:root {
  --panel: rgba(22, 32, 46, 0.86);
  --panel2: rgba(34, 48, 68, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e8eef5;
  --dim: #9fb0c3;
  --accent: #4fc3f7;
  --good: #66bb6a;
  --bad: #ef5350;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1622; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--text); user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.ok { color: var(--good); }
.bad { color: var(--bad); }
.good { color: var(--good); }
.dim { color: var(--dim); }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 18px;
  padding: 0 14px; background: linear-gradient(180deg, rgba(18, 27, 40, 0.95), rgba(18, 27, 40, 0.82));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); z-index: 10;
}
.city { display: flex; align-items: center; gap: 8px; }
#cityName { background: transparent; border: 1px solid transparent; color: #fff; font-weight: 700; font-size: 17px; width: 150px; padding: 3px 6px; border-radius: 6px; }
#cityName:hover, #cityName:focus { border-color: var(--line); outline: none; background: rgba(255, 255, 255, 0.05); }
.pill { font-size: 11px; padding: 3px 8px; border-radius: 20px; background: rgba(79, 195, 247, 0.18); color: var(--accent); white-space: nowrap; }
.stats { display: flex; gap: 16px; flex: 1; }
.stat { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.stat b { font-size: 15px; }
.stat small { font-size: 11px; }
.stat .neg, #money.neg { color: var(--bad); }
.stat .pos { color: var(--good); }
.speed { display: flex; background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 2px; }
.speed button { background: none; border: 0; padding: 5px 9px; border-radius: 6px; font-size: 11px; color: var(--dim); letter-spacing: -2px; }
.speed button.active { background: var(--accent); color: #0e1622; }
.rci { display: flex; gap: 4px; height: 40px; align-items: flex-end; padding: 0 4px; }
.rci .bar { position: relative; width: 14px; height: 38px; background: rgba(0, 0, 0, 0.35); border-radius: 3px; overflow: hidden; }
.rci .fill { position: absolute; bottom: 12px; left: 0; right: 0; transition: height 0.4s; max-height: 26px; }
.rci .bar span { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 700; line-height: 12px; color: var(--dim); }
.actions { display: flex; gap: 6px; }
.actions button { background: var(--panel2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }
.actions button:hover { border-color: var(--accent); }

/* ---------- utilities / advisor ---------- */
#utilities { position: fixed; top: 60px; left: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; z-index: 5; width: 230px; }
.ut { display: flex; align-items: center; gap: 7px; font-size: 12px; margin: 3px 0; }
.ut span { width: 18px; text-align: center; }
.ubar { flex: 1; height: 7px; background: rgba(0, 0, 0, 0.35); border-radius: 4px; overflow: hidden; }
.ubar div { height: 100%; transition: width 0.4s; }
.ut small { color: var(--dim); min-width: 62px; text-align: right; }
#advisor { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: rgba(255, 248, 225, 0.94); color: #3e2f12; padding: 7px 14px; border-radius: 20px; font-size: 13px; z-index: 5; max-width: 560px; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); pointer-events: none; }

/* ---------- barker ---------- */
#barker { position: fixed; top: 200px; left: 10px; width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; z-index: 5; overflow: hidden; transition: box-shadow 0.3s; }
#barker.ping { box-shadow: 0 0 0 2px #ffb74d; }
#barker .head { padding: 6px 10px; font-weight: 700; font-size: 13px; background: rgba(255, 183, 77, 0.16); cursor: pointer; }
#barker .head small { font-weight: 400; color: var(--dim); font-size: 11px; }
#barker.collapsed #barks { display: none; }
#barks { overflow-y: auto; max-height: inherit; }
.facs { margin: 4px 0 2px; }
.fac { display: grid; grid-template-columns: 1fr 70px 42px; align-items: center; gap: 6px; font-size: 12px; padding: 1px 0; }
.fac i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; display: block; }
.fac i b { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.fac em { font-style: normal; text-align: right; font-weight: 700; }
.fac.pos em { color: var(--good); } .fac.neg em { color: #ef5350; }
.fac.pos i b { background: var(--good); left: 50%; } .fac.neg i b { background: #ef5350; right: 50%; }
details.why { margin: 2px 0 6px; } details.why summary { cursor: pointer; color: var(--accent); font-size: 12px; }
#barks { max-height: 300px; overflow-y: auto; }
.bark { display: flex; gap: 8px; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 12px; animation: slidein 0.35s ease; }
.bark .av { width: 26px; height: 26px; border-radius: 50%; background: #ffb74d; color: #3e2723; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.bark b { color: #ffcc80; font-size: 11px; }
.bark p { margin: 2px 0 0; color: #dbe4ee; line-height: 1.3; }
@keyframes slidein { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ---------- overlays ---------- */
#overlays { position: fixed; right: 10px; top: 64px; display: grid; grid-template-columns: repeat(2, 34px); gap: 4px; background: var(--panel); padding: 6px; border-radius: 10px; border: 1px solid var(--line); z-index: 5; }
#overlays button { width: 34px; height: 34px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.05); border-radius: 8px; font-size: 17px; }
#overlays button:hover { border-color: var(--line); }
#overlays button.active { border-color: var(--accent); background: rgba(79, 195, 247, 0.25); }
#ovLabel { position: fixed; left: 50%; transform: translateX(-50%); top: 98px; cursor: pointer; border: 1px solid var(--accent); background: var(--panel2); padding: 6px 12px; border-radius: 8px; font-size: 13px; z-index: 5; }

/* ---------- toolbar ---------- */
#toolbar { display: flex; gap: 4px; background: var(--panel); padding: 6px; border-radius: 14px; border: 1px solid var(--line); z-index: 6; }
#toolbar .cat { display: flex; flex-direction: column; align-items: center; width: 74px; padding: 6px 2px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.04); border-radius: 10px; }
#toolbar .cat .ic { font-size: 22px; }
#toolbar .cat .lb { font-size: 10.5px; color: var(--dim); margin-top: 2px; white-space: nowrap; }
#toolbar .cat:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.08); }
#toolbar .cat.active { border-color: var(--accent); background: rgba(79, 195, 247, 0.22); }
#toolbar .cat.active .lb { color: #fff; }
#toolbar .bulldoze { margin-left: 8px; }
#toolbar .bulldoze.active { border-color: var(--bad); background: rgba(239, 83, 80, 0.25); }
#toolpanel { display: flex; flex-direction: column; gap: 6px; background: var(--panel); padding: 8px; border-radius: 12px; border: 1px solid var(--line); z-index: 6; max-width: 94vw; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.card { position: relative; width: 112px; min-height: 104px; border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; flex: none; }
.card:hover { border-color: rgba(79, 195, 247, 0.6); }
.card.active { border-color: var(--accent); background: rgba(79, 195, 247, 0.22); }
.card .cic { font-size: 26px; padding: 0 8px 4px; border-radius: 6px; }
.card .cn { font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.card .cc { font-size: 11px; color: #ffe082; }
.card .up { color: var(--dim); }
.card .sz { position: absolute; top: 4px; right: 6px; font-size: 9.5px; color: var(--dim); }
.card.locked { opacity: 0.55; }
.card.opt { width: 78px; min-height: 0; justify-content: center; background: rgba(255, 255, 255, 0.04); border-style: dashed; }
.card.opt .cic { font-size: 20px; }
.card.opt.active { border-style: solid; }
.card .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 16, 26, 0.6); border-radius: 10px; font-size: 12px; font-weight: 700; }

/* ---------- panels ---------- */
.panel { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; z-index: 8; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
#infoPanel { right: 62px; bottom: 100px; width: 300px; font-size: 13px; }
#infoPanel .ih { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; }
#infoPanel .sub { color: var(--dim); font-size: 12px; margin: 3px 0 8px; }
#infoPanel .x { background: none; border: 0; color: var(--dim); font-size: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 5px 0; }
.row.big { font-size: 15px; border-top: 1px solid var(--line); padding-top: 6px; }
.mbar { width: 130px; height: 8px; background: rgba(0, 0, 0, 0.35); border-radius: 4px; overflow: hidden; }
.mbar div { height: 100%; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 8px 0; font-size: 12px; }
.warn { background: rgba(239, 83, 80, 0.18); border: 1px solid rgba(239, 83, 80, 0.5); padding: 6px 8px; border-radius: 8px; font-size: 12px; margin: 6px 0; }
.panel button.danger { width: 100%; margin-top: 6px; background: rgba(239, 83, 80, 0.2); border: 1px solid rgba(239, 83, 80, 0.5); padding: 6px; border-radius: 8px; }
#budgetPanel { right: 10px; top: 60px; width: 380px; font-size: 13px; }
#budgetPanel .sect { font-weight: 700; margin: 10px 0 4px; color: var(--accent); }
#budgetPanel .sect small { color: var(--dim); font-weight: 400; }
.taxrow { display: grid; grid-template-columns: 12px 90px 1fr 36px 66px; align-items: center; gap: 6px; margin: 4px 0; }
.taxrow .dot { width: 10px; height: 10px; border-radius: 50%; }
.taxrow input { width: 100%; accent-color: #4fc3f7; }
.taxrow .inc { text-align: right; color: var(--good); }
#infoPanel { max-height: calc(100vh - 170px); overflow-y: auto; }
.sect2 { font-weight: 700; color: var(--accent); margin: 10px 0 4px; font-size: 12.5px; }
.uprow { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.uprow > div { flex: 1; min-width: 0; }
.uprow small { display: block; color: var(--dim); font-size: 11px; line-height: 1.25; }
.uic { font-size: 18px; width: 22px; text-align: center; }
.hhsum { color: var(--dim); font-size: 12px; margin: 2px 0 6px; }
.pp { display: grid; grid-template-columns: 20px 1fr auto; column-gap: 6px; align-items: baseline; margin: 3px 0; }
.pp b { font-weight: 600; } .pp i { font-style: normal; color: var(--dim); font-size: 12px; }
.pp small { grid-column: 2 / 4; color: var(--dim); font-size: 11px; margin-top: -1px; }
.pets { font-size: 12px; margin: 4px 0 2px; padding: 4px 7px; background: var(--panel2); border-radius: 7px; }
.hhlist { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.hh { border-top: 1px solid var(--line); padding: 5px 0; }
.hht { font-size: 12px; margin-bottom: 2px; }
.jbtns { display: flex; gap: 3px; flex: 0 0 auto !important; }
.jbtns button.mini { padding: 3px 6px; }
.panel button.mini:disabled { opacity: 0.35; cursor: default; }
.panel button.mini { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; white-space: nowrap; font-size: 12px; }
.panel button.mini:hover { border-color: var(--accent); }
.panel button.mini.on { border-color: var(--good); color: var(--good); }
.loanrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 5px 0; }
.loanrow small { display: block; color: var(--dim); font-size: 11.5px; }
.loanrow button { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; white-space: nowrap; }
.loanrow button:hover { border-color: var(--accent); }
#budgetPanel { max-height: calc(100vh - 80px); overflow-y: auto; }
#eduPanel { right: 10px; top: 60px; width: 380px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
#eduPanel .sect { font-weight: 700; margin: 10px 0 4px; color: var(--accent); }
#eduPanel .sect small { color: var(--dim); font-weight: 400; }
.dropwrap { position: relative; }
#cityMenu { position: absolute; right: 0; top: calc(100% + 6px); display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; z-index: 30; min-width: 190px; }
#cityMenu button { text-align: left; white-space: nowrap; }
#cityMenu.hidden { display: none; }
#commPanel, #achievePanel { right: 10px; top: 60px; width: 380px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.ach { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; margin: 6px 0; }
.ach.done { border-color: var(--good); }
.ach .ah { display: flex; gap: 6px; align-items: center; }
.ach .ah b { flex: 1; }
.ach small { display: block; color: var(--dim); margin-top: 2px; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.subtabs button { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 7px; padding: 3px 10px; font-size: 12px; color: var(--dim); }
.subtabs button.on { border-color: var(--accent); color: #fff; background: rgba(79, 195, 247, 0.22); }
.tcards { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; max-width: 92vw; }
.ovsep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 2px 0; }
#citizensPanel, #tourismPanel { right: 10px; top: 60px; width: 380px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
#transitPanel { right: 10px; top: 60px; width: 430px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.lanechip { display: inline-block; padding: 1px 6px; margin-left: 3px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.lanechip.on { border-color: #ffd54f; color: #ffd54f; }
.lsw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.mbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 4px 0 2px; }
.mbar div { height: 100%; }
#tradePanel { right: 10px; top: 60px; width: 470px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.tsect { font-weight: 700; color: var(--accent); margin: 10px 0 2px; }
.ttab { width: 100%; border-collapse: collapse; font-size: 12px; }
.ttab th { color: var(--dim); font-weight: 400; text-align: right; padding: 2px 3px; }
.ttab td { text-align: right; padding: 3px 3px; border-top: 1px solid var(--line); white-space: nowrap; }
.ttab td:first-child, .ttab th:first-child { text-align: left; }
.ttab td.ok { color: var(--good); } .ttab td.bad { color: #ef5350; } .ttab td.dim { color: var(--dim); }
.ttab button.mini { padding: 1px 5px; font-size: 11px; }
.prod { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; margin: 7px 0; }
.prod .ph { display: flex; align-items: center; gap: 6px; }
.prod .ph b { flex: 1; }
.prod small { display: block; color: var(--dim); margin-top: 3px; line-height: 1.4; }
.prod small .ok { color: var(--good); } .prod small .bad { color: #ef5350; }
.hint { color: var(--dim); font-size: 11.5px; margin: 8px 0 0; }
#menuPanel { right: 10px; top: 60px; width: 230px; display: flex; flex-direction: column; gap: 6px; }
#menuPanel button { background: var(--panel2); border: 1px solid var(--line); padding: 8px; border-radius: 8px; text-align: left; }
#menuPanel button:hover { border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 2px; }

/* ---------- tooltip / toasts ---------- */
#tooltip { position: fixed; z-index: 20; background: rgba(10, 16, 26, 0.92); padding: 5px 9px; border-radius: 6px; font-size: 12.5px; pointer-events: none; white-space: nowrap; border: 1px solid var(--line); }
#toasts { position: fixed; top: 136px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 30; pointer-events: none; }
.toast { background: var(--panel2); padding: 8px 16px; border-radius: 8px; font-size: 13.5px; border: 1px solid var(--line); transition: opacity 0.5s, transform 0.5s; }
.toast.bad { border-color: var(--bad); }
.toast.good { border-color: var(--good); }
.toast.out { opacity: 0; transform: translateY(-10px); }
.float { position: fixed; z-index: 25; font-weight: 700; font-size: 14px; pointer-events: none; animation: floatup 1.2s ease-out forwards; text-shadow: 0 1px 3px #000; }
.float.bad { color: #ff8a80; }
.float.good { color: #b9f6ca; }
@keyframes floatup { to { transform: translateY(-40px); opacity: 0; } }
#milestoneBanner { position: fixed; top: 110px; left: 50%; transform: translate(-50%, -20px); opacity: 0; transition: all 0.6s; background: linear-gradient(135deg, #ffd54f, #ffb300); color: #3e2a00; padding: 14px 34px; border-radius: 14px; text-align: center; z-index: 40; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); pointer-events: none; }
#milestoneBanner.show { opacity: 1; transform: translate(-50%, 0); }
#milestoneBanner .mt { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#milestoneBanner .mn { font-size: 24px; font-weight: 800; }
#milestoneBanner .mr { font-size: 12px; }

/* ---------- start / help ---------- */
#start, #help { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; background: radial-gradient(ellipse at center, rgba(10, 18, 30, 0.35), rgba(10, 18, 30, 0.8)); transition: opacity 0.6s; }
#start.gone { opacity: 0; pointer-events: none; }
.startbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 40px; text-align: center; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.startbox h1 { margin: 0; font-size: 46px; letter-spacing: -1px; }
.startbox h1 span { color: var(--accent); }
.startbox .tag { color: var(--dim); margin: 6px 0 20px; }
.startbox .btns { display: flex; gap: 10px; justify-content: center; }
.startbox button { padding: 11px 22px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 15px; }
.startbox button:disabled { opacity: 0.4; cursor: default; }
.startbox button.primary { background: var(--accent); color: #0e1622; font-weight: 700; border: 0; }
.startbox .tips { list-style: none; padding: 0; margin: 22px 0 10px; text-align: left; display: inline-block; color: #cfd8e3; line-height: 1.9; }
.startbox .small { color: var(--dim); font-size: 12px; }
#help .startbox { text-align: left; }
#help h2 { margin: 6px 0 10px; font-size: 18px; color: var(--accent); }
#help ol { padding-left: 20px; line-height: 1.6; font-size: 14px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13.5px; margin-bottom: 14px; }
@media (max-width: 1100px) {
  #toolbar .cat { width: 48px; }
  #toolbar .cat .lb { display: none; }
  .stats { gap: 10px; }
  #utilities, #barker { width: 190px; }
  #advisor { left: 210px; right: 60px; transform: none; max-width: none; }
}
@media (max-width: 800px) {
  #topbar { gap: 8px; padding: 0 8px; }
  #cityName { width: 100px; font-size: 14px; }
  .rci, .stat:nth-child(3), .stat:nth-child(4), .pill, #net { display: none; }
  .speed button { padding: 5px 6px; }
  .actions button { padding: 6px 8px; }
  #btnBudget { font-size: 0; } #btnBudget .ico { width: 16px; height: 16px; }
  #barker { display: none; }
}
kbd { background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* economy, statistics and development panels */
#econPanel { right: 10px; top: 60px; width: 470px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
#econRows { margin-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 6px; }
.kpis > div { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; }
.kpis b { font-size: 17px; margin: 1px 0; }
.kpis small { color: var(--dim); font-size: 11px; }
.mbar.wide { width: 100%; height: 12px; display: flex; margin: 4px 0; }
.hbars { display: flex; align-items: flex-end; gap: 4px; height: 80px; margin: 4px 0 2px; }
.hbars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.hbars i { display: block; border-radius: 3px 3px 0 0; min-height: 1px; }
.hbars small { color: var(--dim); font-size: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 2px 8px; font-size: 12px; }
#statsPanel { right: 10px; top: 60px; width: 560px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
#statsCtl .sgrp { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 3px 0; }
#statsCtl .sgrp small { color: var(--dim); width: 58px; }
#statsCtl button.mini { padding: 2px 7px; font-size: 11px; }
svg.chart { width: 100%; height: auto; margin-top: 8px; background: rgba(0, 0, 0, 0.18); border-radius: 8px; }
svg.chart text { fill: var(--dim); font-size: 10px; }
svg.chart .grid { stroke: rgba(255, 255, 255, 0.08); }
svg.chart .zero { stroke: rgba(255, 255, 255, 0.35); stroke-dasharray: 3 3; }
svg.chart .hair { stroke: rgba(255, 255, 255, 0.5); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#devPanel { right: 10px; top: 60px; width: 620px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.devhead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.devhead .pts { font-size: 22px; color: #ce93d8; }
.devtree { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.branch { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.branch .bh { font-weight: 700; color: var(--accent); font-size: 12px; }
.node { display: flex; align-items: center; gap: 6px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; color: inherit; }
.node .ni { font-size: 16px; }
.node .nn { flex: 1; font-size: 12px; font-weight: 600; }
.node .nn small { display: block; font-weight: 400; color: var(--dim); font-size: 11px; }
.node .nc { font-weight: 700; color: #ce93d8; min-width: 16px; text-align: right; }
.node.can { border-color: #ce93d8; cursor: pointer; }
.node.can:hover { background: rgba(206, 147, 216, 0.18); }
.node.got { border-color: var(--good); background: rgba(102, 187, 106, 0.14); }
.node.got .nc { color: var(--good); }
.node.locked { opacity: 0.45; }
.node.poor { opacity: 0.75; }
.badge { background: #ab47bc; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
#btnCity.attn { border-color: #ce93d8; }

/* new city setup */
#newCityBox { text-align: left; max-width: 760px; }
#newCityBox h2 { margin: 0 0 10px; }
.nc-grid { display: grid; grid-template-columns: 1fr 250px; gap: 18px; }
.nc-l { display: block; color: var(--accent); font-weight: 700; font-size: 12px; margin: 10px 0 4px; }
#newCityBox input:not([type=checkbox]) { background: var(--panel2); border: 1px solid var(--line); color: inherit; border-radius: 7px; padding: 6px 8px; }
#ncName { width: 100%; box-sizing: border-box; }
#ncSeed { width: 110px; }
.nc-cards { display: flex; flex-wrap: wrap; gap: 5px; }
.nc-cards button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 82px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font-size: 20px; color: inherit; }
.nc-cards button b { font-size: 11px; font-weight: 600; }
.nc-cards button.on { border-color: var(--accent); background: rgba(79, 195, 247, 0.2); }
.nc-cards .del { position: absolute; top: 1px; right: 4px; font-size: 10px; color: var(--dim); }
.nc-cards .del:hover { color: var(--bad); }
#ncPreview { width: 240px; height: 240px; border-radius: 10px; border: 1px solid var(--line); image-rendering: pixelated; display: block; margin-bottom: 4px; }
#newCityBox .check { display: block; margin-top: 10px; }
.startbox.hidden { display: none; }
/* map editor */
#editorBar { display: none; position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; z-index: 9; flex-direction: column; gap: 6px; max-width: calc(100vw - 30px); }
body.editing #editorBar { display: flex; }
.eb-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.eb-row small { color: var(--dim); margin: 0 2px 0 6px; }
#editorBar button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: inherit; }
#editorBar button[data-brush] { display: flex; flex-direction: column; align-items: center; font-size: 18px; min-width: 58px; }
#editorBar button[data-brush] small { font-size: 10px; margin: 0; }
#editorBar button.on { border-color: var(--accent); background: rgba(79, 195, 247, 0.22); }
#editorBar button.primary { background: var(--accent); color: #0e1622; font-weight: 700; }
#editorBar input#edName, #editorBar select { background: var(--panel2); border: 1px solid var(--line); color: inherit; border-radius: 7px; padding: 4px 6px; }
body.editing header, body.editing #toolbar, body.editing #toolpanel, body.editing #utilities, body.editing #advisor, body.editing #barker,
body.editing #overlays, body.editing #ovLabel, body.editing #infoPanel, body.editing .panel, body.editing #tutorial { display: none !important; }
/* photo mode */
#photoBar { display: none; position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(14, 22, 34, 0.75); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; z-index: 30; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
body.photo #photoBar { display: flex; }
#photoBar button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; color: inherit; }
#photoBar button.primary { background: var(--accent); color: #0e1622; font-weight: 700; }
#photoBar input[type=range] { width: 110px; vertical-align: middle; }
body.photo header, body.photo #toolbar, body.photo #toolpanel, body.photo #utilities, body.photo #advisor, body.photo #barker, body.photo #overlays,
body.photo #ovLabel, body.photo #infoPanel, body.photo .panel, body.photo #toasts, body.photo #milestoneBanner, body.photo #tutorial, body.photo #tooltip { display: none !important; }
#photoTilt { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#photoTilt div { position: absolute; left: 0; right: 0; height: 34%; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#photoTilt div:first-child { top: 0; mask-image: linear-gradient(to bottom, #000, transparent); -webkit-mask-image: linear-gradient(to bottom, #000, transparent); }
#photoTilt div:last-child { bottom: 0; mask-image: linear-gradient(to top, #000, transparent); -webkit-mask-image: linear-gradient(to top, #000, transparent); }
#photoVig { position: fixed; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.45) 100%); display: none; }
body.photo #photoVig:not(.hidden) { display: block; }
body:not(.photo) #photoTilt { display: none; }
/* tutorial */
#tutorial { position: fixed; left: 50%; top: 104px; transform: translateX(-50%); width: 420px; max-width: calc(100vw - 30px); background: var(--panel); border: 1px solid #ce93d8; border-radius: 12px; padding: 10px 14px; z-index: 12; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); font-size: 13px; }
#tutorial .th { display: flex; justify-content: space-between; align-items: center; color: var(--dim); }
#tutorial .th button { background: none; border: 0; color: var(--dim); }
#tutorial b { font-size: 15px; }
#tutorial p { margin: 4px 0 8px; line-height: 1.4; }
#tutorial .tb { display: flex; justify-content: flex-end; }
#tutorial .tb button { background: var(--accent); color: #0e1622; border: 0; border-radius: 8px; padding: 5px 14px; font-weight: 700; }
#toolbar .cat.tut { border-color: #ce93d8 !important; box-shadow: 0 0 0 2px #ce93d8, 0 0 14px #ce93d8; animation: tutpulse 1.2s infinite alternate; }
@keyframes tutpulse { from { box-shadow: 0 0 0 2px #ce93d8, 0 0 4px #ce93d8; } to { box-shadow: 0 0 0 2px #ce93d8, 0 0 16px #ce93d8; } }

/* weather */
.stat.wx { cursor: pointer; }
#weatherPanel { right: 10px; top: 60px; width: 400px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.wxnow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wxnow .big { font-size: 40px; }
.wxnow b { display: block; font-size: 16px; }
.wxnow small { color: var(--dim); }
.fc { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 4px; }
.fc > div { display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 7px; padding: 3px 0; }
.fc small { color: var(--dim); font-size: 10px; }
.fc span { font-size: 18px; }
.fc b { font-size: 12px; }

/* events */
#eventsPanel { right: 10px; top: 60px; width: 430px; font-size: 13px; max-height: calc(100vh - 80px); overflow-y: auto; }
.evhost { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.panel button.mini.evb { display: flex; flex-direction: column; align-items: flex-start; padding: 3px 7px; }
.panel button.mini.evb small { color: var(--dim); font-size: 10px; }
.evnow { display: flex; gap: 8px; align-items: flex-start; background: rgba(206, 147, 216, 0.12); border: 1px solid rgba(206, 147, 216, 0.4); border-radius: 8px; padding: 6px 8px; margin: 4px 0; }
.evnow > span { font-size: 26px; }
.evnow small { display: block; }
.evsq { border-top: 1px solid var(--line); padding-top: 4px; }

/* road tool panel */
#roadPanel { position: fixed; left: 10px; bottom: 10px; z-index: 6; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
#roadPanel .rp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#roadPanel .rp-lb { font-weight: 600; white-space: nowrap; }
#roadPanel .rp-btns { display: flex; align-items: center; gap: 3px; }
#roadPanel .rp-snaps { justify-content: flex-end; gap: 3px; padding-top: 2px; }
#roadPanel button { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); color: #cfd8e3; }
#roadPanel button:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
#roadPanel button.on { background: #1d7fb0; border-color: var(--accent); color: #fff; }
#roadPanel button.muted { opacity: 0.4; }
#roadPanel .rp-val { min-width: 62px; text-align: center; padding: 5px 6px; background: rgba(0, 0, 0, 0.35); border-radius: 6px; font-variant-numeric: tabular-nums; }
#roadPanel .rp-par { display: flex; align-items: center; gap: 3px; margin-right: 4px; }
#roadPanel .rp-par.off { opacity: 0.45; }
#roadPanel .rp-par button { width: 24px; font-size: 16px; }
@media (max-width: 1250px) { #roadPanel { bottom: auto; top: 244px; } }

/* ---- main menu: wordmark top left, account top right, the menu bottom left over the circling city */
#help { z-index: 60; }
body.at-menu #topbar, body.at-menu #utilities, body.at-menu #advisor, body.at-menu #barker, body.at-menu #overlays, body.at-menu #ovLabel,
body.at-menu #buildbar, body.at-menu #roadPanel, body.at-menu .panel, body.at-menu #tooltip, body.at-menu #tutorial, body.at-menu #milestoneBanner { display: none !important; }
.sm { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 20px; padding: clamp(16px, 4vh, 40px) clamp(16px, 4vw, 56px) clamp(30px, 5vh, 52px); overflow: auto; }
.sm.hidden { display: none; }
.sm-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sm-brand { display: flex; align-items: center; gap: 14px; filter: drop-shadow(0 6px 22px rgba(6, 9, 24, 0.5)); }
.sm-mark { width: clamp(46px, 7vh, 62px); height: auto; flex: none; }
.sm-word { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5.2vh, 48px); letter-spacing: -0.03em; line-height: 1; color: #fff; }
.sm-cols { display: grid; grid-template-columns: minmax(270px, 380px) minmax(270px, 370px); justify-content: space-between; align-items: end; gap: 24px; }
.sm-menu { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.sm-menu > button { display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border: 0; border-radius: 14px; background: transparent; color: var(--text);
  font-family: var(--display); font-weight: 700; font-size: clamp(18px, 2.5vh, 22px); letter-spacing: -0.01em; text-align: left; transition: background 0.12s; }
.sm-menu > button i { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--ink-2); color: var(--hat); box-shadow: 0 2px 0 var(--ink-0); transition: background 0.12s, color 0.12s, transform 0.12s; }
.sm-menu > button i svg { width: 22px; height: 22px; }
.sm-menu > button span { display: flex; flex-direction: column; }
.sm-menu > button small { font-family: var(--ui); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--dim); }
.sm-menu > button small:empty { display: none; }
.sm-menu > button:hover:not(:disabled) { background: rgba(163, 171, 203, 0.1); }
.sm-menu > button:hover:not(:disabled) i, #btnContinue:not(:disabled) i { background: var(--hat); color: var(--hat-ink); box-shadow: 0 2px 0 var(--hat-edge); }
.sm-menu > button:hover:not(:disabled) i { transform: rotate(-4deg); }
.sm-menu > button:disabled { opacity: 0.4; cursor: default; }
.sm-minor { display: flex; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sm-minor button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 6px; }
.sm-minor button svg { width: 16px; height: 16px; color: var(--dim); flex: none; }
.sm-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sm-card { display: flex; gap: 14px; padding: 12px; align-items: center; }
.sm-card img, .sm-card .ph { width: 136px; height: 92px; object-fit: cover; border-radius: 12px; flex: none; background: var(--ink-2); display: grid; place-items: center; font-size: 42px; }
.sm-card .tx { flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.sm-card .tx b { display: block; font-family: var(--display); font-size: 18px; letter-spacing: -0.01em; }
.sm-card .tx small { display: block; color: var(--dim); }
.sm-card button { display: block; margin-top: 10px; padding: 8px 16px; }
.sm-account { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 16px; border-radius: 999px; font-size: 14px; color: var(--text); max-width: 100%; }
.sm-account > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 6px; color: var(--dim); }
.sm-account > span b { color: var(--text); }
.sm-account form { margin: 0; }
.sm-account a, .sm-account button { display: inline-block; padding: 8px 15px; border-radius: 999px; text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.sm-sync { display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 14px; border-radius: 14px; background: rgba(255, 201, 60, 0.14); box-shadow: inset 0 0 0 1.5px rgba(255, 201, 60, 0.45); backdrop-filter: blur(10px); font-size: 13.5px; color: var(--text); text-align: left; }
.sm-sync > span { flex: 1; min-width: 0; }
#start .sm-sync button { padding: 7px 14px; }
#lbSync { margin: 10px 0 0; }
.sm-news { padding: 14px 16px 10px; overflow: auto; max-height: 34vh; }
.sm-h { font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; margin-bottom: 4px; }
.sm-news ul { list-style: none; margin: 0; padding: 0; }
.sm-news li { padding: 6px 0; font-size: 13px; line-height: 1.4; }
.sm-news li + li { border-top: 1px solid var(--line); }
.sm-news li b { display: block; color: var(--text); font-weight: 650; }
.sm-news li span { color: var(--dim); }
.sm-ver { position: fixed; left: clamp(16px, 4vw, 56px); bottom: 10px; display: flex; align-items: center; gap: 14px; font-size: 12px; color: rgba(241, 243, 250, 0.6); }
.sm-ver .ico { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 760px) {
  .sm-cols { grid-template-columns: 1fr; align-items: start; }
  .sm-news { display: none; }
  .sm-account > span { display: none; }
}
/* load game, save game */
.startbox.wide { max-width: 940px; width: 94vw; }
.lb-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; text-align: left; margin: 10px 0 14px; }
.lb-list { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.lb-city { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin: 8px 0 2px; }
.lb-city:first-child { margin-top: 0; }
.lb-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 5px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.lb-row:hover { background: rgba(255, 255, 255, 0.06); }
.lb-row.on { background: rgba(79, 195, 247, 0.14); border-color: var(--accent); }
.lb-row img, .lb-row .ph { width: 64px; height: 36px; object-fit: cover; border-radius: 3px; background: #2b3a4d; display: grid; place-items: center; }
.lb-row b { display: block; font-size: 14px; }
.lb-row small, .lb-row .ago { color: var(--dim); font-size: 12px; }
.lb-detail img, .lb-detail .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #2b3a4d; display: grid; place-items: center; font-size: 60px; }
.lb-detail h3 { margin: 10px 0 2px; }
.lb-detail .row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.lb-detail .row span { color: var(--dim); }
.lb-detail .btns { margin-top: 12px; justify-content: flex-start; }
.lb-empty { color: var(--dim); padding: 30px 10px; text-align: center; }
#saveBox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(8, 16, 28, 0.5); }
#saveBox.hidden { display: none; }
#saveBox .startbox { width: min(520px, 94vw); text-align: left; }
#saveBox input { width: 100%; padding: 9px 10px; font-size: 15px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--text); margin: 4px 0 4px; }
.sb-list { max-height: 34vh; margin: 10px 0 14px; }
.op-rows { display: flex; flex-direction: column; gap: 10px; text-align: left; margin: 12px 0 16px; }
.op-sel select { margin-left: 8px; padding: 5px; border-radius: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.op-store { font-size: 12px; color: var(--dim); }

/* ---- options */
.op-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 0; overflow-x: auto; }
.op-tabs button { border: 0; background: none; padding: 9px 14px; font-size: 14px; color: var(--dim); border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap; }
.op-tabs button.on { color: #fff; border-bottom-color: var(--accent); }
.op-body { text-align: left; min-height: 46vh; max-height: 56vh; overflow: auto; padding: 8px 4px 4px; }
.op-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.op-item > span:first-child { display: flex; flex-direction: column; }
.op-item small { color: var(--dim); font-size: 12px; font-weight: normal; }
.op-item input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.op-item select { padding: 6px 8px; border-radius: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); flex: none; }
.op-range { display: flex; align-items: center; gap: 8px; flex: none; }
.op-range i { font-style: normal; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.op-presets { display: flex; gap: 6px; }
.startbox .op-presets button, .startbox .op-item button { padding: 7px 14px; font-size: 13px; }
.startbox button.danger { background: rgba(239, 83, 80, 0.18); border-color: rgba(239, 83, 80, 0.5); }
.op-note { color: var(--dim); font-size: 13px; padding: 8px 4px; }
.op-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 4px; font-size: 13px; align-items: center; }
.op-keys kbd { font-family: inherit; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; white-space: nowrap; }
#optionsBox .btns { justify-content: space-between; }
body.no-barker #barker, body.no-advisor #advisor { display: none !important; }
#fps { position: fixed; right: 8px; bottom: 6px; z-index: 80; font: 12px/1 monospace; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 4px 6px; border-radius: 4px; pointer-events: none; }
#topbar, #utilities, #advisor, #barker, #overlays, #buildbar, .panel, #roadPanel, #toasts, #milestoneBanner, #tutorial, #ovLabel { zoom: var(--ui-scale, 1); }

/* ======================================================================================
   City Architect look: blueprint and building site. Blueprint-indigo glass panels with soft
   rounded corners, hard-hat yellow for whatever is chosen or is the main action, buttons with a
   pressable bottom edge, Bricolage Grotesque for titles and Figtree for everything else.
   ====================================================================================== */
:root {
  --ink-0: #0c1024;                  /* the dark bottom edge under raised things */
  --ink-1: rgba(22, 27, 52, 0.9);    /* panels */
  --ink-2: #262e55;                  /* raised: buttons, cards */
  --ink-3: #323c6c;                  /* raised, hovered */
  --hat: #ffc93c;                    /* hard-hat yellow: selected, primary */
  --hat-edge: #b8861b;
  --hat-ink: #1a1f3a;
  --panel: var(--ink-1);
  --panel2: var(--ink-2);
  --line: rgba(163, 171, 203, 0.16);
  --text: #f1f3fa;
  --dim: #a3abcb;
  --accent: var(--hat);
  --sel: var(--hat);
  --good: #5bd08a;
  --bad: #ff6b6b;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(6, 9, 24, 0.45);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --ui: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}
html, body { background: #10142a; font-family: var(--ui); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(163, 171, 203, 0.3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--hat); outline-offset: 2px; }
input[type=range], input[type=checkbox] { accent-color: var(--hat); }
.ok, .good { color: var(--good); }
.bad { color: var(--bad); }

/* ---- surfaces: rounded indigo glass */
#utilities, #barker, #overlays, #toolbar, #toolpanel, .panel, #roadPanel, .startbox, #tutorial, #editorBar, #photoBar, #cityMenu, #advisor, #ovLabel, .toast, #tooltip,
.sm-menu, .sm-card, .sm-news, .sm-account, #topbar > div {
  background: var(--panel); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text);
}
.startbox, .sm-menu { border-radius: 22px; }
.sm-card, .sm-news { border-radius: 18px; }
.startbox { padding: 26px 30px; }
#tooltip { background: rgba(14, 18, 40, 0.95); border-radius: var(--r-sm); }
#start { background: linear-gradient(90deg, rgba(10, 13, 32, 0.78) 0%, rgba(10, 13, 32, 0.3) 42%, rgba(10, 13, 32, 0.08) 62%, rgba(10, 13, 32, 0.5) 100%); }
#saveBox { background: rgba(10, 13, 32, 0.55); }

/* ---- drawn icons (icons.js): sized by the text they sit in, like the emoji they replace */
svg.ico { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.24em; flex: none; overflow: visible; }

/* ---- type: sentence case throughout; titles in Bricolage */
.panel h3, .startbox h2, #help h2 { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; text-transform: none; color: #fff; margin: 0 0 12px; padding: 0; border: 0; text-align: left; }
.startbox h2 { font-size: 22px; }
#help h2 { margin-top: 4px; }
.sect, .sect2, .tsect, #budgetPanel .sect, #eduPanel .sect, .branch .bh, .nc-l, .lb-city {
  font-family: var(--ui); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: #d5daf0;
}
.sect small, #budgetPanel .sect small, #eduPanel .sect small { font-weight: 500; color: var(--dim); }
.nc-l { margin-top: 14px; }
.hint { line-height: 1.45; }
details.why summary { color: #ffd978; }
#cityName { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; border-radius: var(--r-sm); }
.stat b, .kpis b, #roadPanel .rp-val, .ttab td, .taxrow b, .op-range i { font-variant-numeric: tabular-nums; }

/* ---- buttons: raised tiles with a bottom edge that press down */
.panel button.mini, .loanrow button, #menuPanel button, .actions button, .startbox button, #editorBar button, #photoBar button, .subtabs button,
.nc-cards button, #cityMenu button, .panel button.danger, .sm-card button, .sm-minor button, .sm-account a, .sm-account button, #start .sm-sync button, #tutorial .tb button {
  border: 0; border-radius: var(--r-sm); background: var(--ink-2); color: var(--text); box-shadow: 0 2px 0 var(--ink-0);
  font-family: var(--ui); font-weight: 600; text-transform: none; letter-spacing: 0; transition: background 0.12s, color 0.12s, transform 0.06s, box-shadow 0.06s;
}
.panel button.mini:hover:not(:disabled), .loanrow button:hover, #menuPanel button:hover, .actions button:hover, .startbox button:hover:not(:disabled), #editorBar button:hover,
#photoBar button:hover, .subtabs button:hover, .nc-cards button:hover, #cityMenu button:hover, .sm-minor button:hover, .sm-account a:hover, .sm-account button:hover {
  background: var(--ink-3); color: #fff;
}
.panel button.mini:active:not(:disabled), .loanrow button:active, #menuPanel button:active, .actions button:active, .startbox button:active:not(:disabled), #editorBar button:active,
#photoBar button:active, .subtabs button:active, .nc-cards button:active, #cityMenu button:active, .sm-minor button:active, .sm-account a:active, .sm-account button:active,
.sm-card button:active, #start .sm-sync button:active:not(:disabled), #tutorial .tb button:active, .card:active, #toolbar .cat:active, #overlays button:active, #roadPanel button:active {
  transform: translateY(1px); box-shadow: 0 1px 0 var(--ink-0);
}
.startbox button { padding: 10px 18px; font-size: 14px; }
.actions button { padding: 7px 13px; font-size: 13px; }
#menuPanel button { padding: 9px 12px; }
.mregion { display: flex; flex-direction: column; gap: 5px; padding: 6px 0 2px; border-top: 1px solid var(--line); margin-top: 2px; }
.mregion small { font-size: 12.5px; font-weight: 700; color: #d5daf0; }
#mRegion { display: flex; gap: 4px; }
#menuPanel #mRegion button { flex: 1; padding: 7px 4px; font-size: 12px; text-align: center; white-space: nowrap; }
#menuPanel #mRegion button.on { background: var(--hat); color: var(--hat-ink); box-shadow: 0 2px 0 var(--hat-edge); }
#cityMenu { padding: 6px; border-radius: var(--r); }
#cityMenu button { box-shadow: none; background: transparent; padding: 7px 10px; }
/* primary: hard-hat yellow */
.startbox button.primary, #editorBar button.primary, #photoBar button.primary, #tutorial .tb button, .sm-card button, #start .sm-sync button, .sm-account a.go {
  background: var(--hat); color: var(--hat-ink); font-weight: 700; box-shadow: 0 2px 0 var(--hat-edge);
}
.startbox button.primary:hover:not(:disabled), #editorBar button.primary:hover, #photoBar button.primary:hover, #tutorial .tb button:hover, .sm-card button:hover,
#start .sm-sync button:hover:not(:disabled), .sm-account a.go:hover { background: #ffd666; color: var(--hat-ink); }
.startbox button.primary:active, .sm-card button:active, #start .sm-sync button:active:not(:disabled), .sm-account a.go:active, #tutorial .tb button:active { box-shadow: 0 1px 0 var(--hat-edge); }
#start .sm-sync button:disabled { opacity: 0.5; cursor: default; }
/* danger */
.panel button.danger, .startbox button.danger { background: rgba(255, 107, 107, 0.18); color: #ffc2c2; }
.panel button.danger:hover, .startbox button.danger:hover:not(:disabled) { background: var(--bad); color: #2a0d0d; }
/* selected */
.subtabs button.on, .nc-cards button.on, #editorBar button.on, .lanechip.on { background: var(--hat); color: var(--hat-ink); box-shadow: 0 2px 0 var(--hat-edge); border-color: transparent; }
.panel button.mini.on { background: rgba(91, 208, 138, 0.2); color: #b6f0cd; }
.op-tabs { border-bottom: 1px solid var(--line); gap: 2px; }
.op-tabs button { background: none !important; box-shadow: none !important; border-radius: 0; font-size: 14px; font-weight: 600; color: var(--dim); border-bottom: 3px solid transparent; }
.op-tabs button:hover { color: #fff !important; }
.op-tabs button.on { color: #fff; border-bottom-color: var(--hat); }
.nc-cards button { font-size: 20px; }
.nc-cards button b { font-size: 11.5px; }

/* ---- top bar: floating islands instead of one bar */
#topbar { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; height: 58px; padding: 8px 8px 0 10px; gap: 6px; align-items: stretch; }
/* the city name box is exactly as wide as the utilities and Barker panels under it */
#topbar .city { flex: none; width: 230px; }
#topbar #cityName { flex: 1; min-width: 0; width: auto; }
@media (max-width: 1100px) { #topbar .city { width: 190px; } }
#topbar > div { pointer-events: auto; display: flex; align-items: center; padding: 0 12px; border-radius: 14px; }
/* everything but the city name shares one bar: stats on the left, then speed, demand and the buttons */
#topbar .hud { flex: 1; min-width: 0; gap: 12px; padding: 0 6px 0 14px; }
#topbar .stats { gap: 14px; min-width: 0; }
#topbar .speed, #topbar .rci, #topbar .actions { flex: none; }
#topbar .speed { padding: 3px; gap: 2px; background: rgba(8, 11, 28, 0.45); border-radius: 10px; }
#topbar .rci { height: 40px; padding: 0 2px; }
#topbar .actions { gap: 5px; padding-left: 12px; border-left: 1px solid var(--line); }
#topbar .actions button { height: 36px; }
#topbar .dropwrap { display: flex; }
@media (max-width: 1366px) { #topbar .hud { gap: 9px; padding-left: 11px; } #topbar .stats { gap: 10px; } #topbar .actions { padding-left: 9px; } #topbar .actions button { padding: 7px 10px; } }
/* narrower: drop the milestone badge and the balance per hour, and never let the stats run under the controls */
@media (max-width: 1150px) { #topbar .pill, #topbar #net, #topbar .stat:nth-child(4) { display: none; } #topbar .stats { overflow: hidden; gap: 9px; } #topbar .hud { gap: 7px; } #topbar .speed button { padding: 5px 6px; } #cityName { font-size: 16px; } }
.pill { border-radius: 999px; background: rgba(255, 201, 60, 0.16); color: #ffd978; text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 600; }
.speed button { border-radius: 8px; color: #c7cde6; height: 32px; }
.speed button:hover { background: var(--ink-3); }
.speed button.active { background: var(--hat); color: var(--hat-ink); }
.rci .bar { border-radius: 5px; }

/* ---- left side: utilities and Barker */
#utilities { top: 62px; }
#barker .head { background: rgba(255, 201, 60, 0.12); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; }
#barker .head small { text-transform: none; }
.bark .av { background: var(--hat); color: var(--hat-ink); }
.bark b { color: #ffd978; }

/* ---- the build toolbar and its cards */
#toolbar { padding: 6px; gap: 4px; border-radius: 20px; }
#toolbar .cat { border: 0; border-radius: 14px; background: transparent; transition: background 0.12s; }
#toolbar .cat .lb { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; color: var(--dim); }
#toolbar .cat:hover { background: var(--ink-2); }
#toolbar .cat:hover .lb { color: #fff; }
#toolbar .cat.active { background: var(--hat); box-shadow: 0 2px 0 var(--hat-edge); }
#toolbar .cat.active .lb { color: var(--hat-ink); }
#toolbar .bulldoze.active { background: var(--bad); box-shadow: 0 2px 0 #a33a3a; }
#toolbar .bulldoze.active .lb { color: #2a0d0d; }
/* the build panel sits on the toolbar and is always exactly as wide as it; cards start at the left and scroll */
#buildbar { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 20px); }
#toolpanel { width: 0; min-width: 100%; max-width: none; padding: 8px; border-radius: 18px; align-items: stretch; }
#toolpanel .tcards { max-width: none; }
.card { border: 0; border-radius: var(--r); background: var(--ink-2); box-shadow: 0 2px 0 var(--ink-0); transition: background 0.12s; }
.card:hover { background: var(--ink-3); border-color: transparent; }
.card.active { background: rgba(255, 201, 60, 0.2); box-shadow: inset 0 0 0 2px var(--hat), 0 2px 0 var(--hat-edge); }
.card .cn { font-weight: 650; }
.card .cc { color: #ffd978; }
.card .lock { border-radius: var(--r); background: rgba(12, 16, 36, 0.68); text-transform: none; letter-spacing: 0; font-size: 12px; }
.card.opt { background: transparent; box-shadow: none; border: 1.5px dashed rgba(163, 171, 203, 0.32); }
.card.opt.active { border: 1.5px solid var(--hat); background: rgba(255, 201, 60, 0.16); }

/* ---- info views (overlays) and the road panel */
#overlays { border-radius: var(--r-lg); }
#overlays button { border: 0; border-radius: 10px; background: var(--ink-2); box-shadow: 0 2px 0 var(--ink-0); transition: background 0.12s; }
#overlays button:hover { background: var(--ink-3); }
#overlays button.active { background: var(--hat); box-shadow: 0 2px 0 var(--hat-edge); }
#roadPanel { border-radius: var(--r-lg); }
#roadPanel .rp-lb { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 650; }
#roadPanel button { border: 0; border-radius: var(--r-sm); background: var(--ink-2); color: #dfe3f3; box-shadow: 0 2px 0 var(--ink-0); transition: background 0.12s, color 0.12s; }
#roadPanel button:hover { background: var(--ink-3); color: #fff; }
#roadPanel button.on { background: var(--hat); color: var(--hat-ink); box-shadow: 0 2px 0 var(--hat-edge); }
#roadPanel .rp-val { border-radius: var(--r-sm); background: rgba(8, 11, 28, 0.5); }

/* ---- hints and messages */
#advisor { top: 64px; border-radius: 999px; padding: 8px 18px; }
#ovLabel { border: 0; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--hat), var(--shadow); }
.toast { border: 0; border-radius: var(--r); box-shadow: inset 4px 0 0 rgba(163, 171, 203, 0.5), var(--shadow); padding: 9px 16px 9px 18px; }
.toast.good { box-shadow: inset 4px 0 0 var(--good), var(--shadow); }
.toast.bad { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
#milestoneBanner { background: var(--hat); color: var(--hat-ink); border: 0; border-radius: 20px; padding: 14px 40px 16px; box-shadow: 0 4px 0 var(--hat-edge), 0 18px 40px rgba(6, 9, 24, 0.45); backdrop-filter: none; }
#milestoneBanner .mt { font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; color: rgba(26, 31, 58, 0.7); }
#milestoneBanner .mn { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; text-transform: none; }
#milestoneBanner .mr { color: rgba(26, 31, 58, 0.75); font-weight: 600; }
#tutorial { border: 0; box-shadow: inset 0 0 0 2px #ce93d8, var(--shadow); }
#tutorial .th button { background: none; box-shadow: none; color: var(--dim); }

/* ---- panel contents */
.kpis > div, .branch, .node, .ach, .prod, .fc > div, .evnow, .warn, .pets, .lb-row, .lb-row img, .lb-row .ph, .lb-detail img, .lb-detail .ph,
.sm-card img, .op-item select, .op-keys kbd, kbd, svg.chart, #ncPreview, .mbar, .ubar, .fac i, .fac i b, .hbars i, #saveBox input,
#newCityBox input:not([type=checkbox]), #editorBar input#edName, #editorBar select, .op-sel select { border-radius: var(--r-sm) !important; }
.chip, .lanechip { border-radius: 999px !important; }
.kpis > div, .branch, .ach, .prod, .fc > div, .chip { border: 0; background: rgba(163, 171, 203, 0.08); }
.lb-detail img, .lb-detail .ph { border-radius: var(--r) !important; }
.node { background: var(--ink-2); border-color: transparent; }
.node.can { border-color: var(--hat); }
.node.can:hover { background: rgba(255, 201, 60, 0.16); }
.node .nc, .devhead .pts { color: var(--hat); }
.node.got { border-color: var(--good); }
.ach.done { box-shadow: inset 3px 0 0 var(--good); }
.lb-row { border: 0; }
.lb-row:hover { background: rgba(163, 171, 203, 0.08); }
.lb-row.on { background: rgba(255, 201, 60, 0.14); box-shadow: inset 0 0 0 1.5px var(--hat); }
.lb-detail .row, .row.big, .hh, .bark, .ttab td, .op-item { border-color: var(--line); }
.op-item select, #newCityBox input:not([type=checkbox]), #saveBox input, #editorBar input#edName, #editorBar select {
  background: rgba(8, 11, 28, 0.5); border: 1px solid var(--line); color: var(--text); font-family: var(--ui);
}
#newCityBox input:focus, #saveBox input:focus, #editorBar input#edName:focus { outline: none; border-color: var(--hat); }
kbd, .op-keys kbd { font-family: var(--ui); font-weight: 600; background: var(--ink-2); border: 0; box-shadow: 0 2px 0 var(--ink-0); }
.badge { background: var(--hat); color: var(--hat-ink); font-weight: 700; }
#btnCity.attn { box-shadow: inset 0 0 0 2px var(--hat), 0 2px 0 var(--ink-0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
