:root {
  color-scheme: light;
  --ink: #2c2024;
  --muted: #685D62;
  --line: #ede6e8;
  --surface: #fff;
  --canvas: #f9f6f7;
  --sidebar: #2a1e23;
  --accent: #d4878e;
  --accent-strong: #b0646d;
  --accent-soft: #fff5f6;
  --green: #187451;
  --green-bg: #e7f5ed;
  --amber: #a8875c;
  --amber-bg: #fdf5ec;
  --red: #a33b30;
  --red-bg: #ffebe8;
  --shadow: 0 16px 42px rgba(44, 32, 36, .08);
  --shadow-1: 0 1px 0 rgba(44, 32, 36, .04), 0 10px 24px rgba(44, 32, 36, .06);
  --shadow-2: 0 10px 28px rgba(44, 32, 36, .12);
  --shadow-3: 0 22px 48px rgba(44, 32, 36, .16);
  --easing: cubic-bezier(.2, .8, .2, 1);
  --dur-1: .14s;
  --dur-2: .22s;
  --dur-3: .36s;
  --font-display: "Inter", "SF Pro Display", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-ui: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  /* Semantic radius scale (source of truth for Tailwind aliases): control
     inputs/menus, icon tiles, cards, and dialog panels. */
  --radius-control: 12px;
  --radius-icon: 10px;
  --radius-card: 14px;
  --radius-panel: 16px;
  --tracking: -.02em;
  --leading: 1.55;
  /* Champagne Pearl — Material tokens */
  --frost-blur-1: 10px;
  --frost-blur-2: 16px;
  --shimmer-rose: #e8c4b8;
  --shimmer-gold: #dfc9a0;
  --shimmer-lav: #cdb8d0;
  --champagne: #c9a87c;
  --pearl: #f5eff1;
  --noise-opacity: .03;
  --shimmer-speed: .65s;
  --sidebar-expanded: 256px;
  --sidebar-collapsed: 72px;
  /* Assistant column tokens (chat-column migration plan §3.3): single source
     of truth for the dock/rail widths and fixed zone heights. The shell grid,
     detail-sheet offset and assistant.css all read these — never hardcode the
     assistant width anywhere else. */
  --assistant-expanded-w: 460px;
  --assistant-collapsed-w: 64px;
  --assistant-tablet-w: 420px;
  --assistant-header-h: 60px;
  --assistant-mode-h: 94px;
  --assistant-composer-min-h: 170px;
  /* Fixed-layer avoidance (plans/mobile-uiux-upgrade-plan.md §3.2): single
     source of truth for the bottom navigation's footprint. Every fixed
     element that must clear the nav (body padding, toast, chat fab, chat
     dock) reads --bottom-nav-safe instead of hardcoding a height.
     --bottom-nav-h = 56px button row + 1px border-top; if the nav buttons'
     min-height ever changes, update it here only. Desktop/tablet default is
     0 (no bottom nav); the mobile block below turns it on. */
  --bottom-nav-h: 57px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-safe: 0px;
}
@media (max-width: 720px) {
  :root { --bottom-nav-safe: calc(var(--bottom-nav-h) + var(--safe-bottom)); }
}
html[lang="zh"] {
  --font-display: "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", sans-serif;
  --tracking: 0;
  --leading: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 340px; background: var(--canvas); color: var(--ink); font: 14px/var(--leading) var(--font-body); }
h1, h2, .dataset-title h2, .metric strong, .runs-heading h2, .settings-heading h2 { font-family: var(--font-display); letter-spacing: var(--tracking); }
.id, .run-id, .mono, #settings-preview { font-family: var(--font-mono); }
button:active { transform: scale(.97); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.auth-user {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}
.auth-signout {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
}
.auth-signout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.auth-locked { filter: blur(8px); pointer-events: none; user-select: none; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(40, 28, 34, .55);
}
.auth-panel {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-3);
}
.auth-panel h1 { margin: 8px 0; font-size: 26px; }
.auth-panel > p:not(.overline) { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.dev-exit { width: 100%; padding: 10px 12px; border: 1px solid #e0c8a8; border-radius: 9px; background: var(--amber-bg); color: var(--amber); font-size: 13px; font-weight: 700; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.dev-exit:hover { background: #f5e4d0; color: #8a6840; }
.auth-retry { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; transition: background var(--dur-1) var(--easing); }
.auth-retry:hover { background: var(--green-bg); }
.hidden { display: none !important; }
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr) var(--assistant-expanded-w); transition: grid-template-columns var(--dur-2) var(--easing); }
.sidebar { position: sticky; top: 0; z-index: 45; height: 100vh; display: flex; flex-direction: column; padding: 20px 16px 16px; overflow: visible; background: linear-gradient(180deg, #342831 0%, var(--sidebar) 42%, #1f161a 100%); color: white; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 18px; font-family: var(--font-display); }
.brand-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-main > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); font-size: 16px; font-weight: 750; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text > span { display: -webkit-box; font-size: 14px; font-weight: 750; line-height: 1.25; color: #fff; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.brand-text small { display: block; color: #9e929a; font-size: 11px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle, .sidebar-mobile-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.04); color: #bbaeb4; }
.sidebar-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-toggle svg, .sidebar-mobile-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-primary-action { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 19px; padding: 0 12px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #dd9299, #c7737c); color: #fff; font-size: 13px; font-weight: 750; box-shadow: 0 8px 20px rgba(10,4,7,.22); }
.sidebar-primary-action:hover { box-shadow: 0 10px 24px rgba(10,4,7,.3); transform: translateY(-1px); }
.sidebar-nav { display: grid; gap: 6px; padding-bottom: 17px; border-bottom: 1px solid #49363f; }
.nav-button { position: relative; width: 100%; height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #b6a7ad; text-align: left; font-size: 13px; font-weight: 550; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.nav-button:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-button.active { background: #47353e; color: white; font-weight: 750; }
.nav-button.active::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 99px; background: var(--accent); }
.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav-button .nav-label { min-width: 0; width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.nav-button em { margin-left: auto; padding: 1px 7px; border-radius: 10px; background: #4a3b42; font-size: 11px; font-style: normal; }
.sidebar-section { min-height: 0; display: flex; flex-direction: column; padding-top: 19px; }
.section-label { margin: 0 10px 8px; color: #968a90; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.dataset-links { min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(212, 135, 142, .38) transparent; }
.dataset-links::-webkit-scrollbar { width: 5px; }
.dataset-links::-webkit-scrollbar-thumb { background: rgba(212, 135, 142, .38); border-radius: 99px; }
.dataset-links::-webkit-scrollbar-thumb:hover { background: rgba(212, 135, 142, .6); }
.dataset-links::-webkit-scrollbar-track { background: transparent; }
.dataset-link { width: 100%; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: #a9969d; text-align: left; transition: background var(--dur-1) var(--easing); }
.dataset-link > span:nth-child(2) { min-width: 0; overflow: hidden; }
.dataset-link:hover { background: #362a30; box-shadow: inset 2px 0 0 var(--accent); }
.dataset-link.selected { background: #43343c; color: white; }
.dataset-link > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #7a6e74; }
.dataset-link.ready > span:first-child { background: #42b983; }
.dataset-link.incomplete > span:first-child { background: #e4a743; }
.dataset-link strong, .dataset-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dataset-link strong { font-size: 12px; }
.dataset-link small { color: #b7a8ae; font-size: 11px; }
.dataset-link em { font-size: 11px; font-style: normal; }
.boundary-card { margin-top: 14px; padding: 12px; border: 1px solid #453840; border-radius: 9px; background: rgba(44, 32, 38, .72); }
.boundary-card strong { font-size: 11px; color: #c4b8be; }
.boundary-card p { margin: 4px 0 0; color: #988c92; font-size: 11px; line-height: 1.5; }
.sidebar-footer { position: relative; margin-top: auto; display: grid; gap: 8px; }
.account-zone { flex: 0 0 auto; padding-top: 14px; }
.account-zone .nav-button { height: 40px; }
.account-row { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.035); }
.account-row:hover { background: rgba(255,255,255,.07); }
.account-summary-button { min-width: 0; flex: 1; display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: #fff; text-align: left; }
.account-menu-icon { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.account-summary { min-width: 0; flex: 1; display: grid; }
.account-summary strong, .account-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary strong { font-size: 12px; }
.account-summary small { color: #a99ba1; font-size: 10.5px; }
.account-chevron { width: 16px; height: 16px; fill: none; stroke: #a99ba1; stroke-width: 1.7; transition: transform var(--dur-1) var(--easing); }
.account-summary-button[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.sidebar-account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); display: grid; gap: 9px; padding: 12px; border: 1px solid #514049; border-radius: 12px; background: #2b2025; box-shadow: 0 18px 40px rgba(0,0,0,.34); }
.account-menu-label { color: #a99ba1; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-mobile-toggle, .sidebar-backdrop { display: none; }
.explore-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.research-community-button { min-height: 38px; padding: 8px 13px; border: 1px solid #e2c8cd; border-radius: 9px; background: #fff7f8; color: #a6505d; font-size: 12px; font-weight: 750; transition: background var(--dur-1) var(--easing), border-color var(--dur-1) var(--easing), transform var(--dur-1) var(--easing); }
.research-community-button:hover { border-color: var(--accent); background: #fff; transform: translateY(-1px); }
.community-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.community-select select { max-width: 340px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 13px; font-weight: 600; }
.bottom-nav { display: none; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.overview-rail { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.overview-heading h2 { margin: 0; font-size: 24px; }
.overview-lead { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.overview-block { margin-top: 26px; }
.overview-block-rail { margin-top: 20px; }
.overview-block-rail:first-child { margin-top: 0; }
.overview-block h3 { margin: 0 0 10px; font-size: 15px; }
.overview-rows { display: grid; gap: 10px; }
.overview-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-1); }
.overview-row-community { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.overview-row h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.overview-row .meters { margin: 6px 0 0; }
.overview-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.overview-row-side strong { font-size: 14px; }
.overview-communities { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.overview-communities li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.overview-communities strong { grid-column: 2; grid-row: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-communities .status-pill { grid-column: 3; grid-row: 1; }
.overview-communities .overview-community-meta { grid-column: 2 / 4; grid-row: 2; }
.dataset-dot { width: 8px; height: 8px; border-radius: 50%; background: #7a6e74; }
.dataset-dot.ready { background: #42b983; }
.dataset-dot.incomplete { background: #e4a743; }
.overview-community-meta { color: var(--muted); font-size: 11px; }
.status-pill { padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.status-pill.ok { background: var(--green-bg); color: var(--green); }
.status-pill.warn { background: var(--amber-bg); color: var(--amber); }
.overview-tasks { display: flex; flex-wrap: wrap; gap: 8px; }
.run-card { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-1); }
.run-card + .run-card { margin-top: 10px; }
.run-card-head { display: flex; align-items: center; gap: 10px; }
.run-card-title { min-width: 0; flex: 1; }
.run-card-title h3 { margin: 0; font-size: 14px; }
.run-card-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.dataset-dot.attention { background: #d24f42; }
.run-details { max-width: 320px; margin-left: auto; text-align: right; }
.run-details dl { text-align: left; }
.run-copy { margin: 10px 0 0; }
.why-line { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.entry-button.ghost { background: white; color: #b0646d; border: 1px solid #e8c9cd; }
.entry-button.ghost:hover { background: #fff5f6; }
.post-foot .entry-button + .entry-button { margin-left: 6px; }
.filters-toggle em { margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: white; font-style: normal; font-size: 10px; }
.filters-sheet { border-bottom: 1px solid var(--line); background: #fdfbfc; }
.filters-sheet[hidden] { display: none; }
.detail-why { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.detail-why strong { color: var(--ink); margin-right: 6px; }
.settings-groups { display: grid; gap: 14px; margin-top: 18px; }
.settings-group { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-1); }
.settings-group legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.settings-group .settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); font-size: 13px; }
.settings-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.settings-group .settings-card { border: 0; box-shadow: none; padding: 10px 0 0; }
.usage-summary { margin: 6px 0 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.empty.is-error span { color: var(--red); }
.stale-note { margin: 8px 0 0; color: var(--amber); font-size: 12px; font-weight: 600; }
.locale-toggle { display: flex; padding: 3px; border: 1px solid #453840; border-radius: 999px; background: #221a1e; }
.locale-toggle button { flex: 1; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: #a8959c; font-size: 11px; font-weight: 700; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.locale-toggle button[aria-pressed="true"] { background: white; color: #2a1e23; }
.boundary-card code { color: #b8acb2; }
main { min-width: 0; }
.topbar { height: 83px; display: flex; align-items: center; justify-content: space-between; padding: 16px 30px; border-bottom: 1px solid var(--line); background: rgba(252, 248, 249, .88); backdrop-filter: blur(var(--frost-blur-1)); }
.overline { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 28px; letter-spacing: -.025em; }
.service-state { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 11px; box-shadow: var(--shadow-1); }
.service-state span { width: 7px; height: 7px; border-radius: 50%; background: #b5acb0; }
.service-state.online span { background: #28a46f; box-shadow: 0 0 0 3px #e3f5eb; }
.service-state.offline span { background: #d24f42; }
.service-state.restricted span { background: #c8a060; box-shadow: 0 0 0 3px #fdf3e6; }
.topbar-status { display: flex; align-items: center; gap: 8px; }
.dev-badge { padding: 4px 9px; border: 1px solid #4a4046; border-radius: 99px; background: #332c31; color: #f5e4d0; font-family: var(--font-mono); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.cta-mini { padding: 7px 12px; border: 1px solid #e0c8a8; border-radius: 99px; background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 750; box-shadow: var(--shadow-1); transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.cta-mini:hover { background: #f5e4d0; color: #8a6840; }
.page { max-width: 1540px; margin: auto; padding: 27px 30px 45px; }
.page.is-entering { animation: page-in var(--dur-2) var(--easing); }
.dataset-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 63px; }
.dataset-title p { margin: 0 0 3px; color: var(--muted); font-size: 11px; }
.dataset-title h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.badge { padding: 3px 8px; border: 1px solid #e0d8dc; border-radius: 99px; background: #f1eaed; color: #695d63; font-size: 11px; font-weight: 750; }
.badge.ready { background: var(--green-bg); color: var(--green); border-color: #b7dcc8; }
.badge.warn { background: var(--amber-bg); color: var(--amber); border-color: #e0c8a8; }
.badge.danger { background: var(--red-bg); color: var(--red); border-color: #ecc3bd; }
.dataset-source { max-width: 460px; text-align: right; color: var(--muted); font-size: 11px; }
.dataset-source code { display: block; margin-top: 3px; color: #635760; }
.dataset-status { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.data-details { max-width: 460px; text-align: right; }
.data-details summary { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; list-style: none; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.data-details summary::-webkit-details-marker { display: none; }
.data-details summary::before { content: "⌄"; font-size: 12px; transition: transform var(--dur-1) var(--easing); }
.data-details[open] summary::before { transform: rotate(180deg); }
.data-details summary:hover { background: var(--accent-bg, #fff5f6); color: var(--ink); }
.data-details dl { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow-1); display: grid; gap: 8px; text-align: left; }
.data-details dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-details dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.data-details dd { margin: 0; font-size: 11px; color: var(--ink); overflow-wrap: anywhere; }
.data-details dd code { color: #635760; font-size: 10.5px; }
.data-details-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: left; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 15px; }
.metric { min-height: 78px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-1); transition: transform var(--dur-1) var(--easing), box-shadow var(--dur-1) var(--easing); }
.metric::before { content: ""; display: block; width: 32px; height: 3px; margin-bottom: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--shimmer-rose), var(--shimmer-gold), var(--shimmer-lav)); }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.metric p { margin: 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.metric strong { display: block; margin-top: 3px; font-size: 24px; }
.metric small { color: var(--muted); font-size: 11px; }
.workspace { min-height: 610px; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-1); }
.card-workspace .post-pane { border-right: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.filter-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: white; color: #685c62; font-size: 11px; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing), border-color var(--dur-1) var(--easing); }
.filter-chip.active { background: linear-gradient(135deg, #3e2f36, #2a1e23); border-color: rgba(212, 135, 142, .25); color: white; box-shadow: 0 1px 4px rgba(44, 32, 36, .12); }
.positioning-board { margin: 18px 0 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.five-q { margin: 0 0 10px; padding: 8px 0; border-bottom: 1px solid #f1eaed; }
.five-q:last-child { margin-bottom: 0; border-bottom: 0; }
.five-q h4 { margin: 0 0 6px; font-size: 11px; }
.five-q-layers { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.five-q-body { display: flex; flex-wrap: wrap; gap: 6px; }
.evidence-chip { display: block; width: 100%; padding: 7px 8px; border: 1px solid #ece4e7; border-radius: 7px; background: #fdfafb; color: #544851; font-size: 12px; text-align: left; }
button.evidence-chip { cursor: pointer; }
.evidence-chip small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.evidence-chip q { display: block; margin-top: 3px; color: #685c62; quotes: none; }
.sidecar-note { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.missing-inline { color: #978b91; font-size: 11px; }
.link-list { margin: 6px 0 0; padding-left: 16px; color: #5c5058; font-size: 11px; }
#positioning-filters { border-top: 0; padding-top: 0; }
.ask-search { min-width: 220px; }
.ask-notes { margin: 0 0 10px; color: #685c62; font-size: 12px; }
.five-q.is-hit { background: #fdfafb; border-radius: 8px; padding: 8px; }
.post-pane { min-width: 0; }
.toolbar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search { flex: 1; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #968a90; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.toolbar select { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; color: #6e6268; font-size: 12px; }
.list-meta { display: flex; justify-content: space-between; padding: 8px 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.post-list { height: auto; min-height: 480px; overflow-y: visible; }
.card-stream { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; height: auto; min-height: 520px; }
.opportunity-card { position: relative; display: flex; flex-direction: column; min-height: 220px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fefcfd; cursor: pointer; box-shadow: var(--shadow-1); opacity: 0; transform: translateY(8px); animation: card-in var(--dur-3) var(--easing) forwards; animation-delay: calc(var(--i, 0) * 20ms); transition: transform var(--dur-2) var(--easing), box-shadow var(--dur-2) var(--easing), border-color var(--dur-2) var(--easing); }
.opportunity-card:hover { transform: translateY(-2px); border-color: #e8bcc0; box-shadow: var(--shadow-2); }
.opportunity-card.selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); background: var(--accent-soft); }
.opportunity-card h3 { margin: 8px 0 0; font-size: 16px; font-weight: 650; line-height: 1.35; }
.quote-sticker { margin: 8px 0 10px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: white; }
.quote-sticker p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: #544851; font-size: 14px; line-height: 1.5; }
.quote-sticker cite { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-style: normal; }
.entry-button { margin-left: auto; padding: 6px 10px; border: 0; border-radius: 8px; background: linear-gradient(135deg, #d4878e, #c07078); color: white; font-size: 12px; font-weight: 700; }
.post-card { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.post-card:hover { background: #fcfafb; }
.post-card.selected { background: #fff8f7; }
.post-card.selected::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.post-meta, .post-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.post-meta .id { color: #5c5058; font-weight: 700; }
.post-card h3 { margin: 7px 0 4px; font-size: 12px; line-height: 1.4; }
.post-card .excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 7px; color: #716569; font-size: 14px; line-height: 1.5; }
.scan-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 7px; }
.meters { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--muted); font-size: 11px; }
.heat-value { font-variant-numeric: tabular-nums; color: #695d63; font-weight: 700; }
.meter { display: block; width: 72px; height: 5px; overflow: hidden; border-radius: 99px; background: #ece4e7; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #d9a098, var(--accent)); }
.post-foot span:last-child { margin-left: auto; }
.pagination { display: flex; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); }
.pagination button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #685c62; font-size: 12px; }
.pagination button:disabled { opacity: .35; cursor: default; }
.detail-pane { min-width: 0; background: #fefcfd; }
.detail-sheet { position: fixed; top: 0; right: var(--assistant-expanded-w); z-index: 20; width: min(560px, calc(100vw - var(--sidebar-expanded) - var(--assistant-expanded-w) - 24px)); height: 100vh; overflow: auto; background: #fefcfd; box-shadow: var(--shadow-3); transform: translateX(24px); opacity: 0; transition: transform var(--dur-3) var(--easing), opacity var(--dur-3) var(--easing); }
.shell.chat-closed ~ .detail-sheet { right: var(--assistant-collapsed-w); width: min(560px, calc(100vw - var(--sidebar-expanded) - var(--assistant-collapsed-w) - 24px)); }
.detail-sheet.is-open { transform: none; opacity: 1; }
.detail-sheet, .score-strip, .chart-canvas { scrollbar-width: thin; scrollbar-color: #d9ccd1 transparent; }
.chat-dock { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: #ffffff; }
.chat-fab { display: none; position: fixed; right: 18px; bottom: 18px; z-index: 41; align-items: center; justify-content: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--accent); color: white; cursor: pointer; box-shadow: var(--shadow-2); transition: transform var(--dur-1) var(--easing), box-shadow var(--dur-1) var(--easing); }
.chat-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-fab:hover { transform: translateY(-2px); }
.shell.chat-closed { grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr) var(--assistant-collapsed-w); }
.shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) var(--assistant-expanded-w); }
.shell.sidebar-collapsed.chat-closed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) var(--assistant-collapsed-w); }
.shell.sidebar-collapsed .sidebar { padding-inline: 12px; }
.shell.sidebar-collapsed .brand { justify-content: center; }
.shell.sidebar-collapsed .brand-main { display: none; }
.shell.sidebar-collapsed .sidebar-toggle svg path:last-child { transform: rotate(180deg); transform-origin: center; }
.shell.sidebar-collapsed .sidebar-primary-action, .shell.sidebar-collapsed .nav-button { width: 48px; margin-inline: auto; justify-content: center; padding-inline: 0; }
.shell.sidebar-collapsed .sidebar-primary-action { margin-bottom: 19px; }
.shell.sidebar-collapsed .nav-label, .shell.sidebar-collapsed .section-label, .shell.sidebar-collapsed .account-summary-button { display: none; }
.shell.sidebar-collapsed .nav-button em { position: absolute; top: 5px; right: 4px; min-width: 8px; width: 8px; height: 8px; padding: 0; overflow: hidden; color: transparent; background: var(--accent); }
.shell.sidebar-collapsed .account-row { width: 48px; justify-content: center; margin-inline: auto; padding: 5px; }
.shell.sidebar-collapsed .sidebar-account-menu { left: calc(100% + 12px); right: auto; bottom: 0; width: 190px; }
.shell.sidebar-collapsed [data-tooltip] { position: relative; }
.shell.sidebar-collapsed [data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%; z-index: 80; width: max-content; max-width: 190px; padding: 6px 9px; border: 1px solid #4b3a43; border-radius: 7px; background: #251a1f; color: #fff; font-size: 11px; font-weight: 650; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-4px,-50%); transition: opacity var(--dur-1) var(--easing), transform var(--dur-1) var(--easing); box-shadow: var(--shadow-2); }
.shell.sidebar-collapsed [data-tooltip]:hover::after, .shell.sidebar-collapsed [data-tooltip]:focus-visible::after { opacity: 1; transform: translate(0,-50%); }
.shell.chat-closed .chat-dock { display: none; }
.shell.chat-closed ~ .chat-fab { display: inline-flex; }

/* ---------- Research conversation timeline & history (conversation plan §4–§5) ---------- */
.chat-char-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-char-count.is-over { color: var(--red); font-weight: 800; }
.detail-sheet.hidden { display: none; }
.sheet-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet-bar button, .sheet-button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 12px; color: #5c5058; text-decoration: none; }
.anchor-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.anchor-card { padding: 12px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; background: white; }
.anchor-card.role-fire { border-left-color: var(--accent); }
.anchor-card.role-open { border-left-color: #3ea572; }
.anchor-card.role-op { border-left-color: #4b7fd6; }
.anchor-card.role-saturated { border-left-color: #c4a056; }
.anchor-head { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.anchor-head span { margin-left: auto; }
.anchor-reason { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.source-drawer-toggle { width: 100%; margin-top: 16px; padding: 8px; border: 1px dashed #d0c5ca; border-radius: 8px; background: #fdfafb; color: #5c5058; font-size: 12px; }
.empty { min-height: 610px; display: grid; place-content: center; justify-items: center; padding: 35px; text-align: center; color: var(--muted); }
.empty.compact { min-height: 160px; }
.empty > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #f1eaed; color: #647269; font-size: 20px; }
.empty h2 { margin: 11px 0 0; color: var(--ink); font-size: 15px; }
.empty p { max-width: 330px; margin-top: 6px; font-size: 12px; }
#dataset-view.restricted .dataset-header,
#dataset-view.restricted .metric-grid,
#dataset-view.restricted .toolbar,
#dataset-view.restricted #scan-filters,
#dataset-view.restricted #positioning-filters,
#dataset-view.restricted .list-meta,
#dataset-view.restricted .pagination {
  display: none !important;
}
#dataset-view.restricted .workspace {
  min-height: 610px;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background: #fefcfd;
  box-sizing: border-box;
}
#dataset-view.restricted .post-pane {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#dataset-view.restricted .post-list {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.restricted-cta {
  width: min(560px, 90%);
  padding: 32px 28px;
  border: 1px solid #e8cdb8;
  border-radius: 20px;
  background: linear-gradient(180deg, #fefaf6 0%, #fdf5ef 100%);
  box-shadow: 0 12px 32px rgba(200, 146, 106, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  transform-origin: center 56%;
}
.restricted-cta.is-entering {
  animation: restricted-cta-in var(--dur-3) var(--easing) both;
}
.pro-badge {
  background: linear-gradient(135deg, #fef5f0, #fdf0ea);
  border: 1px solid #e8cdb8;
  color: #9a7850;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  position: relative;
  box-shadow: 0 0 0 1px rgba(201, 168, 124, .1);
}
.pro-badge::after { content: "✧"; margin-left: 5px; font-size: 10px; display: inline-block; animation: twinkle 3.2s ease-in-out infinite; color: var(--champagne); }
.cta-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #2c2024;
}
.cta-sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #6e6268;
}
.features-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fdfafb;
  border: 1px solid #ede6e8;
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 18px;
  color: #3e2f36;
  box-sizing: border-box;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  justify-content: center;
  align-items: center;
}
.cta-primary {
  background: linear-gradient(180deg, #d9a87a, #c8926a);
  color: #2c2024;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  border-radius: 12px;
  padding: 14px 24px;
  flex: 1;
  max-width: 260px;
  min-width: 180px;
  border: 0;
  box-shadow: 0 4px 12px rgba(200, 146, 106, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-1) var(--easing), box-shadow var(--dur-1) var(--easing), background var(--dur-1) var(--easing);
}
.cta-primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 45%, rgba(255,255,255,.1) 55%, transparent 60%); transform: translateX(-100%); pointer-events: none; z-index: 1; }
.cta-primary:hover {
  background: linear-gradient(180deg, #c8926a, #b8825c);
  box-shadow: 0 6px 16px rgba(200, 146, 106, 0.4);
}
.cta-primary:hover::before { transform: translateX(100%); transition: transform .7s var(--easing); }
.cta-secondary {
  background: #fff;
  border: 1px solid #e8e0e4;
  color: #3e2f36;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--dur-1) var(--easing), border-color var(--dur-1) var(--easing);
}
.cta-secondary:hover {
  background: #f9f6f8;
  border-color: #d5cad0;
}
.cta-primary:disabled, .cta-secondary:disabled {
  opacity: .6;
  cursor: default;
}
.restricted-cta p.micro {
  margin: 0;
  font-size: 11px;
  color: #9e929a;
}
.cta-refresh-link {
  border: 0;
  background: transparent;
  color: var(--accent, #d4878e);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
}
.post-detail { height: auto; }
.detail-head { position: sticky; top: 0; z-index: 2; padding: 16px 22px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(12px); }
.detail-head h2 { margin: 9px 0; font-size: 19px; line-height: 1.35; letter-spacing: -.025em; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.detail-actions a, .detail-actions button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #5c5058; font-size: 12px; text-decoration: none; }
.detail-body { padding: 19px 22px 30px; }
.body-copy { margin: 0; white-space: pre-wrap; color: #544851; font-size: 15px; line-height: 1.7; }
.missing { padding: 11px 12px; border-radius: 8px; background: #f5f0f3; color: #8e8288; font-size: 12px; }
.provenance-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 16px 0; }
.provenance-grid div { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.provenance-grid span, .provenance-grid strong { display: block; }
.provenance-grid span { color: #978b91; font-size: 11px; text-transform: uppercase; }
.provenance-grid strong { margin-top: 2px; font-size: 12px; font-weight: 650; }
.profile-card { margin: 16px 0; padding: 13px; border: 1px solid #e5dce0; border-radius: 9px; background: #fdfafb; }
.profile-card h3 { margin: 0 0 7px; font-size: 11px; }
.profile-card p { margin: 4px 0; color: #716569; font-size: 12px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-stats span { padding: 4px 7px; border-radius: 5px; background: white; color: #6e6268; font-size: 11px; }
.comments-heading { display: flex; justify-content: space-between; margin: 21px 0 9px; font-size: 11px; }
.comments-heading span { color: var(--muted); font-size: 11px; }
.comment { margin: 7px 0 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; transition: background var(--dur-1) var(--easing); }
.comment:hover { background: #fdfafb; }
.comment.hot-root { border-left: 3px solid var(--accent); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.comment-head strong { color: #4a3e45; }
.comment-head span:last-child { margin-left: auto; }
.comment p { margin: 6px 0 0; white-space: pre-wrap; color: #5e5258; font-size: 14px; line-height: 1.55; }
.comment-children { margin-left: 17px; padding-left: 8px; border-left: 2px solid #edf0ee; overflow: hidden; transition: opacity var(--dur-2) var(--easing); }
.comment.is-collapsed > .comment-children { display: none; }
.text-toggle, .branch-toggle { margin-top: 6px; padding: 0; border: 0; background: none; color: #187451; font-size: 12px; font-weight: 700; }
.branch-toggle::before { content: "▾ "; }
.comment.is-collapsed > .branch-toggle::before { content: "▸ "; }
#source-drawer { transition: opacity var(--dur-2) var(--easing), transform var(--dur-2) var(--easing); }
#source-drawer:not(.hidden) { opacity: 1; transform: none; }
#source-drawer.hidden { display: block !important; height: 0; overflow: hidden; opacity: 0; transform: translateY(6px); pointer-events: none; }
.comment-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.comment-toolbar label { color: var(--muted); font-size: 11px; }
.comment-toolbar select, .comment-toolbar button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #5c5058; font-size: 11px; }
.score-strip { display: flex; align-items: flex-end; gap: 3px; min-height: 40px; margin: 0 0 12px; padding: 8px 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fdfafb; overflow-x: auto; }
.strip-bar { flex: 0 0 8px; width: 8px; padding: 0; border: 0; border-radius: 3px 3px 0 0; background: #d9a098; }
.strip-bar:hover, .strip-bar:focus { background: var(--accent); }
.runs-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 5px 0 19px; }
.runs-heading select { max-width: 390px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #635760; font-size: 12px; }
.runs-heading h2 { margin: 0; font-size: 25px; }
.runs-heading > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.run-list { display: grid; gap: 12px; }
.activity-section { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); box-shadow: var(--shadow-1); }
.activity-section + .activity-section { margin-top: 20px; }
.activity-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.activity-section-head h3 { margin: 0; font-size: 16px; }
.activity-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.harvest-list-state { min-height: 0; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.harvest-list-state:empty { display: none; }
.harvest-job-list { display: grid; gap: 12px; }
.harvest-job-card { position: relative; padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 22px rgba(44,32,38,.04); }
.harvest-job-card.is-unread { border-color: #e1aeb5; box-shadow: 0 0 0 3px #fff5f6; }
.harvest-job-card.is-failed { border-left: 3px solid var(--red); }
.harvest-job-card.is-ready { border-left: 3px solid var(--green); }
.harvest-job-head { display: flex; justify-content: space-between; gap: 14px; }
.harvest-job-head h4 { margin: 3px 0 0; font-size: 16px; }
.harvest-job-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.harvest-job-status { color: #a4505f; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.is-ready .harvest-job-status { color: var(--green); }
.is-failed .harvest-job-status { color: var(--red); }
.harvest-unread { align-self: flex-start; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: #a4505f; font-size: 10px; font-weight: 800; }
.harvest-stepper { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; margin: 18px 0 13px; padding: 0; list-style: none; }
.harvest-stepper li { position: relative; display: grid; gap: 6px; justify-items: start; color: #a1959a; }
.harvest-stepper li::before { content: ""; position: absolute; top: 5px; left: 8px; right: -8px; height: 2px; background: #eadfe2; }
.harvest-stepper li:last-child::before { display: none; }
.harvest-stepper li > span { position: relative; z-index: 1; width: 12px; height: 12px; border: 2px solid #d9ccd1; border-radius: 50%; background: white; }
.harvest-stepper li.done { color: var(--green); }
.harvest-stepper li.done::before { background: #9fd4bb; }
.harvest-stepper li.done > span { border-color: var(--green); background: var(--green); }
.harvest-stepper li.active { color: var(--ink); font-weight: 700; }
.harvest-stepper li.active > span { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212,135,142,.16); animation: harvest-pulse 1.8s ease-in-out infinite; }
.harvest-stepper small { max-width: 130px; font-size: 10.5px; }
.harvest-job-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 11px; }
.harvest-job-failure { margin: 10px 0 0; padding: 9px 11px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 12px; }
.harvest-job-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.harvest-technical { margin-left: auto; }
.harvest-technical summary { color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.harvest-technical dl { min-width: 260px; display: grid; gap: 5px; margin: 8px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.harvest-technical dl div { display: flex; justify-content: space-between; gap: 12px; }
.harvest-technical dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.harvest-technical dd { margin: 0; font-size: 10px; }
.harvest-load-more { justify-self: center; }
.harvest-primary { min-height: 40px; padding: 9px 15px; border: 0; border-radius: 9px; background: linear-gradient(135deg,#d4878e,#c06d76); color: white; font-size: 12.5px; font-weight: 750; box-shadow: 0 5px 14px rgba(192,109,118,.22); }
.harvest-primary.compact { min-height: 34px; padding: 7px 12px; }
.harvest-primary:disabled { opacity: .5; cursor: default; box-shadow: none; }
.harvest-link-button { padding: 8px 3px; border: 0; background: transparent; color: #a4505f; font-size: 12px; font-weight: 750; }
.harvest-link-button:disabled { opacity: .45; cursor: default; }
#run-count.has-active { color: transparent; min-width: 8px; width: 8px; height: 8px; padding: 0; background: var(--accent); box-shadow: 0 0 0 4px rgba(212,135,142,.13); }

body.harvest-sheet-open { overflow: hidden; }
.harvest-sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 24px; }
.harvest-sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(38,25,31,.46); backdrop-filter: blur(2px); }
.harvest-sheet-card { position: relative; z-index: 1; width: min(720px,calc(100vw - 48px)); min-height: min(520px,calc(100dvh - 48px)); max-height: 80dvh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 20px; background: #fffdfd; box-shadow: 0 26px 70px rgba(40,22,30,.26); animation: harvest-builder-in var(--dur-2) var(--easing); }
.harvest-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.harvest-sheet-head h2 { margin: 1px 0 0; font-size: 22px; }
.harvest-sheet-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: 22px; line-height: 1; }
.harvest-sheet-close:hover, .harvest-sheet-close:focus-visible { border-color: #c98a93; color: var(--ink); }
.harvest-sheet-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.harvest-sheet-lead { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.harvest-community-field { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 750; }
.harvest-community-field input { width: 100%; padding: 12px 13px; border: 1px solid #d9ccd1; border-radius: 10px; background: white; color: var(--ink); font-size: 14px; }
.harvest-community-field input:focus { outline: 3px solid rgba(212,135,142,.16); border-color: var(--accent); }
.harvest-field-hint, .harvest-field-error { margin: 6px 0 0; font-size: 11.5px; }
.harvest-field-hint { color: var(--muted); }
.harvest-field-error { color: var(--red); }
.harvest-existing { display: flex; gap: 11px; margin-top: 18px; padding: 13px; border: 1px solid #c7e4d5; border-radius: 10px; background: var(--green-bg); }
.harvest-existing-mark { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--green); color: white; font-weight: 800; }
.harvest-existing strong { font-size: 12.5px; }
.harvest-existing p { margin: 2px 0 0; color: #4f6e60; font-size: 11px; }
.harvest-capability-note, .harvest-sheet-note { margin: 18px 0 0; padding: 11px 12px; border-radius: 9px; background: var(--amber-bg); color: #7e6443; font-size: 12px; line-height: 1.55; }
.harvest-sheet-note { background: var(--accent-soft); color: #75545b; }
.harvest-sheet-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); background: white; }
.harvest-confirm-community { display: grid; gap: 3px; padding: 15px; border-radius: 11px; background: var(--accent-soft); }
.harvest-confirm-community span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.harvest-confirm-community strong { font-size: 18px; }
.harvest-facts { display: grid; gap: 0; margin: 18px 0 0; }
.harvest-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.harvest-facts dt { color: var(--muted); font-size: 12px; }
.harvest-facts dd { margin: 0; text-align: right; font-size: 12px; font-weight: 750; }

.harvest-builder-head { position: relative; flex: 0 0 auto; padding-right: 28px; }
.harvest-builder-head > div { max-width: 570px; }
.harvest-builder-progress { margin: 2px 0 5px; color: #a4505f; font-size: 11px; font-weight: 800; }
.harvest-builder-body { padding: 24px 28px 30px; }
.harvest-builder-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.harvest-choice { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid #ded2d6; border-radius: 12px; background: white; color: var(--ink); text-align: left; font-size: 13px; font-weight: 720; line-height: 1.35; transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1); }
.harvest-choice:hover { border-color: #d5a1a8; background: #fff9fa; }
.harvest-choice:focus-visible, .harvest-candidate:focus-visible, .harvest-existing-choice:focus-visible { outline: 3px solid rgba(212,135,142,.2); outline-offset: 2px; border-color: var(--accent); }
.harvest-choice.is-selected { border-color: #c46f79; background: #fff4f5; box-shadow: 0 0 0 2px rgba(196,111,121,.12); }
.harvest-choice-check { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border: 1px solid #d9ccd1; border-radius: 50%; color: white; font-size: 12px; }
.harvest-choice.is-selected .harvest-choice-check { border-color: #c46f79; background: #c46f79; }
.harvest-composer { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.harvest-composer summary { width: fit-content; color: #8b5962; font-size: 12px; font-weight: 760; cursor: pointer; }
.harvest-composer textarea { width: 100%; min-height: 76px; margin-top: 11px; padding: 11px 12px; resize: vertical; border: 1px solid #d9ccd1; border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.45; }
.harvest-composer textarea:focus { outline: 3px solid rgba(212,135,142,.16); border-color: var(--accent); }
.harvest-composer small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.harvest-builder-error, .harvest-empty-suggestions { margin-top: 18px; padding: 14px; border: 1px solid #efcaca; border-radius: 11px; background: #fff5f5; color: #7d464e; }
.harvest-builder-error strong, .harvest-empty-suggestions strong { font-size: 13px; }
.harvest-builder-error p, .harvest-empty-suggestions p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.harvest-existing-fallback { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.harvest-existing-fallback h3 { margin: 0; font-size: 14px; }
.harvest-existing-fallback > p { margin: 5px 0 11px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.harvest-existing-list { display: grid; gap: 8px; }
.harvest-existing-choice { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-align: left; }
.harvest-existing-choice:hover { border-color: #d5a1a8; background: #fff9fa; }
.harvest-existing-choice small { color: var(--muted); font-size: 11px; }
.harvest-builder-error > div { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 7px; }
.harvest-resolving { display: grid; align-content: center; justify-items: center; min-height: 300px; text-align: center; }
.harvest-resolving p { max-width: 390px; margin: 14px 0 22px; color: var(--muted); line-height: 1.55; }
.harvest-resolving-orbit { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #eccbd0; border-radius: 50%; animation: harvest-orbit 1.6s ease-in-out infinite; }
.harvest-resolving-orbit span { width: 17px; height: 17px; border-radius: 50%; background: linear-gradient(135deg,#d4878e,#8c52ff); }
.harvest-skeleton { width: min(420px,100%); display: grid; gap: 8px; }
.harvest-skeleton span { height: 12px; border-radius: 99px; background: #f1e9eb; }
.harvest-skeleton span:nth-child(2) { width: 84%; }
.harvest-skeleton span:nth-child(3) { width: 62%; }
.harvest-intent-summary { margin-bottom: 18px; padding: 14px 15px; border-radius: 12px; background: #f8f3f5; }
.harvest-intent-summary span { color: #9a6871; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.harvest-intent-summary p { margin: 5px 0 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.harvest-candidates { display: grid; gap: 10px; }
.harvest-candidate { width: 100%; display: grid; gap: 8px; padding: 15px; border: 1px solid #ded2d6; border-radius: 12px; background: white; color: var(--ink); text-align: left; }
.harvest-candidate:hover { border-color: #d5a1a8; background: #fffafb; }
.harvest-candidate.is-selected { border-color: #c46f79; box-shadow: 0 0 0 2px rgba(196,111,121,.12); }
.harvest-candidate-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.harvest-candidate-top strong { font-size: 15px; }
.harvest-candidate-kind { flex: 0 0 auto; padding: 4px 8px; border-radius: 99px; background: #f1ecee; color: #75676d; font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.harvest-candidate-kind.is-existing { background: var(--green-bg); color: #397057; }
.harvest-candidate-reason { color: var(--muted); font-size: 12px; line-height: 1.5; }
.harvest-candidate small { color: #6b7b72; font-size: 10px; }
.harvest-sheet-actions { flex: 0 0 auto; }

@keyframes harvest-pulse { 50% { box-shadow: 0 0 0 7px rgba(212,135,142,.08); } }
@keyframes harvest-builder-in { from { transform: translateY(12px) scale(.985); opacity: .75; } }
@keyframes harvest-orbit { 50% { transform: scale(1.08); box-shadow: 0 0 0 9px rgba(212,135,142,.08); } }
.run-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 8px 22px rgba(44,32,38,.04); }
.run-card.selected { border-color: #d9a098; box-shadow: 0 0 0 3px #fff5f6; }
.run-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.run-card h3 { margin: 0; font-size: 13px; }
.run-card .run-id { margin-top: 3px; color: #77847d; font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.run-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 13px; }
.run-grid div { padding: 8px 9px; border-radius: 7px; background: #faf8f9; }
.run-grid span, .run-grid strong { display: block; }
.run-grid span { color: #988c92; font-size: 11px; text-transform: uppercase; }
.run-grid strong { margin-top: 2px; font-size: 12px; }
.reason-list { margin: 10px 0 0; padding-left: 17px; color: var(--red); font-size: 11px; }
.settings-heading { max-width: 640px; padding: 6px 0 18px; }
.settings-heading h2 { margin: 0; font-size: 25px; }
.settings-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.settings-card { max-width: 560px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.settings-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; }
.settings-row span { color: var(--muted); }
.settings-field { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.settings-field legend { padding: 0; }
.settings-field label { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; font-weight: 500; color: var(--ink); }
.provider-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 0; border: 0; }
.provider-pills legend { margin-bottom: 6px; }
.provider-pills label { margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.provider-pills input { accent-color: var(--accent); }
.provider-pills label:has(input:checked) { background: #2a1e23; border-color: #2a1e23; color: white; }
.settings-row strong[data-bound="1"]::before, .settings-row strong[data-bound="0"]::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #b5acb0; }
.settings-row strong[data-bound="1"]::before { background: #28a46f; }
#settings-key { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.settings-actions { display: flex; gap: 8px; margin-top: 14px; }
#settings-save { padding: 8px 14px; border: 0; border-radius: 8px; background: #2a1e23; color: white; font-weight: 700; }
#settings-clear { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.settings-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 40;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: min(340px, calc(100vw - 28px));
  padding: 13px 12px 13px 13px;
  border: 1px solid #e5dce0;
  border-left-width: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.toast-mark::before { content: "✓"; }
.toast-copy { min-width: 0; padding-top: 2px; }
.toast-title { display: block; font-size: 13px; font-weight: 750; letter-spacing: -.02em; }
.toast-body { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.toast-close {
  margin: -2px -2px 0 0;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #988c92;
  font-size: 11px;
}
.toast-close:hover { background: #f2eaee; color: var(--ink); }
.toast.is-ok { border-color: #cfe4d6; border-left-color: #3ea572; }
.toast.is-warn { border-color: #ecd8c4; border-left-color: #c8a060; }
.toast.is-error { border-color: #f0cfc9; border-left-color: #c65a4e; }
.toast.is-warn .toast-mark { background: var(--amber-bg); color: var(--amber); }
.toast.is-warn .toast-mark::before { content: "!"; }
.toast.is-error .toast-mark { background: var(--red-bg); color: var(--red); }
.toast.is-error .toast-mark::before { content: "×"; }
.skeleton { border-radius: 7px; background: linear-gradient(90deg,#f1eaed,#fdfafb,#f1eaed); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sidebar .skeleton { background: linear-gradient(90deg,#382c32,#463940,#382c32); background-size: 200% 100%; }
.skeleton.small { height: 38px; margin: 5px 0; }
.skeleton.title { width: 220px; height: 30px; }
.skeleton.line { width: 310px; height: 12px; }
.skeleton.card { height: 105px; margin-bottom: 1px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes card-in { to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 2px 8px rgba(212, 135, 142, .18); } 50% { box-shadow: 0 2px 12px rgba(212, 135, 142, .28); } }
@keyframes typing-dot { 0%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes restricted-cta-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.usage-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 5px 0 19px; }
.usage-heading h2 { margin: 0; font-size: 25px; }
.usage-period { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.usage-heading-side { display: grid; gap: 6px; justify-items: end; text-align: right; }
.byok-badge { padding: 4px 9px; border: 1px solid #e0c8a8; border-radius: 99px; background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 750; white-space: nowrap; }
.byok-note { max-width: 340px; margin: 0; color: #978b91; font-size: 11px; line-height: 1.5; }
.usage-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; align-items: start; }
.usage-column { display: grid; gap: 12px; min-width: 0; }
.usage-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 8px 22px rgba(44,32,38,.04); }
.usage-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.usage-card-head h3 { margin: 0; font-size: 13px; }
.usage-card-meta { color: #978b91; font-size: 11px; }
.balance-figure { display: block; font-family: var(--font-display); font-size: 34px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.balance-sub { display: flex; align-items: center; gap: 7px; margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.balance-sub b { color: #695d63; font-variant-numeric: tabular-nums; }
.balance-breakdown { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.balance-breakdown li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fdfafb; color: #6e6268; font-size: 12px; }
.balance-breakdown b { font-variant-numeric: tabular-nums; color: var(--ink); }
.balance-expiration { margin: 10px 0 0; padding: 8px 9px; border-radius: 7px; background: var(--amber-bg); color: var(--amber); font-size: 11px; }
.plan-toggle { margin: 0 0 12px; }
.plan-facts { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.plan-facts li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fdfafb; color: #6e6268; font-size: 12px; }
.plan-facts b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-card .cta-primary { width: 100%; max-width: none; }
.chart-canvas { display: flex; align-items: flex-end; gap: 3px; min-height: 96px; padding: 10px 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fdfafb; overflow-x: auto; }
.chart-bar { flex: 1 0 8px; max-width: 18px; height: 84px; display: flex; align-items: flex-end; }
.chart-bar i { display: block; width: 100%; height: var(--h, 2%); border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #d9a098, var(--accent)); transition: height var(--dur-2) var(--easing); }
.chart-bar:hover i { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.chart-bar.is-zero i { background: #ece4e7; }
.entry-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; }
.entry-item { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; transition: background var(--dur-1) var(--easing); }
.entry-item:hover { background: #fdfafb; }
.entry-item.is-in_progress { border-left: 3px solid #c8a060; }
.entry-item.is-failed { border-left: 3px solid #c65a4e; }
.entry-item.is-refunded { border-left: 3px solid #3ea572; }
.entry-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entry-when { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.entry-credits { margin-left: auto; color: #5c5058; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-meta { margin: 5px 0 0; color: #978b91; font-size: 11px; }
.entry-failure { color: var(--red); }
.entry-platform { color: var(--muted); }
.entry-more { display: flex; justify-content: center; padding-top: 10px; }
.load-more { padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #685c62; font-size: 12px; }
.load-more:disabled { opacity: .4; cursor: default; }
.usage-empty .empty { min-height: 320px; }
.credits-sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(40, 28, 34, .45); }
.credits-sheet-card { width: min(420px, 100%); padding: 26px; border: 1px solid #e8cdb8; border-radius: 20px; background: linear-gradient(180deg, #fefaf6 0%, #fdf5ef 100%); box-shadow: var(--shadow-3); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.credits-sheet-card h3 { margin: 0; font-size: 17px; color: #2c2024; }
.credits-sheet-facts { margin: 0; color: #6e6268; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.credits-sheet-card .micro { margin: 0; font-size: 11px; color: #9e929a; }
.topup-cta { width: 100%; max-width: none; margin-top: 10px; }
.topup-offers { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.topup-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #e8cdb8; border-radius: 12px; background: white; cursor: pointer; transition: border-color .2s var(--easing), background .2s var(--easing); }
.topup-option:hover { border-color: var(--accent); }
.topup-option.is-selected { border-color: var(--accent); background: #fdf1ee; }
.topup-option input { accent-color: var(--accent); }
.topup-option .topup-credits { flex: 1; text-align: left; color: #2c2024; font-size: 13px; font-weight: 700; }
.topup-option b { color: #5c5058; font-size: 13px; font-variant-numeric: tabular-nums; }
.manage-billing-cta { width: 100%; max-width: none; margin-top: 8px; }
.billing-notice { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid #e8cdb8; border-left: 4px solid var(--accent); border-radius: 12px; background: #fdf1ee; }
.billing-notice-text { flex: 1; margin: 0; color: #5c5058; font-size: 13px; line-height: 1.55; }
.billing-notice .cta-mini { flex-shrink: 0; }
.legal-links { margin: 2px 0 0; font-size: 11px; color: #978b91; }
.legal-links a { color: #685c62; text-decoration: underline; text-underline-offset: 2px; }
.legal-links a:hover { color: var(--accent); }
.visual-dashboard { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin: 4px 0 16px; }
.hero-metric-card { display: flex; align-items: center; gap: 28px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #ffffff, #fffcfc); box-shadow: var(--shadow-2); }
.circular-progress { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.circular-progress svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.circular-progress circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.circular-progress .bg { stroke: #f2e9eb; }
.circular-progress .value { stroke: url(#quota-gradient); transition: stroke-dashoffset 1.2s var(--easing); }
.circular-progress .text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.circular-progress .text strong { font-size: 30px; font-weight: 800; line-height: 1; }
.circular-progress .text .pct-sign { font-size: 15px; margin-left: 2px; }
.circular-progress .text small { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.hero-metric-card.is-flat .circular-progress { display: none; }
.hero-stats { min-width: 0; }
.hero-stats h3 { margin: 0 0 6px; font-size: 16px; color: #5c4b51; }
.hero-stats p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.hero-stats .balance-figure { font-size: 30px; }
.stats-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--canvas); font-size: 13px; font-weight: 600; }
.stats-pill .mono { color: var(--accent); font-weight: 700; }
.stats-pill .sep { color: var(--line); }
.stats-pill .dim { color: var(--muted); }
.stats-pill .mono.dim { color: var(--muted); }
.side-metrics { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.metric-visual { display: flex; flex-direction: column; justify-content: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-1); }
.metric-info { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.metric-info h4 { margin: 0; font-size: 14px; color: #5c4b51; font-weight: 700; }
.metric-info strong { font-size: 20px; font-weight: 800; }
.thick-bar { height: 14px; border-radius: 99px; background: #f2e9eb; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .03); overflow: hidden; margin-bottom: 10px; display: flex; }
.thick-bar.is-empty { background: repeating-linear-gradient(45deg, #f2e9eb, #f2e9eb 6px, #f7f0f2 6px, #f7f0f2 12px); }
.thick-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--shimmer-rose), var(--accent)); transition: width 1.2s var(--easing); position: relative; }
.thick-bar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .4) 50%, rgba(255, 255, 255, 0) 100%); animation: bar-shimmer 2.4s infinite; }
@keyframes bar-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.thick-bar.stacked i { display: block; height: 100%; }
.thick-bar .seg-subscription { background: linear-gradient(90deg, var(--shimmer-rose), var(--accent)); }
.thick-bar .seg-promotional { background: linear-gradient(90deg, var(--shimmer-lav), #b79ac0); }
.thick-bar .seg-purchased { background: linear-gradient(90deg, var(--shimmer-gold), #c9a86a); }
.metric-sub { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--muted); font-size: 12px; }
.metric-sub b { color: #695d63; font-weight: 700; }
.metric-grid.compact { margin: 0 0 16px; }
.metric-grid.compact .metric { min-height: 62px; padding: 10px 14px; }
.metric-grid.compact .metric strong { font-size: 18px; }
.metric-grid.compact .metric::before { width: 24px; margin-bottom: 5px; }
.cta-row { display: flex; gap: 12px; margin: 4px 0 10px; }
.cta-row .cta-primary, .cta-row .cta-secondary { flex: 1; margin: 0; padding: 12px 18px; border-radius: 12px; font-size: 13px; }
.cta-row .cta-primary { background: linear-gradient(135deg, var(--accent), #c26a72); color: white; border: 0; box-shadow: 0 6px 16px rgba(212, 135, 142, .3); }
.cta-row .cta-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(212, 135, 142, .4); }
.cta-row .cta-primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.cta-row .cta-secondary { background: white; border: 1px solid #e8e0e4; color: #5c4b51; }
.cta-row .cta-secondary:hover { background: #f9f6f8; border-color: #d5cad0; }
.entry-item { display: flex; align-items: flex-start; gap: 12px; }
.entry-item:hover { transform: translateX(2px); }
.entry-content { flex: 1; min-width: 0; }
.entry-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #f1eaed; color: #695d63; }
.entry-icon svg { width: 16px; height: 16px; }
.entry-item.is-settled .entry-icon, .entry-item.is-refunded .entry-icon { background: var(--green-bg); color: var(--green); }
.entry-item.is-failed .entry-icon { background: var(--red-bg); color: var(--red); }
.entry-item.is-in_progress .entry-icon { background: var(--amber-bg); color: var(--amber); }
.auth-panel .legal-links { margin-top: 14px; }
.usage-card .legal-links { margin-top: 8px; }
@media (max-width: 1050px) {
  .usage-grid { grid-template-columns: 1fr; }
  .visual-dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .usage-heading { align-items: flex-start; flex-direction: column; }
  .entry-list { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-bar i { transition: none; }
  .circular-progress .value, .thick-bar-fill { transition: none; }
  .thick-bar-fill::after { animation: none; }
}
@media (max-width: 1200px) {
  .overview-grid { grid-template-columns: 1fr; }
  .overview-rail { position: static; max-height: none; overflow: visible; }
  .shell { grid-template-columns: var(--sidebar-expanded) minmax(0,1fr) 320px; }
  .shell.chat-closed { grid-template-columns: var(--sidebar-expanded) minmax(0,1fr); }
  .shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0,1fr) 320px; }
  .shell.sidebar-collapsed.chat-closed { grid-template-columns: var(--sidebar-collapsed) minmax(0,1fr); }
  .detail-sheet { right: 320px; width: min(480px, calc(100vw - 540px)); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .card-stream, .anchor-board { grid-template-columns: 1fr; }
}
@media (max-width: 1050px) {
  .shell { grid-template-columns: minmax(0,1fr) 300px; }
  .shell.chat-closed { grid-template-columns: minmax(0,1fr); }
  .shell.sidebar-collapsed, .shell.sidebar-collapsed.chat-closed { grid-template-columns: minmax(0,1fr) 300px; }
  .shell.sidebar-collapsed.chat-closed { grid-template-columns: minmax(0,1fr); }
  .sidebar, .shell.sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, calc(100vw - 52px)); height: 100dvh; padding: 20px 16px 16px; overflow-y: auto; transform: translateX(-102%); transition: transform var(--dur-2) var(--easing); box-shadow: 18px 0 44px rgba(20,10,15,.28); }
  .shell.sidebar-mobile-open .sidebar { transform: none; }
  .shell.sidebar-collapsed .brand { justify-content: space-between; }
  .shell.sidebar-collapsed .brand-main { display: flex; }
  .shell.sidebar-collapsed .sidebar-primary-action, .shell.sidebar-collapsed .nav-button { width: 100%; margin-inline: 0; justify-content: flex-start; padding-inline: 12px; }
  .shell.sidebar-collapsed .sidebar-primary-action { justify-content: center; }
  .shell.sidebar-collapsed .nav-label, .shell.sidebar-collapsed .section-label, .shell.sidebar-collapsed .account-summary-button { display: flex; }
  .shell.sidebar-collapsed .section-label { display: block; }
  .shell.sidebar-collapsed .nav-button em { position: static; width: auto; height: auto; margin-left: auto; padding: 1px 7px; overflow: visible; color: inherit; background: #4a3b42; }
  .shell.sidebar-collapsed .account-row { width: auto; justify-content: flex-start; margin-inline: 0; padding: 8px; }
  .shell.sidebar-collapsed .sidebar-account-menu { left: 0; right: 0; bottom: calc(100% + 8px); width: auto; }
  .sidebar-toggle { display: none; }
  .sidebar-mobile-toggle { display: inline-grid; border-color: var(--line); background: white; color: var(--ink); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 44; border: 0; background: rgba(32,20,26,.46); backdrop-filter: blur(2px); }
  .shell.sidebar-mobile-open .sidebar-backdrop { display: block; }
  .topbar { justify-content: flex-start; gap: 12px; }
  .topbar-status { margin-left: auto; }
  .workspace { grid-template-columns: 1fr; }
  .post-pane { border-right: 0; }
  .detail-pane { border-top: 1px solid var(--line); }
  .detail-sheet { right: 300px; width: min(420px, calc(100vw - 300px)); }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px) {
  .shell { display: flex; flex-direction: column; }
  .topbar { height: auto; padding: 10px 14px; gap: 10px; }
  /* Compact phone topbar (upgrade-plan §3.3): the marketing H1 duplicates
     each view's own heading and the pricing CTA also lives in Usage, so both
     stay hidden below 720px — the first screen leads with content. The
     overline remains as the brand mark, one line, ellipsized when narrow. */
  .topbar h1 { display: none; }
  .topbar .cta-mini { display: none; }
  .topbar > div:has(.overline) { flex: 1; min-width: 0; }
  .topbar .overline { margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page { padding: 16px 14px 20px; }
  .dataset-header { align-items: flex-start; flex-direction: column; min-height: 0; gap: 10px; }
  .dataset-title h2 { font-size: 20px; }
  .dataset-title p { margin-bottom: 2px; }
  .badges { margin-top: 4px; }
  .dataset-status { margin: 4px 0 0; }
  .toolbar { padding: 10px 14px; }
  .dataset-source { text-align: left; }
  /* Metric cards become a horizontal strip (upgrade-plan §3.3): two cards
     visible + peek, same scroll pattern as Help Center's suggested tasks.
     Saves ~96px of first screen so the Explore search lands above the fold. */
  .metric-grid { display: flex; gap: 10px; margin: 10px 0 8px; overflow-x: auto; padding-bottom: 2px; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 36px), transparent 100%); }
  .metric { flex: 0 0 62%; max-width: 62%; min-height: 0; padding: 8px 12px; scroll-snap-align: start; }
  .metric strong { font-size: 17px; margin-top: 1px; }
  .metric small { display: none; }
  .metric::before { width: 24px; margin-bottom: 4px; }
  .toolbar { flex-direction: column; }
  .workspace { min-height: 0; }
  .run-grid { grid-template-columns: repeat(2,1fr); }
  .chat-dock { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); bottom: auto; height: calc(var(--chat-viewport-height, 100dvh) - env(safe-area-inset-top, 0px)); max-height: none; z-index: 58; border-left: 0; border-top: 0; border-radius: 0; box-shadow: var(--shadow-2); }
  /* Fullscreen Assistant owns the viewport: no double fixed navigation. */
  .shell:not(.chat-closed) .bottom-nav { display: none; }
  .assistant-header { padding: 0 10px 0 12px; }
  .assistant-status-text { max-width: 130px; }
  .assistant-mode { padding: 10px 12px 12px; }
  .assistant-modes button { height: 38px; }
  .assistant-timeline { padding: 12px 14px 8px; }
  .assistant-composer { margin: 0 12px 6px; }
  .assistant-footnote { margin: 0 14px 8px; flex-wrap: wrap; }
  .chat-save-note { padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
  .conversation-list { padding: 0 8px; }
  .chat-fab { right: 14px; bottom: calc(var(--bottom-nav-safe) + 14px); }
  body { padding-bottom: var(--bottom-nav-safe); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 42; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); padding-bottom: var(--safe-bottom); }
  .bottom-nav button { min-height: 56px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
  .bottom-nav button.active { color: #c26771; }
  .toast { bottom: calc(var(--bottom-nav-safe) + 10px); }
  .nav-button, .locale-toggle button, .pagination button, .dataset-link, .auth-signout, .onboarding-entry { min-height: 44px; }
  .filter-chip { min-height: 44px; padding: 10px 14px; }
  .assistant-ib { width: 44px; height: 44px; flex-basis: 44px; }
  .assistant-ib svg { width: 18px; height: 18px; }
  .detail-sheet { right: 0; width: 100vw; }
  .runs-heading { align-items: flex-start; flex-direction: column; }
  .explore-bar { align-items: stretch; flex-direction: column; margin: 0 0 10px; }
  .community-select { justify-content: space-between; }
  .community-select select { min-width: 0; flex: 1; }
  .activity-section { padding: 14px; }
  .activity-section-head { align-items: stretch; flex-direction: column; }
  .harvest-job-actions { align-items: stretch; flex-direction: column; }
  .harvest-technical { margin-left: 0; }
  .harvest-technical dl { min-width: 0; }
  .harvest-stepper small { font-size: 9px; }
  .harvest-sheet { align-items: flex-end; padding: 0; }
  .harvest-sheet-card { width: 100%; min-height: 0; height: min(92dvh,var(--harvest-viewport-height,92dvh)); max-height: min(92dvh,var(--harvest-viewport-height,92dvh)); border: 0; border-radius: 18px 18px 0 0; animation-name: harvest-sheet-up; }
  .harvest-sheet-card::before { content: ""; width: 38px; height: 4px; flex: 0 0 4px; align-self: center; margin-top: 8px; border-radius: 99px; background: #d8ccd0; }
  .harvest-sheet-head { padding: 18px 18px 14px; }
  .harvest-sheet-body { padding: 18px 18px 24px; }
  .harvest-builder-body { padding-top: 18px; }
  .harvest-builder-options { grid-template-columns: 1fr; gap: 8px; }
  .harvest-choice { min-height: 52px; }
  .harvest-sheet-actions { padding: 12px 18px max(16px,env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .harvest-sheet-actions button { min-height: 48px; }
  .harvest-sheet-actions .harvest-primary { flex: 1 1 180px; }
  .harvest-candidate { min-height: 88px; }
  .harvest-candidate-top { align-items: flex-start; }
  /* Full-width mobile toast; `bottom` intentionally NOT set here — the rule
     above (bottom: calc(var(--bottom-nav-safe) + 10px)) is the single source.
     A stray `bottom: 10px` here previously won the cascade and buried the
     toast under the bottom nav (z-40 vs z-42), making Dismiss unclickable. */
  .toast { right: 10px; left: 10px; width: auto; }
}
@keyframes harvest-sheet-up { from { transform: translateY(24px); opacity: .75; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .opportunity-card { opacity: 1; transform: none; }
  .detail-sheet { transform: none; opacity: 1; }
  .page.is-entering { animation: none; }
  .restricted-cta.is-entering { opacity: 1; transform: none; }
  .pro-badge::after { animation: none; }
  #ask-submit::before, .cta-primary::before { display: none; }
  .chat-typing i { animation: none; opacity: .55; }
}

/* Onboarding tour: non-blocking spotlight overlay */
.onboarding-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 26px;
  background: rgba(40, 28, 34, .42);
}
.onboarding-sheet.hidden { display: none; }
.onboard-card {
  position: relative;
  z-index: 72;
  width: min(520px, 100%);
  max-height: min(76vh, 640px);
  overflow: auto;
  padding: 20px 22px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow-3);
}
.onboard-card h2 { margin: 6px 0 8px; font-size: 17px; }
.onboard-lead { margin: 0 0 8px; color: #4a3e45; line-height: 1.55; }
.onboard-note { margin: 0 0 4px; padding: 8px 11px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); color: #68525a; font-size: 12px; }
.onboard-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.onboard-skip, .onboard-back { margin-left: auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #685c62; font-size: 12px; }
.onboard-back { margin-left: 0; }
.onboard-skip:hover, .onboard-back:hover { color: var(--ink); border-color: #d9c9ce; }
.onboard-target {
  position: relative;
  z-index: 71;
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px rgba(212, 135, 142, .25);
  background: white;
}
.onboard-form { display: grid; gap: 12px; margin: 12px 0 2px; }
.onboard-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.onboard-field > span { font-size: 12px; font-weight: 750; color: #5c5058; letter-spacing: .02em; }
.onboard-field input[type="text"], .onboard-field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfafb;
  color: var(--ink);
  font-size: 13px;
}
.onboard-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.onboard-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 12px; color: #4a3e45; }
.onboard-pill input { accent-color: var(--accent); }
.onboarding-entry { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: #b9aeb4; font-size: 11px; }
.onboarding-entry:hover { color: white; border-color: #574a51; }
.ask-free-badge { padding: 3px 9px; border: 1px solid #e4c9d0; border-radius: 999px; background: var(--accent-soft); color: #a4505f; font-size: 11px; font-weight: 750; white-space: nowrap; }
@media (max-width: 1050px) {
  .onboarding-sheet { align-items: flex-end; padding: 14px; }
}

/* Help Center: migrated to Tailwind utilities (plans/migrate_to_CSS.md C3).
   Class names below survive only as JavaScript/behavior hooks or shared rules:
   - .hc-card-highlight is toggled by resolveTask() to flash a category card.
   - .hc-suggest / .hc-search / .hc-card / .hc-tour-confirm names are kept in
     the markup as query/delegation hooks; their visuals now live in tw:* classes.
   Shared .overline / .cta-* button styles are intentionally still legacy (C5). */
.hc-card-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 135, 142, .25), var(--shadow-2); }
/* Typographic properties retained in legacy per plan §9.2 (option 2): the
   unlayered globals `h1 { margin: 0; font-size: 28px }` and
   `button, input, select { font: inherit }` outrank @layer utilities, so
   font-size/weight for these Help elements stay here instead of fighting
   tw: classes from the other side. */
.help-header h1 { margin: 6px 0 8px; font-size: 30px; }
.hc-task-pill { font-size: 13px; font-weight: 600; }
.hc-article-link { font-size: 13px; }
.hc-search input { font-size: 15px; }
.hc-search input:focus { outline: none; }
/* Help mode label on the shared assistant dock; the note text is localized
   through data-help-note so no CSS content is hardcoded. */
.chat-dock.help-mode .assistant-header h2::after { content: " · " attr(data-help-note); color: #b0646d; font-size: 12px; font-weight: 600; }
@media (max-width: 720px) {
  .help-header h1 { font-size: 26px; }
  .bottom-nav button { padding: 6px 2px; font-size: 10px; }
}

/* Tablet portrait / large-phone landscape, 721–1050px (upgrade-plan §3.4):
   persistent 72px icon rail + floating assistant side sheet. This block MUST
   stay after the 1050px block above — it replaces that zone's drawer sidebar
   and 300px chat column. Selectors are grouped as `.shell X` and
   `.shell.sidebar-collapsed X` because the persisted collapsed state
   (mvp-sidebar-collapsed, applied by src/views/sidebar.js) raises the 1050px
   block's specificity for the un-collapse rules. */
@media (min-width: 721px) and (max-width: 1050px) {
  .shell, .shell.chat-closed, .shell.sidebar-collapsed, .shell.sidebar-collapsed.chat-closed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
  .shell .sidebar, .shell.sidebar-collapsed .sidebar { position: sticky; top: 0; inset: auto; width: var(--sidebar-collapsed); height: 100vh; padding: 20px 12px 16px; overflow: visible; transform: none; box-shadow: none; }
  .shell.sidebar-mobile-open .sidebar { transform: none; }
  .shell.sidebar-mobile-open .sidebar-backdrop { display: none; }
  .sidebar-mobile-toggle { display: none; }
  .shell .brand, .shell.sidebar-collapsed .brand { justify-content: center; }
  .shell .brand-main, .shell.sidebar-collapsed .brand-main { display: none; }
  .shell .sidebar-primary-action, .shell .nav-button, .shell.sidebar-collapsed .sidebar-primary-action, .shell.sidebar-collapsed .nav-button { width: 48px; margin-inline: auto; justify-content: center; padding-inline: 0; }
  .shell .nav-label, .shell .section-label, .shell.sidebar-collapsed .nav-label, .shell.sidebar-collapsed .section-label { display: none; }
  .shell .nav-button em, .shell.sidebar-collapsed .nav-button em { position: absolute; top: 5px; right: 4px; min-width: 8px; width: 8px; height: 8px; padding: 0; overflow: hidden; color: transparent; background: var(--accent); }
  .shell .account-row, .shell.sidebar-collapsed .account-row { width: 48px; flex-direction: column; justify-content: center; gap: 4px; margin-inline: auto; padding: 1px; }
  .shell .account-summary-button, .shell.sidebar-collapsed .account-summary-button { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; }
  .account-summary-button .account-menu-icon { display: block; }
  .account-summary-button .account-summary, .account-summary-button .account-chevron { display: none; }
  .shell .sidebar-account-menu, .shell.sidebar-collapsed .sidebar-account-menu { left: calc(100% + 12px); right: auto; bottom: 0; width: 190px; }
  .shell > .sidebar [data-tooltip] { position: relative; }
  .shell > .sidebar [data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%; z-index: 80; width: max-content; max-width: 190px; padding: 6px 9px; border: 1px solid #4b3a43; border-radius: 7px; background: #251a1f; color: #fff; font-size: 11px; font-weight: 650; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-4px,-50%); transition: opacity var(--dur-1) var(--easing), transform var(--dur-1) var(--easing); box-shadow: var(--shadow-2); }
  .shell > .sidebar [data-tooltip]:hover::after, .shell > .sidebar [data-tooltip]:focus-visible::after, .shell > .sidebar [data-tooltip]:focus-within::after { opacity: 1; transform: translate(0,-50%); }
  .shell > .sidebar .account-row:has(.account-summary-button[aria-expanded="true"])::after { display: none; }
  .chat-dock { position: fixed; left: auto; right: 0; top: 0; bottom: 0; height: auto; width: min(420px, calc(100vw - 72px)); z-index: 40; border-left: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow-2); }
  .detail-sheet { right: 0; width: min(560px, calc(100vw - 96px)); }
}

/* Landscape phones (721–1050px wide, <=500px tall) share the rail zone but
   lose ~21% of height to the desktop topbar; apply the same compact topbar
   as phones (upgrade-plan matrix #13). */
@media (min-width: 721px) and (max-width: 1050px) and (max-height: 500px) {
  .topbar { height: auto; padding: 10px 14px; gap: 10px; }
  .topbar h1 { display: none; }
  .topbar .cta-mini { display: none; }
  .topbar > div:has(.overline) { flex: 1; min-width: 0; }
  .topbar .overline { margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
