/* Orange Cat / 橘猫值班室 — 独立视觉层，不改变业务钩子与协议。 */
:root {
  /* primitive */
  --oc-ink-900: oklch(0.235 0.025 285);
  --oc-ink-800: oklch(0.30 0.025 285);
  --oc-ink-600: oklch(0.47 0.02 285);
  --oc-paper-0: oklch(0.995 0.003 90);
  --oc-paper-50: oklch(0.975 0.006 90);
  --oc-paper-100: oklch(0.945 0.009 85);
  --oc-line: oklch(0.875 0.012 80);
  --oc-orange-100: oklch(0.93 0.035 75);
  --oc-orange-300: oklch(0.82 0.105 68);
  --oc-orange-500: oklch(0.75 0.14 62);
  --oc-orange-700: oklch(0.53 0.125 48);
  --oc-orange-800: oklch(0.45 0.11 45);
  --oc-green: oklch(0.52 0.09 155);
  --oc-red: oklch(0.53 0.16 25);
  --oc-amber: oklch(0.52 0.11 70);
  /* semantic */
  --page: var(--oc-paper-50);
  --surface: var(--oc-paper-0);
  --surface-subtle: var(--oc-paper-100);
  --ink: var(--oc-ink-900);
  --ink-muted: var(--oc-ink-600);
  --action: var(--oc-orange-700);
  --action-hover: var(--oc-orange-800);
  /* existing component tokens */
  --bg: var(--page);
  --card: var(--surface);
  --card-strong: var(--surface);
  --border: var(--line);
  --text: var(--ink);
  --dim: var(--ink-muted);
  --accent: var(--action);
  --accent2: var(--oc-orange-500);
  --danger: var(--oc-red);
  --ok: var(--oc-green);
  --warn: var(--oc-amber);
  --shadow: 0 12px 30px oklch(0.30 0.025 285 / 0.07);
  --glow: 0 6px 16px oklch(0.53 0.125 48 / 0.14);
  --radius: 14px;
  --bar: var(--action);
  --veil: linear-gradient(105deg, oklch(0.975 0.006 90 / 0.96), oklch(0.975 0.006 90 / 0.80) 52%, oklch(0.975 0.006 90 / 0.93));
  --hero-op: 0.22;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before { background: var(--veil); animation: none; }
body::after {
  background: url("custom/paw-trail.png") right 4% top 8% / 120px auto no-repeat;
  opacity: 0.12;
  animation: none;
}
::selection { color: var(--ink); background: var(--oc-orange-300); }
.auth-hero { opacity: var(--hero-op); filter: saturate(0.72) contrast(0.92); }
.glass, .auth-card, .topbar, .stat-card, .tok-spark, #add-sec, .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 22px; }
.hidden, .hidden-view, [hidden] { display: none !important; }
.dim, .small { color: var(--ink-muted); }
.small { font-size: 12px; }
.spacer { min-width: 0; }
h1, h2, h3, p { text-wrap: pretty; }
button, input, select, textarea { font-family: var(--font); }
button, a, input, select, textarea, summary { touch-action: manipulation; }
:focus-visible {
  outline: 3px solid var(--oc-orange-500) !important;
  outline-offset: 3px !important;
}

/* controls */
.btn {
  min-height: 44px;
  padding: 9px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 140ms ease-out, background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, opacity 140ms ease-out;
}
.btn:hover:not(:disabled) { background: var(--surface-subtle); border-color: var(--oc-ink-600); box-shadow: none; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn.primary, .mode-tab.active, .seg-btn.active, .mode-chip.active {
  color: var(--oc-paper-0);
  background: var(--action);
  border: 1px solid var(--action);
  box-shadow: none;
}
.btn.primary:hover:not(:disabled), .mode-tab.active:hover, .seg-btn.active:hover, .mode-chip.active:hover {
  color: var(--oc-paper-0);
  background: var(--action-hover);
  border-color: var(--action-hover);
}
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { color: var(--danger); background: transparent; border-color: var(--danger); }
.btn.small { min-height: 40px; padding: 7px 12px; font-size: 13px; }
.btn.tiny { min-height: 36px; }
.btn:disabled { opacity: 0.5; }
.inp {
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.inp:focus { border-color: var(--action); box-shadow: 0 0 0 3px var(--oc-orange-100); }
.fld-label, .fld-hint { color: var(--ink-muted); }
.chk input, .sess-check, .pick-item input { accent-color: var(--action); }

/* license gate */
.license-gate {
  background: var(--page);
  gap: 18px;
}
.license-brand {
  width: min(1000px, 100%);
  justify-content: flex-start;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0;
}
.license-brand img { width: 58px; height: 58px; object-fit: contain; }
.license-brand > span { display: grid; gap: 2px; line-height: 1.2; }
.license-brand small { color: var(--ink-muted); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; }
.license-card {
  width: min(1000px, 100%);
  grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.86fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 12px 12px 0 var(--oc-orange-100);
}
.license-content { padding: 48px 46px 42px; }
.license-kicker, .auth-kicker, .hero-eyebrow, .auth-card-index {
  color: var(--action);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.license-content h1 {
  margin: 12px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.license-intro { margin: 18px 0 28px; color: var(--ink-muted); font-size: 15px; line-height: 1.8; }
.license-label { color: var(--ink); font-size: 14px; }
.license-input { font-family: var(--font-mono); letter-spacing: 0.04em; }
.license-hint { color: var(--ink-muted); font-size: 12px; }
.license-submit, .license-retry { min-height: 50px; }
.license-message { color: var(--ink-muted); }
.license-message.is-error { color: var(--danger); }
.license-message.is-success { color: var(--ok); }
.license-art {
  padding: 36px 28px;
  color: var(--oc-paper-0);
  background: var(--ink);
  border-left: 1px solid var(--ink);
}
.license-art::before, .license-art::after {
  width: 72px;
  height: 72px;
  background: transparent;
  border: 1px solid oklch(0.995 0.003 90 / 0.18);
  border-radius: 50%;
}
.license-art::before { top: 24px; right: 24px; }
.license-art::after { bottom: 30px; left: -28px; }
.license-art img { width: min(260px, 90%); filter: drop-shadow(0 18px 20px oklch(0.1 0 0 / 0.22)); }
.license-art p { margin-top: 24px; color: var(--oc-paper-100); font-size: 13px; }

/* auth */
.auth-wrap {
  width: min(1280px, 100%);
  max-width: 1280px;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 0.96fr) minmax(420px, 1.04fr);
  gap: clamp(48px, 7vw, 104px);
  padding: 48px 40px;
}
.auth-brand {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 0 0 210px;
  text-align: left;
}
.brand-line { justify-content: flex-start; gap: 18px; }
.brand-logo-lg {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-brand h1 {
  margin: 4px 0 0;
  color: var(--ink);
  background: none;
  font-family: var(--font-display);
  font-size: clamp(56px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
  animation: none;
  -webkit-text-fill-color: currentColor;
}
.auth-brand h1 small { display: block; margin-top: 10px; font-family: var(--font); font-size: 20px; font-weight: 600; letter-spacing: 0.28em; }
.auth-brand .slogan { max-width: 470px; margin: 26px 0 0; color: var(--ink-muted); font-size: 16px; line-height: 1.85; }
.auth-shift {
  display: grid;
  gap: 5px;
  width: min(250px, calc(100% - 220px));
  margin-top: 32px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.auth-shift span { color: var(--action); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; }
.auth-shift strong { font-size: 14px; line-height: 1.6; }
.auth-mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 230px;
  margin: 0;
  filter: drop-shadow(0 18px 18px oklch(0.30 0.025 285 / 0.10));
  animation: none;
}
.auth-orbits { position: absolute; left: 0; bottom: 0; justify-content: flex-start; gap: 8px; max-width: calc(100% - 246px); margin: 0; }
.orbit-chip {
  min-height: 32px;
  padding: 5px 10px;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  animation: none;
}
.auth-card {
  grid-column: 2;
  grid-row: 1;
  display: block;
  align-self: center;
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-top { margin: 0; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.auth-top > div { display: grid; gap: 5px; }
.auth-welcome { font-family: var(--font-display); font-size: 28px; line-height: 1.35; }
.auth-subtitle { display: block; font-size: 13px; }
.auth-cloud { display: none; }
.auth-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin: 22px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.auth-tab {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  font-size: 13px;
  transition: color 120ms ease-out, background-color 120ms ease-out, transform 120ms ease-out;
}
.auth-tab:hover { color: var(--ink); background: var(--surface-subtle); }
.auth-tab.active { color: var(--oc-paper-0); background: var(--ink); border-color: var(--ink); box-shadow: none; }
.auth-pane { min-width: 0; padding: 24px 0 0; }
.auth-pane > .btn.primary { width: 100%; }
.ts-demo { color: var(--ink-muted); background: var(--surface-subtle); border: 1px dashed var(--line); border-radius: 10px; }
.form-msg { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
#boot-skeleton { background: var(--page); }

/* desktop duty rail */
#view-console:not(.hidden-view) { display: block; }
.topbar {
  position: fixed;
  inset: 20px auto 20px 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  width: 232px;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 24px 16px 18px;
  color: var(--oc-paper-0);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 16px;
  box-shadow: none;
}
.topbar-row { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 12px; width: 100%; }
.topbar-row:first-child { flex: 1; }
.topbar .brand { justify-content: flex-start; margin-bottom: 4px; text-align: left; }
.topbar .brand > span { display: flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; }
.topbar .brand > span::after { display: none; }
.topbar .brand b { color: var(--oc-paper-0); background: none; font-family: var(--font-display); font-size: 27px; -webkit-text-fill-color: currentColor; }
.topbar .brand small { color: var(--oc-paper-100); font-size: 12px; font-weight: 500; letter-spacing: 0.18em; }
.brand-logo { width: 58px; height: 58px; margin: 0 0 8px; padding: 0; object-fit: contain; background: transparent; border: 0; border-radius: 0; }
.shift-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  padding: 3px 10px;
  color: var(--oc-orange-300);
  border: 1px solid oklch(0.82 0.105 68 / 0.35);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.shift-status i { width: 6px; height: 6px; background: var(--oc-orange-300); border-radius: 50%; }
.topbar .user-email { max-width: 100%; padding: 6px 9px; color: var(--oc-paper-100); background: var(--oc-ink-800); border-color: var(--oc-ink-600); }
.topbar .token-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  color: var(--oc-paper-100);
  background: var(--oc-ink-800);
  border: 1px solid var(--oc-ink-600);
  border-radius: 12px;
  text-align: left;
}
.topbar .token-chip b { display: block; color: var(--oc-paper-0); font-family: var(--font-mono); font-size: 26px; line-height: 1.25; }
.topbar .token-chip .peak-badge { margin-top: 6px; color: var(--ink); background: var(--oc-orange-300); }
.topbar-row .spacer { display: block; flex: 1; min-height: 12px; }
.topbar #token-est, .topbar #conn-state { color: var(--oc-paper-100); text-align: left; line-height: 1.5; }
.topbar .btn { color: var(--oc-paper-0); background: transparent; border-color: var(--oc-ink-600); }
.topbar .btn:hover:not(:disabled) { color: var(--ink); background: var(--oc-paper-0); border-color: var(--oc-paper-0); }
.topbar #btn-redeem { color: var(--ink); background: var(--oc-orange-300); border-color: var(--oc-orange-300); }
.topbar-row #btn-refresh-balance { width: 100%; margin: 0; }
.topbar-row2 { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: 100%; }
.topbar::after { content: "ORANGE CAT · SHIFT 01"; margin-top: 16px; color: var(--oc-paper-100); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-align: left; }
.topbar .more-menu { color: var(--ink); }

/* workspace */
.console-wrap {
  width: 100%;
  max-width: 1580px;
  margin: 0;
  padding: 26px 28px 52px 284px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-areas:
    "notice notice"
    "desk desk"
    "accounts stats"
    "accounts spark"
    "accounts add";
  gap: 18px;
  align-items: start;
}
#notice-stack { grid-area: notice; display: grid; gap: 12px; min-width: 0; }
#notice-stack:not(:has(> :not(.hidden))) { display: none; }
#automatch, #kick-notes { grid-column: 1 / -1; }
.console-hero {
  grid-area: desk;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  min-height: 196px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero-copy { min-width: 0; padding: 28px 30px; }
.console-hero h2 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.035em;
}
.console-hero p { max-width: 560px; margin: 0; color: var(--ink-muted); font-size: 14px; }
.hero-note { display: inline-flex; gap: 8px; margin-top: 15px; padding: 0; color: var(--ink-muted); background: transparent; font-family: var(--font-mono); font-size: 11px; }
.hero-note i { color: var(--action); font-style: normal; }
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: var(--oc-orange-100);
  border-left: 1px solid var(--line);
}
.console-hero .hero-visual img { position: static; width: 176px; max-width: 100%; margin: 0; filter: drop-shadow(0 12px 12px oklch(0.45 0.11 45 / 0.10)); }
.hero-stamp { position: absolute; top: 16px; right: 16px; color: var(--action); font-family: var(--font-mono); font-size: 11px; font-weight: 800; line-height: 1.25; letter-spacing: 0.12em; text-align: right; }
.hero-caption { position: absolute; bottom: 13px; left: 16px; color: var(--ink-muted); font-size: 12px; }
.stat-grid { grid-area: stats; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card, .stat-card:nth-child(n) {
  min-width: 0;
  min-height: 118px;
  padding: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}
.stat-card:first-child { color: var(--oc-paper-0); background: var(--ink); border-color: var(--ink); }
.stat-card:first-child .stat-k, .stat-card:first-child .stat-io { color: var(--oc-paper-100); }
.stat-k { color: var(--ink-muted); font-size: 12px; }
.stat-card .stat-v { margin-top: 8px; font-family: var(--font-mono); font-size: 25px; font-variant-numeric: tabular-nums; }
.stat-io { color: var(--ink-muted); font-family: var(--font-mono); font-size: 12px; }
.tok-spark { grid-area: spark; margin: 0; background: var(--surface); border-radius: 12px; }
.acc-sec { grid-area: accounts; min-width: 0; }
.acc-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.acc-title { font-family: var(--font-display); font-size: 23px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 12px; }
.mode-tab { min-height: 46px; justify-content: center; padding: 8px; color: var(--ink-muted); border-radius: 8px; font-size: 13px; }
.mode-tab.active { color: var(--oc-paper-0); }
.mode-icon { width: 24px; height: 24px; }
.ops-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ops-row .btn { min-width: 0; padding-inline: 10px; }
.ops-row .spacer { display: none; }
#fish-ops, #mode-ops { display: contents; }
.sel-line { color: var(--ink-muted); }
.resume-inner { border-left: 1px solid var(--action); background: var(--oc-orange-100); }
.acc-table-wrap { overflow-x: auto; }
.acc-table { min-width: 720px; font-size: 13px; }
.acc-table th { padding: 10px; color: var(--ink-muted); background: var(--surface-subtle); border-bottom-color: var(--line); font-family: var(--font-mono); font-size: 11px; }
.acc-table td { padding: 11px 10px; border-bottom-color: var(--line); }
.acc-row:hover, .acc-row.open { background: var(--oc-orange-100); }
.badge { background: var(--surface); }
.badge-blue { color: var(--action); border-color: var(--action); }
.amount-link { color: var(--action); text-decoration-color: var(--oc-orange-300); }
.amount-link:hover { color: var(--action-hover); }
.receipt-entry { color: var(--oc-paper-0); background: var(--ink); border-color: var(--ink); border-radius: 8px; box-shadow: none; }
.receipt-entry:hover { background: var(--action); border-color: var(--action); }
.receipt-arrow { color: var(--oc-orange-300); }
#add-sec { grid-area: add; margin: 0; background: var(--surface); border: 1px dashed var(--oc-ink-600); }
#add-sec .add-form { grid-template-columns: 1fr; gap: 10px; }
.empty-art { width: 150px; }
.back-top { color: var(--oc-paper-0); background: var(--ink); border-color: var(--ink); border-radius: 10px; }

/* dialogs, popovers, feedback */
.modal { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px oklch(0.2 0.025 285 / 0.22); }
.modal-mask { background: oklch(0.20 0.025 285 / 0.44); backdrop-filter: none; }
.modal-body { color: var(--ink); }
.modal-title { font-family: var(--font-display); font-size: 21px; }
.theme-menu, .row-menu, .mode-menu { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.theme-item:hover, .row-menu-item:hover { background: var(--surface-subtle); }
.map-pick, .entry-opt, .receipt-choice, .stats-record { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.map-pick:hover, .receipt-choice:hover { background: var(--oc-orange-100); border-color: var(--action); }
.seg { background: var(--surface-subtle); border-color: var(--line); border-radius: 10px; }
.seg-btn { border-radius: 7px; }
.wan-hint { color: var(--action); background: var(--oc-orange-100); border-radius: 7px; }
.receipt-popover .modal { background: var(--surface); border-radius: 12px; }
.receipt-choice small, .stats-record-head span, .stats-record-line { color: var(--ink-muted); }
.toast-box { display: grid; gap: 0; justify-items: center; }
.toast-box .toast { grid-area: 1 / 1; }
.toast { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.banner-tag { color: var(--oc-paper-0); background: var(--action); }

@media (min-width: 1101px) {
  .console-wrap {
    grid-template-columns: minmax(0, 1fr) 292px;
    grid-template-areas:
      "notice notice"
      "desk desk"
      "accounts stats"
      "accounts spark"
      "accounts add";
  }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-head { grid-template-columns: minmax(0, 1fr); }
  .mode-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .topbar {
    position: sticky;
    inset: 0 auto auto;
    width: calc(100% - 24px);
    margin: 12px auto 0;
    padding: 12px 14px;
    border-radius: 14px;
  }
  .topbar-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .topbar .brand { margin: 0; }
  .topbar .brand b { font-size: 22px; }
  .topbar .brand small { display: none; }
  .brand-logo { width: 40px; height: 40px; margin: 0; }
  .shift-status { order: 2; }
  .topbar .user-email { max-width: 180px; }
  .topbar .token-chip { flex: 1 1 170px; flex-direction: row; justify-content: center; padding: 8px 12px; }
  .topbar .token-chip b { display: inline; font-size: inherit; }
  .topbar-row .spacer { display: none; }
  .topbar #conn-state { display: none; }
  .topbar-row #btn-refresh-balance { width: auto; }
  .topbar-row2 { display: flex; flex-direction: row; justify-content: flex-end; margin-top: 0; }
  .topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: auto; }
  .topbar::after { display: none; }
  .console-wrap {
    padding: 18px 14px 44px;
    grid-template-columns: minmax(0, 1fr) 250px;
    grid-template-areas:
      "notice notice"
      "desk desk"
      "stats stats"
      "accounts accounts"
      "spark add";
  }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-card, .stat-card:nth-child(n) { min-height: 106px; }
}

@media (max-width: 900px) {
  body::after { background-size: 88px auto; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 18px 40px; }
  .auth-brand { grid-column: 1; grid-row: 1; padding-bottom: 180px; }
  .auth-brand .brand-line { justify-content: flex-start; }
  .auth-brand h1 { font-size: 58px; }
  .auth-brand .slogan { margin: 18px 0 0; }
  .auth-mascot { width: 190px; }
  .auth-shift { width: calc(100% - 210px); margin-top: 22px; }
  .auth-orbits { max-width: calc(100% - 205px); }
  .auth-card { grid-column: 1; grid-row: 2; padding: 24px; }
  .console-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "notice" "desk" "stats" "accounts" "spark" "add";
    gap: 12px;
    padding: 16px 10px 42px;
  }
  .console-hero { grid-template-columns: minmax(0, 1fr) 200px; min-height: 176px; }
  .hero-copy { padding: 24px; }
  .console-hero h2 { font-size: 30px; }
  .console-hero .hero-visual img { width: 150px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-head { display: flex; }
  .mode-tabs { display: none; }
  .mode-select { display: inline-flex; }
  .ops-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acc-table { min-width: 0; }
  .card { padding: 16px; border-radius: 14px; }
  .glass, .auth-card, .topbar, .stat-card, .tok-spark, #add-sec { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar .more-menu { top: calc(100% + 8px); bottom: auto; }
}

@media (max-width: 680px) {
  .license-gate { align-content: start; padding-top: max(20px, env(safe-area-inset-top)); }
  .license-card { grid-template-columns: minmax(0, 1fr); border-radius: 16px; box-shadow: 7px 7px 0 var(--oc-orange-100); }
  .license-content { grid-row: 2; padding: 26px 22px 24px; }
  .license-art { grid-row: 1; padding: 18px 20px 0; background: transparent; border: 0; }
  .license-art img { width: 130px; filter: none; }
  .license-art p, .license-art::before, .license-art::after { display: none; }
  .license-content h1 { font-size: 30px; }
}

@media (max-width: 520px) {
  .auth-wrap { padding: 20px 12px 32px; }
  .auth-brand { padding-bottom: 154px; }
  .brand-logo-lg { width: 62px; height: 62px; }
  .auth-brand h1 { font-size: 46px; }
  .auth-brand h1 small { font-size: 16px; }
  .auth-brand .slogan { font-size: 14px; line-height: 1.75; }
  .auth-shift { display: none; }
  .auth-mascot { width: 132px; }
  .auth-orbits { max-width: calc(100% - 142px); gap: 6px; }
  .orbit-chip { padding: 4px 8px; font-size: 12px; }
  .auth-card { padding: 20px 16px; border-radius: 14px; }
  .auth-welcome { font-size: 24px; }
  .auth-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-tab { width: 100%; padding: 8px 4px; }
  .topbar { width: calc(100% - 20px); margin-top: 10px; padding: 10px; }
  .topbar .brand > span { font-size: 13px; }
  .topbar .brand b { font-size: 20px; }
  .shift-status { display: none; }
  .topbar .user-email { order: 3; max-width: 100%; }
  .topbar .token-chip { flex-basis: 150px; font-size: 12px; }
  .topbar-row2 { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: 100%; }
  .console-hero { grid-template-columns: minmax(0, 1fr) 112px; min-height: 178px; }
  .hero-copy { padding: 20px 16px; }
  .hero-eyebrow { font-size: 10px; letter-spacing: 0.06em; }
  .console-hero h2 { font-size: 25px; }
  .console-hero p { font-size: 12px; line-height: 1.6; }
  .hero-note { align-items: flex-start; flex-direction: column; gap: 0; font-size: 10px; }
  .hero-note i { display: none; }
  .console-hero .hero-visual img { width: 102px; }
  .hero-stamp { top: 10px; right: 9px; font-size: 9px; }
  .hero-caption { display: none; }
  .stat-card, .stat-card:nth-child(n) { min-height: 106px; padding: 13px; }
  .stat-card .stat-v { font-size: 22px; }
  .stat-k, .stat-io { font-size: 12px; }
  .card { padding: 12px; }
  .ops-row .btn { font-size: 12px; }
  .acc-table { font-size: 12px; }
  .acc-table th { font-size: 12px; }
  .acc-table .badge, .acc-table .batch-line { font-size: 12px; }
  .acc-table .col-amount, .acc-table .col-map, .acc-table .col-ready { font-size: 12px; }
  .acc-table .col-amount::before, .acc-table .col-map::before { font-size: 12px; }
  .receipt-entry { min-height: 40px; }
  .modal { border-radius: 14px; }
}

@media (max-width: 380px) {
  .license-gate { padding-left: 12px; padding-right: 12px; }
  .license-content { padding: 22px 17px; }
  .license-brand small { font-size: 9px; }
  .hero-copy { padding: 18px 13px; }
  .console-hero { grid-template-columns: minmax(0, 1fr) 94px; }
  .console-hero .hero-visual img { width: 88px; }
  .console-hero h2 { font-size: 23px; }
}

@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .btn, .auth-tab, .mode-tab, .row-menu-item, .theme-item { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .auth-hero { display: none !important; }
}
