:root {
  --paper: #f4f1ea;
  --ink: #1c1915;
  --muted: #766f64;
  --line: #e7e1d5;
  --panel: #faf8f3;
  --card: #ffffff;
  --radius: 12px;
  --lift: 0 1px 2px rgba(28, 25, 21, 0.05), 0 6px 18px rgba(28, 25, 21, 0.04);
  --now: #1d4e89;
  --warn: #c4552a;
  --caution: #b86a10;
  --ok: #1f7a4d;
  --catch: #1f7a4d;
  --finish: #0e7c86;
  --focus: #9a3412;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.06);
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 100%;
}

#welcome, #app, #overview, #guide { grid-row: 4; }

a { color: var(--now); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand .logo { width: 26px; height: 26px; flex: none; }
.brand .logo rect { fill: #2d2820; }
.brand .logo path {
  fill: none;
  stroke: #58b27f;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand .name { font-weight: 650; letter-spacing: 0.02em; font-size: 16px; }
.brand .sub {
  color: #b9b2a5;
  font-size: 13px;
  padding-left: 10px;
  border-left: 1px solid #4a443a;
}

.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
.topbar nav a:hover { background: #2d2820; }
.topbar nav .gh svg { width: 16px; height: 16px; fill: currentColor; }
.topbar .lang { display: block; margin-left: 6px; }
.topbar .lang select {
  background: #2d2820;
  color: var(--paper);
  border-color: #4a443a;
  padding: 5px 8px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: end;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.empty .toolbar .group:not(.pages) { display: none; }
.toolbar .group { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }

label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

select, input, button {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

button, a.button {
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}

button:hover, a.button:hover { background: #3a342c; }
button:disabled { opacity: 0.45; cursor: default; }
button.quiet, a.button.quiet {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
button.quiet:hover, a.button.quiet:hover { background: #f3ecdf; border-color: #b7ad9e; }
:focus-visible { outline: 2px solid var(--now); outline-offset: 2px; }

#welcome {
  overflow: auto;
  padding: 28px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
#welcome[hidden] { display: none; }
#welcome .card {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
#welcome h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
#welcome h2 { margin: 0 0 8px; font-size: 18px; }
#welcome .lead { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 15px; }
#welcome .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
#welcome .steps { margin: 0 0 14px; padding-left: 22px; line-height: 1.55; font-size: 14px; }
#welcome .steps li { margin: 0 0 6px; }
#welcome .steps code {
  background: #efe9dc;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
}
#welcome .fine { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
#welcome .build { background: #fff; }
#welcome .build .actions { margin: 4px 0 0; }

#status {
  min-height: 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
}

#status:empty { display: none; }
#status:not(:empty) { padding: 10px 20px 0; }

#app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 290px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

#app[hidden] { display: none; }

#list, #gauges, #stage, #hint {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}

#list, #gauges {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d9d2c5 transparent;
}
#list { padding: 0 0 4px; }
#gauges { padding: 20px 20px 10px; }

.rate {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f1ede3;
}
.rate .tick {
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 44px;
  padding: 11px 0 0 16px;
  cursor: pointer;
}
.rate .tick input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.rate .stroke { flex: 1; min-width: 0; width: auto; border-bottom: 0; padding-left: 8px; }
.rate.off .stroke { color: var(--muted); }

.stroke {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 1px solid #f1ede3;
  border-radius: 0;
  padding: 10px 16px 10px 18px;
  cursor: pointer;
}
.stroke::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.rate .stroke::before { display: none; }

.stroke:hover { background: var(--panel); }
.stroke.warn::before { background: var(--warn); opacity: 0.55; }
.stroke.on { background: #f0f6ef; }
.stroke.on::before { background: var(--ok); opacity: 1; }
.stroke.on.warn { background: #fcf2ec; }
.stroke.on.warn::before { background: var(--warn); opacity: 1; }
.rate { position: relative; }
.rate::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.rate:has(.stroke.warn)::before { background: var(--warn); opacity: 0.55; }
.rate:has(.stroke.on)::before { background: var(--ok); opacity: 1; }
.rate:has(.stroke.on.warn)::before { background: var(--warn); opacity: 1; }

.stroke .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.stroke .who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.stroke .who b { color: var(--ink); font-size: 14px; font-weight: 650; }
.stroke .split { font-size: 15px; font-weight: 650; }

.stroke .hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stroke.warn .hint { color: #8a4a2c; }

.tags { display: flex; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 7px;
}
.tag.rescued { color: var(--caution); background: #fdf5e7; border-color: #ecd6ad; }
.tag.pace { color: var(--ok); background: #eef6f0; border-color: #c3dfce; }

.filters {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badges .name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.4;
  cursor: pointer;
}
.badge span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.badge:hover { background: var(--panel); border-color: #cfc7b8; }
.badge.on, .badge.on:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.badge.on span { color: #cfc7b8; }
.badge.rate-badge { padding: 2px 8px; font-variant-numeric: tabular-nums; }
.badges:has(.rate-badge) { gap: 4px; }
.stroke { scroll-margin-top: 96px; }
.none { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }
main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  gap: 12px;
}

#hint {
  border-left: 4px solid var(--ok);
  padding: 14px 18px;
}

#hint.warn { border-left-color: var(--warn); }
#hint .text { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
#hint .pace-line { color: var(--ok); }
#hint .meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
#hint .basis { margin-top: 6px; font-size: 13px; color: #4a443a; }

#chips {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  margin: -2px -2px -6px;
  scrollbar-width: none;
}
#chips::-webkit-scrollbar { display: none; }
#chips.more { mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
#chips.more.end { mask-image: none; }
#chips[hidden] { display: none; }

.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 7px 12px 8px;
  cursor: pointer;
  box-shadow: var(--lift);
}
.chip .k {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.chip .v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip:hover { background: var(--panel); border-color: #cfc7b8; }
.chip.on, .chip.on:hover { background: var(--ink); border-color: var(--ink); }
.chip.on .k { color: #cfc7b8; }
.chip.on .v { color: var(--paper); }
.chip.hot { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.chip.hot .v { color: var(--warn); }
.chip.hot.on .v { color: #ffb598; }

#stage { min-height: 0; position: relative; overflow: hidden; padding: 4px; }
#chart { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#chart:active { cursor: grabbing; }

#foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}


#legend { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  background: currentColor;
}
.swatch.now { color: var(--now); }
.swatch.ref { color: #8a8478; }
.swatch.raw { color: #b7c3d4; }
.swatch.gps { color: var(--ink); }
.swatch.catch { color: var(--catch); }
.swatch.finish { color: var(--finish); }
.swatch.mark { color: var(--focus); }
.swatch.warn { color: var(--warn); }
.swatch.sel { color: #8a4b12; }
.swatch.best { color: var(--ok); }
.swatch.slow { color: #0e7c86; }
.swatch.fast { color: #9a3412; }

.panel-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-head .rate {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.panel-head .sub {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.gauge { margin: 0 0 16px; }
.gauge .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.gauge .name {
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}
.gauge .val { font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 650; }
.gauge .val.ok { color: var(--ok); }
.gauge .val.caution { color: var(--caution); }
.gauge .val.warn { color: var(--warn); }
.bar {
  position: relative;
  height: 6px;
  margin: 8px 0 6px;
  border-radius: 99px;
  background: #eee9de;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--ink);
}
.bar i.ok { background: var(--ok); }
.bar i.caution { background: var(--caution); }
.bar i.warn { background: var(--warn); }
.bar em {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--ink);
  opacity: 0.7;
}
.cap { color: var(--muted); font-size: 12px; line-height: 1.35; min-height: 1.2em; }



dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 16px;
  min-width: min(420px, 92vw);
}
dialog::backdrop { background: rgba(28, 25, 21, 0.35); }
#device-title { font-weight: 650; margin-bottom: 8px; }
#device-session { width: 100%; min-height: 180px; }
#device-note { color: var(--muted); font-size: 13px; margin: 8px 0; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
#device-close { background: #fff; color: var(--ink); }

@media (max-width: 640px) {
  .brand .sub { display: none; }
  .topbar nav .gh span { display: none; }
  #welcome { padding-top: 16px; }
  #welcome .card { padding: 18px; }
  #welcome h1 { font-size: 22px; }
}

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 220px minmax(420px, 1fr) auto; }
  #list { border-right: 0; border-bottom: 1px solid var(--line); }
  #gauges { border-left: 0; border-top: 1px solid var(--line); }
}
/* Session overview: map, figures and curves of the whole session. */
.pages { gap: 0 !important; }
.pages button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 0;
  margin-left: -1px;
  padding: 7px 14px;
}
.pages button[hidden] { display: none; }
.pages button.first { border-radius: 6px 0 0 6px; margin-left: 0; }
.pages button.last { border-radius: 0 6px 6px 0; }
.pages button.first.last { border-radius: 6px; }
.pages button:hover { background: #f3ecdf; }
.pages button[aria-selected="true"], .pages button[aria-selected="true"]:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  position: relative;
}
.pages[hidden] { display: none; }
body.page-overview .analysis { display: none; }
body.page-overview #app { display: none; }
body.page-strokes #overview { display: none; }
body.page-guide #welcome, body.page-guide #app, body.page-guide #overview, body.page-guide .analysis { display: none; }

#overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 16px;
  padding: 16px;
  min-height: 0;
}
#overview[hidden] { display: none; }
#overview .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}
.ov-map { position: relative; min-height: 360px; overflow: hidden; }
#map { position: absolute; inset: 0; background: #e9e4d8; }
#map .leaflet-control-attribution { font-size: 11px; }
#map-note {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  z-index: 500;
}
.ov-map.nogps #map { display: none; }
.ov-map.nogps #map-note { display: flex; }
#map-legend {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 600;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--lift);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 170px;
}
.ov-map.nogps #map-legend { display: none; }
#map-legend .bar2 {
  height: 8px;
  border-radius: 99px;
  margin: 5px 0 4px;
  background: linear-gradient(to right, rgb(230, 0, 20), rgb(230, 200, 20) 50%, rgb(0, 200, 20));
}
#map-legend .ends { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
#map-legend .ends b { color: var(--ink); font-weight: 650; }
#map-legend .keys { display: flex; gap: 12px; margin-top: 6px; color: var(--muted); }
#map-legend .keys i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 2px solid #fff; box-shadow: 0 0 0 1px #1c1915; }
#map-legend .keys i.start { background: #1f9d55; border-radius: 50%; }
#map-legend .keys i.end { background: #1c1915; }
.mark-start, .mark-end { border: 2px solid #fff; box-shadow: 0 0 0 1px #1c1915, 0 1px 4px rgba(0, 0, 0, 0.35); }
.mark-start { background: #1f9d55; border-radius: 50%; }
.mark-end { background: #1c1915; }
.mark-now { background: #1d4e89; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #1d4e89, 0 1px 4px rgba(0, 0, 0, 0.4); }

.ov-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 1px 4px 4px 1px;
  margin: -1px -4px -4px -1px;
  scrollbar-width: thin;
  scrollbar-color: #d9d2c5 transparent;
}
.ov-side > .card { flex: none; }
.ov-head { padding: 16px 18px; }
.ov-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-title h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.ov-title .badge { cursor: default; background: #eef6f0; border-color: #c3dfce; color: var(--ok); }
.ov-title .badge:empty { display: none; }
#ov-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ov-actions[hidden], #ov-tip:empty, a.button[hidden], #ov-charts[hidden] { display: none; }
#ov-tip { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

#ov-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}
#ov-stats .stat { background: var(--card); padding: 12px 14px 11px; min-width: 0; }
#ov-stats .k {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
#ov-stats .v {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#ov-stats .v small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; margin-left: 3px; }
#ov-stats .v.dim { color: #b5ad9f; }

#ov-laps { padding: 12px 6px 6px; overflow-x: auto; }
#ov-laps table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#ov-laps th {
  padding: 0 12px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}
#ov-laps th:first-child, #ov-laps td:first-child { text-align: left; }
#ov-laps td { padding: 6px 12px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
#ov-laps[hidden] { display: none; }

#ov-charts { padding: 6px 0; }
.ov-chart { height: 112px; position: relative; padding: 2px 10px; }
.ov-chart[hidden] { display: none; }
.ov-chart + .ov-chart { border-top: 1px solid var(--line); }
.ov-chart canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

@media (max-width: 980px) {
  #overview { grid-template-columns: 1fr; overflow: auto; }
  .ov-map { height: 52vh; min-height: 320px; }
  .ov-side { overflow: visible; }
}

/* Guide: what the data is and what it tells you. */
#guide { display: none; overflow: auto; padding: 22px 16px 56px; min-height: 0; }
body.page-guide #guide { display: block; }
.g-wrap { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 38px; }
.g-hero h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.g-hero p, .g-lead { margin: 0; color: var(--muted); line-height: 1.55; font-size: 15px; max-width: 780px; }
.g-lead { margin-bottom: 14px; }
.g-sec h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.g-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 16px 18px;
}
.g-card h3 { margin: 0 0 6px; font-size: 16px; }
.g-grid { display: grid; gap: 14px; }
.g-grid.sources { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g-grid.outing { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 14px; }
.g-measures { margin: 0 0 4px; font-size: 14px; line-height: 1.5; }
.g-card ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.g-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.g-card p.g-limit { color: var(--muted); font-size: 13px; }
.g-label {
  margin: 12px 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.g-label.good { color: var(--ok); }
.g-label.warn { color: var(--caution); }
.g-source { border-top: 4px solid var(--line); }
.g-source.gps { border-top-color: #1d4e89; }
.g-source.accel { border-top-color: #1f7a4d; }
.g-source.gyro { border-top-color: #0e7c86; }
.g-source.hr { border-top-color: #c4552a; }
.g-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #efe9dc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.g-scroll { overflow-x: auto; }
.g-cycle { display: block; width: 100%; min-width: 640px; height: auto; }
.g-cycle text { font-size: 11px; fill: #4a443a; }
.g-cycle .g-band text { font-size: 12px; font-weight: 600; }
.g-cycle .g-axis { fill: var(--muted); font-weight: 600; letter-spacing: 0.03em; }
.g-cycle .g-tick { fill: var(--muted); font-size: 12px; }
.g-band { outline: none; cursor: pointer; }
.g-band .g-hit { fill: transparent; }
.g-band.on rect:not(.g-hit) { stroke: var(--ink); stroke-width: 1.5; }
.g-band:focus-visible .g-hit { stroke: var(--now); stroke-width: 2; }
.g-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.g-phase {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--phase);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.g-phase.on { box-shadow: 0 0 0 2px var(--ink); }
.g-phase h3 { margin: 0; font-size: 15px; }
.g-phase dl { margin: 0; }
.g-phase dt {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.g-phase dd { margin: 2px 0 0; }

.g-example { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.g-canvas { position: relative; min-width: 0; min-height: 300px; }
#g-canvas { display: block; width: 100%; }
.g-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}
.g-note[hidden] { display: none; }
.g-callouts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.g-callouts li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: default; }
.g-callouts li:hover { background: #f3ecdf; }
.g-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.g-callouts li:hover .g-num { background: var(--focus); }
.g-callouts b { font-size: 14px; }
.g-callouts p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: #4a443a; }

.g-boat { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 20px; align-items: center; }
.g-axes { display: block; width: 100%; min-width: 480px; height: auto; }
.g-axes .g-lab { font-size: 13px; font-weight: 600; }
.g-axes .g-view { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.g-axes .g-small { fill: var(--muted); font-size: 11px; }
.g-boat ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.g-boat li { font-size: 14px; line-height: 1.5; }
.g-boat li i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }

@media (max-width: 980px) {
  .g-example, .g-boat { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #guide { padding-top: 16px; }
  .g-hero h1 { font-size: 22px; }
  .g-grid.outing { grid-template-columns: 1fr; }
}
