:root {
  --bg: #0D151C; --panel: #14202A; --hair: #30424F; --text: #EAF2F5; --muted: #9FB0BA;
  --green: #78B43C; --blue: #68CBF3; --red: #F2685E; --amber: #F4B740; --unknown: #5B6C78;
  --head: "Sora", system-ui, sans-serif; --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--body); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.notice { padding: 6px 16px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--hair); }
.top { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: rgba(13, 21, 28, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 600 16px var(--head); }
.live { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.live b { font-weight: 400; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); }
.live.ok i { background: var(--green); }
.tabs { order: 3; width: 100%; display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--hair); border-radius: 12px; }
.tabs button { flex: 1; min-height: 40px; padding: 6px 4px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
main.wide { max-width: 1100px; }
h1 { font: 300 28px/1.15 var(--head); margin: 8px 0 12px; }
h2 { font: 400 13px var(--body); letter-spacing: .02em; color: var(--muted); margin: 0 0 10px; }
.card { background: var(--panel); border: 1px solid var(--hair); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.card.alert { border-color: rgba(242, 104, 94, .55); background: linear-gradient(180deg, rgba(242, 104, 94, .12), var(--panel) 70%); }
.card.calm { border-color: rgba(120, 180, 60, .45); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.big { font: 300 40px/1.1 var(--head); margin: 4px 0 10px; }
.big small { font: 400 15px var(--body); color: var(--muted); margin-left: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; background: var(--unknown); }
.s-shedding { background: var(--red); } .s-off { background: var(--amber); } .s-soon { background: var(--blue); }
.s-ok { background: var(--green); } .s-unknown { background: var(--unknown); }
.rows > div { padding: 5px 0; font-weight: 600; }
.rows > div span.muted { font-weight: 400; margin-left: 6px; }
.progress { height: 4px; border-radius: 2px; background: var(--hair); margin-top: 12px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { min-height: 36px; padding: 5px 12px; border-radius: 18px; border: 1px solid var(--hair); background: none; color: var(--muted); font-size: 14px; }
.chip.on { color: var(--bg); background: var(--blue); border-color: var(--blue); font-weight: 600; }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.days .chip { white-space: nowrap; flex: none; }

.win { border-left: 3px solid var(--hair); padding: 8px 0 8px 12px; margin-bottom: 10px; }
.win.active { border-color: var(--red); } .win.upcoming { border-color: var(--blue); } .win.done { opacity: .62; }
.win .time { font: 600 17px var(--head); }
.win .state { float: right; font-size: 13px; color: var(--muted); }
.win .names { color: var(--text); }
.win .note { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tag { font-size: 12px; padding: 1px 6px; border: 1px solid var(--hair); border-radius: 6px; color: var(--muted); margin-left: 6px; }

.tl { position: relative; }
.tl-axis, .tl-row { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 8px; }
.tl-axis { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tl-axis div:last-child { display: flex; justify-content: space-between; }
.tl-row { min-height: 34px; border-top: 1px solid rgba(48, 66, 79, .5); font-size: 13px; }
.tl-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(48, 66, 79, .7) calc(25% - 1px) 25%); }
.tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--blue); min-width: 3px; }
.tl-bar.done { background: var(--unknown); } .tl-bar.active { background: var(--red); }
.tl-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--red); }

#map { height: calc(100dvh - 190px); min-height: 360px; border-radius: 14px; border: 1px solid var(--hair); background: var(--panel); }
.leaflet-container { background: #101A22; font: 13px var(--body); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(190deg) brightness(.85) contrast(.9) saturate(.5); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--hair); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin: 10px 0 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-weight: 400; color: var(--muted); padding: 4px 6px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { padding: 7px 6px; border-top: 1px solid rgba(48, 66, 79, .6); text-align: right; font-variant-numeric: tabular-nums; }
tr.sel td { background: rgba(104, 203, 243, .08); }
tbody tr { cursor: pointer; }
.hbar { height: 4px; border-radius: 2px; background: var(--green); margin-top: 4px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.months { display: flex; align-items: flex-end; gap: 4px; height: 130px; min-width: 100%; }
.months > div { flex: 1; min-width: 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 11px; color: var(--muted); }
.months i { display: block; width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 1px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(9px, 1fr)); gap: 2px; font-size: 11px; color: var(--muted); min-width: 330px; max-width: 760px; }
.heat .c { aspect-ratio: 1; border-radius: 2px; background: var(--hair); }
.heat .hh { text-align: center; }

.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login input { width: 100%; min-height: 52px; margin: 12px 0; padding: 10px; text-align: center; letter-spacing: .4em; font: 600 22px var(--head);
  color: var(--text); background: var(--bg); border: 1px solid var(--hair); border-radius: 12px; }
.btn { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--green); color: #0D151C; font-weight: 600; }
.err { color: var(--red); min-height: 22px; font-size: 14px; }
.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; color: var(--muted); }

@media (min-width: 760px) {
  .tabs { order: 0; width: auto; margin: 0 auto; }
  .tabs button { padding: 6px 18px; }
  .tl-axis, .tl-row { grid-template-columns: 190px 1fr; }
  h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: no-preference) { .live.ok i { animation: pulse 2.4s infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
