/* =========================================================
   style.css (Consolidated / Final)
   - 重複・競合しやすい定義を整理し、後勝ちで「最終意図」が出るように統合
   ========================================================= */

/* =========================
   Base / Reset
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { color: #111; background: #fff; }
* { font-family: 'Mplus 1p', "Hiragino Sans", "Noto Sans JP", sans-serif; }

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* a11y helper */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================
   Layout Containers
========================= */
.container { padding-top: 1rem; }

.main-content {
  max-width: 66.67%;   /* index.html メイン幅 */
  margin: 0 auto;
}

.narrow-content {
  max-width: 40.00%;   /* show/edit の幅 */
  margin: 0 auto;
}

/* index.html が page-grid を持つ時だけ “全幅” 化 */
.main-content:has(.page-grid) {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* =========================
   Header
========================= */
.site-header{
  position: sticky; top:0; z-index:100;
  background:#fff; box-shadow:0 1px 0 rgba(0,0,0,.06);
  width:100%;
  height: 90px;
  display:flex; align-items:center;
  padding: 0 20px;
}

.header-inner {
  width:100%;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
}

.brand { text-decoration:none; color:#111; }
.brand-logo{ height: 80px; width:auto; display:block; }

/* Search pill in header */
.header-search{
  flex:1;
  max-width:700px;
  display:flex;
  align-items:center;
  margin:0 8px;
  position:relative;
}
.header-search input{
  width:100%;
  border:none;
  background:#f3f3f3;
  border-radius:999px;
  padding:10px 72px 10px 16px;  /* 右側にアイコン余白 */
  font-size:16px;
}
.header-search input:focus{
  outline:none;
  box-shadow:0 0 0 2px #a7e6ea;
}

/* Search icon button */
.search-btn{
  position:absolute;
  right:8px;
  width:64px;
  height:64px;
  border:none;
  background:transparent;
  cursor:pointer;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.search-btn svg{ width:22px; height:22px; fill:#6ccbd0; }
.search-btn img.search-icon{
  width:64px;
  height:64px;
  display:block;
  object-fit:contain;
}

/* Right icon row */
.icon-row{
  display:flex;
  align-items:center;
  gap:12px;
}

.icon-btn{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto;
  height:auto;
  background:none;
  border-radius:0;
  padding:0;
  text-decoration:none;
}
.icon-btn:hover{ filter:none; }
.icon-btn:active{ transform: scale(0.96); }
.icon-btn:hover .icon-img{ opacity:0.9; }

.icon-btn .icon-img{
  width:84px;
  height:84px;
  display:block;
  object-fit:contain;
}

/* Avatar + logout / text link */
.avatar-logout{ display:flex; align-items:center; gap:8px; margin-left:2px; }
.logout-link{ color:#333; font-weight:600; text-decoration:none; }
.logout-link:hover{ text-decoration:underline; }
.text-link{ color:#333; font-weight:600; text-decoration:none; padding:8px 6px; }
.text-link:hover{ text-decoration:underline; }

/* User menu */
.usermenu { position: relative; display: inline-block; }
.userbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.userbtn img,
.usermenu .icon-img{
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 50%;
  outline: none !important;
}
.userbtn:focus,
.userbtn:focus-visible,
.userbtn:focus-within,
.usermenu.open .userbtn{
  outline: none !important;
  box-shadow: none !important;
}
.userbtn::-moz-focus-inner { border: 0; }

.userdropdown{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:160px;
  background:#fff;
  border:1px solid rgba(0,0,0,.1);
  border-radius:8px;
  box-shadow:0 4px 12px rgba(0,0,0,.1);
  display:none;
  z-index:1000;
  padding:6px;
}
.usermenu.open .userdropdown{ display:block; }
.userdropdown .menuitem{
  display:block;
  padding:10px 12px;
  color:#333;
  text-decoration:none;
  font-size:14px;
  border-radius:6px;
}
.userdropdown .menuitem:hover{ background:#f4f7f9; }

/* Unread badge on DM icon */
#navDmLink { position: relative; }
#navDmBadge{
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #ff3b30;
  color: #fff;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  z-index: 3;
  pointer-events: none;
}
@media (max-width: 640px){
  #navDmBadge{
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    font-size: 11px; line-height: 18px;
  }
}

/* Mobile header */
@media (max-width:900px){
  .header-search{ max-width:100%; }
  .icon-row{ gap:10px; }
  .logout-link{ display:none; }
}

/* =========================
   Cards / Posts (legacy)
========================= */
.card{
  margin: 0.25rem;
  position: relative;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
}

.blog-body { padding: 1.25em; }

.post-container{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:1rem;
}
.post{
  width:30%;
  margin-bottom:20px;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  border-radius:8px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.post img{ width:100%; height:auto; }
.post-content{ padding:10px; flex-grow:1; position:relative; }

.read-more{
  display:block;
  margin:10px auto;
  padding:8px 16px;
  background-color:#007bff;
  color:white;
  text-decoration:none;
  border-radius:4px;
}
.read-more:hover{ background-color:#0056b3; }

.full-width-img{ width:100%; height:auto; }
.bold-title{ font-weight:bold; font-size:1.5em; }
.show-card-body{ text-align:left; }

/* Reactions */
.reaction-heart{
  font-size:16px;
  color:#cccccc;
  cursor:pointer;
  border: none;
  background: none;
}
.reaction-heart.clicked{ color:#ff0000; }
.reaction-heart:hover{ color:#ff3333; }
.reaction-heart.always-red{ color:#ff0000; }
.reaction-count{
  font-size:16px !important;
  color:#000;
  margin-left:2px;
  display:inline-block;
}

.text-right{ text-align:right; }
.text-left{ text-align:left; }
.large-textarea{ height:400px; }

.creator-reaction-container{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* Quill */
#editor{ height: 320px; }
.ql-editor img{ max-width:100%; height:auto; }

/* =========================
   Home Carousel
========================= */
.home-hero{ width:100%; margin:0 0 28px; padding:0; }
.home-hero .article-carousel{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
}
.article-carousel .swiper-wrapper{ align-items: stretch; }

.article-carousel .swiper-slide{
  width:auto;
  height:auto;
  aspect-ratio:16 / 9;
  border-radius:10px;
  overflow:hidden;
  position:relative;
  flex-shrink:0;
}

.carousel-image{
  width:100%;
  height:100%;
  object-fit:cover;
}

.carousel-caption{
  position:absolute;
  inset:auto 0 0 0;
  background: rgba(0,0,0,.38);
  color:#fff;
  padding:8px 10px;
  font-size:.95rem;
  line-height:1.25;
}

.home-hero .swiper-button-next,
.home-hero .swiper-button-prev{
  color:#007bff;
  top:50%;
  transform:translateY(-50%);
}

@media (max-width:1024px){
  .home-hero .article-carousel{ padding:0 12px; }
}

/* =========================
   2-column page grid (index)
========================= */
.page-grid{
  display:grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap:28px;
  align-items:start;
  padding-inline: clamp(12px, 4vw, 24px);
}

.home-main{ min-width:0; }

/* Sidebar search panel */
.search-sidebar{
  position: sticky;
  top: 92px;  /* header height */
  height: fit-content;
}
.search-panel{
  background:#fff;
  border:1px solid #e6e6e9;
  border-radius:14px;
  padding:18px 16px;
  box-shadow:0 4px 16px rgba(0,0,0,0.04);
  display:flex;
  flex-direction:column;
  gap:18px;
}
.panel-block + .panel-block{
  padding-top:10px;
  border-top: 1px solid #f0f2f6;
}
.panel-title{
  font-size:14px;
  font-weight:700;
  color:#3a3a3c;
  margin:0 0 10px 0;
}
.field-label{
  display:block;
  font-size:12px;
  color:#6b7280;
  margin:6px 0 6px;
}

.text-input,
.select-input{
  width:100%;
  padding:12px 14px;
  border:1px solid #d9dce3;
  border-radius:12px;
  outline:none;
  background:#fff;
  font-size:14px;
  height:42px;
}
.text-input:focus,
.select-input:focus{
  border-color:#7aa7ff;
  box-shadow:0 0 0 3px rgba(122,167,255,0.18);
}

/* select caret + optional left icons */
.select-wrap{ position: relative; }
.select-wrap .select-input{
  appearance:none;
  -webkit-appearance:none;
  padding-right:34px;
}
.select-wrap::after{
  content:"";
  position:absolute;
  right:12px;
  top:50%;
  width:10px; height:10px;
  transform: translateY(-50%) rotate(45deg);
  border-right:2px solid #6b7280;
  border-bottom:2px solid #6b7280;
  pointer-events:none;
}
.select-wrap.icon-person .select-input,
.select-wrap.icon-org .select-input,
.select-wrap.icon-event .select-input{ padding-left:40px; }
.select-wrap.icon-person::before,
.select-wrap.icon-org::before,
.select-wrap.icon-event::before{
  content:"";
  position:absolute;
  left:12px;
  top:50%;
  transform: translateY(-50%);
  width:18px; height:18px;
  opacity:.7;
}
.select-wrap.icon-person::before{
  background: no-repeat center / 100% url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><circle cx='12' cy='8' r='4'/><path d='M4 20c0-4 4-6 8-6s8 2 8 6'/></svg>");
}
.select-wrap.icon-org::before{
  background: no-repeat center / 100% url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path d='M3 21h18M4 21V8l8-5 8 5v13M9 21V12h6v9'/></svg>");
}
.select-wrap.icon-event::before{
  background: no-repeat center / 100% url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4M8 2v4M3 10h18'/></svg>");
}

/* Sidebar submit */
.search-submit{
  margin-top:6px;
  width:100%;
  padding:11px 14px;
  border:none;
  border-radius:12px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  background:#3b82f6;
  color:#fff;
  transition: transform .02s ease, opacity .2s ease;
}
.search-submit:hover{ opacity:.95; }
.search-submit:active{ transform: translateY(1px); }
.search-submit--mint{ background:#5ec6c4; }

/* responsive: grid -> 1 column */
@media (max-width:1024px){
  .page-grid{
    grid-template-columns: 1fr;
    padding-inline: clamp(12px, 4vw, 20px);
  }
  .search-sidebar{
    position: static;
    top:auto;
    order:-1;
  }
  .home-main .section{
    max-width: unset;
    margin: 40px 0;
    padding: 0;
  }
}

/* =========================
   Right column sections
========================= */
.section{
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}
.section-title{
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 1rem;
  border-left: 4px solid #007bff;
  padding-left: 10px;
}

/* =========================
   Category strip
========================= */
.category-strip{
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap:24px;
  padding:12px 4px 8px;
  overflow-x:auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.category-strip::-webkit-scrollbar{ height:8px; }
.category-strip::-webkit-scrollbar-thumb{
  border-radius:9999px;
  background: rgba(0,0,0,.15);
}
.category-pill{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  text-decoration:none;
  user-select:none;
}
.cat-icon{
  width:72px;
  height:72px;
  border-radius:9999px;
  background: radial-gradient(120% 120% at 20% 20%, #d7fff2 0%, #b7f0de 50%, #9be7d7 100%);
  border:1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06) inset;
  background-size: cover;
  background-position: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.category-pill:hover .cat-icon{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12), 0 4px 14px rgba(0,0,0,.06) inset;
}
.cat-label{
  margin-top:8px;
  font-size:12px;
  color:#2b2b2b;
  letter-spacing:.02em;
  white-space:nowrap;
}
.section-title + .category-strip{ margin-top:8px; }

@media (max-width:768px){
  .cat-icon{ width:60px; height:60px; }
  .category-strip{ gap:16px; }
}
@media (min-width:1024px){
  .category-strip{
    display:grid;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap:32px 40px;
    padding-right:0;
  }
  .cat-icon{ width:80px; height:80px; }
  .cat-label{ font-size:13px; }
}

/* =========================
   Buttons (global)
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  text-align:center;
  padding:12px 14px;
  border-radius:10px;
  border:1px solid #e0e0e0;
  cursor:pointer;
}
.btn:hover{ opacity:.9; }

.btn-primary{ background:#2563eb; color:#fff; border-color:#2563eb; }
.btn-outline{ background:#fff; color:#111; }

.btn-ghost{ background:#fff; border-color:#d7dbe6; }
.btn-ghost:hover{ background:#f6f8fc; }

.btn-primary.mint{ background:#5ec6c4; color:#fff; border-color:#5ec6c4; }
.btn-primary.mint:hover{ filter: brightness(.95); }

/* =========================
   Post Editor (new/edit)
========================= */
.post-editor .container{ padding-top:24px; }
.post-editor body,
.post-editor .main-content,
.post-editor .narrow-content{ background:#f5f7fb; }
.post-editor .narrow-content{ max-width:980px; }

.post-editor .editor-surface{
  background:#fff;
  border:1px solid #e6e8ef;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(28,39,64,0.06);
  padding:0;
  overflow:hidden;
}

.post-editor .editor-topbar{
  position: sticky; top:0; z-index:40;
  display:flex;
  justify-content:flex-end; /* 右寄せ */
  align-items:center;
  background:#fff;
  padding:14px 18px;
  border-bottom:1px solid #edf0f5;
}
.editor-breadcrumb .editor-tab{
  display:inline-block;
  margin-right:18px;
  color:#8b90a0;
  text-decoration:none;
  padding-bottom:8px;
  border-bottom:2px solid transparent;
  font-weight:700;
  font-size:14px;
}
.editor-breadcrumb .editor-tab.active{ color:#1b1f2a; border-color:#1b1f2a; }

.editor-actions{
  display:flex;
  gap:8px;
  align-items:center;
  margin-left:auto;
  flex-wrap:wrap;
}

.editor-form{
  max-width:920px;
  margin:0 auto 40px;
  padding:18px;
}

.card-row.two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.card-flex{ display:flex; gap:10px; }
.card-flex.equal > *{ flex:1 1 0; min-width:0; }

.form-label{
  font-weight:700;
  margin-bottom:8px;
  display:block;
  color:#1b1f2a;
}
.form-label .hint{ font-weight:400; color:#9aa1b2; margin-left:4px; }

.form-control{
  width:100%;
  height:40px;
  padding:8px 12px;
  border:1px solid #d9dce6;
  border-radius:10px;
  font-size:14px;
  background:#fff;
}
.form-control:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(147,197,253,0.25);
}
.form-control.small{ max-width:none; height:40px; }

.tag-input-row{ display:flex; gap:8px; align-items:center; }
.tag-chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:9999px;
  font-size:12px;
  font-weight:600;
  line-height:1;
  background:#eef2f7;
  color:#111827;
  border:0;
}
.chip.small{ font-size:11px; padding:4px 8px; }

.chip-x{
  margin-left:6px;
  border:none;
  background:transparent;
  cursor:pointer;
  color:#6b7280;
}

.tag-suggestions.compact{ margin-top:10px; }
.tag-suggestions .tag{
  display:inline-block;
  background:#f3f4f6;
  color:#374151;
  border-radius:9999px;
  padding:6px 10px;
  margin:4px 6px 0 0;
  cursor:pointer;
}

.image-grid{ display:flex; gap:12px; align-items:flex-start; }
.image-thumb{
  position:relative;
  width:220px;
  height:132px;
  border:1px dashed #d1d5db;
  border-radius:10px;
  overflow:hidden;
  background:#f9fafb;
}
.image-thumb img{ width:100%; height:100%; object-fit:cover; }
.image-uploader{
  width:220px;
  height:132px;
  border:2px dashed #cbd5e1;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6b7280;
  cursor:pointer;
  background:#fff;
}
.image-uploader input{ display:none; }
.image-uploader span{ font-size:28px; }
.thumb-remove{
  position:absolute;
  top:6px;
  right:6px;
  border:none;
  width:24px;
  height:24px;
  border-radius:9999px;
  background:#111827;
  color:#fff;
  line-height:24px;
  cursor:pointer;
}

.form-bottom-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:20px;
}

@media (max-width:768px){
  .card-row.two{ grid-template-columns:1fr; }
  .editor-form{ padding:14px; }
}

/* Back button (optional) */
.page-head{
  display:flex;
  align-items:center;
  margin:8px 0 12px;
}
.btn-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  text-decoration:none;
  color:#111;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
}
.btn-back:hover{ background:#f9fafb; }

/* X icon button (black) */
.btn-x{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:9999px;
  background:#111;
  border:1px solid #111;
  color:#fff;
  cursor:pointer;
  transition:background .2s;
}
.btn-x:hover{ background:#333; border-color:#333; }
.btn-x .x-icon{ width:18px; height:18px; fill:#fff; display:block; }

/* Preview modal (entry-like) */
.preview-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.preview-dialog{
  background:#fff;
  width: min(1000px, 100%);
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  position:relative;
}
.preview-dialog--entry{ padding:14px 14px 22px; }
.preview-close{
  position: sticky;
  top: 10px;
  margin-left:auto;
  display:block;
  width:40px;
  height:40px;
  border-radius:999px;
  border:none;
  background:#f2f2f2;
  cursor:pointer;
  font-size:20px;
  line-height:40px;
}
.preview-close:hover{ background:#e9e9e9; }

/* Preview: account chip hide avatar */
.account-chip--noavatar{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.account-chip--noavatar img,
.account-chip--noavatar .avatar-fallback{ display:none !important; }

/* =========================
   Profile (show)
========================= */
.profile-wrap{ max-width: 920px; margin: 24px auto; }
.profile-card{
  background:#fff;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
  padding: 20px 22px;
  position: relative;
}

/* cover */
.profile-cover{
  position: relative;
  width:100%;
  height:180px;
  overflow:hidden;
  border-radius:12px 12px 0 0;
  background:#e9eef5;
}
.profile-cover img,
.profile-cover .cover-fallback{
  width:100%;
  height:100%;
  object-fit:cover;
}
.cover-fallback{
  background: linear-gradient(135deg,#6fb1fc,#4364f7,#0052d4);
}

/* header (coverの下に独立表示) */
.profile-header{
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:16px 20px;
  margin-top:0;
}
.profile-header .avatar{
  width:100px;
  height:100px;
  border-radius:50%;
  border:3px solid #fff;
  overflow:hidden;
  background:#fff;
  flex-shrink:0;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
}
.profile-header .avatar img{ width:100%; height:100%; object-fit:cover; }
.profile-header .head{ flex:1; min-width:0; }
.profile-header .head .name{
  margin:0 0 4px;
  font-size:20px;
  line-height:1.3;
}
.profile-header .head .bio{
  margin:0 0 6px;
  color:#555;
}

.profile-header .right-side{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.profile-header .legend{ white-space:nowrap; }
.profile-header .edit-btn{
  display:inline-block;
  background:#fff;
  border:1px solid #e3e6eb;
  padding:6px 10px;
  border-radius:8px;
  text-decoration:none;
  font-size:14px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

/* legend (strong/weak) */
.profile-card .legend{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:9999px;
  padding:6px 10px;
  line-height:1;
}
.profile-card .legend .legend-title{
  font-size:12px;
  color:#64748b;
  margin-right:2px;
}

/* status row legend placement */
.row--status{ position: relative; }
.row--status .vals{ padding-right:140px; }
.legend-status{
  position:absolute;
  top:8px;
  right:0;
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:9999px;
  padding:6px 10px;
  line-height:1;
  white-space:nowrap;
}

@media (max-width:640px){
  .profile-header{ flex-direction:column; align-items:flex-start; }
  .profile-header .right-side{ align-items:flex-start; }
  .row--status .vals{ padding-right:0; }
  .legend-status{ position:static; margin:6px 0 0 auto; }
}

/* profile body grid (legacy-ish) */
.profile-card .grid{ margin-top:16px; }
.profile-card .row{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:12px;
  padding:10px 0;
  border-top:1px solid #eee;
}
.profile-card .row:first-of-type{ border-top:none; }
.profile-card .label{ color:#666; font-weight:600; padding-top:6px; }
.profile-card .vals{ display:flex; flex-wrap:wrap; gap:10px; }
.bio-long{ white-space:pre-wrap; line-height:1.7; }

.history{ margin-top:28px; }
.history h2{ font-size:18px; margin:18px 0; }
.entry-list{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:12px;
}
.entry-list li{
  display:grid;
  grid-template-columns:1fr 120px;
  gap:12px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid #eee;
}
.entry-list .title{ font-weight:700; color:#333; text-decoration:none; }
.entry-list .thumb{ width:120px; height:72px; object-fit:cover; border-radius:8px; }
@media (max-width:640px){
  .profile-card .row{ grid-template-columns:1fr; }
  .entry-list li{ grid-template-columns:1fr; }
}

/* Chips level colors */
.chip-lvl-2{ background:#3b82f6; color:#fff; }
.chip-lvl-1{ background:#22c55e; color:#fff; }
.chip-lvl-0{ background:#e5e7eb; color:#374151; }

/* =========================
   Profile Edit
========================= */
.profile-shell{
  max-width: 880px;
  margin: 28px auto 80px;
}

.profile-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px;
}
.profile-id{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:14px;
  align-items:center;
}
.avatar{
  width:64px; height:64px;
  border-radius:50%;
  background:#E7F6F8;
  display:grid;
  place-items:center;
  font-size:28px;
  color:#4aa2b5;
  font-weight:700;
  overflow:hidden;
}
.name-input{ width:320px; max-width:100%; }
.subbtns{ display:flex; gap:8px; margin-left:auto; }

.btn-soft{
  border:1px solid #dfe4ea;
  background:#f7f8fa;
  color:#333;
  padding:8px 12px;
  border-radius:12px;
  font-size:14px;
}
.btn-primary-pill{
  background:#49b7c4;
  border:none;
  color:#fff;
  padding:10px 14px;
  border-radius:14px;
  font-weight:600;
}
.btn-primary-pill:disabled{ opacity:.5; }

.form-title{ font-size:13px; color:#666; margin:12px 0 6px; }
.input, .textarea{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  background:#fff;
}
.textarea{ min-height:84px; resize: vertical; }

.section{
  margin-top:18px;
  padding-top:12px;
  border-top:1px dashed #eee;
}
.section-title{
  font-size:14px;
  font-weight:700;
  color:#333;
  margin:6px 0 10px;
}
.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
@media (max-width:800px){
  .grid-2{ grid-template-columns:1fr; }
}

/* tri-state chips */
.chip.tri{
  display:inline-block;
  padding:6px 10px;
  margin:6px 8px 0 0;
  border-radius:9999px;
  border:1px solid #d0d7de;
  background:#fff;
  font-size:14px;
  cursor:pointer;
  user-select:none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.chip.tri.lvl-0{ background:#fff; color:#111; border-color:#d0d7de; }
.chip.tri.lvl-2{ background:#1d9bf0; color:#fff; border-color:#1d9bf0; }
.chip.tri.lvl-1{ background:#20c997; color:#fff; border-color:#20c997; }
.chip.tri:focus{ outline:none; box-shadow:0 0 0 3px rgba(29,155,240,.25); }

.rowflex{ display:flex; gap:8px; margin-bottom:8px; }
.rowflex .input{ flex:1; }
.btn-line{ border:1px solid #cfd6dd; background:#fff; border-radius:10px; padding:6px 10px; }

.footer-actions{ display:flex; justify-content:flex-end; margin-top:18px; }

/* 名前入力を広げる（アバター無しも含む） */
.profile-head .profile-id:not(:has(.avatar)){
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
.profile-head .name-input{
  width:auto;
  max-width:none;
  flex:1 1 auto;
}
.profile-head .name-input .input{
  width:100%;
  max-width:500px;
}

/* =========================
   Signup Overlay
========================= */
.signup-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
.signup-overlay.is-open{ display:flex; }

.signup-overlay__panel{
  width: min(560px, 92vw);
  background:#fff;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.2);
  padding:28px 24px 22px;
  position:relative;
}
.signup-overlay__close{
  position:absolute;
  top:8px;
  right:10px;
  background:transparent;
  border:0;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  color:#666;
}
.signup-overlay__title{ margin:0 0 8px; font-size:22px; font-weight:700; }
.signup-overlay__lead{ margin:0 0 18px; color:#444; }
.signup-overlay__actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width:420px){
  .signup-overlay__actions{ grid-template-columns:1fr; }
}

/* =========================
   Entry Article (show entry)
========================= */
.entry-article{
  max-width:800px;
  margin:40px auto;
  background:#fff;
  border-radius:12px;
  padding:40px 50px;
  box-shadow:0 2px 6px rgba(0,0,0,0.08);
  position:relative;
}
.entry-header{ margin-bottom:16px; }

.entry-tags{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.entry-tags .tag{
  background:#f5f5f5;
  border-radius:16px;
  padding:4px 10px;
  font-size:12px;
  color:#555;
  cursor: default;
}

.entry-title{
  margin:0;
  font-size:26px;
  font-weight:700;
  line-height:1.4;
  word-break:break-word;
}

/* 投稿日時：カード右上 */
.entry-date-top{
  position:absolute;
  top:16px;
  right:24px;
  font-size:13px;
  color:#888;
  line-height:1;
  white-space:nowrap;
}

.entry-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:14px;
  color:#888;
}
.author-info{
  display:flex;
  align-items:center;
  gap:8px;
}
.author-avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  object-fit:cover;
}

.entry-mainimg{
  position:relative;
  overflow:hidden;
  border-radius:10px;
}
.entry-mainimg img{
  width:100%;
  display:block;
  border-radius:10px;
  margin:20px 0;
}

/* image labels */
.entry-labels{
  position:absolute;
  top:12px;
  left:12px;
  display:flex;
  gap:8px;
  z-index:2;
}

/* pills (base) */
.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:600;
  line-height:1;
  letter-spacing:.02em;
  color:#fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.15),
    0 2px 6px rgba(0,0,0,.10);
  background: linear-gradient(135deg, var(--c1, #9ecbff), var(--c2, #6aa8ff));
}
.pill:hover{ filter: brightness(1.06); }

/* type colors */
.pill-event{      --c1:#89c9ff; --c2:#3d89ff; }
.pill-area{       --c1:#7fe2c0; --c2:#43b689; }
.pill-cost{       --c1:#f9c66a; --c2:#f78a2a; }
.pill-duration{   --c1:#b6a8f2; --c2:#8c79e8; }
.pill-deadline{   --c1:#ff9aa8; --c2:#ff5b6b; }
.pill-flag--youth{     --c1:#8dc6ff; --c2:#5aa5ff; }
.pill-flag--allowance{ --c1:#ffd271; --c2:#f5a623; }

/* optional per-event/per-area class hooks (if you use them) */
.pill-event--ワークショップ { --c1:#ff8a8a; --c2:#ffb86b; }
.pill-event--オーディション { --c1:#a78bfa; --c2:#60a5fa; }
.pill-event--公演           { --c1:#34d399; --c2:#22d3ee; }
.pill-event--スタッフ募集   { --c1:#f59e0b; --c2:#f97316; }

.entry-body{ line-height:1.8; color:#333; }

/* Share chips bottom */
.entry-share-bottom{ display:flex; gap:10px; align-items:center; }

.share-chip{
  --brand:#5b6675;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border:1px solid #dfe4ea;
  border-radius:9999px;
  background:#fff;
  color: var(--brand);
  text-decoration:none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.share-chip svg{ width:18px; height:18px; fill: currentColor; }
.share-chip--x:hover{ background:#111; border-color:#111; color:#fff; }
.share-chip--fb:hover{ background:#1877f2; border-color:#1877f2; color:#fff; }
.share-chip:focus-visible{ outline:none; box-shadow:0 0 0 3px rgba(56,189,248,.35); }

@media (max-width:520px){
  .share-chip{ width:40px; height:40px; }
  .share-chip svg{ width:20px; height:20px; }
}

/* CTA buttons (entry bottom) */
.entry-cta{
  margin-top:28px;
  padding-top:20px;
  border-top:1px solid #edf0f5;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
  text-align:center;
}
.cta-btn{
  --mint:#49b7c4;
  --mint-ink:#0e7f86;
  --ink:#374151;
  --border:#e5e7eb;

  display:inline-flex;
  align-items:center;
  gap:10px;
  height:40px;
  padding:0 14px 0 10px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  text-decoration:none;
  border:1px solid var(--border);
  background:#fff;
  color:var(--ink);
  box-shadow:0 1px 0 rgba(0,0,0,.04);
  transition: transform .04s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  cursor:pointer;
}
.cta-btn:focus{ outline:none; box-shadow:0 0 0 3px rgba(73,183,196,.25); }
.cta-btn:active{ transform: translateY(1px); }

.cta-badge{
  width:26px; height:26px;
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  background:#f5f7fb;
  border:1px solid #e9edf3;
}
.cta-icn{ width:16px; height:16px; display:block; fill: currentColor; }

/* Ask (black) */
.cta-ask{
  background:#111;
  color:#fff;
  border-color:#111;
}
.cta-ask .cta-badge{
  background:#fff;
  border-color:#fff;
  color:#111;
}
.cta-ask:hover{ background:#333; border-color:#333; }

/* Keen (mint outline) */
.cta-keen{
  color: var(--mint-ink);
  border-color:#bfe9e6;
  background:#fff;
}
.cta-keen .cta-badge{
  background:#eaf7f6;
  border-color:#d4efed;
  color: var(--mint-ink);
}
.cta-keen:hover{
  background:#f6fdfc;
  border-color:#aee3e0;
}

/* Entry (mint filled) */
.cta-entry{
  background: var(--mint);
  border-color: var(--mint);
  color:#fff;
  box-shadow:0 2px 8px rgba(73,183,196,.25);
}
.cta-entry .cta-badge{
  background:#fff;
  border-color: rgba(255,255,255,.85);
  color: var(--mint);
}
.cta-entry:hover{ filter: brightness(.96); }

.cta-btn.is-disabled,
.cta-btn.cta-entry.is-disabled{
  opacity:.45;
  pointer-events:none;
  cursor:not-allowed;
}
.cta-btn.cta-entry.sent{ background:#e5f5ff; }

/* Author block */
.entry-author-block{
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:24px 16px;
  margin:32px 0;
  background:#fafafa;
  border-radius:12px;
  box-shadow:0 1px 3px rgba(0,0,0,0.05);
}
.author-avatar-large{
  width:96px;
  height:96px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #e0e0e0;
}
.author-profile-text{ flex:1; }
.author-name{ font-weight:bold; font-size:1.1rem; margin-bottom:4px; }
.author-bio{ margin:4px 0; color:#555; line-height:1.5; }
.author-career{ margin-top:8px; color:#777; font-size:.9rem; }

/* Comments */
.entry-comments{
  margin-top:40px;
  padding-top:24px;
  border-top:1px solid #eee;
}
.entry-comments h3{
  font-size:1.3rem;
  margin-bottom:20px;
  font-weight:600;
}
.comment-item{
  display:flex;
  align-items:flex-start;
  margin-bottom:20px;
  gap:12px;
}
.comment-avatar img{
  width:48px;
  height:48px;
  border-radius:50%;
  object-fit:cover;
  background:#f5f5f5;
}
.comment-body{
  flex:1;
  background:#fafafa;
  border-radius:10px;
  padding:12px 16px;
}
.comment-header{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:4px;
}
.comment-username{ font-weight:600; color:#333; }
.comment-date{ font-size:.85rem; color:#888; }
.comment-text{ margin:0; line-height:1.6; color:#444; }

.comment-form{
  margin-top:24px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.comment-form textarea{
  resize:vertical;
  padding:10px;
  border:1px solid #ddd;
  border-radius:8px;
}
.comment-form button{
  align-self:flex-end;
  background-color:#007aff;
  color:#fff;
  border:none;
  padding:8px 16px;
  border-radius:6px;
  cursor:pointer;
}
.comment-form button:hover{ background-color:#005fcc; }

/* Entry labels line above tags */
.entry-toplabels{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:8px 0 12px;
}

@media (max-width:480px){
  .entry-labels{ top:10px; left:10px; gap:6px; }
  .pill{ font-size:11px; padding:5px 9px; }
}

/* =========================
   Search Page (dedicated)
========================= */
.search-page{
  max-width:1000px;
  margin:0 auto;
  padding:40px 20px;
  color:#333;
}

.search-box{
  background:#fff;
  border-radius:20px;
  box-shadow:0 2px 8px rgba(0,0,0,0.06);
  padding:36px 40px;
  margin-bottom:60px;
}

.search-title{
  text-align:center;
  font-size:22px;
  font-weight:600;
  color:#5ec6c4;
  margin-bottom:20px;
  letter-spacing:.04em;
}

/* freeword */
.search-freeword{ position:relative; margin-bottom:30px; }
.search-freeword input{
  width:100%;
  border:1.5px solid #b6e4e4;
  border-radius:9999px;
  padding:12px 45px 12px 20px;
  font-size:15px;
  outline:none;
}
.search-freeword input:focus{
  border-color:#30bcbc;
  box-shadow:0 0 0 2px rgba(48,188,188,0.1);
}
.search-freeword .search-icon{
  position:absolute;
  right:16px;
  top:50%;
  transform: translateY(-50%);
  background:none;
  border:none;
  color:#30bcbc;
  font-size:18px;
}

/* selects & filters: stacked */
.search-box .search-selects.stacked-selects{
  display:grid;
  grid-template-columns: 1fr;
  row-gap:18px;
  justify-content: initial;
}
.search-box .stacked-selects .card-flex.equal{
  display:flex;
  flex-direction: row;
  gap:12px;
}
.search-box .stacked-selects .card-flex.equal > .select-wrap{
  flex:1 1 0;
  min-width:0;
}
@media (max-width:768px){
  .search-box .stacked-selects .card-flex.equal{ flex-direction:column; }
}

/* filters stacked */
.search-box .search-filters,
.search-box .search-filters.stacked{
  display:grid;
  grid-template-columns: 1fr;
  row-gap:18px;
}

.group-label{
  display:block;
  font-weight:700;
  color:#3a3a3c;
  margin-bottom:8px;
}
.checkbox-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  justify-content:flex-start;
}

/* check chip */
.check-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid #e3edf0;
  border-radius:999px;
  margin:4px;
  cursor:pointer;
  background:#f6fafb;
  color:#475569;
  transition: background .15s, border-color .15s;
}
.check-chip:hover{ background:#eef7f8; border-color:#d6eaed; }
.check-chip input{ accent-color:#5ec6c4; }

/* actions */
.search-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-top:16px;
}
.search-actions .btn{
  min-width:140px;
  height:40px;
  padding:0 16px;
  border-radius:999px;
  font-weight:600;
}
.btn-outlined{
  background:#fff;
  color:#46b4a9;
  border-color:#46b4a9;
}
.btn-outlined:hover{ background: rgba(70,180,169,.08); }
.search-actions .btn-primary{
  background:#46b4a9;
  border-color:#46b4a9;
}

/* results cards */
.result-list{ display:grid; gap:16px; }

.result-card{
  display:flex;
  gap:20px;
  align-items:flex-start;
  background:#fff;
  border:1px solid rgba(0,0,0,.06);
  border-radius:12px;
  padding:16px;
}
.result-card:hover{
  box-shadow:0 4px 18px rgba(0,0,0,.06);
  transform: translateY(-1px);
  transition: .15s ease;
}

/* thumb right */
.card-thumb{
  flex:0 0 180px;
  aspect-ratio:4 / 3;
  border-radius:12px;
  overflow:hidden;
  display:block;
  background:#f2f4f7;
}
.card-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}

/* main */
.card-main{ flex:1 1 auto; min-width:0; }
.result-labels{ display:flex; flex-wrap:wrap; gap:6px; }
.result-title{
  font-size:18px;
  font-weight:700;
  margin:2px 0 0;
  line-height:1.4;
}
.result-title a{ color:#1b66d1; text-decoration:none; }
.result-title a:hover{ text-decoration:underline; }
.result-meta{
  color:#667085;
  font-size:13px;
  display:flex;
  gap:6px;
}
.result-desc{
  font-size:14px;
  color:#111;
  margin:2px 0 0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.result-org{
  margin-top:6px;
  display:flex;
  align-items:center;
  gap:8px;
  color:#475467;
  font-size:14px;
}
.result-org .org-icon{
  width:28px;
  height:28px;
  border-radius:50%;
  object-fit:cover;
  flex:0 0 auto;
}
.result-org .org-name{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media (max-width:768px){
  .result-card{ flex-direction:column; }
  .card-thumb{
    width:100%;
    flex-basis:auto;
    aspect-ratio:16 / 9;
  }
}

/* =========================
   DM (Direct Message)
========================= */
.dm-layout{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:24px;
  min-height:70vh;
}
.dm-sidebar{ border-right:1px solid #eee; padding-right:16px; }

.dm-search{
  display:flex;
  align-items:center;
  gap:8px;
  background:#f5f7f9;
  border-radius:999px;
  padding:10px 14px;
  margin:8px 0;
}
.dm-search input{
  border:none;
  background:transparent;
  outline:none;
  width:100%;
}

.dm-conv-list{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* conversation row */
.dm-conv-item{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:10px 12px 10px 26px; /* dot space */
  border-radius:10px;
  background:#f7f9fb;
  border:none;
  text-align:left;
  cursor:pointer;
}
.dm-conv-item:hover{ background:#f6fafb; }
.dm-conv-item.active{ background:#eaf7ff; }

.dm-conv-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  object-fit:cover;
  flex-shrink:0;
}

.dm-conv-name{ flex:1; font-weight:600; }
.dm-conv-time{ color:#8899aa; font-size:12px; }
.dm-conv-snippet{
  font-size:12px;
  color:#6b7280;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:420px;
}

/* unread dot */
.dm-conv-unread{
  position:absolute;
  left:10px;
  top:50%;
  transform: translateY(-50%);
  width:10px;
  height:10px;
  border-radius:9999px;
  background:#ff3b30;
  box-shadow:0 0 0 2px #fff;
  opacity:0;
  transition: opacity .15s ease;
}
.dm-conv-unread.is-visible{ opacity:1; }

.dm-thread{
  display:flex;
  flex-direction:column;
  min-height:70vh;
}
.dm-thread-header{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  padding:8px 0;
  margin-bottom:8px;
  border-bottom:1px solid #eee;
}
.dm-thread-avatar{
  width:32px;
  height:32px;
  border-radius:50%;
  object-fit:cover;
  flex-shrink:0;
}

.dm-thread-body{
  flex:1;
  overflow:auto;
  padding:12px;
}
.dm-thread-body.empty{ color:#9aa1a9; }

/* bubbles */
.dm-msg{ display:flex; margin:6px 0; }
.dm-msg.other{ justify-content:flex-start; }
.dm-msg.me{ justify-content:flex-end; }
.dm-msg .bubble{
  max-width:70%;
  padding:10px 12px;
  border-radius:14px;
  line-height:1.5;
  background:#f0f3f5;
}
.dm-msg.me .bubble{ background:#dff4ff; }

.dm-send{
  display:flex;
  gap:10px;
  border-top:1px solid #eee;
  padding-top:8px;
}
.dm-send input{
  flex:1;
  border:1px solid #e5e7eb;
  border-radius:999px;
  padding:10px 14px;
}
.dm-send .btn-send{
  border:none;
  background:#10b981;
  color:#fff;
  border-radius:999px;
  padding:0 14px;
}

/* floating action button */
.dm-fab{
  position:fixed;
  right:28px;
  bottom:28px;
  width:56px;
  height:56px;
  border-radius:50%;
  border:none;
  background:#10b981;
  color:#fff;
  box-shadow:0 10px 20px rgba(0,0,0,.15);
  font-size:20px;
}

/* modal */
.dm-modal.hidden{ display:none; }
.dm-modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.36);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}
.dm-modal-content{
  width:520px;
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.2);
}
.dm-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid #eee;
  font-weight:700;
}
.dm-user-search{ padding:12px 16px; }
.dm-user-result{
  max-height:300px;
  overflow:auto;
  margin-top:8px;
  border:1px solid #eee;
  border-radius:12px;
}
.dm-user-row{ padding:10px 12px; cursor:pointer; }
.dm-user-row:hover{ background:#f6fafb; }

.dm-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:12px 16px;
  border-top:1px solid #eee;
}

/* =========================
   Misc
========================= */
.hint.right{
  display:flex;
  justify-content:flex-end;
  margin-top:6px;
  color:#889;
}


/* ===== おすすめ/人気：左右余白なし + できるだけ多く表示 ===== */

/* セクションの左右paddingが強い場合はゼロに（必要なら） */
.home-main .section{
  padding-left: 0;
  padding-right: 0;
}

/* 横スライダー本体 */
.home-main .section .entry-row{
  display: grid;
  grid-auto-flow: column;

  /* ★ ここがポイント：1枚の幅を固定/可変にして、広い画面ほど見える枚数が増える */
  grid-auto-columns: clamp(160px, 14vw, 210px);

  gap: 12px;                 /* 余白を少し詰めると表示枚数が増える */
  overflow-x: auto;
  overflow-y: hidden;

  padding: 0 0 12px;         /* ← 左右を0にして“余白なし”に */
  margin: 0;                 /* 念のため */

  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* カードはスナップ対象 */
.home-main .section .entry-row .entry-card{
  width: 100%;
  max-width: none;
  flex: none;
  scroll-snap-align: start;
}

/* 画像の高さは揃える（好みで調整） */
.home-main .section .entry-card img{
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

/* =========================================================
   HOME: おすすめ/人気（大きめカード + 余白少なめ + 横スクロール）
   ※ style.css の一番下に置いて “後勝ち” させる
========================================================= */

/* 右カラムの section を「右カラム幅いっぱい」にする（中央寄せ/左右paddingを撤去） */
.home-main > .section{
  max-width: none;
  margin: 24px 0;      /* 好みで */
  padding: 0;          /* ← ここが左右余白を消す本体 */
}

/* タイトルも右カラムの端に揃える */
.home-main > .section .section-title{
  margin-left: 0;
  margin-right: 0;
}

/* 横スライダー（折り返さない） */
.home-main > .section .entry-row{
  display: grid;
  grid-auto-flow: column;

  /* ★ カード幅：ここを大きめにすると「小さくなりすぎ」を解消できる */
  grid-auto-columns: clamp(220px, 18vw, 300px);

  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;

  padding: 0 0 12px;   /* 左右は 0（＝余白なし） */
  margin: 0;

  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* カードはグリッドに従う（width固定やmax-widthを無効化） */
.home-main > .section .entry-card{
  width: auto;
  max-width: none;
  flex: none;

  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);

  scroll-snap-align: start;
}

/* 画像は少し高さを上げて “大きく見せる” */
.home-main > .section .entry-card img{
  width: 100%;
  height: 160px;      /* 130px → 160px くらいにすると見栄えが近づく */
  object-fit: cover;
  display: block;
}

/* スクロールバーを目立たせない（任意） */
.home-main > .section .entry-row::-webkit-scrollbar{ height: 8px; }
.home-main > .section .entry-row::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.15);
  border-radius: 999px;
}

/* 画面が狭いときはカード幅を少し下げる */
@media (max-width: 900px){
  .home-main > .section .entry-row{
    grid-auto-columns: clamp(200px, 60vw, 260px);
  }
  .home-main > .section .entry-card img{ height: 150px; }
}

/* ===== おすすめ/人気（横スライダー）の文字を控えめに ===== */
.home-main .section .entry-card .entry-info{
  padding: 10px 12px 12px; /* ついでに少しだけ詰める（任意） */
}

.home-main .section .entry-card .entry-info h5{
  margin: 0 0 6px;
  font-size: 13px;     /* ←小さく */
  font-weight: 600;    /* ←太すぎを回避（700→600） */
  line-height: 1.35;
  letter-spacing: 0;
}

.home-main .section .entry-card .entry-info p{
  margin: 0 0 10px;
  font-size: 11px;     /* ←作成者を少し小さく */
  font-weight: 400;    /* ←細め */
  opacity: .78;
}

/* タイトルが長いとき2行で省略（欲しければ） */
.home-main .section .entry-card .entry-info h5{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== おすすめ / 人気：続きを読むボタンを小さく ===== */
.home-main .section .entry-card .read-more{
  display: inline-block;
  padding: 6px 10px;        /* ← 高さを小さく */
  font-size: 11px;          /* ← 文字サイズ */
  font-weight: 600;         /* ← 少しだけ強調 */
  border-radius: 8px;       /* ← 角を少し丸める */
  line-height: 1.2;

  /* 既存の青色はそのまま */
}

/* ボタンが横いっぱいに伸びていた場合の保険 */
.home-main .section .entry-card .read-more{
  width: auto;
}

/* ===== 検索結果：タブ（全て表示/受付中）＋並び替え ===== */
.results-tabs {
  margin-top: 10px;
}

.results-tabs .tab-form{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* タブボタン */
.results-tabs .tab{
  appearance: none;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: #222;
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;   /* 太すぎるなら 500 に */
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

.results-tabs .tab:hover{
  border-color: #d7d7d7;
}

.results-tabs .tab:active{
  transform: translateY(1px);
}

/* アクティブ（画像2の左の“全て表示”みたいなやつ） */
.results-tabs .tab.active{
  background: #35b7b3;     /* ここはサイトのメインカラーに合わせて微調整OK */
  border-color: transparent;
  color: #fff;
}

/* 並び替えセレクト（新着順） */
.results-tabs .sort-select{
  border: 1px solid #e6e6e6;
  background: #fff;
  color: #222;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;   /* 太すぎるなら 500 に */
  line-height: 1;
  cursor: pointer;
}

/* ===== profile: ラベル列を少し広げて改行させない ===== */
.profile-card .grid .row{
  /* すでに display:flex の場合もあるので、gridで揃える */
  display: grid;
  grid-template-columns: clamp(170px, 22%, 220px) 1fr; /* ← ラベル列を横長に */
  column-gap: 16px;
  align-items: center;
}

.profile-card .grid .row .label{
  white-space: nowrap;        /* ← 改行しない */
  overflow: hidden;           /* 万一長すぎたら */
  text-overflow: ellipsis;    /* …にする */
}

/* 右上の凡例がある行（row--status）は右端に凡例が乗るので3列に */
.profile-card .grid .row--status{
  grid-template-columns: clamp(170px, 22%, 220px) 1fr auto;
}

/* =========================================================
   Mobile fixes (append to END of style.css)
   - PCはそのまま / モバイルだけ崩れを止める
========================================================= */

@media (max-width: 640px){

  /* --- 基本：横はみ出し防止 --- */
  html, body { overflow-x: hidden; }
  .container { padding-top: 8px; }

  /* --- “%幅”指定がモバイルで細すぎるので、モバイルだけ全幅へ --- */
  .main-content,
  .narrow-content{
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 12px !important;
  }

  /* post-editor の narrow-content は既に 980px なので、モバイルでは詰める */
  .post-editor .narrow-content{
    padding: 0 10px !important;
  }

  /* --- Header：高さと中身を縮める（PCはそのまま） --- */
  .site-header{
    height: 64px;
    padding: 0 12px;
  }
  .brand-logo{
    height: 40px;
  }

  /* 検索ピルをコンパクトに */
  .header-search{
    max-width: none;
    margin: 0 6px;
  }
  .header-search input{
    font-size: 15px;
    padding: 10px 44px 10px 14px;
  }
  .search-btn{
    width: 44px;
    height: 44px;
    right: 6px;
  }
  .search-btn img.search-icon{
    width: 44px;
    height: 44px;
  }

  /* 右上のアイコン列が横幅を食い潰すのでモバイルでは隠す（※ハンバーガー化前提） */
  .icon-row{
    display: none !important;
  }

  /* --- 既存の “section padding” が強いときの保険 --- */
  .section{
    padding: 0 12px;
  }

  /* --- 記事（show entry） --- */
  .entry-article{
    max-width: 100%;
    margin: 18px auto;
    padding: 18px 14px;
  }
  .entry-date-top{
    position: static;
    margin-top: 6px;
    text-align: right;
    display: block;
  }
  .entry-title{ font-size: 22px; }

  /* --- Profile --- */
  .profile-wrap{ margin: 16px auto; padding: 0 12px; }
  .profile-card{ padding: 16px 14px; }
}

/* =========================================================
   Mobile: Search sidebar -> off-canvas drawer (optional)
   body に .sidebar-open を付けると開く
========================================================= */

@media (max-width: 640px){

  /* page-grid は1カラムになってるが、検索が長すぎるので “収納” できるようにする */
  .search-sidebar{
    position: fixed !important;
    top: 64px;            /* header 高さに合わせる */
    left: 0;
    bottom: 0;
    width: min(92vw, 420px);
    z-index: 2000;
    transform: translateX(-110%);
    transition: transform .2s ease;
    padding: 10px 10px 14px;
    overflow: auto;
    background: transparent;
  }

  /* 開いている状態 */
  body.sidebar-open .search-sidebar{
    transform: translateX(0);
  }

  /* パネルはドロワーらしく */
  .search-panel{
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    border-radius: 16px;
  }

  /* 背景の暗幕（疑似的に） */
  body.sidebar-open::before{
    content:"";
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 1999;
  }

  /* “閉じる”用の×ボタンを置きたい場合の枠（HTML追加できるなら） */
  .search-drawer-close{
    position: sticky;
    top: 0;
    margin-left: auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #f2f2f2;
    cursor: pointer;
    display: none;
  }
  body.sidebar-open .search-drawer-close{ display: block; }
}

/* =========================================================
   Mobile: DM layout fix
========================================================= */
@media (max-width: 640px){
  .dm-layout{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dm-sidebar{
    border-right: none;
    padding-right: 0;
  }
  .dm-conv-snippet{
    max-width: 100%;
  }
  .dm-thread-body{
    padding: 10px;
  }
  .dm-msg .bubble{
    max-width: 82%;
  }
}

/* =========================================================
   Mobile hamburger menu
========================================================= */

.hamburger-btn{
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 10px 8px;
  cursor: pointer;
}

.hamburger-drawer{
  display: none;
}

@media (max-width: 640px){
  /* 右上アイコン列は隠す（既に入ってるならOK） */
  .icon-row{ display:none !important; }

  /* ハンバーガーは表示 */
  .hamburger-btn{ display: inline-flex; align-items:center; justify-content:center; }

  /* ドロワー（画面全体の暗幕＋パネル） */
  .hamburger-drawer{
    display: block;
    position: fixed;
    inset: 64px 0 0 0;  /* headerの下から */
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
  }
  body.menu-open .hamburger-drawer{
    pointer-events: auto;
    opacity: 1;
  }
  .hamburger-drawer::before{
    content:"";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
  }

  .hamburger-panel{
    position: absolute;
    top: 10px;
    right: 10px;
    width: min(92vw, 360px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    overflow: hidden;
  }

  .hamburger-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
  }
  .hamburger-close{
    border:0;
    background:transparent;
    font-size: 26px;
    line-height: 1;
    padding: 0 6px;
    cursor:pointer;
  }

  .hamburger-links{
    padding: 10px 8px 12px;
  }
  .hamburger-links a{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    color: #222;
    text-decoration: none;
  }
  .hamburger-links a:hover{
    background: #f6f6f6;
  }
  .hamburger-links hr{
    margin: 10px 8px;
  }
}

/* ===== profile: モバイルでは「凡例 → 活動ステータス」を縦並びにする ===== */
@media (max-width: 640px){

  /* row--status を grid-area で並び替える */
  .profile-card .grid .row--status{
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "legend"
      "label"
      "vals";
    row-gap: 8px;
    align-items: start;
  }

  .profile-card .grid .row--status .label{
    grid-area: label;
  }

  .profile-card .grid .row--status .vals{
    grid-area: vals;
  }

  .profile-card .grid .row--status .legend-status{
    grid-area: legend;
    justify-self: end;   /* 右寄せ（左寄せにしたいなら start） */
    margin: 0;           /* 既存の margin:6px 0 0 auto を打ち消す */
  }
}

/* =========================================================
   iPad / Tablet fixes (PC・スマホは維持)
   - 641px〜1024px を “タブレット帯” として幅だけ広げる
========================================================= */
@media (min-width: 641px) and (max-width: 1024px){

  /* %指定だと細くなりすぎるので、タブレットは px/vw ベースに */
  .main-content{
    max-width: min(1200px, 96vw);
    width: 100%;
    margin: 0 auto;
  }

  .narrow-content{
    max-width: min(920px, 92vw);
    width: 100%;
    margin: 0 auto;
  }

  /* index の2カラム：iPadは「まだ2カラムでいける」ので余白だけ調整（必要なら） */
  .page-grid{
    padding-inline: 20px;
    gap: 20px;
    grid-template-columns: 320px minmax(0, 1fr);
  }

  /* ★重要：post-editor は「同じ要素にクラスが付いている」ケースがあるので子孫ではなく同要素指定で効かせる */
  .narrow-content.post-editor{
    max-width: min(980px, 92vw);
  }

  /* profile など中の max-width が効くように、親幅を確保した上で念のため */
  .profile-wrap{
    width: 100%;
  }
}