/* Layout: a full-bleed map with a thin top bar, a lens dock along the bottom and one detail panel on the right
   (a bottom sheet on phones). One deliberate dark look: indigo (neel) seas, lacquer panels, turmeric and
   peacock accents taken from Indian dye colours. The brand mark is the Ashoka Chakra as drawn on the national flag
   (navy, 24 spokes) on an ivory disc; it is never set on tricolour bands. */
:root {
  --ink: #0d1118;          /* kohl: page ground */
  --lacquer: #151b26;      /* panel ground */
  --lacquer-2: #1c2433;    /* raised rows */
  --line: #2c3647;         /* hairlines */
  --paper: #ece4d3;        /* main text */
  --muted: #9aa3b2;        /* secondary text */
  --haldi: #e3a72f;        /* turmeric accent */
  --mor: #2fa3a0;          /* peacock accent */
  --alta: #d9534f;         /* madder red, warnings */
  --neel: #13284a;         /* indigo sea */
  --good: #5cb85c;
  --kesari: #ff9933;       /* tricolour saffron (screen tint; the flag standard defines cloth, not sRGB) */
  --safed: #ffffff;        /* tricolour white */
  --hara: #138808;         /* tricolour green */
  --font-display: "Rozha One", "Noto Serif Devanagari", Georgia, serif;
  --font-ui: "Mukta", "Noto Sans", "Nirmala UI", "Kohinoor Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--ink); color: var(--paper); font-family: var(--font-ui); font-size: 14px; overflow: hidden; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--haldi); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- top bar */
#topbar {
  display: flex; align-items: center; gap: 10px; height: 44px; flex: none; position: relative; z-index: 20;
  padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, #111723, #0e131c); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 2px; flex: none; }
.brand-mark { width: 28px; height: 28px; display: block; padding: 2px; border-radius: 50%; background: #fdf8ec; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.brand-mark svg, .loading-mark svg { width: 100%; height: 100%; display: block; }
.brand-medal { display: grid; place-items: center; flex: none; }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.brand-name { font-family: var(--font-display); font-size: 21px; letter-spacing: .5px; color: var(--paper); }
.brand-sub { font-size: 9.5px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); margin: 1px 0 0 1px; }
.yields { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.yields::-webkit-scrollbar { display: none; }
.yield { display: flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--lacquer-2);
  border: 1px solid var(--line); white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; cursor: help; }
.yield .ico { flex: none; color: var(--yc, var(--paper)); }
.yield b { font-weight: 600; }
.yield small { color: var(--muted); font-weight: 500; }
.spacer { flex: 1; }
.search { position: relative; flex: 0 1 300px; min-width: 120px; }
.search input { width: 100%; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--paper);
  padding: 0 28px 0 29px; font: inherit; }
.search input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.search-kbd { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font: 600 11px/16px var(--font-ui); color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; pointer-events: none; }
.search input:focus ~ .search-kbd { display: none; }
.search input::placeholder { color: #6c7686; }
.search-results { position: absolute; top: 38px; right: 0; width: min(420px, 92vw); max-height: 60vh; overflow: auto; background: var(--lacquer);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 4px; }
.sr-item { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.sr-item:hover, .sr-item.active { background: var(--lacquer-2); }
.sr-item b { font-weight: 600; }
.sr-item span { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.tb-actions { display: flex; gap: 6px; flex: none; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--lacquer-2); cursor: pointer; font-weight: 600; white-space: nowrap; }
.tb-btn i { display: grid; font-style: normal; }
.tb-btn[aria-expanded="true"] { border-color: var(--haldi); }
.tb-btn:hover { border-color: var(--haldi); }
.tb-icon { width: 32px; padding: 0; justify-content: center; }

/* ------------------------------------------------------------- stage */
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--neel); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.dragging { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; background: var(--ink); z-index: 30;
  color: var(--muted); transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }
/* the chakra turns slowly while the map loads: the wheel of law in motion */
.loading-mark { width: 58px; height: 58px; padding: 4px; border-radius: 50%; background: #fdf8ec; box-shadow: 0 0 0 2px #c9a45c, 0 0 0 4px rgba(0,0,0,.5); }
.loading-mark svg { animation: turn 7s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-mark svg { animation: none; } }

.tooltip { position: absolute; z-index: 15; pointer-events: none; max-width: 320px; background: rgba(13,17,24,.96); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 13px; line-height: 1.35; }
.tooltip .t-h { font-weight: 700; font-size: 14px; }
.tooltip .t-s { color: var(--muted); font-size: 12px; }
.tooltip .t-h .t-k { font-family: var(--font-ui, inherit); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tooltip .t-v { margin-top: 4px; font-weight: 600; color: var(--haldi); font-variant-numeric: tabular-nums; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tooltip .t-row span:first-child { color: var(--muted); }

/* ------------------------------------------------------------- legend */
.legend { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: 12px; z-index: 12; width: 280px; max-height: calc(100% - 30px); overflow: auto; background: rgba(21,27,38,.94);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.legend h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.1; }
.legend .lg-src { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.legend .lg-bar { height: 10px; border-radius: 3px; margin: 9px 0 3px; }
.legend .lg-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend .lg-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 8px; font-size: 12px; max-height: 190px; overflow: auto; }
.legend .lg-cat { display: flex; align-items: center; gap: 6px; min-width: 0; }
.legend .lg-cat i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend .lg-cat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend .lg-desc { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.35; }
.legend .lg-close { float: right; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

/* ------------------------------------------------------------- minimap */
.minimap { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 12;
  border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.45); cursor: crosshair; touch-action: none; }
.mm-on .legend { bottom: 196px; max-height: calc(100% - 214px); }
@media (max-height: 640px) { .minimap { display: none !important; } .mm-on .legend { bottom: 12px; max-height: calc(100% - 30px); } }

/* ------------------------------------------------------------- lens bar (bottom right), lens picker, map layers */
.dock { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 13;
  display: flex; align-items: center; gap: 4px; padding: 5px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none;
  background: rgba(21,27,38,.95); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dock::-webkit-scrollbar { display: none; }
.dk-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--lacquer-2); cursor: pointer; font-weight: 600; white-space: nowrap; font-size: 13px; }
.dk-btn:hover { border-color: var(--mor); }
.dk-btn[aria-pressed="true"], .dk-btn[aria-expanded="true"] { background: var(--haldi); color: #1b1407; border-color: var(--haldi); }
.dk-count { font-size: 11px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: inline-grid; place-items: center; background: #26354a; color: var(--paper); }
.dk-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; flex: none; }
.popover { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 16;
  background: var(--lacquer); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  padding: 10px 12px 12px; max-height: calc(100% - 84px); overflow: auto; }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pop-head b { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pop-close { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--lacquer-2); cursor: pointer; font-size: 16px; line-height: 1; }
.lens-picker { width: min(640px, calc(100% - 24px)); }
.lp-grid { columns: 2 270px; column-gap: 18px; }
.lp-group { break-inside: avoid; margin-bottom: 12px; }
.lp-group h5 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.lp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.lp-btn { position: relative; display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 5px 8px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--lacquer-2); cursor: pointer; text-align: left; font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.lp-btn i { font-style: normal; font-size: 15px; flex: none; }
.lp-btn em { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px; opacity: .85; }
.lp-btn:hover { border-color: var(--mor); }
.lp-btn[aria-pressed="true"] { border-color: var(--haldi); box-shadow: inset 0 0 0 1px var(--haldi); }
.layers-pop { width: 250px; }
.share-pop { top: 8px; bottom: auto; width: 340px; }
.share-what { margin: 0 0 8px; font-weight: 600; line-height: 1.35; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); padding: 0 8px; font: 12.5px var(--font-ui); }
.sp-copy { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--lacquer-2); cursor: pointer; font-weight: 700; white-space: nowrap; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 2px; }
.sp-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--lacquer-2);
  color: var(--paper); text-decoration: none; cursor: pointer; font: 600 13px var(--font-ui); text-align: left; }
.sp-item:hover, .sp-copy:hover { border-color: var(--mor); }
.sp-item .ico-whatsapp { color: #3fcf6c; } .sp-item .ico-facebook { color: #6d9cf5; }
.share-pop .note { margin: 8px 0 0; }
/* medium widths: some top-bar buttons keep only their icons */
@media (max-width: 1700px) { #btn-explorer span, #btn-insights span, #btn-units span { display: none; } #btn-explorer, #btn-insights, #btn-units { width: 30px; padding: 0; justify-content: center; } }
@media (max-width: 1100px) { #btn-share span, #btn-places span { display: none; } #btn-share, #btn-places { width: 30px; padding: 0; justify-content: center; } }
a.tb-btn { text-decoration: none; color: inherit; }
.ly-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 600; border-radius: 6px; }
.ly-row:hover { background: var(--lacquer-2); }
.ly-row i { font-style: normal; width: 22px; text-align: center; }
.ly-row span { flex: 1; }
.ly-row em { width: 32px; height: 18px; border-radius: 9px; background: #33405a; position: relative; transition: background .15s; flex: none; }
.ly-row em::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #cfd6e2; transition: left .15s; }
.ly-row[aria-pressed="true"] em { background: var(--haldi); }
.ly-row[aria-pressed="true"] em::after { left: 16px; background: #fff8e8; }
.ly-row[aria-pressed="false"] { color: var(--muted); }

/* ------------------------------------------------------------- side panel */
.panel { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 64px; width: 390px; z-index: 14;
  background: var(--lacquer); border: 1px solid var(--line); border-radius: 14px; overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.p-head { position: sticky; top: 0; background: linear-gradient(180deg, var(--lacquer) 80%, rgba(21,27,38,0)); padding: 14px 16px 8px; z-index: 2; }
.p-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--lacquer-2);
  cursor: pointer; font-size: 18px; line-height: 1; }
.p-eyebrow { color: var(--mor); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.p-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; margin: 2px 40px 0 0; text-wrap: balance; }
.p-local { font-size: 18px; color: var(--haldi); margin-top: 2px; }
.p-sub { color: var(--muted); margin-top: 4px; line-height: 1.35; }
.p-tabs { display: flex; gap: 2px; margin: 10px -6px 0; border-bottom: 1px solid var(--line); }
.p-tab { flex: 1; min-width: 0; border: 0; background: none; color: var(--muted); padding: 6px 2px 7px; font-weight: 700; font-size: 12px; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-tab i { font-style: normal; }
.p-tab:hover { color: var(--paper); }
.p-tab[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--haldi); }
.p-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.p-sec h4 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-variant-numeric: tabular-nums; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.kv dd small { color: var(--muted); font-weight: 500; }
.big-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.big-stat { background: var(--lacquer-2); border-radius: 9px; padding: 8px 9px; min-width: 0; }
.big-stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-stat span { color: var(--muted); font-size: 11.5px; line-height: 1.2; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--lacquer-2); border: 1px solid var(--line); font-size: 12.5px; }
.chip b { font-weight: 700; }
.spec { display: flex; gap: 10px; align-items: flex-start; background: var(--lacquer-2); border-radius: 10px; padding: 9px 10px; }
.spec .e { font-size: 22px; line-height: 1; }
.spec b { display: block; }
.spec span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 52px; align-items: center; gap: 8px; font-size: 12.5px; }
.bar-row .lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .trk { height: 9px; background: #232c3b; border-radius: 3px; position: relative; overflow: hidden; }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.bar-row .ref { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--paper); opacity: .7; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.stack-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.spark { width: 100%; height: 96px; display: block; }
.note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.link-btn { background: none; border: 0; color: var(--mor); cursor: pointer; padding: 0; font-weight: 600; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #263041; font-variant-numeric: tabular-nums; }
.list-row:last-child { border-bottom: 0; }
/* city header: population in a hex badge, then rank medallions (both skins) */
.c-head { display: flex; gap: 12px; align-items: center; margin: 6px 40px 0 0; }
.c-badge { flex: none; width: 62px; height: 68px; display: grid; place-items: center; background: #0d1118;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.c-badge span { width: 56px; height: 62px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-weight: 800; font-size: 13.5px; color: #14120d; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.c-head .p-title { margin: 0; }
.c-medals { display: flex; justify-content: space-around; gap: 6px; margin-top: 12px; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; text-align: center; cursor: help; }
.medal b { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #20160a;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e3b54a 55%, #9a7420); box-shadow: 0 0 0 2px #120c05, 0 0 0 3px rgba(236,208,142,.55), 0 3px 6px rgba(0,0,0,.5); }
.medal.silver b { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 55%, #7d8794); box-shadow: 0 0 0 2px #0b0e12, 0 0 0 3px rgba(220,226,235,.5), 0 3px 6px rgba(0,0,0,.5); }
.medal.bronze b { background: radial-gradient(circle at 35% 30%, #ffd9b0, #c98a4f 55%, #7a4a22); box-shadow: 0 0 0 2px #120a04, 0 0 0 3px rgba(222,160,100,.5), 0 3px 6px rgba(0,0,0,.5); }
.medal span { font-size: 11px; color: var(--muted); line-height: 1.15; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #26354a; color: var(--paper); }

/* ------------------------------------------------------------- modal (explorer, almanac) */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(5,8,12,.7); display: grid; place-items: center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.modal-card { position: relative; width: min(1180px, 100%); max-height: calc(100% - 20px); overflow: auto; background: var(--lacquer);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.modal-close { position: sticky; float: right; top: 0; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--lacquer-2); cursor: pointer; font-size: 20px; z-index: 3; }
.modal h2 { font-family: var(--font-display); font-weight: 400; font-size: 32px; margin: 0 0 4px; }
.modal h3 { margin: 18px 0 6px; font-size: 15px; }
.modal p { line-height: 1.5; max-width: 75ch; color: #d6cfbf; }
.modal ul { max-width: 75ch; margin: 6px 0 10px; padding-left: 20px; color: #d6cfbf; }
.modal li { line-height: 1.5; margin: 5px 0; }
.modal li b { color: var(--paper); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.src { background: var(--lacquer-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.src b { display: block; }
.src span { color: var(--muted); font-size: 12.5px; display: block; line-height: 1.4; }
.src a { color: var(--mor); font-size: 12.5px; word-break: break-all; }
.ex-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.ex-controls label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ex-controls select { background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: 7px; height: 30px; font: inherit; max-width: 230px; }
.ex-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.ex-table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 10px; }
table.ex { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.ex th { position: sticky; top: 0; background: #1a2130; text-align: right; padding: 7px 8px; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 700; }
table.ex th:first-child, table.ex td:first-child { text-align: left; }
table.ex td { padding: 5px 8px; border-top: 1px solid #222b3a; text-align: right; white-space: nowrap; }
table.ex tr:hover td { background: #1c2433; cursor: pointer; }
.ex-scatter { width: 100%; aspect-ratio: 1 / 1; max-width: 100%; background: #111722; border-radius: 10px; border: 1px solid var(--line); }

/* ------------------------------------------------------------- phones */
@media (max-width: 760px) {
  #topbar { gap: 8px; }
  .brand-text { display: none; }
  .tb-actions .tb-btn:not(#btn-almanac):not(#btn-insights):not(#btn-share) { display: none; }
  .tb-actions .tb-btn span { display: none; }
  .tb-actions .tb-btn { width: 32px; padding: 0; justify-content: center; }
  .popover.share-pop { top: 6px; bottom: auto; }
  .search-kbd { display: none; }
  .search { flex: 1 1 auto; min-width: 90px; }
  .p-tab span { display: none; }
  .p-tab i { font-size: 16px; }
  .yields { display: none; }
  .panel { top: auto; left: 8px; right: 8px; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 56%; }
  .legend, .mm-on .legend { width: auto; right: 8px; left: 8px; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .dock { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-width: none; }
  .dk-btn { padding: 0 9px; }
  .dk-btn[data-act="res"] span, .dk-quick span { display: none; }
  .popover { left: 8px; right: 8px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); max-height: 70%; }
  .lp-grid { columns: 1; }
  .panel:not([hidden]) ~ .legend { display: none; }
  .ex-wrap { grid-template-columns: 1fr; }
  .p-title { font-size: 26px; }
}

/* link from a panel to the place's full page */
.p-page { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--haldi, #e3a72f); text-decoration: none; font-weight: 600; font-size: 13px; }
.p-page:hover { background: var(--lacquer-2); color: #fff; }

/* report card in the panels (reportcard.js): label, value, a line from lowest to highest, and the ranks */
.rc { display: grid; gap: 7px; }
.rc-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "s s" "r r"; gap: 1px 10px; font-size: 12.5px; }
.rc-l { grid-area: l; color: var(--muted); }
.rc-row b { grid-area: v; text-align: right; font-variant-numeric: tabular-nums; }
.rc-s { grid-area: s; position: relative; height: 8px; margin: 2px 4px 0; }
.rc-s::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; border-radius: 1px; background: #2c3747; }
.rc-s i { position: absolute; top: 0; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--haldi, #e3a72f); }
.rc-row small { grid-area: r; color: var(--muted); font-size: 11px; }
.rc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.rc-links a { color: var(--haldi, #e3a72f); text-decoration: none; }
.rc-links a:hover { color: #fff; }
