/* jMeteo: dark only, the jApps slate palette. Phone first; on a computer the column stays narrow. */
:root {
  --bg: #0f1720;
  --card: #18222d;
  --card2: #222e3a;
  --line: #26323f;
  --text: #e6ebf0;
  --muted: #8d99a6;
  --accent: #4c9ff0;
  --accent-text: #08121c;
  --ok: #3cc47e;
  --warn: #e0a83a;
  --bad: #ef6262;
  --sun: #f5b73b;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-top: env(safe-area-inset-top, 0px);
}
main {
  max-width: 560px; margin: 0 auto;
  padding: 8px max(14px, env(safe-area-inset-left, 0px)) calc(84px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-right, 0px));
}
h1 { font-size: 26px; margin: 14px 0 12px; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp { flex: 1; }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.ico { display: inline-flex; line-height: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* buttons */
.plain { background: none; border: 0; padding: 0; text-align: left; }
.icon { background: none; border: 0; padding: 8px; color: var(--muted); border-radius: 50%; }
.icon:active { background: var(--card2); }
.spin .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.primary, .secondary { display: block; width: 100%; border: 0; border-radius: 12px; padding: 13px; margin-top: 10px; font-weight: 600; }
.primary { background: var(--accent); color: var(--accent-text); }
.secondary { background: var(--card2); }
.mini { background: var(--card2); border: 0; border-radius: 8px; min-width: 34px; height: 30px; padding: 0 8px; color: var(--muted); }
.mini.bad { color: var(--bad); }

/* header */
.top { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.pname { font-size: 19px; font-weight: 700; display: inline-flex; align-items: baseline; overflow: hidden; }
.caret { color: var(--muted); font-size: 13px; }
.note { margin: 4px 0; font-size: 13px; }

/* alerts */
.alert { border-radius: 12px; padding: 9px 12px; margin-top: 8px; font-size: 14px; border: 1px solid; }
.alert.red { background: color-mix(in srgb, var(--bad) 18%, var(--card)); border-color: var(--bad); }
.alert.amber { background: color-mix(in srgb, var(--warn) 16%, var(--card)); border-color: var(--warn); }
.alert.blue { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); }

/* now */
.now { padding: 8px 2px 4px; }
.nowrow { display: flex; align-items: center; }
.big { font-size: 84px; font-weight: 300; line-height: 1; letter-spacing: -.04em; }
.nowtxt { font-size: 18px; margin-top: 2px; }

.card { background: var(--card); border-radius: 16px; padding: 10px 12px; margin-top: 12px; }
.cap { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* hours */
.hours { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.hours::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; }
.hour.midnight { border-left: 1px solid var(--line); }
.hour .muted { white-space: nowrap; }
.pp { color: var(--accent); font-size: 11px; min-height: 14px; }

/* days */
.days { padding: 4px 12px; }
.day { display: block; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 7px 0; text-align: left; }
.day:first-child { border-top: 0; }
.dayrow { display: grid; grid-template-columns: 44px 28px 34px 32px minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.dayrow .num:last-child { text-align: right; }
.dname { text-transform: capitalize; }
.rng { height: 5px; border-radius: 3px; background: var(--line); position: relative; }
.rng b { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--sun)); }
.detail { padding: 4px 0 10px; }
.slots { display: flex; justify-content: space-between; gap: 2px; overflow-x: auto; }
.slots .hour { flex: 0 1 46px; }
.detail p { margin: 8px 0 0; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tile { background: var(--card); border-radius: 16px; padding: 10px 12px; }
.tile.wide { grid-column: 1 / -1; }
.tv { font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit { font-size: 13px; font-weight: 400; }
.arrow { display: inline-block; color: var(--accent); }
.credit { text-align: center; margin-top: 18px; }

/* places */
.search { width: 100%; font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.results { list-style: none; margin: 6px 0 0; padding: 0; }
.results li { padding: 0; }
.results .result, .results li.muted, .results li.bad { display: block; width: 100%; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.place { background: var(--card); border-radius: 16px; padding: 10px 12px; margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; border: 1px solid transparent; }
.place.sel { border-color: var(--line); }
.pbtn { display: block; width: 100%; }
.pmain { display: flex; flex-direction: column; }
.pn { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt { display: flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 300; }
.chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--card2); }
.chip.red { background: color-mix(in srgb, var(--bad) 30%, var(--card)); }
.chip.amber { background: color-mix(in srgb, var(--warn) 26%, var(--card)); }
.chip.blue { background: color-mix(in srgb, var(--accent) 30%, var(--card)); }
.pact { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

/* settings */
.toggle, .field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.card .cap + .toggle { border-top: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sw { flex: 0 0 auto; width: 42px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .sw { background: var(--ok); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.field:first-child { border-top: 0; }
select { font: inherit; font-size: 16px; color: var(--text); background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.about p { margin: 4px 0; }

/* tab bar */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: rgba(15, 23, 32, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
#tabs button { flex: 0 1 160px; background: none; border: 0; color: var(--muted); padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
#tabs button.on { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .spin .ico { animation: none; } }
