/* ==========================================================
   二波雷達 — 視覺系統
   設計基準：F:\Calude動畫\交易準則\first-principles-trading-ui.html
   （Nothing 風：暖紙底 + 白卡 + 點陣紋 + 等寬大寫標籤 + 藥丸控件）
   字級鐵律：最小 11px（來自參考檔實測字級分布）
   ========================================================== */

:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-raised: #efede7;
  --border: #dfdcd4;
  --border-visible: #bfb9ad;
  --text-display: #000000;
  --text-primary: #171717;
  --text-secondary: #62605b;
  --text-disabled: #98948b;
  --accent: #d71921;
  --success: #4a9e5c;
  --warning: #d4a843;
  --interactive: #007aff;

  --ease: cubic-bezier(.25, .1, .25, 1);
  --font-ui: "Space Grotesk", "DM Sans", system-ui, -apple-system, "Noto Sans TC", sans-serif;
  --font-mono: "Space Mono", "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --font-display: "Doto", "Space Mono", monospace;

  /* 狀態色 */
  --st-on: #4a9e5c;
  --st-off: #98948b;
  --st-warn: #d4a843;
  --st-danger: #e07b39;
  --st-critical: #d71921;
  --st-nodata: #bfb9ad;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 點陣底紋（參考檔特徵） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, .055) 1px, transparent 1px);
  background-size: 22px 22px;
}

.wrap { position: relative; z-index: 1; }

/* ---------- 版面 ---------- */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
  align-items: start;
}

/* ---------- 側欄 ---------- */
.sidebar {
  position: sticky;
  top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
}

.brand-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.brand {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-display);
  line-height: 1.05;
  margin-bottom: 18px;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
}
.kv .k { color: var(--text-secondary); text-transform: uppercase; }
.kv .v { color: var(--text-primary); font-weight: 700; }

.navlist { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.navbtn {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-visible);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.navbtn:hover { background: var(--surface-raised); transform: translateX(2px); }
.navbtn.active {
  background: var(--text-display);
  color: #fff;
  border-color: var(--text-display);
}

.side-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-disabled);
}

/* ---------- 主區 ---------- */
.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  /* 窄屏（320px）保護：卡片內若有寬內容（表格、長標題），
     預設 min-width:auto 會讓卡片被撐破、整頁橫向溢出。
     實測 m320 因回測對比表溢出 25px —— 這兩行是根治，
     不是靠個別元素補 overflow。 */
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;           /* 窄屏允許換行，別硬撐 */
}
/* 實測 320px 時「② 見頂／逃命側（ESCAPE）」會溢出 4px：
   letter-spacing 在 CJK 全形括號上會累積寬度。窄屏收斂間距並允許斷行。 */
.card-label > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .card-label { letter-spacing: .02em; gap: 6px; }
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0 0 4px;
  color: var(--text-display);
}

.card-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }

/* ---------- 頂部狀態列 ---------- */
.statusbar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.verdict-card { display: flex; flex-direction: column; justify-content: center; }

.verdict-value {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
  color: var(--text-display);
}
.verdict-desc { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

.score-ring {
  display: flex;
  align-items: baseline;
  gap: 6px;
  /* 不用 Doto 點陣字：實測單一數字（如「4」）在點陣下幾乎看不出是什麼，
     這格是關鍵數字，可讀性優先於風格。 */
  font-family: var(--font-mono);
}
.score-num { font-size: 46px; font-weight: 700; line-height: 1; }
.score-den { font-size: 20px; color: var(--text-secondary); }

/* 狀態色套用 */
.lv-ok    { color: var(--st-on); }
.lv-warn  { color: var(--st-warn); }
.lv-danger{ color: var(--st-danger); }
.lv-critical { color: var(--st-critical); }
.lv-nodata{ color: var(--st-nodata); }

.bg-ok    { background: var(--st-on); }
.bg-warn  { background: var(--st-warn); }
.bg-danger{ background: var(--st-danger); }
.bg-critical { background: var(--st-critical); }
.bg-nodata{ background: var(--st-nodata); }

/* ---------- 階段仲裁（最上面那張，先給結論） ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-left-width: 6px;
  padding: 18px 20px;
}
.stage-ok { border-left-color: var(--st-on); }
.stage-warn { border-left-color: var(--st-warn); }
.stage-danger { border-left-color: var(--st-danger); }
.stage-critical { border-left-color: var(--st-critical); }
.stage-nodata { border-left-color: var(--st-nodata); }

.stage-name {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
  margin: 4px 0 6px;
}
.stage-desc { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }

.stage-right {
  border-left: 1px solid var(--border);
  padding-left: 18px;
  min-width: 0;
}
.stage-action {
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 10px;
}
.stage-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-parts .part {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border-visible);
  color: var(--text-secondary);
}
.stage-parts .part b { color: var(--text-primary); }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; gap: 12px; }
  .stage-right { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 12px; }
}

/* ---------- 兩套判定對照 ---------- */
.te-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.te-col {
  border: 1px solid var(--border-visible);
  border-radius: 12px;
  padding: 14px 15px;
  border-top-width: 3px;
  min-width: 0;
}
.te-in { border-top-color: var(--st-on); background: linear-gradient(180deg, rgba(74,158,92,.05), transparent 55%); }
.te-out { border-top-color: var(--st-danger); background: linear-gradient(180deg, rgba(224,123,57,.05), transparent 55%); }

.te-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.te-q { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.te-src { font-size: 12px; line-height: 1.65; color: var(--text-secondary); }
.te-rule {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  font-weight: 700;
}

.te-vs {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-disabled);
  letter-spacing: .04em;
  padding: 0 2px;
  white-space: nowrap;
}

.te-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .te-grid { grid-template-columns: 1fr; }
  .te-vs { padding: 2px 0; }
}

/* ---------- 開關格 ---------- */
.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.switch {
  border: 1px solid var(--border-visible);
  border-radius: 12px;
  padding: 14px 15px;
  background: var(--surface);
  position: relative;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.switch:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .06); transform: translateY(-1px); }
.switch.is-master { border-width: 2px; border-color: var(--text-display); }
.switch.is-on   { background: linear-gradient(180deg, rgba(74,158,92,.07), transparent 60%); }
.switch.is-nodata { background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(0,0,0,.02) 8px, rgba(0,0,0,.02) 16px); }

.switch-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.switch-no {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  flex: none;
}

.switch-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.dot {
  width: 11px; height: 11px;
  border-radius: 999px;
  flex: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--text-display);
  color: #fff;
}

.switch-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 2px 0 6px;
}

.switch-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.switch-meta .thr {
  font-family: var(--font-mono);
  color: var(--text-disabled);
}

.evidence {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.src-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-disabled);
  letter-spacing: .04em;
}

/* 資料新鮮度小字：讓使用者一眼知道這個數字的精度與延遲 */
.fresh {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-raised);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.fresh b { color: var(--text-primary); }
.fresh-warn {
  background: rgba(212, 168, 67, .14);
  color: #7a5f1c;
}
.fresh-warn b { color: #7a5f1c; }

/* ---------- 燃料儀表 ---------- */
.fuel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.gauge {
  border: 1px solid var(--border-visible);
  border-radius: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border-left-width: 4px;
}
.gauge.g-ok { border-left-color: var(--st-on); }
.gauge.g-warn { border-left-color: var(--st-warn); }
.gauge.g-danger { border-left-color: var(--st-danger); }
.gauge.g-critical { border-left-color: var(--st-critical); }
.gauge.g-nodata { border-left-color: var(--st-nodata); }

.gauge-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.gauge-value {
  /* 用等寬而非 Doto 點陣：數字（-3 bp / 2.99 T / +1.45%）必須一眼可讀，
     點陣字在小數字上辨識度太差。風格保留在標題與品牌字。 */
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--text-display);
}

.gauge-level {
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.gauge-evidence {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.55;
}

.gauge-video {
  font-size: 11px;
  color: var(--text-disabled);
  margin-top: 5px;
  font-style: italic;
}

/* ---------- 逃生階梯 ---------- */
.escape-list { display: flex; flex-direction: column; gap: 10px; }

.phase {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.phase.is-hot { border-color: var(--st-danger); background: linear-gradient(180deg, rgba(224,123,57,.06), transparent); }
.phase.is-top { border-color: var(--st-critical); border-width: 2px; }

.phase-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-secondary);
}
.phase-name { font-size: 15px; font-weight: 700; margin-top: 2px; }
.phase-headline {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.cond-list { display: flex; flex-wrap: wrap; gap: 7px; }
.cond {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-visible);
  color: var(--text-secondary);
  background: var(--surface-raised);
}
.cond.hit {
  background: var(--st-critical);
  border-color: var(--st-critical);
  color: #fff;
  font-weight: 700;
}

/* ---------- 存取鎖（公開站台：部分分頁需輸入通行碼）---------- */
/* 為什麼用 blur 而不是直接不渲染：使用者要求「看得到有東西、但看不清楚」，
   讓人知道還有內容可看。注意這是**呈現層**的遮蔽，DOM 仍在 ——
   真正敏感的資料不該放在這裡（本專案這幾頁都是公開 API 算出來的，不含機密）。 */
.locked-wrap { position: relative; }

.locked-wrap > .panel-inner {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
  transition: filter .35s var(--ease);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(40px, 12vh, 140px);
  /* 半透明底：既讓下方模糊內容透出質感，又確保輸入框可讀 */
  background: linear-gradient(180deg, rgba(244,242,236,.55), rgba(244,242,236,.82));
}

.lock-box {
  background: var(--surface);
  border: 1px solid var(--border-visible);
  border-radius: 16px;
  padding: 22px 24px;
  width: min(340px, calc(100% - 32px));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .10);
  text-align: center;
}

/* 刻意不給任何提示文字（使用者要求：避免爬蟲／機器人猜到）。
   只有一個輸入框與一顆按鈕，知道的人才進得去。 */
.lock-box .lock-input {
  width: 100%;
  border: 1px solid var(--border-visible);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
  letter-spacing: .12em;
  background: var(--surface-raised);
  color: var(--text-primary);
}
.lock-box .lock-input:focus {
  outline: none;
  border-color: var(--text-display);
}
.lock-box .lock-btn {
  margin-top: 10px;
  width: 100%;
  appearance: none;
  border: 1px solid var(--text-display);
  background: var(--text-display);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lock-box .lock-btn:hover { opacity: .86; }

/* 錯誤時的輕微搖晃：不給文字提示，用動作回饋「不對」 */
.lock-box.shake { animation: lockShake .34s var(--ease); }
@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- 圖表 ---------- */
.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg { display: block; max-width: 100%; height: auto; }

/* 價格疊圖切換列：小按鈕 + 說明小字。
   用 flex-wrap 讓窄屏（320px）時說明字自動換行，不會把卡片撐破。 */
.overlay-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 8px 0 4px;
  min-width: 0;
}
.overlay-bar > .tiny { min-width: 0; flex: 1 1 200px; line-height: 1.55; }

.btn-mini {
  appearance: none;
  border: 1px solid var(--border-visible);
  background: transparent;
  color: var(--text-primary);
  border-radius: 999px;
  padding: 5px 13px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn-mini:hover { border-color: var(--text-display); }
/* 開啟狀態用價格線的同一個橘色，讓「按鈕亮著」與「圖上那條線」對得起來 */
.btn-mini.on {
  background: #c0562e;
  border-color: #c0562e;
  color: #fff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.legend i {
  display: inline-block;
  width: 14px; height: 3px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tab {
  appearance: none;
  border: 1px solid var(--border-visible);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  transition: all .18s var(--ease);
}
.tab:hover { background: var(--surface-raised); }
.tab.active { background: var(--text-display); color: #fff; border-color: var(--text-display); }

.panel { display: none; }
.panel.active { display: block; }

/* ---------- 表格 ---------- */
.tbl-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 400;
}
td.num { font-family: var(--font-mono); text-align: right; }
tbody tr:hover { background: var(--surface-raised); }

/* ---------- 警報 ---------- */
.alert-banner {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-weight: 700;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215, 25, 33, .35); }
  50% { box-shadow: 0 0 0 12px rgba(215, 25, 33, 0); }
}
.alert-banner .big {
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;   /* 標題不要斷成三行 */
  flex: none;
}
.alert-banner > span:not(.big) { min-width: 0; font-weight: 500; }

@media (max-width: 700px) {
  .alert-banner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .alert-banner .big { font-size: 19px; white-space: normal; }
}

.btn {
  appearance: none;
  border: 1px solid var(--text-display);
  background: var(--text-display);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .18s var(--ease);
}
.btn:hover { opacity: .84; }
.btn.ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-visible);
}

.input {
  border: 1px solid var(--border-visible);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  min-width: 0;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.muted { color: var(--text-secondary); }
.tiny { font-size: 11px; }

/* ---------- RWD ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .statusbar { grid-template-columns: 1fr; }
  .phase { grid-template-columns: 1fr; gap: 9px; }

  /* 手機：側欄的導覽清單會吃掉整個首屏，資料被推到看不見。
     改成只留品牌 + 兩個關鍵數字，導覽交給上方的 tabs（本來就有）。 */
  .sidebar .navlist { display: none; }
  .sidebar .side-note { display: none; }
  .sidebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 14px;
    padding: 12px 14px;
  }
  .brand-label { grid-column: 1; grid-row: 1; margin: 0; font-size: 10px; }
  .brand { grid-column: 1; grid-row: 2; margin: 0; font-size: 24px; }
  .sidebar .kv {
    grid-column: 2;
    padding: 4px 0;
    border-bottom: none;
    justify-content: flex-end;
    gap: 10px;
  }
  .sidebar .kv:nth-of-type(1) { grid-row: 1; }
  .sidebar .kv:nth-of-type(2) { grid-row: 2; }
}
@media (max-width: 560px) {
  .app { padding: 12px; gap: 12px; }
  .card { padding: 15px 14px; }
  .switch-grid { grid-template-columns: 1fr; }
}
