/* surin.info — shared design (simple, professional). No external fonts or libraries. */
:root {
  --bg: #f4f5f7; --card: #fff; --ink: #111827; --ink2: #374151; --muted: #6b7280; --line: #e5e7eb; --soft: #f8f9fb;
  --accent: #0a58a6; --accent-soft: #e8f0fa; --danger: #c62828;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Thonburi", sans-serif;
}
a { color: var(--accent); }
.hidden { display: none !important; }
.num, td.n, .tab { font-variant-numeric: tabular-nums; }

/* top bar + tabs */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 820px; margin: 0 auto; padding: 0 16px; height: 44px; display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 800; letter-spacing: .08em; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo b { color: #d32f2f; }
.tagline { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar { max-width: 820px; margin: 0 auto; padding: 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar a { display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 4px 7px; color: var(--ink2); text-decoration: none; font-size: 14.5px; font-weight: 550;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.tabbar a:hover { color: var(--ink); background: var(--soft); }
.tabbar a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
@media (min-width: 760px) { .tabbar { grid-template-columns: repeat(6, auto); justify-content: start; } .tabbar a { padding: 9px 13px 8px; font-size: 15px; } }
.tabbar svg { flex: none; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 48px; }
.banner { display: block; width: 100%; height: auto; margin-top: 14px; border-radius: 12px; background: #dfe9f3; }
.pagehead { padding: 20px 2px 2px; }
h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
.sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 14px; }
.card-head { margin-bottom: 12px; }
.card h2 { font-size: 17px; font-weight: 650; margin: 0; line-height: 1.35; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.alert { border-radius: 10px; padding: 11px 14px; font-size: 14.5px; margin-top: 14px; border: 1px solid; }
.alert.warn { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert a { color: inherit; font-weight: 650; }
.stale { position: relative; }
.stale > *:not(.stale-note):not(.card-head) { filter: grayscale(1); opacity: .55; }
.stale-note { display: inline-block; font-size: 12.5px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 2px 8px; margin-top: 6px; }

/* pills / chips */
.pill { display: inline-block; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.chip { display: inline-block; min-width: 48px; text-align: center; border-radius: 6px; padding: 1px 7px; font-weight: 650; font-size: 14.5px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }

/* hero */
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--ink2); }
.big { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.big .num { font-size: 64px; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.big .unit { font-size: 16px; color: var(--muted); font-weight: 500; }
.scale { margin: 14px 0 4px; }
.scale .bar { position: relative; display: flex; height: 8px; border-radius: 99px; overflow: visible; }
.scale .bar i { display: block; height: 100%; }
.scale .bar i:first-child { border-radius: 99px 0 0 99px; } .scale .bar i:last-of-type { border-radius: 0 99px 99px 0; }
.scale .mk { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.scale .ticks { position: relative; height: 18px; font-size: 11.5px; color: var(--muted); }
.scale .ticks span { position: absolute; transform: translateX(-50%); top: 3px; }
.scale .ticks span:first-child { transform: none; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.facts div { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.facts .k { display: block; font-size: 12px; color: var(--muted); }
.facts .v { display: block; font-size: 16px; font-weight: 650; }
.src { font-size: 13px; color: var(--muted); margin-top: 10px; }
.advice { margin-top: 12px; background: var(--soft); border-left: 4px solid var(--line); border-radius: 0 8px 8px 0; padding: 10px 12px; font-size: 14.5px; color: var(--ink2); }
.advice p { margin: 0 0 6px; } .advice p:last-child { margin: 0; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tiles div { background: var(--soft); border-radius: 8px; padding: 9px 11px; }
.tiles .k { display: block; font-size: 12px; color: var(--muted); }
.tiles .v { display: block; font-size: 22px; font-weight: 700; line-height: 1.25; }
.tiles .s { display: block; font-size: 12px; color: var(--muted); }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* map */
.map svg { width: 100%; max-width: 520px; margin: 0 auto; height: auto; display: block; touch-action: manipulation; }
.map path.d { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map path.d.click { cursor: pointer; }
.map path.o { fill: none; stroke: #4b5563; stroke-width: 2.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map path.sel { fill: none; stroke: #111827; stroke-width: 2.6; vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
.map text { font-size: 18px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none;
  paint-order: stroke; stroke: rgba(255,255,255,.8); stroke-width: 3px; fill: #111827; }
.map circle { vector-effect: non-scaling-stroke; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--line); }
td { padding: 8px 6px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
td.n, th.n { text-align: right; white-space: nowrap; }
td .s { display: block; font-size: 12px; color: var(--muted); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--soft); }
tbody tr.on { background: var(--accent-soft); }
tbody tr.on td:first-child { font-weight: 650; }

/* chart */
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .ax { font-size: 16px; fill: #6b7280; }
.chart .grid { stroke: #eef0f3; stroke-width: 1; }
.chart .ref { stroke: var(--danger); stroke-width: 1.4; stroke-dasharray: 6 4; }
.chart .now { stroke: #6b7280; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .cur { stroke: #111827; stroke-width: 1; }
.chart .s1 { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.chart .s2 { fill: none; stroke: #7c3aed; stroke-width: 1.8; stroke-linejoin: round; }
.chart .s3 { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 5 4; }
.chart .s4 { fill: none; stroke: #6b9e9a; stroke-width: 2.2; stroke-dasharray: 7 5; }
.read { font-size: 13.5px; min-height: 2.6em; color: var(--ink2); margin-top: 6px; }
.keys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.keys span::before { content: ""; display: inline-block; width: 20px; border-top: 2.5px solid; vertical-align: middle; margin-right: 5px; }
.keys .k1::before { border-color: var(--accent); } .keys .k2::before { border-color: #7c3aed; }
.keys .k3::before { border-color: var(--accent); border-top-style: dashed; } .keys .k4::before { border-color: #6b9e9a; border-top-style: dashed; }
.keys .kr::before { border-color: var(--danger); border-top-style: dashed; }

/* day cards */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.days.w3 { grid-template-columns: repeat(3, 1fr); }
.day { border-radius: 10px; padding: 9px 6px; text-align: center; background: var(--soft); }
.day .dn { font-size: 13px; font-weight: 600; color: var(--ink2); }
.day .dv { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 2px 0; }
.day .ds { font-size: 12px; color: var(--muted); }
.day .ic { color: var(--ink2); margin: 2px 0; }
.day.lvl .dn, .day.lvl .ds { color: inherit; opacity: .9; }

/* weather now */
.wx-now { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.wx-now .ic { color: var(--ink2); }
.wx-now .t { font-size: 40px; font-weight: 700; line-height: 1; }
.wx-now .d { font-size: 14px; color: var(--muted); }
.icon { display: inline-block; vertical-align: middle; }
.arrow { display: inline-block; }

/* heatmap table */
.heat { table-layout: fixed; font-size: 13px; }
.heat th, .heat td { text-align: center; padding: 5px 2px; }
.heat th:first-child, .heat td:first-child { text-align: left; width: 31%; padding-left: 4px; }
.heat td.c { border: 2px solid #fff; border-radius: 6px; font-weight: 600; }

/* bars (reservoirs) */
.bars .row { display: grid; grid-template-columns: 1fr 112px; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid #f0f1f3; align-items: center; }
.bars .row:last-child { border-bottom: 0; }
.bars .nm { font-size: 14.5px; } .bars .nm .s { display: block; font-size: 12px; color: var(--muted); }
.bars .pc { text-align: right; font-weight: 700; font-size: 15px; }
.bars .pc .s { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.bars .track { grid-column: 1 / -1; height: 6px; background: #eef0f3; border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bars .fill.over { background: #1e3a8a; }

/* station list (rivers) */
.st-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 6px; border-bottom: 1px solid #f0f1f3; cursor: pointer; border-radius: 8px; }
.st-row:hover { background: var(--soft); } .st-row.on { background: var(--accent-soft); }
.st-row .nm { font-weight: 600; } .st-row .s { font-size: 12.5px; color: var(--muted); }
.st-row .r { text-align: right; }

footer { font-size: 13px; color: var(--muted); margin-top: 20px; padding: 0 2px; }
footer ul { padding-left: 18px; margin: 6px 0; } footer li { margin: 3px 0; }

@media (max-width: 420px) {
  .tagline { display: none; }
  .facts, .tiles { gap: 6px; } .tiles .v { font-size: 19px; }
  .big .num { font-size: 58px; }
}
@media (min-width: 640px) { h1 { font-size: 28px; } .big .num { font-size: 76px; } .card { padding: 20px 22px; } }

/* crop prices */
.px-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; align-items: center; }
.px-row .nm { font-weight: 600; } .px-row .s { font-size: 12.5px; color: var(--muted); }
.px-row .pv { text-align: right; font-size: 24px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.px-row .pv small { font-size: 12px; color: var(--muted); font-weight: 400; }
.chg { font-weight: 600; } .chg.up { color: #15803d; } .chg.down { color: #b91c1c; } .chg.same { color: var(--muted); font-weight: 400; }
.chart .dot { fill: #fff; stroke-width: 2; stroke-dasharray: none; }
.intro { background: var(--accent-soft); color: #1e3a5f; border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-top: 14px; }

/* guide (static) */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.jump a { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 14.5px; color: var(--ink2); text-decoration: none; font-weight: 550; }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.section-title { font-size: 20px; font-weight: 700; margin: 26px 2px 0; scroll-margin-top: 110px; }
.reviewed { font-size: 12.5px; color: var(--muted); margin: 2px 2px 0; }
.sos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sos a { display: block; text-decoration: none; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sos a:hover { border-color: var(--danger); }
.sos .no { display: block; font-size: 28px; font-weight: 800; color: var(--danger); line-height: 1.15; font-variant-numeric: tabular-nums; }
.sos .lb { display: block; font-size: 13.5px; color: var(--ink2); }
.sos a.main { grid-column: 1 / -1; background: #fef2f2; border-color: #fecaca; }
.sos a.main .no { font-size: 36px; }
.list .item { padding: 11px 0; border-bottom: 1px solid #f0f1f3; }
.list .item:last-child { border-bottom: 0; }
.list .t { font-weight: 650; } .list .s { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 14px; color: var(--accent); text-decoration: none; background: #fff; font-weight: 550; }
.btn:hover { border-color: var(--accent); }
.btn.call { color: #fff; background: var(--accent); border-color: var(--accent); }
.src-link { font-size: 12px; color: var(--muted); }
.src-link a { color: var(--muted); }
.tt th, .tt td { white-space: nowrap; }
.tt td.w { white-space: normal; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ev { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f1f3; }
.ev:last-child { border-bottom: 0; }
.ev .mo { background: var(--accent-soft); color: var(--accent); border-radius: 10px; text-align: center; padding: 8px 4px; font-weight: 700; font-size: 14px; line-height: 1.3; align-self: start; }
.ev .t { font-weight: 650; } .ev .d { font-size: 14px; color: var(--ink2); margin-top: 2px; }
.ev .when { font-size: 13.5px; margin-top: 4px; } .ev .when b { color: var(--accent); }
.footlinks { margin-top: 8px; } .footlinks a { margin-right: 12px; }
.ev-img { margin: 0 0 8px; }
.ev-img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #eef1f5; }
.ev-img figcaption { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.ev-img figcaption a { color: var(--muted); }
