:root {
  --bg: #0b0d12;
  --panel: #11151d;
  --panel-2: #151b25;
  --text: #e8edf5;
  --muted: #8b98aa;
  --accent: #5cc8ff;
  --line: #263142;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overscroll-behavior-y: auto; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
}
button, input, select { font: inherit; }
.sidebar-toggle {
  width: 30px; height: 30px; flex: none;
  color: var(--text); background: #1a2330; border: 1px solid #304158;
  border-radius: 6px; cursor: pointer; font-size: 15px;
}
.sidebar-toggle:hover { border-color: var(--accent); }
.layout.sidebar-folded .sidebar { display: none; }
.layout.sidebar-folded .sidebar-resizer { display: none; }
.sidebar-resizer {
  width: 1px; flex: none; position: relative; cursor: col-resize;
  background: var(--line); border: 0;
}
.sidebar-resizer::before {
  content: ""; position: absolute; inset: 0 -5px; cursor: col-resize;
}
.sidebar-resizer:hover, .sidebar-resizer:focus, .layout.resizing .sidebar-resizer {
  background: rgba(92, 200, 255, .28); outline: none;
}
.layout.resizing { cursor: col-resize; user-select: none; }
.layout-opt {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 11px; white-space: nowrap;
}
.layout-opt input { accent-color: var(--accent); }
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, #151b25, #0f141c);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.brand span { color: var(--accent); }
#search {
  flex: 1;
  max-width: 620px;
  height: 32px;
  padding: 0 12px;
  color: var(--text);
  background: #090c12;
  border: 1px solid #2c394d;
  border-radius: 7px;
  outline: none;
}
#search:focus { border-color: var(--accent); }
.layout { display: flex; height: calc(100% - 52px); min-height: 0; }
.sidebar-backdrop { display: none; }
.sidebar {
  width: 330px;
  min-width: 220px;
  max-width: 70vw;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 0;
}
.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--line);
}
.badge-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  color: #b9c9da; background: #0d141b; border: 1px solid #253a4b;
  border-radius: 5px; padding: 3px 7px; font: inherit; font-size: 11px;
  font-weight: 700; text-transform: none; letter-spacing: 0;
  cursor: pointer; white-space: nowrap;
}
.badge-toggle:hover { color: #e7f1fb; background: #121d28; border-color: #35556d; }
.badge-toggle input {
  appearance: none; -webkit-appearance: none;
  width: 13px; height: 13px; margin: 0; border: 1px solid #35536a;
  border-radius: 3px; background: #0a1016; display: inline-grid;
  place-content: center; cursor: pointer;
}
.badge-toggle input::before {
  content: ""; width: 6px; height: 3px; border-left: 2px solid #7fa8c2;
  border-bottom: 2px solid #7fa8c2; transform: rotate(-45deg) translate(0, -1px);
  opacity: 0;
}
.badge-toggle input:checked::before { opacity: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); }
.filter-btn {
  color: var(--muted); background: #131a25; border: 1px solid #26364b;
  border-radius: 5px; padding: 3px 6px; font-size: 10px; cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { color: #00141f; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.chart-list { overflow-y: auto; padding: 6px; }
.chart-more { padding: 12px 8px; text-align: center; color: var(--muted); font-size: 11px; cursor: pointer; }
.chart-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin: 2px 0;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}
.chart-item:hover { background: #1b2330; }
.chart-item.active { background: #17283a; border-color: #2d5b7a; }
.chart-level {
  width: 34px; flex: none; display: flex; align-items: center; justify-content: center;
  color: #d7dee8; font-weight: 750; font-variant-numeric: tabular-nums;
  font-size: 16px; line-height: 1; text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22), 0 -1px 0 rgba(0, 0, 0, .45);
}
.chart-level.course { color: #f0b35a; }
.chart-level.unknown { color: #59616d; font-weight: 600; opacity: .75; }
.chart-level.cv2 { color: #c9a0ff; }
.chart-body { flex: 1; min-width: 0; }
.chart-item .file { display: flex; align-items: baseline; gap: 4px; font-weight: 650; overflow: hidden; white-space: nowrap; }
.chart-item .file-name { overflow: hidden; text-overflow: ellipsis; }
.file-diff { color: var(--accent); font-size: 11px; font-weight: 600; flex: none; }
.chart-item .sub { color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  color: #7dd3fc;
  background: #0b2a3a;
  border: 1px solid #2b6f8f;
  border-radius: 4px;
  font-size: 10px;
  text-align: center;
}
.badge-tier {
  font-family: "DejaVu Sans", "Segoe UI", sans-serif;
  font-variant-east-asian: proportional-width;
}
.badge.dummy { color: #c9ced8; background: #252b34; border-color: #4d5664; }
.badge.duplicate { color: #ffd54a; background: #332b0a; border-color: #7a6519; }
.badge.audience { color: #d8b4fe; background: #2b1b3d; border-color: #6b4a8f; }
.badge.narrow { color: #fde047; background: #3a3008; border-color: #8a6a12; }
.badge.wide { color: #7dd3fc; background: #0b2a3a; border-color: #2b6f8f; }
.badge.recovery { color: #8ff0b0; background: #12301f; border-color: #2f6b45; }
.badge.risk { color: #ff9a9a; background: #3a1515; border-color: #8a2f2f; }
.badge.recovery.down { color: #a5b4fc; background: #1e1b4b; border-color: #4f46e5; }
.badge.risk.down { color: #cbd5e1; background: #23262b; border-color: #4a5058; }
.badge.cool_damage, .badge.good_damage { color: #ff7b7b; background: #1c0707; border-color: #6b1f1f; }
.meta-level.course-level { color: #f0b35a; font-style: italic; border-bottom: 1px dashed #a77635; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.title-row { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.arrange-display {
  flex: none; align-self: center;
  color: #8fa3b8; font: 10px/1.2 ui-monospace, monospace;
  letter-spacing: .08em; white-space: nowrap; opacity: .85;
  user-select: all;
}
.chart-head h1 { margin: 0; font-size: 20px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-level {
  flex: none; width: 40px; margin-right: 12px; font-size: 21px; line-height: 1.05;
  font-weight: 800; text-align: center; color: #dbe2eb;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22), 0 -1px 0 rgba(0, 0, 0, .45);
}
.title-level.course { color: #f0b35a; }
.title-level.unknown { color: #59616d; font-weight: 700; opacity: .75; }
.title-level.cv2 { color: #c9a0ff; }
.head-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.meta { color: var(--muted); font-size: 12px; margin-top: 1px; display: flex; flex-wrap: wrap; gap: 10px; }
.meta b { color: #cfe8ff; font-weight: 600; }
.controls { display: flex; align-items: center; gap: 6px; flex: none; }
.mobile-actions { display: none; }
.controls button {
  width: 30px; height: 30px;
  color: var(--text); background: #1a2330; border: 1px solid #304158;
  border-radius: 6px; cursor: pointer;
}
.controls button:hover { border-color: var(--accent); }
#zoom-label { width: 48px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.controls select {
  height: 30px; color: var(--text); background: #1a2330;
  border: 1px solid #304158; border-radius: 6px; padding: 0 8px;
}
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted);
}
.empty strong { color: #c8d6e8; font-size: 18px; }
.empty-hint-mobile { display: none; }
.viewer { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 14px; }
#thumb {
  width: 100%;
  height: 48px;
  display: block;
  background: #070a0f;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.scroll { flex: 1; overflow: auto; overscroll-behavior: contain; background: #070a0f; border: 1px solid var(--line); border-radius: 6px; }
.measures { position: relative; min-width: 100%; min-height: 100%; }
.measure-canvas { position: absolute; display: block; }
.measure { position: relative; }
.scroll, #thumb { background: #000; }
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 8px; }
  .brand { font-size: 13px; }
  #search { min-width: 0; height: 30px; padding: 0 8px; }
  .layout { position: relative; display: block; }
  .sidebar {
    position: absolute; z-index: 30; inset: 0 auto 0 0;
    width: 100%; min-width: 0; max-width: 100%;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 18px 0 45px rgba(0, 0, 0, .5);
    border-right: 1px solid #2d3e52;
  }
  .layout.sidebar-open .sidebar { transform: translateX(0); }
  
  .layout.sidebar-folded .sidebar { display: flex; }
  .layout.sidebar-folded .sidebar-resizer { display: none; }
  .sidebar-resizer { display: none; }
  .sidebar-backdrop {
    display: block;
    position: absolute; inset: 0; z-index: 20;
    background: rgba(0, 0, 0, .48);
  }
  .main { height: 100%; }
  .chart-head { flex-wrap: wrap; gap: 8px; padding: 8px 10px; min-height: 0; }
  .chart-title { flex: 1 1 100%; }
  .chart-head h1 { font-size: 16px; }
  .meta { font-size: 10.5px; gap: 5px; row-gap: 2px; line-height: 1.3; margin-top: 1px; }
  .meta span { white-space: nowrap; }
  .title-level { width: 32px; font-size: 18px; margin-right: 8px; }
  .controls { display: none; }
  .mobile-actions {
    position: fixed; right: 12px; bottom: calc(58px + env(safe-area-inset-bottom));
    z-index: 45; display: flex; align-items: center; gap: 6px; padding: 4px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
    background: rgba(8, 12, 18, .72);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
  }
  .mobile-actions button {
    width: 38px; height: 38px; padding: 0; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: #dce9f8; background: #182431; border: 1px solid #3d5f7d;
    border-radius: 50%; font-size: 12px; font-weight: 700; cursor: pointer;
  }
  .mobile-actions button[aria-pressed="true"] {
    color: #00141f; background: var(--accent); border-color: var(--accent);
  }
  #mobile-swap5 { font-size: 9px; letter-spacing: -.03em; }
  #mobile-mirror7 { font-size: 10px; }
  .viewer { padding: 6px 8px 8px; gap: 6px; }
  .filters { flex-wrap: wrap; overflow: visible; }
  .filter-btn { flex: none; font-size: 11px; padding: 5px 7px; }
  .side-head { padding: 8px 10px; }
  .chart-list { padding: 4px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .scroll { -webkit-overflow-scrolling: touch; }
  .chart-item { padding: 8px; }
  #thumb { height: 40px; }
  .empty-hint-desktop { display: none; }
  .empty-hint-mobile { display: inline; }
}

[hidden] { display: none !important; }

.legend-row { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.legend { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px; min-height: 18px; color: var(--muted); font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.legend-dot.dup { background: transparent !important; border: 1px solid #ffd54a; border-radius: 1px; }

.settings-toggle {
  width: 30px !important; height: 30px; padding: 0;
  color: var(--text); background: #1a2330; border: 1px solid #304158;
  border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.settings-toggle:hover { border-color: var(--accent); }
.settings-backdrop { position: fixed; inset: 0; background: transparent; z-index: 50; pointer-events: none; }
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 300px; z-index: 51;
  padding: 18px; background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0,0,0,.35);
}
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.settings-head strong { font-size: 16px; }
#settings-close { width: 28px; height: 28px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.setting-row { display: block; margin: 18px 0; color: var(--muted); }
.setting-row span { display: flex; justify-content: space-between; margin-bottom: 8px; }
.setting-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.setting-row input[type=range] { width: 100%; accent-color: var(--accent); }

.toast-container {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 10px 13px;
  color: #ffd9d9;
  background: #2a1418;
  border: 1px solid #8f3b46;
  border-left: 3px solid #ff6b7a;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.setting-block { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.setting-title { margin-bottom: 9px; color: var(--text); font-weight: 650; }
#arrange-input {
  width: 100%; height: 32px; padding: 0 8px;
  color: var(--text); background: #090c12; border: 1px solid #2c394d;
  border-radius: 6px; font-family: ui-monospace, monospace; letter-spacing: .08em;
}
#arrange-input:focus { outline: none; border-color: var(--accent); }
#arrange-input.bad { border-color: #ff6b7a; }
.arrange-error { min-height: 16px; margin-top: 5px; color: #ff9aa4; font-size: 11px; line-height: 1.4; }
.arrange-actions { display: flex; gap: 6px; margin-top: 8px; }
.arrange-actions button {
  flex: 1; height: 30px; color: var(--text); background: #1a2330;
  border: 1px solid #304158; border-radius: 6px; cursor: pointer;
}
.arrange-actions button:hover { border-color: var(--accent); }

.chart-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0; }
.title-block { flex: 0 1 auto; min-width: 0; margin-right: 30px; }
.info-toggle {
  width: 30px; height: 30px; flex: none;
  color: var(--text); background: #1a2330; border: 1px solid #304158;
  border-radius: 50%; cursor: pointer; font-weight: 700; font-family: Georgia, serif;
}
.info-toggle:hover { border-color: var(--accent); }
.info-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); }
.info-modal {
  position: fixed; z-index: 71; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px)); max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.info-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.info-head strong { font-size: 14px; }
#info-close {
  width: 28px; height: 28px; color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer;
}
.info-body { overflow: auto; padding: 8px 16px 18px; }
.ini-section { margin-top: 14px; }
.ini-section h3 { margin: 0 0 6px; color: var(--accent); font-size: 12px; letter-spacing: .05em; }
.ini-row {
  display: grid; grid-template-columns: minmax(140px, 42%) 1fr;
  gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 12px;
}
.ini-key { color: var(--muted); }
.ini-val { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.ini-empty { padding: 18px 0; color: var(--muted); }
.ini-raw { white-space: pre-wrap; color: var(--text); font: 12px/1.5 ui-monospace, monospace; }


body.cv2 {
  --bg: #120b1c;
  --panel: #1a1029;
  --panel-2: #211433;
  --text: #f0e8ff;
  --muted: #b39bcb;
  --line: #3d2a58;
  --accent: #c9a0ff;
}
body.cv2 .topbar {
  background: linear-gradient(180deg, #251438, #170d24);
  border-bottom-color: #4a2f68;
}
body.cv2 .sidebar { background: #170e24; border-right-color: #4a2f68; }
body.cv2 .side-head, body.cv2 .filters { border-bottom-color: #3d2a58; }
body.cv2 .chart-head { background: #1a1029; border-bottom-color: #4a2f68; }
body.cv2 #search,
body.cv2 #arrange-input {
  color: #f0e8ff; background: #0d0715; border-color: #4a2f68;
}
body.cv2 .filter-btn,
body.cv2 .controls button,
body.cv2 .controls select,
body.cv2 .sidebar-toggle,
body.cv2 .settings-toggle,
body.cv2 .info-toggle,
body.cv2 .arrange-actions button,
body.cv2 #settings-close,
body.cv2 #info-close {
  color: #e9d9ff; background: #241536; border-color: #4a2f68;
}
body.cv2 .filter-btn.active {
  color: #160b22; background: #c9a0ff; border-color: #c9a0ff;
}
body.cv2 .badge-toggle {
  color: #d9c8ec; background: #21142e; border-color: #4f3568;
}
body.cv2 .badge-toggle:hover { color: #f0e4ff; background: #2a1a3a; border-color: #6a4a8f; }
body.cv2 .badge-toggle input { border-color: #5d447c; }
body.cv2 .badge-toggle input::before { border-color: #b79ad6; }
body.cv2 .chart-item:hover { background: #241536; }
body.cv2 .chart-item.active { background: #2c1743; border-color: #6b47a0; }
body.cv2 .badge {
  color: #e4ccff; background: #2a163d; border-color: #5b3b82;
}

body.cv2 .badge.narrow { color: #fde047; background: #3a3008; border-color: #8a6a12; }
body.cv2 .badge.wide { color: #7dd3fc; background: #0b2a3a; border-color: #2b6f8f; }
body.cv2 .badge.recovery { color: #8ff0b0; background: #12301f; border-color: #2f6b45; }
body.cv2 .badge.recovery.down { color: #a5b4fc; background: #1e1b4b; border-color: #4f46e5; }
body.cv2 .badge.risk { color: #ff9a9a; background: #3a1515; border-color: #8a2f2f; }
body.cv2 .badge.risk.down { color: #cbd5e1; background: #23262b; border-color: #4a5058; }
body.cv2 .badge.cool_damage, body.cv2 .badge.good_damage { color: #ff7b7b; background: #1c0707; border-color: #6b1f1f; }
.badge.cool_damage, .badge.good_damage { color: #ff7b7b; background: #1c0707; border-color: #6b1f1f; }
body.cv2 .badge-tier {
  font-family: "DejaVu Sans", "Segoe UI", sans-serif;
  font-variant-east-asian: proportional-width;
}
.badge.dummy {
  color: #d0d0d4; background: #2a2a2e; border-color: #5a5a62;
}
body.cv2 .badge.duplicate {
  color: #ffd54a; background: #332b0a; border-color: #7a6519;
}
body.cv2 .settings-panel, body.cv2 .info-modal { border-color: #4a2f68; }
body.cv2 .settings-backdrop, body.cv2 .info-backdrop { background: rgba(18, 7, 28, .62); }
body.cv2 .legend { color: #b39bcb; }

body.cv2 .viewer, body.cv2 .scroll, body.cv2 #thumb, body.cv2 .measures {
  background: #000;
}
body.cv2 .scroll, body.cv2 #thumb { border-color: #263142; }

.info-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.info-tab {
  height: 26px; padding: 0 10px; color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 11px;
}
.info-tab:hover { color: var(--text); border-color: var(--line); }
.info-tab.active { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.info-pane { min-height: 80px; }
.ez-section { margin-top: 14px; }
.ez-section h3 { margin: 0 0 6px; color: var(--accent); font-size: 12px; letter-spacing: .05em; }
.ez-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 12px;
  padding: 5px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  font-size: 12px;
}
.ez-key { color: var(--muted); font-family: ui-monospace, monospace; }
.ez-val { color: var(--text); font-family: ui-monospace, monospace; overflow-wrap: anywhere; }


.info-heading { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#info-title { font-size: 14px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.info-tab {
  height: 27px; padding: 0 11px; color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 11px;
}
.info-tab:hover { color: var(--text); border-color: var(--line); }
.info-tab.active { color: var(--accent); background: #0d121a; border-color: var(--accent); font-weight: 650; }
.info-body { padding: 4px 16px 18px; }
.ez-row {
  display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 12px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.055); font-size: 12px;
}
.ez-key { color: var(--muted); }
.ez-val { color: var(--text); white-space: pre-wrap; word-break: break-word; }
body.cv2 .info-tab.active { background: #241536; }


@media (max-width: 760px) {
  .settings-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none; max-height: 38vh; overflow-y: auto;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    background: var(--panel);
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .5);
    display: flex; flex-wrap: wrap; column-gap: 8px;
  }
  body.cv2 .settings-panel { background: #170e24; }
  .settings-head { flex: 0 0 100%; }
  .setting-block { flex: 0 0 100%; }
  .settings-backdrop { background: transparent; }
  .settings-head { margin-bottom: 7px; }
  .settings-head strong { font-size: 14px; }
  .setting-row {
    display: block; flex: 1 1 calc(50% - 4px);
    width: auto; margin: 2px 0;
  }
  .setting-row span { margin-bottom: 3px; font-size: 11px; }
  .setting-row input[type=range] { height: 16px; }
  .setting-block { margin-top: 7px; padding-top: 7px; }
  .setting-title { margin-bottom: 4px; font-size: 12px; }
  #arrange-input { height: 29px; }
  .arrange-error { min-height: 0; margin-top: 2px; }
  .arrange-actions { margin-top: 4px; margin-bottom: 8px; }
  .arrange-actions button { height: 29px; }
}

@media (max-width: 760px) {
  .legend-row { flex-wrap: wrap; align-items: center; gap: 1px 0; min-height: 0; }
  .legend {
    flex: 1 1 auto; min-height: 0; gap: 3px 7px;
    font-size: 10px; line-height: 1.1;
  }
  .legend-item { line-height: 1.1; }
  .legend-stacked .legend { flex: 1 1 100%; }
  .arrange-display { margin-left: auto; }
  .legend-stacked .arrange-display {
    flex: 0 0 100%; text-align: right; margin-top: 1px;
  }
}
