:root {
  --bar: #0f2a44; --bar-text: #ffffff; --bg: #f3f5f8; --card: #ffffff; --text: #111827; --muted: #6b7280;
  --line: #e5e7eb; --pos: #0a7a2f; --neg: #b3261e; --chip: #e5e7eb; --accent: #0f2a44;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.25rem; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
small, .muted { color: var(--muted); }
.pos { color: var(--pos); font-weight: 700; }
.neg { color: var(--neg); font-weight: 700; }

/* top bar */
.top { background: var(--bar); color: var(--bar-text); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 1rem; }
.top .brand { font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.top .nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.top .nav a { text-decoration: none; padding: .5rem .6rem; border-radius: 6px; min-height: 40px; display: inline-flex; align-items: center; opacity: .85; }
.top .nav a.on, .top .nav a:hover { background: rgba(255,255,255,.15); opacity: 1; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.top .who small { color: rgba(255,255,255,.7); }
form.inline { display: inline; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: .4rem; min-height: 40px; }

/* strategy selector */
.seg { display: flex; margin: .75rem 1rem 0; border: 1px solid var(--accent); border-radius: 8px; overflow: hidden; max-width: 520px; }
.seg a { flex: 1; text-align: center; padding: .55rem 0; text-decoration: none; min-height: 40px; font-size: .95rem; }
.seg a.on { background: var(--accent); color: #fff; font-weight: 600; }

/* layout */
.page { padding: .75rem 1rem 2rem; max-width: 1200px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; margin-bottom: .75rem; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .75rem; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.wide { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; }
.kpi small { display: block; font-size: .78rem; }
.kpi b { font-size: 1.25rem; }

/* blocks with day chips */
.blk h2 { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.blk h2 a { text-decoration: none; display: flex; justify-content: space-between; width: 100%; min-height: 40px; align-items: center; }
.blk .arrow { color: var(--muted); font-weight: 400; margin-left: .4rem; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 0; }
.chips a { white-space: nowrap; padding: .45rem .7rem; border-radius: 16px; background: var(--chip); text-decoration: none; font-size: .9rem; min-height: 40px; display: inline-flex; align-items: center; }
.chips a.on { background: var(--accent); color: #fff; }

/* tables */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td.r, th.r { text-align: right; }
.tag { display: inline-block; font-size: .72rem; padding: .1rem .4rem; border-radius: 4px; background: var(--chip); margin-right: .3rem; }
.breakdown { color: var(--muted); font-size: .8rem; }
details summary { cursor: pointer; }

/* city bars */
.bars .bar { display: grid; grid-template-columns: 7rem 1fr 4.5rem; align-items: center; gap: .5rem; padding: .3rem 0; text-decoration: none; min-height: 40px; }
.bars .bar i { display: block; height: 10px; border-radius: 3px; background: var(--pos); }
.bars .bar i.neg { background: var(--neg); }
.bars .bar span:last-child { text-align: right; }

/* forms */
.login { max-width: 360px; margin: 2rem auto; }
label { display: block; margin: .5rem 0; }
input[type=text], input[type=password], input:not([type]), select { width: 100%; padding: .55rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; min-height: 40px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .6rem 1rem; font: inherit; cursor: pointer; min-height: 40px; }
.btn.small { padding: .35rem .6rem; font-size: .85rem; }
.error { color: var(--neg); }
.ok { color: var(--pos); }
.chart { position: relative; width: 100%; }
.chart canvas { width: 100% !important; }
.help { font-size: .85rem; color: var(--muted); margin: .25rem 0 .5rem; }

/* close-now day cards */
.days-cards { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: .5rem; }
@media (min-width: 720px) { .days-cards { grid-template-columns: repeat(3, 1fr); } }
.daycard { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; min-height: 40px; }
.daycard.on { border-color: var(--accent); background: #eef2f7; }
.daycard b { font-size: 1rem; }
.card.alert { border-color: var(--pos); background: #f0faf3; }
