/* TokenPool user console. One stylesheet, system fonts only. Pages are built
   by the modules in this directory; selectors follow their class names.
   Palette and shapes follow the TokenPool Wallet Tool: neutral grey ground,
   flat white cards, one gold accent, and a dark theme that follows the OS. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --border-strong: #d1d5dc;
  --text: #16181d;
  --text-2: #3d434f;
  --muted: #697080;
  --accent: #c48a00;
  --accent-hover: #a87600;
  --accent-text: #ffffff;
  --accent-soft: #fdf3d6;
  --accent-ink: #7a5600;
  --accent-ring: rgba(196, 138, 0, .28);
  /* Native checkboxes and sliders: Chrome draws a dark empty track for a
     light accent, so the light theme hands them a slightly deeper gold. */
  --control: #b07c00;
  --notice-bg: #fff8e1;
  --notice-border: #f3e2a9;
  --notice-ink: #5b4511;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --danger-border: #f3c4c0;
  --success: #1e7e45;
  --success-soft: #e6f4ec;
  --header-bg: rgba(255, 255, 255, .88);
  --row-hover: #fafbfc;
  /* Market chart: empty track, seller supply bands, minutes over the cap. */
  --track: #e8ebef;
  --band: #2b8ac4;
  --over: #d9480f;
  --radius: 10px;
  --radius-sm: 6px;
  --header: 56px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #191c22;
    --surface-2: #20242b;
    --border: #2b3039;
    --border-strong: #3a404b;
    --text: #e8eaee;
    --text-2: #c3c8d1;
    --muted: #9097a5;
    --accent: #f0b90b;
    --accent-hover: #f5c93d;
    --accent-text: #16181d;
    --accent-soft: rgba(240, 185, 11, .13);
    --accent-ink: #f0b90b;
    --accent-ring: rgba(240, 185, 11, .32);
    --control: #f0b90b;
    --notice-bg: #2a2410;
    --notice-border: #4a3e14;
    --notice-ink: #f1dc9a;
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, .12);
    --danger-border: rgba(255, 107, 107, .35);
    --success: #4cc38a;
    --success-soft: rgba(76, 195, 138, .14);
    --header-bg: rgba(25, 28, 34, .9);
    --row-hover: #1d2027;
    --track: #2a2f38;
    --band: #4aa3dc;
    --over: #ff8a4c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }

/* Header */
header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 24px;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 23px; object-fit: contain; }
.brand small {
  display: inline-block; margin-left: 2px; padding: 1px 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
}
#session { display: flex; align-items: center; }
#session .row { gap: 10px; flex-wrap: nowrap; }
#session small {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: var(--text-2); padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* Shell */
.layout {
  flex: 1; width: 100%; max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 208px minmax(0, 1fr);
}
nav {
  position: sticky; top: var(--header); align-self: start;
  max-height: calc(100vh - var(--header)); overflow-y: auto;
  padding: 20px 12px;
}
nav a {
  display: block; margin: 2px 0; padding: 8px 12px;
  border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 14px;
  transition: background-color .15s, color .15s;
}
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
main { min-width: 0; padding: 24px 32px 56px; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 4px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--accent-ink); }
h1, .hero h2 { text-wrap: balance; }
/* The signed-out landing carries its own heading; the page title and refresh add nothing there. */
main:has(.hero) .heading { display: none; }
h1 { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; font-weight: 650; }
h3 { margin: 16px 0 8px; font-size: 14.5px; font-weight: 650; }
p { margin: 8px 0; overflow-wrap: anywhere; }
.muted, small { color: var(--muted); font-size: 12.5px; }
p.muted { font-size: 13px; }

/* Status line */
#message:empty { display: none; }
#message {
  margin: 12px 0 4px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid transparent;
}
#message.success { background: var(--success-soft); color: var(--success); }
#message.error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.error { color: var(--danger); }
.success { color: var(--success); }

/* Cards */
section.card {
  margin: 16px 0; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
section.card > h2:first-child { margin-bottom: 12px; }
section.card > :last-child { margin-bottom: 0; }
.entry { padding: 14px 0; border-bottom: 1px solid var(--border); }
.entry:last-child { border-bottom: 0; }

/* Buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { background: var(--surface-2); color: var(--text); }
button:active, .button:active { transform: translateY(.5px); }
button.primary, .button.primary {
  color: var(--accent-text); background: var(--accent); border-color: var(--accent); font-weight: 600;
}
button.primary:hover, .button.primary:hover { color: var(--accent-text); background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--danger); border-color: var(--danger-border); }
button.danger:hover { background: var(--danger-soft); }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; }
button:disabled:not(.primary), button:disabled:not(.primary):hover { background: var(--surface); color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
form button { margin-top: 16px; }
:not(.row) > button + button { margin-left: 8px; }

/* Profile picture: the default is a text glyph, drawn here as a gold disc. */
[role=img][aria-label="默认头像"] {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  font-size: 0; background: var(--accent);
}
[role=img][aria-label="默认头像"]::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-text); opacity: .85; }
img[alt="个人头像"] { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }

/* Forms: labels sit above their control, as in the wallet tool. */
label { display: block; margin: 14px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: 6px; font-weight: 400; }
input, select, textarea {
  width: 100%; max-width: 640px; min-height: 36px; padding: 7px 10px;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
textarea { min-height: 96px; line-height: 1.55; resize: vertical; }
input[type=checkbox], input[type=radio] {
  width: 16px; height: 16px; min-height: 0; max-width: none; margin: 0 8px 0 0; padding: 0;
  accent-color: var(--control); vertical-align: -2px; box-shadow: none;
}
fieldset { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { float: left; width: 100%; margin: 0 0 6px; padding: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
fieldset > label {
  display: inline-flex; align-items: center; margin: 0; padding: 6px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
fieldset > label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 4px; }
.stat {
  min-width: 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: 13px;
}
.stat strong {
  display: block; margin: 4px 0 0; color: var(--text);
  font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat:first-child strong { color: var(--accent-ink); }

/* Tables */
.scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; min-width: 90px; }
th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
td p { margin: 0 0 4px; }
td code { white-space: nowrap; }

/* Text blocks */
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
code { font-size: 12.5px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text); }
pre {
  margin: 12px 0; padding: 14px 16px; white-space: pre-wrap;
  font-size: 12.5px; line-height: 1.65; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
pre code { padding: 0; background: none; color: inherit; }
.notice {
  margin: 12px 0; padding: 12px 14px;
  color: var(--notice-ink); background: var(--notice-bg);
  border: 1px solid var(--notice-border); border-radius: 8px; line-height: 1.6;
}
.notice h2, .notice h3 { color: var(--notice-ink); margin-top: 0; }
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.notice code { background: rgba(0, 0, 0, .06); color: inherit; }
.loading { color: var(--muted); }

/* Landing (signed out) */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: center; gap: 32px;
  margin: 8px 0 16px; padding: 40px 40px 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.hero-mark { width: 240px; height: auto; }
.hero .eyebrow { margin-bottom: 10px; }
.hero h2 { max-width: 720px; margin: 0 0 14px; font-size: 30px; line-height: 1.3; font-weight: 750; letter-spacing: -.02em; }
.hero .lead { max-width: 660px; margin: 0 0 22px; font-size: 15px; line-height: 1.75; color: var(--text-2); }
.hero .row .button { min-height: 40px; padding: 0 20px; font-size: 15px; }
.hero .muted { margin-top: 12px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.feature { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.feature .tag {
  display: inline-block; margin-bottom: 10px; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft);
}

footer {
  margin-top: auto; padding: 16px 24px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); background: var(--surface);
}
footer .legal-links { margin-left: 12px; white-space: nowrap; }
footer .legal-links a { color: var(--muted); }
footer .legal-links a:hover { color: var(--text); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, fieldset > label:has(input:focus-visible) {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Model proposals: a submit form, the account's list, and one detail. */
.proposal-intro { margin-top: 0; color: var(--text-2); }
.proposal-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; max-width: 720px; }
.proposal-form > label { margin-top: 0; }
.proposal-form > label > input, .proposal-form > label > select { max-width: none; }
.proposal-form .wide, .proposal-form > p, .proposal-form > button { grid-column: 1 / -1; }
.proposal-form > p { margin: -4px 0 0; }
.proposal-form > button { justify-self: start; margin-top: 12px; }
.proposal-rules { margin: 16px 0 0; padding: 10px 12px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); }
.proposal-rules p { margin: 2px 0; }
.proposal-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.proposal-toolbar > label { margin: 0; }
.proposal-toolbar select { width: 160px; }
.proposal-status { margin: 10px 0; font-size: 13px; color: var(--muted); }
.proposal-status:empty, .proposal-pending:empty { display: none; }
.proposal-list { display: grid; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.proposal-list:empty { display: none; }
.proposal-list > p { margin: 0; padding: 16px; color: var(--muted); text-align: center; }
:not(.row) > button.proposal-item + button.proposal-item { margin-left: 0; }
button.proposal-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; justify-content: stretch; align-items: center;
  width: 100%; min-height: 0; padding: 12px 14px; text-align: left; white-space: normal; line-height: 1.45;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-weight: 400;
}
button.proposal-item:last-child { border-bottom: 0; }
button.proposal-item:hover { background: var(--row-hover); }
button.proposal-item.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.proposal-item strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; overflow-wrap: anywhere; }
.proposal-item small { grid-column: 1; font-size: 12.5px; }
.proposal-item .pill { grid-row: 1 / span 3; grid-column: 2; }
.proposal-pager:has(button:not([hidden])) { margin-top: 12px; }
.proposal-pager button { margin-top: 0; }
.proposal-lookup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.proposal-lookup > label { flex: 1; min-width: 240px; max-width: 460px; margin: 0; }
.proposal-lookup > button { margin-top: 0; }
.proposal-detail:empty { display: none; }
.proposal-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.proposal-detail h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0 0 12px; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pending { background: var(--notice-bg); color: var(--notice-ink); }
.pill.approved { background: var(--success-soft); color: var(--success); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }

@media (min-width: 761px) {
  /* Break the Chinese headline at punctuation, never inside a word. */
  .hero h2 { word-break: keep-all; }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 184px minmax(0, 1fr); }
  main { padding: 22px 24px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 160px; }
  .hero-mark { width: 160px; }
}
@media (max-width: 760px) {
  header { padding: 0 16px; gap: 12px; }
  .brand { font-size: 16px; }
  .brand small { display: none; }
  #session small { display: none; }
  .layout { display: block; }
  nav {
    position: sticky; top: var(--header); z-index: 10; max-height: none;
    display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 10px 16px;
    background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: none; margin: 0; padding: 5px 12px; border-radius: 999px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); }
  nav a[aria-current] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
  main { padding: 18px 16px 40px; }
  h1 { font-size: 20px; }
  section.card { padding: 16px; }
  .form-grid, .proposal-form { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat strong { font-size: 20px; }
  /* Readable columns scroll sideways instead of breaking every word. */
  .scroll table { min-width: 760px; }
  .scroll th, .scroll td { overflow-wrap: normal; word-break: normal; }
  .hero { display: block; padding: 26px 20px 24px; }
  .hero-mark { display: none; }
  .hero h2 { font-size: 24px; }
  .hero .lead { font-size: 14.5px; }
  .features { grid-template-columns: 1fr; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  footer { padding: 14px 16px; }
  footer .legal-links { display: block; margin: 6px 0 0; }
}

/* Buyer price caps: a default cap, then one comparison row per model. A row's
   track runs 0–100% of the official price: supply bands shade it, the part
   above the cap is dimmed, a dot is the live market ratio and a tick the cap. */
.cap-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.cap-live { font-size: 12px; color: var(--muted); }
.cap-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 8px; vertical-align: 1px; }
.cap-default { margin: 14px 0 16px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.cap-default-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; }
.cap-default-form > .cap-range { grid-column: 1 / -1; }
.cap-default-label { display: grid; gap: 2px; }
.cap-default-ctl { justify-content: flex-end; }
.cap-default-ctl button { margin-top: 0; }
.cap-default-ctl input:not([type=checkbox]), .cap-pct { width: 84px; text-align: right; background: var(--surface); }
.cap-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 500; }
.cap-range { width: 100%; min-width: 0; padding: 0; border: 0; box-shadow: none; background: transparent; accent-color: var(--control); }
.cap-range:focus { background: transparent; box-shadow: none; }
.cap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; }
.cap-summary { flex: 1; min-width: 200px; margin: 0; color: var(--text-2); font-size: 14px; }
.cap-filters { gap: 6px; }
.cap-chip { min-height: 28px; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.cap-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.cap-sort { width: auto; font-size: 13px; }
.cap-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.cap-legend i { display: inline-block; vertical-align: -1px; margin-right: 6px; }
.cap-legend i.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text); }
.cap-legend i.tick { width: 3px; height: 12px; border-radius: 2px; background: var(--accent); }
.cap-legend i.band { width: 18px; height: 9px; border-radius: 2px; background: linear-gradient(90deg, color-mix(in srgb, var(--band) 28%, transparent) 50%, color-mix(in srgb, var(--band) 62%, transparent) 50%); }
.cap-grid { display: grid; min-width: 0; }
.cap-cols { display: grid; grid-template-columns: minmax(140px, 1.15fr) 128px minmax(200px, 2.2fr) 96px 92px 150px; gap: 14px; align-items: center; }
.cap-head { padding: 0 12px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.cap-row { border-bottom: 1px solid var(--border); }
button.cap-main { width: 100%; padding: 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font-weight: 400; box-shadow: none; }
button.cap-main:hover, .cap-row.open button.cap-main { background: var(--surface-2); }
.cap-row.flash button.cap-main { animation: cap-flash 2.4s ease-out; }
@keyframes cap-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.cap-model, .cap-price, .cap-capcell, .cap-status { display: grid; gap: 2px; min-width: 0; }
.cap-model small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.cap-price { font-size: 13px; font-variant-numeric: tabular-nums; }
.cap-status { justify-items: start; gap: 4px; }
.cap-status small { font-size: 12px; line-height: 1.45; }
.cap-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.cap-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cap-pill.ok { background: var(--success-soft); color: var(--success); }
.cap-pill.wait { background: var(--notice-bg); color: var(--notice-ink); }
.cap-bar { position: relative; height: 34px; min-width: 0; }
.cap-track { position: absolute; left: 0; right: 0; top: 12px; height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.cap-band { position: absolute; top: 0; bottom: 0; }
.cap-band.low { background: color-mix(in srgb, var(--band) 28%, transparent); }
.cap-band.ample { background: color-mix(in srgb, var(--band) 62%, transparent); }
.cap-dim { position: absolute; top: 0; bottom: 0; right: 0; background: var(--surface); opacity: .6; }
.cap-mark { position: absolute; top: 0; bottom: 0; width: 0; transition: left .4s ease; }
.cap-mark.cap::before { content: ""; position: absolute; left: -1.5px; top: 8px; width: 3px; height: 18px; border-radius: 2px; background: var(--accent); }
.cap-mark.market::after { content: ""; position: absolute; left: -5px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.cap-tag { position: absolute; transform: translateX(-50%); font-size: 10px; line-height: 1; white-space: nowrap; }
.cap-tag.market { top: 0; color: var(--text); }
.cap-tag.cap { bottom: -1px; color: var(--accent-ink); }
.cap-bar.large { height: 46px; margin-bottom: 12px; }
.cap-bar.large .cap-track { top: 16px; height: 14px; border-radius: 7px; }
.cap-bar.large .cap-mark.cap::before { top: 10px; height: 26px; }
.cap-bar.large .cap-mark.market::after { top: 16px; left: -7px; width: 14px; height: 14px; }
.cap-bar.large .cap-tag { font-size: 11px; }
.cap-trend { display: block; width: 100%; height: 30px; }
.cap-trend.empty { height: auto; color: var(--muted); }
.cap-trend .line { fill: none; stroke: var(--text-2); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.cap-trend .over { fill: none; stroke: var(--over); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.cap-trend .cap { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 2; opacity: .8; vector-effect: non-scaling-stroke; }
.cap-trend .end { fill: var(--text); }
.cap-edit { padding: 4px 12px 20px; }
.cap-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 32px; }
.cap-edit-grid > div { min-width: 0; }
.cap-edit h3 { font-size: 14px; margin: 0 0 8px; }
.cap-modes { display: grid; gap: 8px; }
.cap-modes label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; }
.cap-own { padding-left: 24px; flex-wrap: nowrap; }
.cap-facts { display: grid; gap: 8px; margin: 14px 0 16px; }
.cap-facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.cap-facts dt { color: var(--muted); }
.cap-facts dd { margin: 0; }
.cap-facts dd.good { color: var(--success); }
.cap-facts dd.warn { color: var(--notice-ink); }
.cap-edit .row button { margin-top: 0; }
@media (max-width: 900px) {
  .cap-head { display: none; }
  .cap-cols { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
  .cap-barcell { grid-column: 1 / -1; }
  .cap-trendcell { display: none; }
  .cap-edit-grid, .cap-default-form { grid-template-columns: minmax(0, 1fr); }
  .cap-default-ctl { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .cap-row.flash button.cap-main { animation: none; } .cap-mark { transition: none; } }
