:root {
  --bg: #f4f4f5; --card: #ffffff; --ink: #18181b; --muted: #71717a; --line: #e4e4e7; --chip: #f4f4f5;
  --accent: #27272a; --on-accent: #ffffff; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.05);
  --lo: #22a06b; --mid: #e2b203; --hi: #e5484d; --late: #fdecec; --zebra: #fafafa; --bar: rgba(255,255,255,.82);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f11; --card: #18181b; --ink: #f4f4f5; --muted: #a1a1aa; --line: #27272a; --chip: #27272a;
          --accent: #e4e4e7; --on-accent: #18181b; --shadow: none;
          --late: #3a1d1f; --zebra: #1d1d21; --bar: rgba(24,24,27,.82); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px 40px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; letter-spacing: -.02em; }
h1 small { display: block; font-size: .9rem; color: var(--muted); font-weight: 400; }
h2 { font-size: 1.1rem; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
small { color: var(--muted); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: var(--bar); color: var(--ink); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.top a { color: var(--ink); text-decoration: none; }
.brand { font-weight: 700; letter-spacing: -.01em; }
nav { display: flex; gap: 4px; align-items: center; }
nav a:not(.me) { padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: .95rem; }
nav a:not(.me):hover { color: var(--ink); }
nav a.on { background: var(--chip); color: var(--ink); font-weight: 600; }
.me { background: var(--c); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center;
  margin-left: 6px; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow); }
.toggle { font-size: .85rem; font-weight: 500; color: var(--muted); }
.err { color: var(--hi); }
.empty { color: var(--muted); }
/* power */
.nowprice { margin: 0 0 10px; }
.recs { list-style: none; padding: 0; margin: 0 0 12px; }
.recs li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.recs small { display: block; }
.big { font-size: 1.6rem; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding-bottom: 16px; }
.bar { flex: 1; border-radius: 3px 3px 0 0; position: relative; min-width: 3px; }
.bar.lo, .legend .lo::before { background: var(--lo); }
.bar.mid, .legend .mid::before { background: var(--mid); }
.bar.hi, .legend .hi::before { background: var(--hi); }
.bar i { position: absolute; bottom: -16px; left: 0; font-size: .65rem; color: var(--muted); font-style: normal; }
.legend { font-size: .8rem; color: var(--muted); margin: 4px 0 0; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 6px; }
/* tasks */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task.late { box-shadow: inset 3px 0 0 var(--hi); padding-left: 10px; }
.task.late small b { color: var(--hi); font-weight: 600; }
.task form { margin: 0; }
.tt { flex: 1; }
.tt small { display: block; }
.check { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 1rem; cursor: pointer; transition: all .15s; }
.check:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }
.who { background: var(--c); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.due { font-size: .8rem; color: var(--muted); width: 42px; }
/* forms */
.add summary { cursor: pointer; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 4px; }
input, select, button { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.grid button, .pin button { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; cursor: pointer; }
/* login */
.login { text-align: center; padding-top: 30px; }
.avatars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 420px; margin: 20px auto; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.avatar span { font-size: 2.4rem; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); border: 4px solid transparent; }
.avatar.sel span { border-color: var(--ink); }
.pin { display: flex; flex-direction: column; gap: 10px; max-width: 220px; margin: 0 auto; }
.pin input { text-align: center; font-size: 1.6rem; letter-spacing: .5em; }
/* departures — compact, fixed width, like Bo's old Indelukkehuset board */
#afgange h2, .fullboard h2 { margin-bottom: 6px; }
.board { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.3;
  border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board th { text-align: left; padding: 3px 5px; font-weight: 600; }
.board td { padding: 3px 5px; white-space: nowrap; }
.board tbody tr:nth-child(odd) { background: var(--zebra); }
.ico { width: .85em; height: .85em; vertical-align: -1px; margin-right: 3px; display: inline; }
.board .ln { white-space: nowrap; }
.board .ln a { color: inherit; text-decoration: none; }
.board tr[data-href] { cursor: pointer; }
.board tbody tr[data-href]:hover { background: var(--late); }
.board .dly { color: var(--hi); font-weight: 600; }
.board .cancel td:not(.t) { text-decoration: line-through; opacity: .6; }
.msgs { list-style: none; padding: 0; margin: 3px 0 0; font-size: .85rem; color: var(--hi); }
.fullboard main { max-width: 460px; }
.back { text-align: center; }
.back a, h2 small a { color: var(--muted); }
@media (max-width: 440px) {
  #afgange { padding: 10px 6px; }
  .board th, .board td { padding: 3px 3px; }
  .board .cut { display: inline-block; max-width: 6.2em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
}
@media (max-width: 375px) { .board .cut { max-width: 5.4em; } }
/* journey detail */
.back-top { margin: 4px 0 0; } .back-top a { color: var(--muted); text-decoration: none; }
.route { list-style: none; margin: 0; padding: 0; }
.route li { display: flex; align-items: center; gap: 10px; padding: 3px 0; position: relative; }
.route .rt { width: 5.2em; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.route .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--card); flex: none; z-index: 1; }
.route li::before { content: ""; position: absolute; left: calc(5.2em + 14px); top: 0; bottom: 0; border-left: 2px solid var(--line); }
.route li:first-child::before { top: 50%; } .route li:last-child::before { bottom: 50%; }
.route .past { color: var(--muted); }
.route .mine { font-weight: 700; } .route .mine .dot { background: var(--accent); width: 14px; height: 14px; margin: 0 -2px; }
.route .cancel .sn { text-decoration: line-through; }
.dly { color: var(--hi); font-weight: 600; }
.msg { color: var(--hi); font-size: .85rem; margin: 8px 0 0; }
.btn { display: inline-block; margin-top: 10px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--lc); color: #fff;
  border-radius: 8px; padding: 1px 9px 1px 7px; }
.pill .ico { width: .8em; height: .8em; }
