/* ============ Dine — verde floresta sóbrio, alto contraste para uso ao ar livre ============ */
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --radius-sm: 8px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[data-theme="light"] {
  --bg: #f2f0e9;
  --bg-grad: none;
  --surface: #fbfaf7;
  --surface-2: #ecebe4;
  --text: #1e2621;
  --muted: #5f6a62;
  --line: #dddacf;
  --primary: #2f5a44;
  --primary-strong: #234433;
  --primary-soft: #e2e8df;
  --on-primary: #ffffff;
  --accent: #b0661f;
  --high: #2f5a44;
  --low: #2c5a73;
  --low-soft: #e0e9ee;
  --water: #2c5a73;
  --water-strong: #234a60;
  --night: rgba(30, 38, 33, 0.06);
  --curve-top: #2c5a73;
  --curve-top-op: .24;
  --curve-bot-op: .02;
  --ok: rgba(176, 102, 31, .16);
  --shadow: 0 1px 2px rgba(30, 38, 33, .06);
  --topbar: #234433;
  --hero: #2c5a73;
  --danger: #a4321f;
  --skel: #e6e4dc;
}
[data-theme="dark"] {
  --bg: #131815;
  --bg-grad: none;
  --surface: #1b211d;
  --surface-2: #232b26;
  --text: #e8ebe5;
  --muted: #9ba69d;
  --line: #2d3631;
  --primary: #93b49c;
  --primary-strong: #b4cbb9;
  --primary-soft: #28352d;
  --on-primary: #131815;
  --accent: #d6a15c;
  --high: #93b49c;
  --low: #8fb6cc;
  --low-soft: #1f2e37;
  --water: #8fb6cc;
  --water-strong: #b3cfdf;
  --night: rgba(0, 0, 0, 0.22);
  --curve-top: #8fb6cc;
  --curve-top-op: .20;
  --curve-bot-op: .01;
  --ok: rgba(214, 161, 92, .14);
  --shadow: none;
  --topbar: #18201b;
  --hero: #1f3340;
  --danger: #e58a78;
  --skel: #222a25;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 18.5px; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); color: var(--text);
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.icon { width: 1.35em; height: 1.35em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon .fill, .icon.wind-arrow { fill: currentColor; stroke: none; }
.icon.sm { width: .95em; height: .95em; }
.icon.lg { width: 1.8em; height: 1.8em; }
.icon.xl { width: 2.4em; height: 2.4em; }
.icon.xxl { width: 4.2em; height: 4.2em; stroke-width: 1.5; }
.icon.muted, .muted { color: var(--muted); }
.icon.sun { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 12px; background: var(--topbar); color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .15);
}
.station-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: 8px 12px; text-align: left; }
.station-btn.static { background: none; border-color: transparent; pointer-events: none; }
.station-btn.static .pin, .station-btn.static .chev { display: none; }
.station-btn .pin { color: #d6c9a8; }
.station-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.station-text strong { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-text small { font-size: .75rem; opacity: .8; }
.station-text small:empty { display: none; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); flex: none; }
.icon-btn.on-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.icon-btn.filled { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.icon-btn.busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { background: #6b4a1f; color: #fff; font-size: .85rem; padding: 8px 14px; text-align: center; }

/* ---------- layout ---------- */
.view { max-width: 680px; margin: 0 auto; padding: 14px 14px calc(var(--tabbar-h) + var(--safe-b) + 24px); display: flex; flex-direction: column; gap: 14px; outline: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-title small { margin-left: auto; font-weight: 500; font-size: .72rem; color: var(--muted); }
button.card { width: 100%; text-align: left; }
.source { font-size: .75rem; color: var(--muted); line-height: 1.45; padding: 0 4px; }
.source p + p { margin-top: 4px; }
.source .warn { display: flex; gap: 6px; align-items: flex-start; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.tag, .chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-strong); border: 0; }
.chip { font-size: .85rem; padding: 8px 14px; }

/* ---------- barra de data ---------- */
.datebar { display: flex; align-items: center; gap: 8px; }
.datebar-center { flex: 1; display: flex; flex-direction: column; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 52px; justify-content: center; box-shadow: var(--shadow); position: relative; }
.datebar-center.static { cursor: default; }
.datebar-center strong { font-size: 1.1rem; }
.datebar-rel { font-size: .8rem; font-weight: 500; color: var(--muted); }
.datebar-end { display: flex; gap: 6px; align-items: center; }
.datebar .icon-btn { height: 52px; box-shadow: var(--shadow); }

/* ---------- destaque ---------- */
.hero { display: flex; justify-content: space-between; gap: 12px; align-items: stretch; background: var(--hero); color: #fff; border: 0; }
[data-theme="dark"] .hero { color: var(--text); border: 1px solid var(--line); }
.hero-label { font-size: .85rem; opacity: .85; font-weight: 500; }
.hero-main { display: flex; flex-direction: column; gap: 2px; }
.hero-value { display: flex; align-items: baseline; gap: 4px; line-height: 1; margin: 4px 0 6px; }
.hero-value .big { font-size: 3.4rem; font-weight: 700; }
.hero-value .u { font-size: 1.3rem; font-weight: 700; opacity: .85; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .95rem; background: rgba(255, 255, 255, .16); border-radius: 4px; padding: 4px 10px 4px 6px; align-self: flex-start; }
.trend small { font-weight: 500; opacity: .85; font-size: .78rem; }
.trend { white-space: nowrap; }
.hero-main { min-width: 0; }
.hero-next .hero-label { }
[data-theme="dark"] .trend.up { color: var(--high); } [data-theme="dark"] .trend.down { color: var(--low); }
.hero-next { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .22); justify-content: center; }
.hero-next strong { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.hero-next span { font-weight: 600; }
.countdown { font-size: .8rem; background: rgba(255, 255, 255, .18); padding: 3px 9px; border-radius: 4px; margin-top: 4px; }

/* ---------- tempo resumido ---------- */
.weather-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.weather-strip .icon.xl { color: var(--primary); }
.wx-temp { font-size: 2rem; font-weight: 700; }
.wx-desc { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wx-desc span { font-size: .82rem; color: var(--muted); }

/* ---------- gráfico ---------- */
.chart-card { padding: 10px 4px 8px; overflow: hidden; }
.tide-chart { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tide-chart .night { fill: var(--night); }
.tide-chart .grid { stroke: var(--line); stroke-width: 1; }
.tide-chart .vgrid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.tide-chart .axis { fill: var(--muted); font-size: 11px; font-weight: 600; }
.tide-chart .axis.unit { font-weight: 700; }
.tide-chart .g-top { stop-color: var(--curve-top); stop-opacity: var(--curve-top-op); }
.tide-chart .g-bot { stop-color: var(--curve-top); stop-opacity: var(--curve-bot-op); }
.tide-chart .curve { fill: none; stroke: var(--water); stroke-width: 3; stroke-linejoin: round; }
.tide-chart .area-ok { fill: var(--ok); }
.tide-chart .thr { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; }
.tide-chart .thr-label { fill: var(--accent); font-size: 11px; font-weight: 700; }
.tide-chart .ext { stroke: var(--surface); stroke-width: 2.5; }
.tide-chart .ext.high { fill: var(--high); } .tide-chart .ext.low { fill: var(--low); }
.tide-chart .ext-h { fill: var(--text); font-size: 12.5px; font-weight: 700; }
.tide-chart .ext-t { fill: var(--muted); font-size: 11px; font-weight: 600; }
.tide-chart .now line { stroke: var(--accent); stroke-width: 2; }
.tide-chart .now circle { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.tide-chart .bubble rect { fill: var(--accent); }
.tide-chart .bubble text { fill: #1d1300; font-size: 12px; font-weight: 700; }
.tide-chart .scrub line { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.tide-chart .scrub circle { fill: var(--text); stroke: var(--surface); stroke-width: 2.5; }
.tide-chart .scrub .bubble rect { fill: var(--text); }
.tide-chart .scrub .bubble text { fill: var(--surface); }
.tide-chart.scrubbing .now .bubble { opacity: 0; }
.tide-chart .hit { fill: transparent; cursor: crosshair; }
.hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .72rem; color: var(--muted); padding-top: 2px; }

/* ---------- lista de marés ---------- */
.tide-row { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tide-row:first-of-type { border-top: 0; }
.tide-ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; }
.tide-row.high .tide-ico { background: var(--primary-soft); color: var(--high); }
.tide-row.low .tide-ico { background: var(--low-soft); color: var(--low); }
.tide-name { font-weight: 600; }
.tide-time { font-size: 1.35rem; font-weight: 700; }
.tide-h { font-weight: 700; min-width: 4.8em; text-align: right; color: var(--muted); }
.tide-row.past { opacity: .5; }

/* ---------- janela operacional ---------- */
.window-card .card-title { color: var(--accent); }
.win-list { display: flex; flex-wrap: wrap; gap: 8px; }
.win { display: inline-flex; flex-direction: column; background: var(--ok); border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.win small { font-weight: 600; color: var(--muted); font-size: .72rem; }

/* ---------- infos ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info { display: flex; gap: 12px; align-items: center; padding: 14px; }
.info > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info span { font-size: .8rem; color: var(--muted); }
.info strong { font-size: 1rem; }
.info .tag { align-self: flex-start; margin-top: 2px; }
.moon-ico .lit { fill: #f3f1e4; } .moon-ico .dark { fill: #1f2c26; } .moon-ico .rim { fill: none; stroke: rgba(120, 140, 130, .45); stroke-width: 1; }
[data-theme="dark"] .moon-ico .dark { fill: #020906; }

/* ---------- tábua ---------- */
.legend { display: flex; gap: 14px; justify-content: center; font-size: .75rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.low { background: var(--low); } .dot.high { background: var(--high); } .dot.spring { background: var(--accent); }
.cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-row { display: grid; grid-template-columns: 44px 30px 1fr 20px; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 12px; text-align: left; box-shadow: var(--shadow); }
.cal-row.today { border: 2px solid var(--primary); }
.cal-row.spring { border-left: 4px solid var(--accent); }
.cal-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cal-date strong { font-size: 1.45rem; font-weight: 700; }
.cal-date span { font-size: .75rem; color: var(--muted); font-weight: 500; }
.cal-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-vals { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .95rem; }
.cal-vals .low { color: var(--low); display: inline-flex; align-items: center; gap: 2px; }
.cal-vals .high { color: var(--high); display: inline-flex; align-items: center; gap: 2px; }
.cal-vals .icon { width: 1em; height: 1em; stroke-width: 2.6; }
.cal-ev { font-size: .75rem; font-weight: 600; color: var(--accent); }
.cal-track { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; border: 1px solid var(--line); }
.cal-fill { position: absolute; top: -1px; bottom: -1px; border-radius: 99px; background: var(--water); opacity: .8; }
.cal-times { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-weight: 600; gap: 8px; }

/* ---------- lua ---------- */
.moon-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 12px 22px; border-radius: 12px; color: #eefaf3;
  background: #101512; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.moon-hero::before { content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: radial-gradient(1px 1px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 80% 12%, #fff, transparent), radial-gradient(1.5px 1.5px at 68% 70%, #fff, transparent),
  radial-gradient(1px 1px at 25% 78%, #fff, transparent), radial-gradient(1px 1px at 90% 50%, #fff, transparent), radial-gradient(1px 1px at 40% 10%, #fff, transparent), radial-gradient(1.2px 1.2px at 8% 55%, #fff, transparent); }
.moon-canvas { width: min(72vw, 290px); height: min(72vw, 290px); position: relative; }
.moon-hero h1 { font-size: 1.9rem; margin-top: 6px; position: relative; }
.moon-sub { opacity: .85; position: relative; }
.tide-type { display: flex; gap: 12px; align-items: center; }
.tide-type p { font-size: .9rem; color: var(--muted); }
.pill { flex: none; font-weight: 700; font-size: .8rem; padding: 6px 12px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-strong); }
.pill.sizigia { background: var(--ok); color: var(--accent); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.kv { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 0; }
.kv .icon { grid-row: span 2; color: var(--primary); align-self: center; }
.kv span { font-size: .75rem; color: var(--muted); }
.kv strong { font-size: 1.1rem; }
.phase-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.phase-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 10px 4px; border-radius: 8px; background: var(--surface-2); }
.phase-item strong { font-size: .78rem; }
.phase-item span { font-weight: 700; font-size: 1.05rem; }
.phase-item small { color: var(--muted); font-size: .72rem; }

/* ---------- tempo ---------- */
.wx-now-top { display: flex; align-items: center; gap: 16px; }
.wx-now-top .icon.xxl { color: var(--primary); }
.wx-now-top > div { display: flex; flex-direction: column; }
.wx-big { font-size: 3.6rem; font-weight: 700; line-height: 1; }
.wx-now-top .muted { font-size: .85rem; }
.wx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.wx-stats > div { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; background: var(--surface-2); border-radius: 8px; padding: 10px; }
.wx-stats .icon { grid-row: span 3; color: var(--primary); }
.wx-stats span { font-size: .72rem; color: var(--muted); }
.wx-stats small { font-size: .72rem; color: var(--muted); }
.hours { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; margin: 0 -4px; }
.hour { scroll-snap-align: start; flex: none; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 8px; background: var(--surface-2); font-size: .85rem; }
.hour .icon.lg { color: var(--primary); }
.hour strong { font-size: 1.15rem; }
.hour-t { font-weight: 700; color: var(--muted); font-size: .78rem; }
.pop { color: var(--muted); font-size: .78rem; display: inline-flex; align-items: center; gap: 2px; }
.pop.hi { color: var(--low); font-weight: 700; }
.hour-wind, .day-wind { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .8rem; }
.wind-arrow { width: 1em; height: 1em; color: var(--primary); transition: none; }
.hour-tide { font-weight: 700; font-size: .78rem; color: var(--low); background: var(--low-soft); border-radius: 8px; padding: 2px 6px; }
.days { display: flex; flex-direction: column; }
.day { display: grid; grid-template-columns: 52px 34px 38px 34px 1fr 34px 54px; align-items: center; gap: 6px; padding: 9px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day-name { font-weight: 700; }
.day .icon.lg { color: var(--primary); width: 1.6em; height: 1.6em; }
.tmin { color: var(--muted); text-align: right; font-weight: 600; } .tmax { font-weight: 700; }
.trange { position: relative; height: 6px; background: var(--surface-2); border-radius: 99px; }
.trange i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); opacity: .7; }

/* ---------- estações ---------- */
.stations-head { display: flex; flex-direction: column; gap: 10px; }
.search-row { display: flex; gap: 8px; }
.search-wrap { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; box-shadow: var(--shadow); }
.search-wrap .icon { color: var(--muted); }
.search { flex: 1; border: 0; background: none; font: inherit; color: var(--text); height: 44px; outline: none; min-width: 0; }
.st-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.st-list li + li { border-top: 1px solid var(--line); }
.st-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 8px; background: none; border: 0; text-align: left; }
.st-item.current { background: var(--primary-soft); }
.st-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.st-name strong { font-size: 1.05rem; }
.st-name span { font-size: .78rem; color: var(--muted); }
.st-dist { font-weight: 700; color: var(--muted); font-size: .9rem; }
.star { background: none; border: 0; width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; flex: none; }
.star.on { color: var(--accent); } .star.on .icon { fill: currentColor; }
.map-wrap { position: relative; }
.map { height: calc(100dvh - 290px); min-height: 360px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.map-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
.map-sheet.hidden { display: none; }
.map-sheet > div { display: flex; flex-direction: column; min-width: 0; }
.map-sheet span { font-size: .8rem; color: var(--muted); }

/* ---------- controles ---------- */
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px 8px; border-radius: 10px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; }
.input { width: 100%; height: 48px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; padding: 0 14px; }
.input:focus { border-color: var(--primary); outline: none; }
.input.small { width: 110px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.field.grow { flex: 1; }
.switch { appearance: none; width: 52px; height: 30px; border-radius: 99px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(22px); }

/* ---------- ajustes ---------- */
.settings { display: flex; flex-direction: column; gap: 18px; }
.set-group { display: flex; flex-direction: column; gap: 10px; }
.set-group h2 { font-size: .95rem; color: var(--text); font-weight: 600; padding: 0 2px; }
.set-help { font-size: .78rem; color: var(--muted); padding: 0 4px; line-height: 1.4; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.row-gap { display: flex; gap: 10px; align-items: flex-end; }
.spacer { height: 2px; }
.account { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; border-radius: 8px; }
.account > div { flex: 1; display: flex; flex-direction: column; }
.account span { color: var(--muted); font-size: .82rem; }
.account .icon { color: var(--primary); }

/* ---------- navegação inferior ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px 6px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 700; border-radius: 8px; }
.tabbar a .icon { width: 1.55rem; height: 1.55rem; padding: 3px 14px; box-sizing: content-box; border-radius: 4px; transition: background .2s; }
.tabbar a[aria-current="page"] { color: var(--primary-strong); }
[data-theme="dark"] .tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] { font-weight: 700; }

/* ---------- estados ---------- */
.skel { height: 120px; background: linear-gradient(90deg, var(--skel) 0%, var(--surface-2) 50%, var(--skel) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border: 0; box-shadow: none; }
.skel-1 { height: 250px; } .skel-2 { height: 180px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 18px; }
.error-card .icon { color: var(--accent); }
.toast { position: fixed; background: #1e2621 !important; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #0c2a1f; color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: .9rem; max-width: 90vw; transition: .25s; z-index: 50; box-shadow: 0 8px 26px rgba(0, 0, 0, .3); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--topbar); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 12px; padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 6px; }
.brand h1 { font-size: 1.6rem; font-weight: 700; color: var(--primary-strong); }
[data-theme="dark"] .brand h1 { color: var(--primary); }
.brand p { color: var(--muted); font-size: .9rem; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 48px; }
.pass-toggle { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); }
.login-err { color: var(--danger); font-weight: 600; font-size: .88rem; min-height: 1.2em; }

@media (min-width: 720px) {
  .view { padding-top: 22px; }
  .hero-value .big { font-size: 4rem; }
}
@media (max-width: 360px) {
  .hero-value .big { font-size: 2.8rem; }
  .hero-next strong { font-size: 1.5rem; }
  .info-grid { grid-template-columns: 1fr; }
  .day { grid-template-columns: 44px 30px 34px 30px 1fr 30px 46px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.source .ok-note { color: var(--primary); font-weight: 700; margin-bottom: 4px; }

/* ---------- câmera ---------- */
.camera { display: flex; flex-direction: column; gap: 10px; }
.cam-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: calc(100dvh - 300px); width: 100%; }
.cam-stage.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }
.cam-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-live { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: rgba(16, 22, 18, .72); color: #eef1ec; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; border-left: 4px solid #d6a15c; }
.cam-live strong { font-size: 1rem; color: #fff; }
.cam-live-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cam-live .warn { color: #f3c27a; font-weight: 700; }
.acc { font-weight: 700; padding: 2px 8px; border-radius: 4px; font-size: .78rem; }
.acc.good { background: #93b49c; color: #131815; } .acc.ok { background: #d6a15c; color: #131815; } .acc.bad { background: #e58a78; color: #131815; }
.cam-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; color: #eef1ec; }
.cam-note { width: 100%; height: 46px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; padding: 0 14px; }
.cam-controls { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--primary); background: var(--surface); display: grid; place-items: center; padding: 0; }
.shutter span { width: 58px; height: 58px; border-radius: 50%; background: var(--primary); display: block; }
.shutter:active span { transform: scale(.9); }
.shutter:disabled { opacity: .5; }
.cam-btn, .cam-thumb { width: 54px; height: 54px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; position: relative; overflow: visible; padding: 0; }
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.cam-thumb .count { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 4px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
.cam-preview { position: fixed; inset: 0; z-index: 40; background: #0c100e; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(var(--safe-b) + 12px); gap: 12px; }
.cam-preview img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.cam-preview-actions { display: flex; gap: 8px; }
.cam-preview-actions .btn { flex: 1; }
.tabbar a { font-size: .68rem; }
.tabbar a .icon { padding: 3px 10px; }
.cam-live-in { display: flex; flex-direction: column; gap: 2px; }
.homage { font-size: .8rem; color: var(--muted); padding: 6px 4px 0; }
