/* Moja Forma — produkcijski stilski list za čist začetek.
   Ob prenovi (oktober 2026) so odstranjeni vsi stari razdelki. Vizualni sistem (žetoni,
   osnova, vrhnja vrstica, kartice, gumbi, prijava) in nadzorna plošča po potrjenem
   mockupu design/forma-v2 (navigacija, Danes, Trendi, grafi).
   Vir vizualnega sistema: design/design-system.md */

/* ---------- Žetoni ----------
   Temni način ima svoje vrednosti, ne obrat svetlih. Vsak žeton nosi obe prek light-dark():
   brez izbire sledi sistemu, gumb v glavi (data-theme na <html>) izbiro zaklene. */
:root {
  color-scheme: light dark;
  /* modra nosi strukturo (vrednosti iz logotipa) */
  --blue-900: #01243f;
  --blue-800: #013668;
  --blue-700: #01528f;
  --blue-600: #0f5f9e;
  --blue-500: #2b7bc0;
  --blue-100: #e2edf6;
  /* oranžna nosi akcijo; besedilo na njej je vedno --blue-900, nikoli belo */
  --orange-600: #a84d12;
  --orange-500: #f26c0c;
  --orange-300: #fba968;
  --orange-100: #fceadb;
  --eyebrow: light-dark(#a84d12, #f7b98c);
  /* jeklena za nevtralne ikone in stanja */
  --steel: #4e6e8a;
  --steel-700: #35566f;
  --steel-100: #e6ecf2;
  /* podatkovne barve: preverjene za kontrast in barvno slepoto (za prihodnje grafe) */
  --data-bike: #2b7bc0;
  --data-gym: #d96a12;
  --data-other: #64809b;
  /* nevtrali */
  --cream: light-dark(#f4f7fa, #0c1a26);
  --ink: light-dark(#10202e, #e9f1f8);
  --muted: light-dark(#52677a, #9cb0c0);
  --white: light-dark(#fff, #142633);
  --line: light-dark(#d9e3ec, #274154);
  --danger: light-dark(#a63a3a, #f0a5a5);
  --danger-bg: light-dark(#f8e5e5, #3d2424);
  --accent-text: light-dark(var(--blue-600), #8cc2ea);
  --card-shadow: 0 12px 34px light-dark(rgba(12, 45, 74, .08), transparent);
  --card-line: light-dark(rgba(12, 45, 74, .1), #274154);
  /* fokus mora doseči 3:1 na vsaki podlagi; na temnem kromu je oranžen */
  --focus: light-dark(var(--blue-700), #8cc2ea);
}

:root[data-theme="light"] { color-scheme: light }

:root[data-theme="dark"] { color-scheme: dark }

/* ---------- Osnova ---------- */
* { box-sizing: border-box }

/* atribut hidden mora premagati razredna pravila za prikaz */
[hidden] { display: none !important }

html {
  background: var(--blue-800);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0, rgba(240, 124, 52, .14), transparent 30%), var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance }

p { text-wrap: pretty }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topbar :focus-visible { outline-color: var(--orange-300) }

.muted { color: var(--muted) }

.break { overflow-wrap: anywhere }

.code { font-variant-numeric: tabular-nums; letter-spacing: .04em }

.icon {
  flex: 0 0 auto;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none }

/* ---------- Vrhnja vrstica in znamka ---------- */
.topbar {
  position: sticky;
  z-index: 8;
  top: 0;
  padding-top: env(safe-area-inset-top);
  background: rgba(1, 54, 104, .97);
  backdrop-filter: blur(18px);
  color: #fff;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1180px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 7px max(16px, env(safe-area-inset-right)) 7px max(16px, env(safe-area-inset-left));
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 800;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: url(/brand-mark.png) center/cover no-repeat;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .32);
}

.logout-form { margin: 0 }

.topbar-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: background-color .16s ease;
}

.topbar-button:hover { background: rgba(255, 255, 255, .18) }

/* ---------- Postavitev ---------- */
.shell {
  display: grid;
  /* minmax(0, …): široka tabela v .table-scroll drsi v svojem okviru in ne raztegne strani. */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.shell.narrow { max-width: 720px }

.page-heading { padding: 10px 4px 0 }

.page-heading h1 {
  margin: 5px 0 4px;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 12px;
  font-weight: 850;
  color: var(--eyebrow);
}

/* ---------- Uvodni pas na prvi strani ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 22px;
  border-radius: 22px;
  background: radial-gradient(circle at 92% 8%, rgba(242, 108, 12, .32), transparent 34%), linear-gradient(150deg, var(--blue-800), var(--blue-900));
  color: #fff;
}

.hero .eyebrow { color: var(--orange-300) }

.hero h1 {
  margin: 4px 0 10px;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

/* ---------- Kartice in obvestila ---------- */
.card {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--card-line);
  border-radius: 19px;
  box-shadow: var(--card-shadow);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -.01em;
}

.notice {
  margin: 0;
  padding: 12px 15px;
  border-radius: 12px;
  background: light-dark(var(--blue-100), rgba(43, 123, 192, .22));
  color: light-dark(var(--blue-700), #a8d6f5);
  font-weight: 700;
}

.error-note {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------- Gumbi ---------- */
.primary,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 18px;
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  justify-self: start;
  background: var(--orange-500);
  color: var(--blue-900);
}

.button {
  width: 100%;
  background: var(--blue-700);
  color: #fff;
}

.button.microsoft {
  background: #292929;
  color: #fff;
}

.primary:hover,
.button:hover { filter: brightness(1.08) }

/* ---------- Prijava in sistemske strani ---------- */
.system-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 75% 15%, #015a9c, var(--blue-900) 55%);
}

/* Kartica ostane svetla tudi v temnem načinu: logotip ima belo podlago, zato so
   barve besedila tu zapisane izrecno in ne sledijo temnim žetonom. */
.system-card {
  color-scheme: light;
  width: min(430px, 100%);
  padding: 32px 24px;
  border-radius: 26px;
  background: #fff;
  color: #10202e;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
  text-align: center;
}

.system-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.system-card .muted { color: #5c7182 }

.system-card .eyebrow { color: #a84d12 }

.system-card .notice {
  background: #e2edf6;
  color: #01528f;
}

.system-card .error-note {
  margin-top: 16px;
  background: #f8e5e5;
  color: #a63a3a;
}

.brand-mark {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: url(/brand-mark.png) center/cover no-repeat;
}

.system-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

/* ---------- Passkey (prijava in nastavitve) ---------- */
/* Sporočilo skripte passkey.js; dokler je prazno, ne zavzame prostora. */
.passkey-status:empty { display: none }

.settings-grid { display: grid; gap: 16px }

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.card-head h2 { margin: 0 }

.card .notice { margin: 0 0 12px }

/* Povezava v obvestilu prevzame barvo obvestila; privzeta modra je na temni podlagi neberljiva. */
.notice a {
  display: inline-block;
  margin: -12px 0;
  padding: 12px 0;
  color: inherit;
  font-weight: 800;
}

.settings-list {
  margin: 8px 0 16px;
  padding: 0;
  list-style: none;
}

.settings-list > li {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.settings-list strong { overflow-wrap: anywhere }

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button.is-danger {
  border-color: currentColor;
  color: var(--danger);
}

.ghost-button:disabled,
.primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Preimenovanje in preklic se odpreta v istem mestu, brez skripte. */
.inline-action > summary {
  list-style: none;
}

.inline-action > summary::-webkit-details-marker { display: none }

.inline-action[open] > summary { margin-bottom: 10px }

.inline-action form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: light-dark(var(--steel-100), rgba(255, 255, 255, .05));
}

.state-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 750;
}

.state-pill.is-ok { background: light-dark(var(--blue-100), rgba(43, 123, 192, .26)); color: light-dark(var(--blue-700), #a8d6f5) }

/* Garmin v Nastavitvah (partials/garmin-connect). */
.garmin-card .card-head { align-items: center }

.garmin-form { display: grid; gap: 2px; margin-bottom: 8px }

.garmin-form .primary { justify-self: start; margin-top: 6px }

.garmin-privacy { margin: 2px 0 4px; font-size: 14px }

.garmin-facts { display: grid; gap: 8px; margin: 0 0 12px }

.garmin-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; border-radius: 12px; background: var(--track) }

.garmin-facts dt { color: var(--muted); font-weight: 650 }

.garmin-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere }

.garmin-card .button-row form { margin: 0 }

.field {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}

.field span { font-weight: 650 }

.field input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

/* ---------- Nadzorna plošča: žetoni (po mockupu design/forma-v2) ---------- */
:root {
  --num: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --tabbar-h: 64px;
  --stage-deep: light-dark(var(--blue-800), #8cc2ea);
  --stage-light: light-dark(var(--blue-500), #2b7bc0);
  --stage-rem: light-dark(var(--orange-300), #fba968);
  --stage-awake: light-dark(#c7d3de, #4e6e8a);
  --track: light-dark(var(--steel-100), rgba(255, 255, 255, .08));
  --line-stroke: light-dark(var(--blue-500), #8cc2ea);
  /* stres: v temnem načinu svetlejši korak pomeni več, kot pri conah */
  --stress-rest: light-dark(var(--blue-500), #8cc2ea);
  --stress-low: light-dark(var(--orange-300), #b5642a);
  --stress-medium: light-dark(var(--orange-500), #f26c0c);
  --stress-high: light-dark(#a84d12, #fba968);
}

.num { font-family: var(--num); font-variant-numeric: tabular-nums }

/* ---------- Navigacija: spodnja vrstica pod 900 px, zgoraj nad 900 px ---------- */
.shell.wide { width: min(1180px, 100%) }

.shell { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)) }

/* Element s fokusom se ne sme skriti pod pritrjeno glavo ali spodnjo vrstico (WCAG 2.4.11). */
html {
  scroll-padding-top: calc(72px + env(safe-area-inset-top));
  scroll-padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
}

.topnav { display: none }

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--blue-900);
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  border-radius: 12px;
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

/* Pet zavihkov pri 320 px: oznaka se raje prelomi, kot da bi segla čez sosednji zavihek. */
.tabbar a span { max-width: 100%; text-align: center; line-height: 1.15; overflow-wrap: anywhere }

@media (max-width: 359px) {
  .tabbar a { font-size: 11px }
}

.tabbar a[aria-current="page"] { color: #fff }

.tabbar a[aria-current="page"] svg { color: var(--orange-500) }

.tabbar :focus-visible { outline-color: var(--orange-300) }

/* Pod 1000 px osem povezav ne gre v vrstico poleg znaka in orodij, zato ostanejo zavihki. */
@media (min-width: 1000px) {
  /* The name is hidden on purpose below 1200 px and must never be cut by an ellipsis. */
  .brand { flex: none }

  .topnav { display: flex; gap: 4px; margin-left: auto }

  .topnav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 11px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .86);
    font-weight: 650;
    text-decoration: none;
  }

  .topnav a:hover { background: rgba(255, 255, 255, .1) }

  .topnav a[aria-current="page"] {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--orange-500);
  }

  .tabbar { display: none }

  html { scroll-padding-bottom: 16px }

  .shell { padding-bottom: 48px }
}

/* ---------- Skupni deli plošče ---------- */
.screen-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; padding: 6px 4px 0 }

.screen-heading h1 { margin: 0; font-size: clamp(28px, 6vw, 40px); line-height: 1.05; letter-spacing: -.03em }

/* Cilj dotika 44 px brez premika naslova kartice: navpični odmik izniči negativni rob. */
.card-link { display: inline-block; margin: -12px 0; padding: 12px 0; color: var(--accent-text); font-weight: 650; font-size: 15px }

.empty { margin: 8px 0 0; color: var(--muted) }

.data-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: light-dark(var(--orange-100), rgba(242, 108, 12, .16));
  color: light-dark(var(--blue-900), #fde3cf);
}

.data-banner.is-info { background: light-dark(var(--blue-100), rgba(43, 123, 192, .22)); color: light-dark(var(--blue-800), #a8d6f5) }

.data-banner p { margin: 0; font-weight: 650 }

.data-banner a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 800 }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--track);
}

.segmented a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.segmented a[aria-current="true"] { background: light-dark(var(--blue-800), #8cc2ea); color: light-dark(#fff, var(--blue-900)) }

.type-mark { display: inline-block; flex: none; width: 12px; height: 12px }

.type-mark.is-bike { background: var(--data-bike); border-radius: 50% }

.type-mark.is-gym { background: var(--data-gym); border-radius: 3px }

.type-mark.is-other { border: 2.5px solid var(--data-other); border-radius: 50% }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px }

.legend li { display: inline-flex; align-items: center; gap: 8px }

.swatch { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px }

/* ---------- Danes: uvodni pas in merilniki ---------- */
.today-hero { display: grid; gap: 18px; padding: 22px 12px 14px }

.today-hero > div:first-child { padding: 0 4px }

.today-hero h1 { margin-bottom: 4px }

.sync-state { margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px }

/* Vsi trije merilniki so vedno v eni vrsti; velikost pisave sledi širini merilnika (cqi),
   da gre »PRIPRAVLJENOST« v vrsto tudi pri 320 px. Prej je bil na telefonu vodoraven trak,
   kjer je bil tretji merilnik namenoma odrezan, kar je bilo videti kot napaka. */
.gauges {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gauge {
  container-type: inline-size;
  display: grid;
  justify-items: center;
  gap: 2px;
  height: 100%;
  margin: 0;
  padding: 10px 4px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
}

.gauge-dial { position: relative; width: min(150px, 100%) }

.gauge svg { display: block; width: 100%; height: auto }

.gauge-seg {
  fill: none;
  stroke: rgba(255, 255, 255, .16);
  stroke-width: 10;
}

/* Segmenti se ob nalaganju prižgejo zaporedno, brez skripte; pri zmanjšanem gibanju takoj. */
.gauge-seg.is-on {
  stroke: var(--orange-500);
  animation: gauge-on .2s ease both;
  animation-delay: calc(var(--i) * 45ms);
}

@keyframes gauge-on {
  from { stroke: rgba(255, 255, 255, .16) }
}

.gauge-value { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 4%; color: #fff; font-size: clamp(24px, 30cqi, 40px); line-height: 1 }

.gauge figcaption { display: grid; justify-items: center; max-width: 100%; text-align: center }

.gauge-label { max-width: 100%; color: rgba(255, 255, 255, .78); font-size: clamp(8px, 9.8cqi, 11px); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap }

.gauge-level { min-height: 1.3em; color: var(--orange-300); font-size: clamp(12px, 13cqi, 15px); font-weight: 750 }

/* ---------- Danes: kartice ---------- */
.today-grid { display: grid; gap: 16px }

.big-stat { margin: 0; font-size: 40px; line-height: 1 }

.stages { display: flex; gap: 2px; height: 14px; margin: 14px 0 10px; border-radius: 7px; overflow: hidden }

.stage.is-deep { background: var(--stage-deep) }

.stage.is-light { background: var(--stage-light) }

.stage.is-rem { background: var(--stage-rem) }

.stage.is-awake { background: var(--stage-awake) }

.stage-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; padding: 0; list-style: none; font-size: 14px }

.stage-legend li { display: flex; align-items: center; gap: 8px }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 }

.stat-row > div { padding: 10px 12px; border-radius: 12px; background: var(--track) }

.stat-row dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase }

.stat-row dd { margin: 2px 0 0; font-size: 24px }

.stat-row .stat-note { color: var(--muted); font-size: 13px; font-family: inherit }

.spark-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px }

.spark-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em }

.type-bar { display: flex; gap: 2px; height: 12px; margin: 6px 0 10px; border-radius: 6px; overflow: hidden; background: var(--track) }

.type-bar > .is-bike { background: var(--data-bike) }

.type-bar > .is-gym { background: var(--data-gym) }

.type-bar > .is-other { background: var(--data-other) }

.progress-label { display: flex; justify-content: space-between; margin: 14px 0 6px; font-size: 14px }

.progress { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden }

.progress span { display: block; height: 100%; background: var(--orange-500) }

.progress.is-over span { background: var(--orange-600) }

.activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--white);
  color: inherit;
  text-decoration: none;
}

.activity-row.is-plain { min-height: 44px; padding: 0; border: 0; background: none }

a.activity-row:hover .activity-name { text-decoration: underline }

.activity-row .type-mark { grid-row: 1 / span 2 }

.activity-name { overflow-wrap: anywhere; font-weight: 700 }

.activity-meta { grid-column: 2; color: var(--muted); font-size: 14px }

.activity-figure { grid-column: 3; grid-row: 1 / span 2; display: grid; text-align: right; font-size: 19px }

.activity-figure small { color: var(--muted); font-size: 14px }

/* ---------- Danes: prehrana, telo, zdravje ---------- */
.kcal-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 10px }

.kcal-out { margin: 8px 0 0; font-size: 14px }

.delta { color: var(--muted); font-size: 15px }

.macro-list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none }

.macro-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px }

.macro-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden }

.macro-bar > span { display: block; height: 100%; background: light-dark(var(--blue-500), #8cc2ea) }

.macro-bar.is-over > span { background: var(--orange-500) }

.meal-list { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line) }

.meal-list > li { border-bottom: 1px solid var(--line) }

.meal-list summary,
.meal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; font-weight: 650 }

.meal-list summary { cursor: pointer }

/* Garmin še ne pošilja seznama živil; opomba je informacija, ne napaka. */
.food-note { margin: 8px 0 0; font-size: 14px }

.food-list { margin: 0 0 10px; padding: 0; list-style: none; font-size: 14px }

.food-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 }

.food-list li > span:first-child { overflow-wrap: anywhere }

.food-list small { display: block; color: var(--muted) }

.health-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 12px }

.health-list > div { padding: 10px 12px; border-radius: 12px; background: var(--track) }

.health-list dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase }

.health-list dd { margin: 2px 0 0; font-size: 19px }

.health-list dd.muted { font-size: 15px }

.stress-bar { display: flex; gap: 2px; height: 12px; margin: 6px 0 10px; border-radius: 6px; overflow: hidden }

.stress-bar > .is-rest, .stress-rest { background: var(--stress-rest) }

.stress-bar > .is-low, .stress-low { background: var(--stress-low) }

.stress-bar > .is-medium, .stress-medium { background: var(--stress-medium) }

.stress-bar > .is-high, .stress-high { background: var(--stress-high) }

/* ---------- Grafi ---------- */
.line-chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 160px auto; gap: 4px 8px; margin-top: 12px }

.line-chart.is-spark { grid-template-columns: 1fr; grid-template-rows: 44px; margin-top: 4px }

.chart-y { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 12px; text-align: right }

.chart-plot {
  width: 100%;
  height: 100%;
  overflow: visible;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%);
  border-bottom: 1px solid var(--line);
}

.is-spark .chart-plot { background: none; border: 0 }

/* Oblaček ob dotiku ali miški (public/charts.js). Vodoravni poteg prsta premika črto, navpični pomika stran. */
.chart-area { position: relative; min-width: 0 }

.line-chart[data-points] .chart-area { touch-action: pan-y; cursor: crosshair }

.chart-cursor, .chart-dot, .chart-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s ease }

.chart-area.is-active > :is(.chart-cursor, .chart-dot, .chart-tip) { opacity: 1 }

.chart-cursor { top: 0; bottom: 0; border-left: 1px dashed var(--muted) }

.chart-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--line-stroke); box-shadow: 0 0 0 3px var(--white) }

.chart-tip { top: -8px; padding: 4px 9px; border-radius: 8px; background: var(--ink); color: var(--white); font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%) }

/* Pika na meritvi (views/partials/line-chart.ejs): v HTML, ker bi se krog v raztegnjenem SVG spremenil v elipso. */
.chart-mark { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--line-stroke); pointer-events: none }

.chart-note { margin: 6px 0 0; font-size: 13px }

/* Telesna sestava (opts.trend): meritve so bleda tanka črta, povprečje polna. Razlika je v debelini in
   prosojnosti, legenda pa obe črti poimenuje, zato barva ni edini nosilec pomena. */
.has-trend .chart-plot .chart-raw { stroke-width: 1.25; opacity: .45 }

.has-trend .chart-plot .chart-trend { stroke-width: 2.75 }

.has-trend .chart-mark { opacity: .55 }

.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px }

.chart-legend li { display: flex; align-items: center; gap: 6px }

.chart-legend li::before { content: ''; width: 18px; border-top: 3px solid var(--line-stroke) }

.chart-legend .is-raw::before { border-top-width: 1px; opacity: .6 }

/* ---------- Meritve obsegov (views/measurements.ejs) ---------- */
.measure-status { margin: -4px 0 16px }

.measure-form { display: grid; gap: 12px; margin-bottom: 16px }

.measure-form h2 { margin: 0 }

.measure-date input { width: min(100%, 220px) }

.measure-hint { margin: -6px 0 0; font-size: 14px }

.measure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0 14px; align-items: start }

.measure-grid .field input { width: 100% }

/* Številka mesta: ista v obrazcu, grafu, seznamu in na sliki. */
.measure-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: 2px solid var(--orange-500);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.measure-section-title { margin: 24px 0 12px }

.measure-charts { margin-bottom: 16px }

.measure-chart h3 { margin: 0; font-size: 17px }

/* Okvir za skrito oznako »Dejanja« (.visually-hidden je absoluten), da ostane v drsnem okviru tabele. */
.measure-table { position: relative }

.measure-table th[scope="row"] { white-space: nowrap }

.measure-actions { display: flex; gap: 8px; white-space: nowrap }

.measure-actions form { margin: 0 }

.measure-guide { margin-top: 16px }

.measure-guide summary { cursor: pointer; list-style-position: inside }

.measure-guide summary h2 { display: inline; margin: 0; font-size: 19px }

.measure-rules { display: grid; gap: 6px; margin: 14px 0; padding-left: 20px }

.measure-guide-body { display: grid; gap: 16px }

.measure-figure { width: min(100%, 220px); height: auto; justify-self: center }

.measure-figure .fig-body > * { fill: color-mix(in srgb, var(--line-stroke) 18%, transparent); stroke: var(--line-stroke); stroke-width: 1.5 }

.measure-figure .fig-tape { fill: none; stroke: var(--orange-500); stroke-width: 2.5; stroke-dasharray: 5 3 }

.measure-figure .fig-leader { stroke: var(--orange-500); stroke-width: 1.5 }

.measure-badge circle { fill: var(--white); stroke: var(--orange-500); stroke-width: 2 }

.measure-badge text { fill: var(--ink); font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: central }

.measure-sites { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none }

.measure-sites li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px }

@media (min-width: 720px) {
  .measure-guide-body { grid-template-columns: 220px 1fr; align-items: start }
}

.chart-plot polyline {
  fill: none;
  stroke: var(--line-stroke);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-x { grid-column: 2; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px }

.chart-table { margin-top: 8px; font-size: 14px }

.chart-table summary { display: flex; align-items: center; min-height: 44px; color: var(--accent-text); font-weight: 650; cursor: pointer }

.table-scroll { overflow-x: auto }

.table-scroll table { width: 100%; border-collapse: collapse }

.table-scroll th,
.table-scroll td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left }

.table-scroll td.num { text-align: right }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 160px; margin-top: 12px; border-bottom: 1px solid var(--line) }

.bar { display: flex; flex-direction: column-reverse; gap: 2px; height: 100% }

.bar-part.is-bike { background: var(--data-bike) }

.bar-part.is-gym { background: var(--data-gym) }

.bar-part.is-other { background: var(--data-other) }

.bar-part:last-child { border-radius: 4px 4px 0 0 }

.chart-x.is-full { grid-column: auto; margin-top: 4px }

@media (min-width: 720px) {
  .today-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; padding: 26px 24px }


  .today-grid { grid-template-columns: 1fr 1fr }
}

/* ---------- Glava: jezik, tema, odjava ---------- */
.topbar-tools { display: flex; align-items: center; gap: 6px; flex: none }

.prefs { display: flex; gap: 6px }

.pref-form { margin: 0 }

.pref-button { justify-content: center; min-width: 44px; padding: 0 10px }

.pref-code { font-size: 13px; letter-spacing: .04em }

/* Gumb za temo pokaže pot stran od trenutno vidne teme, tudi kadar ta sledi sistemu. */
.theme-to-light { display: none }

:root[data-theme="dark"] .theme-to-light { display: inline-flex }

:root[data-theme="dark"] .theme-to-dark { display: none }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-to-light { display: inline-flex }

  :root:not([data-theme="light"]) .theme-to-dark { display: none }
}

/* ---------- Aktivnosti, podrobnosti, rekordi, Več (faza 5, po mockupu design/forma-v2) ---------- */
.day-group h2 { margin: 18px 4px 8px; color: var(--muted); font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase }

.activity-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px }

.back-link { margin: 0 4px }

.screen-heading .eyebrow { display: flex; align-items: center; gap: 8px }

.stat-row.is-detail { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) }

.zones { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none }

.zone { display: grid; grid-template-columns: 34px 1fr 76px; gap: 10px; align-items: center; font-size: 14px }

.zone-bar { height: 12px; border-radius: 6px; background: var(--track); overflow: hidden }

.zone-bar > span { display: block; height: 100% }

.zone-time { text-align: right }

.sets td:not(:first-child),
.sets th:not(:first-child) { text-align: right }

.record-list { margin: 0; padding: 0; list-style: none }

.record-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line) }

.record-list li:first-child { border-top: 0 }

.record-label { font-weight: 700 }

.record-value { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 24px }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none }

.badge { display: grid; gap: 4px; justify-items: start; padding: 14px; border-radius: 16px; background: light-dark(var(--orange-100), rgba(242, 108, 12, .16)); color: var(--ink) }

.badge-emblem { width: 34px; height: 34px }

.badge-emblem path { fill: none; stroke: var(--orange-500); stroke-width: 5 }

.badge-name { font-weight: 750; line-height: 1.25 }

.badge-date { font-size: 13px; color: var(--muted) }

.more-list { margin: 0; padding-block: 8px; list-style: none }

.more-list li { padding: 4px 0; border-top: 1px solid var(--line) }

.more-list li:first-child { border-top: 0 }

.more-list a { display: flex; justify-content: space-between; align-items: center; min-height: 48px; color: var(--ink); font-weight: 700; text-decoration: none }

.more-list form { padding: 8px 0 }

/* ---------- Prijava (po mockupu design/prijava-v2, različica A) ----------
   Gibanje po vstopni strani app.paytrip.si: mreža pik, sij pod kazalcem in val ob kliku
   (public/login.js), naslov po besedah in 12-sekundna zgodba z gumbom za ustavitev. */
.login-page { --accent-word: light-dark(#c75a0a, var(--orange-500)) }

.login {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.login-dots, .login-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; background-size: 28px 28px }

.login-dots { background-image: radial-gradient(var(--line) 1.4px, transparent 1.6px) }

.login-glow {
  background-image: radial-gradient(var(--orange-500) 1.8px, transparent 2px);
  opacity: 0;
  transition: opacity .3s ease;
  -webkit-mask-image: radial-gradient(12.5rem circle at var(--mx, -999px) var(--my, -999px), #000, transparent);
  mask-image: radial-gradient(12.5rem circle at var(--mx, -999px) var(--my, -999px), #000, transparent);
}

.login.is-pointer .login-glow { opacity: 1 }

/* Na domačem zaslonu iPhona je ura bela na prosojni vrstici; na svetli prijavi ji modri trak
   zagotovi kontrast. Brez zareze ali v brskalniku je visok 0. */
.login::before {
  content: "";
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: env(safe-area-inset-top);
  background: var(--blue-800);
}

.login-ripple {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid var(--orange-500);
  border-radius: 50%;
  pointer-events: none;
  animation: login-ripple .8s cubic-bezier(.3, 0, .8, .15) forwards;
}

@keyframes login-ripple {
  from { opacity: .9; transform: scale(.4) }
  to { opacity: 0; transform: scale(7) }
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

.login-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 19px; font-weight: 800; white-space: nowrap }

/* Gumba za jezik in temo sta tu na svetli podlagi, ne v temni glavi. */
.login-head .topbar-button { border: 1px solid var(--line); background: var(--white); color: var(--ink) }

.login-head .topbar-button:hover { background: var(--track) }

.login-main {
  display: grid;
  gap: 32px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.login-copy { display: flex; flex-direction: column; gap: 18px; max-width: 32rem }

/* Majhen napis rabi 4,5:1; oranžna --accent-word je le za velik naslov (3:1). */
.login-eyebrow { margin: 0; color: var(--eyebrow); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase }

.login-copy h1 { margin: 0; color: var(--ink); font-size: clamp(38px, 10vw, 64px); line-height: 1.02; letter-spacing: -.04em }

.word { display: inline-block }

.word.is-accent { color: var(--accent-word) }

.login-lead { margin: 0; color: var(--muted); font-size: 18px }

.login-actions { margin-top: 6px }

.login-actions .passkey-status { margin-top: 12px }

.signin-button {
  width: 100%;
  min-height: 58px;
  gap: 12px;
  border-radius: 16px;
  font-size: 19px;
  box-shadow: 0 10px 26px rgba(242, 108, 12, .32);
  transition: transform .15s ease, box-shadow .15s ease;
}

.signin-button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(242, 108, 12, .38) }

.signin-button:active { transform: translateY(1px); box-shadow: 0 6px 16px rgba(242, 108, 12, .3) }

.signin-hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; text-align: center }

.login-alt { margin: 0; color: var(--muted); font-size: 14px; text-align: center }

.login-alt a { display: inline-block; padding: 12px 2px; color: var(--accent-text); font-weight: 750 }

/* Vstop: besede naslova vzidejo ena za drugo (80 ms), nato uvod in gumbi. */
.login .word, .login .rise { opacity: 0; animation: login-rise .8s cubic-bezier(.2, .7, .2, 1) forwards }

.login .word { transform: translateY(24px); animation-delay: calc(.1s + var(--i) * 80ms) }

.login .rise { transform: translateY(16px); animation-delay: calc(.1s + var(--i) * 75ms) }

@keyframes login-rise {
  to { opacity: 1; transform: none }
}

/* Zgodba enega jutra (vzorčni podatki), 12 s, ponavlja se. */
.story {
  position: relative;
  container-type: inline-size;
  justify-self: center;
  width: 100%;
  max-width: 35rem;
  aspect-ratio: 560 / 500;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--card-shadow);
  font-size: 13px;
}

.story-art { position: absolute; inset: 0 }

.story-map { position: absolute; inset: 0; width: 100%; height: 100% }

.story-area { fill: url(#story-fill) }

.story-track { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round }

.story-route { fill: none; stroke: var(--orange-500); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0 }

.story-pin { transform-box: fill-box; transform-origin: center }

.story-pin circle { fill: var(--blue-500) }

.story-pin.is-end circle { fill: var(--orange-500) }

.story-pin .pin-hole { fill: var(--white) }

.story-rider { fill: var(--orange-500); stroke: var(--white); stroke-width: 3 }

.story-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: light-dark(#fff, #1b3142);
  box-shadow: 0 10px 24px light-dark(rgba(12, 45, 74, .14), rgba(0, 0, 0, .35));
  color: var(--ink);
  white-space: nowrap;
}

.chip-1 { top: 52%; left: 3% }

.chip-2 { top: 33%; left: 24% }

.chip-3 { top: 5%; right: 3% }

.chip-mark { flex: none; width: 30px; height: 30px; border-radius: 50% }

.chip-mark.is-sleep { background: radial-gradient(circle at 35% 35%, #8cc2ea, var(--blue-700)) }

.chip-mark.is-heart { background: radial-gradient(circle at 35% 35%, #fba968, #d96a12) }

.chip-mark.is-ride { background: var(--data-bike); box-shadow: inset 0 0 0 7px light-dark(#fff, #1b3142) }

.chip-what { display: grid }

.chip-title { font-weight: 750 }

.chip-by { color: var(--muted); font-size: 12px }

.chip-value { margin-left: 4px; font-size: 16px }

.story-today {
  position: absolute;
  right: 4%;
  bottom: 13%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border-radius: 18px;
  background: var(--blue-900);
  color: #fff;
  box-shadow: 0 16px 34px rgba(1, 36, 63, .35);
}

.today-ring { width: 58px; height: 58px; flex: none }

.today-ring .ring-seg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 14 }

.today-ring .ring-seg.is-on { stroke: var(--orange-500) }

.story-today p { margin: 0 }

.today-head { display: flex; gap: 8px; align-items: baseline; font-weight: 800 }

.today-hint { color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 600 }

.today-value { color: var(--orange-300); font-size: 15px; font-weight: 750 }

.today-value .num { color: #fff; font-size: 26px }

.today-rows { display: flex; gap: 12px; color: rgba(255, 255, 255, .75); font-size: 12px }

.today-rows b { color: #fff; font-weight: 600 }

.story-pause {
  position: absolute;
  left: 3%;
  bottom: 3%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Časovnica: pika prevozi profil med 6 % in 56 %; točke, kartice in »Danes« se prižigajo za njo. */
.story-route { animation: story-route 12s linear infinite }

.story-pin { animation: 12s ease-out infinite }

.pin-1 { animation-name: pin-1 }

.pin-2 { animation-name: pin-2 }

.pin-3 { animation-name: pin-3 }

.story-chip, .story-today { animation: 12s cubic-bezier(.2, .7, .2, 1) infinite }

.chip-1 { animation-name: chip-1 }

.chip-2 { animation-name: chip-2 }

.chip-3 { animation-name: chip-3 }

.story-today { animation-name: story-today }

@keyframes story-route {
  0%, 6% { stroke-dashoffset: 100 }
  56%, 94% { stroke-dashoffset: 0 }
  100% { stroke-dashoffset: 100 }
}

@keyframes pin-1 { 0%, 5% { transform: scale(0) } 9%, 92% { transform: scale(1) } 100% { transform: scale(0) } }

@keyframes pin-2 { 0%, 22% { transform: scale(0) } 26%, 92% { transform: scale(1) } 100% { transform: scale(0) } }

@keyframes pin-3 { 0%, 55% { transform: scale(0) } 59%, 92% { transform: scale(1) } 100% { transform: scale(0) } }

@keyframes chip-1 { 0%, 9% { opacity: 0; transform: translateY(12px) scale(.96) } 13%, 90% { opacity: 1; transform: none } 96%, 100% { opacity: 0; transform: translateY(-8px) } }

@keyframes chip-2 { 0%, 26% { opacity: 0; transform: translateY(12px) scale(.96) } 30%, 90% { opacity: 1; transform: none } 96%, 100% { opacity: 0; transform: translateY(-8px) } }

@keyframes chip-3 { 0%, 58% { opacity: 0; transform: translateY(12px) scale(.96) } 62%, 90% { opacity: 1; transform: none } 96%, 100% { opacity: 0; transform: translateY(-8px) } }

@keyframes story-today { 0%, 66% { opacity: 0; transform: translateY(16px) } 71%, 90% { opacity: 1; transform: none } 96%, 100% { opacity: 0; transform: translateY(-8px) } }

.story.is-paused :is(.story-route, .story-pin, .story-chip, .story-today) { animation-play-state: paused }

/* Ozka zgodba (telefon): manjše kartice, »Danes« v kotu, gumb za ustavitev zgoraj. */
@container (max-width: 430px) {
  .story-chip { gap: 8px; padding: 6px 10px; font-size: 12px }

  .chip-mark { width: 24px; height: 24px }

  .chip-value { font-size: 14px }

  .story-today { right: 3%; bottom: 3%; gap: 10px; padding: 10px 12px 10px 10px }

  .today-ring { width: 46px; height: 46px }

  .today-rows { display: none }

  .story-pause { top: 3%; bottom: auto }

  .chip-3 { top: 16% }
}

/* Najožji telefoni: zgodba je višja, kartice si sledijo po višini brez prekrivanja. */
@container (max-width: 340px) {
  .story-chip { padding: 5px 9px }

  .chip-value { font-size: 13px }

  .chip-3 { top: 19%; right: 3% }

  .chip-2 { top: 37%; left: 14% }

  .chip-1 { top: 55%; left: 3% }
}

@media (max-width: 380px) {
  .story { aspect-ratio: 560 / 720 }
}

@media (min-width: 960px) {
  .login-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; padding-top: 56px }

  .signin-button { width: auto; min-width: 300px; padding-inline: 32px }

  .signin-hint, .login-alt { text-align: left }
}

/* Zmanjšano gibanje: vse v končnem stanju, sij, val in pika po profilu izginejo. */
@media (prefers-reduced-motion: reduce) {
  .login .word, .login .rise, .story-route, .story-pin, .story-chip, .story-today { animation: none !important; opacity: 1; transform: none }

  .login-glow, .login-ripple, .story-pause, .story-rider { display: none }
}

/* ---------- Prisilne barve (Windows visok kontrast) ----------
   Obroči in grafi so SVG poteze; sistem jim sicer da barvo ozadja ali jih skrije. Barvni trakovi
   nosijo podatek ob besedilu, zato ohranijo svoje barve in dobijo rob. */
@media (forced-colors: active) {
  .gauge-seg, .ring-seg, .story-track { stroke: GrayText }

  .gauge-seg.is-on, .ring-seg.is-on { stroke: Highlight }

  .chart-plot polyline, .story-route { stroke: CanvasText }
  .chart-mark { forced-color-adjust: none; background: CanvasText }

  .story-pin circle, .story-rider { fill: Highlight }

  .progress, .macro-bar, .type-bar, .stages, .stress-bar, .zone-bar, .bar, .swatch, .type-mark, .chip-mark { forced-color-adjust: none }

  .progress, .macro-bar, .type-bar, .stages, .stress-bar, .zone-bar { border: 1px solid CanvasText }

  .gauge, .story-chip, .story-today, .data-banner, .state-pill, .stat-row > div, .health-list > div, .garmin-facts > div { border: 1px solid CanvasText }
  .measure-figure .fig-body > *, .measure-figure .fig-tape, .measure-figure .fig-leader, .measure-badge circle { forced-color-adjust: none; stroke: CanvasText }
  .measure-figure .fig-body > * { fill: Canvas }
  .measure-badge circle { fill: Canvas }
  .measure-badge text { fill: CanvasText }
  .measure-num { border-color: CanvasText }
}

/* ---------- Odzivnost ---------- */
/* Napis »Odjava« se skrije samo vizualno, da gumb ohrani dostopno ime. Z devetimi povezavami v glavi
   (Meritve) je prostora zanj dovolj šele od 1320 px. */
@media (max-width: 1319px) {
  .topbar-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .logout-form .topbar-button {
    justify-content: center;
    width: 44px;
    padding: 0;
  }
}

/* Na najožjih zaslonih jezik pokaže samo ikono; ime jezika ostane bralniku. */
@media (max-width: 360px) {
  .pref-code { display: none }

  .topbar-tools, .prefs { gap: 4px }

  /* Ob treh ikonah ime znamke ne gre v vrstico; ostane znak, ime ostane bralniku. */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* Vseh devet povezav gre v vrhnjo vrstico: pod 1200 px ostane znak, ime ostane bralniku. */
@media (min-width: 1000px) and (max-width: 1199px) {
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .topnav a { padding: 0 7px }
}

/* Štirje filtri vrste vadbe ostanejo v eni vrstici tudi pri 320 px. */
@media (max-width: 420px) {
  .segmented a { min-width: 0; padding: 0 12px }
}

@media (min-width: 720px) {
  .shell { padding-top: 32px }

  .hero { padding: 34px 32px }

  .card { padding: 24px 26px }

  /* Cards in a row share top and bottom edges; a card left alone in its row takes the full width. */
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }

  .settings-grid > :last-child:nth-child(odd) { grid-column: 1 / -1 }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Navodila (views/guides.ejs, views/guide.ejs): kazalo po skupinah in branje daljšega besedila. */
.guide-lead { margin: 0 0 20px; color: var(--muted); max-width: 60ch }
.guide-search { margin: 0 0 12px }
.guide-search label { display: block; margin-bottom: 6px; font-weight: 700 }
.guide-search input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); font: inherit }
.guide-search p { margin: 6px 0 0 }
.guide-search p:empty { margin: 0 }
.guide-group { margin-bottom: 16px }
.guide-group h2 { margin: 0 0 4px; font-size: 1.05rem }
.guide-list { padding-inline: 0 }
.guide-group[hidden], .guide-list li[hidden] { display: none }
.guide-back { margin: 0 0 12px }
.guide-back a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent-text); font-weight: 700; text-decoration: none }
.guide h1 { margin: 4px 0 16px; font-size: clamp(1.45rem, 5vw, 1.9rem); line-height: 1.2; overflow-wrap: anywhere }
.guide-body { max-width: 68ch; line-height: 1.6 }
.guide-body h2 { margin: 28px 0 8px; font-size: 1.15rem }
.guide-body h3 { margin: 22px 0 6px; font-size: 1rem }
.guide-body p, .guide-body ul, .guide-body ol { margin: 0 0 12px }
.guide-body ul, .guide-body ol { padding-left: 1.4em }
.guide-body li { margin-bottom: 6px }
.guide-body code { padding: 1px 6px; border-radius: 6px; background: var(--track); font-family: inherit; font-weight: 650; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone }
.guide-body a, .guide-source a { color: var(--accent-text); font-weight: 650 }
.guide-note { margin: 0 0 14px; padding: 12px 14px; border-left: 4px solid var(--orange-500); border-radius: 8px; background: light-dark(var(--orange-100), rgba(242, 108, 12, .12)) }
.guide-note p { margin: 0 }
.guide-source { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--line) }

@media (forced-colors: active) {
  .guide-note { border-left-color: CanvasText }
  .guide-body code { border: 1px solid CanvasText }
}

.viewer-strip {
  margin: 0;
  padding: 6px 16px;
  text-align: center;
  font-weight: 650;
  color: var(--ink);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.invite-link { overflow-wrap: anywhere; }
.note-threads { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.note-threads a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; max-width: 100%; overflow-wrap: anywhere; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.note-threads a[aria-current] { font-weight: 650; border-color: currentColor; text-decoration: underline; }
.note-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.note.is-mine { background: var(--cream); }
.note-meta { margin: 0 0 4px; color: var(--muted); font-size: .875rem; }
.note-body { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form { display: grid; gap: 12px; margin-top: 16px; }
.field textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }

/* ---------- Kalkulatorji ---------- */
.calc-list-title { display: block }
.calc-list-lead { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 400 }
.calc-list a { gap: 12px; padding-block: 8px }

.calc-form { display: grid; gap: 12px }
.calc-form[hidden],
.calc-form [hidden],
.calc-result[hidden] { display: none }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0 14px; align-items: start }
.calc-field .field { margin-bottom: 4px }
.calc-form .field input,
.calc-form .field select { width: 100% }
.calc-form .field select {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.calc-error { margin: 0 0 10px; color: var(--danger); font-size: 14px; font-weight: 650 }

.calc-choice { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0 }
.calc-choice legend { margin-bottom: 6px; padding: 0; font-weight: 650 }
.calc-choice label { flex: 1 1 100px; position: relative }
.calc-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer }
.calc-choice span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-weight: 650;
}
.calc-choice input:checked + span { border-color: var(--blue-600); background: light-dark(var(--blue-100), rgba(43, 123, 192, .22)); box-shadow: inset 0 0 0 1px var(--blue-600) }
.calc-choice input:focus-visible + span { outline: 3px solid var(--orange-500); outline-offset: 2px }
.calc-choice-stack label { flex-basis: 150px }

.calc-hint { margin: 0; color: var(--muted); font-size: 14px }
.calc-result { min-width: 0; margin-top: 16px; scroll-margin-top: 12px }
.calc-result h2:focus { outline: none }
.calc-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 12px }
.calc-value { margin: 0; font-size: clamp(30px, 8vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.calc-unit { color: var(--muted); font-size: 16px; font-weight: 650; letter-spacing: 0 }
.calc-category { margin: 0; padding: 4px 12px; border-radius: 999px; background: light-dark(var(--blue-100), rgba(43, 123, 192, .22)); color: light-dark(var(--blue-700), #a8d6f5); font-weight: 700 }
.calc-caption { margin: -8px 0 12px; color: var(--muted) }
.calc-list-values { display: grid; margin: 0 }
.calc-list-values div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line) }
.calc-list-values dt { color: var(--muted) }
.calc-list-values dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums }
.calc-table { margin: 12px 0 }
.calc-table caption { padding-bottom: 6px; text-align: left; font-weight: 700 }
.calc-table th,
.calc-table td { padding-inline: 5px }
.calc-table th[scope="row"] { font-weight: 500 }
.calc-table td { font-variant-numeric: tabular-nums; font-weight: 650 }
.calc-result .notice { margin: 12px 0; font-weight: 600 }
.calc-note { margin: 12px 4px 0; color: var(--muted); font-size: 14px; max-width: 60ch }

/* ---------- Today: next training (design/trening-vabila) ---------- */
.training-card .notice { margin: 0 0 14px }
.training { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start }
.date-tile { display: grid; justify-items: center; min-width: 66px; padding: 9px 6px 10px; border-radius: 15px; background: var(--blue-800); color: #fff; line-height: 1.1 }
.date-tile small { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase }
.date-tile b { font-family: var(--num); font-size: 31px; font-weight: 700; line-height: 1.12 }
.date-tile.is-today { background: var(--orange-500); color: var(--blue-900) }
.date-tile.is-off { background: light-dark(#e6ecf2, #274154); color: var(--muted) }
.training-main p { margin: 0 }
.training-main .training-title { margin-bottom: 3px; font-size: 21px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere }
.is-cancelled .training-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px }
.training-time { font-size: 18px; font-weight: 650 }
.training-main .training-note { margin-top: 2px; color: var(--muted); font-size: 15px }
.training-main .training-place { margin-top: 2px; color: var(--muted); overflow-wrap: anywhere }
.training-main .training-chip { display: inline-block; margin-bottom: 7px; padding: 2px 10px; border-radius: 999px; background: var(--orange-100); color: var(--blue-900); font-size: 13px; font-weight: 750 }
.training-main .training-chip.is-danger { background: var(--danger-bg); color: var(--danger) }
.training-later { display: grid; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none }
.training-later li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--line) }
.training-later-name { font-weight: 650; overflow-wrap: anywhere }
.training-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 14px; color: var(--muted); font-size: 14px }
.training-foot .ghost-button { font-size: 15px; text-decoration: none }
.training-steps { display: grid; gap: 8px; margin: 0 0 12px; padding-left: 22px }
.training-code { display: inline-block; font-size: 24px; letter-spacing: .08em; overflow-wrap: anywhere }
.training-connect .button-row form { margin: 0 }
/* 320 px with 150 % text: the date tile leaves too little room beside it. */
@media (max-width: 240px) {
  .training { grid-template-columns: minmax(0, 1fr) }
  .date-tile { justify-self: start }
}
