/* Ärevarv · Patrik springer. Base layout and the older views; the identity and the new screens live in brand.css. */
:root {
  /* Ärevarv identity: warm cream paper, navy ink, bib red, Lidingö forest, medal sun, lake blue */
  --paper: #FFF7EA;
  --paper-2: #F5E9D2;
  --card: #FFFDF7;
  --ink: #1B1A2E;
  --ink-2: #5D5A6C;
  --rule: #EADCC4;
  --red: #E63B2E;
  --red-d: #B42A20;
  --now: #C42A1F;            /* red as text: 4.9:1 on paper */
  --forest: #2E7D4F;
  --forest-d: #1E5A37;
  --sun: #FFC43D;
  --sun-d: #D99A10;
  --lake: #5FA8D3;
  --lake-d: #3A7DA6;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fredoka', 'Nunito', system-ui, sans-serif;   /* display: titles, Hasse's voice */
  --num: 'Barlow Condensed', 'Nunito', system-ui, sans-serif;
  --r: 18px;
  --lift: 0 4px 0 rgba(27, 26, 46, .12);
  --bar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body {
  font: 400 17px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif { font-family: var(--serif); font-variant-numeric: normal; }
.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ink2 { color: var(--ink-2); }

/* ---------- frame ---------- */
#app { position: fixed; inset: 0; }
.view { position: absolute; inset: 0 0 calc(var(--bar) + var(--safe-b)) 0; display: none; }
.view.on { display: block; }
.scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* bottom bar: three words, the active one underlined in ink (never --now) */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bar) + var(--safe-b));
  padding-bottom: var(--safe-b); display: flex; background: var(--paper); border-top: 1px solid var(--rule); z-index: 20;
}
#bar a {
  flex: 1; display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; min-height: 48px;
}
#bar a span { padding: 6px 2px 4px; border-bottom: 2px solid transparent; }
#bar a[aria-current="page"] span { border-bottom-color: var(--ink); }
#bar a:not([aria-current="page"]) { color: var(--ink-2); }

/* the progress line: the only motion that starts itself */
#load { position: fixed; top: 0; left: 0; height: 1px; background: var(--ink); width: 0; z-index: 40; transition: width .4s var(--ease), opacity .4s; }
#load.done { opacity: 0; }

/* ---------- the closed door ---------- */
#door { position: fixed; inset: 0; display: none; place-items: center; background: var(--paper); z-index: 50; }
#door.on { display: grid; }
#door svg { width: 64px; height: 64px; display: block; margin: 0 auto 20px; }
#door .door-in { width: min(340px, calc(100% - 32px)); text-align: center; }
#door p { font-size: 19px; margin: 0 0 28px; }
#door .fl { display: block; text-align: left; font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
#door .row2 { display: flex; gap: 8px; }
#door input { flex: 1; min-width: 0; min-height: 48px; border: 1px solid var(--ink); background: var(--paper); padding: 0 12px; font-size: 16px; }

/* ---------- Kartan ---------- */
#map { position: absolute; inset: 0; background: var(--paper); }
#map .maplibregl-ctrl-attrib { background: transparent; font: 400 11px var(--sans); color: var(--ink-2); }
#map .maplibregl-ctrl-attrib a { color: var(--ink-2); }
#map .maplibregl-ctrl-bottom-right { bottom: 132px; }
#wearCanvas { position: absolute; inset: 0; pointer-events: none; }
.k-top {
  position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 4px) 8px 2px 16px; display: flex; align-items: center;
  justify-content: space-between; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.k-top > * { pointer-events: auto; }
.k-name { font-weight: 600; font-size: 17px; margin: 0; padding: 6px 0; }
.k-right { display: flex; align-items: center; gap: 4px; }
.k-year { font-weight: 600; font-size: 28px; line-height: 1; padding: 6px 4px; }
.k-clock { width: 48px; height: 48px; display: grid; place-items: center; }
.k-clock svg { width: 24px; height: 24px; }
.k-chip {
  position: absolute; top: calc(var(--safe-t) + 72px); left: 50%; transform: translateX(-50%); z-index: 5;
  display: none; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--ink); padding: 0 4px 0 12px;
  font-size: 15px; min-height: 40px; box-shadow: 2px 2px 0 var(--ink);
}
.k-chip.on { display: flex; }
.k-chip button { width: 36px; height: 36px; font-size: 20px; line-height: 1; }
.k-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px 8px; z-index: 5;
  background: var(--paper); border-top: 1px solid var(--rule);
}
.k-play { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.k-play button.play { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); }
.k-play button.play svg { width: 18px; height: 18px; }
.scrub { position: relative; flex: 1; height: 48px; touch-action: none; cursor: pointer; }
.scrub .line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ink); }
.scrub .tick { position: absolute; top: calc(50% - 4px); width: 1px; height: 8px; background: var(--ink-2); }
.scrub .lab { position: absolute; top: calc(50% + 8px); font-size: 12px; color: var(--ink-2); transform: translateX(-50%); }
.scrub .knob { position: absolute; top: calc(50% - 11px); width: 2px; height: 22px; background: var(--ink); transform: translateX(-1px); }
.scrub .knob::after { content: ''; position: absolute; left: -7px; top: 7px; width: 16px; height: 8px; }
.k-insets { display: flex; gap: 8px; justify-content: space-between; padding-top: 4px; overflow-x: auto; scrollbar-width: none; }
.k-insets::-webkit-scrollbar { display: none; }
.inset { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.inset .fr { width: 56px; height: 56px; background: var(--paper-2); border: 1px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.inset .fr svg { width: 48px; height: 48px; }
.inset .fr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inset span { font: 500 15px var(--serif); color: var(--ink); }
.place { font: 500 15px/1 var(--serif); color: var(--ink-2); letter-spacing: .02em; pointer-events: none; white-space: nowrap;
  text-shadow: 0 0 4px var(--paper), 0 0 2px var(--paper), 0 0 1px var(--paper); }
.place.city { letter-spacing: .18em; text-transform: uppercase; font-size: 15px; }
.course-tag {
  font: 600 15px var(--sans); background: var(--paper); border: 1px solid var(--ink); padding: 4px 12px; min-height: 40px; box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
}
.course-tag .n { color: var(--ink-2); font-weight: 400; }
a.course-tag { text-decoration: none; color: var(--ink); }
.course-tag.off { box-shadow: none; border-color: var(--rule); color: var(--ink-2); cursor: default; }
.k-still { position: absolute; inset: 0; background: var(--paper) center/cover no-repeat; display: none; }
.nogl .k-still { display: block; }

/* ---------- Loppet ---------- */
.l-wrap { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px 24px; }
.l-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.l-title { font-weight: 600; font-size: 17px; margin: 0; padding: 6px 0; }
.l-title .ink2 { font-weight: 400; }
.l-switch { display: flex; gap: 4px; }
.l-switch button { min-height: 40px; padding: 0 10px; font-size: 15px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.l-switch button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.l-clock { font-weight: 600; font-size: 44px; line-height: 1.05; margin-top: 4px; }
.l-speed { font-size: 15px; color: var(--ink-2); min-height: 36px; padding: 4px 0; }
.l-course { position: relative; margin: 8px -16px 0; }
.l-course svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.l-course .c-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.l-course .c-shadow { fill: none; stroke: var(--paper-2); stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
.l-course .c-tick { stroke: var(--ink); stroke-width: 1; }
.l-course .c-km { font: 400 12px var(--sans); fill: var(--ink-2); }
.l-course .c-place { font: 500 15px var(--serif); fill: var(--ink-2); }
.l-course .r { fill: var(--ink); }
.l-course .r.even { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.l-course .r.sel { stroke: var(--ink); stroke-width: 2; }
.l-course .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.l-course .lane36 { fill: none; stroke: var(--now); stroke-width: 2; stroke-dasharray: 3 3; }
.l-course .lab36 { font: 600 15px var(--sans); fill: var(--now); }
.l-course .rlab { font: 600 15px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.l-course .flag { stroke: var(--ink); stroke-width: 1; }
.l-course .flagdot { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.l-course .hit { fill: transparent; cursor: pointer; }
.l-ctrl { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.btn {
  min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); background: var(--paper); font-weight: 600; font-size: 17px;
  box-shadow: 2px 2px 0 var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.quiet { border-width: 1px; box-shadow: none; font-weight: 400; }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font-size: 17px; margin-left: auto; }
.toggle .sw { width: 44px; height: 26px; border: 2px solid var(--ink); position: relative; background: var(--paper); flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--ink-2); transition: transform .2s var(--ease), background .2s; }
.toggle[aria-checked="true"] .sw::after { transform: translateX(18px); background: var(--ink); }
.l-scrub { margin-top: 4px; }
.l-scrub input { width: 100%; height: 40px; accent-color: var(--ink); }
.l-goal { margin-top: 16px; }
.l-goal h2, .sec-h { font-size: 15px; font-weight: 600; margin: 0; padding: 10px 0 6px; border-bottom: 2px solid var(--ink); }
.goal-row {
  display: grid; grid-template-columns: 2.4em 3.4em 1fr auto; gap: 8px; align-items: baseline; padding: 10px 0;
  border-bottom: 1px solid var(--rule); width: 100%; text-align: left; min-height: 48px;
}
.goal-row .t { text-align: right; font-weight: 600; }
.goal-row .y { font-weight: 600; }
.goal-row .f { color: var(--ink-2); font-size: 15px; }
.goal-row.in { animation: rowin .12s var(--ease) both; }
@keyframes rowin { from { opacity: 0; transform: translateY(4px); } }
.l-src { font-size: 15px; color: var(--ink-2); margin: 16px 0 0; }

/* ---------- sheets: bib, Passet on desktop, Klockan ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(28, 26, 23, .18); z-index: 30; opacity: 0; transition: opacity .24s; }
.sheet-back.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--paper); z-index: 31;
  border-top: 2px solid var(--ink); padding: 8px 16px calc(24px + var(--safe-b)); transform: translateY(100%);
  transition: transform .24s var(--ease); overscroll-behavior: contain;
}
.sheet.on { transform: none; }
.sheet .x { position: absolute; top: 4px; right: 4px; width: 48px; height: 48px; font-size: 26px; line-height: 1; z-index: 1; }
#sheet-body { padding-top: 28px; }
.sheet .grip { width: 40px; height: 4px; background: var(--rule); margin: 4px auto 8px; }
.bib { border: 2px solid var(--ink); padding: 14px 16px 16px; margin-top: 8px; position: relative; background: var(--paper); }
.bib::before, .bib::after { content: ''; position: absolute; top: 10px; width: 8px; height: 8px; border: 1px solid var(--ink-2); border-radius: 50%; }
.bib::before { left: 10px; } .bib::after { right: 10px; }
.bib .b-h { font-weight: 600; font-size: 17px; padding: 0 16px; text-align: center; }
.bib .b-t { font-weight: 600; font-size: 44px; text-align: center; line-height: 1.1; margin: 6px 0 2px; }
.bib .b-p { text-align: center; color: var(--ink-2); }
.bib .b-c { font: 400 20px/1.4 var(--serif); margin: 14px 0 0; text-align: center; }
.bib .b-s { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; font-size: 15px; color: var(--ink-2); }
.bib .b-s div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.bib .b-s div span:last-child { color: var(--ink); text-align: right; }

/* ---------- Liggaren ---------- */
.g-wrap { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 0 24px; }
.seg { display: flex; margin: 0 16px; border: 2px solid var(--ink); }
.seg a { flex: 1; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 15px; font-weight: 600; gap: 6px; }
.seg a + a { border-left: 2px solid var(--ink); }
.seg a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.seg a .n { font-weight: 400; }
.lg { margin: 8px 0 0; padding: 0; list-style: none; }
.lg li { border-bottom: 1px solid var(--rule); }
.lg .row { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 4px 10px; padding: 10px 16px; align-items: baseline; width: 100%; text-align: left; min-height: 48px; }
.lg .yr { font-weight: 600; }
.lg .race { min-width: 0; }
.lg .race .nth { color: var(--ink-2); }
.lg .tm { text-align: right; font-weight: 600; }
.lg .pl { grid-column: 3; text-align: right; color: var(--ink-2); font-size: 15px; }
.lg .cm { grid-column: 2 / 4; font: 400 17px/1.4 var(--serif); }
.lg .mg { grid-column: 2 / 4; font: 500 17px/1.4 var(--serif); color: var(--ink-2); }
.lg li.hundred .row { color: var(--ink-2); border-bottom: 1px dashed var(--ink-2); }
.lg li.hundred { border-bottom: 0; }
.lg li.honour .race { font-style: normal; }
.lg li.honour .src { grid-column: 2 / 4; font-size: 15px; color: var(--ink-2); }
.lg li.drop .row { color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--now); vertical-align: middle; margin-right: 6px; }
.yh { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; justify-content: space-between; padding: 10px 16px 6px;
  border-bottom: 2px solid var(--ink); font-weight: 600; font-size: 15px; }
.yh .ink2 { font-weight: 400; }
.yg { content-visibility: auto; contain-intrinsic-size: auto 2400px; }
.ps { list-style: none; margin: 0; padding: 0; }
.ps a, .ps .ps-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 16px; text-decoration: none; border-bottom: 1px solid var(--rule); min-height: 48px; align-items: baseline; }
.ps .d { color: var(--ink-2); font-size: 15px; }
.ps .tt { font-family: var(--serif); font-size: 17px; }
.ps .v { text-align: right; font-size: 15px; }
.ps li.mgap a { border-top: 6px solid var(--paper-2); }
.ps a.now .tt::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--now); margin-right: 8px; vertical-align: middle; }
.sk a { display: grid; grid-template-columns: 1fr auto; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--rule); min-height: 56px; align-items: baseline; gap: 10px; }
.sk .who { font: 400 20px var(--serif); }
.sk .v { color: var(--ink-2); }
.sk .v b { color: var(--ink); font-weight: 600; }
.filter-h { display: flex; align-items: center; justify-content: space-between; margin: 8px 16px 0; border: 1px solid var(--ink); padding: 0 0 0 12px; min-height: 44px; }
.filter-h button { width: 44px; height: 44px; font-size: 22px; }

/* ---------- Passet ---------- */
.p-wrap { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 16px 32px; }
.p-top { display: flex; align-items: flex-start; gap: 8px; }
.p-top .back { width: 48px; height: 48px; margin-left: -12px; flex: none; display: grid; place-items: center; }
.p-top .back svg { width: 22px; height: 22px; }
.p-title { flex: 1; min-width: 0; }
.p-title input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: transparent; font: 400 28px/1.25 var(--serif); padding: 4px 0; }
.p-title input:focus { outline: none; border-bottom-color: var(--ink); }
.p-date { color: var(--ink-2); font-size: 15px; }
.p-map { margin: 12px -16px 0; background: var(--paper-2); }
.p-map svg { display: block; width: 100%; height: auto; }
.p-map .tr { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.p-map .tr.now { stroke: var(--now); }
.p-map .st { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.cells { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--ink); margin-top: 0; }
.cell { padding: 10px 0 10px; border-bottom: 1px solid var(--rule); }
.cell:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 10px; }
.cell:nth-child(even) { padding-left: 12px; }
.cell .k { font-size: 15px; color: var(--ink-2); }
.cell .v { font-size: 20px; font-weight: 600; }
.cell .v small { font-size: 15px; font-weight: 400; color: var(--ink-2); }
.splits { width: 100%; border-collapse: collapse; margin-top: 8px; }
.splits th { font-size: 15px; font-weight: 600; text-align: right; padding: 8px 0 6px; border-bottom: 2px solid var(--ink); }
.splits th:first-child, .splits td:first-child { text-align: left; }
.splits td { padding: 7px 0; border-bottom: 1px solid var(--rule); text-align: right; }
.splits .bar { width: 34%; padding-left: 12px; }
.splits .bar i { display: block; height: 2px; background: var(--ink-2); }
.line-in { margin-top: 18px; border-bottom: 1px solid var(--ink); display: flex; align-items: center; }
.line-in input { flex: 1; border: 0; background: transparent; font: 400 20px var(--serif); padding: 10px 0; min-height: 48px; }
.line-in input:focus { outline: none; }
.line-in .saved { font-size: 15px; color: var(--ink-2); opacity: 0; transition: opacity .2s; }
.line-in .saved.on { opacity: 1; }
.p-src { font-size: 15px; color: var(--ink-2); margin-top: 16px; }

/* ---------- Klockan ---------- */
.kl h2 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.kl p { margin: 6px 0; }
.kl ol { margin: 6px 0; padding-left: 1.4em; }
.kl input[type=date], .kl input[type=text] { width: 100%; min-height: 48px; border: 1px solid var(--ink); background: var(--paper); padding: 0 12px; font-size: 17px; }
.kl .row2 { display: flex; gap: 8px; margin-top: 8px; }
.kl .status { color: var(--ink-2); margin-top: 6px; }
.kl .foot { margin-top: 24px; text-align: center; font: 500 17px var(--serif); color: var(--ink-2); }

.err { padding: 24px 16px; color: var(--ink-2); }

@media (min-width: 960px) {
  :root { --bar: 0px; }
  #bar { top: 0; bottom: 0; right: auto; width: 96px; height: auto; flex-direction: column; justify-content: center; border-top: 0; border-right: 1px solid var(--rule); padding: 0; }
  #bar a { flex: none; height: 72px; }
  .view { left: 96px; bottom: 0; }
  .sheet { left: auto; right: 24px; bottom: 24px; width: 440px; max-height: calc(100vh - 48px); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
  .k-bottom { padding: 0 24px 16px; }
  .k-insets { justify-content: flex-start; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ---------- additions: switch, grid, empty rule, Samma runda ---------- */
.empty-rule { border-top: 1px dashed var(--ink-2); margin: 14px 0; height: 0; }
.l-switch { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 2px 0 0; }
.l-sw { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; }
.l-sw.on { color: var(--ink); border-bottom-color: var(--ink); }
.l-sw.off { cursor: default; }
.l-speed { display: inline-flex; align-items: center; min-height: 40px; }
.l-ctrl { flex-wrap: wrap; }
.goal-row { color: inherit; }
.drop-line { display: flex; align-items: center; gap: 2px; color: var(--ink-2); margin: 10px 0; }
.sr-pack { margin-top: 22px; }
.sr-t td { font-size: 17px; }
.sr-strip-w { margin-top: 10px; }
.sr-strip { display: block; width: 100%; height: auto; }
.sr-axis { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-2); }
.p-date .p-saved { opacity: 0; transition: opacity .2s; }
.p-date .p-saved.on { opacity: 1; }
.klar { margin-top: 4px; min-height: 40px; padding: 0 12px; }
.lg .rowlink { display: block; text-decoration: none; color: inherit; }
.filter-h .x { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; text-decoration: none; }
.tomap-w { padding: 8px 16px 4px; }
.tomap { min-height: 40px; font-size: 15px; text-decoration: none; }
.kl-h { font: 600 17px var(--sans); padding: 12px 0; }
.scrub .lab, .l-course .c-km { font-size: 15px; }
@media (min-width: 960px) {
  .l-wrap { max-width: 1100px; }
  .l-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 32px; align-items: start; }
  .l-course { margin: 8px 0 0; }
  .l-right { position: sticky; top: 12px; padding-top: 48px; }
}

.scrub .lab.first { transform: none; }
.scrub .lab.last { transform: translateX(-100%); }
.p-title { margin: 0; }
.l-head { flex-wrap: wrap; }
.l-clockrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.l-goal-h { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.l-goal-h h2 { border: 0; padding: 10px 0 6px; }
.l-goal-h .toggle { margin: 0 0 6px; min-height: 40px; font-size: 15px; }
.l-ctrl .btn { min-width: 96px; }
.l-scrub { padding: 0 0 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 40px; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type=range]::-moz-range-track { height: 1px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 40px; margin-top: -19.5px; background: linear-gradient(var(--ink), var(--ink)) center / 4px 24px no-repeat; border: 0; border-radius: 0; }
input[type=range]::-moz-range-thumb { width: 28px; height: 40px; background: linear-gradient(var(--ink), var(--ink)) center / 4px 24px no-repeat; border: 0; border-radius: 0; }
.bib .b-same { display: block !important; text-align: right; }
.bib .b-same span { display: block; }
.bib .b-same span:first-child { color: var(--ink); }

/* ---------- the real colour map under Loppet and Passet ---------- */
.l-course { position: relative; aspect-ratio: 390 / 300; }
.l-course .l-map { position: absolute; inset: 0; }
.l-course svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.l-course.on-map .c-shadow { stroke: #fff; stroke-width: 7; opacity: .9; }
.l-course.on-map .c-line { stroke-width: 2.5; }
.l-course .r { stroke: #fff; stroke-width: 1.5; }
.l-course .r.even { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.l-course .c-place, .l-course .lab36 { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.l-course.on-map .c-place { fill: var(--ink); }
.p-map { position: relative; aspect-ratio: 390 / 220; }
.p-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-map .p-real { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; }
.p-map.on-map .p-real { opacity: 1; }
.p-map.on-map svg { visibility: hidden; }

/* Samma ålder: a word that is underlined when on, like the bar and the tabs */
.toggle { padding: 0 12px; border: 1px solid var(--ink); color: var(--ink); font-weight: 600; background: var(--paper); }
.toggle[aria-checked="true"] { background: var(--ink); color: var(--paper); }
#map .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(244, 239, 230, .85); min-height: 22px; }
#map .maplibregl-ctrl-attrib-button { filter: invert(38%); transform: scale(.8); }

.kl input[type=datetime-local] { width: 100%; min-height: 48px; border: 1px solid var(--ink); background: var(--paper); padding: 0 12px; font-size: 17px; }
.kl .fl { display: block; font-size: 15px; color: var(--ink-2); margin: 10px 0 4px; }
.kl .row2 .grow { flex: 1; min-width: 0; }
.p-note { margin: 4px 16px 0; padding: 14px 0; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 15px; }
#sheet-body .btn { margin: 16px; }
