/* UI contract: AGENTS.md §8. Change shared tokens before component values. */
:root {
  color-scheme: dark;
  --bg: #070a12;
  --surface: rgba(12,18,33,.62);
  --surface-hover: rgba(12,18,33,.50);
  --surface-pressed: rgba(12,18,33,.42);
  --glass-blur: 24px;
  --glass-saturation: 115%;
  --dock-surface: rgba(7,12,26,.64);
  --dock-border: rgba(121,144,206,.16);
  --dock-image: linear-gradient(110deg, rgba(47,77,155,.08), rgba(56,42,111,.045) 72%, transparent);
  --dock-shadow: 0 4px 16px rgba(0,0,0,.16);
  --tab-height: calc(var(--control-height) + 2 * var(--tab-padding) + 2px);
  --dock-height: calc(var(--tab-height) + var(--space-3) + var(--space-1));
  --chart-neutral: #adb2bd;
  --chart-astra: #b19aef;
  --chart-default: #d0c0ff;
  --tab-gap: var(--space-3);
  --tab-padding: var(--space-2);
  --surface-raised: rgba(16,24,43,.94);
  --surface-subtle: rgba(11,17,31,.68);
  --track-fill: rgba(255,255,255,.1);
  --ambient-background: radial-gradient(ellipse 56vw 48vh at 50% -4%, rgba(55,105,184,.26), transparent 82%),
    radial-gradient(ellipse 42vw 34vh at 66% 12%, rgba(78,68,177,.18), transparent 84%),
    radial-gradient(ellipse 56vw 56vh at 104% 24%, rgba(64,91,207,.16), transparent 86%),
    radial-gradient(ellipse 44vw 52vh at -8% 78%, rgba(31,95,143,.10), transparent 88%),
    radial-gradient(ellipse 40vw 44vh at 100% 106%, rgba(77,47,139,.06), transparent 88%), var(--bg);
  --surface-inset: rgba(106,137,199,.055);
  --surface-inset-hover: rgba(106,137,199,.10);
  --surface-inset-pressed: rgba(106,137,199,.16);
  --glass-image: linear-gradient(155deg, rgba(109,137,218,.045), rgba(79,101,174,.012) 40%, transparent 72%);
  --stroke: #303a50;
  --divider: rgba(151,172,214,.13);
  --stroke-strong: #3a4552;
  --text: #f5f5f7;
  --muted-light: #d0d2d8;
  --muted: #a5aab4;
  --accent: #c5b5ff;
  --accent-strong: #a08aed;
  --on-accent: #191425;
  --primary-fill: #d5d1ed;
  --primary-hover: rgba(213,209,237,.90);
  --primary-pressed: rgba(213,209,237,.80);
  --primary-text: #211e30;
  --recommend-fill: rgba(197,181,255,.07);
  --green: #8cdcb3;
  --red: #ff9da9;
  --selected-border: rgba(180,161,231,.76);
  --selected-fill: rgba(34,32,48,.72);
  --selected-image: linear-gradient(155deg, rgba(197,181,255,.10), rgba(197,181,255,.03) 42%, transparent 78%);
  --selected-muted: #bdc0d0;
  --hover-fill: rgba(106,137,199,.08);
  --pressed-fill: rgba(106,137,199,.14);
  --disabled-fill: #121b2c;
  --disabled-text: #8e95a4;
  --focus-color: #dbd1ff;
  --shadow: 0 12px 32px rgba(0,0,0,.16), inset 0 1px 0 rgba(130,165,234,.045);
  --dialog-scrim: rgba(3,7,18,.68);
  --shadow-floating: 0 20px 64px rgba(0,0,0,.36);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --layout-gap: var(--space-4);
  --section-gap: var(--space-12);
  --card-padding: var(--space-6);
  --card-radius: 24px;
  --inner-radius: 16px;
  --control-radius: 12px;
  --pill-radius: 999px;
  --control-height: 44px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-title: 20px;
  --text-section: 24px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --motion: 160ms ease;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  font-size: var(--text-base);
  line-height: 1.6;
}
* { box-sizing: border-box; }
html { height: 100%; overflow: hidden; background: var(--bg); }
body { height: 100%; margin: 0; overflow: hidden; background: transparent; color: var(--text); -webkit-font-smoothing: antialiased; }
/* One bounded scroll owner. Route content may be long; the document never grows. */
.app-viewport { position: relative; height: 100%; height: 100dvh; overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; overflow-anchor: none; scroll-padding-top: 88px; }
#view-outlet { display: flow-root; contain: layout; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-weight: var(--weight-semibold); line-height: 1.35; letter-spacing: -.025em; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--muted-light); }
code { font-family: "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.hidden { display: none !important; }
/* One focus treatment, separate from persistent selection. */
:where(button, a, input, [tabindex]):focus-visible { outline: 2px solid var(--focus-color); outline-offset: 3px; }
.ambient-layer {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--ambient-background);
}
.glass { background-color: var(--surface); background-image: var(--glass-image); border: 1px solid var(--stroke); box-shadow: var(--shadow); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation)); }
.glass-subtle { background: var(--surface-subtle); border: 1px solid var(--stroke); backdrop-filter: blur(20px) saturate(100%); -webkit-backdrop-filter: blur(20px) saturate(100%); }
/* Reset state mappings on every action so a nested button cannot inherit its card's surface. */
:where(.primary-button, .secondary-button, .text-button, .icon-button, .external-link, .view-tab, .account-card.actionable-card, .source-link, .ranking-footnote a, .wordmark) {
  --action-hover-fill: var(--hover-fill); --action-pressed-fill: var(--pressed-fill);
  --action-hover-border: transparent; --action-pressed-border: transparent;
}
/* Controls share geometry; hover and press never move the layout. */
.primary-button, .secondary-button, .text-button, .icon-button, .view-tab, .external-link {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: var(--space-2) var(--space-4); border: 1px solid transparent; border-radius: var(--control-radius);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.4; text-decoration: none;
  transition: background-color var(--motion), border-color var(--motion), color var(--motion), box-shadow var(--motion);
}
.primary-button {
  --action-hover-fill: var(--primary-hover); --action-hover-border: var(--primary-hover);
  --action-pressed-fill: var(--primary-pressed); --action-pressed-border: var(--primary-pressed);
  background: var(--primary-fill); background-clip: padding-box; border-color: var(--primary-fill); color: var(--primary-text);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.secondary-button, .external-link {
  --action-hover-fill: var(--surface-inset-hover); --action-pressed-fill: var(--surface-inset-pressed);
  --action-hover-border: var(--stroke); --action-pressed-border: var(--stroke);
  background: var(--surface-inset); border-color: var(--stroke); color: var(--muted-light);
}
.account-card.actionable-card {
  --action-hover-fill: var(--surface-hover); --action-pressed-fill: var(--surface-pressed);
  --action-hover-border: var(--stroke); --action-pressed-border: var(--stroke);
}
.text-button, .icon-button, .view-tab { background: transparent; color: var(--muted-light); }
button:disabled { background: var(--disabled-fill); border-color: var(--stroke); color: var(--disabled-text); box-shadow: none; cursor: not-allowed; }
/* Purple is the only current/selected treatment, on both tabs and account cards. */
.view-tab[aria-selected="true"], .account-card.active { --muted: var(--selected-muted); background-color: var(--selected-fill); background-image: var(--selected-image); border-color: var(--selected-border); }
.view-tab[aria-selected="true"] { color: var(--accent); }
/* Animate only the existing surface alpha. Keep foreground colors and glass images intact. */
@media (hover: hover) and (pointer: fine) {
  :is(.primary-button, .secondary-button, .text-button, .icon-button, .external-link, .view-tab, .account-card.actionable-card, .source-link, .ranking-footnote a, .wordmark):hover:not(:disabled):not([aria-selected="true"]) {
    background-color: var(--action-hover-fill); border-color: var(--action-hover-border);
  }
}
:is(.primary-button, .secondary-button, .text-button, .icon-button, .external-link, .view-tab, .account-card.actionable-card, .source-link, .ranking-footnote a, .wordmark):active:not(:disabled):not([aria-selected="true"]) {
  background-color: var(--action-pressed-fill); border-color: var(--action-pressed-border);
}
.full-width { width: 100%; min-height: 48px; justify-content: space-between; }
.source-link, .ranking-footnote a { display: inline-flex; align-items: center; vertical-align: middle; min-height: var(--control-height); padding: var(--space-1) var(--space-2); text-decoration: underline; text-decoration-color: var(--stroke-strong); text-underline-offset: 4px; border: 1px solid transparent; border-radius: var(--control-radius); transition: background-color var(--motion), border-color var(--motion), color var(--motion); }
.source-link { font-size: var(--text-xs); }
.status-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; margin-right: var(--space-2); border-radius: var(--pill-radius); background: var(--green); }
.eyebrow, .section-kicker { margin: 0 0 var(--space-3); color: var(--accent); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .12em; line-height: 1.5; }
/* Login and confirmation use the same spacing and control system. */
.login-shell { display: grid; min-height: 100%; place-items: center; padding: var(--space-8) var(--space-4); }
.login-card { width: min(100%, 460px); border-radius: var(--card-radius); padding: var(--space-10); }
.brand-mark { display: grid; width: 48px; height: 48px; margin-bottom: var(--space-8); place-items: center; border: 1px solid var(--selected-border); border-radius: var(--inner-radius); background: var(--selected-fill); }
.brand-mark svg { width: 28px; fill: none; stroke: var(--accent); stroke-width: 1.35; }
.brand-mark .mark-line { stroke: var(--text); }
.login-card h1 { margin-bottom: var(--space-3); font-size: 32px; }
.login-copy, .hero-copy { color: var(--muted); line-height: 1.75; }
.login-copy { margin-bottom: var(--space-8); }
label { display: block; margin-bottom: var(--space-2); color: var(--muted-light); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.key-field { position: relative; }
.key-field input { width: 100%; height: 56px; padding: 0 80px 0 var(--space-4); border: 1px solid var(--stroke-strong); border-radius: var(--control-radius); background: var(--bg); color: var(--text); transition: border-color var(--motion); }
.key-field input:focus { border-color: var(--selected-border); }
.icon-button { position: absolute; top: 6px; right: 6px; padding: var(--space-2) var(--space-3); }
.form-error { min-height: 24px; margin: var(--space-2) 0; color: var(--red); font-size: var(--text-sm); }
.security-note { margin: var(--space-6) 0 0; color: var(--muted); font-size: var(--text-xs); text-align: center; }
/* Shared page rhythm and editorial hierarchy. */
.dashboard { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding-bottom: var(--space-10); overflow-anchor: none; }
.topbar { display: flex; min-height: 88px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider); }
.wordmark { display: flex; min-height: var(--control-height); align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-3); margin-inline-start: calc(-1 * var(--space-3)); color: var(--text); text-decoration: none; font-size: var(--text-base); font-weight: var(--weight-semibold); border: 1px solid transparent; border-radius: var(--control-radius); transition: background-color var(--motion), border-color var(--motion), color var(--motion); }
.wordmark-icon { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--selected-border); border-radius: var(--control-radius); background: var(--selected-fill); color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: var(--space-2); }
/* The slot keeps content height stable. Once docked, tabs and glass share viewport positioning. */
.tab-sentinel { height: 1px; margin-top: var(--space-6); margin-bottom: -1px; pointer-events: none; }
.tab-slot { min-height: var(--tab-height); }
.tab-dock { position: relative; width: max-content; max-width: 100%; z-index: 10; }
.tab-dock.is-stuck { position: fixed; top: var(--space-3); }
.tab-dock::before {
  content: ""; position: fixed; inset: 0 0 auto; height: var(--dock-height);
  z-index: -1; pointer-events: none; visibility: hidden;
  background-color: var(--dock-surface); background-image: var(--dock-image);
  border-bottom: 1px solid var(--dock-border); box-shadow: var(--dock-shadow);
  backdrop-filter: blur(28px) saturate(100%); -webkit-backdrop-filter: blur(28px) saturate(100%);
}
.tab-dock.is-stuck::before { visibility: visible; }
.view-tabs { display: flex; width: max-content; gap: var(--tab-gap); padding: var(--tab-padding); border-radius: var(--inner-radius); box-shadow: var(--shadow); }
.tab-dock.is-stuck .view-tabs {
  background: transparent; border-color: transparent; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.view-tab:focus-visible { outline-offset: 2px; }
.view-panel { display: flow-root; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-8); padding: var(--space-12) 0; }
.hero h1 { margin-bottom: var(--space-4); font-size: clamp(40px, 4.8vw, 60px); letter-spacing: -.045em; line-height: 1.12; }
.hero-copy { margin: 0; font-size: var(--text-lg); }
.team-context { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-xs); }
.system-state, .principle-card, .path-card { display: flex; min-width: 240px; flex-direction: column; gap: var(--space-2); padding: var(--space-5); border-radius: var(--inner-radius); color: var(--muted); font-size: var(--text-xs); }
.live-indicator { color: var(--muted-light); font-weight: var(--weight-medium); }
.principle-card strong { color: var(--text); font-size: var(--text-section); line-height: 1.35; }
.principle-divider { height: 1px; margin: var(--space-1) 0; background: var(--divider); }
.principle-label { color: var(--accent); font-weight: var(--weight-semibold); }
.path-card { min-width: 0; }
.path-card code { color: var(--muted-light); font-size: var(--text-xs); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.section-heading h2 { margin: 0; font-size: var(--text-section); }
.section-heading p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.section-heading .section-kicker { margin-bottom: var(--space-2); }
.content-section { margin-top: var(--section-gap); }
.view-panel > .hero + .content-section { margin-top: 0; }
.editorial-heading { align-items: flex-end; }
.section-note { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.75; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--layout-gap); }
.two-column-section, .comparison-grid, .project-grid, .accounts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--layout-gap); }
.info-card, .editorial-card, .ranking-card, .effort-guide, .workspace-overview, .project-card, .workflow-card, .account-card, .state-card { border-radius: var(--card-radius); padding: var(--card-padding); min-width: 0; }
.info-card h3, .project-card h3 { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-title); }
.info-card p, .project-card > p { margin: 0; color: var(--muted); line-height: 1.75; }
.editorial-card > h2 { margin: 0 0 var(--space-6); font-size: var(--text-title); }
/* Pills are static annotations; they never gain hover or pointer feedback. */
.text-chip, .status-pill, .badge, .count-pill { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 28px; border: 1px solid var(--stroke); border-radius: var(--pill-radius); padding: var(--space-1) var(--space-3); background: var(--surface-inset); color: var(--muted-light); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1.5; }
.text-chip { color: var(--accent); letter-spacing: .06em; }
.badge.active { color: var(--accent); border-color: var(--selected-border); background: var(--selected-fill); font-weight: var(--weight-semibold); }
.status-pill.live { color: var(--green); }
.status-pill.pending { color: var(--muted); }
.count-pill { flex-shrink: 0; color: var(--accent); }
/* Guide: read-only recommendations are tinted, with no selection outline. */
.team-hero { align-items: center; }
.team-hero h1 { font-size: clamp(40px, 4.5vw, 56px); line-height: 1.2; }
.team-principle { width: 344px; min-width: 304px; padding: var(--card-padding); }
.default-effort { color: var(--accent); font-size: var(--text-title); font-weight: var(--weight-semibold); }
.default-effort > span { color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }
.default-speed { color: var(--muted); }
.team-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border-radius: var(--card-radius); }
.tier { padding: var(--card-padding); }
.tier + .tier { border-left: 1px solid var(--divider); }
.tier-default { background: var(--recommend-fill); }
.tier-label { color: var(--muted); font-size: var(--text-xs); }
.tier-default .tier-label { color: var(--accent); }
.tier h3 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-section); }
.tier h3 span { margin-left: var(--space-1); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }
.tier p { margin: 0 0 var(--space-5); color: var(--muted-light); font-size: var(--text-sm); }
.tier-metric { color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.comparison-insight { display: grid; grid-template-columns: 176px 1fr; align-items: baseline; gap: var(--space-4); padding: var(--space-6) 0; }
.comparison-insight > strong { color: var(--accent); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.comparison-insight p { margin: 0; color: var(--muted-light); font-size: var(--text-sm); line-height: 1.75; }
.comparison-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); color: var(--muted); font-size: var(--text-xs); }
.chart-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--divider); }
.chart-heading h3 { margin: 0; font-size: var(--text-title); }
.chart-heading > span { color: var(--muted); font-size: var(--text-xs); }
.ranking-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--divider); }
.ranking-meta p, .ranking-meta span { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.ranking-meta p { color: var(--muted-light); }
.ranking-list { display: grid; gap: var(--space-2); }
.ranking-row { --row-color: var(--chart-neutral); display: grid; grid-template-columns: 24px minmax(160px, 1fr) minmax(80px, 2fr) 40px; align-items: center; gap: var(--space-3); min-height: 36px; }
.ranking-position { color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ranking-name { color: var(--row-color); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ranking-track, .bar { height: 6px; overflow: hidden; border-radius: var(--pill-radius); background: var(--track-fill); }
.ranking-track span, .bar > span { display: block; height: 100%; border-radius: inherit; background: var(--row-color, var(--accent-strong)); }
.ranking-row.astra { --row-color: var(--chart-default); }
.ranking-score { color: var(--row-color); font-size: var(--text-sm); font-variant-numeric: tabular-nums; text-align: right; }
.ranking-loading { min-height: 120px; display: grid; place-items: center; color: var(--muted); font-size: var(--text-sm); }
.ranking-footnote { margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--divider); color: var(--muted); font-size: var(--text-xs); line-height: 1.75; }
.comparison-list { gap: var(--space-1); }
.pair-row { --row-color: var(--chart-neutral); display: grid; grid-template-columns: 20px minmax(120px, 1.2fr) minmax(28px, 1fr) 48px; align-items: center; gap: var(--space-2); min-height: 64px; padding: var(--space-2); border: 1px solid transparent; border-radius: var(--control-radius); }
.pair-identity { min-width: 0; display: grid; gap: var(--space-1); }
.pair-name { color: var(--row-color); font-size: var(--text-sm); }
.pair-effort { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--row-color); font-size: var(--text-xs); }
.pair-value { display: grid; gap: var(--space-1); text-align: right; font-variant-numeric: tabular-nums; }
.pair-value strong { color: var(--row-color); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.pair-value > span { color: var(--row-color); font-size: var(--text-xs); }
.pair-row.astra { --row-color: var(--chart-astra); }
.pair-row.default-combination { --row-color: var(--chart-default); background: var(--recommend-fill); }
.default-marker { color: var(--row-color); font-size: var(--text-xs); }
.effort-guide { margin-top: var(--space-8); }
.effort-guide-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); padding-bottom: var(--space-6); }
.effort-guide-heading h3 { margin: 0; font-size: var(--text-title); }
.effort-guide-heading > span { color: var(--muted); font-size: var(--text-xs); }
.effort-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.effort-cards article { padding: 0 var(--space-6); }
.effort-cards article:first-child { padding-left: 0; }
.effort-cards article:last-child { padding-right: 0; }
.effort-cards article + article { border-left: 1px solid var(--divider); }
.effort-kind { color: var(--accent); font-size: var(--text-xs); }
.effort-cards h4 { margin: var(--space-3) 0 var(--space-4); font-size: var(--text-title); }
.effort-cards h4 small { display: block; margin-top: var(--space-1); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }
.effort-cards p { margin: 0 0 var(--space-4); color: var(--muted-light); font-size: var(--text-sm); line-height: 1.75; }
.effort-cards .effort-example { color: var(--muted); }
.effort-rule { display: block; color: var(--text); font-size: var(--text-sm); line-height: 1.75; font-weight: var(--weight-medium); }
.effort-bottom { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--divider); }
.effort-bottom p { margin: 0 0 var(--space-3); color: var(--muted); font-size: var(--text-xs); line-height: 1.75; }
.effort-bottom p:first-child { color: var(--muted-light); }
.effort-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); color: var(--muted); font-size: var(--text-xs); }
/* Projects: descriptive cards, never imitation controls. */
.workspace-overview { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-8); }
.workspace-overview h2 { margin: 0 0 var(--space-3); font-size: var(--text-section); }
.workspace-overview > div:first-child > p:last-child { margin: 0; color: var(--muted); line-height: 1.75; }
.workspace-facts { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.workspace-facts > div { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: var(--space-2); border-left: 1px solid var(--divider); padding-left: var(--space-4); }
.workspace-facts strong { overflow-wrap: anywhere; font-size: var(--text-base); font-weight: var(--weight-semibold); }
.workspace-facts span { color: var(--muted); font-size: var(--text-xs); }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.project-code { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--stroke); border-radius: var(--control-radius); background: var(--surface-inset); color: var(--accent); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.project-card ul { display: grid; gap: var(--space-2); margin: var(--space-5) 0; padding: var(--space-4) 0 var(--space-4) var(--space-5); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); color: var(--muted-light); font-size: var(--text-sm); }
.project-card code { color: var(--muted); font-size: var(--text-xs); }
.document-list > div { display: grid; gap: var(--space-1); padding: var(--space-4) 0; border-top: 1px solid var(--divider); }
.document-list > div:first-child { border-top: 0; padding-top: 0; }
.document-list > div:last-child { padding-bottom: 0; }
.document-list strong { color: var(--muted-light); font-family: "SFMono-Regular", Consolas, monospace; font-size: var(--text-sm); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.document-list span { color: var(--muted); font-size: var(--text-sm); }
.status-stack { display: grid; gap: var(--space-6); }
.status-stack > div { display: flex; align-items: flex-start; }
.status-stack .status-dot { margin-top: var(--space-2); }
.status-stack .pending-dot { background: var(--muted); }
.status-stack p { margin: 0; color: var(--muted); line-height: 1.75; }
.status-stack strong { display: block; margin-bottom: var(--space-1); color: var(--text); font-weight: var(--weight-semibold); }
.workflow-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--layout-gap); color: var(--muted-light); font-size: var(--text-sm); }
.workflow-card i { color: var(--muted); font-style: normal; }
/* Accounts: status first, complete identity second; footer aligned across cards. */
.account-card { position: relative; display: flex; flex-direction: column; transition: background-color var(--motion), border-color var(--motion); }
.account-card.actionable-card { cursor: pointer; }
.account-card.disabled-card { cursor: default; }
.account-top { display: flex; flex-direction: column; gap: var(--space-4); }
.identity { min-width: 0; }
.identity h3 { margin: 0; font-size: var(--text-title); overflow-wrap: anywhere; letter-spacing: -.015em; }
.badges { display: flex; order: -1; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.account-state { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 28px; color: var(--muted); font-size: var(--text-xs); }
.selection-check { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--on-accent); background: var(--accent); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 1; }
.badge.plan { letter-spacing: .06em; }
.runtime-status { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.75; }
.limits { display: grid; gap: var(--space-6); margin: var(--space-8) 0 var(--space-6); }
.limit-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-sm); }
.limit-head span:first-child { color: var(--muted-light); }
.limit-value { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar > span { background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.reset-time { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.model-limits, .reset-credits { padding-top: var(--space-6); border-top: 1px solid var(--divider); }
.model-limit-group + .model-limit-group { margin-top: var(--space-6); }
.model-limit-group h4, .subsection-heading h4 { margin: 0; color: var(--muted-light); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.model-limit-group .limit { margin-top: var(--space-4); }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); }
.reset-guidance { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.75; }
.reset-list { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.reset-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); border: 1px solid var(--divider); border-radius: var(--inner-radius); padding: var(--space-3) var(--space-4); background: var(--surface-inset); }
.reset-row > div { display: grid; gap: var(--space-1); }
.reset-row strong { color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.reset-row span { color: var(--muted); font-size: var(--text-xs); }
.reset-row .expiry { color: var(--muted-light); font-variant-numeric: tabular-nums; }
.account-tip { border: 1px solid var(--stroke); border-radius: var(--inner-radius); padding: var(--space-4); background: var(--surface-inset); }
.account-tip strong { font-size: var(--text-sm); }
.account-tip p { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-xs); }
.card-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin-top: auto; padding-top: var(--space-5); border-top: 1px solid var(--divider); }
.card-status { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.active .card-status { color: var(--accent); }
.switch-button { min-width: 112px; margin-left: auto; }
/* Current remains legible and visually selected while its action is disabled. */
.switch-button.current-button:disabled { background: var(--selected-fill); border-color: var(--selected-border); color: var(--accent); cursor: default; }
.state-card { display: grid; min-height: 232px; place-items: center; align-content: center; gap: var(--space-4); color: var(--muted); text-align: center; }
.state-card p { margin: 0; }
.state-title { color: var(--text); font-weight: var(--weight-semibold); }
.spinner { width: 24px; height: 24px; border: 2px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-10); padding-top: var(--space-5); border-top: 1px solid var(--divider); color: var(--muted); font-size: var(--text-xs); }
footer p { margin: 0; }
.confirm-dialog { width: min(calc(100% - 32px), 460px); max-height: calc(100dvh - 32px); padding: 0; border-radius: var(--card-radius); background-color: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-floating); }
.confirm-dialog::backdrop { background: var(--dialog-scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.confirm-dialog form { padding: var(--space-8); }
.confirm-dialog h2 { margin-bottom: var(--space-3); font-size: var(--text-section); }
.confirm-dialog form > p:not(.eyebrow) { color: var(--muted-light); line-height: 1.75; overflow-wrap: anywhere; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-6); }
.toast { position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 20; max-width: min(400px, calc(100% - 48px)); border: 1px solid var(--stroke); border-radius: var(--inner-radius); padding: var(--space-4) var(--space-5); background: var(--surface-raised); box-shadow: var(--shadow-floating); color: var(--muted-light); font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: opacity var(--motion); }
.toast.show { opacity: 1; }
.refresh-icon.spinning { display: inline-block; animation: spin 800ms linear infinite; }
@media (max-width: 1000px) {
  .comparison-grid { grid-template-columns: 1fr; }
  .team-hero { align-items: flex-start; }
  .hero { gap: var(--space-6); }
  .workspace-overview { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --card-padding: var(--space-5); --card-radius: 20px; --section-gap: var(--space-10); }
  .dashboard { width: min(calc(100% - 32px), 620px); }
  .topbar { min-height: 72px; }
  .wordmark > span:last-child { display: none; }
  .tab-sentinel { margin-top: var(--space-4); }
  .tab-dock, .tab-dock.is-stuck { position: static; width: 100%; }
  .tab-dock::before { display: none; }
  .app-viewport { scroll-padding-top: 16px; }
  .view-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .view-tab { padding: var(--space-2) var(--space-1); font-size: var(--text-xs); white-space: nowrap; }
  .hero { align-items: flex-start; flex-direction: column; padding: var(--space-10) 0; }
  .hero h1 { font-size: 40px; }
  .hero-copy { font-size: var(--text-base); }
  .system-state, .team-principle, .path-card { width: 100%; min-width: 0; }
  .section-heading { flex-wrap: wrap; }
  .section-heading h2 { font-size: var(--text-title); }
  .accounts-grid, .entry-grid, .two-column-section, .project-grid, .team-tiers, .effort-cards { grid-template-columns: 1fr; }
  .desktop-break { display: none; }
  .tier + .tier { border-left: 0; border-top: 1px solid var(--divider); }
  .tier { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: var(--space-2) var(--space-4); }
  .tier h3 { margin: 0; font-size: var(--text-title); text-align: right; }
  .tier p { margin: 0; grid-column: 1 / -1; }
  .tier-metric { grid-column: 1 / -1; }
  .comparison-insight { grid-template-columns: 1fr; gap: var(--space-2); }
  .comparison-meta { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
  .effort-cards article { padding: var(--space-6) 0; }
  .effort-cards article:first-child { padding-top: 0; }
  .effort-cards article:last-child { padding-bottom: 0; }
  .effort-cards article + article { border-left: 0; border-top: 1px solid var(--divider); }
  .ranking-heading { align-items: flex-start; flex-direction: column; }
  .ranking-meta { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
  .ranking-row { grid-template-columns: 20px minmax(0, 1fr) minmax(32px, .6fr) 32px; gap: var(--space-2); }
  .pair-row { grid-template-columns: 16px minmax(0, 1fr) minmax(20px, .4fr) 44px; gap: var(--space-2); padding: var(--space-2) var(--space-1); }
  .pair-name { font-size: var(--text-xs); }
  .workflow-card { align-items: flex-start; flex-direction: column; }
  .workflow-card i { transform: rotate(90deg); margin-left: var(--space-1); }
  footer { flex-direction: column; gap: var(--space-2); }
}
@media (max-width: 480px) {
  .login-card { padding: var(--space-6); }
  .login-card h1 { font-size: 28px; }
  .top-actions { gap: var(--space-1); }
  .workspace-facts { grid-template-columns: 1fr; }
  .workspace-facts > div { border-top: 1px solid var(--divider); border-left: 0; padding: var(--space-4) 0; }
  .workspace-facts > div:first-child { border-top: 0; padding-top: 0; }
  .workspace-facts > div:last-child { padding-bottom: 0; }
  .reset-row { align-items: flex-start; flex-direction: column; }
  .card-status { width: 100%; }
  .confirm-dialog form { padding: var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
