:root {
  --green-1: #1c5a4a; --green-2: #0e3a30; --mint: #f2faf5; --mint-2: #cfeadb; --stripe: #2fa36b;
  --ink: #0b0b0c; --muted: #4a6b60; --yellow: #f5c400; --red: #c4321f; --card: #ffffff; --bg: #eef6f1;
  --radius: 14px; --link: #12704f;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #eaf4ee; --muted: #9cc3b0; --card: #133f34; --bg: #0b2a23; --mint: #133f34; --link: #8fe0b4; --red: #ff9b8c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(var(--green-1), var(--green-2)); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; }
.brand img { border-radius: 8px; }
nav { display: flex; gap: 4px; margin-left: auto; }
nav a { color: var(--mint-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
nav a[aria-current] { background: rgba(255,255,255,.15); color: #fff; }
.lang { display: flex; gap: 2px; }
nav[hidden] + .lang { margin-left: auto; }
.lang button { background: transparent; color: var(--mint-2); border: 1px solid rgba(255,255,255,.3);
  padding: 3px 8px; font: 700 12px system-ui; cursor: pointer; }
.lang button:first-child { border-radius: 6px 0 0 6px; } .lang button:last-child { border-radius: 0 6px 6px 0; }
.lang button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

main { max-width: 680px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 14px 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h2:first-child { margin-top: 0; }
.muted, small, .help { color: var(--muted); }
small { display: block; font-size: 13px; margin-top: 2px; }
.center { text-align: center; }

.hero { text-align: center; padding: 24px 0 4px; }
.hero img { border-radius: 26px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.hero h1 { font-size: 34px; margin: 12px 0 4px; }
.lead { font-size: 18px; }
.privacy h2 { margin-top: 0; }

label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid #b9d3c6; border-radius: 10px; background: #fff; color: #0b0b0c;
}
input:focus, select:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.dt { display: grid; grid-template-columns: 1fr 84px; gap: 6px; }
.bmcard { border: 2px dashed var(--yellow); }

/* regular trips in settings */
#routes { counter-reset: route; }
fieldset.route { counter-increment: route; border: 1px solid #b9d3c6; border-radius: 12px; padding: 4px 12px 10px; margin: 10px 0; min-width: 0; }
fieldset.route legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
fieldset.route legend::after { content: " " counter(route); }
button.link.danger-link { color: var(--red); display: block; margin-top: 4px; }

/* "Another trip": collapsed panel at the top of Trips */
details.fold { padding: 0; }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "›"; font-size: 22px; line-height: 1; color: var(--stripe); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold form, details.fold #otherResult { padding: 0 16px; }
details.fold #otherResult { padding-bottom: 8px; }
details.fold #otherResult:empty { display: none; }
details.fold h3 { font-size: 15px; color: var(--muted); margin: 16px 0 6px; }
details.fold .trip { box-shadow: none; border: 1px solid #b9d3c6; }
details.fold form { padding-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .row { grid-template-columns: 1fr; } }

button { font: inherit; cursor: pointer; border-radius: 10px; padding: 9px 14px; border: 1px solid #b9d3c6; background: #fff; color: #0b0b0c; }
button.primary { background: var(--green-2); color: #fff; border-color: var(--green-2); font-weight: 700; }
a.button { display: inline-block; border-radius: 10px; padding: 9px 14px; text-decoration: none; }
a.button.primary { background: var(--green-2); color: #fff; font-weight: 700; }
button.big { display: block; width: 100%; padding: 14px; font-size: 18px; }
button.link { background: none; border: none; padding: 4px 0; color: var(--link); font-weight: 600; }
button.danger { color: var(--red); border-color: var(--red); }
.error { color: var(--red); font-weight: 600; min-height: 1.2em; }
.ok { color: var(--link); font-weight: 700; margin-left: 10px; }
.notice { background: #fff4c2; color: #0b0b0c; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.station { position: relative; }
.suggest { position: absolute; z-index: 3; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid #b9d3c6; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.suggest button { display: block; width: 100%; text-align: left; border: none; padding: 8px 10px; }
.suggest button:hover, .suggest button:focus { background: var(--bg); }

.tickets { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.tickets li { padding: 8px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; border-bottom: 1px solid var(--mint-2); }
.tickets li small { margin: 0; }
.tk-acts { display: flex; gap: 12px; flex: none; }
.ticketform { background: var(--bg); border-radius: 12px; padding: 4px 12px 12px; margin: 10px 0; }
.ticketform h3 { font-size: 15px; margin: 10px 0 0; }
.pill { background: var(--mint-2); color: var(--green-2); border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

.day h2 { font-size: 15px; color: var(--muted); margin: 20px 0 6px; }
.day h2::first-letter { text-transform: uppercase; }
.trip, .claim { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.when { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.when strong { font-size: 18px; } .when span { font-size: 12px; font-weight: 700; color: var(--muted); }
.badge { display: inline-block; border-radius: 6px; padding: 0 6px; font-size: 12px; font-weight: 800; margin-left: 4px; }
.badge.bad { background: var(--ink); color: var(--yellow); }
.badge.warn { background: var(--yellow); color: var(--ink); }
.badge.quiet { background: var(--mint-2); color: var(--green-2); font-weight: 700; }
.claim { grid-template-columns: 1fr auto auto auto; }
.acts { display: flex; flex-direction: column; align-items: center; gap: 2px; }
button.small { font-size: 13px; padding: 2px 0; }
button.remove { color: var(--muted); font-size: 16px; padding: 4px 6px; }
.claim select { width: auto; } .claim input { width: 90px; }
.totals { font-weight: 700; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

a.bookmarklet img { border-radius: 5px; vertical-align: -5px; margin-right: 4px; }
.steps { padding-left: 20px; } .steps li { margin: 6px 0; }
.big { display: inline-block; font-size: 20px; font-weight: 800; background: var(--yellow); color: #0b0b0c; border-radius: 6px; padding: 0 8px; }
p.small { font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
label.share-setup { align-items: flex-start; margin: 16px 0 4px; }
label.share-setup input { margin-top: 4px; }
label.share-setup small { font-weight: 400; }
a.bookmarklet { display: inline-block; background: var(--ink); color: var(--yellow); font-weight: 800; text-decoration: none;
  padding: 12px 18px; border-radius: 12px; border: 3px dashed var(--yellow); cursor: grab; }

dialog { border: none; border-radius: var(--radius); padding: 20px; max-width: min(92vw, 460px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin-top: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

footer { max-width: 680px; margin: 10px auto 30px; padding: 0 16px; font-size: 13px; color: var(--muted); text-align: center; }
footer a { color: var(--link); }

/* visually hidden but part of the text (e.g. the 👻 that ends up in the bookmark's name) */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

[hidden] { display: none !important; }
input::placeholder { color: #8aa79b; opacity: 1; }
.pill.live { background: var(--stripe); color: #fff; text-transform: uppercase; letter-spacing: .04em; vertical-align: 2px; }
.small-hero { padding-top: 8px; }
.small-hero h1 { font-size: 26px; }
.about p { margin: 0 0 12px; }
.counter { font-weight: 700; margin: 8px 0; }
.counter small { font-weight: 400; }
.sharecard pre { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow-x: auto; }
.sharecard summary { cursor: pointer; color: var(--link); font-weight: 600; }
.jab { background: var(--card); border-left: 4px solid var(--yellow); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 8px 0; text-align: left; }
.podium { list-style: none; padding: 0; margin: 6px 0 4px; }
.podium li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.podium .muted { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pct { font-weight: 800; }
details.jabfold > summary { font-weight: 400; }
details.jabfold > summary::before { color: var(--yellow); }
details.jabfold .pct { font-weight: 800; }
details.jabfold .jab-body { padding: 0 16px 12px; }
.trip .deadline { grid-column: 1 / -1; order: 3; margin: -4px 0 0; color: var(--red); font-weight: 700; }
.offline { margin: 0; padding: 6px 16px; background: var(--ink); color: var(--yellow); font-size: 14px; text-align: center; }
.notice.problem { background: #ffe1dc; }
.suggest li.small { padding: 8px 10px; font-size: 13px; }
.homecard { border: 2px dashed var(--stripe); }
.homecard h2 { margin-top: 0; }
.reassure { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 4px 0 10px; }
.roadmap { margin: 0; padding-left: 20px; }
.roadmap li { margin: 0 0 8px; }
.support { margin: 28px 0 8px; font-size: 14px; color: var(--muted); }
.support p { margin: 0 0 8px; }
.support strong { color: var(--ink); }
a.support-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 10px; border-radius: 12px;
  background: linear-gradient(var(--green-1), var(--green-2)); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); }
a.support-btn img { border-radius: 6px; }
a.support-btn:hover, a.support-btn:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
details.faq .faq-body { padding: 0 16px 10px; }
details.qa { border-top: 1px solid var(--mint-2); }
details.qa summary { cursor: pointer; padding: 10px 0; font-weight: 600; list-style: none; display: flex; gap: 8px; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: "+"; color: var(--stripe); font-weight: 800; width: 12px; flex: none; }
details.qa[open] summary::before { content: "–"; }
details.qa p { margin: 0 0 12px 20px; color: var(--muted); }
.trip .tk { color: var(--muted); }
.tk-pick { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; font-weight: 400; font-size: 13px; }
.tk-pick select { width: auto; margin: 0; padding: 2px 6px; font-size: 13px; border-radius: 6px; }
input.caught { outline: 3px solid var(--stripe); background: #e5f7ec; }
.casecard h1 { font-size: 22px; }
.trip small.notrun { color: var(--muted); }
.trip small.repl, .nowlist small.repl { display: block; color: var(--muted); font-size: 12px; }
details.now > summary { font-weight: 400; }
details.now > summary small { display: inline; margin-left: 6px; font-size: 12px; }
details.now .now-body { padding: 0 16px 8px; }
details.now.alert { border-left: 4px solid var(--red); }
.nowlist { list-style: none; margin: 0; padding: 0; }
.nowlist li { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--mint-2); font-size: 14px; }
.nowlist .nt { font-weight: 800; font-size: 16px; }
.nowlist .nt s { font-weight: 400; color: var(--muted); font-size: 12px; display: block; }
.nowlist .badge { margin-left: 0; }
button.small-btn { padding: 6px 10px; font-size: 14px; }
@media (prefers-color-scheme: dark) {
  /* the dark green button vanished on the dark green cards: use the logo's bright green with dark text */
  button.primary, a.button.primary { background: #3fbf7f; border-color: #3fbf7f; color: #06261d; }
  a.support-btn { outline: 1px solid rgba(255,255,255,.25); }
}
main.legal { max-width: 720px; }
main.legal h1 { margin-top: 18px; }
main.legal h2 { margin-top: 22px; }
main.legal li { margin: 6px 0; }
main.legal hr { border: none; border-top: 1px solid var(--mint-2); margin: 32px 0 8px; }
.testercard { border: 2px dashed var(--yellow); }
.testercard h2 { margin-top: 0; }
.hero .why { max-width: 520px; margin: 6px auto 0; color: var(--muted); font-size: 15px; }
fieldset.tkkind { border: none; padding: 0; margin: 6px 0; }
fieldset.tkkind legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
fieldset.tkkind label.check { margin: 4px 0; }
.tkimg-preview { display: flex; align-items: center; gap: 10px; margin: -4px 0 8px; }
.tkimg-preview img { max-height: 96px; max-width: 96px; border-radius: 8px; border: 1px solid var(--mint-2); }
.intro { max-width: 460px; margin: 0 auto; text-align: center; }
.intro-top { display: flex; justify-content: flex-end; }
.intro-pic svg, .intro-pic img { width: 100%; max-width: 320px; height: auto; margin: 4px auto 8px; display: block; }
.intro-pic img { border-radius: 14px; border: 1px solid var(--mint-2); box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 46vh; object-fit: cover; object-position: top; }
/* "?" in the top-right corner of the page (not the header, which should stay one row) */
.helpbar { position: relative; max-width: 680px; margin: 0 auto; height: 0; z-index: 4; }
.helpbtn { position: absolute; right: 16px; top: 22px; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 2px solid var(--link); background: var(--card); color: var(--link); font: 800 17px system-ui; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.helpbtn:hover, .helpbtn:focus { background: var(--link); color: var(--card); }
main > h1:first-child { padding-right: 46px; }
dialog.helpdlg { max-width: min(94vw, 440px); }
dialog.helpdlg .intro h1 { font-size: 20px; }
.intro h1 { font-size: 23px; margin: 8px 0 6px; }
.intro .lead { font-size: 17px; margin: 0 0 10px; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: none; background: var(--mint-2); }
.dot[aria-current] { background: var(--stripe); width: 26px; border-radius: 5px; }
.intro .card { text-align: left; }
/* phones: keep the header on one row (logo without the name, tighter tabs) */
@media (max-width: 480px) {
  header { flex-wrap: nowrap; gap: 6px; padding-left: 12px; padding-right: 12px; }
  .brand-name { display: none; }
  nav { gap: 0; }
  nav a { padding: 6px 7px; font-size: 15px; }
  .lang button { padding: 3px 6px; }
}

/* ---------------------------------------------------------------- game "Forsinket?" */
.game { max-width: 480px; margin: 0 auto; }
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 8px; font-weight: 700; }
.g-clock { display: flex; flex-direction: column; align-items: center; }
.g-clock.warn b { color: var(--red); }
.g-bar { display: block; width: 70px; height: 4px; border-radius: 2px; background: var(--mint-2); overflow: hidden; margin-top: 3px; }
.g-bar i { display: block; height: 100%; width: 0; background: var(--yellow); }
.g-lives img { margin-left: 2px; vertical-align: middle; }
.g-lives img.lost { opacity: .2; filter: grayscale(1); }
.g-board { position: relative; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--green-2);
  touch-action: none; user-select: none; -webkit-user-select: none; }
.g-board canvas { display: block; width: 100%; height: 100%; }
.g-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 18px; background: rgba(11, 42, 35, .9); color: #fff; overflow: auto; }
.g-msg h2 { margin: 0 0 8px; color: var(--yellow); font-size: 24px; }
.g-msg p { margin: 0 0 12px; line-height: 1.4; }
.g-rules { text-align: left; margin: 0 0 12px; padding-left: 4px; list-style: none; font-size: 14px; line-height: 1.4; }
.g-rules li { margin: 6px 0; }
.g-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.g-toast { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink);
  color: var(--yellow); font-weight: 800; padding: 6px 14px; border-radius: 99px; }
.g-msg[hidden], .g-toast[hidden] { display: none; }
.g-pad { display: grid; grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 58px); gap: 8px;
  justify-content: center; margin: 12px auto 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.g-pad button { font-size: 24px; border-radius: 16px; background: var(--card); color: var(--ink); border: 2px solid var(--mint-2); padding: 0; }
.g-pad .g-up { grid-column: 2; grid-row: 1; } .g-pad .g-left { grid-column: 1; grid-row: 2; }
/* pause and "?" sit in the bottom corners, away from the arrows, so a thumb doesn't hit them by accident */
.g-pad .g-pp { grid-column: 1; grid-row: 3; justify-self: start; align-self: end; width: 48px; height: 40px; font-size: 18px;
  background: var(--yellow); border-color: var(--yellow); color: #0b0b0c; }
.g-pad .g-right { grid-column: 3; grid-row: 2; } .g-pad .g-down { grid-column: 2; grid-row: 3; }
.g-pad .g-help { grid-column: 3; grid-row: 3; justify-self: end; align-self: end; width: 40px; height: 40px; font-size: 20px; }
.g-keys { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.g-pad .helpbtn, .g-keys .helpbtn { position: static; flex: none; }
.g-msg button.primary { background: var(--yellow); border-color: var(--yellow); color: #0b0b0c; }
.g-lvl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.g-clock.ahead b { color: var(--link); }
.g-toast { white-space: normal; width: max-content; max-width: 90%; text-align: center; }
.g-toast { background: rgba(11, 11, 12, .55); pointer-events: none; transition: top .15s, bottom .15s; }
.g-toast.low { top: auto; bottom: 10px; }
/* centred while it fits; when the rules are taller than the board, they start at the top and scroll */
.g-msg { justify-content: flex-start; padding: 14px 16px; }
.g-msg > :first-child { margin-top: auto; }
.g-msg > :last-child { margin-bottom: auto; }
.g-rules { font-size: 13px; line-height: 1.35; }
.g-rules li { margin: 5px 0; }
.g-sign { vertical-align: -5px; }
/* Sporarbeid: pause, "go now" and "?" in one row under the board */
.g-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0 0; }
.g-row .g-pp { width: 48px; height: 40px; padding: 0; font-size: 18px; border-radius: 16px; background: var(--yellow); border: 2px solid var(--yellow); color: #0b0b0c; }
.g-row .g-go { flex: 1; max-width: 220px; min-height: 48px; font-size: 18px; }
.g-row .g-go:disabled { opacity: .45; }
.g-row .helpbtn { position: static; flex: none; }
.g-spacer { width: 24px; }
/* Full fart: a taller board, speed under the distance */
.g-board.g-tall { aspect-ratio: 3 / 4; }
.g-speed { font-size: 12px; font-weight: 600; color: var(--muted); }
.g-speed.fast { color: var(--link); }
.g-row > .muted { text-align: center; }
.savefail { background: var(--red); color: #fff; font-weight: 600; }
.savefail a { color: #fff; }
