:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f8f8f6;
  --surface-hover: #f0f0ed;
  --ink: #171816;
  --ink-soft: #5f625c;
  --ink-faint: #6f746b;
  --line: #e4e5e0;
  --line-strong: #d5d7d0;
  --accent: #0e7a5f;
  --accent-strong: #095b48;
  --accent-soft: #e6f3ee;
  --blue: #2e65d1;
  --blue-soft: #eaf0fb;
  --amber: #a85f10;
  --amber-soft: #fbf0df;
  --red: #b53a36;
  --red-soft: #fbeceb;
  --purple: #7654b5;
  --purple-soft: #f0ebf8;
  --shadow-sm: 0 1px 2px rgba(15, 18, 15, .04), 0 4px 14px rgba(15, 18, 15, .025);
  --shadow-md: 0 16px 48px rgba(15, 18, 15, .09), 0 3px 12px rgba(15, 18, 15, .05);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --topbar: 68px;
  --sidebar: 236px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111210;
  --surface: #181917;
  --surface-raised: #1d1f1c;
  --surface-soft: #20221f;
  --surface-hover: #282a26;
  --ink: #f3f4f0;
  --ink-soft: #b8bbb3;
  --ink-faint: #a0a59c;
  --line: #2b2e29;
  --line-strong: #3a3e37;
  --accent: #58c7a3;
  --accent-strong: #8cddc3;
  --accent-soft: #193b31;
  --blue: #7ca4f4;
  --blue-soft: #202d49;
  --amber: #e2a65f;
  --amber-soft: #3d2e1e;
  --red: #ee8882;
  --red-soft: #422523;
  --purple: #b79ae8;
  --purple-soft: #332944;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .16);
  --shadow-md: 0 20px 56px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { color: inherit; font: inherit; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
code, pre, kbd { font-family: var(--mono); }

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

.app-shell {
  min-height: 100vh;
  min-width: 0;
  padding-top: var(--topbar);
  padding-left: var(--sidebar);
}

.topbar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: var(--sidebar) 230px minmax(280px, 520px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 22px 0 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  position: relative;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 5px 14px rgba(15,18,15,.12);
  overflow: hidden;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  top: 9px;
  border: 2px solid var(--surface);
  border-right-color: transparent;
  border-radius: 50%;
}
.brand-mark::before { left: 5px; }
.brand-mark::after { right: 5px; }
.brand-mark i { position: absolute; left: 16px; top: 8px; width: 2px; height: 19px; border-radius: 2px; background: var(--accent); }
.brand-copy { display: grid; gap: 0; min-width: 0; }
.brand-copy strong { font-size: 16px; letter-spacing: -.03em; line-height: 1.15; }
.brand-copy small { color: var(--ink-faint); font-size: 10px; letter-spacing: .03em; white-space: nowrap; }

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 5px 10px 5px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.workspace-switcher:hover { background: var(--surface-soft); border-color: var(--line); }
.workspace-switcher > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.workspace-switcher small { color: var(--ink-faint); font-size: 10px; }
.workspace-switcher strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher svg { width: 14px; height: 14px; color: var(--ink-faint); }
.workspace-monogram {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: #fff;
  background: #272a26;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}

.command-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.command-trigger:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.command-trigger > span:nth-child(2) { flex: 1; text-align: left; }
kbd { padding: 2px 6px; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.environment { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; margin-right: 6px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.environment i, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.icon-button.has-indicator { position: relative; }
.icon-button.has-indicator::after { content: ""; position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; background: var(--red); border: 2px solid var(--surface); border-radius: 50%; }
.profile-button { display: grid; place-items: center; width: 34px; height: 34px; margin-left: 2px; color: #fff; background: #3b3d39; border-radius: 50%; font-size: 12px; font-weight: 650; cursor: pointer; }

.sidebar {
  position: fixed;
  z-index: 40;
  left: 0;
  top: var(--topbar);
  bottom: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 17px 12px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar nav { display: grid; gap: 4px; }
.nav-section { margin: 16px 10px 6px; color: var(--ink-faint); font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.sidebar button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sidebar button svg { width: 17px; height: 17px; }
.sidebar button:hover { color: var(--ink); background: var(--surface-soft); }
.sidebar button.active { color: var(--ink); background: var(--surface-hover); font-weight: 600; }
.mobile-more { display: none !important; }
.sidebar button.active svg { color: var(--accent); stroke-width: 1.9; }
.nav-count { margin-left: auto; padding: 1px 6px; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }
.sidebar-foot { display: grid; gap: 3px; margin-top: auto; padding-top: 22px; }
.release-card { display: flex; align-items: center; gap: 10px; margin: 10px 2px 0; padding: 11px 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.release-card > div { display: grid; gap: 1px; min-width: 0; }
.release-card strong { font-size: 11px; }
.release-card small { color: var(--ink-faint); font-size: 9px; white-space: nowrap; }
.release-mark { display: grid; place-items: center; width: 28px; height: 28px; background: var(--accent-soft); border-radius: 8px; }
.release-mark i { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent); }

.main { min-width: 0; min-height: calc(100vh - var(--topbar)); padding: 32px clamp(24px, 3.2vw, 54px) 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 1500px; margin: 0 auto 27px; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { margin: 0 0 6px; color: var(--ink-faint); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-head h1 { margin: 0; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.12; letter-spacing: -.045em; font-weight: 680; }
.page-head p:last-child { max-width: 720px; margin: 8px 0 0; color: var(--ink-soft); }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.page-content { min-width: 0; max-width: 1500px; margin: 0 auto; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-weight: 580;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0,0,0,.025);
}
.button:hover { background: var(--surface-hover); }
.button.primary { color: #fff; background: #1d201d; border-color: #1d201d; }
:root[data-theme="dark"] .button.primary { color: #171816; background: #f1f2ee; border-color: #f1f2ee; }
.button.accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 20%, var(--line)); }
.button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button svg { width: 16px; height: 16px; }

.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 20px 15px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.card-head p { margin: 4px 0 0; color: var(--ink-faint); font-size: 12px; }
.card-body { padding: 0 20px 20px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 30px 0 13px; }
.section-title h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.section-title p { margin: 4px 0 0; color: var(--ink-soft); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.allowance-card {
  --allowance-tone: var(--accent);
  --allowance-soft: var(--accent-soft);
  position: relative;
  margin-bottom: 13px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -20%, color-mix(in srgb, var(--allowance-tone) 12%, transparent) 0, transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--allowance-soft) 34%, var(--surface)) 0, var(--surface) 48%);
  border-color: color-mix(in srgb, var(--allowance-tone) 20%, var(--line));
}
.allowance-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--allowance-tone); }
.allowance-warning { --allowance-tone: var(--amber); --allowance-soft: var(--amber-soft); }
.history-coverage-warning { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; color: var(--ink); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line)); border-radius: var(--radius-md); }
.history-coverage-warning > span { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; color: var(--amber); background: var(--surface); border-radius: 9px; }
.history-coverage-warning svg { width: 16px; height: 16px; }
.history-coverage-warning strong { display: block; font-size: 12px; }
.history-coverage-warning p { margin: 3px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.allowance-danger { --allowance-tone: var(--red); --allowance-soft: var(--red-soft); }
.allowance-unconfigured { --allowance-tone: var(--ink-faint); --allowance-soft: var(--surface-hover); }
.allowance-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 15px; }
.allowance-heading { min-width: 0; }
.allowance-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--allowance-tone); font-size: 10px; font-weight: 720; letter-spacing: .045em; }
.allowance-kicker svg { width: 15px; height: 15px; }
.allowance-heading h2 { margin: 6px 0 0; font-size: 19px; line-height: 1.2; letter-spacing: -.035em; }
.allowance-heading p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; overflow-wrap: anywhere; }
.allowance-status { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 28px; padding: 4px 9px; color: var(--allowance-tone); background: color-mix(in srgb, var(--allowance-soft) 76%, var(--surface)); border: 1px solid color-mix(in srgb, var(--allowance-tone) 22%, var(--line)); border-radius: 999px; font-size: 10px; font-weight: 690; white-space: nowrap; }
.allowance-status svg { width: 13px; height: 13px; stroke-width: 1.9; }
.allowance-main { position: relative; display: grid; grid-template-columns: minmax(240px, .78fr) minmax(0, 2.22fr); align-items: stretch; gap: 22px; padding: 0 22px 17px; }
.allowance-primary { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 4px 2px; }
.allowance-primary > span { color: var(--ink-soft); font-size: 11px; font-weight: 580; }
.allowance-primary strong { display: block; min-width: 0; margin-top: 3px; color: var(--ink); font-size: clamp(32px, 3vw, 43px); font-weight: 690; line-height: 1.08; letter-spacing: -.052em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.allowance-primary strong.is-unconfigured { margin-top: 8px; color: var(--ink-soft); font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -.04em; }
.allowance-primary small { display: block; margin-top: 8px; color: var(--ink-faint); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.allowance-stats { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 11px; }
.allowance-stats div { min-width: 0; padding: 11px 13px; background: color-mix(in srgb, var(--surface) 86%, transparent); }
.allowance-stats dt { color: var(--ink-faint); font-size: 10px; }
.allowance-stats dd { min-width: 0; margin: 4px 0 0; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.allowance-progress-row { position: relative; display: grid; grid-template-columns: minmax(195px, 240px) minmax(0, 1fr); align-items: center; gap: 17px; padding: 0 22px 18px; }
.allowance-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; font-size: 10px; }
.allowance-progress-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allowance-progress-copy span { flex: 0 0 auto; color: var(--ink-faint); white-space: nowrap; }
.allowance-progress { height: 8px; overflow: hidden; background: color-mix(in srgb, var(--allowance-tone) 8%, var(--surface-hover)); border: 1px solid color-mix(in srgb, var(--allowance-tone) 13%, var(--line)); border-radius: 999px; }
.allowance-progress i { display: block; width: var(--allowance-progress); max-width: 100%; height: 100%; background: var(--allowance-tone); border-radius: inherit; transition: width .28s ease; }
.allowance-unconfigured .allowance-progress { background: repeating-linear-gradient(135deg, var(--surface-hover), var(--surface-hover) 6px, var(--surface-soft) 6px, var(--surface-soft) 12px); }
.allowance-unconfigured .allowance-progress i { opacity: 0; }
.allowance-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 52px; padding: 10px 14px 10px 22px; background: color-mix(in srgb, var(--surface-soft) 72%, transparent); border-top: 1px solid var(--line); }
.allowance-notes { min-width: 0; display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.allowance-notes span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.allowance-notes svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--allowance-tone); }
.allowance-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.allowance-actions .button { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.allowance-actions .button.ghost { background: transparent; }
:root[data-theme="dark"] .allowance-card { background: radial-gradient(circle at 92% -20%, color-mix(in srgb, var(--allowance-tone) 11%, transparent) 0, transparent 36%), linear-gradient(135deg, color-mix(in srgb, var(--allowance-soft) 18%, var(--surface)) 0, var(--surface) 50%); }

.billing-definitions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.billing-definitions article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; padding: 13px; background: color-mix(in srgb, var(--surface) 90%, var(--surface-soft)); border: 1px solid var(--line); border-radius: 12px; }
.billing-definitions article > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 9px; }
.billing-definitions svg { width: 17px; height: 17px; }
.billing-definitions article > div { min-width: 0; }
.billing-definitions strong { display: block; font-size: 11px; line-height: 1.35; }
.billing-definitions small { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }

.wallet-hero { position: relative; overflow: hidden; margin-bottom: 13px; background: radial-gradient(circle at 86% 0, color-mix(in srgb, var(--accent) 15%, transparent), transparent 38%), linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 40%, var(--surface)), var(--surface) 48%); border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }
.wallet-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.wallet-hero-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 22px 13px; }
.wallet-hero-head > div { min-width: 0; }
.wallet-hero-head h2 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.035em; }
.wallet-hero-head p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; }
.billing-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-strong); font-size: 10px; font-weight: 720; letter-spacing: .04em; }
.billing-kicker svg { width: 15px; height: 15px; }
.wallet-balance-row { position: relative; display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: stretch; padding: 2px 22px 19px; }
.wallet-balance { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.wallet-balance > span { color: var(--ink-soft); font-size: 11px; }
.wallet-balance > strong { margin-top: 3px; font-size: clamp(35px, 4vw, 50px); font-weight: 680; line-height: 1.08; letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-balance > small { margin-top: 7px; color: var(--ink-faint); font-size: 10px; }
.wallet-ledger-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 11px; }
.wallet-ledger-stats div { min-width: 0; padding: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.wallet-ledger-stats dt { color: var(--ink-faint); font-size: 10px; }
.wallet-ledger-stats dd { margin: 6px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-hero-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px 12px 22px; background: color-mix(in srgb, var(--surface-soft) 76%, transparent); border-top: 1px solid var(--line); }
.wallet-hero-foot > div { display: grid; gap: 2px; min-width: 0; }
.wallet-hero-foot strong { font-size: 11px; }
.wallet-hero-foot span { color: var(--ink-faint); font-size: 10px; line-height: 1.45; }

.billing-management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.billing-control-card { display: flex; min-width: 0; flex-direction: column; }
.billing-control-card .card-body { flex: 1; }
.billing-kind { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 25px; padding: 4px 8px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.billing-kind.platform { color: var(--blue); background: var(--blue-soft); }
.billing-control-value { min-width: 0; padding: 3px 0 17px; }
.billing-control-value > span { display: block; color: var(--ink-faint); font-size: 10px; }
.billing-control-value > strong { display: block; margin-top: 3px; font-size: clamp(26px, 3vw, 35px); line-height: 1.15; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.billing-control-value > small { display: block; margin-top: 7px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.billing-meter-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 10px; }
.billing-meter-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-meter-copy span { flex: 0 0 auto; color: var(--ink-faint); }
.billing-meter { height: 8px; overflow: hidden; background: var(--surface-hover); border: 1px solid var(--line); border-radius: 999px; }
.billing-meter i { display: block; height: 100%; max-width: 100%; background: var(--accent); border-radius: inherit; }
.billing-meter.blue i { background: var(--blue); }
.billing-control-note { margin: 13px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.55; }
.capacity-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 3px 0 17px; }
.capacity-summary div { min-width: 0; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.capacity-summary span { display: block; color: var(--ink-faint); font-size: 10px; }
.capacity-summary strong { display: block; margin-top: 5px; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.billing-section-title { margin-top: 27px; }
.billing-table-card .empty-state { min-height: 150px; }
.billing-keys-table { min-width: 760px; }
.billing-transactions-table { min-width: 820px; }
.transaction-type { display: inline-flex; padding: 4px 7px; color: var(--ink-soft); background: var(--surface-hover); border-radius: 999px; font-size: 10px; font-weight: 630; white-space: nowrap; }
.transaction-type.credit { color: var(--accent-strong); background: var(--accent-soft); }
.transaction-type.debit { color: var(--amber); background: var(--amber-soft); }
.transaction-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.transaction-amount.credit { color: var(--accent-strong); }
.transaction-amount.debit { color: var(--ink); }

.billing-load-state { display: grid; justify-items: center; min-height: 320px; padding: 50px 20px; text-align: center; }
.billing-load-state h2 { margin: 14px 0 5px; font-size: 17px; }
.billing-load-state p { max-width: 430px; margin: 0 0 18px; color: var(--ink-faint); font-size: 12px; }
.billing-loading { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.billing-loading div { height: 180px; background: linear-gradient(90deg, var(--surface-soft), var(--surface), var(--surface-soft)); background-size: 220% 100%; border: 1px solid var(--line); border-radius: var(--radius); animation: loading 1.4s ease infinite; }

.billing-modal-boundary, .deployment-readonly { padding: 13px 14px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.billing-modal-boundary { border-left: 3px solid var(--accent); }
.billing-modal-boundary.soft { border-left-color: var(--amber); }
.billing-modal-boundary.hard { border-left-color: var(--red); }
.billing-modal-boundary.platform { border-left-color: var(--blue); }
.billing-modal-boundary strong, .deployment-readonly strong { display: block; color: var(--ink); font-size: 11px; }
.billing-modal-boundary p, .deployment-readonly p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.deployment-readonly { margin-top: 15px; }
.field-shell > span:last-child { position: absolute; right: 10px; color: var(--ink-faint); font-size: 10px; pointer-events: none; }
.field-shell:has(> span:last-child) .input { padding-right: 48px; }
:root[data-theme="dark"] .wallet-hero { background: radial-gradient(circle at 86% 0, color-mix(in srgb, var(--accent) 11%, transparent), transparent 40%), linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 18%, var(--surface)), var(--surface) 50%); }

.metric-card { position: relative; min-height: 141px; padding: 18px; overflow: hidden; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.purple { color: var(--purple); background: var(--purple-soft); }
.metric-value { margin-top: 15px; font-size: 29px; font-weight: 660; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--ink-faint); font-size: 11px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; font-weight: 650; }
.delta.down { color: var(--blue); background: var(--blue-soft); }
.delta.warn { color: var(--amber); background: var(--amber-soft); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 13px; margin-top: 13px; }
.trend-card { min-height: 375px; }
.chart-toolbar, .inline-tabs { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.chart-toolbar button, .inline-tabs button { padding: 5px 9px; color: var(--ink-faint); background: transparent; border-radius: 6px; font-size: 11px; cursor: pointer; }
.chart-toolbar button.active, .inline-tabs button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.chart-wrap { position: relative; height: 260px; padding: 8px 0 0; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-svg .axis-label { fill: var(--ink-faint); font: 10px var(--font); }
.chart-svg .area { fill: color-mix(in srgb, var(--accent) 9%, transparent); stroke: none; }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line.secondary { stroke: var(--blue); }
.chart-svg .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.decision-list { display: grid; }
.decision-item { display: grid; grid-template-columns: 31px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.decision-item:first-child { border-top: 0; padding-top: 2px; }
.decision-icon { display: grid; place-items: center; width: 31px; height: 31px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; }
.decision-item h4 { margin: 0 0 3px; font-size: 12px; }
.decision-item p { margin: 0; color: var(--ink-faint); font-size: 10px; }
.decision-item time { color: var(--ink-faint); font-size: 10px; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); gap: 13px; }
.progress-list { display: grid; gap: 15px; }
.progress-row { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(140px, 2fr) auto; align-items: center; gap: 12px; }
.progress-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.progress-row span:last-child { color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.progress-track i.blue { background: var(--blue); }
.progress-track i.amber { background: var(--amber); }
.budget-ring { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 22px; }
.ring { position: relative; display: grid; place-items: center; width: 124px; height: 124px; border-radius: 50%; background: conic-gradient(var(--accent) var(--value), var(--surface-hover) 0); }
.ring::before { content: ""; position: absolute; inset: 13px; background: var(--surface); border-radius: 50%; }
.ring-content { position: relative; display: grid; text-align: center; }
.ring-content strong { font-size: 21px; letter-spacing: -.04em; }
.ring-content small { color: var(--ink-faint); }
.budget-copy { display: grid; gap: 9px; }
.budget-copy div { display: flex; justify-content: space-between; gap: 20px; color: var(--ink-soft); font-size: 11px; }
.budget-copy strong { color: var(--ink); }
.budget-copy .budget-status { color: var(--accent); }
.budget-copy .budget-status.warn { color: var(--amber); }
.budget-copy .budget-status.danger { color: var(--red); }
.budget-copy .budget-status.neutral { color: var(--ink-faint); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search-field { min-width: 260px; flex: 1; }
.search-field, .field-shell { position: relative; display: flex; align-items: center; }
.search-field > span:first-child { position: absolute; left: 11px; color: var(--ink-faint); pointer-events: none; }
.search-field input { padding-left: 36px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent); }
.select { appearance: none; padding-right: 31px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 11px) 16px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }

/* Coco Select keeps the native select as the form source while presenting one
   consistent, keyboard-accessible surface across the console. */
.coco-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.coco-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}
.coco-select-trigger {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 25px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 7px 7px 7px 11px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 98%, white 2%), var(--surface)),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 55%, transparent), 0 1px 2px rgba(15, 18, 15, .025);
  outline: none;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease;
}
:root[data-theme="dark"] .coco-select-trigger { box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 1px 2px rgba(0,0,0,.14); }
.coco-select-trigger:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink-faint) 52%, var(--line)); background: var(--surface-raised); }
.coco-select-trigger:focus-visible,
.coco-select.is-open .coco-select-trigger {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent), inset 0 1px 0 color-mix(in srgb, white 48%, transparent);
}
.coco-select-value { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 540; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.coco-select-chevron {
  position: relative;
  width: 25px;
  height: 25px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 7px;
  background: var(--surface-soft);
  transition: transform .17s ease, background-color .17s ease;
}
.coco-select-chevron::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
}
.coco-select.is-open .coco-select-chevron { background: var(--accent-soft); transform: rotate(180deg); }
.coco-select.is-open .coco-select-chevron::before { border-color: var(--accent-strong); }
.coco-select.is-disabled .coco-select-trigger { color: var(--ink-faint); background: var(--surface-soft); cursor: not-allowed; opacity: .72; }
.coco-select.is-static .coco-select-trigger { cursor: default; opacity: 1; }
.coco-select.is-static .coco-select-chevron { border-color: transparent; background: transparent; }
.coco-select.is-static .coco-select-chevron::before { width: 5px; height: 9px; top: 6px; left: 9px; border-color: var(--accent); transform: rotate(45deg); }
.coco-select.compact { width: 116px; flex: 0 0 116px; }
.coco-select.compact .coco-select-trigger { grid-template-columns: minmax(0, 1fr) 20px; min-height: 34px; padding: 5px 5px 5px 9px; border-radius: 9px; }
.coco-select.compact .coco-select-value { font-size: 11px; }
.coco-select.compact .coco-select-chevron { width: 20px; height: 20px; border: 0; background: transparent; }
.coco-select.compact .coco-select-chevron::before { top: 6px; left: 6px; }

.coco-select-backdrop { display: none; }
.coco-select-menu {
  position: fixed;
  z-index: 170;
  min-width: 210px;
  max-width: calc(100vw - 20px);
  padding: 6px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--line-strong) 88%, transparent);
  border-radius: 14px;
  box-shadow: 0 22px 58px rgba(15,18,15,.16), 0 5px 16px rgba(15,18,15,.08), inset 0 1px 0 rgba(255,255,255,.52);
  backdrop-filter: blur(20px) saturate(1.15);
  outline: none;
  overflow: hidden;
  transform-origin: top center;
  animation: coco-select-in .14s cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="dark"] .coco-select-menu { box-shadow: 0 24px 64px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.055); }
@keyframes coco-select-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.coco-select-menu-head { display: none; }
.coco-select-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 39px;
  margin: 1px 1px 6px;
  padding: 0 10px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.coco-select-search span, .coco-select-search svg { width: 16px; height: 16px; }
.coco-select-search input { min-width: 0; width: 100%; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 12px; }
.coco-select-search input::placeholder { color: var(--ink-faint); }
.coco-select-options { max-height: 304px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.coco-select-group { margin: 7px 10px 4px; color: var(--ink-faint); font-size: 9px; font-weight: 680; letter-spacing: .08em; text-transform: uppercase; }
.coco-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px 7px 10px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  outline: 0;
  cursor: pointer;
  transition: color .12s ease, background-color .12s ease;
}
.coco-select-option:hover:not(:disabled), .coco-select-option:focus-visible { color: var(--ink); background: var(--surface-hover); }
.coco-select-option.is-selected { color: var(--accent-strong); background: var(--accent-soft); }
.coco-select-option:disabled { opacity: .42; cursor: not-allowed; }
.coco-select-option-copy { min-width: 0; }
.coco-select-option-copy strong { display: block; overflow: hidden; font-size: 12px; font-weight: 570; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.coco-select-check { display: grid; place-items: center; width: 22px; height: 22px; color: var(--accent-strong); opacity: 0; }
.coco-select-check svg { width: 15px; height: 15px; stroke-width: 2; }
.coco-select-option.is-selected .coco-select-check { opacity: 1; }
.coco-select-empty { margin: 0; padding: 22px 12px; color: var(--ink-faint); text-align: center; font-size: 11px; }
.coco-select-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
.field { display: grid; gap: 6px; }
.field > label, .field-label { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.field-hint { color: var(--ink-faint); font-size: 10px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.range-row { display: grid; grid-template-columns: 100px 1fr 42px; align-items: center; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-value { text-align: right; color: var(--ink-soft); font: 11px var(--mono); }

.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-pill { padding: 7px 10px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; cursor: pointer; }
.filter-pill.active { color: var(--accent-strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); font-weight: 620; }

.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.model-card { position: relative; display: flex; flex-direction: column; min-height: 265px; padding: 17px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.model-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 12px 34px rgba(15,18,15,.07); }
.model-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-provider { display: flex; align-items: center; gap: 9px; min-width: 0; }
.model-card-top .model-provider > span:last-child { display: grid; min-width: 0; }
.model-card-top .model-provider strong,
.model-card-top .model-provider small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; font-size: 11px; font-weight: 730; letter-spacing: -.02em; }
.provider-mark.accent { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.provider-mark.blue { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.provider-mark.purple { color: var(--purple); background: var(--purple-soft); border-color: transparent; }
.provider-mark.amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.health { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-faint); font-size: 10px; }
.health i { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.model-card h3 { margin: 16px 0 3px; font-size: 16px; letter-spacing: -.025em; }
.model-id { color: var(--ink-faint); font: 10px var(--mono); }
.model-description { min-height: 41px; margin: 13px 0; color: var(--ink-soft); font-size: 11px; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 3px 7px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; font-size: 9px; }
.tag.success { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.tag.warn { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.tag.danger { color: var(--red); background: var(--red-soft); border-color: transparent; }
.model-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; padding-top: 16px; }
.model-stats div { display: grid; gap: 2px; padding: 8px; background: var(--surface-soft); border-radius: 8px; }
.model-stats small { color: var(--ink-faint); font-size: 8px; text-transform: uppercase; }
.model-stats strong { font-size: 11px; }
.model-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.model-price { font-size: 11px; }
.model-price strong { font-size: 14px; letter-spacing: -.02em; }

.route-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 13px; }
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 20px 16px; }
.mode-option { position: relative; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.mode-option.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.mode-option strong { display: block; margin-bottom: 3px; font-size: 11px; }
.mode-option small { display: block; color: var(--ink-faint); font-size: 9px; }
.route-chain { display: grid; gap: 8px; }
.route-item { display: grid; grid-template-columns: 22px 32px 1fr auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; cursor: grab; }
.route-chain.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-chain.compact .route-item { grid-template-columns: 32px minmax(0, 1fr) auto; cursor: default; }
.route-chain.compact .provider-mark { width: 32px; height: 32px; }
.route-pool-summary { width: 100%; margin-top: 9px; padding: 10px 12px; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 9px; font-size: 11px; text-align: center; cursor: pointer; }
.route-pool-summary:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.empty-inline { padding: 18px; color: var(--ink-faint); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 12px; }
.route-item.dragging { opacity: .45; border-style: dashed; }
.drag-handle { display: grid; gap: 3px; width: 12px; color: var(--ink-faint); }
.drag-handle i { height: 1px; background: currentColor; border-radius: 1px; }
.route-rank { display: grid; place-items: center; width: 27px; height: 27px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font: 10px var(--mono); }
.route-item h4 { margin: 0 0 2px; font-size: 11px; }
.route-item p { margin: 0; color: var(--ink-faint); font-size: 9px; }
.route-static { display: grid; place-items: center; width: 22px; color: var(--ink-faint); }
.route-static svg { width: 14px; height: 14px; }
.route-order-actions { display: flex; align-items: center; gap: 3px; }
.route-order-actions .icon-button { width: 28px; height: 28px; }
.route-order-actions .icon-button:disabled { opacity: .3; cursor: not-allowed; }
.route-constraints-body { display: grid; gap: 18px; }
.route-cost-control { position: relative; padding: 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 72%, var(--surface)), var(--surface-soft)); border: 1px solid color-mix(in srgb, var(--accent) 19%, var(--line)); border-radius: 12px; overflow: hidden; }
.route-cost-control::after { content: ""; position: absolute; width: 120px; height: 120px; top: -80px; right: -45px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 68%); pointer-events: none; }
.route-cost-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.route-cost-head h3 { margin: 2px 0 0; font-size: 14px; letter-spacing: -.02em; }
.route-cost-kicker { color: var(--accent-strong); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.route-cost-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(150px, 1.15fr) repeat(2, minmax(112px, .75fr)); gap: 10px; }
.route-cost-input { position: relative; display: flex; align-items: center; min-width: 0; }
.route-cost-input > span { position: absolute; z-index: 1; left: 10px; color: var(--ink-faint); font: 11px var(--mono); pointer-events: none; }
.route-cost-input .input { min-width: 0; padding-left: 25px; padding-right: 42px; font-variant-numeric: tabular-nums; }
.route-cost-input > small { position: absolute; right: 9px; color: var(--ink-faint); font: 10px var(--mono); pointer-events: none; }
.route-cost-input .input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 10%, transparent); }
.route-cost-help { position: relative; z-index: 1; margin: 10px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.55; }
.route-cost-status { position: relative; z-index: 1; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: start; gap: 9px; margin-top: 11px; padding: 10px 11px; color: var(--ink-soft); background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); border-radius: 9px; }
.route-cost-status-dot { width: 7px; height: 7px; margin-top: 5px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--accent-soft); }
.route-cost-status strong, .route-cost-status small { display: block; overflow-wrap: anywhere; }
.route-cost-status strong { color: var(--ink); font-size: 11px; }
.route-cost-status small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.route-cost-status.no-match, .route-cost-status.invalid { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 20%, var(--line)); }
.route-cost-status.no-match .route-cost-status-dot, .route-cost-status.invalid .route-cost-status-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.route-cost-status.disabled .route-cost-status-dot { background: var(--ink-faint); box-shadow: 0 0 0 3px var(--surface-hover); }
.route-secondary-constraints { padding-top: 17px; border-top: 1px solid var(--line); }
.model-pool { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.model-check { display: flex; align-items: center; gap: 8px; padding: 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.model-check:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
.model-check input { accent-color: var(--accent); }
.model-check span { display: grid; }
.model-check strong { font-size: 10px; }
.model-check small { color: var(--ink-faint); font-size: 8px; }
.weights { display: grid; gap: 13px; }
.simulation-box { padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.simulation-result { margin-top: 12px; }
.candidate-row { display: grid; grid-template-columns: 26px 1fr 48px; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.candidate-row:first-child { border-top: 0; }
.candidate-list { margin-top: 8px; }
.candidate-copy { min-width: 0; }
.candidate-copy > strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.candidate-cost { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 10px; overflow-wrap: anywhere; }
.candidate-cost.warn { color: var(--amber); }
.candidate-score { color: var(--accent-strong); font: 11px var(--mono); text-align: right; }
.score-bar { height: 4px; margin-top: 4px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--accent); }
.decision-summary { padding: 12px; color: var(--ink-soft); background: var(--accent-soft); border-radius: 9px; font-size: 11px; line-height: 1.6; }
.decision-summary.no-match { color: var(--red); background: var(--red-soft); }
.decision-cost-range { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 10px; }
.routing-rejection-summary { margin: 10px 0 0; padding: 8px 10px; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 10px; line-height: 1.55; }
.audit-list { display: grid; gap: 8px; }
.audit-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: start; }
.audit-row > i { width: 7px; height: 7px; margin-top: 5px; background: var(--accent); border-radius: 50%; }
.audit-row strong { display: block; font-size: 10px; }
.audit-row small { color: var(--ink-faint); font-size: 9px; }

.security-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(330px, 1fr) minmax(250px, .8fr); gap: 13px; align-items: start; }
.policy-column { min-height: 570px; }
.baseline-list { display: grid; gap: 8px; }
.baseline-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.baseline-icon { display: grid; place-items: center; width: 29px; height: 29px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.baseline-item strong { display: block; font-size: 10px; }
.baseline-item small { display: block; color: var(--ink-faint); font-size: 8px; }
.lock-label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-faint); font-size: 8px; }
.lock-label svg { width: 11px; height: 11px; }
.policy-group { padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.policy-group + .policy-group { margin-top: 9px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.group-head h4 { margin: 0; font-size: 11px; }
.group-head small { color: var(--ink-faint); font-size: 8px; }
.term-list { display: flex; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.term-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; font-size: 9px; }
.term-chip > span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.term-chip button { display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: var(--ink-faint); background: transparent; cursor: pointer; }
.term-chip svg { width: 10px; height: 10px; }
.add-term { display: flex; gap: 6px; margin-top: 9px; }
.add-term .input { min-height: 32px; font-size: 10px; }
.scope-list { display: grid; gap: 8px; }
.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; background: var(--surface-soft); border-radius: 9px; }
.scope-row strong { display: block; font-size: 10px; }
.scope-row small { color: var(--ink-faint); font-size: 8px; }
.switch { position: relative; width: 34px; height: 20px; flex: 0 0 34px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
.scan-result { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.scan-result.passed { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.scan-result.blocked { color: var(--red); background: var(--red-soft); border-color: transparent; }
.scan-result.redacted { color: var(--amber); background: var(--amber-soft); border-color: transparent; }

.safety-simple { display: grid; gap: 13px; }
.safety-baseline-summary details { border-top: 1px solid var(--line); }
.safety-baseline-summary summary,
.safety-advanced summary { padding: 13px 18px; color: var(--ink-soft); font-size: 12px; font-weight: 620; cursor: pointer; list-style-position: inside; }
.safety-baseline-summary .baseline-list { padding: 0 18px 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.safety-main-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 13px; align-items: start; }
.simple-policy-list { display: grid; gap: 10px; }
.simple-policy-list .policy-group + .policy-group { margin-top: 0; }
.simple-policy-list .group-head select { width: 116px; min-height: 34px; font-size: 11px; }
.simple-policy-list .group-head .coco-select { width: 116px; flex: 0 0 116px; }
.simple-policy-list .term-chip { cursor: default; }
.simple-policy-list .term-chip > svg { display: none; }
.add-term.batch { align-items: flex-end; }
.add-term.batch .textarea { min-height: 58px; flex: 1; font-size: 12px; resize: vertical; }
.safety-side { display: grid; gap: 13px; }
.safety-test-button { width: 100%; margin-top: 9px; }
.safety-advanced { overflow: hidden; }
.safety-advanced[open] summary { border-bottom: 1px solid var(--line); }

.report-builder { display: grid; grid-template-columns: 254px minmax(0, 1fr); gap: 13px; }
.builder-panel { position: sticky; top: calc(var(--topbar) + 20px); align-self: start; }
.builder-section { padding: 15px 16px; border-top: 1px solid var(--line); }
.builder-section:first-child { border-top: 0; }
.builder-section h3 { margin: 0 0 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.check-list { display: grid; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 28px; color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.check-row input { accent-color: var(--accent); }
.report-surface { display: grid; gap: 13px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.report-kpi { padding: 13px; background: var(--surface-soft); border-radius: 10px; }
.report-kpi small { display: block; color: var(--ink-faint); font-size: 9px; }
.report-kpi strong { display: block; margin-top: 5px; font-size: 18px; letter-spacing: -.035em; }
.report-chart { min-height: 370px; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 235px; padding: 24px 4px 0; border-bottom: 1px solid var(--line); }
.bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 3px; flex: 1; height: 100%; }
.bar { position: relative; width: min(28px, 42%); min-height: 3px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar.secondary { background: var(--blue); opacity: .72; }
.bar:hover::after { content: attr(data-value); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); padding: 4px 6px; color: var(--surface); background: var(--ink); border-radius: 5px; font-size: 8px; white-space: nowrap; }
.bar-labels { display: flex; gap: 12px; padding-top: 8px; }
.bar-labels span { flex: 1; overflow: hidden; color: var(--ink-faint); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.scatter-dot { fill: color-mix(in srgb, var(--accent) 72%, transparent); stroke: var(--surface); stroke-width: 2; }
.scatter-dot:hover { fill: var(--accent); stroke: var(--accent-soft); stroke-width: 5; }

.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 10px 13px; color: var(--ink-faint); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 650; letter-spacing: .03em; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-soft); }
.data-table strong { color: var(--ink); }
.table-identity { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.mini-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; color: var(--ink-soft); background: var(--surface-hover); border-radius: 8px; font-size: 9px; font-weight: 700; }
.table-identity div { display: grid; }
.table-identity small { color: var(--ink-faint); font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; font-weight: 620; white-space: nowrap; }
.status-badge i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status-badge.warn { color: var(--amber); background: var(--amber-soft); }
.status-badge.danger { color: var(--red); background: var(--red-soft); }
.status-badge.neutral { color: var(--ink-soft); background: var(--surface-hover); }

.org-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 13px; }
.org-stat { padding: 16px; }
.org-stat small { color: var(--ink-faint); }
.org-stat strong { display: block; margin-top: 5px; font-size: 22px; letter-spacing: -.04em; }
.department-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.department-card { padding: 16px; }
.department-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.department-head h3 { margin: 0; font-size: 13px; }
.department-card > p { min-height: 32px; color: var(--ink-faint); font-size: 10px; }
.department-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.department-meta div { padding: 8px; background: var(--surface-soft); border-radius: 8px; }
.department-meta small { display: block; color: var(--ink-faint); font-size: 8px; }
.department-meta strong { display: block; margin-top: 2px; font-size: 10px; }

.playground-layout { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: 13px; min-height: 620px; }
.play-panel { display: flex; flex-direction: column; }
.play-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.playground-key { grid-column: 1 / -1; }
.prompt-area { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.prompt-area textarea { min-height: 300px; flex: 1; border: 0; padding: 0; background: transparent; box-shadow: none; font-size: 14px; line-height: 1.7; resize: none; }
.prompt-area textarea:focus { box-shadow: none; }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.prompt-foot small { color: var(--ink-faint); }
.response-panel { position: relative; min-height: 620px; background: #191b19; color: #eef0eb; border-color: #242824; overflow: hidden; }
.response-panel .card-head { border-bottom: 1px solid rgba(255,255,255,.08); }
.response-panel .card-head p { color: #8c938b; }
.response-output { min-height: 280px; padding: 22px; white-space: pre-wrap; line-height: 1.72; }
.response-output.empty { color: #777d76; }
.trace-panel { margin: 0 16px 16px; padding: 14px; background: #222522; border: 1px solid #2d312d; border-radius: 11px; }
.trace-panel h3 { margin: 0 0 12px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.trace-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; }
.trace-step { position: relative; padding: 10px 8px; background: #292d29; }
.trace-step:first-child { border-radius: 8px 0 0 8px; }
.trace-step:last-child { border-radius: 0 8px 8px 0; }
.trace-step:not(:last-child)::after { content: ""; position: absolute; z-index: 2; right: -4px; top: 50%; width: 7px; height: 7px; background: #292d29; border-top: 1px solid #383d38; border-right: 1px solid #383d38; transform: translateY(-50%) rotate(45deg); }
.trace-step small { display: block; color: #7e857d; font-size: 8px; }
.trace-step strong { display: block; margin-top: 3px; color: #d9ded7; font-size: 9px; }
.response-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.response-meta div { padding: 9px; background: #292d29; border-radius: 8px; }
.response-meta small { display: block; color: #7e857d; font-size: 8px; }
.response-meta strong { display: block; margin-top: 3px; font: 9px var(--mono); }

.connection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.connection-card { padding: 16px; }
.connection-card .provider-mark { margin-bottom: 14px; }
.connection-card h3 { margin: 0; font-size: 13px; }
.connection-card > p { min-height: 32px; color: var(--ink-faint); font-size: 10px; }
.connection-health { display: grid; gap: 7px; margin: 13px 0; padding: 10px; background: var(--surface-soft); border-radius: 9px; }
.connection-health div { display: flex; justify-content: space-between; font-size: 9px; }

.code-block { position: relative; margin: 0; padding: 18px; color: #dfe5dc; background: #171a17; border: 1px solid #242824; border-radius: 11px; overflow-x: auto; font-size: 11px; line-height: 1.65; white-space: pre; }
.copy-code { position: absolute; top: 8px; right: 8px; }
.docs-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 13px; }
.docs-index { position: sticky; top: calc(var(--topbar) + 20px); align-self: start; padding: 10px; }
.docs-index span, .docs-index button { display: block; width: 100%; padding: 8px 9px; color: var(--ink-soft); border-radius: 7px; text-align: left; }
.docs-index button { font: inherit; font-size: 13px; background: none; border: 0; cursor: pointer; }
.docs-index button:hover { color: var(--ink); }
.docs-index span.active, .docs-index button.active { color: var(--ink); background: var(--surface-soft); }
.docs-content { padding: 24px; }
.docs-content h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.035em; }
.docs-content h3 { margin: 27px 0 9px; font-size: 14px; }
.docs-content p, .docs-content li { color: var(--ink-soft); line-height: 1.7; }
.docs-content code:not(pre code) { padding: 2px 5px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 4px; font-size: .9em; }
.docs-content .table-wrap { margin: 10px 0 4px; }
.docs-content ol, .docs-content ul { margin: 8px 0; padding-left: 20px; }
.docs-content h4 { margin: 18px 0 8px; font-size: 13px; letter-spacing: -.01em; }
.docs-index button.doc-nav-chapter { margin-top: 10px; font-weight: 600; color: var(--ink); }
.docs-index button.doc-nav-chapter:first-child { margin-top: 0; }
.docs-index button.doc-nav-sub { padding-left: 26px; font-size: 12px; }
.docs-index button.doc-nav-sub.active { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.doc-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc-pager-link { display: grid; gap: 3px; max-width: 46%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: none; cursor: pointer; text-align: left; font: inherit; }
.doc-pager-link:hover { border-color: var(--accent-strong); background: var(--accent-soft); }
.doc-pager-link small { color: var(--ink-soft); font-size: 11px; }
.doc-pager-link strong { color: var(--ink); font-size: 13px; line-height: 1.4; }
.doc-pager-link.next { margin-left: auto; text-align: right; }

.empty-state { display: grid; place-items: center; min-height: 280px; padding: 36px; text-align: center; }
.empty-state span { display: grid; place-items: center; width: 46px; height: 46px; color: var(--ink-faint); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; }
.empty-state h3 { margin: 14px 0 5px; font-size: 14px; }
.empty-state p { max-width: 360px; margin: 0; color: var(--ink-faint); font-size: 11px; }

.loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.loading-grid div { height: 140px; background: linear-gradient(90deg, var(--surface-soft), var(--surface), var(--surface-soft)); background-size: 220% 100%; border: 1px solid var(--line); border-radius: var(--radius); animation: loading 1.4s ease infinite; }
@keyframes loading { to { background-position: -120% 0; } }

.modal { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: transparent; border: 0; overflow: visible; }
.modal.wide { width: min(940px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(18,20,18,.44); backdrop-filter: blur(5px); }
.modal-shell { max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 21px 15px; border-bottom: 1px solid var(--line); }
.modal-shell h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.modal-body { padding: 20px 21px; overflow-y: auto; }
.modal-shell > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 21px; background: var(--surface-soft); border-top: 1px solid var(--line); }

.command-palette { position: fixed; z-index: 100; inset: 0; display: grid; place-items: start center; padding-top: 12vh; background: rgba(18,20,18,.36); backdrop-filter: blur(4px); }
.command-panel { width: min(600px, calc(100vw - 28px)); max-height: 62vh; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-md); overflow: hidden; }
.command-input { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.command-input input { flex: 1; min-width: 0; padding: 0; background: transparent; border: 0; outline: none; font-size: 15px; }
.command-results { max-height: 49vh; padding: 7px; overflow-y: auto; }
.command-result { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 9px; color: var(--ink-soft); background: transparent; border-radius: 9px; text-align: left; cursor: pointer; }
.command-result:hover, .command-result.active { color: var(--ink); background: var(--surface-soft); }
.command-result > span:first-child { display: grid; place-items: center; width: 31px; height: 31px; background: var(--surface-hover); border-radius: 8px; }
.command-result strong { display: block; font-size: 11px; }
.command-result small { color: var(--ink-faint); font-size: 9px; }

.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 9px; min-width: 260px; max-width: 390px; padding: 11px 13px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-md); animation: toast-in .22s ease both; }
.toast > span { display: grid; place-items: center; width: 24px; height: 24px; color: var(--accent); background: var(--accent-soft); border-radius: 7px; }
.toast.error > span { color: var(--red); background: var(--red-soft); }
.toast strong { display: block; font-size: 10px; }
.toast small { display: block; color: var(--ink-faint); font-size: 9px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Account access */
.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(430px, 1.08fr) minmax(430px, .92fr);
  gap: clamp(18px, 2.4vw, 38px);
  padding: clamp(18px, 2.5vw, 38px);
  background:
    radial-gradient(circle at 86% 8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 31%),
    var(--bg);
}

.auth-story {
  position: relative;
  min-height: calc(100svh - clamp(36px, 5vw, 76px));
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4.2vw, 64px);
  color: #f2f5f0;
  background:
    radial-gradient(circle at 78% 18%, rgba(83, 194, 157, .22), transparent 28%),
    radial-gradient(circle at 14% 88%, rgba(91, 116, 185, .17), transparent 31%),
    linear-gradient(145deg, #171a17 0%, #0f1210 64%, #17271f 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(18, 22, 18, .16);
  overflow: hidden;
}

.auth-story::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -148px;
  bottom: -150px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(255, 255, 255, .025), 0 0 0 104px rgba(255, 255, 255, .018);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}
.auth-brand .brand-mark { background: #f2f4ef; box-shadow: 0 8px 24px rgba(0, 0, 0, .24); }
.auth-brand .brand-mark::before,
.auth-brand .brand-mark::after { border-color: #161a17; border-right-color: transparent; }
.auth-brand > span:last-child { display: grid; gap: 1px; }
.auth-brand strong { color: #fff; font-size: 18px; letter-spacing: -.03em; }
.auth-brand small { color: rgba(235, 240, 234, .62); font-size: 11px; }

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: auto 0;
  padding: clamp(48px, 7vh, 86px) 0;
}
.auth-story-copy .eyebrow { margin-bottom: 16px; color: #71d1b0; }
.auth-story-copy h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(40px, 4.4vw, 68px);
  font-weight: 630;
  line-height: 1.06;
  letter-spacing: -.055em;
}
.auth-story-copy > p:not(.eyebrow) {
  max-width: 590px;
  margin: 24px 0 0;
  color: rgba(235, 240, 234, .72);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.75;
}
.auth-benefits { display: grid; gap: 12px; margin-top: 32px; }
.auth-benefits span { display: flex; align-items: center; gap: 10px; color: rgba(242, 245, 240, .86); font-size: 13px; }
.auth-benefits i { width: 7px; height: 7px; flex: 0 0 7px; background: #62cba7; border-radius: 50%; box-shadow: 0 0 0 4px rgba(98, 203, 167, .12); }

.auth-mascot-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px 10px 10px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 16px;
  backdrop-filter: blur(16px);
}
.auth-mascot-card img { width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; object-position: 50% 31%; border-radius: 12px; }
.auth-mascot-card div { display: grid; gap: 3px; min-width: 0; }
.auth-mascot-card strong { color: #fff; font-size: 13px; }
.auth-mascot-card small { color: rgba(235, 240, 234, .62); font-size: 11px; }

.auth-panel { display: grid; place-items: center; min-width: 0; padding: clamp(10px, 2.6vw, 36px); }
.auth-card {
  width: min(100%, 500px);
  padding: clamp(26px, 3vw, 40px);
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 30px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-tabs button {
  min-height: 38px;
  color: var(--ink-faint);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}
.auth-tabs button.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(15, 18, 15, .08); }
.auth-form { display: grid; gap: 17px; }
.auth-form header { margin-bottom: 5px; }
.auth-form h2 { margin: 0; font-size: 27px; font-weight: 660; letter-spacing: -.045em; }
.auth-form header p { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; }
.auth-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 590; }
.auth-form label small { color: var(--ink-faint); font-size: 11px; font-weight: 450; line-height: 1.5; }
.auth-form .input { min-height: 46px; padding-inline: 13px; }
.auth-two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 3px; }
.auth-switch { margin: -2px 0 0; color: var(--ink-faint); font-size: 12px; text-align: center; }
.auth-switch button { padding: 0; color: var(--accent-strong); background: transparent; font-weight: 650; cursor: pointer; }
.auth-error { margin-top: 16px; padding: 11px 13px; color: var(--red); background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 20%, var(--line)); border-radius: 10px; font-size: 12px; line-height: 1.55; }
.auth-legal { margin: 22px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.55; text-align: center; }

:root[data-theme="dark"] .auth-shell {
  background: radial-gradient(circle at 86% 8%, rgba(78, 170, 139, .12), transparent 30%), var(--bg);
}
:root[data-theme="dark"] .auth-card { background: rgba(25, 27, 24, .96); border-color: var(--line-strong); }
:root[data-theme="dark"] .auth-tabs button.active { background: var(--surface-raised); box-shadow: 0 2px 10px rgba(0, 0, 0, .24); }

/* Coco super agent workspace */
.main.coco-agent-mode { min-height: calc(100svh - var(--topbar)); padding-top: 0; padding-bottom: 0; }
.main.coco-agent-mode .page-head { display: none; }
.main.coco-agent-mode .page-content { max-width: none; }
body[data-page="coco"] .coco-launcher { display: none !important; }

.coco-agent-page {
  position: relative;
  width: min(1120px, 100%);
  min-height: calc(100svh - var(--topbar));
  margin: 0 auto;
  padding: clamp(56px, 9vh, 108px) 24px 34px;
}
.coco-agent-page::before {
  content: "";
  position: fixed;
  z-index: -1;
  width: min(740px, 62vw);
  height: min(540px, 52vw);
  top: calc(var(--topbar) - 210px);
  left: calc(50% + var(--sidebar) / 2);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 11%, transparent), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}
.coco-agent-hero { max-width: 790px; margin: 0 auto; text-align: center; transition: opacity .2s ease, transform .2s ease; }
.coco-agent-avatar { position: relative; width: 92px; height: 92px; margin: 0 auto 18px; }
.coco-agent-avatar::before { content: ""; position: absolute; inset: -9px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 17%, transparent), transparent 67%); border-radius: 50%; }
.coco-agent-avatar > span { position: absolute; z-index: 2; right: 3px; bottom: 7px; width: 14px; height: 14px; background: var(--accent); border: 3px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 5px var(--accent-soft); }
.coco-agent-avatar img { position: relative; width: 92px; height: 92px; object-fit: cover; object-position: 50% 31%; background: var(--surface); border: 1px solid var(--line); border-radius: 27px; box-shadow: 0 20px 50px rgba(15, 18, 15, .14); }
.coco-agent-status { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; margin-bottom: 18px; padding: 5px 9px; color: var(--accent-strong); background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 999px; font-size: 10px; font-weight: 650; }
.coco-agent-status i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--accent-soft); }
.coco-agent-status span { padding-left: 7px; color: var(--ink-faint); border-left: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); font-weight: 500; }
.coco-agent-status.simulation { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 18%, var(--line)); }
.coco-agent-status.simulation i { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.coco-agent-status.offline { color: var(--ink-soft); background: var(--surface-soft); border-color: var(--line); }
.coco-agent-status.offline i { background: var(--ink-faint); box-shadow: 0 0 0 3px var(--surface-hover); }
.coco-agent-hero .eyebrow { color: var(--accent-strong); }
.coco-agent-hero h2 { max-width: 760px; margin: 8px auto 0; font-size: clamp(34px, 4.4vw, 58px); font-weight: 680; line-height: 1.08; letter-spacing: -.055em; }
.coco-agent-hero > p:last-child { max-width: 650px; margin: 18px auto 0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }

.coco-agent-starters { display: flex; gap: 10px; width: 100%; margin: 38px auto 18px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.coco-agent-starters > button { position: relative; min-width: 0; flex: 1 1 0; min-height: 142px; padding: 16px; color: var(--ink); background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; scroll-snap-align: start; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.coco-agent-starters > button:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: 0 14px 36px rgba(15,18,15,.08); }
.coco-agent-starters > button > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; }
.coco-agent-starters > button > span svg { width: 17px; height: 17px; }
.coco-agent-starters strong, .coco-agent-starters small { display: block; }
.coco-agent-starters strong { margin-top: 17px; font-size: 13px; letter-spacing: -.015em; }
.coco-agent-starters small { margin-top: 5px; padding-right: 12px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.coco-agent-starters > button > i { position: absolute; right: 14px; top: 14px; color: var(--ink-faint); transform: rotate(45deg); }
.coco-agent-starters > button > i svg { width: 14px; height: 14px; }

.coco-agent-conversation { display: none; width: min(840px, 100%); margin: 0 auto; padding: 28px 8px 12px; }
.coco-agent-page.is-active { display: flex; flex-direction: column; padding-top: 22px; }
.coco-agent-page.is-active .coco-agent-hero { display: none; }
.coco-agent-page.is-active .coco-agent-starters { display: none; }
.coco-agent-page.is-active .coco-agent-conversation { display: flex; flex: 1; flex-direction: column; gap: 18px; }
.coco-agent-message { display: flex; align-items: flex-start; gap: 10px; max-width: 88%; }
.coco-agent-message > img { width: 34px; height: 34px; flex: 0 0 34px; object-fit: cover; object-position: 50% 31%; border: 1px solid var(--line); border-radius: 11px; }
.coco-agent-message > div { min-width: 0; }
.coco-agent-message > div > span { display: block; margin: 0 0 5px 2px; color: var(--ink-faint); font-size: 10px; font-weight: 650; }
.coco-agent-message p { margin: 0; padding: 12px 14px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 5px 15px 15px 15px; box-shadow: var(--shadow-sm); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; }
.coco-agent-message.user { align-self: flex-end; justify-content: flex-end; }
.coco-agent-message.user > div > span { text-align: right; }
.coco-agent-message.user p { color: #fff; background: var(--accent); border-color: var(--accent); border-radius: 15px 5px 15px 15px; }
.coco-agent-message.streaming p::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 4px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: coco-agent-caret .8s steps(2, jump-none) infinite; }
@keyframes coco-agent-caret { 50% { opacity: .15; } }
.coco-agent-working { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-left: 44px; padding: 9px 12px; color: var(--ink-faint); background: var(--surface-soft); border-radius: 10px; font-size: 11px; }
.coco-agent-working i { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; animation: coco-agent-dot 1s ease-in-out infinite; }
.coco-agent-working i:nth-child(2) { animation-delay: .14s; }
.coco-agent-working i:nth-child(3) { animation-delay: .28s; }
.coco-agent-working span { margin-left: 5px; }
@keyframes coco-agent-dot { 0%, 100% { opacity: .24; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.coco-agent-trace { width: calc(100% - 44px); margin-left: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); overflow: hidden; }
.coco-agent-trace summary { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; list-style: none; }
.coco-agent-trace summary::-webkit-details-marker { display: none; }
.coco-agent-trace-mark { display: grid; place-items: center; width: 32px; height: 32px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 9px; }
.coco-agent-trace-mark svg { width: 15px; height: 15px; }
.coco-agent-trace summary strong, .coco-agent-trace summary small { display: block; }
.coco-agent-trace summary strong { font-size: 11px; }
.coco-agent-trace summary small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }
.coco-agent-trace-state { padding: 3px 7px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 6px; font-size: 9px; }
.coco-agent-trace.awaiting_approval .coco-agent-trace-mark,
.coco-agent-trace.awaiting_approval .coco-agent-trace-state { color: var(--amber); background: var(--amber-soft); }
.coco-agent-trace.failed .coco-agent-trace-mark,
.coco-agent-trace.failed .coco-agent-trace-state { color: var(--red); background: var(--red-soft); }
.coco-agent-trace.rejected .coco-agent-trace-mark,
.coco-agent-trace.rejected .coco-agent-trace-state,
.coco-agent-trace.cancelled .coco-agent-trace-mark,
.coco-agent-trace.cancelled .coco-agent-trace-state { color: var(--ink-soft); background: var(--surface-soft); }
.coco-agent-trace-list { display: grid; gap: 0; padding: 2px 14px 12px 29px; border-top: 1px solid var(--line); }
.coco-agent-trace-step { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.coco-agent-trace-step:last-child { border-bottom: 0; }
.coco-agent-trace-step > i { width: 7px; height: 7px; margin-top: 4px; background: var(--blue); border-radius: 50%; box-shadow: 0 0 0 3px var(--blue-soft); }
.coco-agent-trace-step.completed > i, .coco-agent-trace-step.success > i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.coco-agent-trace-step.failed > i, .coco-agent-trace-step.error > i { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.coco-agent-trace-step strong, .coco-agent-trace-step small { display: block; }
.coco-agent-trace-step strong { font-size: 10px; }
.coco-agent-trace-step small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; line-height: 1.5; }
.coco-agent-trace-step > span { color: var(--ink-faint); font-size: 9px; }

.coco-agent-ui-card { width: calc(100% - 44px); margin-left: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.coco-agent-ui-card > header { display: flex; align-items: center; gap: 10px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.coco-agent-ui-card > header > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; }
.coco-agent-ui-card > header svg { width: 16px; height: 16px; }
.coco-agent-ui-card header p, .coco-agent-ui-card header h3 { margin: 0; }
.coco-agent-ui-card header p { color: var(--ink-faint); font-size: 9px; }
.coco-agent-ui-card header h3 { margin-top: 2px; font-size: 13px; }
.coco-agent-ui-copy { margin: 0; padding: 14px 15px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.coco-agent-ui-card > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 15px; background: var(--surface-soft); border-top: 1px solid var(--line); }
.coco-agent-approval-state { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.coco-agent-approval-state.approved { color: var(--accent-strong); }
.coco-agent-approval-state.failed { color: var(--red); }
.coco-agent-diff { display: grid; gap: 7px; padding: 13px 15px; }
.coco-agent-diff > div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr) 18px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; background: var(--surface-soft); border-radius: 9px; }
.coco-agent-diff strong { font-size: 10px; }
.coco-agent-diff span, .coco-agent-diff b { overflow-wrap: anywhere; font: 10px var(--mono); }
.coco-agent-diff span { color: var(--ink-faint); text-decoration: line-through; }
.coco-agent-diff b { color: var(--accent-strong); }
.coco-agent-diff i { color: var(--ink-faint); transform: rotate(-90deg); }
.coco-agent-diff svg { width: 13px; height: 13px; }
.coco-agent-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 15px; }
.coco-agent-report-kpis > div { min-width: 0; padding: 10px; background: var(--surface-soft); border-radius: 9px; }
.coco-agent-report-kpis small, .coco-agent-report-kpis strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coco-agent-report-kpis small { color: var(--ink-faint); font-size: 9px; }
.coco-agent-report-kpis strong { margin-top: 4px; font-size: 15px; }
.coco-agent-report-insights { display: grid; gap: 7px; margin: 0; padding: 0 18px 15px 33px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.coco-agent-report-insights li::marker { color: var(--accent); }
.coco-agent-price-control { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 16px; padding: 17px 15px; }
.coco-agent-price-control > label { position: relative; display: flex; align-items: center; }
.coco-agent-price-control > label > span { position: absolute; left: 10px; color: var(--ink-faint); }
.coco-agent-price-control .input { padding-left: 25px; padding-right: 105px; }
.coco-agent-price-control label small { position: absolute; right: 9px; color: var(--ink-faint); font-size: 9px; }
.coco-agent-security-terms { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 15px; }
.coco-agent-security-terms span { padding: 5px 8px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 7px; font-size: 10px; }
.coco-agent-security-terms small { color: var(--ink-faint); }
.coco-agent-security-meta { display: flex; gap: 7px; padding: 0 15px 14px; }
.coco-agent-security-meta span { padding: 4px 7px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; font-size: 9px; }

.coco-agent-composer { width: min(840px, 100%); margin: 18px auto 0; padding: 10px 11px 9px; background: color-mix(in srgb, var(--surface-raised) 96%, transparent); border: 1px solid var(--line-strong); border-radius: 17px; box-shadow: 0 20px 50px rgba(15,18,15,.11), 0 3px 10px rgba(15,18,15,.045); backdrop-filter: blur(16px); transition: border-color .16s ease, box-shadow .16s ease; }
.coco-agent-composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 22px 54px rgba(15,18,15,.12), 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
.coco-agent-composer textarea { display: block; width: 100%; min-height: 56px; max-height: 180px; padding: 8px 9px; color: var(--ink); background: transparent; border: 0; outline: 0; resize: vertical; font-size: 14px; line-height: 1.6; }
.coco-agent-composer textarea::placeholder { color: var(--ink-faint); }
.coco-agent-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 1px 0 8px; }
.coco-agent-composer > div > span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 9px; }
.coco-agent-composer > div > span svg { width: 13px; height: 13px; color: var(--accent); }
.coco-agent-composer button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; color: #fff; background: var(--accent); border-radius: 11px; cursor: pointer; }
.coco-agent-composer button:disabled { opacity: .5; cursor: wait; }
.coco-agent-composer button svg { width: 17px; height: 17px; }
.coco-agent-disclaimer { margin: 12px auto 0; color: var(--ink-faint); font-size: 9px; text-align: center; }
.coco-agent-page.is-active .coco-agent-composer { position: sticky; z-index: 5; bottom: 18px; margin-top: auto; }
.coco-agent-page.is-active .coco-agent-disclaimer { padding-bottom: 4px; }
:root[data-theme="dark"] .coco-agent-message.user p,
:root[data-theme="dark"] .coco-agent-composer button { color: #171816; }
:root[data-theme="dark"] .coco-agent-avatar img { box-shadow: 0 22px 58px rgba(0,0,0,.36); }

/* CoCo platform assistant */
.coco-launcher {
  position: fixed;
  z-index: 82;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 5px 14px 5px 5px;
  color: #f5f7f3;
  background: #1b1f1b;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(15, 18, 15, .24);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.coco-launcher:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(15, 18, 15, .29); }
.coco-launcher img { width: 38px; height: 38px; object-fit: cover; object-position: 50% 31%; border-radius: 50%; }
.coco-launcher span { font-size: 12px; font-weight: 650; white-space: nowrap; }

.coco-panel {
  position: fixed;
  z-index: 90;
  top: 82px;
  right: 22px;
  bottom: 86px;
  width: min(410px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-raised) 97%, transparent);
  border: 1px solid var(--line);
  border-radius: 21px;
  box-shadow: 0 28px 80px rgba(15, 18, 15, .2), 0 3px 12px rgba(15, 18, 15, .08);
  backdrop-filter: blur(22px) saturate(1.15);
  overflow: hidden;
  animation: coco-panel-in .22s ease both;
}
@keyframes coco-panel-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.coco-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.coco-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coco-identity img { width: 39px; height: 39px; flex: 0 0 39px; object-fit: cover; object-position: 50% 31%; border-radius: 11px; }
.coco-identity > span { display: grid; gap: 1px; }
.coco-identity strong { font-size: 13px; }
.coco-identity small { display: flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 10px; }
.coco-identity small i { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--accent-soft); }
.coco-messages { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 13px; padding: 18px 16px; overflow-y: auto; overscroll-behavior: contain; }
.coco-message { display: flex; align-items: flex-start; gap: 8px; max-width: 92%; }
.coco-message > div { min-width: 0; max-width: 100%; }
.coco-message > img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; object-position: 50% 31%; border-radius: 9px; }
.coco-message p { max-width: 100%; margin: 0; padding: 10px 12px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; overflow-wrap: anywhere; word-break: break-word; font-size: 12px; line-height: 1.65; }
.coco-message.user { align-self: flex-end; justify-content: flex-end; }
.coco-message.user > img { display: none; }
.coco-message.user p { color: #fff; background: var(--accent); border-color: var(--accent); border-radius: 13px 4px 13px 13px; }
.coco-message.loading p::after { content: ""; display: inline-block; width: 14px; height: 4px; margin-left: 7px; background: radial-gradient(circle, currentColor 1.5px, transparent 2px) 0 0 / 7px 4px; opacity: .48; animation: coco-thinking .9s linear infinite; }
.coco-message.pending p::after { content: ""; display: inline-block; width: 14px; height: 4px; margin-left: 7px; background: radial-gradient(circle, currentColor 1.5px, transparent 2px) 0 0 / 7px 4px; opacity: .48; animation: coco-thinking .9s linear infinite; }
.coco-citations { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.coco-citations span { max-width: 100%; padding: 3px 6px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 5px; overflow-wrap: anywhere; word-break: break-word; font-size: 9px; }
@keyframes coco-thinking { to { background-position: 7px 0; } }
.coco-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding-left: 36px; }
.coco-suggestions button { padding: 7px 9px; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 8px; font-size: 10px; cursor: pointer; }
.coco-suggestions button:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.coco-composer { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.coco-composer textarea { width: 100%; min-height: 38px; max-height: 118px; padding: 9px 11px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 10px; outline: none; resize: none; line-height: 1.45; }
.coco-composer textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent); }
.coco-composer button { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--accent); border-radius: 10px; cursor: pointer; }
.coco-composer button:disabled { opacity: .46; cursor: not-allowed; }
.coco-panel > footer { padding: 8px 14px 10px; color: var(--ink-faint); background: var(--surface); font-size: 10px; text-align: center; }
:root[data-theme="dark"] .coco-launcher { color: #171816; background: #eef1eb; border-color: rgba(0, 0, 0, .12); box-shadow: 0 18px 46px rgba(0, 0, 0, .42); }
:root[data-theme="dark"] .coco-panel { background: rgba(27, 29, 26, .98); box-shadow: 0 32px 86px rgba(0, 0, 0, .48); }
:root[data-theme="dark"] .coco-message.user p,
:root[data-theme="dark"] .coco-composer button { color: #171816; }

.account-summary { display: flex; align-items: center; gap: 12px; }
.account-avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; color: #fff; background: #30332f; border-radius: 50%; font-weight: 700; }
.account-summary > div { display: grid; gap: 2px; }
.account-summary small { color: var(--ink-faint); }
.model-detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.model-detail-head .field { flex: 1; }
.detail-heading { margin: 20px 0 9px; font-size: 12px; }
.offer-table { min-width: 760px; }
[role="button"][data-action].data-row:focus,
.data-table tr[role="button"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.mobile-nav-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mobile-nav-grid button { display: grid; justify-items: start; gap: 9px; min-height: 88px; padding: 13px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; text-align: left; cursor: pointer; }
.mobile-nav-grid button span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 8px; }
.mobile-nav-grid button strong { font-size: 11px; }

/* Readability floor for secondary product copy. */
.card-head p,
.section-title p,
.field-hint,
.model-description,
.connection-card > p,
.department-card > p { font-size: 12px; line-height: 1.55; }
.decision-item p,
.decision-item time,
.release-card small,
.model-id,
.mode-option small,
.route-item p,
.model-check small,
.audit-row small,
.baseline-item small,
.lock-label,
.group-head small,
.term-chip,
.scope-row small,
.check-row,
.report-kpi small,
.bar:hover::after,
.bar-labels span,
.data-table th,
.table-identity small,
.department-meta small,
.trace-step small,
.trace-step strong,
.response-meta small,
.response-meta strong,
.connection-health div,
.command-result small,
.toast small { font-size: 10px; line-height: 1.45; }
.tag,
.status-badge,
.model-stats small { font-size: 10px; }

.auth-tabs button:focus-visible,
.auth-switch button:focus-visible,
.coco-launcher:focus-visible,
.coco-suggestions button:focus-visible,
.coco-composer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1180px) {
  :root { --sidebar: 208px; }
  .topbar { grid-template-columns: var(--sidebar) minmax(150px, 190px) minmax(220px, 1fr) auto; }
  .command-trigger > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .model-grid, .department-grid, .connection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-definitions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-layout { grid-template-columns: minmax(260px, .75fr) minmax(360px, 1.25fr); }
  .security-layout > :last-child { grid-column: 1 / -1; }
  .safety-baseline-summary .baseline-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 70px; }
  .topbar { grid-template-columns: var(--sidebar) 1fr auto; padding-left: 12px; }
  .brand-copy, .workspace-switcher > span:nth-child(2), .workspace-switcher > span:last-child, .command-trigger { display: none; }
  .workspace-switcher { width: 43px; padding: 5px; justify-self: start; }
  .top-actions { grid-column: 3; }
  .environment { display: none; }
  .sidebar { padding: 14px 9px; }
  .sidebar button { justify-content: center; padding: 8px; }
  .sidebar button > span:not([data-icon]), .nav-section, .nav-count, .release-card, .sidebar-foot button span:last-child { display: none; }
  .overview-grid, .split-grid, .route-layout, .playground-layout { grid-template-columns: 1fr; }
  .billing-management-grid { grid-template-columns: 1fr; }
  .report-builder { grid-template-columns: 1fr; }
  .builder-panel { position: static; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-index { position: static; display: flex; overflow-x: auto; }
  .docs-index span, .docs-index button { width: auto; white-space: nowrap; }
  .auth-shell { grid-template-columns: minmax(330px, .88fr) minmax(390px, 1.12fr); gap: 16px; padding: 16px; }
  .auth-story { min-height: calc(100svh - 32px); padding: 28px; border-radius: 22px; }
  .auth-story-copy h1 { font-size: clamp(34px, 5vw, 48px); }
  .auth-panel { padding: 12px; }
  .safety-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .allowance-head { padding: 18px 18px 14px; }
  .allowance-main { grid-template-columns: 1fr; gap: 15px; padding: 0 18px 16px; }
  .allowance-primary { padding-bottom: 1px; }
  .allowance-primary strong { font-size: clamp(31px, 6vw, 40px); }
  .allowance-primary strong.is-unconfigured { font-size: clamp(26px, 5vw, 32px); }
  .allowance-progress-row { grid-template-columns: 1fr; gap: 8px; padding: 0 18px 17px; }
  .allowance-foot { align-items: flex-start; flex-direction: column; padding: 12px 18px 14px; }
  .allowance-actions { width: 100%; }
  .allowance-actions .button { min-height: 42px; flex: 1 1 0; }
  .wallet-balance-row { grid-template-columns: 1fr; gap: 14px; }
  .wallet-balance > strong { font-size: clamp(34px, 7vw, 45px); }
  .auth-shell { display: block; min-height: 100svh; padding: 0 0 28px; }
  .auth-story { min-height: 236px; padding: 22px 20px 64px; border: 0; border-radius: 0 0 26px 26px; box-shadow: none; }
  .auth-brand strong { font-size: 16px; }
  .auth-brand small { font-size: 10px; }
  .auth-story-copy { margin: 31px 0 0; padding: 0; }
  .auth-story-copy .eyebrow { margin-bottom: 9px; }
  .auth-story-copy h1 { max-width: 340px; font-size: clamp(27px, 8.5vw, 35px); line-height: 1.12; }
  .auth-story-copy h1 br { display: none; }
  .auth-story-copy > p:not(.eyebrow) { max-width: 350px; margin-top: 12px; font-size: 12px; line-height: 1.6; }
  .auth-benefits, .auth-mascot-card { display: none; }
  .auth-panel { position: relative; z-index: 2; display: block; margin-top: -42px; padding: 0 13px; }
  .auth-card { width: min(100%, 500px); margin-inline: auto; padding: 24px 20px; border-radius: 20px; }
  .auth-tabs { margin-bottom: 24px; }
  .auth-form { gap: 15px; }
  .auth-form h2 { font-size: 24px; }
  .auth-two-fields { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 680px) {
  :root { --sidebar: 0px; --topbar: 62px; }
  .app-shell { padding-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { grid-template-columns: 1fr auto; gap: 8px; height: var(--topbar); padding: 0 12px; }
  .workspace-switcher { display: none; }
  .top-actions { grid-column: 2; }
  .sidebar { z-index: 70; top: auto; width: 100%; height: calc(70px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); border-right: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar nav { display: flex; gap: 3px; width: max-content; min-width: 100%; }
  .sidebar nav > .nav-section { display: none; }
  .sidebar nav button { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 64px; min-height: 56px; padding: 5px 7px; }
  .sidebar nav button[data-page]:not([data-page="coco"]):not([data-page="overview"]):not([data-page="routing"]):not([data-page="reports"]) { display: none; }
  .sidebar nav .mobile-more { display: flex !important; }
  .sidebar nav { width: 100%; }
  .sidebar nav > button { flex: 1; min-width: 0; }
  .sidebar nav button > span:not([data-icon]):not(.nav-count) { display: block; max-width: 60px; overflow: hidden; font-size: 10px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar nav .nav-count { display: none; }
  .sidebar button svg { width: 19px; height: 19px; }
  .sidebar nav:not(:has(> button:nth-of-type(6))) { width: 100%; }
  .sidebar nav:not(:has(> button:nth-of-type(6))) button { min-width: 0; flex: 1; }
  .sidebar-foot { display: none; }
  .main { padding: 22px 13px 40px; }
  .billing-definitions { grid-template-columns: 1fr; }
  .billing-definitions article { min-height: 76px; }
  .wallet-hero-head { padding: 18px 18px 13px; }
  .wallet-balance-row { padding: 1px 18px 17px; }
  .wallet-hero-foot { align-items: flex-start; flex-direction: column; padding: 13px 18px 15px; }
  .wallet-hero-foot .button { width: 100%; min-height: 44px; }
  .billing-control-card .card-foot .button { width: 100%; min-height: 42px; }
  .billing-section-title .button { width: 100%; min-height: 42px; }
  .billing-keys-table th:last-child,
  .billing-keys-table td:last-child { position: sticky; right: 0; z-index: 2; min-width: 70px; background: var(--surface); box-shadow: -9px 0 14px color-mix(in srgb, var(--ink) 5%, transparent); }
  .billing-keys-table th:last-child { z-index: 3; background: var(--surface-soft); }
  .billing-keys-table tbody tr:hover td:last-child { background: var(--surface-soft); }
  .billing-table-card .empty-state { width: calc(100vw - 26px); }
  .billing-loading { grid-template-columns: 1fr; }
  .billing-loading div { height: 124px; }
  .allowance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allowance-stats div { min-height: 58px; padding: 10px 11px; }
  .allowance-stats dd { font-size: 13px; }
  .allowance-notes { align-items: flex-start; flex-direction: column; gap: 6px; font-size: 11px; }
  .allowance-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .allowance-actions .button { min-width: 0; min-height: 44px; padding-inline: 9px; white-space: normal; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; overflow: visible; padding-bottom: 0; }
  .page-actions .button { flex: 0 0 auto; min-width: 0; max-width: 100%; padding-inline: 10px; overflow-wrap: anywhere; white-space: normal; }
  .page-head h1 { font-size: 25px; }
  .page-head p:last-child { font-size: 12px; }
  .metric-grid, .model-grid, .department-grid, .connection-grid, .org-summary, .report-kpis, .security-layout { grid-template-columns: 1fr; }
  .security-layout > :last-child { grid-column: auto; }
  .field-row, .play-controls, .model-pool { grid-template-columns: 1fr; }
  .mode-picker { grid-template-columns: 1fr; }
  .budget-ring { grid-template-columns: 1fr; justify-items: center; }
  .progress-row { grid-template-columns: 90px 1fr; }
  .progress-row > span:last-child { display: none; }
  .trace-flow, .response-meta { grid-template-columns: repeat(2, 1fr); }
  .trace-step:nth-child(2) { border-radius: 0 8px 8px 0; }
  .trace-step:nth-child(3) { border-radius: 8px 0 0 8px; }
  .report-builder { gap: 10px; }
  .report-surface { order: 1; }
  .builder-panel { order: 2; }
  .builder-section .check-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  .policy-column { min-height: auto; }
  .safety-baseline-summary .baseline-list { grid-template-columns: 1fr; }
  .simple-policy-list .group-head { align-items: flex-start; }
  .add-term.batch { display: grid; grid-template-columns: 1fr; }
  .card-head, .section-title { flex-wrap: wrap; }
  .section-title { align-items: flex-start; }
  .section-title .search-field { width: 100% !important; }
  .toolbar .select, .toolbar .coco-select { max-width: 100%; }
  .add-term { flex-wrap: wrap; }
  .add-term .input { width: auto; min-width: 0; flex: 1 1 150px; }
  .route-chain:not(.compact) .route-item { grid-template-columns: 22px 32px minmax(0, 1fr); }
  .route-chain:not(.compact) .route-order-actions { grid-column: 2 / -1; justify-self: end; }
  .route-chain.compact { grid-template-columns: 1fr; }
  .route-chain.compact .route-item { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .route-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-cost-basis { grid-column: 1 / -1; }
  .route-item > :nth-child(3), .scope-row > :first-child { min-width: 0; }
  .baseline-item { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .toast-region { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; width: 100%; }

  .coco-launcher { right: 13px; bottom: calc(82px + env(safe-area-inset-bottom)); min-height: 44px; padding: 4px 11px 4px 4px; }
  .coco-launcher img { width: 34px; height: 34px; }
  .coco-panel { inset: 0 0 calc(70px + env(safe-area-inset-bottom)) 0; width: 100%; border: 0; border-radius: 0; box-shadow: none; animation-name: coco-panel-mobile-in; }
  @keyframes coco-panel-mobile-in { from { opacity: 0; transform: translateY(16px); } }
  .coco-panel > header { min-height: 62px; padding: 11px 13px; }
  .coco-messages { padding: 16px 13px; }
  .coco-message { max-width: 96%; }
  .coco-message p { font-size: 13px; }
  .coco-suggestions { padding-left: 36px; }
  .coco-suggestions button { min-height: 34px; font-size: 11px; }
  .coco-composer { padding: 10px 12px; }
  .coco-panel > footer { padding-bottom: 9px; font-size: 10px; }
  .mobile-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .coco-select-trigger { min-height: 44px; padding-block: 8px; }
  .coco-select.compact .coco-select-trigger { min-height: 44px; }
  .coco-select-backdrop {
    position: fixed;
    z-index: 178;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(15,18,15,.34);
    border: 0;
    backdrop-filter: blur(3px);
    animation: coco-select-backdrop-in .16s ease;
  }
  @keyframes coco-select-backdrop-in { from { opacity: 0; } }
  .coco-select-menu,
  .coco-select-menu.compact {
    z-index: 179;
    inset: auto 8px calc(8px + env(safe-area-inset-bottom) + var(--coco-select-keyboard-offset, 0px)) 8px !important;
    width: auto !important;
    max-width: none;
    max-height: min(72svh, calc(var(--coco-select-viewport-height, 100svh) - 16px), 620px);
    padding: 7px;
    border-radius: 20px;
    transform-origin: bottom center;
    animation-name: coco-select-sheet-in;
  }
  @keyframes coco-select-sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
  .coco-select-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 8px 12px 10px; }
  .coco-select-menu-head > span { display: grid; }
  .coco-select-menu-head strong { font-size: 15px; letter-spacing: -.02em; }
  .coco-select-menu-head small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
  .coco-select-menu-close { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
  .coco-select-menu-close svg { width: 17px; height: 17px; }
  .coco-select-search { min-height: 44px; margin-bottom: 7px; }
  .coco-select-search input { font-size: 16px; }
  .coco-select-options { max-height: calc(min(72svh, 620px) - 70px); }
  .coco-select-menu:has(.coco-select-search) .coco-select-options { max-height: calc(min(72svh, 620px) - 121px); }
  .coco-select-option { min-height: 48px; padding-inline: 12px 10px; border-radius: 11px; }
  .coco-select-option-copy strong { font-size: 14px; }
}

@media (max-width: 900px) {
  .coco-agent-page { padding-inline: 18px; }
  .coco-agent-starters > button { flex: 0 0 calc(50% - 5px); }
}

@media (max-width: 680px) {
  .main.coco-agent-mode { min-height: calc(100svh - var(--topbar) - 70px); }
  .coco-agent-page { min-height: calc(100svh - var(--topbar) - 70px); padding: 32px 13px 22px; }
  .coco-agent-page::before { left: 50%; width: 100vw; height: 70vw; }
  .coco-agent-avatar, .coco-agent-avatar img { width: 72px; height: 72px; }
  .coco-agent-avatar { margin-bottom: 14px; }
  .coco-agent-avatar img { border-radius: 22px; }
  .coco-agent-hero h2 { font-size: clamp(30px, 9vw, 40px); }
  .coco-agent-hero > p:last-child { margin-top: 14px; font-size: 13px; }
  .coco-agent-starters { margin-top: 28px; padding-bottom: 4px; }
  .coco-agent-starters > button { flex-basis: min(76vw, 250px); min-height: 136px; }
  .coco-agent-page.is-active { padding-top: 10px; }
  .coco-agent-page.is-active .coco-agent-conversation { padding: 12px 0 8px; }
  .coco-agent-message { max-width: 96%; }
  .coco-agent-message > img { width: 30px; height: 30px; flex-basis: 30px; }
  .coco-agent-message p { padding: 11px 12px; font-size: 13px; }
  .coco-agent-trace, .coco-agent-ui-card { width: calc(100% - 40px); margin-left: 40px; }
  .coco-agent-trace summary { grid-template-columns: 30px minmax(0, 1fr); }
  .coco-agent-trace-state { display: none; }
  .coco-agent-trace-list { padding-left: 15px; }
  .coco-agent-trace-step { grid-template-columns: 9px minmax(0, 1fr); }
  .coco-agent-trace-step > span { display: none; }
  .coco-agent-report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coco-agent-price-control { grid-template-columns: 1fr; }
  .coco-agent-diff > div { grid-template-columns: 1fr 18px 1fr; }
  .coco-agent-diff strong { grid-column: 1 / -1; }
  .coco-agent-composer { border-radius: 15px; }
  .coco-agent-page.is-active .coco-agent-composer { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .coco-agent-composer > div > span { max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .coco-agent-page.is-active .coco-agent-disclaimer { margin-bottom: calc(70px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .main { padding-inline: 12px; }
  .allowance-head { gap: 10px; padding-inline: 16px; }
  .allowance-heading h2 { font-size: 18px; }
  .allowance-status { min-height: 26px; padding-inline: 7px; }
  .allowance-main, .allowance-progress-row { padding-inline: 16px; }
  .allowance-primary strong { font-size: 29px; }
  .allowance-primary strong.is-unconfigured { font-size: 25px; }
  .allowance-stats div { padding-inline: 9px; }
  .allowance-foot { padding-inline: 16px; }
  .allowance-actions { grid-template-columns: 1fr; }
  .wallet-hero-head { gap: 10px; padding-inline: 16px; }
  .wallet-hero-head h2 { font-size: 18px; }
  .wallet-balance-row, .wallet-hero-foot { padding-inline: 16px; }
  .wallet-balance > strong { font-size: 31px; }
  .wallet-ledger-stats, .capacity-summary { grid-template-columns: 1fr; }
  .billing-meter-copy { align-items: flex-start; flex-direction: column; gap: 3px; }
  .page-actions { gap: 7px; }
  .page-actions .button { min-height: 37px; padding-inline: 9px; font-size: 12px; }
  .card-head { gap: 12px; padding-inline: 17px; }
  .card-body { padding-inline: 17px; }
  .auth-story { min-height: 224px; padding-inline: 17px; }
  .auth-panel { padding-inline: 10px; }
  .auth-card { padding: 22px 17px; }
  .auth-tabs button { font-size: 11px; }
  .route-cost-grid { grid-template-columns: 1fr; }
  .route-cost-basis { grid-column: auto; }
  .route-cost-head { gap: 9px; }
  .route-cost-control { padding: 13px; }
  .candidate-row { grid-template-columns: 26px minmax(0, 1fr) 42px; }
  .coco-launcher span { display: none; }
  .coco-launcher { width: 44px; padding: 4px; }
}

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

@media (forced-colors: active) {
  .coco-select-trigger, .coco-select-menu, .coco-select-option, .coco-select-search { border: 1px solid CanvasText; }
  .coco-select-option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
  .coco-select-trigger:focus-visible,
  .coco-select-option:focus-visible,
  .coco-select-search:focus-within,
  .coco-select-menu-close:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
