/* Cat's Eye — styled after EVE Online's own windows: near-black translucent panels, hairline
   borders, square corners, uppercase header strips, cyan highlight. One dark theme on purpose. */
:root {
  --bg: #05070a;
  --bg2: #0a0e12;
  --win: rgba(13, 17, 21, 0.96);
  --win-head: #121a20;
  --panel2: #161e25;
  --line: #24303a;
  --line2: #34444f;
  --text: #d5dde2;
  --muted: #8d9aa3;
  --dim: #5f6c75;
  --accent: #4fb8d4;
  --accent-dim: rgba(79, 184, 212, 0.16);
  --amber: #e3a23b;
  --good: #5fca86;
  --bad: #ff6b6b;
  --turnur: #2fd1c1;
  --thera: #e45fc8;
  --poch: #ff4d5e;
  --camp: #f0932b;
  --radius: 2px;
  --ui: "Saira Semi Condensed", "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --num: "Saira Semi Condensed", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--ui); -webkit-text-size-adjust: 100%; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "bar bar" "stage side";
}

/* top bar: like the Neocom strip — dark, hairline below, uppercase labels */
.bar {
  grid-area: bar;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding-block: 8px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, #0f151a, #0a0e12);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 rgba(79, 184, 212, 0.08);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 40px; height: 21px; display: block; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-sub { color: var(--dim); font-size: 12px; letter-spacing: 0.04em; }
.search { position: relative; flex: 1 1 180px; min-width: 0; max-width: 300px; }
.search input { width: 100%; padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--line2); background: #070a0d; }
.search input::placeholder { color: var(--dim); }
.suggest {
  position: absolute; z-index: 20; top: calc(100% + 2px); left: 0; right: 0;
  margin: 0; padding: 2px; list-style: none;
  background: var(--win); border: 1px solid var(--line2); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
.suggest li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-dim); }
.suggest .s-where { color: var(--muted); font-size: 12px; white-space: nowrap; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-width: 0; }
.modes, .layers { display: flex; gap: 0; border: 1px solid var(--line); background: #070a0d; }
.mode, .layer {
  border: 0; border-right: 1px solid var(--line); background: transparent; padding: 5px 10px;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.mode:last-child, .layer:last-child { border-right: 0; }
.mode:hover, .layer:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.mode[aria-checked="true"] { color: #e9f6fa; background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }
.layer { display: inline-flex; align-items: center; gap: 6px; }
.layer .dot { width: 8px; height: 8px; border: 1px solid currentColor; }
.layer .dot.turnur { color: var(--turnur); }
.layer .dot.thera { color: var(--thera); }
.layer .dot.poch { color: var(--poch); }
.layer .dot.camp { color: var(--camp); }
.layer[aria-pressed="true"] { color: #e9f6fa; background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }
.layer[aria-pressed="true"] .dot { background: currentColor; box-shadow: 0 0 6px currentColor; }
.layer[aria-pressed="false"] { opacity: 0.75; }
.layer .layer-n { min-width: 16px; padding: 0 4px; border-radius: 8px; background: #ff3b30; color: #fff; font-size: 10px; font-weight: 800; line-height: 15px; text-align: center; }
.hour-sel, .lang { width: auto; padding: 4px 6px; font-size: 12px; border: 1px solid var(--line2); background: #070a0d; border-radius: var(--radius); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.refresh { display: flex; align-items: center; gap: 8px; }
.refresh button {
  border: 1px solid var(--accent); background: var(--accent-dim); color: #e9f6fa;
  padding: 4px 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.refresh button:disabled { opacity: 0.55; cursor: progress; }
.refresh-status { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* map */
.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(1100px 700px at 50% 40%, rgba(40, 70, 90, 0.18), transparent 65%), var(--bg); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#map.dragging { cursor: grabbing; }
.zoom { position: absolute; top: 10px; left: max(10px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 4px; }
.zoom button { min-width: 36px; height: 30px; border: 1px solid var(--line2); background: rgba(10, 14, 18, 0.9); font-size: 14px; color: var(--muted); border-radius: var(--radius); }
.zoom button:hover { color: var(--text); border-color: var(--accent); }
.hint { position: absolute; left: 10px; bottom: 8px; margin: 0; padding: 2px 8px; background: rgba(5, 7, 10, 0.8); border: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: 0.03em; pointer-events: none; }
.ctx {
  position: absolute; z-index: 15; min-width: 220px;
  display: flex; flex-direction: column; padding: 0 0 4px;
  background: var(--win); border: 1px solid var(--line2); border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
}
.ctx-title { padding: 6px 10px; font-weight: 600; background: var(--win-head); border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx-title span:not(.sec-badge) { color: var(--muted); font-weight: 400; font-size: 12px; }
.ctx > button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent; padding: 6px 10px; font-size: 13px; }
.ctx > button:hover, .ctx > button:focus-visible { background: var(--accent-dim); outline: none; }
.ctx-bm { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-block: 1px solid var(--line); margin-block: 4px; }
.ctx-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.swatch { width: 18px; height: 18px; border: 1px solid rgba(0, 0, 0, 0.6); padding: 0; border-radius: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 1px; }
.swatch-off { border: 1px solid var(--line2); background: transparent; padding: 0 8px; height: 20px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* side panel: stacked EVE-style windows */
.side {
  grid-area: side; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-block: 10px 16px; padding-left: 10px;
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  background: #07090c; border-left: 1px solid var(--line);
}
.sheet-toggle { display: none; }
details.card { background: var(--win); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
details.card > summary {
  list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer; user-select: none;
  background: var(--win-head); border-bottom: 1px solid transparent;
  box-shadow: inset 2px 0 0 var(--accent);
}
details.card[open] > summary { border-bottom-color: var(--line); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: ""; flex: none; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); transform: rotate(-90deg); transition: transform 0.12s; }
details.card[open] > summary::after { transform: none; }
details.card > summary:hover { background: #162028; }
.card-title { font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; min-width: 0; flex: none; color: #e4ecf0; }
#infoCard .card-title { text-transform: none; letter-spacing: 0.01em; font-size: 14px; }
.card-sum { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.card-body h3 { margin: 4px 0 0; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-body h3 span { color: var(--dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.note { margin: 0; color: var(--dim); font-size: 12px; }
.error { color: var(--bad); }

.ends { display: flex; flex-direction: column; gap: 5px; }
.end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.end-tag { flex: none; font-size: 11px; font-weight: 700; padding: 0 6px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid currentColor; }
.end-tag.start { color: var(--good); }
.end-tag.goal { color: var(--bad); }
.end-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-name.empty { color: var(--dim); }
.end-actions, .actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.end-actions button, .actions button, .copy {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line2); background: #0b1014; padding: 3px 9px; font-size: 12px; border-radius: var(--radius);
}
.end-actions button:hover, .actions button:hover, .copy:hover { border-color: var(--accent); color: #e9f6fa; }
.actions button.on { border-color: var(--amber); color: var(--amber); }
.actions button.on-bad { border-color: var(--bad); color: var(--bad); }
.actions .end-tag { padding: 0 4px; }
.gate-range { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.gate-range select { width: auto; padding: 2px 4px; }
.nums { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.nums dt { color: var(--muted); }
.nums dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.nums dd b { font-weight: 600; color: #eef4f7; }
.nums dd.howto { grid-column: 1 / -1; text-align: left; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text) !important; font-size: 13px !important; }
.check input { accent-color: var(--accent); }
.route-check { display: inline-flex; gap: 6px; white-space: nowrap; }
.route-check .dot { width: 8px; height: 8px; }
.avoid { display: flex; flex-direction: column; gap: 4px; }
.avoid-head { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.avoid-head span { color: var(--bad); }
.avoid-list { display: flex; flex-wrap: wrap; gap: 4px; }
.avoid-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 6px; border: 1px solid rgba(255, 107, 107, 0.45); font-size: 12px; }
.ship { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.ship label, .wh-opts label { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.ship label:not(:first-child) { margin-top: 4px; }
select { width: 100%; min-width: 0; padding: 4px 6px; border-radius: var(--radius); border: 1px solid var(--line2); background: #070a0d; }
.range { margin: 0; color: var(--muted); font-size: 12px; }
.range b { color: var(--amber); }
.hops { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.hops li::marker { color: var(--dim); }
.hops .ly { color: var(--dim); font-size: 12px; }
.link { all: unset; cursor: pointer; color: #cfe8f0; border-bottom: 1px dotted var(--dim); }
.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.info-where { color: var(--muted); font-size: 12px; }
.info-en { color: var(--text); }
.sec-badge { display: inline-block; font-weight: 700; font-size: 12px; padding: 0 4px; border: 1px solid currentColor; line-height: 1.4; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 0 6px; font-size: 11px; border: 1px solid var(--line2); color: var(--muted); letter-spacing: 0.04em; }
.sw-inline { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }
.bm-row { display: flex; flex-direction: column; gap: 6px; padding: 7px 8px; border: 1px solid var(--line); background: #080b0e; }
.bm-row .bm-head { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.bm-row input { width: 100%; padding: 4px 8px; border: 1px solid var(--line2); background: #070a0d; font-size: 13px; border-radius: var(--radius); }
.kill-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kill-table th { color: var(--muted); font-weight: 500; text-align: left; padding: 2px 0; }
.kill-table thead th { border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.kill-table td { font-variant-numeric: tabular-nums; text-align: right; padding: 2px 0 2px 10px; }
.kill-table thead th:not(:first-child) { text-align: right; }
.poch-groups { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.7; }
.poch-reg { display: inline-block; margin-right: 8px; padding: 0 5px; border: 1px solid rgba(255, 77, 94, 0.5); color: #ff9aa5; font-weight: 600; }

.bm-list, .wh-list, .camp-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px; }
.bm-list li { display: flex; align-items: center; gap: 8px; padding: 4px 4px; min-width: 0; border-bottom: 1px solid rgba(36, 48, 58, 0.6); }
.bm-list li:hover { background: rgba(79, 184, 212, 0.05); }
.bm-dot { width: 9px; height: 9px; flex: none; }
.bm-name { flex: none; }
.bm-memo { color: var(--dim); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.bm-x { border: 0; background: transparent; color: var(--dim); padding: 0 4px; font-size: 14px; line-height: 1; }
.bm-x:hover { color: var(--bad); }

.wh-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.wh-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 3px 4px; font-size: 13px; border-bottom: 1px solid rgba(36, 48, 58, 0.6); }
.wh-list li > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-list .wh-meta, .wh-list .wh-size, .camp-list .wh-meta { color: var(--dim); font-size: 12px; }
.wh-list .wh-size { text-align: right; }
.wh-list li.small { opacity: 0.45; }
.wh-list.off, .wh-hub.off { opacity: 0.5; }
.jname { color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; }
.dist { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; font-size: 12px; }
.dist .bar { height: 5px; background: var(--poch); opacity: 0.75; }
.dist .v { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.traits { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.traits b { color: var(--text); font-weight: 600; }
.camp-list li { display: flex; flex-direction: column; gap: 1px; padding: 5px 4px; border-bottom: 1px solid rgba(36, 48, 58, 0.6); font-size: 13px; }
.camp-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.camp-meta span:last-child { text-align: right; }

.legend-rows { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend-row .sw { width: 11px; height: 11px; flex: none; }
.legend-row .sw.ring { box-shadow: 0 0 0 1px rgba(235, 240, 245, 0.85); }
.legend-row .sw.ring-only { background: transparent; border: 2px solid; border-radius: 50%; }
.legend-row .sw.diamond { background: transparent; border: 2px solid; transform: rotate(45deg) scale(0.8); }
.legend-row .sw.cross { width: 11px; height: 11px; line-height: 11px; text-align: center; font-weight: 700; }
.legend-row .ct { margin-left: auto; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.legend-row.more { color: var(--dim); }
.ramp { height: 10px; border: 1px solid var(--line); }
.ml-dots { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding-top: 4px; }
.ml-dots span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums; }
.ml-dots i { display: block; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 190, 180, 0.35); }
.top-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.top-list li { display: flex; gap: 6px; align-items: baseline; }
.top-list li::marker { color: var(--dim); }
.top-list .v { margin-left: auto; font-weight: 700; color: #ff8a7a; font-variant-numeric: tabular-nums; }
.map-legend {
  position: absolute; left: max(10px, env(safe-area-inset-left, 0px)); bottom: 36px; width: 230px;
  display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 9px;
  background: rgba(10, 14, 18, 0.92); border: 1px solid var(--line2); box-shadow: inset 2px 0 0 #e23b2e, 0 8px 24px rgba(0, 0, 0, 0.5);
}
.layer .dot.gatecamp { width: auto; height: auto; border: 0; background: none; color: rgba(255, 59, 48, 0.55); font-size: 10px; line-height: 1; }
.layer .dot.gatecamp::before { content: "\25B2"; }
.layer[data-layer="gatecamp"][aria-pressed="true"] { background: rgba(255, 59, 48, 0.14); box-shadow: inset 0 -2px 0 #ff3b30; }
.layer[aria-pressed="true"] .dot.gatecamp { background: none; box-shadow: none; color: #ff3b30; text-shadow: 0 0 6px rgba(255, 59, 48, 0.95), 0 0 2px #ff3b30; }
.sw.tri { background: #ff3b30; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gc-sum { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.gc-sum.bad { color: #ff6b5e; font-weight: 600; }
.gc-sum.ok { color: #3ecf8e; }
.gc-yours { display: inline-block; padding: 0 4px; border: 1px solid #ff6b5e; color: #ff6b5e; font-size: 10px; letter-spacing: 0.04em; }
.gc-line { font-size: 12px; color: var(--text); }
.gc-line.hot { color: #ff8a7a; font-weight: 600; }
.fresh { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; cursor: default; }
.fresh::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.fresh.live { color: #3ecf8e; border-color: rgba(62, 207, 142, 0.55); }
.fresh.live::before { box-shadow: 0 0 6px #3ecf8e; animation: fresh-pulse 2s ease-in-out infinite; }
.fresh.recent { color: #e3b341; border-color: rgba(227, 179, 65, 0.45); }
.fresh.old { color: #ff8a7a; border-color: rgba(255, 138, 122, 0.45); }
@keyframes fresh-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .fresh.live::before { animation: none; } }
details.coal { border-bottom: 1px solid var(--line); }
details.coal > summary { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; list-style: none; font-size: 13px; }
details.coal > summary::-webkit-details-marker { display: none; }
details.coal > summary .coal-name { font-weight: 600; color: #e9eef1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.coal > summary .ct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
details.coal > summary:hover .coal-name { color: var(--accent); }
.coal-body { display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px 18px; }
.coal-members { margin: 0; padding-left: 18px; font-size: 12px; display: flex; flex-direction: column; gap: 1px; }
.coal-members li { display: flex; gap: 6px; }
.coal-members li .ct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.coal-members .auto { color: var(--accent); font-weight: 700; }
.coal-body .link { align-self: flex-start; }
.map-legend { cursor: pointer; user-select: none; -webkit-user-select: none; }
.map-legend:focus-visible { outline: 1px solid var(--accent); }
.map-legend.folded > :not(.ml-title) { display: none; }
.ml-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #f0f4f6; }
.ml-title::after { content: ""; flex: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.map-legend.folded .ml-title::after { transform: rotate(-90deg); }
.ml-note { font-size: 11px; color: var(--muted); }
.map-legend .ramp-labels { color: var(--text); font-size: 11px; }
.ramp-labels { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }

.credit { margin-top: 4px; padding: 10px; border: 1px solid var(--line); background: #080b0e; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.credit b { color: #eef4f7; font-weight: 600; letter-spacing: 0.02em; }
.credit-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.credit-legal { color: var(--dim); font-size: 10.5px; line-height: 1.45; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "bar" "stage" "side"; }
  .bar { gap: 6px; }
  .brand-sub { display: none; }
  .search { flex: 1 1 120px; max-width: none; }
  .bar-end { margin-left: 0; }
  .refresh-status { display: none; }
  .controls { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .controls::-webkit-scrollbar { display: none; }
  .mode, .layer { padding: 5px 8px; }
  .side { max-height: 48vh; border-left: 0; border-top: 1px solid var(--line); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .side.collapsed { max-height: none; overflow: hidden; }
  .side.collapsed > :not(.sheet-toggle):not(#infoCard):not(#measureCard) { display: none; }
  .side.collapsed:has(#infoCard:not([hidden])) #measureCard { display: none; }
  .side.collapsed #infoCard .card-body > :not(.actions) { display: none; }
  .side.collapsed #measureCard .card-body { display: none; }
  .sheet-toggle { display: block; align-self: center; border: 1px solid var(--line2); background: #0b1014; padding: 1px 16px; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
  .hint { display: none; }
  .map-legend { bottom: 8px; width: 176px; padding: 6px 8px; gap: 3px; }
  .map-legend .ramp, .map-legend .ramp-labels { display: none; }
}
@media (prefers-reduced-motion: reduce) { details.card > summary::after { transition: none; } }

/* ---------- version chip and the map / market tabs ---------- */
.brand-ver { color: var(--dim); font-size: 11px; letter-spacing: 0.03em; text-decoration: none; border: 1px solid var(--line); padding: 0 5px; line-height: 16px; border-radius: var(--radius); font-variant-numeric: tabular-nums; white-space: nowrap; }
a.brand-ver[href]:hover { color: var(--accent); border-color: var(--line2); }
.brand-ver.new { color: #120c02; background: var(--amber); border-color: var(--amber); font-weight: 700; }
.views { display: flex; border: 1px solid var(--line); background: #070a0d; }
.view-tab { border: 0; background: transparent; padding: 5px 16px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.view-tab + .view-tab { border-left: 1px solid var(--line); }
.view-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.view-tab[aria-selected="true"] { color: #e9f6fa; background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }
.app.v-mkt .bar > .search, .app.v-mkt .bar .controls, .app.v-mkt #fresh, .app.v-mkt #refreshBox, .app.v-mkt .stage, .app.v-mkt .side { display: none; }

/* ---------- market tab ---------- */
.mkt { grid-column: 1 / -1; grid-row: 2; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "nav main"; }
.mkt-top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.mkt-search { flex: 1 1 260px; max-width: 440px; }
.mkt-search .suggest li { justify-content: flex-start; align-items: center; }
.suggest li.on { background: var(--accent-dim); }
.suggest .sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .smeta { margin-left: auto; padding-left: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.micon { flex: none; display: inline-block; vertical-align: middle; background: #0a0f13; }
.mkt-nav { grid-area: nav; min-height: 0; overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); background: var(--win); display: flex; flex-direction: column; gap: 6px; }
.mnav-h { margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mnav-list { display: flex; flex-direction: column; gap: 1px; }
.mnav-btn { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 0; border-left: 2px solid transparent; background: transparent; padding: 5px 8px; color: var(--text); font-size: 13px; }
.mnav-btn:hover { background: rgba(255, 255, 255, 0.04); }
.mnav-btn.on { background: var(--accent-dim); border-left-color: var(--accent); color: #eef7fa; }
.mnav-btn .ct, .tbtn .ct { margin-left: auto; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.mnav-tree > summary { cursor: pointer; list-style: none; }
.mnav-tree > summary::-webkit-details-marker { display: none; }
.mnav-tree > summary::before { content: "▸ "; }
.mnav-tree[open] > summary::before { content: "▾ "; }
.tree { margin-top: 4px; font-size: 13px; }
.tkids { padding-left: 12px; border-left: 1px solid var(--line); margin-left: 6px; }
.tbtn { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 0; background: transparent; padding: 3px 4px; color: var(--text); }
.tbtn:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.tbtn.on { background: var(--accent-dim); color: #eef7fa; }
.tbtn .tarrow { width: 10px; flex: none; color: var(--muted); }
.tbtn .tname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-main { grid-area: main; min-width: 0; min-height: 0; overflow-y: auto; padding: 14px 18px 28px; display: flex; flex-direction: column; gap: 14px; }
.mkt-main > * { flex-shrink: 0; }
.mnav-chips { display: flex; flex-direction: column; gap: 6px; }
.mhead { display: flex; align-items: flex-start; gap: 12px; }
.mhead-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mtitle { margin: 0; font-size: 20px; font-weight: 700; color: #eef4f7; letter-spacing: 0.01em; }
.msub { color: var(--muted); font-size: 12px; }
.mactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mbtn { border: 1px solid var(--line2); background: #0b1014; padding: 3px 10px; font-size: 12px; color: var(--text); border-radius: var(--radius); }
.mbtn:hover { border-color: var(--accent); color: #fff; }
.mbtn.on { border-color: var(--amber); color: var(--amber); }
.mback { align-self: flex-start; font-size: 12px; }
.mnote { margin: 0; color: var(--muted); font-size: 13px; }
.mnote.mfail, .mfail { color: var(--bad); }
.mkt-src { margin: 6px 0 0; color: var(--dim); font-size: 11px; }
.mdim { color: var(--dim); }
.mscroll { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.mtable th { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 6px 8px; border-bottom: 1px solid var(--line2); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.mtable td { padding: 5px 8px; border-bottom: 1px solid #141b21; white-space: nowrap; }
.mtable tbody tr[data-item], .mtable tbody tr[data-hub] { cursor: pointer; }
.mtable tbody tr[data-item]:hover, .mtable tbody tr[data-hub]:hover { background: rgba(79, 184, 212, 0.06); }
.mtable .cnum { text-align: right; }
.mtable .cname { text-align: left; }
.mtable .cstar { width: 28px; padding-right: 0; }
.mtable .cspark { width: 80px; text-align: center; }
.mtable .msec td { padding-top: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-bottom-color: var(--line); }
.sortbtn { all: unset; cursor: pointer; }
.sortbtn:hover, .sortbtn.on { color: #e9f6fa; }
.iname { display: inline-flex; align-items: center; gap: 8px; max-width: 380px; }
.iname > span { overflow: hidden; text-overflow: ellipsis; }
.star { all: unset; cursor: pointer; color: var(--dim); font-size: 14px; padding: 0 2px; }
.star:hover { color: var(--text); }
.star.on { color: var(--amber); }
.spark { display: block; margin: 0 auto; }
.chg { white-space: nowrap; }
.chg-mark { font-size: 9px; margin-right: 3px; vertical-align: 1px; }
.chg-mark.up { color: var(--good); }
.chg-mark.down { color: var(--bad); }
.chg-mark.flat { color: var(--dim); }
.mhubs-t tr.cur td { background: rgba(79, 184, 212, 0.08); }
.mhubs-t tr.cur td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.hubdot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border: 1px solid var(--dim); vertical-align: 1px; }
.mhubs-t tr.cur .hubdot { background: var(--accent); border-color: var(--accent); }
.mbest { display: inline-block; padding: 0 4px; margin-right: 2px; border: 1px solid var(--good); color: var(--good); font-size: 10px; letter-spacing: 0.04em; line-height: 14px; vertical-align: 1px; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mtile { border: 1px solid var(--line); background: var(--win); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtile-l { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile-v { font-size: 17px; font-weight: 600; color: #eef4f7; white-space: nowrap; }
.mtile-n { color: var(--dim); font-size: 11px; }
.mchart-box { border: 1px solid var(--line); background: var(--win); padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.mchart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mchart-title { color: var(--text); font-size: 13px; font-weight: 600; }
.mranges { display: flex; border: 1px solid var(--line); background: #070a0d; }
.mranges .mode[aria-pressed="true"] { color: #e9f6fa; background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }
.mchart { position: relative; outline: none; min-height: 120px; }
.mchart:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.mchart-last { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.mchart-svg { display: block; touch-action: pan-y; }
.mchart-svg .axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; font-family: var(--num); }
.mchart-svg .axis-title { fill: var(--dim); letter-spacing: 0.04em; }
.mtip { position: absolute; z-index: 2; pointer-events: none; min-width: 150px; padding: 7px 9px; background: rgba(8, 11, 14, 0.97); border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.mtip-row { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mtip-row b { color: #eef4f7; font-weight: 600; font-variant-numeric: tabular-nums; }
.mtip-row span { color: var(--muted); font-size: 11px; }
.mtip-date b { color: var(--muted); font-weight: 500; font-size: 11px; }
.mdaily > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.mdaily[open] > summary { margin-bottom: 6px; }
.mdaily .mscroll { max-height: 320px; overflow-y: auto; }
.mbooks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mbook { border: 1px solid var(--line); background: var(--win); padding: 8px 10px; }
.mbook-h { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 860px) {
  .views { order: 2; }
  .view-tab { padding: 5px 12px; }
  .mkt { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "top" "nav" "main"; }
  .mkt-top { padding: 8px 12px; }
  .mkt-hubs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mkt-nav { border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 12px; gap: 4px; overflow: visible; }
  .mnav-chips { flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .mnav-chips::-webkit-scrollbar { display: none; }
  .mnav-chips .mnav-h { display: none; }
  .mnav-chips .mnav-list { display: contents; }
  .mkt-nav .mnav-btn { width: auto; flex: none; border: 1px solid var(--line); padding: 3px 9px; font-size: 12px; white-space: nowrap; }
  .mkt-nav .mnav-btn.on { border-color: var(--accent); }
  .mnav-tree > summary { margin: 0; padding: 2px 0; }
  .mnav-tree .tree { max-height: 40vh; overflow-y: auto; }
  .mkt { grid-template-rows: auto auto minmax(0, 1fr); }
  .mkt-main { padding: 12px 12px max(20px, env(safe-area-inset-bottom, 0px)); }
  .mtitle { font-size: 17px; }
  .iname { max-width: 200px; }
}
@media (max-width: 560px) {
  .mtable .cspark { display: none; }
  .mtable td, .mtable th { padding-left: 6px; padding-right: 6px; }
  .mtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
