/* design-system.css */
:root {
  color-scheme: light;
  --ws-canvas: #ffffff;
  --ws-canvas-subtle: #f7f8fa;
  --ws-surface: #ffffff;
  --ws-surface-raised: #ffffff;
  --ws-surface-strong: #f7f8fa;
  --ws-ink: #202124;
  --ws-ink-soft: #3c4043;
  --ws-muted: #667085;
  --ws-muted-strong: #52606d;
  --ws-line: #e8eaed;
  --ws-line-strong: #d0d5dd;
  --ws-accent: #2563eb;
  --ws-accent-hover: #1d4ed8;
  --ws-accent-strong: #1e40af;
  --ws-accent-soft: #dbeafe;
  --ws-accent-softer: #eff6ff;
  --ws-info: #2b6092;
  --ws-info-soft: #dfeaf4;
  --ws-warning: #8f681c;
  --ws-warning-soft: #f4ead3;
  --ws-danger: #c24738;
  --ws-danger-soft: #f7e2de;
  --ws-signal: #c94735;
  --ws-signal-hover: #ae382a;
  --ws-signal-soft: #f8e3de;
  --ws-backdrop: rgb(32 33 36 / 36%);
  --ws-shadow-overlay: 0 18px 48px rgb(32 33 36 / 16%);
  --ws-shadow-float: 0 8px 24px rgb(32 33 36 / 10%);
  --ws-radius-control: 6px;
  --ws-radius-panel: 8px;
  --ws-control-height: 38px;
  --ws-font-display: "Arial Narrow", "DIN Condensed", "Bahnschrift Condensed", "PingFang SC", "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif;
  --ws-font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Zen Hei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ws-font-reading: "Songti SC", "Noto Serif CJK SC", STSong, serif;
  --ws-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ws-ease: cubic-bezier(.16, 1, .3, 1);
  --ws-duration-fast: 140ms;
  --ws-duration: 220ms;
  --ws-z-sticky: 20;
  --ws-z-navigation: 30;
  --ws-z-drawer: 60;
  --ws-z-modal: 100;
  --ws-z-toast: 200;
}

body.dark,
body[data-theme="dark"],
.admin-dark {
  color-scheme: dark;
  --ws-canvas: #10181c;
  --ws-canvas-subtle: #152126;
  --ws-surface: #19262c;
  --ws-surface-raised: #1f2e35;
  --ws-surface-strong: #24343b;
  --ws-ink: #edf3f4;
  --ws-ink-soft: #d2dde1;
  --ws-muted: #a5b5bc;
  --ws-muted-strong: #c0cdd1;
  --ws-line: #34464e;
  --ws-line-strong: #4c626b;
  --ws-accent: #69b6c8;
  --ws-accent-hover: #80c5d5;
  --ws-accent-strong: #a1d6e1;
  --ws-accent-soft: #173a45;
  --ws-accent-softer: #172e36;
  --ws-info: #8bb5dc;
  --ws-info-soft: #213745;
  --ws-warning: #dfb660;
  --ws-warning-soft: #40351f;
  --ws-danger: #ff8675;
  --ws-danger-soft: #472a27;
  --ws-signal: #c94735;
  --ws-signal-hover: #dc5c47;
  --ws-signal-soft: #452b28;
  --ws-backdrop: rgb(3 10 13 / 76%);
  --ws-shadow-overlay: 0 24px 70px rgb(0 0 0 / 42%);
  --ws-shadow-float: 0 12px 34px rgb(0 0 0 / 28%);
}

html {
  font-family: var(--ws-font-sans);
  background: var(--ws-canvas);
  color: var(--ws-ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--ws-font-sans);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: color-mix(in srgb, var(--ws-accent) 22%, transparent);
}

:focus-visible {
  outline: 2px solid var(--ws-accent);
  outline-offset: 2px;
}

* {
  scrollbar-color: var(--ws-line-strong) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--ws-line-strong);
  background-clip: padding-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* styles.css */
:root {
  --bg: var(--ws-canvas);
  --surface: var(--ws-surface);
  --surface-soft: var(--ws-canvas-subtle);
  --ink: var(--ws-ink);
  --muted: var(--ws-muted);
  --line: var(--ws-line);
  --brand: var(--ws-accent);
  --brand-solid: var(--ws-accent);
  --brand-soft: var(--ws-accent-soft);
  --amber: var(--ws-warning);
  --danger: var(--ws-danger);
  --chat-wash: rgb(241 243 240 / 76%);
  --sidebar: 76px;
  --topbar: 68px;
  --shadow: var(--ws-shadow-float);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ws-font-sans);
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
body.dark {
  --bg: var(--ws-canvas);
  --surface: var(--ws-surface);
  --surface-soft: var(--ws-canvas-subtle);
  --ink: var(--ws-ink);
  --muted: var(--ws-muted);
  --line: var(--ws-line);
  --brand: var(--ws-accent);
  --brand-solid: var(--ws-accent);
  --brand-soft: var(--ws-accent-soft);
  --amber: var(--ws-warning);
  --danger: var(--ws-danger);
  --chat-wash: rgb(21 26 23 / 76%);
  --shadow: var(--ws-shadow-float);
}
body.no-images .story-cover:not(.story-card .story-cover),
body.no-images .workspace-cover { display: none; }

.boot-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: var(--bg); }
.boot-sidebar { padding: 20px 18px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.boot-mark, .boot-line, .boot-dot, .boot-panel { display: block; background: var(--surface-soft); animation: boot-pulse 1.1s ease-in-out infinite alternate; }
.boot-mark { width: 36px; height: 36px; border-radius: 7px; margin-bottom: 12px; }
.boot-line { width: 68%; height: 12px; border-radius: 4px; }
.boot-line.wide { width: 84%; }
.boot-main { min-width: 0; }
.boot-topbar { height: var(--topbar); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.boot-line.search { width: min(360px, 55%); height: 34px; }
.boot-dot { width: 34px; height: 34px; border-radius: 50%; }
.boot-workspace { height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); padding: 16px; display: grid; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) minmax(210px, 280px); gap: 12px; }
.boot-panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
@keyframes boot-pulse { from { opacity: .55; } to { opacity: 1; } }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-left: var(--sidebar); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 18px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 22px;
  font-weight: 850;
  font-size: 20px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-solid);
  color: #fff;
}
.nav-group { margin-bottom: 20px; }
.nav-label {
  padding: 0 12px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.nav-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 680;
  text-align: left;
}
.nav-button:hover, .nav-button.active { background: var(--brand-soft); color: var(--brand); }
.nav-button svg { width: 18px; height: 18px; flex: none; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }
.account-strip {
  border-top: 1px solid var(--line);
  padding: 14px 8px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
}
.account-name { min-width: 0; font-size: 13px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-points { color: var(--muted); font-size: 11px; }
.account-strip > span:not(.avatar) { min-width: 0; display: grid; gap: 2px; }
.sidebar-tools { display: flex; gap: 6px; padding: 0 8px; }

.main-area { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar);
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box { position: relative; width: min(600px, 100%); }
.search-box svg { position: absolute; left: 13px; top: 11px; width: 19px; color: var(--muted); }
.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  outline: none;
}
.search-box input:focus, .field input:focus, .field textarea:focus, .field select:focus, .composer textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.top-actions { margin-left: auto; display: flex; gap: 7px; }
.page { max-width: 1480px; margin: 0 auto; padding: 26px 28px 84px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 26px; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.button, .icon-button, .chip, .segment {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-weight: 700;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 56%, var(--surface)); }
.button:active:not(:disabled), .icon-button:active:not(:disabled) { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, .nav-button:focus-visible, .session-open:focus-visible, .segment:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-button { width: 38px; padding: 0; flex: none; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: var(--brand-solid); border-color: var(--brand-solid); }
.button.amber { color: #2b2112; background: var(--amber); border-color: var(--amber); }
.button.danger { color: var(--danger); }
.button.ghost { background: transparent; }
.button.small { min-height: 32px; padding: 0 10px; font-size: 12px; }

.model-picker { position: relative; min-width: 0; display: inline-flex; align-items: center; }
.model-picker-trigger { min-width: 0; max-width: 100%; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.model-picker-trigger:hover:not(:disabled) { background: var(--surface-soft); }
.model-picker-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-trigger > svg { flex: none; color: var(--muted); }
.model-picker-menu { position: absolute; z-index: var(--ws-z-drawer); right: 0; bottom: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised, var(--surface)); box-shadow: var(--ws-shadow-overlay); }
.model-picker-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.model-picker-tabs button { min-height: 30px; flex: none; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.model-picker-tabs button.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgb(32 33 36 / 8%); }
.model-picker-list { max-height: min(360px, 52vh); overflow-y: auto; padding: 5px; }
.model-picker-option { width: 100%; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
.model-picker-option:hover, .model-picker-option:focus-visible { background: var(--surface-soft); }
.model-picker-option-copy { min-width: 0; display: grid; gap: 6px; }
.model-picker-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-option strong { font-size: 13px; }
.model-picker-option-prices { display: flex; flex-wrap: wrap; gap: 5px; }
.model-price-token { min-height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted-strong); font-size: 10px; line-height: 1; white-space: nowrap; }
.model-price-token i { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--brand); }
.model-price-token.output i { background: var(--ws-ink-soft); }
.model-price-token b { color: var(--ink); font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.model-price-token em { color: var(--muted); font-size: 9px; font-style: normal; }
.model-picker-option > svg { flex: none; color: var(--brand); }
.model-picker-details { margin: 0 12px 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.model-picker-details summary { color: var(--brand); cursor: pointer; }
.model-picker-details p { margin: 7px 0 0; }
.model-picker-mobile-dialog h2 { margin: 0 0 14px; font-size: 20px; }
.model-picker-mobile-dialog .model-picker-list { max-height: min(56dvh, 440px); }
@media (max-width: 620px) {
  .model-picker-trigger { min-height: 44px; padding-inline: 10px; }
  .model-picker-tabs { margin-inline: -2px; }
  .model-picker-tabs button { min-height: 38px; padding-inline: 10px; }
  .model-picker-option { min-height: 68px; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.ranking-tabs { display: flex; gap: 3px; padding: 3px; background: var(--surface-soft); border-radius: 7px; overflow-x: auto; }
.ranking-tabs { max-width: 100%; scrollbar-width: thin; }
.segment { white-space: nowrap; border: 0; background: transparent; min-height: 34px; padding: 0 12px; color: var(--muted); }
.segment.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.category-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { min-height: 32px; border-radius: 999px; padding: 0 12px; font-size: 13px; color: var(--muted); }
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.story-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.story-card {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.story-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.story-cover { height: 168px; position: relative; background: var(--surface-soft); }
.story-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-soft); color: var(--muted); }
.cover-fallback svg { opacity: .7; }
.story-badges { position: absolute; inset: 10px 10px auto; display: flex; justify-content: space-between; gap: 6px; }
.metric-badge { padding: 5px 8px; border-radius: 5px; background: rgba(25,29,26,.8); color: #fff; font-size: 11px; font-weight: 750; }
.story-body { padding: 14px; display: flex; flex: 1; flex-direction: column; }
.story-author { color: var(--brand); font-size: 12px; font-weight: 750; }
.story-body h3 { margin: 5px 0 7px; font-size: 17px; line-height: 1.35; }
.story-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; height: 42px; overflow: hidden; }
.story-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.tag { padding: 3px 6px; border-radius: 4px; color: var(--brand); background: var(--brand-soft); font-size: 11px; }
.story-meta { margin-top: auto; padding-top: 12px; }
.story-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.story-grid.compact .story-cover { height: 125px; }
.story-grid.compact .story-body p, .story-grid.compact .tag-list { display: none; }
.explore-search { display: none; }
.load-more { display: flex; justify-content: center; padding: 24px 0 4px; }
.rail-header, .inspector-header, .chat-header {
  min-height: 64px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: center; }
.session-open {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 10px 11px;
  background: transparent;
  text-align: left;
}
.session-open:hover { background: color-mix(in srgb, var(--brand-soft) 62%, transparent); }
.session-open.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.session-open strong, .session-open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-open strong { font-size: 12px; line-height: 1.35; }
.session-open span { color: var(--muted); font-size: 10px; margin-top: 5px; }
.chat-header-actions { margin-left: auto; display: flex; gap: 6px; }
.mobile-chat-more { display: none; }
.model-select { height: 36px; max-width: 190px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 0 9px; }
.external-renderer-host { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.external-renderer-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.external-renderer-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--surface) 86%, transparent); }
.external-renderer-host.is-ready .external-renderer-loading { display: none; }
.external-renderer-list > .older-messages { position: absolute; z-index: 4; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; }
.message-markup-chat { display: flex; align-items: flex-start; gap: 10px; width: 100%; margin: 12px 0; text-align: left; }
.message-markup-chat--right { flex-direction: row-reverse; text-align: right; }
.message-markup-avatar-wrap { width: 42px; min-width: 42px; height: 42px; display: grid; place-items: center; }
.message-markup-avatar { display: block; width: 42px; height: 42px; object-fit: cover; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); background: var(--surface); }
.message-markup-avatar--placeholder { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.message-markup-content { min-width: 0; max-width: min(100%, 560px); display: grid; gap: 3px; }
.message-markup-name { color: var(--muted); font-size: 11px; line-height: 1.35; }
.message-markup-bubble { min-width: 0; padding: 10px 13px; border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--surface) 96%, transparent); overflow-wrap: anywhere; white-space: pre-wrap; }
.message-markup-chat--right .message-markup-bubble { background: var(--brand-solid); color: #fff; border-color: var(--brand-solid); text-align: left; }
.typing { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }
.quick-actions { display: flex; gap: 7px; overflow-x: auto; }
.quick-actions button { white-space: nowrap; }
.stop-generation { min-width: 92px; }
.older-messages { display: flex; justify-content: center; padding: 0 0 18px; }
.empty-chat { flex: 1; display: grid; place-items: center; padding: 30px; text-align: center; }
.empty-chat-inner { max-width: 540px; }
.empty-chat h2 { margin: 0 0 8px; }
.empty-chat p { color: var(--muted); line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 15px; border-block: 1px solid var(--line); }
.metric { padding: 12px 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric:nth-child(2n) { border-right: 0; }
.metric:nth-last-child(-n + 2) { border-bottom: 0; }
.metric strong, .metric span { display: block; }
.metric strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 10px; margin-top: 4px; }
.rating-control { display: flex; min-width: 0; gap: 6px; }
.rating-control .model-select { width: 76px; min-width: 0; }
.comment-list { display: grid; gap: 12px; }
.comment { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.comment p { margin: 6px 0 0; color: var(--ink); }
.comment-form { display: grid; gap: 7px; margin-bottom: 14px; }
.comment-form textarea { min-height: 76px; resize: vertical; }
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 10px;
  outline: none;
}

.form-card { max-width: 940px; }
.profile-points { max-width: 940px; display: grid; gap: 30px; }
.points-summary { display: grid; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.points-summary .account-strip { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 4px 0; }
.points-summary .avatar { width: 52px; height: 52px; }
.points-summary .account-name { font-size: 18px; }
.points-summary > .account-strip > strong { font-size: 26px; }
.points-summary > .account-strip > strong small { color: var(--muted); font-size: 11px; }
.claim-status { display: flex; color: var(--muted); }
.claim-status > span { display: flex; align-items: center; gap: 9px; }
.claim-status > span > span { display: grid; gap: 2px; }
.claim-status strong { color: var(--ink); font-size: 12px; }
.claim-status small { font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.points-ledger { border-top: 1px solid var(--line); }
.points-entry { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.points-entry-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-soft); color: var(--brand); }
.points-entry > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.points-entry strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.points-entry small { color: var(--muted); font-size: 10px; }
.points-entry b { font-variant-numeric: tabular-nums; }
.points-entry b.positive { color: #1f7a45; }
.points-entry b.negative { color: var(--danger); }
.points-skeleton { height: 230px; }
.form-section { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 750; }
.field small { color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 11px 12px;
  outline: none;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.world-entry { border: 1px solid var(--line); border-radius: 7px; padding: 13px; display: grid; gap: 9px; background: var(--surface); }
.world-entry-head { display: flex; justify-content: space-between; align-items: center; }
.action-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.form-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.preview-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
.preview-cover { aspect-ratio: 16/10; border-radius: 7px; overflow: hidden; background: var(--surface-soft); }
.preview-cover img { width: 100%; height: 100%; object-fit: cover; }

.library-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.library-tab { padding: 10px 14px; border: 0; background: transparent; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; }
.library-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.conversation-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.conversation-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(140px, .7fr) 90px 150px auto; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.conversation-row:last-child { border-bottom: 0; }
.conversation-row > a.button { text-decoration: none; }
.conversation-story { display: flex; gap: 10px; min-width: 0; align-items: center; }
.conversation-story-media { position: relative; width: 58px; height: 42px; flex: 0 0 58px; overflow: hidden; border-radius: 5px; background: var(--surface-soft); }
.conversation-story-media img { width: 100%; height: 100%; object-fit: cover; }
.conversation-story-media .cover-fallback svg { width: 16px; height: 16px; }
.conversation-story strong, .conversation-story span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-story span, .conversation-row > span { color: var(--muted); font-size: 11px; }
.consumption-summary { width: min(720px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; border-block: 1px solid var(--line); }
.consumption-summary { width: min(900px, 100%); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.consumption-summary > div { display: grid; gap: 3px; padding: 16px 4px; }
.consumption-summary > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.consumption-summary span { color: var(--muted); font-size: 11px; }
.consumption-summary strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.consumption-summary small { color: var(--muted); font-size: 11px; }
@media (max-width: 650px) { .consumption-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }.consumption-summary > div:nth-child(3) { border-left: 0; padding-left: 4px; border-top: 1px solid var(--line); }.consumption-summary > div:nth-child(4) { border-top: 1px solid var(--line); } }
.consumption-list { width: min(1120px, 100%); border-top: 1px solid var(--line); }
.consumption-row { min-width: 0; display: grid; grid-template-columns: 34px minmax(180px, 1.3fr) minmax(80px, .55fr) minmax(130px, .8fr) minmax(155px, .8fr) 90px; align-items: center; gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--line); }
.consumption-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-soft); color: var(--brand); }
.consumption-place { min-width: 0; display: grid; gap: 3px; }
.consumption-place strong, .consumption-place small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consumption-place small, .consumption-kind, .consumption-model, .consumption-row time, .consumption-amount small { color: var(--muted); font-size: 11px; }
.consumption-amount { display: grid; justify-items: end; gap: 2px; }
.consumption-amount strong { color: var(--danger); font-size: 15px; font-variant-numeric: tabular-nums; }
.consumption-amount.free strong { color: var(--ws-accent-strong, var(--brand)); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(14,17,15,.58); }
.modal { width: min(520px, 100%); max-height: min(780px, 92vh); overflow-y: auto; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding: 22px; position: relative; }
.modal.wide { width: min(760px, 100%); }

.modal.full { width: min(1280px, 100%); height: min(900px, calc(100dvh - 36px)); max-height: none; overflow: hidden; padding: 0; }
.modal h2 { margin: 0 0 6px; font-size: 21px; }
.modal > p { margin: 0 0 18px; color: var(--muted); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.auth-error { margin: 14px 0 0; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line)); border-radius: 5px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); font-size: 13px; line-height: 1.45; }

.empty-chat-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.new-conversation-form { min-width: 0; }
.opening-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.opening-picker legend { margin-bottom: 7px; padding: 0; font-size: 12px; font-weight: 750; }
.opening-choice-list { max-height: min(320px, 36vh); overflow-y: auto; display: grid; gap: 7px; padding: 1px 4px 1px 1px; scrollbar-gutter: stable; }
.opening-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}
.opening-choice:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); }
.opening-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.opening-choice > input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); }
.opening-choice > input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.opening-choice-body { min-width: 0; display: grid; gap: 4px; }
.opening-choice-heading { min-width: 0; display: flex; align-items: center; gap: 7px; }
.opening-choice-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.opening-default-badge { flex: none; padding: 2px 5px; border-radius: 4px; background: var(--brand-solid); color: #fff; font-size: 9px; font-weight: 750; }
.opening-choice-meta { display: flex; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 10px; }
.opening-choice-meta b { color: var(--line); font-weight: 400; }
.opening-choice-preview { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.55; }
.custom-opening-field[hidden] { display: none; }
.custom-opening-field textarea { min-height: 104px; max-height: 220px; }
.settings-grid { display: grid; gap: 16px; }
.range-row { display: grid; grid-template-columns: 130px minmax(0,1fr) 54px; align-items: center; gap: 10px; }
.range-row output { text-align: right; font-variant-numeric: tabular-nums; }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; padding: 11px 15px; border-radius: 6px; background: var(--ink); color: var(--surface); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: none; }
body:has(.modal-backdrop) .toast { z-index: 90; }
.empty-state { border: 1px dashed var(--line); border-radius: 8px; padding: 50px 20px; text-align: center; color: var(--muted); }
.loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skeleton { height: 300px; border-radius: 8px; background: linear-gradient(90deg, var(--surface), var(--surface-soft), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.mobile-only { display: none; }
.mobile-nav { display: none; }
.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; }

@media (max-width: 1250px) {
  .story-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .story-grid.compact { grid-template-columns: repeat(4, minmax(0,1fr)); }

}
@media (max-width: 980px) {

  .brand > span:last-child, .nav-label, .nav-button span, .sidebar .account-strip > span:not(.avatar), .sidebar .account-strip > svg { display: none; }
  .brand, .nav-button { justify-content: center; padding-inline: 0; }
  .account-strip { grid-template-columns: 1fr; justify-items: center; }
  .topbar .account-button { width: 40px; padding: 0; }
  .topbar .account-button span { display: none; }
  .story-grid, .story-grid.compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mobile-only { display: inline-flex; }

}
@media (max-width: 700px) {
  :root { --sidebar: 0px; --topbar: 58px; }

  .sidebar { display: none; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .mobile-nav .nav-button {
    min-height: 56px;
    padding: 6px 2px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border-radius: 0;
    font-size: 10px;
  }
  .mobile-nav .nav-button span { display: block; }
  .topbar { padding: 9px 12px; }
  .search-box { display: none; }
  .explore-search {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
  }
  .explore-search > svg { width: 19px; color: var(--muted); }
  .explore-search input { min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0 11px; outline: none; }
  .explore-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
  .explore-search.has-clear { grid-template-columns: 20px minmax(0, 1fr) 38px 38px; }
  .page { padding: 20px 13px 78px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 23px; }
  .story-grid, .story-grid.compact { grid-template-columns: 1fr; }
  .story-cover, .story-grid.compact .story-cover { height: 195px; }
  .ranking-tabs { width: 100%; }
  .chat-header-actions { min-width: 0; gap: 4px; }
  .desktop-chat-action { display: none; }
  .mobile-chat-more { display: inline-flex; }
  .model-select { max-width: 108px; padding-inline: 6px; }
  .quick-actions { padding-inline: 12px; }
  .profile-points { gap: 22px; }
  .points-summary .account-strip { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .points-summary .avatar { width: 46px; height: 46px; }
  .points-summary > .account-strip > strong { font-size: 21px; }
  .points-entry { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .points-entry-icon { width: 29px; height: 29px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .preview-layout { grid-template-columns: 1fr; }
  .conversation-row { grid-template-columns: minmax(0,1fr) auto; }
  .conversation-row > span { display: none; }
  .consumption-row { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 5px 9px; padding-inline: 2px; }
  .consumption-icon { grid-column: 1; grid-row: 1 / 3; }
  .consumption-place { grid-column: 2; grid-row: 1; }
  .consumption-amount { grid-column: 3; grid-row: 1 / 3; }
  .consumption-kind { grid-column: 2; grid-row: 2; }
  .consumption-model { grid-column: 2; grid-row: 3; overflow-wrap: anywhere; }
  .consumption-row time { grid-column: 2; grid-row: 4; }
  .range-row { grid-template-columns: 1fr 54px; }
  .range-row label { grid-column: 1 / -1; }
  .top-actions .button span { display: none; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); padding: 18px 14px; }
  .modal.auth-dialog { padding: 18px; }
  .auth-dialog .modal-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .auth-dialog .modal-actions > .button { width: 100%; }

  .modal.full { width: 100%; height: calc(100dvh - 16px); padding: 0; }
  .opening-choice-list { max-height: min(280px, 34dvh); padding-right: 2px; scrollbar-gutter: auto; }
  .opening-choice { grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .new-conversation-form .modal-actions { position: sticky; bottom: -18px; margin-inline: -14px; padding: 12px 14px calc(2px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .new-conversation-form .modal-actions .button { width: 100%; }

}

@media (max-width: 700px) {
  .boot-shell { grid-template-columns: 1fr; }
  .boot-sidebar { display: none; }
  .boot-topbar { padding: 0 14px; }
  .boot-workspace { grid-template-columns: 1fr; padding: 10px; }
  .boot-panel.rail, .boot-panel.detail { display: none; }

}

@media (max-width: 700px) {
  body.keyboard-open .mobile-nav { display: none; }

}

/* Wonderstage UI 2.0: player platform and immersive playroom */
.app-shell { padding-left: 76px; }
.sidebar {
  width: 76px;
  padding: 14px 10px;
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
}
.brand { justify-content: center; min-height: 52px; padding: 0 0 18px; }
.brand > span:last-child,
.sidebar .nav-label,
.sidebar .nav-button span,
.sidebar .account-strip > span:not(.avatar),
.sidebar .account-strip > svg { display: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 8px; }
.nav-group { display: grid; justify-items: center; gap: 5px; margin-bottom: 18px; }
.nav-button {
  position: relative;
  width: 48px;
  min-height: 48px;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
}
.nav-button.active::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-button:hover,
.nav-button.active { background: var(--brand-soft); color: var(--brand); }
.sidebar-footer { justify-items: center; }
.sidebar-tools { width: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0; }
.sidebar-tools .icon-button { width: 22px; min-height: 30px; border: 0; background: transparent; }
.sidebar .account-strip {
  width: 48px;
  min-height: 50px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}
.sidebar .avatar { width: 36px; height: 36px; border-radius: 8px; }

.topbar {
  min-height: 68px;
  padding: 12px 30px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom-color: color-mix(in srgb, var(--line) 82%, transparent);
}
.search-box { width: min(560px, 62vw); }
.search-box input {
  height: 42px;
  border-color: transparent;
  background: var(--surface-strong, var(--surface));
  box-shadow: inset 0 0 0 1px var(--line);
}
.top-actions .icon-button,
.top-actions .button { min-height: 42px; }
.page { max-width: 1560px; padding: 38px 42px 96px; }
.page-heading { align-items: flex-start; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(30px, 3vw, 42px); font-weight: 760; line-height: 1.12; }
.page-heading p { max-width: 54ch; margin-top: 9px; font-size: 14px; line-height: 1.7; }
.explore-heading { min-height: 72px; }

.button,
.icon-button,
.chip,
.segment {
  min-height: var(--ws-control-height);
  border-radius: var(--ws-radius-control);
  border-color: var(--ws-line-strong);
  background: var(--surface-raised, var(--surface));
  transition: background-color var(--ws-duration-fast) var(--ws-ease), border-color var(--ws-duration-fast) var(--ws-ease), color var(--ws-duration-fast) var(--ws-ease), transform var(--ws-duration-fast) var(--ws-ease);
}
.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 46%, var(--line)); }
.button:active:not(:disabled),
.icon-button:active:not(:disabled) { transform: scale(.98); }
.button.primary,
.icon-button.primary { background: var(--brand-solid); border-color: var(--brand-solid); color: #f7faf7; }
.button.primary:hover:not(:disabled),
.icon-button.primary:hover:not(:disabled) { background: var(--ws-accent-hover); border-color: var(--ws-accent-hover); }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.button.amber { background: var(--ws-warning-soft); border-color: color-mix(in srgb, var(--amber) 28%, var(--line)); color: var(--amber); }
.ranking-tabs { padding: 2px; background: var(--surface-soft); border-radius: 8px; }
.segment.active { box-shadow: none; }
.category-row { gap: 8px; margin-bottom: 26px; }
.chip { border-radius: 6px; }
.chip.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--brand); }

.story-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; align-items: stretch; }
.story-card {
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}
.story-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 50%, var(--line)), var(--ws-shadow-float); }
.story-cover { position: relative; flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px 8px 0 0; }
.story-cover img { position: absolute; inset: 0; transition: transform 420ms var(--ws-ease); }
.story-card:hover .story-cover img { transform: scale(1.025); }
.cover-fallback { align-content: center; gap: 6px; background: var(--ws-accent-softer); color: var(--brand); }
.cover-fallback strong { font-size: 32px; font-weight: 720; line-height: 1; }
.cover-fallback small { color: var(--muted); font-size: 11px; font-weight: 650; }
.story-body { padding: 16px 16px 17px; }
.story-kicker { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-metrics { flex: none; display: flex; gap: 9px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.story-metrics span + span { padding-left: 9px; border-left: 1px solid var(--line); }
.story-play-metrics { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 9px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.story-play-metrics span + span { padding-left: 10px; border-left: 1px solid var(--line); }
.story-config-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--line); font-variant-numeric: tabular-nums; }
.story-config-stats > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface-soft); }
.story-config-stats small { color: var(--muted); font-size: 10px; }
.story-config-stats strong { color: var(--text); font-size: 15px; line-height: 1; }
.story-config-stats b { margin-left: 2px; color: var(--muted); font-size: 9px; font-weight: 600; }
.story-body h3 { display: -webkit-box; min-height: calc(1.35em * 2); margin: 8px 0 7px; overflow: hidden; font-size: 17px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.story-body p { display: -webkit-box; height: calc(1.6em * 2); min-height: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.story-card .tag-list { max-height: 25px; overflow: hidden; }
.story-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.story-grid.compact .story-kicker { align-items: flex-start; }
.story-grid.compact .story-metrics { display: none; }

.conversation-table,
.world-entry { border-radius: 8px; background: var(--surface); }
.conversation-row { min-height: 76px; padding: 14px 16px; }
.conversation-row:hover { background: var(--ws-accent-softer); }
.consumption-summary { border-block-color: var(--line-strong); }
.points-entry-icon,
.consumption-icon { background: var(--brand-soft); }
.empty-state { border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 48%, transparent); }
.modal-backdrop { background: var(--ws-backdrop); backdrop-filter: blur(5px); }
.modal { border-radius: 8px; box-shadow: var(--ws-shadow-overlay); }
.toast { background: var(--ws-ink); color: var(--ws-surface); box-shadow: var(--ws-shadow-float); }
.rail-header,
.chat-header,
.inspector-header { min-height: 60px; padding: 10px 13px; }
.session-open { border-radius: 6px; }
.session-open.active { box-shadow: inset 3px 0 0 var(--brand); }
.empty-chat { text-align: left; justify-items: start; }
.empty-chat-inner { max-width: 660px; margin-left: clamp(0px, 7vw, 100px); }
.empty-chat-inner .brand-mark { margin: 0 0 18px !important; }
.empty-chat h2 { max-width: 22ch; font-size: clamp(28px, 4vw, 48px); line-height: 1.2; }
.empty-chat p { max-width: 58ch; font-family: var(--ws-font-reading); font-size: 16px; line-height: 1.9; }
.empty-chat-actions { justify-content: flex-start; }

@media (max-width: 1250px) {
  .story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

}

@media (max-width: 980px) {
  :root { --sidebar: 76px; }
  .page { padding-inline: 28px; }
  .story-grid,
  .story-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

}

@media (max-width: 700px) {
  .app-shell { padding-left: 0; }
  .page { padding: 22px 14px 84px; }
  .topbar { min-height: 58px; padding: 8px 12px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading h1 { font-size: 28px; }
  .story-grid,
  .story-grid.compact { grid-template-columns: 1fr; gap: 16px; }
  .story-cover,
  .story-grid.compact .story-cover { height: auto; aspect-ratio: 16 / 10; }
  .chat-header-actions { flex: 1; justify-content: flex-end; }
  .model-select { max-width: min(35vw, 126px); }
  .empty-chat { padding: 24px 18px; }
  .empty-chat-inner { margin-left: 0; }
  .empty-chat h2 { font-size: 30px; }
  .empty-chat p { font-size: 15px; }

}

/* Explore refinement: keep frequent choices visible and disclose the long tail. */
.explore-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}
.explore-primary-filters {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.explore-primary-filters .category-row,
.explore-more-panel .category-row { margin-bottom: 0; }
.explore-more-filters { min-width: 0; }
.explore-more-filters > summary {
  width: fit-content;
  min-height: var(--ws-control-height);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}
.explore-more-filters > summary::-webkit-details-marker { display: none; }
.explore-more-filters > summary:hover { color: var(--ink); }
.explore-more-filters > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.explore-more-filters > summary svg { width: 16px; height: 16px; }
.explore-more-filters > summary small {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10px;
}
.explore-more-panel {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 20px;
  margin-top: 9px;
  padding: 16px 0 2px;
  border-top: 1px solid var(--line);
}
.explore-more-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.explore-more-panel legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

/* Cards foreground the world itself; operational metrics belong in details. */
.story-card .tag-list { min-height: 25px; }

.actionable-empty { grid-column: 1 / -1; }
.actionable-empty h2 { margin: 0; color: var(--ink); font-size: 18px; }
.actionable-empty p { max-width: 52ch; margin: 8px auto 18px; color: var(--muted); line-height: 1.65; }
.auth-gate { padding: 44px 16px; text-align: center; }
.auth-gate h2 { margin: 0; font-size: 18px; color: var(--ink); }
.auth-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* The compact desktop rail still names the current destination. */
@media (min-width: 701px) and (max-width: 980px) {
  :root { --sidebar: 112px; }
  .sidebar .nav-button.active {
    justify-content: flex-start;
    gap: 7px;
    padding-inline: 10px;
  }
  .sidebar .nav-button.active span {
    min-width: 0;
    display: block;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

}

@media (max-width: 700px) {
  .button,
  .icon-button,
  .chip,
  .segment,
  .model-select,
  .session-open,
  .session-actions .icon-button,
  .message-tools .icon-button,
  .explore-more-filters > summary { min-height: 44px; }
  .icon-button,
  .session-actions .icon-button,
  .message-tools .icon-button { width: 44px; }
  .button.small { min-height: 44px; }
  .explore-search { grid-template-columns: 20px minmax(0, 1fr) 44px; }
  .explore-search.has-clear { grid-template-columns: 20px minmax(0, 1fr) 44px 44px; }
  .explore-search input { height: 44px; }
  .explore-primary-filters { display: grid; gap: 8px; }
  .explore-primary-filters .ranking-tabs,
  .explore-primary-filters .category-row { width: 100%; }
  .explore-primary-filters .category-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .explore-more-panel { grid-template-columns: 1fr; gap: 16px; }
  .explore-more-panel .ranking-tabs { width: 100%; }
  .chat-header-actions { gap: 2px; }
  .chat-header-actions .model-select { max-width: 88px; }

}
.rail-close { margin-left: auto; }
.chat-header-actions { min-width: 0; }
@media (max-width: 1200px) and (min-width: 701px) {
  .workspace-primary-tools .button { width: 38px; padding-inline: 0; }
  .workspace-primary-tools .button span { display: none; }

}

@media (max-width: 700px) {
  .chat-header-actions { flex: none; margin-left: 0; }
  .chat-header-actions .model-select,
  .chat-header-actions .desktop-chat-action { display: none; }

}

/* Mod marketplace and immutable conversation attachments. */
.page-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 760;
}
.mod-page-heading h1 { font-size: 34px; }
.mod-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.mod-tabs .segment {
  min-height: 42px;
  padding: 0 3px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.mod-tabs .segment.active { border-bottom-color: var(--brand); color: var(--ink); }
.mod-view { min-width: 0; }
.mod-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 180px) auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mod-search { position: relative; min-width: 0; }
.mod-search svg { position: absolute; left: 12px; top: 12px; width: 17px; color: var(--muted); }
.mod-search input,
.mod-filters select,
.mod-rating-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
}
.mod-search input { padding: 0 12px 0 39px; }
.mod-filters select,
.mod-rating-control select { padding: 0 34px 0 11px; }
.mod-search input:focus,
.mod-filters select:focus,
.mod-rating-control select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.mod-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 1px;
  color: var(--muted);
  font-size: 11px;
}
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mod-card {
  min-width: 0;
  min-height: 315px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color var(--ws-duration-fast) var(--ws-ease), transform var(--ws-duration-fast) var(--ws-ease);
}
.mod-card:hover { border-color: color-mix(in srgb, var(--brand) 46%, var(--line)); transform: translateY(-2px); }
.mod-card.installed { box-shadow: inset 3px 0 0 var(--brand); }
.mod-card-head,
.mod-card footer,
.mod-card-actions,
.mod-card-title,
.mod-creator-toolbar { display: flex; align-items: center; }
.mod-card-head { min-height: 23px; justify-content: space-between; gap: 10px; }
.mod-category,
.mod-status,
.mod-price {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 740;
}
.mod-category { background: var(--brand-soft); color: var(--brand); }
.mod-price { background: color-mix(in srgb, var(--amber) 17%, var(--surface)); color: color-mix(in srgb, var(--amber) 78%, var(--ink)); }
.mod-status { background: var(--surface-soft); color: var(--muted); }
.mod-status.published { background: var(--brand-soft); color: var(--brand); }
.mod-status.archived { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.mod-card-title {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.mod-card-title h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 17px; line-height: 1.4; }
.mod-card-title span { flex: none; color: var(--muted); font-family: var(--ws-font-mono); font-size: 10px; }
.mod-card > p {
  min-height: 44px;
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.mod-card .tag-list { min-height: 23px; max-height: 23px; overflow: hidden; }
.mod-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.mod-card:has(.mod-status) .mod-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mod-metrics div { min-width: 0; }
.mod-metrics dt { color: var(--muted); font-size: 9px; }
.mod-metrics dd { margin: 3px 0 0; overflow: hidden; font-size: 11px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.mod-card footer { justify-content: space-between; gap: 9px; margin-top: auto; padding-top: 13px; }
.mod-card footer > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mod-card-actions { flex: none; justify-content: flex-end; gap: 5px; }
.mod-card-actions .icon-button { width: 32px; min-height: 32px; }
.mod-card-actions .button.quiet { border-color: transparent; background: transparent; }
.mod-notice { display: flex; gap: 7px; margin-top: 10px; padding: 8px; border-radius: 6px; font-size: 10px; line-height: 1.5; }
.mod-notice svg { width: 15px; flex: none; }
.mod-notice.danger { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.mod-creator-toolbar { justify-content: space-between; gap: 18px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mod-creator-toolbar > div { display: grid; gap: 3px; }
.mod-creator-toolbar span { color: var(--muted); font-size: 11px; }
.mod-creator-toolbar .mod-creator-tools { display: flex; align-items: center; }
.mod-purchase-summary { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-block: 1px solid var(--line); }
.mod-detail header { padding-right: 38px; }
.mod-detail header h2 { margin: 10px 0 7px; font-size: 26px; }
.mod-detail header p,
.mod-detail-description p,
.mod-changelog p { color: var(--muted); line-height: 1.75; }
.mod-detail-byline { display: flex; justify-content: space-between; gap: 15px; margin-top: 17px; padding: 11px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.mod-detail-description p { white-space: pre-wrap; }
.mod-detail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 0; border-block: 1px solid var(--line); }
.mod-detail-stats div { padding: 13px 9px; border-right: 1px solid var(--line); }
.mod-detail-stats div:last-child { border-right: 0; }
.mod-detail-stats dt { color: var(--muted); font-size: 11px; }
.mod-detail-stats dd { margin: 4px 0 0; font-size: 17px; font-weight: 760; }
.mod-detail-stats dd small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 600; }
.mod-changelog { margin-top: 18px; }
.mod-changelog h3 { margin: 0; font-size: 17px; }
.mod-changelog p { margin: 5px 0 0; white-space: pre-wrap; }
.mod-reviews { margin-top: 22px; }
.mod-reviews-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.mod-reviews-heading h3 { margin: 0; font-size: 17px; }
.mod-reviews-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.mod-reviews-heading > strong { color: var(--brand); font-size: 25px; line-height: 1; }
.mod-reviews-heading > strong small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mod-rating-control { display: grid; grid-template-columns: minmax(100px, 1fr) 110px auto; align-items: center; gap: 8px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.mod-rating-control > span { font-size: 14px; font-weight: 740; }
.mod-rating-control textarea { grid-column: 1 / -1; width: 100%; min-height: 76px; resize: vertical; }
.mod-rating-control > div { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mod-review-count { color: var(--muted); font-size: 11px; }
.mod-review-list { margin-top: 14px; border-top: 1px solid var(--line); }
.mod-review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mod-review header { display: flex; align-items: baseline; gap: 8px; }
.mod-review header strong { font-size: 13px; }
.mod-review header span { color: var(--brand); font-size: 12px; font-weight: 740; }
.mod-review header time { margin-left: auto; color: var(--muted); font-size: 11px; }
.mod-review p { margin: 7px 0 0; white-space: pre-wrap; color: var(--text); font-size: 13px; line-height: 1.7; }
.mod-detail .modal-actions { align-items: center; }
.mod-detail-price { margin-right: auto; color: var(--muted); font-size: 14px; font-weight: 740; }
.modal:has(.mod-editor-workbench) { width: min(1160px, 100%); }
.mod-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-right: 38px; }
.mod-editor-heading > div:first-child { min-width: 0; }
.mod-editor-heading h2 { overflow-wrap: anywhere; }
.mod-editor-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.mod-editor-heading > div:last-child { display: flex; flex: none; gap: 7px; }
.mod-editor-workbench { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 24px; align-items: start; margin-top: 18px; }
.mod-editor-preview { min-width: 0; position: sticky; top: -1px; padding-left: 24px; border-left: 1px solid var(--line); }
.mod-editor .form-grid { margin-top: 0; }
.mod-editor .mod-visibility-field { padding: 11px 12px 12px; border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line)); border-radius: 7px; background: color-mix(in srgb, var(--brand-soft) 58%, var(--surface)); }
.mod-editor .mod-visibility-field label { font-weight: 700; }
.mod-editor .mod-visibility-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mod-form-error { margin-top: 14px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: 6px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); font-size: 14px; line-height: 1.6; }
.mod-form-error .button { margin-left: 8px; }
.mod-editor .mod-prompt-field textarea { min-height: 250px; font-family: var(--ws-font-mono); font-size: 14px; }
.mod-prompt-field label { display: flex; justify-content: space-between; gap: 12px; }
.mod-prompt-field label span { color: var(--muted); font-family: var(--ws-font-mono); font-size: 11px; }
.mod-trial-dialog > header { padding-right: 38px; }
.mod-trial-dialog > header h2 { margin: 10px 0 5px; font-size: 26px; overflow-wrap: anywhere; }
.mod-trial-dialog > header p { margin: 0; color: var(--muted); font-size: 14px; }
.mod-preview { min-width: 0; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.mod-editor-preview .mod-preview { margin-top: 0; padding-top: 0; border-top: 0; }
.mod-preview-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mod-preview-head > div { min-width: 0; display: grid; gap: 2px; }
.mod-preview-head span { color: var(--brand); font-size: 11px; font-weight: 760; }
.mod-preview-head h3 { margin: 0; overflow-wrap: anywhere; font-size: 17px; }
.mod-preview-settings { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr); gap: 9px; margin-top: 12px; }
.mod-preview-settings label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 720; }
.mod-preview-settings select,
.mod-preview-settings input,
.mod-preview-composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); outline: none; }
.mod-preview-settings select,
.mod-preview-settings input { min-height: 38px; padding: 0 9px; }
.mod-preview-settings select:focus,
.mod-preview-settings input:focus,
.mod-preview-composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.mod-preview-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 13px 0 0; border-block: 1px solid var(--line); background: var(--surface-soft); }
.mod-preview-metrics div { min-width: 0; padding: 9px 7px; border-right: 1px solid var(--line); }
.mod-preview-metrics div:last-child { border-right: 0; }
.mod-preview-metrics dt { color: var(--muted); font-size: 11px; }
.mod-preview-metrics dd { margin: 3px 0 0; overflow: hidden; font-family: var(--ws-font-mono); font-size: 11px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.mod-preview-messages { min-height: 280px; max-height: min(390px, 42dvh); overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 13px 2px; scrollbar-gutter: stable; }
.mod-preview-empty { min-height: 250px; display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 11px; line-height: 1.65; text-align: center; }
.mod-preview-message { width: min(88%, 520px); margin: 0; }
.mod-preview-message.user { align-self: flex-end; }
.mod-preview-message header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); }
.mod-preview-message header > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.mod-preview-message header svg { width: 12px; height: 12px; }
.mod-preview-message header strong { color: var(--ink); font-size: 11px; }
.mod-preview-message header small { margin-left: auto; font-size: 11px; }
.mod-preview-message p { margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-preview-message.user p { border-color: color-mix(in srgb, var(--brand) 28%, var(--line)); background: var(--brand-soft); }
.mod-preview-pending { align-self: flex-start; padding: 8px 10px; color: var(--muted); font-size: 11px; }
.mod-preview-status { min-height: 16px; margin: 0 0 7px; color: var(--muted); font-size: 11px; }
.mod-preview-composer { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; align-items: end; }
.mod-preview-composer textarea { min-height: 70px; max-height: 170px; padding: 9px 10px; resize: vertical; font-size: 14px; line-height: 1.55; }
.mod-preview-composer .icon-button { min-height: 38px; }
.mod-version-dialog > p { margin: 0 0 17px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mod-version-loading,
.mod-version-empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.mod-version-list { border-top: 1px solid var(--line); }
.mod-version-row { min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.mod-version-row.current { box-shadow: inset 3px 0 0 var(--brand); padding-left: 10px; }
.mod-version-index { display: grid; gap: 3px; }
.mod-version-index strong { font-family: var(--ws-font-mono); font-size: 14px; }
.mod-version-index span { width: max-content; color: var(--brand); font-size: 11px; font-weight: 760; }
.mod-version-row > div:nth-child(2) { min-width: 0; }
.mod-version-row p { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.mod-version-row small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-family: var(--ws-font-mono); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mod-version-confirm { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mod-version-confirm > div { min-width: 0; display: grid; gap: 3px; margin-right: auto; }
.mod-version-confirm strong { font-size: 14px; }
.mod-version-confirm span { color: var(--muted); font-size: 11px; }
.modal:has(.new-conversation-form) { max-height: 92vh; }
.conversation-mod-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.conversation-mod-picker legend { width: 100%; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
.conversation-mod-picker legend small { color: var(--muted); font-weight: 600; }
.conversation-mod-picker > p { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.conversation-mod-choice-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; scrollbar-gutter: stable; }
.conversation-mod-choice { min-width: 0; display: grid; grid-template-columns: 18px 22px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 11px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conversation-mod-choice:last-child { border-bottom: 0; }
.conversation-mod-choice:has(input:checked) { background: var(--brand-soft); }
.conversation-mod-choice input { width: 17px; height: 17px; accent-color: var(--brand); }
.conversation-mod-choice > span:last-child { min-width: 0; display: grid; gap: 3px; }
.conversation-mod-choice strong,
.conversation-mod-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-mod-choice strong { font-size: 12px; }
.conversation-mod-choice small { color: var(--muted); font-size: 10px; }
.conversation-mod-order { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--brand); font-size: 10px; font-weight: 760; }
.conversation-mod-picker .empty-state.compact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; text-align: left; }
.new-conversation-status { display: grid; justify-items: start; gap: 7px; min-height: 112px; align-content: center; color: var(--muted); }
.new-conversation-status strong { color: var(--text); font-size: 14px; }
.new-conversation-status.danger strong { color: var(--danger); }
.new-conversation-status .button { margin-top: 5px; }

@media (max-width: 1180px) {
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-filters { grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px); }
  .mod-filters .ranking-tabs { grid-column: 1 / -1; width: max-content; }

}

@media (max-width: 980px) {
  .modal:has(.mod-editor-workbench) { width: min(760px, 100%); }
  .mod-editor-workbench { grid-template-columns: 1fr; }
  .mod-editor-preview { position: static; padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }

}

@media (max-width: 700px) {
  .mod-page-heading { align-items: stretch; flex-direction: column; }
  .mod-page-heading h1 { font-size: 28px; }
  .mod-page-heading > .button { width: 100%; }
  .mod-tabs { gap: 10px; overflow-x: auto; }
  .mod-tabs .segment { min-width: max-content; flex: 1; }
  .mod-filters { grid-template-columns: 1fr; }
  .mod-filters .ranking-tabs { grid-column: auto; width: 100%; }
  .mod-result-meta { display: grid; gap: 4px; }
  .mod-grid { grid-template-columns: 1fr; }
  .mod-card { min-height: 0; padding: 14px; }
  .mod-card:hover { transform: none; }
  .mod-card footer { align-items: flex-end; flex-direction: column; }
  .mod-card footer > span { width: 100%; }
  .mod-card-actions { width: 100%; flex-wrap: wrap; }
  .mod-card-actions .icon-button { width: 44px; min-height: 44px; }
  .mod-card-actions .button:not(.quiet) { flex: 1; }
  .mod-creator-toolbar { align-items: stretch; flex-direction: column; }
  .mod-creator-toolbar .mod-creator-tools .button { width: 100%; }
  .mod-detail header h2 { font-size: 26px; }
  .mod-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-detail-stats div:nth-child(2) { border-right: 0; }
  .mod-detail-stats div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .mod-rating-control { grid-template-columns: 1fr auto; }
  .mod-rating-control > span { grid-column: 1 / -1; }
  .mod-detail .modal-actions { flex-wrap: wrap; }
  .mod-detail-price { width: 100%; margin: 0; }
  .mod-detail .modal-actions .button { flex: 1; }
  .mod-editor-heading { align-items: stretch; flex-direction: column; gap: 12px; padding-right: 30px; }
  .mod-editor-heading > div:last-child .button { flex: 1; }
  .mod-editor-workbench { gap: 18px; margin-top: 14px; }
  .mod-editor .mod-prompt-field textarea { min-height: 240px; }
  .mod-preview-settings { grid-template-columns: 1fr; }
  .mod-preview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-preview-metrics div { border-bottom: 1px solid var(--line); }
  .mod-preview-metrics div:nth-child(2n) { border-right: 0; }
  .mod-preview-metrics div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .mod-preview-messages { min-height: 230px; max-height: 38dvh; }
  .mod-preview-empty { min-height: 200px; }
  .mod-preview-message { width: 94%; }
  .mod-preview-composer { grid-template-columns: minmax(0, 1fr) 44px; }
  .mod-preview-composer .icon-button { min-height: 44px; }
  .mod-version-row { grid-template-columns: 55px minmax(0, 1fr); }
  .mod-version-row > .button { grid-column: 2; width: 100%; }
  .mod-version-confirm { align-items: stretch; flex-wrap: wrap; }
  .mod-version-confirm > div { width: 100%; }
  .mod-version-confirm .button { flex: 1; }
  .conversation-mod-choice-list { max-height: min(210px, 27dvh); }
  .conversation-mod-picker .empty-state.compact { align-items: stretch; flex-direction: column; }
  .conversation-mod-picker .empty-state.compact .button { width: 100%; }

}

/* Author introduction uses the existing platform stylesheet loader. */
.story-introduction { min-height: 360px; height: 60vh; }
.story-introduction > [data-external-renderer-host] { height: 100%; }

/* field-archive.css */
/* Parker Field Archive: shared visual layer for player, creator, and admin surfaces. */

body.parker-app,
body.parker-admin {
  --archive-spine: #14262e;
  --archive-spine-raised: #1b333d;
  --archive-spine-ink: #edf4f5;
  --archive-spine-muted: #9bb0b8;
  --archive-signal: var(--ws-signal);
  --archive-signal-hover: var(--ws-signal-hover);
  --archive-signal-soft: var(--ws-signal-soft);
  background: var(--ws-canvas);
  color: var(--ws-ink);
}

body.parker-app.dark {
  --archive-spine: #0b1418;
  --archive-spine-raised: #14242b;
  --archive-spine-ink: #edf4f5;
  --archive-spine-muted: #9fb1b8;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  border: 1px solid var(--ws-ink);
  border-radius: 2px;
  background: var(--ws-surface-raised);
  color: var(--ws-ink);
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform var(--ws-duration-fast) var(--ws-ease);
}

.skip-link:focus { transform: translateY(0); }

body.parker-app h1,
body.parker-app h2,
body.parker-app h3,
body.parker-admin h1,
body.parker-admin h2,
body.parker-admin h3 {
  font-family: var(--ws-font-display);
  letter-spacing: 0;
  text-wrap: balance;
}

body.parker-app .button,
body.parker-app .icon-button,
body.parker-app .chip,
body.parker-app .segment,
body.parker-admin .button,
body.parker-admin .icon-button,
body.parker-admin .tab {
  border-radius: var(--ws-radius-control);
}

body.parker-app .button.primary {
  border-color: var(--archive-signal);
  background: var(--archive-signal);
  color: #fff;
}

body.parker-app .button.primary:hover:not(:disabled) {
  border-color: var(--archive-signal-hover);
  background: var(--archive-signal-hover);
}

body.parker-app .button:focus-visible,
body.parker-app .icon-button:focus-visible,
body.parker-app .nav-button:focus-visible,
body.parker-admin .button:focus-visible,
body.parker-admin .icon-button:focus-visible,
body.parker-admin .nav-item:focus-visible {
  outline-color: var(--ws-accent);
}

body.parker-app .tag,
body.parker-admin .badge {
  border-radius: 2px;
}

/* Loading shell */
body.parker-app .boot-shell {
  grid-template-columns: 216px minmax(0, 1fr);
  background: var(--ws-canvas);
}

body.parker-app .boot-sidebar {
  padding: 24px 20px;
  border-right: 0;
  background: var(--archive-spine);
}

body.parker-app .boot-sidebar .boot-line,
body.parker-app .boot-sidebar .boot-mark { background: var(--archive-spine-raised); }
body.parker-app .boot-mark { border-radius: 4px; }
body.parker-app .boot-topbar { height: 70px; padding-inline: 32px; background: var(--ws-surface); }
body.parker-app .boot-workspace { padding: 24px 28px; gap: 18px; }
body.parker-app .boot-panel { border-radius: 4px; }

/* Player shell */
body.parker-app {
  --sidebar: 216px;
  --topbar: 70px;
}

body.parker-app .app-shell { padding-left: var(--sidebar); }

body.parker-app .sidebar {
  width: var(--sidebar);
  padding: 20px 14px 16px;
  border-right: 0;
  background: var(--archive-spine);
  color: var(--archive-spine-ink);
}

body.parker-app .brand {
  min-height: 58px;
  gap: 12px;
  margin: 0 4px 28px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

body.parker-app .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
  background: transparent;
}

body.parker-app .brand > span { min-width: 0; display: grid; gap: 2px; }
body.parker-app .brand strong { font-family: var(--ws-font-display); font-size: 21px; line-height: 1; }
body.parker-app .brand small { color: var(--archive-spine-muted); font-size: 10px; font-weight: 600; }

body.parker-app .nav-group { justify-items: stretch; margin-bottom: 24px; }
body.parker-app .sidebar .nav-label { display: block; padding: 0 12px 8px; color: #78909a; font-size: 10px; font-weight: 700; }
body.parker-app .sidebar .nav-button > span { display: inline; }
body.parker-app .sidebar .account-strip > span:not(.avatar) { display: grid; }
body.parker-app .sidebar .account-strip > svg { display: block; }

body.parker-app .nav-button {
  position: relative;
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  gap: 11px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 2px;
  color: var(--archive-spine-muted);
  transition: background-color var(--ws-duration-fast) var(--ws-ease), color var(--ws-duration-fast) var(--ws-ease), transform var(--ws-duration-fast) var(--ws-ease);
}

body.parker-app .nav-button::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 1px;
  height: auto;
  border-radius: 0;
  background: transparent;
}

body.parker-app .nav-button:hover {
  background: var(--archive-spine-raised);
  color: var(--archive-spine-ink);
}

body.parker-app .nav-button.active {
  background: #eaf3f5;
  color: #123743;
}

body.parker-app.dark .nav-button.active { background: #cce5eb; color: #102b34; }
body.parker-app .nav-button.active::before { background: var(--archive-signal); }
body.parker-app .nav-button svg { width: 17px; height: 17px; }

body.parker-app .sidebar-footer {
  width: 100%;
  justify-items: stretch;
  gap: 8px;
}

body.parker-app .sidebar-tools {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

body.parker-app .sidebar-tools .icon-button {
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--archive-spine-muted);
}
body.parker-app .sidebar-tools .icon-button:hover { border-color: rgb(255 255 255 / 28%); background: var(--archive-spine-raised); color: #fff; }

body.parker-app .sidebar .account-strip {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  align-items: center;
  justify-items: stretch;
  gap: 9px;
  padding: 7px 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--archive-spine-ink);
  text-align: left;
}

body.parker-app .sidebar .account-strip:hover { background: var(--archive-spine-raised); color: #fff; }
body.parker-app .sidebar .account-strip > span:not(.avatar) { min-width: 0; }
body.parker-app .sidebar .account-strip > svg { justify-self: end; color: var(--archive-spine-muted); }
body.parker-app .sidebar .account-name { color: var(--archive-spine-ink); font-weight: 700; }
body.parker-app .sidebar .account-points { color: var(--archive-spine-muted); }
body.parker-app .sidebar .avatar {
  width: 30px;
  height: 30px;
  border: 1px solid rgb(237 244 245 / 24%);
  border-radius: 3px;
  background: rgb(237 244 245 / 8%);
  color: var(--archive-spine-ink);
  font-size: 12px;
}

body.parker-app .topbar {
  min-height: var(--topbar);
  padding: 11px 32px;
  border-bottom-color: var(--ws-line);
  background: color-mix(in srgb, var(--ws-surface) 95%, transparent);
  backdrop-filter: blur(12px);
}

body.parker-app .search-box { width: min(680px, 100%); }
body.parker-app .search-box input {
  height: 42px;
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
}
body.parker-app .search-box svg { top: 12px; }
body.parker-app .top-actions { gap: 8px; }
body.parker-app .mobile-brand { display: none; }

body.parker-app .page {
  max-width: 1520px;
  padding: 34px 38px 96px;
}

body.parker-app .page-heading {
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ws-line-strong);
}

body.parker-app .page-heading h1 {
  max-width: 16ch;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.08;
}

body.parker-app .page-heading p { max-width: 62ch; margin-top: 8px; color: var(--ws-muted-strong); line-height: 1.65; }

body.parker-app .button,
body.parker-app .icon-button,
body.parker-app .segment {
  border-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
}

body.parker-app .button:hover:not(:disabled),
body.parker-app .icon-button:hover:not(:disabled) {
  border-color: var(--ws-accent);
  background: var(--ws-accent-softer);
}

body.parker-app .ranking-tabs {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ws-line);
  border-radius: 3px;
  background: var(--ws-canvas-subtle);
}

body.parker-app .segment { border: 0; background: transparent; }
body.parker-app .segment.active { background: var(--ws-ink); color: var(--ws-surface-raised); box-shadow: none; }

body.parker-app .chip {
  min-height: 32px;
  border-radius: 3px;
  background: transparent;
}

body.parker-app .chip.active { border-color: var(--ws-accent); background: var(--ws-accent); color: #fff; }

/* Explore index */
body.parker-app .explore-filters {
  margin-bottom: 24px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--ws-line);
  border-bottom: 1px solid var(--ws-line);
}

body.parker-app .explore-primary-filters { align-items: flex-start; gap: 14px; }
body.parker-app .category-row { margin-bottom: 0; }
body.parker-app .explore-more-filters > summary { border-radius: 3px; }
body.parker-app .explore-more-panel { border-radius: 3px; background: var(--ws-surface); }

body.parker-app .story-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

body.parker-app .story-card {
  position: relative;
  min-height: 370px;
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
  box-shadow: none;
  transition: transform var(--ws-duration) var(--ws-ease), box-shadow var(--ws-duration) var(--ws-ease), border-color var(--ws-duration-fast) var(--ws-ease);
}

body.parker-app .story-grid:not(.compact) .story-card:first-child {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(250px, .95fr);
}

body.parker-app .story-card:hover {
  z-index: 1;
  border-color: var(--ws-accent);
  box-shadow: var(--ws-shadow-float);
  transform: translateY(-3px);
}

body.parker-app .story-cover {
  height: 190px;
  overflow: hidden;
  background: var(--ws-canvas-subtle);
}

body.parker-app .story-grid:not(.compact) .story-card:first-child .story-cover { height: 100%; min-height: 368px; }
body.parker-app .story-cover img { transition: transform .55s var(--ws-ease), filter .3s ease; }
body.parker-app .story-card:hover .story-cover img { transform: scale(1.025); }

body.parker-app .story-index {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  min-width: 32px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: 2px;
  background: var(--archive-signal);
  color: #fff;
  font-family: var(--ws-font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

body.parker-app .story-body { padding: 17px 16px 16px; }
body.parker-app .story-grid:not(.compact) .story-card:first-child .story-body { padding: 24px 22px; }
body.parker-app .story-kicker { align-items: center; }
body.parker-app .story-author { color: var(--ws-accent); font-size: 11px; }
body.parker-app .story-body h3 { margin: 7px 0 9px; font-size: 20px; line-height: 1.25; }
body.parker-app .story-grid:not(.compact) .story-card:first-child h3 { font-size: 28px; }
body.parker-app .story-grid:not(.compact) .story-card:first-child h3 {
  min-height: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
body.parker-app .story-body p { height: auto; min-height: 42px; color: var(--ws-muted-strong); }
body.parker-app .story-grid:not(.compact) .story-card:first-child p { display: -webkit-box; min-height: 84px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
body.parker-app .story-meta { border-top: 1px solid var(--ws-line); }
body.parker-app .tag { background: var(--ws-accent-soft); color: var(--ws-accent-strong); }

body.parker-app .story-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
body.parker-app .story-grid.compact .story-card { min-height: 250px; }
body.parker-app .story-grid.compact .story-cover { height: 130px; }

body.parker-app .rail-header,
body.parker-app .inspector-header,
body.parker-app .chat-header {
  min-height: 66px;
  border-bottom-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
}

body.parker-app .session-item {
  margin: 0 8px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
}

body.parker-app .session-item:hover { background: var(--ws-accent-softer); }
body.parker-app .session-item.active { border-color: var(--ws-accent); background: var(--ws-accent-soft); box-shadow: none; }

body.parker-app .conversation-opening-note {
  width: min(680px, 100%);
  padding: 28px clamp(20px, 4vw, 42px) 24px;
  border-block: 1px solid var(--ws-line-strong);
  background: color-mix(in srgb, var(--ws-surface-raised) 72%, transparent);
}

body.parker-app .conversation-opening-note header,
body.parker-app .conversation-opening-note footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.parker-app .conversation-opening-note header { color: var(--ws-muted); font-size: 11px; }
body.parker-app .conversation-opening-note header span { color: var(--archive-signal); font-weight: 800; }
body.parker-app .conversation-opening-note h2 {
  max-width: 18ch;
  margin: 24px 0 16px;
  font-family: var(--ws-font-display);
  font-size: 34px;
  line-height: 1.18;
}
body.parker-app .conversation-opening-note p {
  display: -webkit-box;
  max-width: 62ch;
  margin: 0;
  overflow: hidden;
  color: var(--ws-muted-strong);
  font-family: var(--ws-font-reading);
  font-size: 15px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
body.parker-app .conversation-opening-note footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--ws-line);
  color: var(--ws-muted);
  font-size: 11px;
}
body.parker-app .conversation-opening-note footer strong { color: var(--ws-accent-strong); }

/* Shared records, forms, and overlays */
body.parker-app .form-card,
body.parker-app .profile-points,
body.parker-app .conversation-table,
body.parker-app .points-ledger,
body.parker-app .consumption-summary,
body.parker-app .metric-grid {
  border-radius: 3px;
  border-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
  box-shadow: none;
}

body.parker-app .conversation-row,
body.parker-app .consumption-row,
body.parker-app .points-entry { border-bottom-color: var(--ws-line); }
body.parker-app .conversation-row:hover,
body.parker-app .consumption-row:hover { background: var(--ws-accent-softer); }

body.parker-app .field input,
body.parker-app .field textarea,
body.parker-app .field select,
body.parker-app .model-select {
  border-radius: 3px;
  border-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
}

body.parker-app .modal-backdrop { background: var(--ws-backdrop); }
body.parker-app .modal {
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 6px;
  background: var(--ws-surface-raised);
  box-shadow: var(--ws-shadow-overlay);
}
body.parker-app .modal-close { border-color: var(--ws-line); }

body.parker-app .empty-state { border-radius: 3px; }
body.parker-app .skeleton { border-radius: 3px; }
body.parker-app .toast { border-radius: 3px; background: var(--archive-spine); }

/* Mod catalog */
body.parker-app .mod-tabs,
body.parker-app .mod-filters { border-radius: 3px; }
body.parker-app .mod-grid { gap: 18px; }

body.parker-app .mod-card {
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
  box-shadow: none;
}

body.parker-app .mod-card:hover { border-color: var(--ws-accent); box-shadow: var(--ws-shadow-float); transform: translateY(-3px); }
body.parker-app .mod-card.installed { background: color-mix(in srgb, var(--ws-accent-soft) 42%, var(--ws-surface-raised)); }
body.parker-app .mod-category,
body.parker-app .mod-status { border-radius: 2px; }
body.parker-app .mod-category { color: var(--ws-accent-strong); }
body.parker-app .mod-price { color: var(--archive-signal); }
body.parker-app .mod-metrics,
body.parker-app .mod-detail-stats { border-color: var(--ws-line-strong); }
body.parker-app .mod-preview-message p,
body.parker-app .mod-preview-settings select,
body.parker-app .mod-preview-settings input,
body.parker-app .mod-preview-composer textarea { border-radius: 3px; }

/* Creator library and editor */
body.parker-app .creator-library-shell,
body.parker-app .creator-editor-shell {
  --bg: var(--ws-canvas);
  --surface: var(--ws-surface);
  --surface-soft: var(--ws-canvas-subtle);
  --ink: var(--ws-ink);
  --muted: var(--ws-muted);
  --line: var(--ws-line);
  --brand: var(--ws-accent);
  --brand-soft: var(--ws-accent-soft);
  background: var(--ws-canvas);
}

body.parker-app .creator-library-header,
body.parker-app .creator-topbar {
  min-height: 70px;
  border-bottom: 0;
  background: var(--archive-spine);
  color: var(--archive-spine-ink);
}

body.parker-app .creator-library-header small,
body.parker-app .creator-title small,
body.parker-app .creator-topbar .save-indicator { color: var(--archive-spine-muted); }

body.parker-app .creator-library-header .button:not(.primary),
body.parker-app .creator-topbar .button:not(.primary),
body.parker-app .creator-topbar .icon-button {
  border-color: rgb(255 255 255 / 18%);
  background: var(--archive-spine-raised);
  color: var(--archive-spine-ink);
}

body.parker-app .creator-library-toolbar {
  padding-block: 16px;
  border-bottom-color: var(--ws-line-strong);
  background: var(--ws-surface);
}

body.parker-app .creator-search,
body.parker-app .world-search { border-radius: 3px; border-color: var(--ws-line-strong); background: var(--ws-surface-raised); }

body.parker-app .creator-work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
body.parker-app .creator-work-card { border-color: var(--ws-line-strong); border-radius: 3px; background: var(--ws-surface-raised); }
body.parker-app .creator-work-cover { background: var(--ws-canvas-subtle); }
body.parker-app .status-pill { border-radius: 2px; }
body.parker-app .creator-empty {
  min-height: 320px;
  align-content: center;
  border-top: 1px solid var(--ws-line-strong);
  border-bottom: 1px solid var(--ws-line-strong);
  background: var(--ws-surface-strong);
}

body.parker-app .creator-editor-shell { --creator-top: 70px; --module-nav: 222px; --inspector: 380px; }
body.parker-app .creator-module-nav { border-right-color: var(--ws-line-strong); background: var(--ws-surface); }
body.parker-app .creator-module-nav button { border-radius: 2px; }
body.parker-app .creator-module-nav button:hover { background: var(--ws-accent-softer); }
body.parker-app .creator-module-nav button.active { background: var(--ws-accent-soft); color: var(--ws-accent-strong); }
body.parker-app .creator-module-nav button b { border-radius: 2px; background: var(--archive-signal); }

body.parker-app .creator-canvas { background: var(--ws-canvas); }
body.parker-app .creator-canvas > * { max-width: 980px; }
body.parker-app .creator-section-head { padding-bottom: 18px; border-bottom: 1px solid var(--ws-line-strong); }
body.parker-app .creator-section-head h1 { font-family: var(--ws-font-display); font-size: 30px; }

body.parker-app .creator-field input,
body.parker-app .creator-field textarea,
body.parker-app .creator-field select,
body.parker-app .action-row input,
body.parker-app .action-row select,
body.parker-app .creator-mobile-module select,
body.parker-app .preview-composer textarea,
body.parker-app .creator-array-custom textarea,
body.parker-app .creator-regex-field input,
body.parker-app .creator-regex-field select,
body.parker-app .creator-regex-field textarea,
body.parker-app .creator-action-row input,
body.parker-app .creator-action-row select,
body.parker-app .creator-action-row textarea {
  border-radius: 3px;
  border-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
}

body.parker-app .creator-inline-card,
body.parker-app .creator-opening-card,
body.parker-app .creator-world-card,
body.parker-app .creator-media-upload,
body.parker-app .creator-music-upload,
body.parker-app .runtime-record,
body.parker-app .creator-release-status {
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
  box-shadow: none;
}

body.parker-app .creator-inline-card > header,
body.parker-app .creator-opening-card > summary,
body.parker-app .creator-world-card > summary { background: var(--ws-surface-strong); }

body.parker-app .creator-companion { border-left-color: var(--ws-line-strong); background: var(--ws-surface); }
body.parker-app .creator-tools > div { border-radius: 3px; box-shadow: var(--ws-shadow-float); }
body.parker-app .creator-array-chip,
body.parker-app .creator-default-badge,
body.parker-app .template-options span,
body.parker-app .runtime-field-grid input,
body.parker-app .runtime-field-grid select,
body.parker-app .runtime-field-grid textarea,
body.parker-app .runtime-action-row input,
body.parker-app .runtime-action-row select,
body.parker-app .runtime-action-row textarea,
body.parker-app .runtime-json-grid textarea { border-radius: 3px; }

/* Admin control room */
body.parker-admin {
  --page: var(--ws-canvas);
  --surface: var(--ws-surface);
  --surface-2: var(--ws-surface-strong);
  --ink: var(--ws-ink);
  --muted: var(--ws-muted);
  --line: var(--ws-line);
  --line-strong: var(--ws-line-strong);
  --accent: var(--ws-accent);
  --accent-soft: var(--ws-accent-soft);
  --danger: var(--ws-danger);
  --danger-soft: var(--ws-danger-soft);
  --amber: var(--ws-warning);
  --amber-soft: var(--ws-warning-soft);
  --blue: var(--ws-info);
  --sidebar: var(--archive-spine);
  --sidebar-muted: var(--archive-spine-muted);
}

body.parker-admin .admin-shell { grid-template-columns: 240px minmax(0, 1fr); background: var(--ws-canvas); }
body.parker-admin .admin-sidebar { padding: 18px 14px; border-right: 0; background: var(--archive-spine); }
body.parker-admin .sidebar-brand { min-height: 62px; padding: 0 8px 18px; border-bottom-color: rgb(255 255 255 / 12%); }
body.parker-admin .sidebar-brand img { width: 38px; height: 38px; border-radius: 4px; }
body.parker-admin .sidebar-brand strong { font-family: var(--ws-font-display); font-size: 15px; }
body.parker-admin .sidebar-brand small { color: var(--archive-spine-muted); }
body.parker-admin .nav-section { color: #78909a; }
body.parker-admin .nav-item { border-radius: 2px; color: var(--archive-spine-muted); }
body.parker-admin .nav-item:hover { background: var(--archive-spine-raised); color: #fff; }
body.parker-admin .nav-item.active { background: #eaf3f5; color: #123743; box-shadow: inset 1px 0 0 var(--archive-signal); }
body.parker-admin .sidebar-account { border-top-color: rgb(255 255 255 / 12%); }
body.parker-admin .sidebar-account .avatar { border-radius: 3px; background: var(--archive-signal); color: #fff; }

body.parker-admin .admin-topbar {
  height: 70px;
  padding: 0 34px;
  border-bottom-color: var(--ws-line-strong);
  background: color-mix(in srgb, var(--ws-surface) 95%, transparent);
  backdrop-filter: blur(12px);
}

body.parker-admin .admin-topbar h1 { font-family: var(--ws-font-display); font-size: 18px; }
body.parker-admin .admin-content { max-width: 1620px; padding: 34px 38px 76px; }
body.parker-admin .page-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--ws-line-strong); }
body.parker-admin .page-head h2 { font-size: 30px; font-weight: 780; }

body.parker-admin .button,
body.parker-admin .icon-button { border-color: var(--ws-line-strong); background: var(--ws-surface-raised); }
body.parker-admin .button:hover,
body.parker-admin .icon-button:hover { border-color: var(--ws-accent); background: var(--ws-accent-softer); }
body.parker-admin .button.primary { border-color: var(--ws-accent); background: var(--ws-accent); color: #fff; }

body.parker-admin .metrics {
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
}

body.parker-admin .metric { position: relative; padding: 19px; border-color: var(--ws-line); }
body.parker-admin .metric:first-child::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--archive-signal);
}
body.parker-admin .metric strong { font-family: var(--ws-font-mono); font-size: 24px; font-variant-numeric: tabular-nums; }

body.parker-admin .panel,
body.parker-admin .table-wrap {
  border-color: var(--ws-line-strong);
  border-radius: 3px;
  background: var(--ws-surface-raised);
}

body.parker-admin .panel-head,
body.parker-admin th { background: var(--ws-surface-strong); }
body.parker-admin tbody tr:hover { background: var(--ws-accent-softer); }
body.parker-admin .chart-bar { border-radius: 1px 1px 0 0; background: var(--ws-accent); }
body.parker-admin .chart-bar.secondary { background: var(--archive-signal); }

body.parker-admin .field input,
body.parker-admin .field select,
body.parker-admin .field textarea,
body.parker-admin .search-input,
body.parker-admin .filters select {
  border-radius: 3px;
  border-color: var(--ws-line-strong);
  background: var(--ws-surface-raised);
}

body.parker-admin .tabs { border-radius: 3px; background: var(--ws-canvas-subtle); }
body.parker-admin .tab { border-radius: 2px; }
body.parker-admin .settings-nav button { border-radius: 2px; }
body.parker-admin .settings-nav button.active { background: var(--ws-accent-soft); color: var(--ws-accent-strong); }
body.parker-admin .modal { border-radius: 6px; background: var(--ws-surface-raised); }
body.parker-admin .admin-toast { border-radius: 3px; background: var(--archive-spine); }
body.parker-admin .badge.green { background: var(--ws-accent-soft); color: var(--ws-accent-strong); }

body.parker-admin .login-screen { background: var(--ws-surface-raised); }
body.parker-admin .login-panel { border-right-color: var(--ws-line-strong); background: var(--ws-surface-raised); }
body.parker-admin .login-brand img { border-radius: 4px; }
body.parker-admin .login-panel h1 { font-family: var(--ws-font-display); font-size: 34px; }
body.parker-admin .login-aside { background-color: var(--archive-spine); }
body.parker-admin .login-aside::after { background: rgb(9 32 42 / 66%); }
body.parker-admin .login-aside h2 { font-family: var(--ws-font-display); font-size: 42px; }

/* Responsive composition */
@media (max-width: 1320px) {
  body.parker-app .story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.parker-app .story-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.parker-app .creator-work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

}

@media (max-width: 1180px) {
  body.parker-app { --sidebar: 86px; }
  body.parker-app .sidebar { padding-inline: 10px; }
  body.parker-app .brand { justify-content: center; margin-inline: 0; padding-inline: 0; }
  body.parker-app .sidebar .brand > span,
  body.parker-app .sidebar .nav-label,
  body.parker-app .sidebar .nav-button > span,
  body.parker-app .sidebar .account-strip > span:not(.avatar),
  body.parker-app .sidebar .account-strip > svg { display: none; }
  body.parker-app .nav-button { justify-content: center; padding-inline: 0; }
  body.parker-app .sidebar-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-app .sidebar-tools .icon-button { min-height: 32px; }
  body.parker-app .sidebar .account-strip {
    min-height: 38px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 4px 0;
  }
  body.parker-app .topbar { padding-inline: 24px; }
  body.parker-app .page { padding-inline: 28px; }
}

@media (max-width: 980px) {
  body.parker-app .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-app .story-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child { grid-column: 1 / -1; }
  body.parker-app .creator-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-admin .admin-content { padding-inline: 24px; }

}

@media (max-width: 820px) {
  body.parker-admin .admin-shell { grid-template-columns: minmax(0, 1fr); }

}

@media (max-width: 760px) {
  body.parker-app { --sidebar: 0px; --topbar: 62px; }
  body.parker-app .sidebar { display: none; }
  body.parker-app .app-shell { padding-left: 0; }
  body.parker-app .topbar { min-height: var(--topbar); padding: 9px 12px; }
  body.parker-app .topbar .search-box { display: none; }
  body.parker-app .mobile-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ws-ink);
  }
  body.parker-app .mobile-brand img { width: 34px; height: 34px; border-radius: 4px; }
  body.parker-app .mobile-brand strong { font-family: var(--ws-font-display); font-size: 18px; }
  body.parker-app .top-actions { width: auto; margin-left: auto; }
  body.parker-app .top-actions .account-button { margin-left: auto; }
  body.parker-app .mobile-nav { display: grid; }
  body.parker-app .page { padding: 24px 14px 96px; }
  body.parker-app .page-heading { margin-bottom: 18px; padding-bottom: 16px; }
  body.parker-app .page-heading h1 { font-size: 29px; }
  body.parker-app .explore-search { display: grid; }
  body.parker-app .explore-filters { padding-top: 12px; }
  body.parker-app .story-grid,
  body.parker-app .story-grid.compact { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child,
  body.parker-app .story-grid.compact .story-card:first-child {
    grid-column: auto;
    display: flex;
  }
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-cover { height: 210px; min-height: 0; }
  body.parker-app .story-card,
  body.parker-app .story-grid.compact .story-card { min-height: 0; }
  body.parker-app .story-cover,
  body.parker-app .story-grid.compact .story-cover { height: 210px; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-body { padding: 17px 16px 16px; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child h3 { font-size: 22px; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child p { min-height: 42px; -webkit-line-clamp: 2; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child { border-top: 4px solid var(--archive-signal); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-body { background: var(--archive-spine); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child h3,
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-author { color: var(--archive-spine-ink); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child p,
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-metrics { color: var(--archive-spine-muted); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child .tag { background: rgb(204 229 235 / 12%); color: #cce5eb; }
  body.parker-app .story-card:hover,
  body.parker-app .mod-card:hover { transform: none; }
  body.parker-app .conversation-opening-note { padding: 22px 18px 20px; }
  body.parker-app .conversation-opening-note h2 { margin-top: 20px; font-size: 28px; }
  body.parker-app .modal { border-radius: 6px 6px 0 0; }
  body.parker-app .creator-library-header,
  body.parker-app .creator-topbar { min-height: 62px; }
  body.parker-app .creator-library-main { padding-inline: 14px; }
  body.parker-app .creator-work-grid { grid-template-columns: minmax(0, 1fr); }
  body.parker-admin .admin-content { padding: 24px 14px 56px; }
  body.parker-admin .admin-topbar { padding-inline: 14px; }
  body.parker-admin .page-head h2 { font-size: 26px; }
  body.parker-admin .chart-day small { display: none; }
  body.parker-admin .chart-day:first-child small,
  body.parker-admin .chart-day:nth-child(7) small,
  body.parker-admin .chart-day:last-child small { display: block; }

}

@media (max-width: 520px) {
  body.parker-app .top-actions > .icon-button:nth-of-type(2) { display: none; }
  body.parker-app .account-button span { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.parker-app .story-cover,
  body.parker-app .story-grid:not(.compact) .story-card:first-child .story-cover,
  body.parker-app .story-grid.compact .story-cover { height: 190px; }
  body.parker-admin .login-panel { padding: 28px 20px; }

}

/* player-gallery.css */
/* Parker player gallery: cinematic discovery over the shared product system. */

body.parker-app {
  --ws-canvas: #f3f4f2;
  --ws-canvas-subtle: #e8eae8;
  --ws-surface: #fafbf9;
  --ws-surface-raised: #ffffff;
  --ws-surface-strong: #eceeec;
  --ws-ink: #151719;
  --ws-ink-soft: #323639;
  --ws-muted: #737a7e;
  --ws-muted-strong: #565e62;
  --ws-line: #dce0df;
  --ws-line-strong: #c5cbca;
  --ws-accent: #315bd8;
  --ws-accent-hover: #2449b9;
  --ws-accent-strong: #18388f;
  --ws-accent-soft: #dce5ff;
  --ws-accent-softer: #edf1ff;
  --ws-signal: #df4a36;
  --ws-signal-hover: #c53d2c;
  --ws-signal-soft: #f8e3df;
  --ws-shadow-float: 0 22px 54px rgb(22 27 29 / 12%);
  --archive-spine: #111315;
  --archive-spine-raised: #1c1f22;
  --archive-spine-ink: #f5f6f4;
  --archive-spine-muted: #a8afb2;
  --sidebar: 224px;
  --topbar: 72px;
  --ws-font-display: "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Zen Hei", system-ui, sans-serif;
  --ws-font-sans: "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Zen Hei", system-ui, sans-serif;
  background: var(--ws-canvas);
}

body.parker-app.dark {
  --ws-canvas: #0e1012;
  --ws-canvas-subtle: #191c1f;
  --ws-surface: #141719;
  --ws-surface-raised: #1a1e21;
  --ws-surface-strong: #202428;
  --ws-ink: #f1f3f2;
  --ws-ink-soft: #d1d5d4;
  --ws-muted: #9ca3a7;
  --ws-muted-strong: #bcc2c4;
  --ws-line: #292e31;
  --ws-line-strong: #3b4246;
  --ws-accent: #7695ff;
  --ws-accent-hover: #91aaff;
  --ws-accent-strong: #b9c7ff;
  --ws-accent-soft: #223366;
  --ws-accent-softer: #192342;
  --ws-shadow-float: 0 24px 60px rgb(0 0 0 / 34%);
}

body.parker-app h1,
body.parker-app h2,
body.parker-app h3,
body.parker-app .brand strong {
  font-family: var(--ws-font-display);
  letter-spacing: 0;
}

body.parker-app svg { stroke-width: 1.75; }

/* Product shell */
body.parker-app .app-shell { padding-left: var(--sidebar); }

body.parker-app .sidebar {
  width: var(--sidebar);
  padding: 22px 16px 18px;
  background: var(--archive-spine);
}

body.parker-app .brand {
  min-height: 64px;
  gap: 12px;
  margin: 0 4px 30px;
  padding: 0 6px 22px;
  border-bottom-color: rgb(255 255 255 / 10%);
}

body.parker-app .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

body.parker-app .brand > span { gap: 3px; }
body.parker-app .brand strong { font-size: 21px; font-weight: 700; }
body.parker-app .brand small { color: #899195; font-size: 10px; font-weight: 500; }

body.parker-app .nav-group { margin-bottom: 26px; }
body.parker-app .sidebar .nav-label { padding: 0 12px 9px; color: #70787c; font-size: 10px; font-weight: 600; }

body.parker-app .nav-button {
  min-height: 44px;
  gap: 12px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 5px;
  color: var(--archive-spine-muted);
  font-size: 14px;
  font-weight: 500;
}

body.parker-app .nav-button::before { inset-block: 13px; width: 2px; }
body.parker-app .nav-button:hover { background: rgb(255 255 255 / 5%); color: #fff; }
body.parker-app .nav-button.active,
body.parker-app.dark .nav-button.active { background: var(--archive-spine-raised); color: #fff; }
body.parker-app .nav-button.active::before { background: var(--ws-signal); }

body.parker-app .sidebar-footer { gap: 9px; }
body.parker-app .sidebar-tools { padding-bottom: 12px; border-bottom-color: rgb(255 255 255 / 10%); }
body.parker-app .sidebar-tools .icon-button { min-height: 40px; color: #899195; }
body.parker-app .sidebar-tools .icon-button:hover { border-color: transparent; background: rgb(255 255 255 / 7%); }

body.parker-app .sidebar .account-strip {
  min-height: 54px;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  padding: 8px;
  border-radius: 5px;
}

body.parker-app .sidebar .account-strip:hover { background: rgb(255 255 255 / 6%); }
body.parker-app .sidebar .avatar { border-color: rgb(255 255 255 / 18%); background: rgb(255 255 255 / 7%); }
body.parker-app .sidebar .account-name { font-size: 13px; font-weight: 600; }

body.parker-app .topbar {
  min-height: var(--topbar);
  padding: 13px 34px;
  border-bottom-color: color-mix(in srgb, var(--ws-line) 72%, transparent);
  background: color-mix(in srgb, var(--ws-surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

body.parker-app .search-box { width: min(720px, 64vw); }
body.parker-app .search-box input {
  height: 44px;
  padding-left: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--ws-canvas-subtle);
  box-shadow: none;
}

body.parker-app .search-box input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--ws-accent);
}

body.parker-app .search-box svg { left: 15px; top: 13px; color: var(--ws-muted); }
body.parker-app .top-actions { gap: 6px; }
body.parker-app .top-actions > .icon-button { border-color: transparent; background: transparent; }
body.parker-app .top-actions > .icon-button:hover { border-color: transparent; background: var(--ws-canvas-subtle); }

body.parker-app .top-actions .account-button {
  min-height: 42px;
  margin-left: 4px;
  border: 0;
  border-radius: 6px;
  background: var(--ws-ink);
  color: var(--ws-surface-raised);
  font-weight: 600;
}

body.parker-app .top-actions .account-button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--ws-ink-soft);
}

body.parker-app .page { max-width: 1640px; padding: 34px 44px 108px; }

/* Discovery composition */
body.parker-app .explore-intro {
  min-height: 112px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

body.parker-app .explore-intro > div { min-width: 0; }
body.parker-app .explore-kicker { display: block; margin-bottom: 8px; color: var(--ws-signal); font-size: 12px; font-weight: 650; }
body.parker-app .explore-intro h1 { max-width: none; margin: 0; font-size: 48px; font-weight: 700; line-height: 1.08; }
body.parker-app .explore-intro p { max-width: 48ch; margin: 10px 0 0; color: var(--ws-muted-strong); font-size: 15px; line-height: 1.6; }

body.parker-app .explore-count {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding-bottom: 4px;
  color: var(--ws-muted);
}

body.parker-app .explore-count strong { color: var(--ws-ink); font-family: var(--ws-font-mono); font-size: 14px; }
body.parker-app .explore-count small { font-size: 12px; }

body.parker-app .featured-world { margin-bottom: 42px; }

body.parker-app .story-card.story-card-featured {
  position: relative;
  width: 100%;
  height: 430px;
  min-height: 430px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #17191b;
  box-shadow: none;
  color: #fff;
  animation: parker-gallery-enter 680ms cubic-bezier(.16, 1, .3, 1) both;
}

body.parker-app .story-card-featured:hover { border-color: transparent; box-shadow: none; transform: translateY(-2px); }

body.parker-app .story-card-featured .story-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

body.parker-app .story-card-featured .story-cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 14 16 / 5%) 18%, rgb(12 14 16 / 22%) 48%, rgb(12 14 16 / 90%) 100%);
  pointer-events: none;
}

body.parker-app .story-card-featured .story-body {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  width: min(820px, 76%);
  display: block;
  padding: 36px 40px 38px;
  color: #fff;
}

body.parker-app .story-card-featured .story-kicker { justify-content: flex-start; gap: 18px; }
body.parker-app .story-card-featured .story-author { color: #fff; font-size: 12px; font-weight: 650; }
body.parker-app .story-card-featured .story-metrics { color: rgb(255 255 255 / 68%); }
body.parker-app .story-card-featured h3 {
  min-height: 0;
  margin: 9px 0 10px;
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.18;
  -webkit-line-clamp: 2;
}

body.parker-app .story-card-featured p {
  min-height: 0;
  height: auto;
  max-width: 68ch;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgb(255 255 255 / 76%);
  font-size: 14px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.parker-app .story-card-featured .tag-list { min-height: 0; margin-top: 14px; }
body.parker-app .story-card-featured .tag { padding: 0; background: transparent; color: rgb(255 255 255 / 72%); font-size: 11px; }
body.parker-app .story-card-featured .tag + .tag::before { content: "/"; margin-right: 6px; color: rgb(255 255 255 / 35%); }

body.parker-app .story-enter {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 0 7px 0 15px;
  border-radius: 6px;
  background: #fff;
  color: #151719;
  font-size: 13px;
  font-weight: 650;
}

body.parker-app .story-enter > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #eceeed;
  transition: transform 420ms cubic-bezier(.16, 1, .3, 1);
}

body.parker-app .story-card-featured:hover .story-enter > span { transform: translateX(2px); }

body.parker-app .catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

body.parker-app .catalog-heading h2 { margin: 0; font-size: 24px; font-weight: 700; }
body.parker-app .catalog-heading p { margin: 5px 0 0; color: var(--ws-muted); font-size: 12px; }
body.parker-app .catalog-heading > .icon-button { border-color: transparent; background: transparent; }
body.parker-app .catalog-heading > .icon-button:hover { border-color: transparent; background: var(--ws-canvas-subtle); }

body.parker-app .explore-filters {
  gap: 12px;
  margin-bottom: 30px;
  padding: 0 0 18px;
  border-top: 0;
  border-bottom: 1px solid var(--ws-line);
}

body.parker-app .explore-primary-filters { align-items: center; gap: 18px; }
body.parker-app .ranking-tabs { gap: 18px; padding: 0; border: 0; border-radius: 0; background: transparent; }
body.parker-app .ranking-tabs .segment {
  min-height: 36px;
  padding: 0 1px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ws-muted);
  font-size: 13px;
  font-weight: 550;
}

body.parker-app .ranking-tabs .segment:hover { color: var(--ws-ink); }
body.parker-app .ranking-tabs .segment.active { border-bottom-color: var(--ws-ink); background: transparent; color: var(--ws-ink); }
body.parker-app .category-row { gap: 6px; }
body.parker-app .chip {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: var(--ws-canvas-subtle);
  color: var(--ws-muted-strong);
  font-size: 12px;
  font-weight: 550;
}

body.parker-app .chip:hover { background: var(--ws-line); color: var(--ws-ink); }
body.parker-app .chip.active { border-color: transparent; background: var(--ws-accent); color: #fff; }
body.parker-app .explore-more-filters > summary { color: var(--ws-muted); font-size: 12px; font-weight: 550; }
body.parker-app .explore-more-filters > summary small { border-radius: 4px; background: var(--ws-accent-soft); color: var(--ws-accent-strong); }
body.parker-app .explore-more-panel { padding: 16px; border: 0; border-radius: 6px; background: var(--ws-canvas-subtle); }

/* Story gallery */
body.parker-app .story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 24px;
}

body.parker-app .story-card:not(.story-card-featured) {
  min-height: 0;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 520ms cubic-bezier(.16, 1, .3, 1);
  animation: parker-gallery-enter 620ms cubic-bezier(.16, 1, .3, 1) both;
}

body.parker-app .story-grid .story-card:nth-child(2) { animation-delay: 45ms; }
body.parker-app .story-grid .story-card:nth-child(3) { animation-delay: 90ms; }
body.parker-app .story-grid .story-card:nth-child(4) { animation-delay: 135ms; }
body.parker-app .story-grid .story-card:nth-child(5) { animation-delay: 180ms; }
body.parker-app .story-grid .story-card:nth-child(6) { animation-delay: 225ms; }

body.parker-app .story-card:not(.story-card-featured):hover { z-index: auto; border-color: transparent; box-shadow: none; transform: translateY(-5px); }

body.parker-app .story-grid:not(.compact) .story-card:first-child {
  grid-column: auto;
  display: block;
  grid-template-columns: none;
}

body.parker-app .story-card:not(.story-card-featured) .story-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 7px;
  background: #dfe2e1;
}

body.parker-app .story-grid:not(.compact) .story-card:first-child .story-cover { height: auto; min-height: 0; }

body.parker-app .story-cover img,
body.parker-app .cover-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.parker-app .cover-fallback {
  display: block;
  background-color: #202326;
  background-image: var(--story-fallback-image);
  background-position: center;
  background-size: cover;
}

body.parker-app .cover-fallback[hidden] { display: none; }
body.parker-app .story-cover img { transition: transform 720ms cubic-bezier(.16, 1, .3, 1), filter 420ms cubic-bezier(.16, 1, .3, 1); }
body.parker-app .story-card:hover .story-cover img { transform: scale(1.04); }

body.parker-app .story-index {
  top: 12px;
  left: 12px;
  min-width: 30px;
  height: 25px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: rgb(17 19 21 / 82%);
  color: #fff;
  font-size: 10px;
}

body.parker-app .story-card-featured .story-index { top: 20px; left: 22px; min-width: 44px; background: var(--ws-signal); font-family: var(--ws-font-sans); font-weight: 650; }

body.parker-app .story-card:not(.story-card-featured) .story-body { display: block; padding: 16px 2px 0; }
body.parker-app .story-grid:not(.compact) .story-card:first-child .story-body { padding: 16px 2px 0; }
body.parker-app .story-card:not(.story-card-featured) .story-kicker { align-items: center; }
body.parker-app .story-card:not(.story-card-featured) .story-author { color: var(--ws-accent); font-size: 11px; font-weight: 650; }
body.parker-app .story-card:not(.story-card-featured) .story-metrics { color: var(--ws-muted); font-size: 10px; }
body.parker-app .story-card:not(.story-card-featured) h3 {
  min-height: 56px;
  display: -webkit-box;
  margin: 8px 0 7px;
  overflow: hidden;
  color: var(--ws-ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.34;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.parker-app .story-grid:not(.compact) .story-card:first-child h3 { min-height: 56px; font-size: 21px; -webkit-line-clamp: 2; }

body.parker-app .story-card:not(.story-card-featured):hover h3 { color: var(--ws-accent); }
body.parker-app .story-card:not(.story-card-featured) p {
  height: 46px;
  min-height: 46px;
  color: var(--ws-muted-strong);
  font-size: 13px;
  line-height: 1.75;
}

body.parker-app .story-grid:not(.compact) .story-card:first-child p { min-height: 46px; -webkit-line-clamp: 2; }

body.parker-app .story-card:not(.story-card-featured) .tag-list { min-height: 20px; margin-top: 11px; gap: 7px; }
body.parker-app .story-card:not(.story-card-featured) .tag { padding: 0; border-radius: 0; background: transparent; color: var(--ws-muted); font-size: 11px; }
body.parker-app .story-card:not(.story-card-featured) .tag + .tag::before { content: "/"; margin-right: 7px; color: var(--ws-line-strong); }

body.parker-app .story-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 18px; }
body.parker-app .story-grid.compact .story-card { min-height: 0; }
body.parker-app .story-grid.compact .story-cover { height: auto; aspect-ratio: 16 / 10; }
body.parker-app .story-grid.compact .story-body { padding-top: 12px; }
body.parker-app .story-grid.compact .story-body h3 { min-height: 48px; font-size: 18px; }

body.parker-app .load-more { padding-top: 42px; }
body.parker-app .load-more .button { min-height: 42px; border-color: var(--ws-line); background: transparent; }
body.parker-app .explore-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--ws-line); color: var(--ws-muted); font-size: 12px; }
body.parker-app .explore-pagination-controls { display: flex; align-items: center; gap: 4px; }
body.parker-app .explore-pagination .icon-button { width: 34px; height: 34px; }
body.parker-app .explore-page-number { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ws-muted-strong); font: inherit; cursor: pointer; }
body.parker-app .explore-page-number:hover { border-color: var(--ws-line-strong); background: var(--ws-canvas-subtle); color: var(--ws-ink); }
body.parker-app .explore-page-number.active { border-color: var(--ws-ink); background: var(--ws-ink); color: var(--ws-surface); font-weight: 700; }
body.parker-app .explore-page-number:disabled, body.parker-app .explore-pagination .icon-button:disabled { cursor: not-allowed; opacity: .45; }
body.parker-app .explore-pagination-ellipsis { width: 24px; text-align: center; color: var(--ws-muted); }

body.parker-app .empty-state { border-color: var(--ws-line); border-radius: 7px; background: var(--ws-surface); }

body.parker-app .mobile-nav {
  border-top-color: rgb(255 255 255 / 10%);
  background: #111315;
}

body.parker-app .mobile-nav .nav-button { color: #8f979b; }
body.parker-app .mobile-nav .nav-button.active { background: transparent; color: #fff; }
body.parker-app .mobile-nav .nav-button::before { display: none; }

@keyframes parker-gallery-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  body.parker-app { --sidebar: 86px; }
  body.parker-app .sidebar { padding-inline: 10px; }
  body.parker-app .sidebar .brand { margin-bottom: 28px; }
  body.parker-app .sidebar-tools .icon-button { min-height: 32px; }
  body.parker-app .page { padding-inline: 32px; }
  body.parker-app .story-grid { gap-inline: 20px; }
}

@media (max-width: 1040px) {
  body.parker-app .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-app .story-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.parker-app .story-card-featured .story-body { width: 88%; }
}

@media (max-width: 760px) {
  body.parker-app { --sidebar: 0px; --topbar: 62px; }
  body.parker-app .app-shell { padding-left: 0; }
  body.parker-app .topbar { padding: 9px 12px; }
  body.parker-app .top-actions > .icon-button { background: transparent; }
  body.parker-app .top-actions .account-button { min-height: 42px; }
  body.parker-app .page { padding: 22px 14px 102px; }
  body.parker-app .explore-intro { min-height: 92px; align-items: flex-start; margin-bottom: 20px; }
  body.parker-app .explore-kicker { margin-bottom: 6px; }
  body.parker-app .explore-intro h1 { font-size: 34px; }
  body.parker-app .explore-intro p { margin-top: 7px; font-size: 14px; }
  body.parker-app .explore-count { display: none; }
  body.parker-app .explore-search {
    margin-bottom: 18px;
    border: 0;
    border-radius: 6px;
    background: var(--ws-surface-raised);
  }
  body.parker-app .explore-search .icon-button.primary {
    border-color: var(--ws-accent);
    background: var(--ws-accent);
    color: #fff;
  }
  body.parker-app .explore-search .icon-button.primary:hover { border-color: var(--ws-accent-hover); background: var(--ws-accent-hover); }
  body.parker-app .featured-world { margin-bottom: 32px; }
  body.parker-app .story-card.story-card-featured { height: 400px; min-height: 400px; border-top: 0; border-radius: 7px; }
  body.parker-app .story-card-featured .story-cover { height: 100%; min-height: 0; }
  body.parker-app .story-card-featured .story-body { width: 100%; padding: 24px 20px 22px; background: transparent; }
  body.parker-app .story-card-featured h3 { margin-top: 8px; font-size: 28px; line-height: 1.2; }
  body.parker-app .story-card-featured p { min-height: 0; font-size: 13px; -webkit-line-clamp: 2; }
  body.parker-app .story-card-featured .tag-list { display: none; }
  body.parker-app .story-enter { min-height: 38px; margin-top: 16px; }
  body.parker-app .catalog-heading { margin-bottom: 14px; }
  body.parker-app .catalog-heading h2 { font-size: 22px; }
  body.parker-app .explore-filters { margin-bottom: 24px; padding-bottom: 14px; }
  body.parker-app .explore-primary-filters { display: grid; gap: 8px; }
  body.parker-app .ranking-tabs { width: 100%; gap: 17px; overflow-x: auto; }
  body.parker-app .ranking-tabs .segment { flex: none; min-height: 42px; }
  body.parker-app .category-row { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  body.parker-app .chip { flex: none; min-height: 40px; }
  body.parker-app .explore-more-filters > summary { min-height: 42px; }
  body.parker-app .explore-more-panel { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  body.parker-app .story-grid,
  body.parker-app .story-grid.compact { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  body.parker-app .story-card:not(.story-card-featured),
  body.parker-app .story-grid.compact .story-card { min-height: 0; display: block; }
  body.parker-app .story-card:not(.story-card-featured) .story-cover,
  body.parker-app .story-grid.compact .story-cover { height: auto; aspect-ratio: 4 / 3; }
  body.parker-app .story-card:not(.story-card-featured) .story-body,
  body.parker-app .story-grid.compact .story-body { padding: 14px 2px 0; background: transparent; }
  body.parker-app .story-card:not(.story-card-featured) h3,
  body.parker-app .story-grid.compact .story-body h3 { min-height: 0; font-size: 21px; }
  body.parker-app .story-card:not(.story-card-featured) p { min-height: 46px; }
  body.parker-app .story-card:not(.story-card-featured):hover { transform: none; }
  body.parker-app .explore-pagination { align-items: stretch; flex-direction: column; gap: 10px; }
  body.parker-app .explore-pagination-total { text-align: center; }
  body.parker-app .explore-pagination-controls { justify-content: center; overflow-x: auto; padding-bottom: 2px; }
}

@media (max-width: 520px) {
  body.parker-app .story-card.story-card-featured { height: 330px; min-height: 330px; }
  body.parker-app .story-card-featured h3 { font-size: 26px; }
  body.parker-app .story-card-featured p { display: none; }
  body.parker-app .story-card-featured .story-index { top: 14px; left: 14px; }
}

.image-upload-page { display: grid; gap: 20px; }
.image-upload-drop { min-height: 180px; border: 1px dashed var(--line, #9aa4b2); display: grid; place-items: center; align-content: center; gap: 8px; padding: 20px; text-align: center; }
.image-upload-drop.dragging { border-color: var(--accent, #267a75); background: rgba(38, 122, 117, .06); }
.image-upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-status, .image-upload-url { overflow-wrap: anywhere; }

/* player-v3.css */
/* Parker V3: an editorial theatre for discovery and continuous story reading. */

body.parker-app {
  --ws-canvas: #ffffff;
  --ws-canvas-subtle: #f7f8fa;
  --ws-surface: #ffffff;
  --ws-surface-raised: #ffffff;
  --ws-surface-strong: #f7f8fa;
  --ws-ink: #202124;
  --ws-ink-soft: #3c4043;
  --ws-muted: #667085;
  --ws-muted-strong: #52606d;
  --ws-line: #e8eaed;
  --ws-line-strong: #d0d5dd;
  --ws-accent: #2563eb;
  --ws-accent-hover: #1d4ed8;
  --ws-accent-strong: #1e40af;
  --ws-accent-soft: #dbeafe;
  --ws-accent-softer: #eff6ff;
  --ws-warning: #84671c;
  --ws-warning-soft: #f0e8cd;
  --ws-danger: #c73e2d;
  --ws-danger-soft: #f6e1dd;
  --ws-signal: #2563eb;
  --ws-signal-hover: #1d4ed8;
  --ws-signal-soft: #dbeafe;
  --ws-action-ink: #ffffff;
  --ws-backdrop: rgb(32 33 36 / 36%);
  --ws-shadow-overlay: 0 18px 48px rgb(32 33 36 / 16%);
  --ws-shadow-float: 0 8px 24px rgb(32 33 36 / 10%);
  --archive-spine: #ffffff;
  --archive-spine-raised: #f7f8fa;
  --archive-spine-ink: #202124;
  --archive-spine-muted: #667085;
  --sidebar: 212px;
  --topbar: 64px;
  --ws-font-display: "Arial", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --ws-font-sans: "Arial", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--ws-canvas);
}

body.parker-app.dark {
  --ws-canvas: #111310;
  --ws-canvas-subtle: #1a1d19;
  --ws-surface: #171916;
  --ws-surface-raised: #1e211d;
  --ws-surface-strong: #262a24;
  --ws-ink: #f1f2ed;
  --ws-ink-soft: #d5d8d1;
  --ws-muted: #9a9f96;
  --ws-muted-strong: #bdc1b8;
  --ws-line: #30342e;
  --ws-line-strong: #4a5047;
  --ws-accent: #88a0ff;
  --ws-accent-hover: #a2b5ff;
  --ws-accent-strong: #c2ccff;
  --ws-accent-soft: #28345e;
  --ws-accent-softer: #202744;
  --ws-danger: #ff8c7b;
  --ws-danger-soft: #4a2b26;
  --ws-signal: #e98270;
  --ws-signal-hover: #ff8976;
  --ws-signal-soft: #452b27;
  --ws-action-ink: #111310;
  --archive-spine: #151714;
  --archive-spine-raised: #242722;
  --archive-spine-ink: #f1f2ed;
  --archive-spine-muted: #a3a89f;
  --ws-shadow-overlay: 0 30px 86px rgb(0 0 0 / 42%);
}

body.parker-app h1,
body.parker-app h2,
body.parker-app h3,
body.parker-app .brand strong {
  letter-spacing: 0;
}

body.parker-app .button,
body.parker-app .icon-button,
body.parker-app input,
body.parker-app textarea,
body.parker-app select {
  border-radius: 5px;
}

body.parker-app .button {
  box-shadow: none;
  font-weight: 650;
}

body.parker-app .button.primary {
  border-color: var(--ws-accent);
  background: var(--ws-accent);
  color: var(--ws-action-ink);
}

body.parker-app .button.primary:hover:not(:disabled) {
  border-color: var(--ws-accent-hover);
  background: var(--ws-accent-hover);
}

/* Shell */
body.parker-app .app-shell { padding-left: var(--sidebar); }

body.parker-app .sidebar {
  width: var(--sidebar);
  padding: 18px 14px 14px;
  border-right: 1px solid var(--ws-line);
  background: var(--archive-spine);
  color: var(--archive-spine-ink);
}

body.parker-app .sidebar-close,
body.parker-app .sidebar-collapse,
body.parker-app .site-navigation-scrim,
body.parker-app .workspace-navigation { display: none; }

body.parker-app .brand {
  min-height: 54px;
  gap: 11px;
  margin: 0 3px 25px;
  padding: 0 5px 17px;
  border: 0;
  border-bottom: 1px solid var(--ws-line);
  background: transparent;
  color: var(--archive-spine-ink);
}

body.parker-app .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: transparent;
}

body.parker-app .brand > span { display: grid; gap: 1px; text-align: left; }
body.parker-app .brand strong { color: var(--archive-spine-ink); font-size: 18px; font-weight: 760; }
body.parker-app .brand small { color: var(--ws-muted); font: 600 9px/1.2 var(--ws-font-mono); }
body.parker-app .nav-group { margin-bottom: 21px; }
body.parker-app .sidebar .nav-label { padding: 0 10px 7px; color: var(--ws-muted); font-size: 10px; font-weight: 700; }

body.parker-app .nav-button {
  min-height: 39px;
  gap: 10px;
  margin: 1px 0;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--archive-spine-muted);
  font-size: 13px;
  font-weight: 570;
}

body.parker-app .nav-button svg { width: 17px; height: 17px; }
body.parker-app .nav-button:hover { background: var(--ws-canvas-subtle); color: var(--archive-spine-ink); }
body.parker-app .nav-button.active,
body.parker-app.dark .nav-button.active { background: var(--archive-spine-raised); color: var(--archive-spine-ink); }
body.parker-app .nav-button::before { inset-block: 9px; width: 2px; left: 0; }
body.parker-app .nav-button.active::before { background: var(--ws-signal); }

body.parker-app .nav-group-create {
  margin-top: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--ws-line);
}

body.parker-app .nav-group-create .nav-button { color: var(--ws-signal); }
body.parker-app .sidebar-footer { gap: 8px; }
body.parker-app .sidebar-tools { padding: 0 0 9px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .sidebar-tools .icon-button { min-height: 34px; border: 0; background: transparent; color: var(--ws-muted); }
body.parker-app .sidebar-tools .icon-button:hover { background: var(--ws-canvas-subtle); color: var(--ws-ink); }

body.parker-app .sidebar .account-strip {
  min-height: 50px;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  gap: 8px;
  padding: 7px 6px;
  border: 0;
  border-radius: 4px;
  color: var(--ws-ink);
}

body.parker-app .sidebar .account-strip:hover { background: var(--ws-canvas-subtle); }
body.parker-app .sidebar .avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--ws-ink);
  border-radius: 50%;
  background: var(--ws-ink);
  color: var(--ws-surface);
  font-size: 12px;
}

body.parker-app .sidebar-nav {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body.parker-app .sidebar .account-name { color: var(--ws-ink); font-size: 12px; }
body.parker-app .sidebar .account-points { color: var(--ws-muted); font-size: 10px; }

body.parker-app .topbar {
  min-height: var(--topbar);
  padding: 10px 34px;
  border-bottom: 1px solid var(--ws-line);
  background: rgb(248 248 245 / 94%);
  backdrop-filter: blur(16px);
}

body.parker-app.dark .topbar { background: rgb(23 25 22 / 94%); }
body.parker-app .search-box { width: min(680px, 62vw); }
body.parker-app .search-box input {
  height: 42px;
  padding-left: 42px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--ws-canvas-subtle);
}

body.parker-app .search-box input:focus { border-color: var(--ws-accent); box-shadow: none; }
body.parker-app .search-box svg { left: 14px; top: 12px; }
body.parker-app .top-points { border-color: transparent; background: transparent; }
body.parker-app .account-button-quiet .avatar { border: 1px solid var(--ws-ink); background: transparent; color: var(--ws-ink); }
body.parker-app .page { max-width: 1540px; padding: 24px 36px 84px; }

/* Discovery */
body.parker-app .explore-intro {
  min-height: 76px;
  align-items: flex-end;
  margin-bottom: 22px;
}

body.parker-app .page-kicker {
  margin-bottom: 7px;
  color: var(--ws-signal);
  font: 700 10px/1.3 var(--ws-font-mono);
}

body.parker-app .explore-intro h1 { font-size: 30px; font-weight: 720; line-height: 1.2; }
body.parker-app .explore-intro p { max-width: 52ch; margin-top: 8px; color: var(--ws-muted-strong); font-size: 14px; }
body.parker-app .explore-count { display: none; }

body.parker-app .featured-world { margin-bottom: 30px; }
body.parker-app .story-card.story-card-featured {
  height: auto;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid #111;
  border-radius: 5px;
  background: #171815;
}
body.parker-app .story-card-featured .story-card-cover-entry { position: absolute; inset: 0; z-index: 1; }

body.parker-app .story-card-featured .story-cover::after { background: rgb(10 11 10 / 43%); }
body.parker-app .story-card-featured .story-body { position: relative; width: min(760px, 74%); padding: 30px 34px 32px; }
body.parker-app .story-card-featured .story-kicker { flex-wrap: wrap; }
body.parker-app .story-card-featured .story-author { min-width: 0; overflow-wrap: anywhere; }
body.parker-app .story-card-featured h3 { margin: 7px 0 8px; font-size: 34px; font-weight: 720; }
body.parker-app .story-card-featured p { color: rgb(255 255 255 / 86%); }
body.parker-app .featured-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 9px;
  border-radius: 3px;
  background: var(--ws-signal);
  color: var(--ws-action-ink);
  font-size: 10px;
  font-weight: 750;
}

body.parker-app .story-enter {
  min-height: 38px;
  margin-top: 17px;
  padding: 0 12px;
  border-radius: 4px;
  background: #fff;
  color: #191a18;
}

body.parker-app .story-enter > span { width: auto; height: auto; background: transparent; }
body.parker-app .explore-filters { gap: 10px; margin-bottom: 25px; padding-bottom: 15px; }
body.parker-app .filter-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
body.parker-app .ranking-tabs { min-width: 0; gap: 18px; overflow-x: auto; }
body.parker-app .ranking-tabs .segment { flex: none; min-height: 34px; font-size: 12px; }
body.parker-app .ranking-tabs .segment.active { border-bottom-color: var(--ws-signal); }
body.parker-app .workspace-loading-shell { min-height: 100dvh; display: grid; grid-template-rows: 64px minmax(240px,1fr) 106px auto; gap: 12px; padding: 12px; background: var(--ws-surface); color: var(--ws-muted-strong); }
body.parker-app .workspace-loading-shell .workspace-loading-head { min-height: 52px; }
body.parker-app .workspace-loading-shell .workspace-loading-body { min-height: 240px; }
body.parker-app .workspace-loading-shell .workspace-loading-composer { min-height: 80px; }
body.parker-app .workspace-loading-shell > span { text-align: center; }
body.parker-app .filter-toggle {
  min-height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--ws-line);
  border-radius: 4px;
  background: transparent;
  color: var(--ws-muted-strong);
  font-size: 12px;
}

body.parker-app .filter-toggle:hover,
body.parker-app .filter-toggle.active { border-color: var(--ws-accent); color: var(--ws-accent); }
body.parker-app .filter-toggle b { min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--ws-accent); color: var(--ws-action-ink); font-size: 9px; }
body.parker-app .category-row { display: flex; gap: 5px; overflow-x: auto; }
body.parker-app .chip { flex: none; min-height: 31px; border-radius: 3px; background: transparent; color: var(--ws-muted-strong); }
body.parker-app .chip:hover { background: var(--ws-canvas-subtle); }
body.parker-app .chip.active { background: var(--ws-ink); color: var(--ws-surface); }

body.parker-app .facet-drawer {
  padding: 18px 0 3px;
  border-top: 1px solid var(--ws-line);
}

body.parker-app .facet-drawer[hidden] { display: none; }
body.parker-app .facet-group { min-width: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; margin: 0 0 12px; padding: 0; border: 0; }
body.parker-app .facet-group legend { float: left; width: 76px; padding: 7px 0 0; color: var(--ws-muted); font-size: 11px; }
body.parker-app .facet-options { display: flex; flex-wrap: wrap; gap: 5px; }
body.parker-app .facet-option { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--ws-line); border-radius: 3px; background: var(--ws-surface); color: var(--ws-muted-strong); font-size: 11px; }
body.parker-app .facet-option small { color: var(--ws-muted); font: 10px var(--ws-font-mono); }
body.parker-app .facet-option.active { border-color: var(--ws-accent); background: var(--ws-accent-softer); color: var(--ws-accent); }
body.parker-app .facet-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 7px; color: var(--ws-muted); font-size: 11px; }

body.parker-app .catalog-heading { margin-bottom: 14px; }
body.parker-app .catalog-heading h2 { font-size: 21px; }
body.parker-app .catalog-view-toggle { width: auto; gap: 6px; padding: 0 10px; }
body.parker-app .catalog-view-toggle span { font-size: 12px; white-space: nowrap; }
body.parker-app .story-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px 20px; }
body.parker-app .story-card:not(.story-card-featured) { content-visibility: auto; contain-intrinsic-block-size: auto 440px; }
body.parker-app img[data-story-cover-src]:not([src]) { visibility: hidden; }
body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) { grid-column: auto; display: block; }
body.parker-app .story-card:not(.story-card-featured) .story-cover { border-radius: 4px; }
body.parker-app .story-grid.covers-hidden .story-cover { display: none; }
body.parker-app .story-card:not(.story-card-featured) .story-body { padding: 11px 1px 0; }
body.parker-app .story-card-entry { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; text-decoration: none; }
body.parker-app .story-card-cover-entry { display: block; }
body.parker-app .story-card-body-entry { display: block; }
body.parker-app .story-author[type="button"],
body.parker-app .detail-author[type="button"] { padding: 0; border: 0; background: transparent; color: var(--ws-accent); cursor: pointer; font: inherit; text-align: left; }
body.parker-app .story-author[type="button"]:hover,
body.parker-app .detail-author[type="button"]:hover { text-decoration: underline; }
body.parker-app .story-card:not(.story-card-featured) h3 { min-height: 44px; margin: 5px 0; font-size: 17px; }
body.parker-app .story-card:not(.story-card-featured):hover h3 { color: var(--ws-accent); }
body.parker-app .story-card:not(.story-card-featured) .story-author { color: var(--ws-accent); }
body.parker-app .story-heat {
  min-height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgb(25 26 24 / 15%);
  border-radius: 5px;
  background: rgb(255 255 255 / 92%);
  color: var(--ws-signal);
  box-shadow: 0 2px 8px rgb(23 25 22 / 12%);
  font-variant-numeric: tabular-nums;
}
body.parker-app .story-heat b { color: var(--ws-ink); font: 750 12px/1 var(--ws-font-mono); }
body.parker-app .story-heat small { color: var(--ws-muted-strong); font-size: 10px; font-weight: 650; }
body.parker-app .story-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0;
  font-variant-numeric: tabular-nums;
}
body.parker-app .story-stat {
  min-width: 0;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--ws-line);
  border-radius: 6px;
  background: var(--ws-surface);
}
body.parker-app .story-stat-label { min-width: 0; display: flex; align-items: center; gap: 5px; color: var(--ws-muted-strong); font-size: 11px; font-weight: 650; }
body.parker-app .story-stat-label svg { flex: none; color: var(--ws-muted); }
body.parker-app .story-stat strong { min-width: 0; color: var(--ws-ink); font: 750 16px/1 var(--ws-font-mono); }
body.parker-app .story-stat b { margin-left: 2px; color: var(--ws-muted); font: 650 9px/1 var(--ws-font-sans); }
body.parker-app .story-summary { margin: 0; }
body.parker-app .story-card-featured .story-heat { border-color: rgb(255 255 255 / 28%); background: rgb(12 13 12 / 72%); }
body.parker-app .story-card-featured .story-heat b { color: #fff; }
body.parker-app .story-card-featured .story-heat small { color: rgb(255 255 255 / 72%); }
body.parker-app .story-card-featured .story-stat-grid {
  width: min(520px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}
body.parker-app .story-card-featured .story-stat { min-height: 54px; gap: 4px; padding: 7px 9px; border-color: rgb(255 255 255 / 28%); background: rgb(12 13 12 / 62%); }
body.parker-app .story-card-featured .story-stat-label,
body.parker-app .story-card-featured .story-stat b { color: rgb(255 255 255 / 72%); }
body.parker-app .story-card-featured .story-stat-label svg { color: rgb(255 255 255 / 72%); }
body.parker-app .story-card-featured .story-stat strong { color: #fff; }

body.parker-app .chat-header-actions { display: flex; align-items: center; gap: 5px; }
body.parker-app .header-turns { color: var(--ws-muted); font: 10px var(--ws-font-mono); }
body.parker-app .older-messages { text-align: center; margin-bottom: 24px; }
body.parker-app .message-markup-chat { margin: 13px 0; }
body.parker-app .message-markup-avatar { border-color: var(--ws-line-strong); }
body.parker-app .message-markup-bubble { border-color: var(--ws-line); background: var(--ws-surface); }
body.parker-app .message-markup-chat--right .message-markup-bubble { background: var(--ws-signal); border-color: var(--ws-signal); color: var(--ws-action-ink); }

body.parker-app .prologue-cover { position: relative; overflow: hidden; border: 1px solid var(--ws-line-strong); border-radius: 4px; background: var(--ws-canvas-subtle); }
body.parker-app .prologue-cover img { position: static; display: block; width: 100%; height: auto; object-fit: contain; }
body.parker-app .prologue-cover .cover-fallback { display: grid; width: 100%; aspect-ratio: 3 / 4; }
body.parker-app .prologue-copy > span { color: var(--ws-accent); font-size: 10px; font-weight: 700; }
body.parker-app .prologue-copy h1 { margin: 7px 0 12px; font-size: 31px; line-height: 1.15; }
body.parker-app .prologue-copy p { max-height: 9.5em; margin: 0; overflow: hidden; color: var(--ws-muted-strong); font-family: var(--ws-font-reading); font-size: 15px; line-height: 1.9; }
body.parker-app .opening-switch { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; padding: 0; border: 0; background: transparent; color: var(--ws-signal); font-size: 11px; font-weight: 700; }
body.parker-app .model-picker { min-width: 0; display: grid; grid-template-columns: minmax(64px,.8fr) minmax(80px,1.2fr); gap: 5px; }
body.parker-app .model-picker select { min-width: 0; width: 100%; }
body.parker-app .model-picker-mobile-trigger { display: none; }
body.parker-app .model-picker.has-price { row-gap: 3px; }
body.parker-app .model-picker-price { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 22px; display: flex; align-items: center; padding: 2px 7px; border-left: 2px solid var(--ws-signal); border-radius: 2px; background: var(--ws-canvas-subtle); color: var(--ws-muted-strong); font: 10px var(--ws-font-mono); font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
body.parker-app .quick-actions .button { border-color: var(--ws-line); background: transparent; color: var(--ws-muted-strong); }
body.parker-app .quick-actions .button:hover { border-color: var(--ws-signal); color: var(--ws-signal); }
body.parker-app .panel-lead { margin: 0 0 14px; color: var(--ws-muted); font-size: 11px; }
body.parker-app .panel-empty { min-height: 130px; display: grid; align-content: center; justify-items: center; gap: 5px; color: var(--ws-muted); text-align: center; }
body.parker-app .panel-empty strong { color: var(--ws-ink); font-size: 13px; }
body.parker-app .panel-empty span { font-size: 11px; }
body.parker-app .panel-loading { min-height: 140px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--ws-muted); font-size: 11px; }

body.parker-app .detail-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; margin-bottom: 18px; border-radius: 4px; background: var(--ws-canvas-subtle); }
body.parker-app .detail-cover .story-cover,
body.parker-app .detail-cover img,
body.parker-app .detail-cover .cover-fallback { width: 100%; height: 100%; }
body.parker-app .detail-author { color: var(--ws-accent); font-size: 10px; font-weight: 700; }
body.parker-app .author-page,
body.parker-app .following-page { max-width: 1460px; margin: 0 auto; }
body.parker-app .author-back { margin-bottom: 18px; }
body.parker-app .author-header { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .author-avatar { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--ws-line-strong); border-radius: 50%; background: var(--ws-canvas-subtle); color: var(--ws-ink); font-size: 20px; font-weight: 750; }
body.parker-app .author-identity { min-width: 0; }
body.parker-app .author-identity h1 { margin: 0; font-size: 25px; }
body.parker-app .author-identity p { margin: 5px 0 0; color: var(--ws-muted); font-size: 13px; }
body.parker-app .author-actions { display: flex; align-items: center; gap: 9px; }
body.parker-app .author-self { color: var(--ws-muted); font-size: 12px; }
body.parker-app .author-loading { min-height: 260px; }
body.parker-app .following-list { display: grid; border-top: 1px solid var(--ws-line); }
body.parker-app .following-row { min-height: 78px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ws-line); }
body.parker-app .following-row .author-avatar { width: 42px; height: 42px; font-size: 15px; }
body.parker-app .following-author-link { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
body.parker-app .following-author-link:hover strong { color: var(--ws-accent); }
body.parker-app .following-author-link strong,
body.parker-app .following-author-link span,
body.parker-app .following-author-unavailable strong,
body.parker-app .following-author-unavailable span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.parker-app .following-author-link span,
body.parker-app .following-author-unavailable span { margin-top: 4px; color: var(--ws-muted); font-size: 12px; }
body.parker-app .following-author-unavailable { min-width: 0; color: var(--ws-muted); }
body.parker-app .detail-summary { color: var(--ws-muted-strong); font-family: var(--ws-font-reading); line-height: 1.75; }
body.parker-app .detail-metrics { display: grid; grid-template-columns: repeat(3,1fr); margin: 18px 0; border-block: 1px solid var(--ws-line); }
body.parker-app .detail-setting-metrics { grid-template-columns: repeat(2,1fr); margin-top: -18px; border-top: 0; }
body.parker-app .detail-metrics span { display: grid; gap: 3px; padding: 13px 8px; color: var(--ws-muted); font-size: 9px; }
body.parker-app .detail-metrics strong { color: var(--ws-ink); font: 700 17px var(--ws-font-mono); }
body.parker-app .detail-facet { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--ws-line); }
body.parker-app .detail-facet > span { color: var(--ws-muted); font-size: 10px; }
body.parker-app .detail-facet p { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
body.parker-app .detail-facet b { color: var(--ws-ink-soft); font-size: 10px; font-weight: 600; }
body.parker-app .panel-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
body.parker-app .rating-inline { display: flex; align-items: center; gap: 5px; color: var(--ws-muted); font-size: 10px; }
body.parker-app .rating-inline select { height: 36px; }

body.parker-app .panel-comment-form { display: grid; gap: 7px; margin-bottom: 19px; }
body.parker-app .panel-comment-form textarea { min-height: 86px; resize: vertical; }
body.parker-app .panel-comment-form .button { justify-self: end; }
body.parker-app .panel-submit-status,
body.parker-app .modal-submit-status { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ws-info); font-size: 11px; line-height: 1.5; }
body.parker-app .panel-submit-status svg,
body.parker-app .modal-submit-status svg { flex: none; }
body.parker-app .panel-comment-list { display: grid; gap: 0; }
body.parker-app .panel-comment-list .comment { padding: 15px 0; border-bottom: 1px solid var(--ws-line); }
body.parker-app .panel-comment-list .comment header { display: grid; grid-template-columns: 28px minmax(0,1fr) 32px; align-items: center; gap: 8px; }
body.parker-app .comment-avatar { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--ws-line-strong); border-radius: 50%; font-size: 10px; }
body.parker-app .panel-comment-list .comment strong { display: block; font-size: 11px; }
body.parker-app .panel-comment-list .comment small { display: block; margin-top: 2px; color: var(--ws-muted); font-size: 8px; }
body.parker-app .panel-comment-list .comment p { margin: 9px 0 0 36px; color: var(--ws-ink-soft); font-size: 12px; line-height: 1.7; }
body.parker-app .panel-load-more { width: 100%; margin-top: 14px; }

body.parker-app .mod-toggle-list { margin-bottom: 15px; border-top: 1px solid var(--ws-line); }
body.parker-app .mod-toggle-row { min-height: 62px; display: grid; grid-template-columns: 18px minmax(0,1fr) 20px; align-items: center; gap: 9px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .mod-toggle-row strong { display: block; font-size: 12px; }
body.parker-app .mod-toggle-row small { display: block; margin-top: 4px; color: var(--ws-muted); font-size: 9px; }
body.parker-app .mod-toggle-row i { color: var(--ws-muted); }
body.parker-app .opening-panel-list { display: grid; gap: 0; border-top: 1px solid var(--ws-line); }
body.parker-app .opening-panel-option { width: 100%; display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 9px; padding: 14px 3px; border: 0; border-bottom: 1px solid var(--ws-line); background: transparent; text-align: left; }
body.parker-app .opening-panel-option.active { color: var(--ws-signal); }
body.parker-app .opening-panel-option strong { font-size: 12px; }
body.parker-app .opening-panel-option p { margin: 5px 0 0; color: var(--ws-muted); font-size: 11px; line-height: 1.55; }
body.parker-app .advanced-settings { width: 100%; min-width: 0; height: 100%; flex: 1; display: flex; flex-direction: column; }
body.parker-app .settings-scope { flex: none; padding: 14px 18px 10px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .settings-scope-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--ws-line); border-radius: 5px; background: var(--ws-canvas-subtle); }
body.parker-app .settings-scope-switch button { min-width: 0; min-height: 38px; flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 3px; background: transparent; color: var(--ws-muted-strong); font-size: 12px; }
body.parker-app .settings-scope-switch button:hover:not(:disabled) { background: var(--ws-surface); color: var(--ws-ink); }
body.parker-app .settings-scope-switch button[aria-pressed="true"] { background: var(--ws-ink); color: var(--ws-surface); font-weight: 700; }
body.parker-app .settings-scope-switch button[aria-pressed="true"]:hover:not(:disabled) { background: var(--ws-ink); color: var(--ws-surface); }
body.parker-app .settings-scope-switch button:focus-visible { outline: 2px solid var(--ws-signal); outline-offset: 2px; }
body.parker-app .settings-scope-switch button:disabled { opacity: .55; cursor: wait; }
body.parker-app .settings-scope p { margin: 9px 0 0; color: var(--ws-muted-strong); font-size: 11px; line-height: 1.6; }
body.parker-app .settings-scope > .button { margin-top: 8px; }
body.parker-app .settings-tabs { min-height: 46px; flex: none; display: flex; align-items: end; gap: 17px; padding: 0 18px; overflow-x: auto; border-bottom: 1px solid var(--ws-line); }
body.parker-app .settings-tabs button { min-height: 45px; flex: none; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ws-muted); font-size: 11px; }
body.parker-app .settings-tabs button.active { border-bottom-color: var(--ws-signal); color: var(--ws-ink); font-weight: 700; }
body.parker-app .settings-section { min-height: 0; flex: 1; padding: 18px; overflow-y: auto; }
body.parker-app .settings-section-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--ws-muted); font-size: 10px; }
body.parker-app .setting-field { min-width: 0; display: grid; gap: 6px; margin-bottom: 13px; color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .setting-field > input,
body.parker-app .setting-field > select { height: 38px; padding-inline: 10px; border: 1px solid var(--ws-line); background: var(--ws-surface); }
body.parker-app .setting-field > textarea { padding: 10px; border: 1px solid var(--ws-line); background: var(--ws-surface); line-height: 1.55; resize: vertical; }
body.parker-app .setting-field > input:focus,
body.parker-app .setting-field > select:focus,
body.parker-app .setting-field > textarea:focus { border-color: var(--ws-accent); outline: 0; box-shadow: 0 0 0 2px var(--ws-accent-soft); }
body.parker-app .setting-field > .model-picker { width: 100%; }
body.parker-app .advanced-settings .setting-field > .model-picker { display: flex; }
body.parker-app .advanced-settings .setting-field > .model-picker .model-picker-trigger { width: 100%; height: 38px; justify-content: space-between; padding-inline: 10px; border: 1px solid var(--ws-line); background: var(--ws-surface); color: var(--ws-ink); font-size: 12px; }
body.parker-app .advanced-settings .setting-field > .model-picker .model-picker-trigger:hover:not(:disabled) { border-color: var(--ws-line-strong); background: var(--ws-canvas-subtle); }
body.parker-app .advanced-settings .setting-field > .model-picker .model-picker-trigger:focus-visible { border-color: var(--ws-accent); outline: 2px solid var(--ws-accent-soft); outline-offset: 1px; }
body.parker-app .setting-field > .model-picker select { height: 38px; padding-inline: 10px; border: 1px solid var(--ws-line); background: var(--ws-surface); }
body.parker-app .setting-field > .model-picker select:focus { border-color: var(--ws-accent); outline: 0; box-shadow: 0 0 0 2px var(--ws-accent-soft); }
body.parker-app .settings-token-control { min-width: 0; height: 38px; display: grid; grid-template-columns: 38px minmax(0,1fr) 38px; overflow: hidden; border: 1px solid var(--ws-line); border-radius: 5px; background: var(--ws-surface); }
body.parker-app .settings-token-control:focus-within { border-color: var(--ws-accent); box-shadow: 0 0 0 2px var(--ws-accent-soft); }
body.parker-app .settings-token-control button { display: grid; place-items: center; padding: 0; border: 0; background: var(--ws-canvas-subtle); color: var(--ws-muted-strong); cursor: pointer; }
body.parker-app .settings-token-control button:first-child { border-right: 1px solid var(--ws-line); }
body.parker-app .settings-token-control button:last-child { border-left: 1px solid var(--ws-line); }
body.parker-app .settings-token-control button:hover:not(:disabled) { background: var(--ws-accent-soft); color: var(--ws-accent); }
body.parker-app .settings-token-control button:disabled { opacity: .45; cursor: default; }
body.parker-app .settings-token-control button:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: -2px; }
body.parker-app .settings-token-control input { width: 100%; min-width: 0; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: var(--ws-ink); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; appearance: textfield; }
body.parker-app .settings-token-control input::-webkit-inner-spin-button,
body.parker-app .settings-token-control input::-webkit-outer-spin-button { margin: 0; appearance: none; }
body.parker-app .settings-token-control input:focus { outline: 0; box-shadow: none; }
body.parker-app .panel-settings .model-picker-menu { top: calc(100% + 8px); right: auto; bottom: auto; left: 0; }
body.parker-app .preset-editor-core .model-picker-menu { top: calc(100% + 8px); right: auto; bottom: auto; left: 0; }
body.parker-app .settings-generation { display: grid; align-content: start; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
body.parker-app .setting-range { display: grid; gap: 7px; margin: 0 0 15px; }
body.parker-app .setting-range > span { display: flex; justify-content: space-between; color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .setting-range output { color: var(--ws-accent); font: 10px var(--ws-font-mono); }
body.parker-app .setting-range input { width: 100%; accent-color: var(--ws-signal); }
body.parker-app .setting-segment { min-width: 0; display: flex; align-items: end; gap: 4px; margin: 0 0 13px; padding: 0; border: 0; }
body.parker-app .setting-segment legend { width: 100%; margin-bottom: 6px; color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .setting-segment label { flex: 1; }
body.parker-app .setting-segment input { position: absolute; opacity: 0; pointer-events: none; }
body.parker-app .setting-segment span { min-height: 36px; display: grid; place-items: center; border: 1px solid var(--ws-line); border-radius: 4px; color: var(--ws-muted); font-size: 10px; }
body.parker-app .setting-segment input:checked + span { border-color: var(--ws-ink); background: var(--ws-ink); color: var(--ws-surface); }
body.parker-app .setting-inline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
body.parker-app .switch-line { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .switch-line input { accent-color: var(--ws-signal); }
body.parker-app .world-entry-list,
body.parker-app .regex-rule-list { display: grid; gap: 10px; }
body.parker-app .world-entry,
body.parker-app .regex-rule { padding: 12px; border: 1px solid var(--ws-line); border-radius: 4px; background: var(--ws-surface); }
body.parker-app .world-entry > header,
body.parker-app .regex-rule > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body.parker-app .world-entry .setting-field:last-child,
body.parker-app .regex-rule .setting-field:last-child { margin-bottom: 0; }
body.parker-app .player-worldbook { min-width: 0; }
body.parker-app .player-worldbook-entries { display: grid; gap: 12px; }
body.parker-app .player-worldbook-categories { border-bottom: 1px solid var(--ws-line); }
body.parker-app .player-worldbook-category { display: grid; grid-template-columns: minmax(0,1fr) 86px 36px; align-items: center; gap: 8px; }
body.parker-app .player-worldbook-actions,
body.parker-app .player-worldbook-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
body.parker-app .player-worldbook-sources { min-width: 0; margin: 0 0 13px; padding: 0; border: 0; }
body.parker-app .player-worldbook-sources legend { color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .player-worldbook-advanced { border-block: 1px solid var(--ws-line); }
body.parker-app .player-worldbook .player-worldbook-advanced > summary { min-height: 40px; display: list-item; align-content: center; color: var(--ws-ink); font-size: 12px; cursor: pointer; }
body.parker-app .player-worldbook-variant { padding-top: 12px; border-top: 1px solid var(--ws-line); }
body.parker-app .player-worldbook-variant-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
body.parker-app .player-worldbook-variant-actions .setting-field { width: 100px; }
body.parker-app .player-worldbook .settings-section-head { flex-wrap: wrap; gap: 8px; }
body.parker-app .player-worldbook :is(input:not([type="checkbox"]), select, textarea) { width: 100%; min-width: 0; }
body.parker-app .settings-style .style-preview { display: grid; gap: 12px; margin: 0 0 12px; padding: 18px; border: 1px solid var(--ws-line); background: var(--ws-canvas); }
body.parker-app .style-preview .parker-message { margin: 0; }
body.parker-app .style-preview .parker-message__bubble { padding: 10px 12px; border: 1px solid var(--ws-line); background: var(--ws-surface); font-size: 11px; }
body.parker-app .style-preview .parker-message--user { justify-content: flex-end; }
body.parker-app .style-preview .parker-message--user .parker-message__bubble { background: var(--ws-signal); color: var(--ws-action-ink); }
body.parker-app .settings-footer { min-height: 64px; flex: none; display: flex; align-items: center; gap: 7px; padding: 10px 16px; border-top: 1px solid var(--ws-line); background: var(--ws-surface-raised); }
body.parker-app .settings-footer > label { min-width: 0; flex: 1; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; color: var(--ws-muted); font-size: 9px; }
body.parker-app .settings-footer select { min-width: 0; height: 36px; border: 1px solid var(--ws-line); background: var(--ws-surface); font-size: 10px; }

/* Player presets */
body.parker-app .preset-page-heading { align-items: end; }
body.parker-app .page-heading-actions { display: flex; gap: 7px; }
body.parker-app .preset-loading { min-height: 360px; display: grid; place-items: center; }
body.parker-app .preset-index-list { border-top: 1px solid var(--ws-line-strong); }
body.parker-app .preset-row { min-height: 92px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 14px 5px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .preset-index { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--ws-line); border-radius: 50%; color: var(--ws-muted); }
body.parker-app .preset-row.is-default .preset-index { border-color: var(--ws-signal); color: var(--ws-signal); }
body.parker-app .preset-summary > div { display: flex; align-items: center; gap: 8px; }
body.parker-app .preset-summary h2 { margin: 0; font-size: 15px; }
body.parker-app .preset-default { padding: 2px 5px; border-radius: 2px; background: var(--ws-signal-soft); color: var(--ws-signal); font-size: 8px; font-weight: 700; }
body.parker-app .preset-summary p { margin: 5px 0 0; color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .preset-summary small { display: block; margin-top: 4px; color: var(--ws-muted); font: 9px var(--ws-font-mono); }
body.parker-app .preset-actions { display: flex; gap: 3px; }
body.parker-app .preset-actions .icon-button { width: 34px; min-height: 34px; border-color: transparent; background: transparent; }
body.parker-app .preset-actions .icon-button:hover { border-color: var(--ws-line); background: var(--ws-surface); }

body.parker-app .modal:has(.preset-editor) { width: min(1080px,100%); }
body.parker-app .preset-editor-heading { padding-right: 42px; }
body.parker-app .preset-editor-heading h2 { margin-top: 4px; }
body.parker-app .preset-editor { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 22px; }
body.parker-app .preset-editor-core { padding-right: 20px; border-right: 1px solid var(--ws-line); }
body.parker-app .preset-number-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 9px; }
body.parker-app .preset-editor-package { min-width: 0; max-height: 67vh; overflow-y: auto; padding-right: 3px; }
body.parker-app .preset-editor-package details { border-bottom: 1px solid var(--ws-line); }
body.parker-app .preset-editor-package summary { min-height: 44px; display: flex; align-items: center; color: var(--ws-ink); font-size: 12px; font-weight: 700; cursor: pointer; }
body.parker-app .preset-editor-package details[open] { padding-bottom: 12px; }
body.parker-app .preset-editor .modal-actions { grid-column: 1/-1; margin: 0; padding-top: 13px; border-top: 1px solid var(--ws-line); }

/* Image studio */
body.parker-app .image-studio { width: min(1100px,100%); display: grid; gap: 30px; }
body.parker-app .image-studio-heading { align-items: end; }
body.parker-app .image-credit-cost { flex: none; padding: 7px 9px; border: 1px solid var(--ws-line-strong); border-radius: 4px; color: var(--ws-signal); font: 700 10px var(--ws-font-mono); white-space: nowrap; }
body.parker-app .image-generation-form { display: grid; grid-template-columns: minmax(0,1fr) 280px; border: 1px solid var(--ws-line-strong); border-radius: 5px; background: var(--ws-surface); }
body.parker-app .image-prompt-field { margin: 0; padding: 18px; border-right: 1px solid var(--ws-line); }
body.parker-app .image-reference-field { display: grid; gap: 10px; margin-top: 18px; font-size: 13px; }
body.parker-app .image-reference-field p { margin: 0; color: var(--ws-muted); line-height: 1.6; }
body.parker-app .image-reference-select { justify-self: start; }
body.parker-app .image-reference-preview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body.parker-app .image-reference-preview img { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--ws-line); border-radius: 5px; }
body.parker-app .image-reference-preview span { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
body.parker-app #image-reference-status:empty { display: none; }
body.parker-app #image-reference-status { color: var(--ws-danger); }
body.parker-app .image-prompt-field textarea { min-height: 164px; max-height: 440px; resize: vertical; }
body.parker-app .image-generation-controls { min-width: 0; display: grid; align-content: start; gap: 13px; padding: 18px; background: var(--ws-surface-raised); }
body.parker-app .image-generation-controls .setting-field { margin: 0; }
body.parker-app .image-generation-controls .button { width: 100%; min-height: 40px; justify-content: center; }
body.parker-app .image-generation-cost { min-height: 35px; display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 0; border-top: 1px solid var(--ws-line); border-bottom: 1px solid var(--ws-line); color: var(--ws-muted-strong); font-size: 10px; }
body.parker-app .image-generation-cost > span { color: var(--ws-signal); }
body.parker-app .image-generation-cost strong { color: var(--ws-ink); font: 700 12px var(--ws-font-mono); }
body.parker-app .image-generation-status { grid-column: 1/-1; display: flex; align-items: flex-start; gap: 6px; margin: -2px 0 0; color: var(--ws-info); font-size: 11px; line-height: 1.5; }
body.parker-app .image-generation-status svg { flex: none; margin-top: 1px; }
body.parker-app .image-generation-status[data-state="complete"] { color: var(--ws-muted-strong); }
body.parker-app .image-generation-status[data-state="error"] { color: var(--ws-danger); }
body.parker-app .button .lucide-loader-circle,
body.parker-app .icon-button .lucide-loader-circle,
body.parker-app .generated-image-preview--pending .lucide-loader-circle { animation: image-generation-spin 850ms linear infinite; }
body.parker-app .image-gallery { display: grid; gap: 14px; }
body.parker-app .image-gallery .section-heading { margin: 0; }
body.parker-app .generated-image-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 19px; }
body.parker-app .generated-image-item { min-width: 0; display: grid; gap: 9px; }
body.parker-app .generated-image-preview { min-width: 0; display: block; overflow: hidden; border: 1px solid var(--ws-line-strong); border-radius: 4px; background: var(--ws-canvas-subtle); aspect-ratio: 1 / 1; }
body.parker-app .generated-image-preview:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 3px; }
body.parker-app .generated-image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 180ms ease; }
body.parker-app .generated-image-preview:hover img { transform: scale(1.025); }
body.parker-app .generated-image-preview--pending { display: grid; place-items: center; border-style: dashed; color: var(--ws-info); background: linear-gradient(110deg, var(--ws-canvas-subtle) 30%, var(--ws-surface-raised) 48%, var(--ws-canvas-subtle) 66%); background-size: 220% 100%; animation: image-generation-pending 1.5s ease-in-out infinite; }
body.parker-app .generated-image-meta { min-width: 0; display: flex; align-items: start; justify-content: space-between; gap: 9px; }
body.parker-app .generated-image-meta > div:first-child { min-width: 0; display: grid; gap: 4px; }
body.parker-app .generated-image-meta strong { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; color: var(--ws-ink); font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; }
body.parker-app .generated-image-meta small { overflow: hidden; color: var(--ws-muted); font: 9px/1.4 var(--ws-font-mono); text-overflow: ellipsis; white-space: nowrap; }
body.parker-app .generated-image-actions { flex: none; display: flex; gap: 2px; }
body.parker-app .generated-image-actions .icon-button { width: 30px; min-height: 30px; border-color: transparent; background: transparent; color: var(--ws-muted); }
body.parker-app .generated-image-actions .icon-button:hover { border-color: var(--ws-line); background: var(--ws-canvas-subtle); color: var(--ws-ink); }
body.parker-app .generated-image-actions .icon-button.danger:hover { border-color: var(--ws-danger); color: var(--ws-danger); }
body.parker-app .image-gallery-empty { grid-column: 1/-1; min-height: 190px; }
@keyframes image-generation-spin { to { transform: rotate(360deg); } }
@keyframes image-generation-pending { to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  body.parker-app .button .lucide-loader-circle,
  body.parker-app .icon-button .lucide-loader-circle,
  body.parker-app .generated-image-preview--pending .lucide-loader-circle,
  body.parker-app .generated-image-preview--pending { animation: none; }
}
body.parker-app .model-picker-mobile-dialog { display: grid; gap: 14px; }
body.parker-app .model-picker-mobile-dialog h2 { padding-right: 38px; }
body.parker-app .model-picker-mobile-options { max-height: min(440px,62dvh); overflow-y: auto; display: grid; border: 1px solid var(--ws-line); border-radius: 5px; }
body.parker-app .model-picker-mobile-option { min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--ws-line); background: var(--ws-surface); color: var(--ws-ink); text-align: left; }
body.parker-app .model-picker-mobile-option:last-child { border-bottom: 0; }
body.parker-app .model-picker-mobile-option[aria-selected="true"] { background: var(--ws-accent-soft); color: var(--ws-accent); font-weight: 700; }
body.parker-app .model-picker-mobile-option span { min-width: 0; overflow-wrap: anywhere; }
body.parker-app .model-picker-mobile-option svg { flex: none; }
body.parker-app .modal-backdrop { background: var(--ws-backdrop); backdrop-filter: blur(3px); }
body.parker-app .modal { border: 1px solid var(--ws-line-strong); border-radius: 6px; background: var(--ws-surface-raised); box-shadow: var(--ws-shadow-overlay); }
body.parker-app .modal h2 { font-size: 20px; }
body.parker-app .toast { border-radius: 4px; background: var(--ws-ink); color: var(--ws-surface); box-shadow: var(--ws-shadow-overlay); }

@keyframes panel-enter {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Desktop reading scale: keep long-form chat comfortable at normal monitor distance. */
@media (min-width: 1021px) {
  body.parker-app .header-turns { font-size: 11px; }
  body.parker-app .message-markup-name { font-size: 12px; }
  body.parker-app .message-markup-bubble { font-size: 16px; line-height: 1.75; }
  body.parker-app .prologue-copy p { font-size: 16px; }

}

@media (max-width: 1180px) {
  body.parker-app { --sidebar: 196px; }
  body.parker-app .sidebar { padding-inline: 12px; }
  body.parker-app .sidebar .brand > span,
  body.parker-app .sidebar .nav-label,
  body.parker-app .sidebar .nav-button span,
  body.parker-app .sidebar .account-strip > span:not(.avatar),
  body.parker-app .sidebar .account-strip > svg { display: initial; }
  body.parker-app .page { padding-inline: 30px; }
  body.parker-app .story-grid { gap-inline: 18px; }

}

@media (max-width: 1020px) {
  body.parker-app .story-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.parker-app .story-grid.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body.parker-app .story-card-featured .story-body { width: 88%; }
  body.parker-app .generated-image-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }

}

@media (max-width: 820px) {
  body.parker-app { --sidebar: 0px; --topbar: 62px; }
  body.parker-app .app-shell,
  body.parker-app.workspace-active .app-shell { padding-left: 0 !important; }
  body.parker-app .sidebar,
  body.parker-app.workspace-active .sidebar {
    width: min(300px,86vw);
    display: flex !important;
    padding: 18px 14px calc(14px + env(safe-area-inset-bottom));
    z-index: 92;
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(.16,1,.3,1);
  }
  body.parker-app .sidebar.is-open,
  body.parker-app.workspace-active .sidebar.is-open { transform: translateX(0); box-shadow: 18px 0 48px rgb(23 25 22 / 18%); }
  body.parker-app .sidebar-close { position: absolute; top: 18px; right: 14px; width: 38px; min-height: 38px; display: grid; z-index: 1; }
  body.parker-app .sidebar .brand { padding-right: 46px; }
  body.parker-app .sidebar-nav { padding-right: 2px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  body.parker-app .sidebar .account-strip > span:not(.avatar) { display: grid; gap: 1px; text-align: left; }
  body.parker-app .site-navigation-scrim {
    position: fixed;
    z-index: 91;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: rgb(24 25 23 / 38%);
  }
  body.parker-app .site-navigation-scrim[hidden] { display: none; }
  body.parker-app.site-navigation-open { overflow: hidden; }
  body.parker-app .topbar { padding: 9px 12px; }
  body.parker-app .topbar .search-box { min-width: 0; width: auto; flex: 1; display: block; }
  body.parker-app .page { padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); }
  body.parker-app .image-generation-form { grid-template-columns: 1fr; }
  body.parker-app .image-prompt-field { border-right: 0; border-bottom: 1px solid var(--ws-line); }
  body.parker-app .image-generation-controls { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  body.parker-app .image-generation-cost { min-height: 38px; border-bottom: 0; }
  body.parker-app .image-generation-controls .button { width: auto; min-width: 118px; }

}

@media (max-width: 760px) {
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) { border-top: 0; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .story-cover { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .story-body { padding: 14px 2px 0; background: transparent; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) h3 { min-height: 0; color: var(--ws-ink); font-size: 21px; }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .story-author { color: var(--ws-accent); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) p { color: var(--ws-muted-strong); }
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .story-metrics,
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .tag { background: transparent; color: var(--ws-muted); }

}

@media (max-width: 620px) {
  body.parker-app .author-header { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; margin-bottom: 24px; }
  body.parker-app .author-header > .author-actions { grid-column: 1 / -1; justify-content: space-between; }
  body.parker-app .author-avatar { width: 48px; height: 48px; font-size: 17px; }
  body.parker-app .author-identity h1 { font-size: 21px; overflow-wrap: anywhere; }
  body.parker-app .following-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; }
  body.parker-app .topbar { gap: 8px; }
  body.parker-app .mobile-brand { min-width: 38px; gap: 0; }
  body.parker-app .mobile-brand img { width: 32px; height: 32px; }
  body.parker-app .mobile-brand strong { display: none; }
  body.parker-app .search-box { width: auto; flex: 1; }
  body.parker-app .top-actions .top-points { display: none; }
  body.parker-app .explore-intro { min-height: 82px; margin-bottom: 17px; }
  body.parker-app .explore-intro h1 { font-size: 31px; }
  body.parker-app .explore-intro p { font-size: 13px; }
  body.parker-app .explore-count { display: none; }
  body.parker-app .featured-world { margin-inline: 0; margin-bottom: 26px; }
  body.parker-app .story-card.story-card-featured { height: auto; min-height: 430px; border-radius: 14px; }
  body.parker-app .story-card-featured .story-body { width: 100%; padding: 22px 18px; }
  body.parker-app .story-card-featured .story-kicker { justify-content: space-between; }
  body.parker-app .story-card-featured .story-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 8px 0; }
  body.parker-app .story-card-featured .story-stat { min-height: 48px; padding: 6px 8px; }
  body.parker-app .story-card-featured h3 { font-size: 27px; }
  body.parker-app .story-card-featured p { font-size: 12px; -webkit-line-clamp: 2; }
  body.parker-app .filter-line { align-items: flex-start; }
  body.parker-app .ranking-tabs { gap: 15px; }
  body.parker-app .ranking-tabs .segment { min-height: 44px; }
  body.parker-app .facet-group { grid-template-columns: 1fr; gap: 5px; }
  body.parker-app .facet-group legend { float: none; width: auto; padding-top: 0; }
  body.parker-app .story-grid,
  body.parker-app .story-grid.compact { grid-template-columns: 1fr; gap: 28px; }
  body.parker-app .story-card:not(.story-card-featured),
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) {
    overflow: hidden;
    border: 1px solid var(--ws-line);
    border-radius: 14px;
    background: var(--ws-surface-raised);
    box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
  }
  body.parker-app .story-card:not(.story-card-featured) .story-cover { border-radius: 0; }
  body.parker-app .story-card:not(.story-card-featured) .story-body,
  body.parker-app .story-grid:not(.compact) .story-card:first-child:not(.story-card-featured) .story-body { padding: 16px; }
  body.parker-app .story-card:not(.story-card-featured) h3 { min-height: 0; }
  body.parker-app .image-studio { gap: 24px; }
  body.parker-app .image-studio-heading { align-items: start; gap: 10px; }
  body.parker-app .image-credit-cost { align-self: start; }
  body.parker-app .image-prompt-field,
  body.parker-app .image-generation-controls { padding: 14px; }
  body.parker-app .image-prompt-field textarea { min-height: 142px; font-size: 16px; }
  body.parker-app .image-generation-controls { grid-template-columns: 1fr; gap: 10px; }
  body.parker-app .image-generation-cost { border-bottom: 1px solid var(--ws-line); }
  body.parker-app .image-generation-controls .button { width: 100%; }
  body.parker-app .generated-image-grid { grid-template-columns: 1fr; gap: 22px; }
  body.parker-app .generated-image-preview { aspect-ratio: 4 / 3; }
  body.parker-app .header-turns { display: none; }
  body.parker-app .prologue-copy h1 { margin: 5px 0 7px; font-size: 21px; }
  body.parker-app .prologue-copy p { max-height: 6.9em; font-size: 13px; line-height: 1.72; }
  body.parker-app .opening-switch { min-height: 30px; margin-top: 8px; }
  body.parker-app .settings-generation { grid-template-columns: 1fr; }
  body.parker-app .settings-tabs { gap: 15px; padding-inline: 14px; }
  body.parker-app .settings-section { padding: 14px; }
  body.parker-app .settings-footer { flex-wrap: wrap; }
  body.parker-app .settings-footer > label { flex-basis: 100%; }
  body.parker-app .settings-footer .button { flex: 1; }
  body.parker-app .setting-inline { grid-template-columns: 1fr; gap: 0; }

  body.parker-app .preset-page-heading { gap: 13px; }
  body.parker-app .preset-page-heading .page-heading-actions { width: 100%; }
  body.parker-app .preset-page-heading .button { flex: 1; }
  body.parker-app .preset-row { grid-template-columns: 30px minmax(0,1fr); }
  body.parker-app .preset-actions { grid-column: 2; overflow-x: auto; }
  body.parker-app .modal:has(.preset-editor) { height: calc(100dvh - 16px); }
  body.parker-app .preset-editor { grid-template-columns: 1fr; }
  body.parker-app .preset-editor-core { padding-right: 0; border-right: 0; }
  body.parker-app .preset-editor-package { max-height: none; overflow: visible; }
  body.parker-app .preset-editor .modal-actions { position: sticky; bottom: -18px; margin-inline: -14px; padding: 11px 14px calc(2px + env(safe-area-inset-bottom)); background: var(--ws-surface-raised); }

}

@keyframes panel-enter-mobile {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 390px) {
  body.parker-app .prologue-copy p { max-height: 5.2em; }
  body.parker-app .preset-number-grid { grid-template-columns: 1fr; }

}

@media (max-width: 620px) and (max-height: 600px) {
  body.parker-app .explore-intro { min-height: 68px; margin-bottom: 12px; }
  body.parker-app .explore-intro h1 { font-size: 28px; }
  body.parker-app .explore-intro p { margin-top: 4px; font-size: 12px; }
  body.parker-app .story-card.story-card-featured {
    height: 430px;
    min-height: 430px;
  }
  body.parker-app .story-card-featured .story-body { padding: 16px 18px; }
  body.parker-app .story-card-featured h3 { font-size: 24px; }
  body.parker-app .story-card-featured p { display: none; }
  body.parker-app .story-enter { margin-top: 11px; }

}

@media (prefers-reduced-motion: reduce) {
  body.parker-app .sidebar { transition: none; }

}

/* Desktop sidebar collapse */
@media (min-width: 821px) {
  body.parker-app.sidebar-collapsed { --sidebar: 72px; }
  body.parker-app.sidebar-collapsed .sidebar { padding-inline: 10px; }
  body.parker-app.sidebar-collapsed .brand { justify-content: center; margin-inline: 0; margin-bottom: 48px; padding-inline: 0; }
  body.parker-app.sidebar-collapsed .brand > span,
  body.parker-app.sidebar-collapsed .sidebar .nav-label,
  body.parker-app.sidebar-collapsed .sidebar .nav-button > span,
  body.parker-app.sidebar-collapsed .sidebar .account-strip > span:not(.avatar),
  body.parker-app.sidebar-collapsed .sidebar .account-strip > svg { display: none; }
  body.parker-app.sidebar-collapsed .nav-button { justify-content: center; padding-inline: 0; }
  body.parker-app.sidebar-collapsed .sidebar-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-app.sidebar-collapsed .sidebar .account-strip {
    min-height: 38px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 4px 0;
  }
  body.parker-app .sidebar-collapse {
    position: absolute;
    top: 19px;
    right: 14px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--archive-spine-muted);
  }
  body.parker-app .sidebar-collapse:hover { background: var(--archive-spine-raised); color: var(--archive-spine-ink); }
  body.parker-app .sidebar-collapse:focus-visible { outline: 2px solid var(--archive-spine-ink); outline-offset: 2px; }
  body.parker-app.sidebar-collapsed .sidebar-collapse { top: 80px; right: 19px; }

}

.tavern-editor { min-width: 0; margin-bottom: 20px; }
.tavern-editor-heading, .tavern-prompt-actions { display: flex; align-items: center; gap: 8px; }
.tavern-editor-heading { justify-content: space-between; margin-bottom: 12px; }
.tavern-editor h3, .tavern-warnings h3 { margin: 0; font-size: 15px; }
.tavern-prompt { border-bottom: 1px solid var(--border, #dedfe2); }
.tavern-prompt > summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; cursor: pointer; }
.tavern-prompt-index { width: 24px; flex: 0 0 24px; font-size: 12px; color: var(--muted, #65666b); }
.tavern-prompt-name { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 13px; }
.tavern-prompt-state { flex: 0 0 28px; font-size: 12px; color: var(--muted, #65666b); }
.tavern-prompt-fields { display: grid; gap: 12px; padding: 0 0 16px; min-width: 0; }
.tavern-prompt-actions .switch-line { margin-right: auto; }
.tavern-editor .setting-field { min-width: 0; }
.tavern-editor textarea { width: 100%; min-width: 0; overflow-wrap: anywhere; }
.tavern-marker { font-family: monospace; font-size: 12px; overflow-wrap: anywhere; }
.tavern-prefill { margin-top: 16px; }
.tavern-warnings { padding: 12px 0; color: #75551c; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.tavern-warnings ul { margin: 8px 0 0; padding-left: 20px; }
.tavern-warnings li + li { margin-top: 6px; }
.preset-import-form { min-width: 0; }
.preset-import-summary { display: grid; gap: 8px; font-size: 13px; margin: 18px 0; }
.preset-import-summary > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
.preset-import-summary dd { margin: 0; overflow-wrap: anywhere; }
.preset-import-error { color: #ad3030; font-size: 13px; overflow-wrap: anywhere; }

@media (min-width: 821px) {
  body.parker-app .modal:has(.preset-editor .tavern-editor) { height: min(780px, 92dvh); display: flex; flex-direction: column; overflow: hidden; }
  body.parker-app .modal:has(.tavern-editor) .preset-editor { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  body.parker-app .modal:has(.tavern-editor) .preset-editor-core,
  body.parker-app .modal:has(.tavern-editor) .preset-editor-package { min-height: 0; max-height: none; overflow-y: auto; }

}

/* The entry trigger opens the family/price list outside clipped toolbars. */
body.parker-app .story-game-config-model .model-picker.entry-model,
body.parker-app .dock-model .model-picker.entry-model { display: flex; }
body.parker-app .model-picker.entry-model .model-picker-trigger { width: 100%; min-width: 0; flex: 1 1 auto; }
body.parker-app .model-picker.entry-model .model-picker-trigger > span { flex: 1 1 auto; }
body.parker-app .model-picker-mobile-dialog .model-picker-option small { white-space: normal; overflow-wrap: anywhere; }

/* pake-theme.css */
/* Supplied Pake 双端设计交付 · 莓紫夜色. Player only; author frames and admin keep their own styles. */
body.parker-app {
  color-scheme: light;
  --bg: var(--ws-canvas);
  --surface: var(--ws-surface);
  --surface-soft: var(--ws-canvas-subtle);
  --ink: var(--ws-ink);
  --muted: var(--ws-muted);
  --line: var(--ws-line);
  --brand: var(--ws-accent);
  --brand-solid: var(--ws-accent);
  --brand-soft: var(--ws-accent-soft);
  --danger: var(--ws-danger);
  --ws-canvas: #fbf5f4;
  --ws-canvas-subtle: #f3e7eb;
  --ws-surface: #fffafa;
  --ws-surface-raised: #fffafa;
  --ws-surface-strong: #f3e7eb;
  --ws-ink: #392539;
  --ws-ink-soft: #51394d;
  --ws-muted: #755e72;
  --ws-muted-strong: #755e72;
  --ws-line: #e0cdd7;
  --ws-line-strong: #a8899d;
  --ws-accent: #963e64;
  --ws-accent-hover: #7c2d50;
  --ws-accent-strong: #7c2d50;
  --ws-accent-soft: #f2dce5;
  --ws-accent-softer: #f6e8ee;
  --ws-signal: var(--ws-accent);
  --ws-signal-hover: var(--ws-accent-hover);
  --ws-signal-soft: var(--ws-accent-soft);
  --ws-action-ink: #fffafa;
  --archive-spine: var(--ws-surface);
  --archive-spine-raised: var(--ws-surface-strong);
  --archive-spine-ink: var(--ws-ink);
  --archive-spine-muted: var(--ws-muted);
  --sidebar: 208px;
  --topbar: 80px;
  --ws-radius-control: 9px;
  --ws-radius-panel: 16px;
  --ws-font-display: 'Songti SC', 'Noto Serif CJK SC', STSong, serif;
  background: var(--ws-canvas);
  color: var(--ws-ink);
  accent-color: var(--ws-accent);
  caret-color: var(--ws-accent);
  scrollbar-color: var(--ws-line-strong) var(--ws-canvas);
}
body.parker-app.dark {
  color-scheme: dark;
  --ws-canvas: #17121b;
  --ws-canvas-subtle: #211925;
  --ws-surface: #211925;
  --ws-surface-raised: #2d2230;
  --ws-surface-strong: #2d2230;
  --ws-ink: #faedf0;
  --ws-ink-soft: #e3cfdc;
  --ws-muted: #beaabd;
  --ws-muted-strong: #beaabd;
  --ws-line: #443448;
  --ws-line-strong: #896a86;
  --ws-accent: #ef9ab5;
  --ws-accent-hover: #f5b4c9;
  --ws-accent-strong: #f5b4c9;
  --ws-accent-soft: #49303f;
  --ws-accent-softer: #302130;
  --ws-signal: var(--ws-accent);
  --ws-signal-hover: var(--ws-accent-hover);
  --ws-signal-soft: var(--ws-accent-soft);
  --ws-action-ink: #301520;
  --archive-spine: #1e1621;
  --archive-spine-raised: var(--ws-surface-strong);
  --archive-spine-ink: var(--ws-ink);
  --archive-spine-muted: var(--ws-muted);
  --ws-danger: #ffa79a;
  --ws-danger-soft: #482932;
  --ws-warning: #edc7b5;
  --ws-warning-soft: #44312c;
}
body.parker-app ::selection { background: var(--ws-accent); color: var(--ws-action-ink); }
body.parker-app :focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 3px; }
body.parker-app input::placeholder, body.parker-app textarea::placeholder { color: var(--ws-muted); opacity: 1; }
body.parker-app .topbar, body.parker-app.dark .topbar { background: var(--ws-canvas); backdrop-filter: none; padding-inline: 36px; }
body.parker-app .page:not([data-explore-page]) { max-width: 1530px; padding: 24px 36px 48px; }
body.parker-app .sidebar { padding: 24px 16px 16px; }
body.parker-app .brand { border: 0; margin-bottom: 20px; gap: 10px; }
/* Pake design delivery: app.js .brand markup and app.css .brand em. */
body.parker-app .brand .pake-brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 37px; height: 40px; border: 1px solid var(--ws-accent); border-radius: 13px 13px 13px 3px; color: var(--ws-accent); font: italic 600 31px/1 Georgia, serif; }
body.parker-app .brand strong { font-family: var(--ws-font-sans); font-size: 22px; font-weight: 600; letter-spacing: 2px; }
body.parker-app .brand small { font: 400 9px/1.1 var(--ws-font-sans); letter-spacing: 3px; }
body.parker-app .nav-button { min-height: 46px; border-radius: 9px; font-size: 14px; font-weight: 400; }
body.parker-app .nav-button.active, body.parker-app.dark .nav-button.active { color: var(--ws-accent); background: var(--ws-surface-strong); }
body.parker-app .nav-button.active::before { width: 0; }
body.parker-app .nav-group:first-child .nav-label { display: none; }
body.parker-app .sidebar .nav-label { font-size: 12px; font-weight: 400; padding-bottom: 10px; }
body.parker-app .sidebar .avatar, body.parker-app .avatar { background: var(--ws-accent-soft); color: var(--ws-ink); border-color: var(--ws-line); }
body.parker-app .button, body.parker-app .icon-button { min-height: 44px; border-radius: 9px; }
body.parker-app input, body.parker-app textarea, body.parker-app select { border-radius: 8px; }
body.parker-app .search-box input { background: var(--ws-surface); border-color: var(--ws-line); border-radius: 9px; }
body.parker-app h1 { font-size: 30px; }
body.parker-app #world-catalog { scroll-margin-top: 100px; }
body.parker-app .ranking-tabs { gap: 16px; border: 0; background: transparent; }
body.parker-app .ranking-tabs .segment { min-height: 44px; padding: 0 4px; border-radius: 0; background: transparent; border: 0; color: var(--ws-muted); }
body.parker-app .ranking-tabs .segment.active { color: var(--ws-accent); border-bottom: 2px solid var(--ws-accent); box-shadow: none; }
body.parker-app .explore-filters { border-bottom: 1px solid var(--ws-line); }
body.parker-app .catalog-heading h2, body.parker-app .story-card h3 { font-family: var(--ws-font-sans); }
body.parker-app .story-card:not(.story-card-featured) .story-heat { background: var(--ws-surface-raised); border-color: var(--ws-line); }
body.parker-app .story-card:not(.story-card-featured) .story-cover { background: var(--ws-surface); }
body.parker-app .story-card:not(.story-card-featured) .story-cover img { object-fit: contain; }
body.parker-app .story-card:not(.story-card-featured) .cover-fallback { background-color: var(--ws-surface); background-size: contain; }
body.parker-app .story-card:not(.story-card-featured):hover .story-cover img { transform: none; }
body.parker-app .featured-label { color: var(--ws-action-ink); }
body.parker-app .mobile-nav { display: none; }
body.parker-app .profile-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
body.parker-app .profile-links a { display: flex; align-items: center; gap: 10px; padding: 18px; background: var(--ws-surface); border-radius: 12px; color: var(--ws-ink); text-decoration: none; }
body.parker-app .profile-links a:hover { background: var(--ws-surface-strong); }
body.parker-app .preference-section { max-width: 720px; margin: 28px 0; padding-bottom: 24px; border-bottom: 1px solid var(--ws-line); }
body.parker-app .preference-options { display: flex; gap: 12px; flex-wrap: wrap; }
body.parker-app .preference-options [aria-pressed='true'] { border-color: var(--ws-accent); color: var(--ws-accent); background: var(--ws-accent-softer); }
@media (max-width: 820px) {
  body.parker-app { --sidebar: 0px; --topbar: 65px; }
  body.parker-app .topbar { padding: 10px 18px; }
  body.parker-app .page:not([data-explore-page]) { padding: 18px 18px calc(90px + env(safe-area-inset-bottom)); }
  body.parker-app .page[data-explore-page] { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  body.parker-app .mobile-nav { position: fixed; z-index: 25; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ws-line); background: var(--ws-canvas); }
  body.parker-app .mobile-nav .nav-button { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: 52px; padding: 4px 0; font-size: 11px; }
  body.parker-app .mobile-nav .nav-button span { display: block; }
  body.parker-app .mobile-nav .nav-button svg { width: 20px; height: 20px; }
  body.parker-app .profile-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.parker-app input, body.parker-app select, body.parker-app textarea { font-size: 16px; }
}
@media (max-width: 359px) {
  body.parker-app .page:not([data-explore-page]) { padding-inline: 14px; }
  body.parker-app .topbar { padding-inline: 14px; }
  body.parker-app .catalog-heading h2 { font-size: 20px; }
  body.parker-app .profile-links a { padding: 14px 10px; }
}
@media (prefers-reduced-motion: reduce) { body.parker-app *, body.parker-app *::before, body.parker-app *::after { scroll-behavior: auto; } }

/* Theme only the platform reading surface. Authored HTML/iframes retain their contract. */
body.parker-app .chat-theme-surface,
body.parker-app .chat-theme-surface[data-story-style="reading"] { background: var(--ws-canvas); }
body.parker-app .chat-theme-surface[data-story-style="reading"] .message:not(.user) .message-bubble { background: var(--ws-surface); border-radius: 12px; }
body.parker-app .chat-theme-surface[data-story-style="reading"] .message.user .message-bubble { background: var(--ws-accent-soft); border-color: var(--ws-line); color: var(--ws-ink); border-radius: 12px; }
body.parker-app .account-button-quiet { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; }
body.parker-app .account-button-quiet:hover { background: var(--ws-surface-strong); }
body.parker-app .story-enter { background: var(--ws-accent); color: var(--ws-action-ink); border-color: var(--ws-accent); border-radius: 9px; }
body.parker-app .story-card .story-summary-expandable { display: -webkit-box; white-space: pre-wrap; overflow-wrap: anywhere; }
body.parker-app .story-card.story-summary-expanded .story-body p.story-summary-expandable { display: block; height: auto; min-height: 0; overflow: visible; -webkit-line-clamp: unset; }
body.parker-app .story-summary-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 44px; margin-left: auto; padding: 6px 0 6px 12px; border: 0; background: transparent; color: var(--ws-accent); font: inherit; font-size: 13px; cursor: pointer; }
body.parker-app .story-summary-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
body.parker-app .story-card-featured .story-summary-toggle { color: #fff; }
body.parker-app .story-card.story-card-featured.story-summary-expanded { height: auto; }
body.parker-app .story-card-featured.story-summary-expanded .story-body { position: relative; margin-top: auto; }
