:root {
  --bg: #090c13;
  --bg2: #0e131d;
  --surface: #121927;
  --surface2: #172033;
  --line: #222c40;
  --ink: #e8edf6;
  --muted: #8592aa;
  --dim: #5a6680;
  --warm: #ffb547;
  --cold: #6cc4ff;
  --accent: #ffb547;
  --moon: #e5dcbf;
  --act: #b6f36b;
  --barb: #e8edf6;
  --disc-bg: #0e131d;
  --night: rgba(4, 6, 12, 0.42);
  --r: 18px;
  --display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--display);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(255, 181, 71, 0.08), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(108, 196, 255, 0.07), transparent 60%),
    var(--bg);
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* jemné izobary v pozadí */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.035'%3E%3Cpath d='M-50 120 C120 40 260 220 420 140 S640 60 700 120'/%3E%3Cpath d='M-50 200 C120 120 260 300 420 220 S640 140 700 200'/%3E%3Cpath d='M-50 280 C120 200 260 380 420 300 S640 220 700 280'/%3E%3Cpath d='M-50 360 C120 280 260 460 420 380 S640 300 700 360'/%3E%3Cpath d='M-50 440 C120 360 260 540 420 460 S640 380 700 440'/%3E%3Cpath d='M-50 520 C120 440 260 620 420 540 S640 460 700 520'/%3E%3C/g%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
b { font-weight: 600; }

/* ------------------------------------------------ hlavička */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 8px; position: relative; z-index: 2;
}
.place { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; text-align: left; min-width: 0; }
.place:hover { background: var(--surface); }
.place .pin { color: var(--warm); flex: none; }
.place.gps .pin { color: var(--act); }
.place-txt { display: flex; flex-direction: column; min-width: 0; }
.place-txt b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-txt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); flex: none; }
.top-right { display: flex; align-items: center; gap: 8px; }
.status { font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: right; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.is-loading #refreshBtn svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ záložky */
.tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); position: relative;
  margin: 0 12px; border-bottom: 1px solid var(--line); z-index: 2;
}
.tab {
  padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-weight: 600; font-size: 15px; color: var(--muted); transition: color .2s;
}
.tab small { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--dim); }
.tab.on { color: var(--ink); }
.tab.on small { color: var(--warm); }
.tab-ink {
  --x: 0; position: absolute; bottom: -1px; left: 0; height: 2px; width: 20%;
  background: var(--warm); border-radius: 2px; box-shadow: 0 0 12px var(--warm);
  transform: translateX(calc(var(--x) * 100%)); transition: transform .05s linear;
}

/* ------------------------------------------------ posun obrazovek */
.pager {
  flex: 1; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.pager::-webkit-scrollbar { display: none; }
.panel {
  flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always;
  overflow-y: auto; overflow-x: hidden; padding: 18px max(14px, calc((100% - 1180px) / 2)) calc(40px + env(safe-area-inset-bottom));
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.rise { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.skeleton { height: 280px; border-radius: var(--r); background: linear-gradient(100deg, var(--surface) 30%, var(--surface2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ------------------------------------------------ obecné */
.card { background: linear-gradient(180deg, var(--surface), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.card h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--dim); font-weight: 400; }
.tl { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.link { margin-left: auto; color: var(--warm); text-transform: none; letter-spacing: 0; font-size: 13px; }
.meter { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 6px; width: 100%; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--cold); }
.meter.act i { background: linear-gradient(90deg, #6b8f3a, var(--act)); }
.meter[class*="lv"] i { width: 20%; }
.meter.lv1 i { width: 30%; background: #5eead4; } .meter.lv2 i { width: 48%; background: #a3e635; }
.meter.lv3 i { width: 62%; background: #fcd34d; } .meter.lv4 i { width: 76%; background: #fb923c; }
.meter.lv5 i { width: 88%; background: #f87171; } .meter.lv6 i { width: 100%; background: #f43f5e; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--act); opacity: .5; }
.dots i.on { background: var(--act); opacity: 1; box-shadow: 0 0 8px rgba(182, 243, 107, .5); }
.station { display: block; overflow: visible; }

/* ------------------------------------------------ Aktuálně */
.now-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 18px 20px 22px; margin-bottom: 16px;
  position: relative; isolation: isolate; border-radius: var(--r); border: 1px solid var(--line);
  background:
    radial-gradient(60% 70% at var(--moon-x, 80%) 0%, var(--moon-glow, transparent), transparent 70%),
    radial-gradient(70% 90% at var(--glow-x, 20%) 115%, var(--glow, transparent), transparent 70%),
    linear-gradient(180deg, var(--sky-top, var(--surface)), var(--sky-bot, var(--bg2)));
  transition: background .6s;
}
/* hvězdy — jen za tmy a při malé oblačnosti */
.now-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; opacity: var(--stars, 0);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 33%, #dfe8ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 68% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 76% 46%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 22%, #fff8e0 50%, transparent 51%), radial-gradient(1px 1px at 6% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 70%, #dfe8ff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 94% 64%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 58%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 19% 84%, #fff 50%, transparent 51%);
}
.now-hero .hero-feels, .now-hero .hero-date { color: rgba(232, 237, 246, .72); }
.hero-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hero-temp { font-size: clamp(88px, 22vw, 150px); font-weight: 800; line-height: .9; letter-spacing: -0.06em; margin: 6px 0 4px; }
.hero-temp span { font-size: .32em; font-weight: 600; color: var(--warm); vertical-align: top; margin-left: 6px; letter-spacing: 0; }
.hero-desc { font-size: 22px; font-weight: 600; }
.hero-feels { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hero-feels b { color: var(--ink); font-family: var(--mono); font-weight: 400; }
.hero-art { display: flex; align-items: center; gap: 4px; }
.hero-icon .wx { display: block; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); animation: float 6s ease-in-out infinite; }
.hero-station { text-align: center; }
.hero-station .station { margin: 0 auto; filter: drop-shadow(0 0 22px rgba(255, 181, 71, .12)); }
.sym-both .hero-station { align-self: flex-end; opacity: .9; }
.sym-both .hero-station .station-cap { font-size: 8.5px; max-width: 100px; }
.wx { display: block; overflow: visible; flex: none; }
@keyframes float { 50% { transform: translateY(-5px); } }
.station-cap { font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.tile { background: var(--bg2); padding: 13px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile .tv { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.tile .ts { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.sky-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; margin-bottom: 16px; }
.pair { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 10px; }
.pair b { font-family: var(--mono); font-size: 17px; }
.pair .mid { text-align: center; } .pair .right { text-align: right; }
.arc { width: 100%; height: auto; display: block; }
.arc-note { fill: var(--dim); font-size: 12px; text-anchor: middle; font-family: var(--mono); }
.moon-top { display: flex; gap: 16px; align-items: center; }
.moon-disc { flex: none; filter: drop-shadow(0 0 18px rgba(229, 220, 191, .18)); }
.moon-phase { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.moon-ill { color: var(--moon); }
.moon-ill b { font-family: var(--mono); }

.sol-head { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sol-now b { font-family: var(--mono); font-size: 28px; color: var(--act); }
.sol-rate b { display: block; margin-top: 4px; }
.sol-rate .dots { margin-top: 8px; }
.timeline { margin: 14px 0 8px; }
.tl-bar { position: relative; height: 22px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.tl-bar i { position: absolute; top: 0; bottom: 0; }
.tl-bar i.maj { background: rgba(182, 243, 107, .55); }
.tl-bar i.min { background: rgba(182, 243, 107, .25); }
.tl-bar b { position: absolute; top: 3px; bottom: 3px; width: 3px; margin-left: -1.5px; background: var(--warm); border-radius: 2px; }
.tl-bar s { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); box-shadow: 0 0 6px #fff; }
.tl-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: 4px; }
.sol-list { list-style: none; font-size: 13px; display: grid; gap: 5px; }
.sol-list li { font-family: var(--mono); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.sol-list span { color: var(--muted); font-family: var(--display); }
.sol-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sol-list i.maj { background: rgba(182, 243, 107, .75); } .sol-list i.min { background: rgba(182, 243, 107, .3); }

.strip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.strip-h { flex: 1 0 74px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; }
.strip-h:hover { filter: brightness(1.15); }
.sh-t { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.strip-h b { font-family: var(--mono); font-size: 16px; }
.sh-p { font-size: 11px; color: var(--cold); font-family: var(--mono); }

/* ------------------------------------------------ den */
.day-head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 16px; }
.dh-main { display: flex; gap: 12px; align-items: center; }
.dh-main .wx { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .3)); }
.dh-date { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.dh-desc { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.dh-temps { font-family: var(--mono); display: flex; gap: 10px; font-size: 18px; }
.dh-temps .hi { color: var(--warm); } .dh-temps .lo { color: var(--cold); }
.dh-facts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.dh-facts > div { background: var(--bg2); padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; }
.dh-facts b { font-family: var(--mono); font-size: 15px; }
.dh-facts small { font-size: 11.5px; color: var(--muted); }
.dh-sky { grid-column: 1 / -1; position: relative; height: 22px; display: flex; border-radius: 8px; border: 1px solid var(--line); }
.dh-sky b { flex: 1; }
.dh-sky b:first-child { border-radius: 7px 0 0 7px; }
.dh-sky b:last-child { border-radius: 0 7px 7px 0; }
.dh-sky span { position: absolute; top: 3px; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; color: rgba(232, 237, 246, .6); }
.dh-sky i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--warm); box-shadow: 0 0 6px var(--warm); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* tabulka hodin */
.hours { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg2); }
.hrow {
  display: grid; align-items: center; gap: 0 12px; padding: 6px 14px; border-top: 1px solid var(--line);
  grid-template-columns: 58px var(--symw, 62px) 1.25fr .8fr 1.15fr 1.25fr .85fr .9fr .85fr 1.1fr;
  grid-template-areas: "time sym temp prec wind hum pres cloud moon act";
}
.hrow.hhead { border-top: 0; padding-block: 10px; background: var(--surface); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hrow.now { box-shadow: inset 3px 0 0 var(--warm), inset 0 0 0 999px rgba(255, 181, 71, .06); }
.hours .hrow:not(.hhead) { border-top-color: rgba(255, 255, 255, .05); }
.hrow small, .c-temp .desc { text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.hours .c-temp .desc, .hours .c-moon.down b { color: #7d89a1; }
.hrow > span { min-width: 0; display: flex; flex-direction: column; }
.hrow small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow b { font-family: var(--mono); font-size: 16px; display: inline-flex; align-items: baseline; gap: 3px; }
.hrow b i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.c-time { grid-area: time; flex-direction: row !important; align-items: baseline; flex-wrap: wrap; }
.c-time b { font-size: 19px; }
.c-time em { font-style: normal; font-size: 10px; color: var(--warm); text-transform: uppercase; letter-spacing: .1em; width: 100%; }
.hrow > .c-sym { grid-area: sym; display: flex; flex-direction: row; align-items: center; gap: 2px; }
.sym-both .c-sym .station { width: 46px; height: 46px; }
.hours.sym-both { --symw: 100px; } .c-temp { grid-area: temp; } .c-prec { grid-area: prec; } .c-wind { grid-area: wind; }
.c-hum { grid-area: hum; } .c-pres { grid-area: pres; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.c-pres small { width: 100%; }
.c-cloud { grid-area: cloud; } .c-moon { grid-area: moon; } .c-act { grid-area: act; }
.c-temp .t { color: var(--tc); font-size: 19px; }
.c-temp .desc { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-prec .wet { color: var(--cold); }
.c-moon.up b { color: var(--moon); } .c-moon.down b { color: var(--dim); }
.c-act .meter { margin: 0 0 4px; }
.hhead > span { display: block; }

/* graf */
.graph-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); overflow: hidden; }
.graph-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; touch-action: pan-x pan-y; }
.graph { display: block; }
.graph-labels { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 1; }
.graph-labels > span { position: absolute; left: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: rgba(14, 19, 29, .85); padding: 2px 6px; border-radius: 6px; }
.graph-labels > span:first-child { font-size: 11px; text-transform: none; letter-spacing: 0; }
.graph-labels b { font-weight: 500; }
.g-grid { stroke: rgba(255, 255, 255, .04); } .g-grid.strong { stroke: rgba(255, 255, 255, .12); }
.g-hour { fill: var(--muted); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.g-temp { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.g-feels { fill: none; stroke: var(--ink); stroke-opacity: .5; stroke-width: 1.4; stroke-dasharray: 5 4; }
.g-dew { fill: none; stroke: var(--cold); stroke-opacity: .55; stroke-width: 1.2; stroke-dasharray: 1 3; stroke-linecap: round; }
.g-tdot { fill: var(--bg); stroke: var(--ink); stroke-width: 1.4; }
.g-tlabel { fill: var(--ink); font-family: var(--mono); font-size: 11.5px; font-weight: 600; text-anchor: middle; }
.g-pop { fill: var(--cold); fill-opacity: .1; }
.g-precip { fill: var(--cold); fill-opacity: .75; }
.g-plabel { fill: var(--cold); font-family: var(--mono); font-size: 10px; text-anchor: middle; }
.g-press { fill: none; stroke: #c4b5fd; stroke-width: 1.8; }
.g-small { fill: var(--muted); font-family: var(--mono); font-size: 10px; text-anchor: middle; }
.g-small.moon { fill: var(--moon); fill-opacity: .7; } .g-small.rh { fill: var(--cold); fill-opacity: .8; }
.g-gust { fill: var(--ink); fill-opacity: .07; }
.g-wind { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.g-horizon { stroke: var(--line); stroke-dasharray: 2 3; }
.g-sun { fill: none; stroke: var(--warm); stroke-width: 2.2; }
.g-moon { fill: none; stroke: var(--moon); stroke-width: 1.8; stroke-dasharray: 6 3; }
.g-act { fill: #0b1006; font-family: var(--mono); font-size: 10px; text-anchor: middle; font-weight: 600; }
.g-now { stroke: var(--warm); stroke-width: 1.5; stroke-dasharray: 3 3; }
.g-nowl { fill: var(--warm); font-family: var(--mono); font-size: 10px; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); padding: 12px 4px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-labels i, .graph-legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.lg-temp { background: linear-gradient(90deg, #5eead4, #fcd34d, #fb923c); }
.lg-feels { border-top: 2px dashed rgba(232, 237, 246, .6); height: 0 !important; }
.lg-dew { border-top: 2px dotted var(--cold); height: 0 !important; }
.lg-precip { background: var(--cold); height: 9px !important; width: 9px !important; }
.lg-pop { background: rgba(108, 196, 255, .2); height: 9px !important; width: 9px !important; }
.lg-wind { background: var(--ink); } .lg-sun { background: var(--warm); }
.lg-moon { border-top: 2px dashed var(--moon); height: 0 !important; }

/* ------------------------------------------------ nastavení */
#p-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-content: start; }
.set h3.sub { margin-top: 22px; }
.select { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); outline: none; }
.select:focus { border-color: var(--warm); }
.set label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 7px; }
.set label:first-of-type { margin-top: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 9px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px rgba(255, 181, 71, .35); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.toggle { width: 46px; height: 26px; border-radius: 26px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.toggle.on { background: var(--act); } .toggle.on i { transform: translateX(20px); background: #10170a; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; text-decoration: none; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--warm); color: #1a1205; font-weight: 600; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.legend { grid-column: 1 / -1; }
.lg-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.lg-grid figure { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.lg-grid.ww figure { width: 84px; }
.lg-grid.icons { margin-bottom: 4px; }
.lg-grid figcaption { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.credit { grid-column: 1 / -1; font-size: 11px; color: var(--dim); text-align: center; font-family: var(--mono); }
.credit a { color: var(--muted); }

/* ------------------------------------------------ dialog místa */
.sheet { margin: auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 22px; width: min(520px, calc(100% - 24px)); max-height: min(640px, 86dvh); }
.sheet::backdrop { background: rgba(3, 5, 10, .7); backdrop-filter: blur(4px); }
.sheet[open] { animation: rise .3s cubic-bezier(.2, .8, .2, 1); }
.sheet-in { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { font-size: 20px; font-weight: 800; }
#placeInput { width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); outline: none; }
#placeInput:focus { border-color: var(--warm); }
.gps-btn { justify-content: center; }
.place-list { list-style: none; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: 380px; }
.place-list .pl-title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 8px 10px 4px; }
.place-list button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; display: flex; flex-direction: column; }
.place-list button:hover { background: var(--surface2); }
.place-list span { font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--surface2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px; transition: .3s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ responzivita */
@media (max-width: 1080px) {
  .sky-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sol-card { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .hrow.hhead { display: none; }
  .hrow {
    grid-template-columns: 46px var(--symw, 60px) 1fr 1fr 1fr; gap: 6px 10px; padding: 10px 12px;
    grid-template-areas: "time sym temp prec wind" "time sym hum pres moon" "time sym cloud act act";
  }
  .c-sym { align-self: center; }
  .hours.sym-both { --symw: 54px; }
  .sym-both .hrow > .c-sym { flex-direction: column; gap: 0; }
  .sym-both .c-sym .wx { width: 44px; height: 44px; }
  .sym-both .c-sym .station { width: 48px; height: 48px; }
  .day-head { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 720px) {
  .top { padding-inline: 10px; }
  .status { display: none; }
  .tabs { margin: 0 4px; }
  .tab { font-size: 13.5px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .sky-row { grid-template-columns: minmax(0, 1fr); }
  .now-hero { grid-template-columns: 1fr; }
  .hero-art { position: absolute; right: 10px; top: 14px; }
  .hero-icon .wx { width: 128px; height: 128px; }
  .sym-wmo .hero-station .station { width: 120px; height: 120px; }
  .sym-both .hero-station { display: none; }
  .now-hero { position: relative; }
  .dh-facts { grid-template-columns: repeat(3, 1fr); }
  .hrow small { font-size: 11px; }
  .hrow b { font-size: 15px; }
}
@media (max-width: 400px) {
  .hrow { grid-template-columns: 40px 52px 1fr 1fr 1fr; gap: 6px 8px; padding: 9px 8px; }
  .hrow .station { width: 52px; height: 52px; }
  .hrow .wx { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .rise, .sheet[open], .hero-icon .wx { animation: none; } }

/* ------------------------------------------------ obory (profily) */
.top { z-index: 6; }
.prof-wrap { position: relative; }
.prof-btn { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px 0 9px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; }
.prof-btn:hover, .prof-btn[aria-expanded="true"] { background: var(--surface); }
.prof-btn .pi { color: var(--act); display: grid; place-items: center; }
.prof-btn .chev { color: var(--muted); }
.prof-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.prof-menu[hidden] { display: none; }
.prof-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 11px; }
.prof-menu button:hover { background: var(--surface); }
.prof-menu button.on { background: var(--surface); }
.prof-menu .pi { color: var(--act); display: grid; place-items: center; }
.prof-menu b { flex: 1; font-weight: 600; }
.prof-menu .ck { color: var(--act); font-size: 13px; }

/* barevný akcent podle oboru (--act se používá pro hodnocení, přepínače, grafy aktivity) */
body[data-profile="fisher"] { --act: #4fd1c5; }
body[data-profile="fisher"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="fisher"] .meter.act i { background: linear-gradient(90deg, #2a7f78, var(--act)); }

/* rybář: pás hodinové aktivity, nejlepší okna, faktory */
.fbar { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 36px; align-items: end; }
.fbar i { display: block; border-radius: 3px; background: var(--act); height: calc(16% + var(--v) * 84%); opacity: calc(.3 + var(--v) * .7); }
.fbar s { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 6px #fff; }
.ff-h { margin-top: 16px; margin-bottom: 8px; }
.sol-list i.fw { background: var(--act); opacity: .8; }
.ff-list { list-style: none; display: grid; gap: 9px; }
.ff-list li { display: grid; grid-template-columns: minmax(56px, 74px) minmax(24px, 1fr) minmax(0, auto); align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.ff-list .meter { margin: 0; }
.ff-v { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 400px) { .prof-btn .pl { display: none; } .prof-btn { padding: 0 8px; } }

/* zahrádkář */
body[data-profile="gardener"] { --act: #f08a5d; }
body[data-profile="gardener"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="gardener"] .meter.act i { background: linear-gradient(90deg, #a8532f, var(--act)); }
.gard-card { --lv0: #6fdc8c; --lv1: #fcd34d; --lv2: #fb923c; --lv3: #f87171; --lv4: #f43f5e; }
.gx-alert, .gx-verdict { margin-top: 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--lvc, var(--lv0)); font-size: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.gx-alert small, .gx-verdict small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.gx-verdict small { flex-basis: auto; }
.lv0 { --lvc: var(--lv0); } .lv1 { --lvc: var(--lv1); } .lv2 { --lvc: var(--lv2); } .lv3 { --lvc: var(--lv3); } .lv4 { --lvc: var(--lv4); }
.gx-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gx-chip { min-width: 0; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); border-top: 3px solid var(--lvc, var(--lv0)); display: flex; flex-direction: column; gap: 2px; }
.gx-chip b { font-family: var(--mono); font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.gx-chip small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.gx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.gx-stats > div { display: flex; flex-direction: column; gap: 2px; }
.gx-stats b { font-family: var(--mono); font-size: 15px; }
.gx-crops { margin-top: 12px; }
.gx-crops li { grid-template-columns: 1fr auto; }
.gx-ok { color: var(--lv0); } .gx-no { color: var(--muted); }

/* zemědělec */
body[data-profile="farmer"] { --act: #e6c84a; }
body[data-profile="farmer"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="farmer"] .meter.act i { background: linear-gradient(90deg, #8a7420, var(--act)); }
.gx-sub { color: var(--muted); font-size: 11px; }

/* včelař */
body[data-profile="beekeeper"] { --act: #c792ea; }
body[data-profile="beekeeper"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="beekeeper"] .meter.act i { background: linear-gradient(90deg, #6f4a8a, var(--act)); }

/* lesník */
body[data-profile="forester"] { --act: #c8a27a; }
body[data-profile="forester"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="forester"] .meter.act i { background: linear-gradient(90deg, #7a5d3d, var(--act)); }

/* turista */
body[data-profile="hiker"] { --act: #6cc4ff; }
body[data-profile="hiker"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="hiker"] .meter.act i { background: linear-gradient(90deg, #2b6f9a, var(--act)); }

/* astronom */
body[data-profile="astronomer"] { --act: #8b9cff; }
body[data-profile="astronomer"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="astronomer"] .meter.act i { background: linear-gradient(90deg, #4a58b0, var(--act)); }

/* alergik */
body[data-profile="allergy"] { --act: #ff8fb1; }
body[data-profile="allergy"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="allergy"] .meter.act i { background: linear-gradient(90deg, #a8506f, var(--act)); }
.gx-togs { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-tog { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.gx-tog.on { border-color: var(--act); color: var(--ink); background: color-mix(in srgb, var(--act) 18%, transparent); }
.ff-list li.dim { opacity: .45; }

/* denní max/min a karta „O aplikaci“ */
.dh-temps small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-right: 5px; }
.about-list { display: grid; gap: 10px; margin: 0; }
.about-list > div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.about-list dt { color: var(--muted); font-size: 13px; }
.about-list dd { margin: 0; font-family: var(--mono); font-size: 13px; text-align: right; }
.about-list a { color: var(--act); word-break: break-all; }

/* upozornění na uložená / zastaralá data a odhad „teď“ */
.stale-bar { margin: 8px 12px 0; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.35; color: var(--ink);
  background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .4); }
.stale-bar[hidden] { display: none; }
.hero-date .est { color: var(--warm); }

/* kotouč Měsíce (fotografický, otáčený podle oblohy) */
.moon-wrap { display: block; width: 96px; height: 96px; flex: none; }
.moon-wrap svg, .moon-photo { width: 100%; height: 100%; display: block; }
.moon-photo { filter: drop-shadow(0 0 12px rgba(255, 246, 214, .14)); }

/* úzké telefony (≤ 420 px): menší štítky v kartách oborů, aby se karta nikdy nerozšířila přes obrazovku */
@media (max-width: 420px) {
  .gx-chip { padding: 8px 8px; }
  .gx-chip b { font-size: 14px; }
  .gx-chip small { font-size: 10.5px; }
  .gx-stats { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
}

/* fotograf: zlatá a modrá hodinka */
body[data-profile="photographer"] { --act: #ffa62b; }
body[data-profile="photographer"] .dots i.on { box-shadow: 0 0 8px color-mix(in srgb, var(--act) 50%, transparent); }
body[data-profile="photographer"] .meter.act i { background: linear-gradient(90deg, #a8651b, var(--act)); }
.fbar i.lt-gold { background: #ffb347; } .fbar i.lt-blue { background: #5b9dff; } .fbar i.lt-night { background: #8b9cff; }
.sol-list i.gold { background: #ffb347; opacity: 1; } .sol-list i.blue { background: #5b9dff; opacity: 1; }
