/* 1xPhotoReal web — tokens follow xuanhieutts-uiux (Light Authority / Graphite Luxe), adapted for an image library. */
:root, [data-theme="light"] {
  --bg:#F8FAFD; --surface:#FFFFFF; --raised:#FFFFFF; --tint:#DCEBFA;
  --ink:#10233A; --muted:#52647A; --primary:#1258A8; --primary-hover:#0D467E;
  --divider:#CAD6E4; --strong:#6E7E94; --focus:#1258A8;
  --positive:#1B6B49; --negative:#B42318; --warm:#C2410C;
  --btn-bg:#1258A8; --btn-fg:#FFFFFF; --frame:#E7EDF5; --code:#F1F5FA;
  /* model families (taxonomy.mjs / migration 009 tokens) and content groups: text colour; badge fill = 12% tint */
  --model-gpt-image:#17693A; --model-nano-banana:#7A5200; --model-qwen-image:#7A2FB0; --model-jimeng:#B0173F; --model-seedance:#3B37B8;
  --model-fallback:#3D5470; /* family without a token yet (6.9:1 on its tint) */
  --group-photoreal:#0A5FB4; --group-design:#0B6670; --group-creative:#A4440A; --group-video:#8A2F7A; --group-other:#52647A;
  --tint-mix:12%;
  color-scheme:light;
}
[data-theme="dark"] {
  --bg:#07080A; --surface:#111317; --raised:#16191E; --tint:#1B222D;
  --ink:#F4F5F7; --muted:#A7ADB7; --primary:#9DCDFF; --primary-hover:#C4E2FF;
  --divider:#22262C; --strong:#626A76; --focus:#9DCDFF;
  --positive:#8AD9B6; --negative:#FFAAA5; --warm:#EE7B3A;
  --btn-bg:#F4F5F7; --btn-fg:#07080A; --frame:#16191E; --code:#0D0F12;
  --model-gpt-image:#7EE2A0; --model-nano-banana:#FFD95A; --model-qwen-image:#D7A6FF; --model-jimeng:#FF94AE; --model-seedance:#AFACFF;
  --model-fallback:#B8C7DA;
  --group-photoreal:#8CC8FF; --group-design:#6FD8E0; --group-creative:#FFB27A; --group-video:#F59BE5; --group-other:#A7ADB7;
  --tint-mix:16%;
  color-scheme:dark;
}
:root { --r:14px; --r-sm:10px; --top:60px; --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

* { box-sizing:border-box; }
[hidden] { display:none !important; } /* component display rules must never override the hidden attribute */
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 var(--font); }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
button, input, select { font:inherit; color:inherit; }
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:6px; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip { position:absolute; left:8px; top:-40px; background:var(--surface); padding:6px 10px; border-radius:8px; z-index:50; }
.skip:focus { top:8px; }
.muted { color:var(--muted); }
code { font-family:var(--mono); font-size:.86em; background:var(--code); border:1px solid var(--divider); border-radius:6px; padding:1px 5px; overflow-wrap:anywhere; }

/* Header */
.top { position:sticky; top:0; z-index:20; height:var(--top); display:flex; align-items:center; gap:16px; padding:0 20px;
  background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:saturate(1.4) blur(12px); -webkit-backdrop-filter:saturate(1.4) blur(12px); border-bottom:1px solid var(--divider); }
.brand { display:flex; align-items:center; gap:6px; color:var(--ink); font-weight:700; letter-spacing:-.01em; flex:none; }
.brand:hover { text-decoration:none; }
.brand-mark { display:inline-grid; place-items:center; width:28px; height:28px; border-radius:8px; background:var(--primary); color:var(--surface); font-size:12px; font-weight:800; }
[data-theme="dark"] .brand-mark { color:#07080A; }
.brand-name { font-size:17px; }
.search { position:relative; flex:1; max-width:680px; display:flex; align-items:center; }
.search input { width:100%; height:40px; padding:0 64px 0 38px; border-radius:999px; border:1px solid var(--divider); background:var(--surface); outline:none; }
.search input:focus { border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.search input::-webkit-search-cancel-button { display:none; }
.search-ico { position:absolute; left:13px; width:16px; height:16px; color:var(--muted); pointer-events:none; }
.kbd { position:absolute; right:12px; font:12px var(--mono); color:var(--muted); border:1px solid var(--divider); border-radius:6px; padding:0 6px; }
.search-clear { position:absolute; right:8px; width:30px; height:30px; border:0; border-radius:50%; background:transparent; font-size:20px; line-height:1; color:var(--muted); cursor:pointer; }
.search-clear:hover { background:var(--tint); }
.search-clear:not([hidden]) ~ .kbd, .search:has(.search-clear:not([hidden])) .kbd { display:none; }
.top-nav { display:flex; align-items:center; gap:6px; margin-left:auto; flex:none; }
.link-btn { border:0; background:none; color:var(--primary); padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:600; font-size:14px; }
.link-btn:hover { background:var(--tint); }
.icon-btn { display:inline-grid; place-items:center; width:38px; height:38px; border-radius:10px; border:1px solid var(--divider); background:var(--surface); cursor:pointer; font-size:20px; line-height:1; color:var(--ink); }
.icon-btn:hover { border-color:var(--strong); }
.icon-btn svg { width:18px; height:18px; }
.lang-btn { font-size:12.5px; font-weight:700; letter-spacing:.02em; }
.top-nav a.link-btn:hover { text-decoration:none; }
.top-nav a.link-btn.on { background:var(--tint); }
[data-theme="light"] .i-sun, [data-theme="dark"] .i-moon { display:none; }

/* Server-rendered prompt page (P2-1 SSR): hide the empty gallery shell until JS takes over. */
html.ssr-page #feedView { display:none; }
html.ssr-page #detailView pre { white-space:pre-wrap; word-break:break-word; font:14px/1.6 var(--mono); }
main { padding:0 20px 24px; min-height:calc(100vh - var(--top) - 60px); outline:none; }

/* Intro + samples */
.intro { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; padding:14px 0 6px; }
.intro-title { margin:0; font-size:15px; font-weight:500; color:var(--muted); flex:1 1 420px; }
#libCount { color:var(--ink); font-weight:700; }
.samples { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.samples-label { font-size:13px; color:var(--muted); }
.sample { border:1px solid var(--divider); background:transparent; border-radius:999px; padding:4px 11px; font-size:13px; cursor:pointer; color:var(--ink); }
.sample:hover { border-color:var(--primary); color:var(--primary); }

/* Listing heading (/category/x, /model/x, /photoreal, /categories) */
.listing-head { padding:16px 0 4px; }
.listing-kicker { margin:0 0 2px; font-size:13px; color:var(--muted); }
.listing-title { margin:0; font-size:24px; line-height:1.25; letter-spacing:-.01em; }
.listing-head[data-family]:not([data-family=""]) .listing-title { color:var(--c); }
/* Categories A–Z */
.cats-tools { position:sticky; top:var(--top); z-index:5; background:var(--bg); padding:10px 0; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; }
.cat-filter { height:38px; border-radius:999px; border:1px solid var(--divider); background:var(--surface); padding:0 14px; min-width:220px; }
.letters { display:flex; flex-wrap:wrap; gap:2px; }
.letters a { display:inline-grid; place-items:center; min-width:30px; height:30px; border-radius:8px; font-weight:600; font-size:13.5px; }
.letters a:hover { background:var(--tint); text-decoration:none; }
.az { columns:4 230px; column-gap:28px; padding-bottom:12px; }
.az-group { break-inside:avoid; margin:0 0 18px; scroll-margin-top:calc(var(--top) + 64px); }
.az-letter { font-size:15px; margin:0 0 6px; padding-bottom:4px; border-bottom:1px solid var(--divider); }
.az ul { list-style:none; margin:0; padding:0; }
.az li { display:flex; justify-content:space-between; gap:10px; padding:3px 0; font-size:14px; }
.az li .n { color:var(--muted); font-variant-numeric:tabular-nums; }

/* Controls */
.controls { position:sticky; top:var(--top); z-index:10; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 0; background:var(--bg); }
.seg { display:inline-flex; padding:3px; border-radius:999px; background:var(--surface); border:1px solid var(--divider); }
.seg button { border:0; background:transparent; padding:6px 14px; border-radius:999px; cursor:pointer; font-weight:600; font-size:14px; color:var(--muted); min-height:32px; }
.seg button[aria-checked="true"] { background:var(--btn-bg); color:var(--btn-fg); }
.seg button:not([aria-checked="true"]):hover { color:var(--ink); }
.seg-sm button { padding:6px 12px; }
.chip { border:1px solid var(--divider); background:var(--surface); border-radius:999px; padding:6px 14px; cursor:pointer; font-weight:600; font-size:14px; min-height:38px; color:var(--muted); }
.chip[aria-pressed="true"] { border-color:var(--primary); color:var(--primary); background:var(--tint); }
.chip .dot { margin-right:6px; }
.sel select { appearance:none; -webkit-appearance:none; height:38px; border-radius:999px; border:1px solid var(--divider); background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E7E94' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center/10px; padding:0 30px 0 14px; font-size:14px; max-width:200px; cursor:pointer; }
.sel select.on { border-color:var(--primary); color:var(--primary); font-weight:600; }
.win-label { font-size:12.5px; color:var(--muted); border:1px solid var(--divider); border-radius:999px; padding:3px 10px; }
.seg [hidden] { display:none; }
.status { margin-left:auto; font-size:13px; color:var(--muted); }
.notice { margin:0 0 10px; padding:8px 12px; border-radius:var(--r-sm); background:var(--tint); color:var(--ink); font-size:14px; border-left:3px solid var(--primary); }

/* Grid */
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:14px; }
.card { position:relative; display:flex; flex-direction:column; min-width:0; }
.card-link { display:block; color:inherit; border-radius:var(--r); }
.card-link:hover { text-decoration:none; }
.frame { position:relative; aspect-ratio:4/5; border-radius:var(--r); overflow:hidden; background:var(--frame); }
.frame img, .frame video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; opacity:0; transition:opacity .25s; }
.frame img.ok, .frame video.ok { opacity:1; }
.card-link:hover .frame img.ok { transform:scale(1.02); transition:transform .4s, opacity .25s; }
.ph { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:flex-end; gap:6px; padding:14px; background:var(--frame); }
.ph-text { font-size:13px; line-height:1.45; color:var(--ink); display:-webkit-box; -webkit-line-clamp:7; -webkit-box-orient:vertical; overflow:hidden; font-family:var(--mono); }
.ph-note { font-size:12px; color:var(--muted); }
.badge-media { position:absolute; left:8px; top:8px; font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; background:rgba(7,8,10,.62); color:#fff; letter-spacing:.02em; }
.card-meta { padding:8px 2px 0; display:grid; gap:4px; }
.card-title { margin:0; font-size:14px; font-weight:600; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-sub { display:flex; align-items:center; gap:6px; min-width:0; font-size:12.5px; color:var(--muted); }
.card-sub .author { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.card-sub .stat { margin-left:auto; flex:none; font-variant-numeric:tabular-nums; }
.copy-quick { position:absolute; right:8px; top:8px; z-index:2; border:0; border-radius:999px; padding:6px 12px; font-size:13px; font-weight:700; cursor:pointer; background:rgba(255,255,255,.94); color:#10233A; box-shadow:0 1px 4px rgba(0,0,0,.2); opacity:0; transform:translateY(-2px); transition:opacity .15s, transform .15s; min-height:32px; }
.card:hover .copy-quick, .card:focus-within .copy-quick { opacity:1; transform:none; }
@media (hover:none) { .copy-quick { opacity:1; transform:none; } }
/* Colour mapping: one colour per model family / group, the same on cards, chips, filters and listing headers. */
/* Families: colour comes from the family's own token via inline style (familyStyle in taxonomy.mjs), with
   --model-fallback for families without a token. [data-family] without inline style also falls back. */
[data-family] { --c:var(--model-fallback); }
[data-group="photoreal"] { --c:var(--group-photoreal); } [data-group="design"] { --c:var(--group-design); }
[data-group="creative"] { --c:var(--group-creative); } [data-group="video"] { --c:var(--group-video); } [data-group="other"] { --c:var(--group-other); }
.mbadge { flex:none; display:inline-block; font-size:11.5px; font-weight:650; line-height:1; padding:4px 7px; border-radius:6px; white-space:nowrap;
  color:var(--c, var(--muted)); background:color-mix(in srgb, var(--c, var(--muted)) var(--tint-mix), var(--surface)); }
.gdot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--c); margin:0 6px 1px 0; vertical-align:middle; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--c); margin-right:6px; vertical-align:middle; }
.chip-group[aria-pressed="true"] { border-color:var(--c); color:var(--c); background:color-mix(in srgb, var(--c) var(--tint-mix), var(--surface)); }
.sel-model select[data-family]:not([data-family=""]).on { border-color:var(--c); color:var(--c); }

.skel .frame { animation:pulse 1.2s ease-in-out infinite; }
.skel .bar { height:12px; border-radius:6px; background:var(--frame); margin-top:8px; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.55; } }

.empty { padding:48px 16px; text-align:center; color:var(--muted); }
.empty h2 { color:var(--ink); font-size:18px; margin:0 0 6px; }
.empty .samples { justify-content:center; margin-top:12px; }
.more { display:flex; justify-content:center; padding:20px 0 8px; }
#sentinel { height:1px; }

/* Buttons */
.btn { border:0; border-radius:999px; background:var(--btn-bg); color:var(--btn-fg); padding:9px 18px; font-weight:700; cursor:pointer; min-height:40px; }
.btn:hover { filter:brightness(1.08); }
.btn-ghost { border:1px solid var(--divider); background:var(--surface); border-radius:999px; padding:6px 13px; cursor:pointer; font-weight:600; font-size:14px; min-height:36px; }
.btn-ghost:hover { border-color:var(--strong); }

/* Detail */
.back { display:inline-flex; align-items:center; gap:6px; margin:14px 0 10px; }
.detail { display:grid; grid-template-columns:minmax(0, 1.05fr) minmax(360px, .95fr); gap:24px; align-items:start; }
.viewer { position:sticky; top:calc(var(--top) + 12px); }
.stage { position:relative; border-radius:var(--r); overflow:hidden; background:var(--frame); min-height:320px; max-height:calc(100vh - var(--top) - 110px); display:grid; place-items:center; }
.stage img, .stage video { max-width:100%; max-height:calc(100vh - var(--top) - 110px); display:block; object-fit:contain; }
.stage .ph { position:relative; min-height:360px; width:100%; }
.thumbs { display:flex; gap:8px; margin-top:8px; overflow-x:auto; padding-bottom:4px; }
.thumbs button { flex:none; width:64px; height:64px; padding:0; border-radius:10px; overflow:hidden; border:2px solid transparent; background:var(--frame); cursor:pointer; }
.thumbs button[aria-current="true"] { border-color:var(--primary); }
.thumbs img { width:100%; height:100%; object-fit:cover; display:block; }
.role-note { font-size:12.5px; color:var(--muted); margin-top:6px; }
.info h1 { font-size:22px; line-height:1.3; margin:0 0 4px; letter-spacing:-.01em; }
.byline { font-size:14px; color:var(--muted); margin-bottom:14px; }
.byline b { color:var(--ink); }
.prompt-box { border:1px solid var(--divider); border-radius:var(--r); background:var(--surface); }
.prompt-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 8px 8px 14px; border-bottom:1px solid var(--divider); }
.prompt-head .lbl { font-weight:700; font-size:14px; margin-right:auto; }
.prompt-wrap { position:relative; overflow:hidden; }
.prompt-wrap.collapsed::after { content:""; position:absolute; left:0; right:0; bottom:0; height:48px; pointer-events:none; background:linear-gradient(to bottom, transparent, var(--surface)); }
.prompt-text { margin:0; padding:14px; white-space:pre-wrap; word-break:break-word; font:14px/1.6 var(--mono); }
.prompt-expand { display:block; width:100%; border:0; border-top:1px solid var(--divider); background:transparent; color:var(--primary); font-weight:600; font-size:14px; padding:9px; cursor:pointer; border-radius:0 0 var(--r) var(--r); }
.prompt-expand:hover { background:var(--tint); }
.hint { font-size:13px; color:var(--muted); margin:8px 2px 0; }
/* Filter chips on the detail (+More) */
.chips { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; }
.chips > [role="listitem"] { display:contents; }
.fchip { display:inline-flex; align-items:center; min-height:30px; font-size:13px; font-weight:600; padding:4px 11px; border-radius:999px; border:1px solid var(--divider); background:var(--surface); color:var(--ink); cursor:pointer; text-decoration:none; }
a.fchip:hover { border-color:var(--strong); text-decoration:none; }
.fchip[data-family], .fchip[data-group] { color:var(--c); border-color:color-mix(in srgb, var(--c) 40%, var(--divider)); background:color-mix(in srgb, var(--c) var(--tint-mix), var(--surface)); }
.fchip-tag { color:var(--muted); font-weight:500; }
.fchip-more { color:var(--primary); border-style:solid; }
.prompt-text mark { background:color-mix(in srgb, var(--primary) 18%, transparent); color:inherit; border-radius:4px; padding:0 2px; }
.copy-main { display:inline-flex; align-items:center; gap:6px; }
.meta { display:grid; grid-template-columns:max-content 1fr; gap:8px 16px; margin:16px 0; font-size:14px; }
.meta dt { color:var(--muted); }
.meta dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.pill { display:inline-block; font-size:12.5px; padding:2px 9px; border-radius:999px; border:1px solid var(--divider); margin:0 4px 4px 0; color:var(--ink); background:var(--surface); }
a.pill:hover { border-color:var(--primary); text-decoration:none; }
.actions-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
details.adv { margin-top:16px; border:1px solid var(--divider); border-radius:var(--r); background:var(--surface); }
details.adv summary { padding:12px 14px; cursor:pointer; font-weight:700; list-style:none; display:flex; justify-content:space-between; }
details.adv summary::after { content:"＋"; color:var(--muted); }
details.adv[open] summary::after { content:"－"; }
details.adv summary::-webkit-details-marker { display:none; }
.adv-body { padding:0 14px 14px; font-size:14px; }
.adv-body h3 { font-size:14px; margin:12px 0 6px; }
.var-row { display:grid; grid-template-columns:minmax(90px, max-content) 1fr; gap:8px; align-items:center; margin-bottom:8px; }
.var-row label { font-family:var(--mono); font-size:13px; color:var(--muted); }
.var-row input { height:36px; border-radius:8px; border:1px solid var(--divider); background:var(--bg); padding:0 10px; min-width:0; }
.related-title { font-size:17px; margin:32px 0 12px; }

/* Prompt modal (over the gallery) */
html.modal-open { overflow:hidden; }
.grid.stale { opacity:.55; transition:opacity .12s; }
dialog.pm { max-width:min(1320px, calc(100vw - 32px)); width:100%; height:calc(100vh - 32px); max-height:none; padding:0; display:none; flex-direction:column; overflow:hidden; outline:none; }
dialog.pm[open] { display:flex; }
dialog.pm::backdrop { background:rgba(7,8,10,.62); backdrop-filter:blur(3px); }
.pm-bar { display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid var(--divider); flex:none; }
.pm-bar .icon-btn { font-size:22px; }
.pm-bar .icon-btn:disabled { opacity:.3; cursor:default; }
.pm-sep { width:1px; height:22px; background:var(--divider); margin:0 2px; }
.pm-count { font-size:13px; color:var(--muted); min-width:64px; text-align:center; font-variant-numeric:tabular-nums; }
.pm-hint { font-size:12.5px; color:var(--muted); margin-left:8px; }
.pm-close { margin-left:auto; }
.pm-body { flex:1; overflow:auto; padding:16px 18px 22px; overscroll-behavior:contain; }
.pm-body .viewer { top:0; }
.pm-body .stage, .pm-body .stage img, .pm-body .stage video { max-height:calc(100vh - 140px); }
.panel + .panel, .prompt-box + .panel { margin-top:14px; }
.d-title { font-size:22px; line-height:1.3; margin:0 0 4px; letter-spacing:-.01em; }
.kbd-in { font:11px var(--mono); border:1px solid currentColor; border-radius:5px; padding:0 4px; opacity:.6; margin-left:2px; }
.related { margin-top:8px; }
.grid-sm { grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; }
.grid-sm .card-title { font-size:13px; }
.keys kbd { font:12px var(--mono); border:1px solid var(--divider); border-radius:6px; padding:1px 6px; background:var(--code); white-space:nowrap; }
.keys th { padding-right:16px; }
.keys td { padding:6px 0; }

/* Dialogs + toast */
dialog { border:1px solid var(--divider); border-radius:var(--r); padding:0; background:var(--surface); color:var(--ink); max-width:min(560px, calc(100vw - 32px)); width:100%; }
dialog::backdrop { background:rgba(7,8,10,.45); }
.dlg { padding:16px 20px 18px; }
.dlg-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.dlg-head h2 { margin:0; font-size:18px; }
.dlg p { margin:10px 0; font-size:14px; }
.dlg-foot { display:flex; justify-content:flex-end; margin-top:12px; }
.kv { width:100%; border-collapse:collapse; font-size:13px; }
.kv th { text-align:left; color:var(--muted); font-weight:500; padding:5px 12px 5px 0; white-space:nowrap; vertical-align:top; }
.kv td { padding:5px 0; }
.toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:60; background:var(--ink); color:var(--bg); padding:10px 16px; border-radius:999px; font-size:14px; font-weight:600; max-width:calc(100vw - 32px); }
.toast.bad { background:var(--negative); color:#fff; }

.foot { display:flex; flex-wrap:wrap; gap:6px 18px; justify-content:space-between; padding:14px 20px 22px; border-top:1px solid var(--divider); font-size:13px; color:var(--muted); }
.credit { font-family:var(--mono); }


/* Account (docs/admin.md §8) and Save */
.acct { position:relative; display:flex; }
.acct-signin { display:inline-flex; align-items:center; text-decoration:none; color:var(--ink); }
.acct-signin:hover { text-decoration:none; }
.acct-btn { width:38px; height:38px; border-radius:50%; border:1px solid var(--divider); background:var(--tint); color:var(--ink); font-weight:700; cursor:pointer; }
.acct-menu { position:absolute; right:0; top:calc(100% + 6px); z-index:30; min-width:220px; padding:6px; border:1px solid var(--divider); border-radius:var(--r-sm); background:var(--surface); display:grid; }
.acct-menu a, .acct-menu button { display:block; text-align:left; padding:8px 10px; border-radius:8px; border:0; background:none; color:var(--ink); font-size:14px; cursor:pointer; text-decoration:none; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu :focus-visible { background:var(--tint); text-decoration:none; }
.acct-email { margin:4px 10px 6px; font-size:12.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html:not(.has-account) [data-save] { display:none; }
.save-quick { position:absolute; left:8px; top:8px; z-index:2; display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:999px; cursor:pointer; background:rgba(255,255,255,.94); color:#10233A; opacity:0; transition:opacity .15s; }
.save-quick svg, .save-btn svg { width:16px; height:16px; }
.card:hover .save-quick, .card:focus-within .save-quick, .save-quick[aria-pressed="true"] { opacity:1; }
@media (hover:none) { .save-quick { opacity:1; } }
.save-quick[aria-pressed="true"] svg path, .save-btn[aria-pressed="true"] svg path { fill:currentColor; }
.save-btn { display:inline-flex; align-items:center; gap:6px; }
.save-btn[aria-pressed="true"] { border-color:var(--primary); color:var(--primary); }
a.btn-ghost { display:inline-flex; align-items:center; color:var(--ink); text-decoration:none; }
a.btn-ghost:hover { text-decoration:none; }
.foot-links { display:flex; flex-wrap:wrap; gap:4px 14px; }
.foot-links a { color:var(--muted); }
/* Server document pages (/categories, /models, /about…): header and footer come from this stylesheet too. */
#ssrPage { padding-top:8px; }

/* Responsive */
@media (max-width: 1000px) {
  .detail { grid-template-columns:1fr; }
  .viewer { position:static; }
  .stage, .stage img, .stage video { max-height:70vh; }
  .pm-body .stage, .pm-body .stage img, .pm-body .stage video { max-height:48vh; min-height:0; }
}
@media (max-width: 760px) {
  :root { --top:56px; }
  .top { gap:10px; padding:0 12px; }
  .brand-name { display:none; }
  .kbd { display:none; }
  .search input { padding-right:36px; }
  main { padding:0 12px 20px; }
  .link-btn#agentBtn { padding:8px 6px; font-size:13px; }
  .grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
  .controls { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -12px; padding:8px 12px; }
  .controls::-webkit-scrollbar { display:none; }
  .controls > * { flex:none; }
  .status { margin-left:8px; }
  .intro { padding-top:10px; }
  .intro-title { font-size:14px; flex-basis:100%; }
  .samples { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -12px; padding:0 12px 2px; }
  .samples::-webkit-scrollbar { display:none; }
  .sample { flex:none; min-height:34px; }
  .card-title { font-size:13.5px; }
  .info h1 { font-size:19px; }
  .listing-title { font-size:20px; }
  #catsLink { padding:8px 6px; font-size:13px; }
  .lang-btn { width:34px; }
  .meta { grid-template-columns:1fr; gap:2px; }
  .meta dt { margin-top:8px; }
  .foot { padding:14px 12px 20px; }
  #keysBtn { display:none; }
  dialog.pm { max-width:100vw; width:100vw; height:100dvh; margin:0; border:0; border-radius:0; }
  .pm-hint { display:none; }
  .pm-body { padding:12px 12px 20px; }
  .pm-body .stage, .pm-body .stage img, .pm-body .stage video { max-height:44vh; }
  .d-title { font-size:19px; }
  .grid-sm { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition:none !important; animation:none !important; } }
