/* JP-S2 (jp-s3-1) discovery-first home: tab switcher, compact editorial hero, dense 2:3 art grid, My Chats strip.
   GH tokens only (shell.css). Floors: controls >=32px desktop / >=44px + 12px text at <=650; labels >=11px. */
.home-s2{padding-top:var(--gh-space-4)}

/* tab switcher (roving tablist) */
.home-tabs{display:inline-flex;gap:var(--gh-space-1);padding:var(--gh-space-1);margin:0 0 var(--gh-space-4);border:1px solid var(--gh-color-line);border-radius:var(--gh-radius-lg);background:var(--gh-color-surface);max-width:100%;box-sizing:border-box}
.home-tab-wrap{position:relative;display:inline-flex}
.home-tab{min-height:var(--gh-control-h);padding:0 var(--gh-space-4);border:1px solid transparent;border-radius:var(--gh-radius-md);background:transparent;color:var(--gh-color-muted);font-size:var(--gh-font-md);font-weight:600;white-space:nowrap;cursor:pointer}
.home-tab:hover{color:var(--gh-color-text);background:var(--gh-color-raised)}
.home-tab.is-selected{color:var(--gh-color-text);background:var(--gh-color-purple-soft);border-color:var(--gh-color-purple)}
.home-tab.is-disabled{color:var(--gh-color-dim);cursor:not-allowed}
.home-tab.is-disabled:hover{background:transparent;color:var(--gh-color-dim)}
.home-tab:focus-visible{outline:2px solid var(--gh-color-focus);outline-offset:2px}
.home-tab-tip{position:absolute;left:0;top:calc(100% + 6px);z-index:20;width:max-content;max-width:240px;padding:var(--gh-space-2) var(--gh-space-3);border:1px solid var(--gh-color-line-strong);border-radius:var(--gh-radius-md);background:var(--gh-color-overlay);color:var(--gh-color-text);font-size:var(--gh-font-sm);line-height:1.4;font-weight:400;white-space:normal;box-shadow:0 8px 24px rgba(0,0,0,.5);visibility:hidden;opacity:0;transition:opacity .12s ease;pointer-events:none}
.home-tab-wrap:hover .home-tab-tip,.home-tab-wrap:focus-within .home-tab-tip,.home-tab-wrap.show-tip .home-tab-tip{visibility:visible;opacity:1}
@media (prefers-reduced-motion:reduce){.home-tab-tip{transition:none}}

/* compact editorial hero: headline + one-line promise; access is a small secondary link */
.home-hero{margin:0 0 var(--gh-space-5);padding:0}
.home-hero-title{margin:0;font-size:clamp(28px,3.4vw,44px);line-height:1.08;font-weight:700;letter-spacing:-.02em;color:var(--gh-color-text)}
.home-hero-promise{margin:var(--gh-space-2) 0 0;font-size:var(--gh-font-lg);line-height:1.45;color:var(--gh-color-muted);max-width:60ch}
.home-hero-meta{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-space-2);margin:var(--gh-space-2) 0 0;font-size:var(--gh-font-sm);color:var(--gh-color-dim)}
.home-hero-link{min-height:var(--gh-control-min);padding:0 var(--gh-space-1);border:0;background:none;color:var(--gh-color-pink);font-size:var(--gh-font-sm);font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.home-hero-link:hover{color:var(--gh-color-text)}
.home-hero-link:focus-visible{outline:2px solid var(--gh-color-focus);outline-offset:2px;border-radius:var(--gh-radius-sm)}

/* grid head: heading, real shown count, collapsible filters */
.home-grid-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-space-3);margin:0 0 var(--gh-space-3)}
.home-grid-head h2{margin:0;font-size:var(--gh-font-xl);font-weight:700}
.home-grid-head .cast-shown-count{font-size:var(--gh-font-sm);color:var(--gh-color-dim);letter-spacing:0;text-transform:none}
.home-filters{margin-left:auto}
.home-filters>summary{display:inline-flex;align-items:center;min-height:var(--gh-control-h);padding:0 var(--gh-space-3);border:1px solid var(--gh-color-line-strong);border-radius:var(--gh-radius-md);color:var(--gh-color-text);font-size:var(--gh-font-md);font-weight:600;cursor:pointer;list-style:none}
.home-filters>summary::-webkit-details-marker{display:none}
.home-filters>summary::after{content:'';width:6px;height:6px;margin-left:var(--gh-space-2);border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px)}
.home-filters[open]>summary::after{transform:rotate(-135deg) translateY(-1px)}
.home-filters>summary:focus-visible{outline:2px solid var(--gh-color-focus);outline-offset:2px}
.home-filters[open]{flex:1 1 100%;margin-left:0;order:3}
.home-filters-body{display:grid;gap:var(--gh-space-2);margin-top:var(--gh-space-2);padding:var(--gh-space-3);border:1px solid var(--gh-color-line);border-radius:var(--gh-radius-lg);background:var(--gh-color-surface)}
.home-filters-body .filters,.home-filters-body .tag-filters{display:flex;flex-wrap:wrap;gap:var(--gh-space-2);align-items:center;overflow:visible}

/* dense image-led grid: tall 2:3 art cards; 6 cols at 1280, 4 at 850, 2 at <=650 */
.home-s2 .cast-grid.gh-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(176px,1fr))!important;gap:var(--gh-space-3)!important}
.gh-card{position:relative;min-width:0}
.gh-card-open{display:flex;flex-direction:column;width:100%;height:100%;padding:0;margin:0;border:1px solid var(--gh-color-line);border-radius:var(--gh-radius-lg);background:var(--gh-color-raised);color:inherit;text-align:left;overflow:hidden;cursor:pointer;transition:border-color .12s ease,transform .12s ease,box-shadow .12s ease}
.gh-card-open:hover{border-color:var(--gh-color-purple);box-shadow:0 0 0 1px var(--gh-color-purple),0 10px 24px rgba(123,60,255,.18);transform:translateY(-2px)}
.gh-card-open:focus-visible{outline:2px solid var(--gh-color-focus);outline-offset:2px;border-color:var(--gh-color-pink)}
@media (prefers-reduced-motion:reduce){.gh-card-open{transition:none}.gh-card-open:hover{transform:none}}
.gh-card-art{position:relative;display:block;aspect-ratio:2/3;width:100%;background:var(--gh-color-overlay);overflow:hidden}
.gh-card-art img{display:block;width:100%;height:100%;object-fit:cover}
.gh-card-art.is-missing{background:linear-gradient(160deg,var(--gh-color-purple-soft),var(--gh-color-pink-soft)),var(--gh-color-overlay)}
.gh-card-art.is-missing::after{content:attr(data-initials);position:absolute;inset:0;display:grid;place-items:center;font-size:var(--gh-font-2xl);font-weight:700;color:var(--gh-color-muted)}
.gh-card-body{display:flex;flex-direction:column;gap:2px;padding:var(--gh-space-2) var(--gh-space-3) var(--gh-space-3)}
.gh-card-name{font-size:var(--gh-font-base);font-weight:700;color:var(--gh-color-text);line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-card-open:hover .gh-card-name,.gh-card-open:focus-visible .gh-card-name{color:var(--gh-color-pink)}
.gh-card-line{font-size:var(--gh-font-sm);line-height:1.4;color:var(--gh-color-muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gh-card-by{margin-top:2px;font-size:var(--gh-font-label);color:var(--gh-color-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}/*tf12*/.gh-card-by{font-size:12px}/*/tf12*/

/* My Chats strip: below the grid, only when real local chats exist */
.home-chats-strip{margin:var(--gh-space-8) 0 0}
.home-strip-head{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-space-3);margin:0 0 var(--gh-space-3)}
.home-strip-head h2{margin:0;font-size:var(--gh-font-xl);font-weight:700}
.home-strip-link{display:inline-flex;align-items:center;min-height:var(--gh-control-min);color:var(--gh-color-pink);font-size:var(--gh-font-md);font-weight:600}
.home-strip-link:focus-visible{outline:2px solid var(--gh-color-focus);outline-offset:2px;border-radius:var(--gh-radius-sm)}
.home-strip-scroll{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(300px,360px);gap:var(--gh-space-3);overflow-x:auto;overscroll-behavior-x:contain;padding-bottom:var(--gh-space-1)}
.home-chat-card{display:flex;gap:var(--gh-space-3);padding:var(--gh-space-3);border:1px solid var(--gh-color-line);border-radius:var(--gh-radius-lg);background:var(--gh-color-raised);min-width:0}
.home-chat-thumb{flex:0 0 72px;width:72px;height:108px;object-fit:cover;border-radius:var(--gh-radius-md);background:var(--gh-color-overlay)}
.home-chat-body{display:flex;flex-direction:column;gap:var(--gh-space-1);min-width:0;flex:1 1 auto}
.home-chat-name{margin:0;font-size:var(--gh-font-base);font-weight:700}
.home-chat-excerpt{margin:0;font-size:var(--gh-font-sm);line-height:1.4;color:var(--gh-color-muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.home-chat-meta{display:flex;flex-wrap:wrap;gap:var(--gh-space-1);margin:0;font-size:var(--gh-font-label);color:var(--gh-color-dim)}
.home-chat-continue{align-self:flex-start;margin-top:auto;min-height:var(--gh-control-min);padding:0 var(--gh-space-4);font-size:var(--gh-font-md)}

@media (max-width:650px){
  .home-s2{padding-top:var(--gh-space-3)}
  .home-tabs{display:flex;width:100%;position:relative;margin-bottom:var(--gh-space-3)}
  .home-tab-wrap{flex:1 1 auto;position:static}
  .home-tab{min-height:var(--gh-hit);width:100%;padding:0 var(--gh-space-3);font-size:var(--gh-font-md)}
  .home-tab-tip{left:0;right:0;width:auto;max-width:none}
  .home-hero{margin-bottom:var(--gh-space-4)}
  .home-hero-title{font-size:26px}
  .home-hero-promise{font-size:var(--gh-font-base)}
  .home-hero-link{min-height:var(--gh-hit);font-size:var(--gh-font-md)}
  .home-grid-head h2{font-size:var(--gh-font-lg)}
  .home-filters>summary{min-height:var(--gh-hit);font-size:var(--gh-font-md)}
  .home-s2 .cast-grid.gh-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--gh-space-2)!important}
  .gh-card-body{padding:var(--gh-space-2)}
  .gh-card-name{font-size:var(--gh-font-md)}
  .home-strip-link{min-height:var(--gh-hit)}
  .home-strip-scroll{grid-auto-columns:minmax(260px,86%)}
  .home-chat-continue{min-height:var(--gh-hit);font-size:var(--gh-font-md)}
}
.home-s2 .cast-section.home-grid-section{border-top:0!important;padding-top:0!important;margin-top:0!important}

/* ---------- JP-S2 disabled-tab note (CoS ruling on jp-s3-1) ----------
   Desktop (fine pointer, >650): the tooltip sits in the empty space to the RIGHT of the tab row, vertically centred on it,
   so it covers nothing (it used to drop over the hero headline). */
.home-tabs{position:relative}
.home-tab-wrap{position:static}
.home-tab-tip{left:calc(100% + var(--gh-space-3));top:50%;transform:translateY(-50%);width:max-content;max-width:min(420px,calc(100vw - 100% - 96px))}
/* Touch or narrow (<=650 or pointer:coarse): no floating tooltip. A tap on a disabled tab shows the SAME element as an
   inline note in flow below the tabs (>= 13px; contain:inline-size so it never widens the tab row). It pushes content down, never overlays; a second tap on that tab or a tap
   on another tab dismisses it (shell.js). It stays the tab's aria-describedby target at all times. */
@media (max-width:650px),(pointer:coarse){
  .home-tabs{flex-wrap:wrap;row-gap:0}
  .home-tab-wrap{display:contents}
  .home-tabs .home-tab{flex:1 1 auto;width:auto}
  .home-tab-tip,
  .home-tab-wrap:hover .home-tab-tip,
  .home-tab-wrap:focus-within .home-tab-tip{
    display:none;position:static;order:99;flex:0 0 100%;width:100%;max-width:none;transform:none;box-sizing:border-box;contain:inline-size;
    margin:var(--gh-space-1) 0 0;padding:var(--gh-space-2) var(--gh-space-3);box-shadow:none;background:var(--gh-color-raised);
    font-size:var(--gh-font-md);line-height:1.45;color:var(--gh-color-text);visibility:visible;opacity:1;transition:none;pointer-events:auto
  }
  .home-tab-wrap.show-tip .home-tab-tip{display:block}
}
/* JP-S3 (jp-s3-1): dense cards, WebP thumbnails, honest "Portrait coming soon" placeholders */
@media (min-width:651px){.home-s2 .cast-grid.gh-grid{gap:10px!important}}
@media (min-width:540px) and (max-width:650px){.home-s2 .cast-grid.gh-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
.gh-card-body{gap:1px;padding:6px 8px 8px;min-width:0;width:100%;box-sizing:border-box}
.gh-card-line{display:block;min-width:0;max-width:100%;-webkit-line-clamp:unset;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:1.35}
.gh-card-by{margin-top:1px}
@media (max-width:650px){.gh-card-body{padding:6px 8px 8px}}
.gh-card-art img{aspect-ratio:2/3}
.gh-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:12px;text-align:center;background:radial-gradient(120% 70% at 50% 28%,rgba(123,60,255,.34),transparent 62%),radial-gradient(90% 60% at 50% 100%,rgba(255,102,196,.18),transparent 70%),linear-gradient(170deg,#140a1f 0%,#0b0b0f 58%,#170a14 100%)}
.gh-ph-mono{display:grid;place-items:center;width:46%;max-width:96px;aspect-ratio:1/1;border-radius:50%;border:2px solid var(--gh-color-pink,#ff66c4);background:rgba(0,0,0,.45);box-shadow:0 0 0 4px rgba(123,60,255,.28);color:#fff;font-size:26px;font-weight:800;letter-spacing:.04em;line-height:1}
.gh-ph-note{font-size:12px;line-height:1.3;font-weight:600;color:#d9cbe8;letter-spacing:.01em}
.gh-ph--big .gh-ph-mono{max-width:140px;font-size:40px}
.gh-ph--big .gh-ph-note{font-size:14px}
.character-portrait,.detail-cover{position:relative}
.gh-mono{display:inline-grid;place-items:center;flex-shrink:0;overflow:hidden;background:radial-gradient(circle at 50% 35%,rgba(123,60,255,.45),transparent 70%),linear-gradient(160deg,#1a0b2a,#0b0b0f 70%,#1d0a17);color:#fff;font-weight:800;font-size:12px;letter-spacing:.04em;line-height:1}
.home-chat-thumb.gh-mono,.continue-card-portrait.gh-mono{font-size:20px}
.gh-tpl-art{display:block;width:100%;height:118px;object-fit:cover;object-position:50% 18%}
.gh-tpl-art.gh-mono{display:grid;font-size:20px}
.catalog-portrait.gh-mono{aspect-ratio:2/3;font-size:20px}
/* JP-S3: keep the placeholder note legible under the legacy/market portrait shade and the detail-cover glow */
.character-portrait:has(> .gh-ph)::after{background:linear-gradient(transparent 72%,#000000b3)}
.detail-cover:has(> .gh-ph) .detail-cover-glow{opacity:.45}
/* JP-S3: tag pills (real cast tags; 11px uppercase meta labels, one line, never a separate hit target) */
.gh-card-pills{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;height:18px;margin-top:4px;min-width:0;max-width:100%;overflow:hidden;pointer-events:none}
.gh-card-pills .gh-meta-pill{flex:none;display:inline-block;padding:1px 5px;border:1px solid var(--gh-color-line,#343434);border-radius:999px;background:rgba(255,255,255,.03);color:var(--gh-color-muted,#a9a9b0);font-size:11px;line-height:14px;font-weight:600;letter-spacing:0;text-transform:uppercase;white-space:nowrap}
.gh-card-pills .gh-meta-pill--more{color:var(--gh-color-pink,#ff66c4);border-color:rgba(255,102,196,.35)}
.gh-card-pills .gh-meta-pill.is-cut{display:none}
.gh-card-pills.is-empty{visibility:hidden}
@media (max-width:539px){.gh-card-pills{display:none}}
/* JP-S3 (Quinn soft on the S2 build): the 12px floor grew Community listing cards by 6px (4 single-line 12px rows at line-height 1.5).
   Keep the 12px text; tighten those rows to 16.5px lines so the card is back to its pre-floor (S1) height. */
.market-card .listing-status,.market-card .creator-line,.market-card .tag,.market-card .market-card-foot,.market-card .market-card-foot *{line-height:16.5px}
