/* Clarity pass (usaciv-style chrome), shared by every skin: slim one-line top bar with colour-coded values,
   inspector comparison tiles and rows, skin picker. Colours come from tokens so each skin restyles it. */

/* Top bar: one slim line; labels move into tooltips, each value takes its yield colour. */
.topbar { padding-block: 6px; gap: 6px 18px; min-height: 52px; }
.seal { width: 34px; height: 34px; font-size: 13px; }
h1 { font-size: 18px; letter-spacing: .04em; }
.sub { font-size: 10px; }
.clock { min-width: 128px; gap: 2px; font-size: 11.5px; }
.res { gap: 2px 14px; align-items: center; }
.res li { gap: 5px; }
.res li > span { display: flex; align-items: baseline; gap: 4px; }
.res small { display: none; }
.res b { font-size: 14.5px; }
.res .d { font-size: 10.5px; }
.res-ic { width: 18px; height: 18px; }
.res li[data-res="pop"] b { color: var(--popc); } .res li[data-res="food"] b { color: var(--food); }
.res li[data-res="prod"] b { color: var(--prod); } .res li[data-res="treasury"] b { color: var(--goldc); }
.res li[data-res="sci"] b { color: var(--sci); } .res li[data-res="influence"] b { color: var(--infc); }
.res li[data-res="happy"] b { color: var(--happyc); } .res li[data-res="score"] b { color: var(--gold); }
/* Phones: values stay on compact rows (labels in tooltips), buttons never wrap word by word. */
@media (max-width: 720px) {
  .res { flex-basis: 100%; gap: 4px 12px; }
  .actions { flex-wrap: wrap; width: 100%; gap: 6px; }
  .actions .btn { white-space: nowrap; padding: 6px 9px; font-size: 13px; }
}

/* Skin picker */
.skin-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.skin-pick select { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
@media (max-width: 720px) { .skin-pick span { display: none; } }

/* Inspector: yield tiles with national rank */
.cmp h3 { margin-top: 4px; }
.cmp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.cmp-tile { display: grid; justify-items: center; gap: 1px; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); text-align: center; cursor: help; }
.cmp-tile .ic { color: var(--c); width: 18px; height: 18px; }
.cmp-tile b { font: 600 17px/1.15 var(--f-mono); color: var(--c); font-variant-numeric: tabular-nums; }
.cmp-tile small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cmp-tile span { font-size: 10.5px; color: var(--muted); }

/* Inspector: indicators against the national average */
.cmp-rows { list-style: none; margin: 0 0 6px; padding: 0; display: grid; }
.cmp-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cmp-rows b { font-weight: 500; text-align: right; }
.cmp-rows em { font: normal 11.5px var(--f-mono); color: var(--muted); text-align: right; white-space: nowrap; }
.cmp-rows em.up { color: var(--jade); } .cmp-rows em.down { color: var(--cinnabar); }

/* Layout fixes: no default body margin (it added an 8px scroll), and the tab strip must not shrink when a pane is long. */
html, body { margin: 0; }
.side .tabs { flex: none; }

/* Quest tracker (Nhiệm vụ) pinned under the map view toggle */
.quests { position: absolute; top: 58px; left: 12px; z-index: 2; width: min(310px, calc(100% - 80px)); max-height: calc(100% - 120px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); font-size: 12.5px; }
.quests summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; }
.quests summary::-webkit-details-marker { display: none; }
.quests summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.quests:not([open]) summary::after { content: "▸"; }
.quests .q-n { font: 600 11px var(--f-mono); color: var(--muted); }
.quests .q-todo { font-size: 11px; font-weight: 600; color: var(--lacquer); background: var(--gold); border-radius: 999px; padding: 1px 7px; }
.quests > ul { list-style: none; margin: 0; padding: 0 6px 6px; overflow: auto; min-height: 0; overscroll-behavior: contain; display: grid; gap: 2px; }
.quests > ul > li > button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 7px 6px; border-radius: 6px; cursor: pointer; color: var(--ink); line-height: 1.35; border-left: 3px solid transparent; }
.quests > ul > li > button:hover, .quests > ul > li > button:focus-visible { background: var(--panel-2); }
.quests > ul > li > button:focus-visible { outline: 2px solid var(--gold); }
.quests > ul > li.todo > button { border-left-color: var(--gold); }
.quests > ul > li.warn > button { border-left-color: var(--cinnabar); }
.quests .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.quests b { display: block; font-size: 12px; }
.quests small { display: block; font: 11px var(--f-mono); color: var(--muted); margin-top: 2px; }
.quests .q-bar { display: block; height: 4px; margin-top: 5px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.quests .q-bar i { display: block; height: 100%; background: var(--jade); }
.quests .q-checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; color: var(--muted); }
.quests .q-checks li.ok { color: var(--jade); }
.quests .q-checks em { font: normal 11px var(--f-mono); color: var(--ink); }
.quests .q-empty { padding: 8px; color: var(--muted); }
@media (max-width: 720px) { .quests { top: 50px; left: 8px; width: calc(100% - 64px); max-height: calc(100% - 100px); } }
