:root {
  color-scheme: dark;
  --bg: #0d1118;
  --panel: #111722;
  --panel-2: #151d29;
  --panel-3: #192331;
  --line: rgba(228, 232, 238, 0.1);
  --line-strong: rgba(228, 232, 238, 0.18);
  --text: #f1efe8;
  --muted: #98a3b1;
  --muted-2: #697687;
  --warm: #e89a62;
  --warm-2: #ffc28f;
  --cool: #5f93ae;
  --cool-2: #8bb6c8;
  --danger: #df7d6b;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(232, 154, 98, 0.75); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(600px, 1fr) 370px;
  grid-template-rows: 70px minmax(0, 1fr);
  height: 100vh;
  background:
    radial-gradient(circle at 45% -15%, rgba(82, 107, 137, 0.16), transparent 34%),
    var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr minmax(340px, 560px) 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 24, 0.86);
  backdrop-filter: blur(18px);
  z-index: 20;
}
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 11px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 8px; background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.01)); }
.brand-mark span { display: block; border-radius: 3px 3px 1px 1px; background: var(--text); opacity: .9; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .45; }
.brand-mark span:nth-child(2) { height: 15px; background: var(--warm); }
.brand-mark span:nth-child(3) { height: 11px; opacity: .7; }
.brand-line { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.brand-line strong { font-size: 16px; letter-spacing: .02em; }
.brand-line > span { font-size: 12px; color: var(--muted); }
.beta-pill { padding: 2px 6px; border-radius: 999px; color: var(--warm-2) !important; background: rgba(232,154,98,.12); border: 1px solid rgba(232,154,98,.2); }
.brand-block p { margin: 3px 0 0; color: var(--muted-2); font-size: 11px; white-space: nowrap; }

.global-search-wrap { position: relative; display: flex; align-items: center; }
.global-search-wrap input { width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--text); padding: 0 48px 0 38px; transition: .18s ease; }
.global-search-wrap input::placeholder { color: #657283; }
.global-search-wrap input:focus { border-color: rgba(232,154,98,.42); background: rgba(255,255,255,.055); box-shadow: 0 0 0 4px rgba(232,154,98,.06); }
.search-icon { position: absolute; left: 13px; color: var(--muted); font-size: 21px; transform: rotate(-20deg); pointer-events: none; }
kbd { position: absolute; right: 10px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); background: var(--panel-2); font-size: 10px; box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(18,24,34,.98); box-shadow: var(--shadow); z-index: 40; max-height: 330px; overflow: auto; }
.search-result { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent; border-radius: 9px; padding: 10px; cursor: pointer; text-align: left; }
.search-result:hover { background: rgba(255,255,255,.06); }
.search-result strong { font-size: 13px; }
.search-result span { color: var(--muted); font-size: 11px; }

.top-actions { display: flex; justify-content: flex-end; gap: 9px; }
.quiet-button, .primary-button, .icon-button, .compare-button { border-radius: 10px; height: 36px; padding: 0 13px; cursor: pointer; transition: .16s ease; }
.quiet-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #c3cad3; }
.quiet-button:hover { background: rgba(255,255,255,.065); color: var(--text); }
.primary-button { border: 1px solid rgba(232,154,98,.44); background: linear-gradient(180deg, #e9a26e, #cc7d4d); color: #1c120c; font-weight: 700; box-shadow: 0 8px 24px rgba(204,125,77,.18); }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.05); }

.catalog-panel, .detail-panel { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.catalog-panel { grid-column: 1; grid-row: 2; padding: 22px 14px 20px; border-right: 1px solid var(--line); background: rgba(15,20,29,.72); }
.section-label { padding: 0 8px 9px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.object-list { display: grid; gap: 5px; }
.object-button { position: relative; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 12px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px; cursor: pointer; text-align: left; color: #c6ced8; }
.object-button:hover { background: rgba(255,255,255,.035); }
.object-button.active { background: linear-gradient(90deg, rgba(232,154,98,.12), rgba(232,154,98,.035)); border-color: rgba(232,154,98,.17); color: var(--text); }
.object-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 16px; }
.object-button.active .object-icon { background: rgba(232,154,98,.16); border-color: rgba(232,154,98,.2); }
.object-copy { min-width: 0; }
.object-copy strong, .object-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-copy strong { font-size: 12px; font-weight: 650; }
.object-copy small { color: var(--muted-2); font-size: 10px; margin-top: 3px; }
.object-status { font-size: 9px; padding: 3px 5px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted-2); }
.object-button.active .object-status { color: var(--warm-2); background: rgba(232,154,98,.1); }
.catalog-divider { height: 1px; background: var(--line); margin: 21px 8px; }
.lens-switch { display: grid; gap: 7px; }
.lens-button { width: 100%; display: grid; grid-template-columns: 9px minmax(0,1fr); gap: 9px; text-align: left; align-items: start; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #b8c1cc; padding: 9px 10px; cursor: pointer; }
.lens-button:hover { background: rgba(255,255,255,.03); }
.lens-button.active { background: rgba(255,255,255,.045); border-color: var(--line); color: var(--text); }
.lens-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 999px; box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.price-dot { background: var(--warm); }
.adjusted-dot { background: var(--cool-2); }
.lens-button strong, .lens-button small { display: block; }
.lens-button strong { font-size: 12px; }
.lens-button small { margin-top: 3px; color: var(--muted-2); font-size: 10px; line-height: 1.35; }
.catalog-note { margin: 22px 5px 0; padding: 13px; display: flex; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.022); }
.status-light { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 13px rgba(232,154,98,.55); }
.catalog-note strong { font-size: 11px; }
.catalog-note p { margin: 4px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }

.workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow: auto; padding: 24px 26px 40px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 18px; }
.eyebrow { color: var(--warm-2); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 750; }
.workspace-head h1 { margin: 7px 0 7px; font-size: clamp(24px, 2.6vw, 35px); line-height: 1.15; letter-spacing: -.03em; }
.workspace-head p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.date-control { width: 230px; flex: 0 0 auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.022); }
.date-control-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.date-control-head span { color: var(--muted-2); font-size: 10px; }
.date-control-head strong { font-size: 11px; }
.date-control input { width: 100%; accent-color: var(--warm); }
.date-ends { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 9px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.metric-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.metric-card > span, .metric-card > small, .metric-card > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > span { color: var(--muted-2); font-size: 10px; }
.metric-card > strong { margin-top: 6px; font-size: 18px; letter-spacing: -.02em; }
.metric-card > small { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.selected-metric { border-color: rgba(232,154,98,.18); background: linear-gradient(145deg, rgba(232,154,98,.1), rgba(255,255,255,.012)); }

.map-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #101722; box-shadow: 0 20px 70px rgba(0,0,0,.16); }
.map-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 65% 35%, rgba(73,105,135,.12), transparent 42%); }
.map-toolbar { position: relative; z-index: 2; min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 14px 8px; border-bottom: 1px solid var(--line); background: rgba(13,19,28,.65); }
.legend-block { width: 220px; }
.legend-block > span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 6px; }
.legend-scale { height: 5px; border-radius: 999px; background: linear-gradient(90deg, #263b50, #5d7185, #a46f5a, #f0a66a); }
.legend-labels { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.map-actions { display: flex; gap: 7px; }
.icon-button { height: 31px; padding: 0 10px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted); font-size: 10px; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.06); }
.map-wrap { position: relative; aspect-ratio: 1080 / 520; min-height: 330px; overflow: hidden; }
#world-map { display: block; width: 100%; height: 100%; }
.graticule { fill: none; stroke: rgba(170,187,205,.065); stroke-width: .55; vector-effect: non-scaling-stroke; }
.country-shape { stroke: rgba(220,229,237,.13); stroke-width: .55; vector-effect: non-scaling-stroke; transition: fill .18s ease, opacity .18s ease, stroke .18s ease; cursor: pointer; }
.country-shape.no-data { fill: #18212d; opacity: .74; cursor: default; }
.country-shape.has-data:hover { stroke: rgba(255,255,255,.72); stroke-width: 1.2; filter: brightness(1.12); }
.country-shape.selected { stroke: #fff5e9; stroke-width: 2; filter: drop-shadow(0 0 6px rgba(255,245,233,.42)); }
.country-marker { cursor: pointer; stroke: rgba(255,255,255,.82); stroke-width: 1.2; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); transition: r .15s ease; }
.country-marker:hover { r: 6.5; }
.country-marker.selected { stroke-width: 2.2; r: 7; }
.map-tooltip { position: absolute; min-width: 155px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(10,14,20,.94); box-shadow: 0 18px 45px rgba(0,0,0,.35); pointer-events: none; z-index: 8; backdrop-filter: blur(10px); }
.map-tooltip strong { display: block; font-size: 12px; }
.map-tooltip span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.map-tooltip em { color: var(--warm-2); font-style: normal; }
.map-caption { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 7px; color: #8996a5; font-size: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,17,24,.72); backdrop-filter: blur(8px); }
.caption-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warm); }

.ranking-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.ranking-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ranking-head h2 { margin: 5px 0 0; font-size: 16px; }
.ranking-table-wrap { max-height: 430px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; text-align: left; background: #151d28; color: var(--muted-2); font-weight: 600; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.055); color: #c7cfd8; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,.035); }
tbody tr.selected { background: rgba(232,154,98,.08); }
.rank-positive { color: var(--warm-2); }
.rank-negative { color: var(--cool-2); }
.table-action { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.detail-panel { grid-column: 3; grid-row: 2; border-left: 1px solid var(--line); background: rgba(15,20,29,.78); }
.detail-tabs { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(3,1fr); padding: 10px 12px 0; background: rgba(15,20,29,.94); backdrop-filter: blur(14px); }
.detail-tab { position: relative; height: 38px; border: 0; background: transparent; color: var(--muted-2); font-size: 11px; cursor: pointer; }
.detail-tab::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 2px; border-radius: 999px; background: transparent; }
.detail-tab.active { color: var(--text); }
.detail-tab.active::after { background: var(--warm); }
.detail-view { display: none; padding: 21px 18px 30px; }
.detail-view.active { display: block; }
.country-heading { display: flex; justify-content: space-between; align-items: start; }
.country-heading span { color: var(--muted-2); font-size: 10px; letter-spacing: .12em; }
.country-heading h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.03em; }
.compare-button { height: 31px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: var(--muted); font-size: 10px; }
.compare-button.active { border-color: rgba(232,154,98,.3); color: var(--warm-2); background: rgba(232,154,98,.08); }
.price-hero { margin-top: 19px; padding: 17px; border: 1px solid rgba(232,154,98,.16); border-radius: 15px; background: linear-gradient(145deg, rgba(232,154,98,.11), rgba(255,255,255,.02)); }
.price-hero > span { color: var(--muted); font-size: 10px; }
.price-hero > strong { display: block; margin: 8px 0 7px; font-size: 28px; letter-spacing: -.03em; }
.price-hero > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.price-hero > div span:first-child { color: var(--warm-2); }
.detail-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.detail-kpis article { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.022); }
.detail-kpis span, .detail-kpis strong, .detail-kpis small { display: block; }
.detail-kpis span { color: var(--muted-2); font-size: 9px; }
.detail-kpis strong { margin-top: 6px; font-size: 16px; }
.detail-kpis small { margin-top: 5px; color: var(--muted-2); font-size: 8px; line-height: 1.35; }
.chart-card { margin-top: 13px; padding: 13px 13px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.chart-head { display: flex; justify-content: space-between; align-items: start; }
.chart-head span { color: var(--muted-2); font-size: 9px; }
.chart-head strong { display: block; margin-top: 3px; font-size: 11px; }
#history-chart { width: 100%; height: auto; display: block; margin-top: 5px; }
.chart-grid { stroke: rgba(255,255,255,.075); stroke-width: .7; }
.chart-line { fill: none; stroke: var(--warm); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 2px 4px rgba(232,154,98,.2)); }
.chart-area { fill: url(#areaGradient); opacity: .7; }
.chart-point { fill: var(--panel); stroke: var(--warm-2); stroke-width: 1.8; }
.chart-selected-line { stroke: rgba(255,255,255,.18); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-label { fill: var(--muted-2); font-size: 8px; }
.compare-section { margin-top: 16px; }
.subsection-head { display: flex; justify-content: space-between; color: #c8d0da; font-size: 10px; }
.subsection-head small { color: var(--muted-2); }
.compare-list { display: grid; gap: 6px; margin-top: 9px; }
.compare-row { display: grid; grid-template-columns: minmax(0,1fr) 78px 26px; align-items: center; gap: 7px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.compare-row strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-row small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.compare-value { text-align: right; color: var(--warm-2); font-size: 10px; }
.compare-remove { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); cursor: pointer; }
.compare-remove:hover { background: rgba(255,255,255,.06); color: var(--text); }

.truth-card { padding: 17px; border: 1px solid rgba(232,154,98,.18); border-radius: 15px; background: linear-gradient(145deg, rgba(232,154,98,.09), rgba(255,255,255,.015)); }
.truth-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; color: var(--warm-2); background: rgba(232,154,98,.11); font-size: 9px; }
.truth-card h2 { margin: 12px 0 9px; font-size: 18px; line-height: 1.35; }
.truth-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.anatomy-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.anatomy-list div { display: flex; justify-content: space-between; padding: 12px 13px; border-bottom: 1px solid var(--line); font-size: 10px; }
.anatomy-list div:last-child { border-bottom: 0; }
.anatomy-list em { font-style: normal; color: var(--muted-2); }
.schema-note { margin-top: 13px; padding: 13px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.schema-note strong { display: block; font-size: 10px; }
.schema-note code { display: block; margin-top: 8px; color: var(--cool-2); font-size: 9px; line-height: 1.6; white-space: normal; }
.source-card { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; padding: 14px; margin-bottom: 9px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.featured-source { border-color: rgba(232,154,98,.18); }
.source-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #201309; background: var(--warm); font-weight: 800; }
.map-source { background: var(--cool-2); color: #09161d; }
.source-card span { color: var(--muted-2); font-size: 8px; }
.source-card h3 { margin: 4px 0 7px; font-size: 12px; }
.source-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.source-meta { display: flex; gap: 6px; margin-top: 9px; }
.source-meta span { padding: 3px 5px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--muted); }
.method-warning { margin-top: 14px; padding: 13px; border-left: 2px solid var(--danger); background: rgba(223,125,107,.055); }
.method-warning strong { font-size: 10px; }
.method-warning p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(18,24,34,.96); box-shadow: var(--shadow); color: #d6dde5; font-size: 11px; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.method-dialog { width: min(760px, calc(100vw - 40px)); border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; background: #121925; color: var(--text); box-shadow: 0 40px 120px rgba(0,0,0,.62); }
.method-dialog::backdrop { background: rgba(4,7,11,.72); backdrop-filter: blur(5px); }
.method-dialog form { position: relative; padding: 26px; }
.dialog-close { position: absolute; right: 16px; top: 14px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.method-dialog h2 { max-width: 640px; margin: 9px 0 20px; font-size: 25px; line-height: 1.3; letter-spacing: -.025em; }
.dialog-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.dialog-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.dialog-grid article > span { color: var(--warm); font-size: 9px; }
.dialog-grid h3 { margin: 7px 0 5px; font-size: 12px; }
.dialog-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.dialog-footer p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 1250px) {
  .app-shell { grid-template-columns: 210px minmax(560px,1fr) 330px; }
  .topbar { grid-template-columns: 1fr minmax(300px, 470px) 1fr; }
  .brand-block p { display: none; }
  .workspace { padding-inline: 20px; }
}
@media (max-width: 1050px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; grid-template-columns: 190px minmax(0,1fr); grid-template-rows: 70px auto auto; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .detail-panel { grid-column: 2; grid-row: 3; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; max-height: none; }
  .detail-tabs { position: static; display: flex; flex-direction: column; padding: 16px 8px; border-right: 1px solid var(--line); }
  .detail-tab { text-align: left; padding-left: 12px; }
  .detail-tab::after { left: 0; right: auto; top: 20%; bottom: 20%; width: 2px; height: auto; }
  .detail-view { padding: 20px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .topbar { position: sticky; top: 0; display: flex; height: 64px; padding: 0 12px; }
  .brand-line > span:not(.beta-pill), .top-actions .quiet-button, .top-actions .primary-button, kbd { display: none; }
  .global-search-wrap { flex: 1; }
  .catalog-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; overflow-x: auto; }
  .catalog-panel .section-label, .catalog-divider, .lens-switch, .catalog-note { display: none; }
  .object-list { display: flex; min-width: max-content; }
  .object-button { width: 165px; }
  .workspace { padding: 18px 12px 30px; }
  .workspace-head { display: block; }
  .date-control { width: 100%; margin-top: 14px; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .map-wrap { min-height: 280px; }
  .detail-panel { display: block; border-top: 1px solid var(--line); }
  .detail-tabs { position: sticky; top: 64px; display: grid; grid-template-columns: repeat(3,1fr); flex-direction: initial; padding: 8px 10px 0; border-right: 0; }
  .detail-tab { text-align: center; padding: 0; }
  .detail-tab::after { left: 20%; right: 20%; top: auto; bottom: 0; width: auto; height: 2px; }
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
}
