/* === Viktors Marathon Plan === */
:root {
  /* Brand */
  --cph-orange: #FF4D00;
  --cph-orange-dark: #D63E00;
  --cph-dark: #1A1A1A;
  --cph-line: #E5E5E5;
  --cph-mid: #757575;
  --cph-soft: #F5F5F5;
  --cph-white: #FFFFFF;

  /* Pace palette — gradvist mere aggressiv fra lette til hårde tider */
  --c-easy:        #3CABDB; /* sky blue   – Opvarmning / Nedkøling (1) */
  --c-long:        #53D86A; /* green      – Let (4) */
  --c-mrp:         #FF4D00; /* app orange – Marathon pace (5) */
  --c-tempo:       #FFD43B; /* yellow     – Tempo (6) */
  --c-longint:     #EC4899; /* pink/mag.  – Lange intervaller (9) */
  --c-mid:         #7C3AED; /* purple     – Mellem intervaller (8) */
  --c-short:       #991B1B; /* dark red   – Korte intervaller (7) */
  --c-check:       #2EBD52; /* positive green for checkbox */

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cph-soft);
  color: var(--cph-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  font-feature-settings: 'tnum' 1;
}

/* === Header === */
.hero {
  background: var(--cph-orange);
  color: var(--cph-dark);
  padding: 28px 20px 0;
  position: relative;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--cph-dark);
  color: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background 0.12s ease, transform 0.08s ease;
}
.profile-btn:hover { background: #000; color: rgba(255,255,255,0.75); }
.profile-btn:active { transform: scale(0.94); }

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chevron-mark {
  width: 60px;
  height: 42px;
  fill: var(--cph-dark);
  flex: none;
}

.logo-text {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--cph-dark);
}
.logo-text #logo-name { color: var(--cph-dark); }

.logo-text span:nth-child(3) {
  font-weight: 600;
  opacity: 0.8;
}

.tabs-container {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cph-orange);
  padding: 0 20px;
}

.tabs {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.18);
}

.tab {
  flex: 1;
  padding: 14px 4px;
  font-weight: 700;
  font-size: 13px;
  color: var(--cph-dark);
  opacity: 0.55;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: opacity 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab svg { flex: none; }

@media (max-width: 380px) {
  .tab { font-size: 12px; gap: 4px; }
  .tab svg { width: 13px; height: 13px; }
}

.tab.active {
  opacity: 1;
  border-bottom-color: var(--cph-dark);
}

/* === Main / views === */
main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.view { display: none; }
.view.active { display: block; }

/* === Goal bar === */
.goal-bar {
  background: var(--cph-dark);
  color: var(--cph-white);
  border-radius: var(--radius);
  padding: 26px 18px 22px;
  margin-bottom: 18px;
  text-align: center;
  position: relative;
}

.lock-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}

.lock-btn:hover { background: rgba(255,255,255,0.14); color: var(--cph-white); }
.lock-btn:active { transform: scale(0.94); }
.lock-btn .icon-locked { display: none; }
.lock-btn .icon-unlocked { display: block; }
.goal-bar.locked .lock-btn {
  background: rgba(255,77,0,0.18);
  color: var(--cph-orange);
}
.goal-bar.locked .lock-btn .icon-locked { display: block; }
.goal-bar.locked .lock-btn .icon-unlocked { display: none; }

.goal-bar.locked .hms-step {
  opacity: 0;
  pointer-events: none;
}
.goal-bar.locked .hms-cell input {
  pointer-events: none;
  caret-color: transparent;
}
.goal-bar.locked .hms-cell {
  transition: gap 0.18s ease;
}

.goal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
}

.hms-input {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.hms-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 88px;
  flex: 0 0 auto;
}

.hms-step {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  border: 0;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease;
  padding: 0;
}

.hms-step:hover {
  background: rgba(255,77,0,0.18);
  color: var(--cph-orange);
}

.hms-step:active {
  background: var(--cph-orange);
  color: var(--cph-dark);
}

.hms-cell input {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--cph-orange);
  font-size: 64px;
  font-weight: 800;
  text-align: center;
  outline: none;
  letter-spacing: -0.04em;
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
  font-feature-settings: 'tnum' 1;
  line-height: 1;
}

.hms-cell input::-webkit-outer-spin-button,
.hms-cell input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hms-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.hms-colon {
  font-size: 44px;
  font-weight: 800;
  color: rgba(255,255,255,0.22);
  align-self: center;
  margin-top: -22px;
  line-height: 1;
}

@media (max-width: 420px) {
  .hms-cell { width: 72px; }
  .hms-cell input { font-size: 52px; }
  .hms-colon { font-size: 36px; margin-top: -20px; }
}

@media (max-width: 360px) {
  .hms-cell { width: 62px; }
  .hms-cell input { font-size: 44px; }
}

/* Reset progress button */
.weeks-footer {
  text-align: center;
  margin-top: 28px;
}

.reset-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--cph-mid);
  padding: 12px 22px;
  background: transparent;
  border: 1px solid var(--cph-line);
  border-radius: 999px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.reset-btn:hover {
  color: var(--cph-orange);
  border-color: var(--cph-orange);
  background: var(--cph-white);
}

/* === Categories table (Mål & Tider) === */
.cat-section {
  background: var(--cph-white);
  border-radius: var(--radius);
  border: 1px solid var(--cph-line);
  overflow: hidden;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cph-mid);
  padding: 14px 18px 10px;
}

.cat-table {
  display: flex;
  flex-direction: column;
}

.cat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  align-items: center;
  border-top: 1px solid var(--cph-line);
}

.cat-row.cat-mrp {
  background: var(--cph-orange);
  border-top-color: var(--cph-orange);
}

.cat-row.cat-mrp + .cat-row { border-top-color: var(--cph-orange); }

.cat-row.cat-mrp .cat-label,
.cat-row.cat-mrp .cat-pace {
  color: var(--cph-dark);
}

.cat-row.cat-mrp .cat-dot {
  background: var(--cph-dark) !important;
  width: 10px;
  height: 10px;
}

.cat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.cat-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--cph-dark);
}

.cat-pace {
  font-size: 14px;
  font-weight: 700;
  color: var(--cph-mid);
  font-feature-settings: 'tnum' 1;
}

/* === Legend === */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 11px;
}

.legend-item {
  background: var(--cph-white);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cph-line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cph-dark);
  font-weight: 600;
  font-size: 12px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.legend-label {
  font-weight: 600;
  color: var(--cph-dark);
}

.legend-pace {
  font-weight: 700;
  color: var(--cph-mid);
  font-feature-settings: 'tnum' 1;
  border-left: 1px solid var(--cph-line);
  padding-left: 8px;
}

/* === Week cards === */
.weeks { display: flex; flex-direction: column; gap: 10px; }

.week-card {
  background: var(--cph-white);
  border-radius: var(--radius);
  border: 1px solid var(--cph-line);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.week-card.current {
  border-color: var(--c-check);
  box-shadow: 0 0 0 4px rgba(46, 189, 82, 0.10);
}

.current-strip {
  background: var(--c-check);
  color: var(--cph-white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 18px;
  text-align: center;
}

.week-card.completed {
  opacity: 0.7;
}

.week-card.completed .week-num,
.week-card.completed .week-km {
  color: var(--cph-mid);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 4px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cph-mid);
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cph-line);
}

.week-head {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  width: 100%;
  text-align: left;
  background: var(--cph-white);
  transition: background 0.1s ease;
}

.week-head:hover { background: var(--cph-soft); }

.week-num {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--cph-dark);
}

.week-num small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--cph-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: -2px;
}

.week-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.week-km-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-km {
  font-size: 16px;
  font-weight: 800;
  color: var(--cph-dark);
  letter-spacing: -0.01em;
}

/* Difficulty badge — lightning bolt + 3-segment ring */
.diff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--diff-c, var(--cph-orange));
  flex: none;
}

.diff-badge svg { flex: none; }

.diff-badge.level-1 { --diff-c: #16A34A; } /* grøn — let */
.diff-badge.level-2 { --diff-c: #EAB308; } /* gul  — moderat */
.diff-badge.level-3 { --diff-c: #DC2626; } /* rød  — hård */

/* Active arc segments (1, 2 or 3 of three) */
.diff-badge.level-1 .diff-ring-active { stroke-dasharray: 21.6 53.8; }
.diff-badge.level-2 .diff-ring-active { stroke-dasharray: 21.6 3.5 21.6 28.7; }
.diff-badge.level-3 .diff-ring-active { stroke-dasharray: 21.6 3.5; }

/* Calorie badge — top-right of session card */
.cal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cph-orange) 12%, transparent);
  color: var(--cph-orange);
  font-size: 12px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1;
  flex: none;
  align-self: flex-start;
  white-space: nowrap;
}

.cal-badge svg { flex: none; }

.week-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.type-dot {
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--cph-line);
  background: var(--cph-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  min-width: 22px;
  max-width: 22px;
  gap: 0;
  overflow: hidden;
  transition: max-width 0.22s ease, padding 0.18s ease, gap 0.18s ease, background 0.15s ease;
}

.type-dot-fill {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c, var(--cph-line));
  flex: none;
}

.type-dot-fill.split {
  background: linear-gradient(90deg, var(--c1) 0 50%, var(--c2) 50% 100%);
}

.type-dot:focus-visible { box-shadow: 0 0 0 3px rgba(255,77,0,0.25); }

.type-dot-tip {
  font-size: 11px;
  font-weight: 700;
  color: var(--cph-dark);
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.22s ease, opacity 0.15s ease;
}

.type-dot.active .type-dot-tip {
  max-width: 200px;
}

.type-dot.active {
  max-width: 240px;
  padding: 0 11px 0 5px;
  gap: 6px;
  background: var(--cph-soft);
}

.type-dot.active .type-dot-tip { opacity: 1; }

.type-dot.type-1 { --c: var(--c-easy); }
.type-dot.type-4 { --c: var(--c-long); }
.type-dot.type-5 { --c: var(--c-mrp); }
.type-dot.type-6 { --c: var(--c-tempo); }
.type-dot.type-7 { --c: var(--c-short); }
.type-dot.type-8 { --c: var(--c-mid); }
.type-dot.type-9 { --c: var(--c-longint); }

.week-progress {
  font-size: 12px;
  font-weight: 700;
  color: var(--cph-mid);
  white-space: nowrap;
}

.week-progress.complete { color: var(--c-check); }

.chev {
  width: 22px;
  height: 22px;
  color: var(--cph-mid);
  transition: color 0.15s ease;
}

.chev .chev-v {
  transform-origin: 12px 12px;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1);
}

.week-card.open .chev .chev-v {
  transform: rotate(90deg);
}

.week-card.current .chev { color: var(--c-check); }

.week-body {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  padding: 0 18px;
  background: var(--cph-soft);
  transition:
    max-height 0.32s cubic-bezier(.2,.7,.2,1),
    padding 0.32s cubic-bezier(.2,.7,.2,1),
    border-top-color 0.2s ease;
}

.week-card.open .week-body {
  max-height: 1600px;
  padding: 8px 18px 16px;
  border-top-color: var(--cph-line);
}

/* === Sessions === */
.session {
  background: var(--cph-white);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid var(--cph-line);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.session.checked { border-color: var(--c-check); }

.session-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
}

.session-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--cph-line);
  background: var(--cph-white);
  flex: none;
  display: grid;
  place-items: center;
  transition: all 0.12s ease;
}

.session-check.checked {
  background: var(--c-check);
  border-color: var(--c-check);
}

.session-check.checked::after {
  content: "";
  width: 5px;
  height: 9px;
  animation: checkPop 0.22s cubic-bezier(.2,.7,.2,1);
  border-right: 2px solid var(--cph-white);
  border-bottom: 2px solid var(--cph-white);
  transform: rotate(45deg) translate(-1px, -1px);
}

.session-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-title b { font-size: 14px; font-weight: 700; }
.session-title span { font-size: 12px; color: var(--cph-mid); }

.session.checked .session-title b { color: var(--c-check); }

.session-body {
  padding: 0 14px 12px 52px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session.checked .session-body { opacity: 0.5; }

/* === Blocks === */
.block {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 12px;
  align-items: stretch;
}

.block-bar {
  border-radius: 4px;
  background: var(--c, var(--cph-line));
}

.block-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  padding: 4px 0;
}

.block-volume {
  color: var(--cph-dark);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.block-meta {
  color: var(--cph-mid);
  font-size: 12px;
  font-weight: 500;
  font-feature-settings: 'tnum' 1;
}

.type-1, .type-2, .type-3 { --c: var(--c-easy); }
.type-4 { --c: var(--c-long); }
.type-5 { --c: var(--c-mrp); }
.type-6 { --c: var(--c-tempo); }
.type-7 { --c: var(--c-short); }
.type-8 { --c: var(--c-mid); }
.type-9 { --c: var(--c-longint); }

/* === Open calc card === */
.open-calc-btn {
  margin-top: 18px;
  width: 100%;
  background: var(--cph-white);
  color: var(--cph-dark);
  border: 1px solid var(--cph-line);
  border-radius: var(--radius);
  padding: 18px 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.open-calc-btn:hover {
  border-color: var(--cph-orange);
  background: #FFF9F5;
}

.open-calc-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cph-soft);
  color: var(--cph-orange);
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.12s ease;
}

.open-calc-btn:hover .open-calc-icon { background: var(--cph-orange); color: var(--cph-dark); }

.open-calc-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.open-calc-content b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.open-calc-content > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--cph-mid);
  line-height: 1.35;
}

.open-calc-chev {
  color: var(--cph-mid);
  flex: none;
}

.back-btn {
  background: transparent;
  border: 0;
  color: var(--cph-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 4px;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.back-btn:hover { color: var(--cph-orange); }

/* === Tempoberegner === */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.distance-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1.5px solid var(--cph-dark);
  border-radius: 999px;
  overflow: hidden;
  background: var(--cph-white);
}

.distance-pills button {
  padding: 12px 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--cph-dark);
  border-right: 1.5px solid var(--cph-dark);
  transition: background 0.12s ease, color 0.12s ease;
}

.distance-pills button:last-child { border-right: none; }

.distance-pills button.active {
  background: var(--cph-dark);
  color: var(--cph-white);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  border: 1.5px solid var(--cph-dark);
  border-radius: var(--radius);
  background: var(--cph-white);
  overflow: hidden;
}

.calc-cell {
  padding: 18px 18px 22px;
  text-align: left;
  border: 0;
  background: var(--cph-white);
  position: relative;
  transition: background 0.12s ease;
  border-bottom: 1.5px solid var(--cph-dark);
  border-right: 1.5px solid var(--cph-dark);
  outline: none;
}

.calc-cell.calc-time {
  grid-column: 1 / 3;
  border-right: none;
}

.calc-cell.calc-dist { border-right: 1.5px solid var(--cph-dark); border-bottom: none; }
.calc-cell.calc-pace { border-right: none; border-bottom: none; }

.calc-cell.active { background: var(--cph-white); }
.calc-cell.active .cell-value { color: var(--cph-orange); }

.cell-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--cph-dark);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cell-label .unit { font-size: 12px; font-weight: 500; color: var(--cph-mid); }

.cell-value {
  margin-top: 6px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--cph-mid);
  line-height: 1.05;
}

.calc-cell.calc-time .cell-value { font-size: 56px; }
.cell-value.accent { color: var(--cph-orange); }

#slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--cph-orange) 0%, var(--cph-orange) 50%, #DDD 50%, #DDD 100%);
  border-radius: 999px;
  outline: none;
}

#slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cph-orange);
  border: 3px solid var(--cph-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

#slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cph-orange);
  cursor: pointer;
  border: 3px solid var(--cph-white);
}

.step-row { display: flex; justify-content: center; gap: 0; }

.step {
  width: 60px;
  height: 44px;
  border: 1.5px solid var(--cph-dark);
  font-size: 22px;
  font-weight: 600;
  background: var(--cph-white);
  color: var(--cph-dark);
}

.step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

.primary-btn {
  background: transparent;
  color: var(--cph-orange);
  border: 1px solid var(--cph-orange);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 26px;
  border-radius: 999px;
  width: auto;
  margin: 16px auto 0;
  display: block;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.primary-btn:hover {
  background: var(--cph-orange);
  color: var(--cph-dark);
}

/* === Stats / Overblik === */
.stats-panel {
  background: var(--cph-dark);
  color: var(--cph-white);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.65);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cph-orange);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-of {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
}

.progress {
  height: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 14px;
}

.progress-fill {
  height: 100%;
  background: var(--cph-orange);
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}

.stat-row.inline {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.stat-row.inline strong { color: var(--cph-white); font-weight: 800; }

/* Chart */
.chart-panel {
  background: var(--cph-white);
  border-radius: var(--radius);
  border: 1px solid var(--cph-line);
  padding: 18px 14px 14px;
  margin-bottom: 18px;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cph-dark);
  margin: 0 6px 14px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  align-items: end;
  gap: 4px;
  height: 200px;
  padding: 0 4px;
  margin-top: 32px;
}

.chart-col {
  height: 100%;
  position: relative;
  cursor: default;
}

.chart-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.chart-seg {
  width: 100%;
  position: relative;
  min-height: 4px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.chart-seg.pending { background-color: #D1D5DB; }
.chart-seg.done    { background-color: var(--cph-orange); }

.chart-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--cph-mid);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
}

.chart-col {
  cursor: pointer;
  transition: transform 0.1s ease;
}


.chart-col-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--cph-dark);
  color: var(--cph-white);
  font-size: 12px;
  font-weight: 800;
  font-feature-settings: 'tnum' 1;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
}

.chart-col-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--cph-dark);
}

.chart-col.active .chart-col-bubble { opacity: 1; }

.chart-col.active .chart-seg { filter: brightness(1.05); }

.chart-axis {
  margin-top: 8px;
  border-top: 1px solid var(--cph-line);
  padding-top: 8px;
}

.chart-axis-row {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 4px;
  padding: 0 4px;
  font-size: 10px;
  color: var(--cph-mid);
  text-align: center;
  font-weight: 600;
}

/* === Adjust modal === */
#adjust-modal .modal-box { max-width: 460px; }

.modal-body.adjust-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.city-body { padding: 18px 22px 22px !important; }
.adjust-section { display: flex; flex-direction: column; gap: 12px; }
.adjust-section > label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cph-mid);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.warmup-section { gap: 16px; }

.warmup-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px 0 4px;
}
.warmup-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  max-width: 140px;
}
.warmup-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cph-dark);
  line-height: 1;
  font-feature-settings: 'tnum' 1;
}
.warmup-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cph-mid);
}
.warmup-divider {
  width: 1px;
  height: 56px;
  background: var(--cph-line);
  align-self: center;
}

.seg-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
}
.seg-control button {
  padding: 10px 8px;
  background: transparent;
  color: var(--cph-dark);
  font-weight: 700;
  font-size: 13px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg-control button.active {
  background: var(--cph-orange);
  color: var(--cph-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#warmup-ratio {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--cph-orange) 0%, var(--cph-orange) 50%, #DDD 50%, #DDD 100%);
}
#warmup-ratio::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cph-orange);
  border: 3px solid var(--cph-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}
#warmup-ratio::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cph-orange);
  border: 3px solid var(--cph-white);
  cursor: pointer;
}
.ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--cph-mid);
  font-weight: 600;
}

.adjust-body .apply-btn {
  margin-top: 12px;
  padding: 16px 22px;
  font-size: 15px;
  font-weight: 800;
  background: var(--cph-dark);
  color: var(--cph-white);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.08s ease;
}
.adjust-body .apply-btn:hover { background: #000; }
.adjust-body .apply-btn:active { transform: scale(0.985); }
.adjust-body .reset-btn {
  width: auto;
  align-self: center;
  margin: 0;
}

.reset-btn.danger {
  color: #DC2626;
  border-color: rgba(220, 38, 38, 0.3);
}
.reset-btn.danger:hover {
  background: #DC2626;
  color: var(--cph-white);
  border-color: #DC2626;
}

.settings-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

/* === Race day session — inverted black/white, no orange === */
.session.race-day {
  border: 0;
  background: var(--cph-dark);
  color: var(--cph-white);
  position: relative;
}
.session.race-day .session-title b { color: var(--cph-white); font-size: 18px; }
.session.race-day .session-title span { color: rgba(255,255,255,0.7); }
.session.race-day .cal-badge {
  background: rgba(255,255,255,0.1);
  color: var(--cph-white);
}
.session.race-day .session-check {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}
.session.race-day .session-check.checked {
  background: var(--cph-white);
  border-color: var(--cph-white);
}
.session.race-day .session-check.checked::after {
  border-right-color: var(--cph-dark);
  border-bottom-color: var(--cph-dark);
}
.session.race-day .block-volume { color: var(--cph-white); }
.session.race-day .block-meta { color: rgba(255,255,255,0.65); }
.session.race-day .block-bar { background: rgba(255,255,255,0.4) !important; }
.session.race-day .session-body { background: transparent; }
.race-day-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

/* === Training detail (graph + step list) === */
.session-details-toggle {
  margin: 8px 0 0;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--cph-mid);
  cursor: pointer;
  align-self: flex-start;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.session-details-toggle:hover { color: var(--cph-orange); }

.session.race-day .session-details-toggle {
  color: rgba(255,255,255,0.65);
}
.session.race-day .session-details-toggle:hover {
  color: var(--cph-white);
}

.session-details {
  display: none;
  padding: 14px 14px 14px 14px;
  border-top: 1px solid var(--cph-line);
  background: var(--cph-soft);
}
.session-details.open { display: block; }

.seg-graph {
  display: flex;
  align-items: stretch;
  height: 26px;
  border-radius: 8px;
  overflow: hidden;
  gap: 2px;
  padding: 4px;
  background: var(--cph-white);
  border: 1px solid var(--cph-line);
  margin-bottom: 14px;
}
.seg-graph-bar {
  background: var(--seg-c, var(--cph-line));
  height: 100%;
  min-width: 2px;
  border-radius: 3px;
  transition: opacity 0.12s ease;
}
.seg-graph-bar:hover { opacity: 0.85; }

.seg-list {
  display: flex;
  flex-direction: column;
  background: var(--cph-white);
  border-radius: 8px;
  border: 1px solid var(--cph-line);
  overflow: hidden;
}
.seg-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  border-top: 1px solid var(--cph-line);
}
.seg-row:first-child { border-top: 0; }
.seg-row::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--seg-c, var(--cph-line));
  border-radius: 2px;
}
.seg-row .seg-label {
  font-weight: 700;
  color: var(--cph-dark);
}
.seg-row .seg-time {
  font-weight: 700;
  font-feature-settings: 'tnum' 1;
  color: var(--cph-dark);
}
.seg-row.seg-pause .seg-label { color: var(--cph-mid); font-weight: 500; }
.seg-row.seg-pause .seg-time { color: var(--cph-mid); font-weight: 500; }

.session.race-day .session-details {
  background: rgba(255,255,255,0.04);
  border-top-color: rgba(255,255,255,0.1);
}
.session.race-day .seg-graph {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.session.race-day .seg-list {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.session.race-day .seg-row {
  border-top-color: rgba(255,255,255,0.08);
}
.session.race-day .seg-row .seg-label,
.session.race-day .seg-row .seg-time { color: var(--cph-white); }
.session.race-day .seg-row.seg-pause .seg-label,
.session.race-day .seg-row.seg-pause .seg-time { color: rgba(255,255,255,0.55); }

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fadein 0.15s ease;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal.hidden { display: none; }

.modal-box {
  background: var(--cph-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--cph-line);
}

.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--cph-mid);
}

.modal-close:hover { background: var(--cph-soft); }

.modal-body { padding: 8px 0 16px; overflow-y: auto; }

.split-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  padding: 10px 20px;
  font-size: 14px;
  font-feature-settings: 'tnum' 1;
  border-bottom: 1px solid var(--cph-soft);
}

.split-row.head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cph-mid);
  background: var(--cph-soft);
  border: 0;
}

.split-row b { font-weight: 700; }

/* === Weather card on Hjem === */
.weather-card {
  width: 100%;
  background: var(--cph-white);
  border: 1px solid var(--cph-line);
  border-radius: var(--radius);
  padding: 14px 18px 16px;
  margin-bottom: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.weather-card:hover { border-color: var(--cph-orange); }
.weather-card:active { transform: scale(0.997); }

.weather-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.weather-city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cph-dark);
}
.weather-city svg { color: var(--cph-orange); }
.weather-edit {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cph-mid);
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.weather-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--cph-dark);
  font-feature-settings: 'tnum' 1;
}
.weather-stat-icon { font-size: 18px; }

.city-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#city-search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cph-line);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.12s ease;
}
#city-search:focus { border-color: var(--cph-orange); }
.city-results { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.city-result {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s ease;
  text-align: left;
  background: var(--cph-white);
  border: 1px solid var(--cph-line);
}
.city-result:hover { background: var(--cph-soft); border-color: var(--cph-orange); }
.city-result b { font-weight: 800; }
.city-result span { color: var(--cph-mid); margin-left: 6px; font-size: 12px; }

/* === Hjem (dashboard) === */
.home-greeting {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 4px 4px 22px;
  color: var(--cph-dark);
}
.home-greeting strong {
  color: var(--cph-orange);
  font-weight: 800;
}

.home-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.home-pace-card {
  background: var(--cph-dark);
  color: var(--cph-white);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 0;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.home-pace-card:active { transform: scale(0.99); }
.home-pace-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.home-pace-value {
  font-size: 38px;
  font-weight: 800;
  color: var(--cph-orange);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 6px 0 12px;
  font-feature-settings: 'tnum' 1;
}
.home-pace-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.home-pace-time strong { color: var(--cph-white); font-weight: 700; }

.home-progress {
  background: var(--cph-white);
  border: 1px solid var(--cph-line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.home-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.home-progress-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cph-mid);
}
.home-progress-pct {
  font-size: 24px;
  font-weight: 800;
  color: var(--cph-orange);
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1;
}
.home-progress .progress {
  margin: 8px 0 10px;
  background: rgba(0,0,0,0.06);
  height: 8px;
}
.home-progress-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--cph-mid);
  font-weight: 500;
  font-feature-settings: 'tnum' 1;
}
.home-progress-meta strong {
  color: var(--cph-dark);
  font-weight: 800;
}

@media (max-width: 380px) {
  .home-row { grid-template-columns: 1fr; }
  .home-pace-value { font-size: 48px; }
}

.home-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cph-mid);
  margin: 4px 4px 8px;
}

.next-card,
.next-session {
  background: var(--cph-white);
  border: 1px solid var(--cph-line);
  border-radius: var(--radius);
  position: relative;
}

.next-session { margin-top: 0; }

.next-card.done {
  text-align: center;
  padding: 26px 20px;
  font-size: 15px;
  font-weight: 700;
}

.next-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.next-meta {
  font-size: 11px;
  font-weight: 800;
  color: var(--cph-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.next-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 2px 0 6px;
  color: var(--cph-dark);
}
.next-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--cph-mid);
  font-feature-settings: 'tnum' 1;
}

.next-card .week-dots {
  margin-top: 14px;
  gap: 8px;
  display: flex;
  align-items: center;
}

/* Circle navigation button (used on next-card and pace card) */
.circle-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cph-orange);
  color: var(--cph-dark);
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
  z-index: 2;
}
.circle-btn:hover { background: var(--cph-orange-dark); }
.circle-btn:active { transform: scale(0.92); }

.home-pace-card .circle-btn {
  background: rgba(255,255,255,0.1);
  color: var(--cph-orange);
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
}
.home-pace-card:hover .circle-btn { background: var(--cph-orange); color: var(--cph-dark); }

/* === Profil-side === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--cph-dark);
  color: var(--cph-white);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--cph-orange);
  display: grid;
  place-items: center;
  flex: none;
}

.profile-greeting { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.profile-greeting strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 20px;
}

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row.form-row-2 > div { display: flex; flex-direction: column; gap: 6px; }

.form-row label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cph-mid);
}

.form-row input {
  padding: 12px 14px;
  border: 1px solid var(--cph-line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  background: var(--cph-white);
  color: var(--cph-dark);
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.form-row input:focus {
  border-color: var(--cph-orange);
  background: #FFF9F5;
}

.form-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-check);
  min-height: 1em;
}
.form-status.error { color: var(--c-short, #DC2626); }

#logout-btn { margin-top: 18px; }

/* === Auth overlay (login + onboarding) === */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--cph-orange);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.auth-screen.hidden { display: none; }

.auth-card {
  background: var(--cph-dark);
  color: var(--cph-white);
  border-radius: 18px;
  padding: 30px 26px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  animation: cardRise 0.32s cubic-bezier(.2,.7,.2,1);
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 22px;
}
.auth-logo svg { fill: var(--cph-orange); }
.auth-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.6);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }

.auth-form h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-form p {
  margin: 0 0 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.45;
}
.auth-form .form-row label { color: rgba(255,255,255,0.5); }
.auth-form .form-row input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--cph-white);
}
.auth-form .form-row input:focus {
  background: rgba(255,77,0,0.1);
  border-color: var(--cph-orange);
}

.auth-submit {
  margin-top: 10px;
  padding: 14px 22px;
  background: var(--cph-orange);
  color: var(--cph-dark);
  font-size: 15px;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}
.auth-submit:hover { background: var(--cph-orange-dark); }
.auth-submit:active { transform: scale(0.985); }

.auth-form .form-status {
  color: rgba(255,255,255,0.6);
}
.auth-form .form-status.error { color: #FF8C66; }

/* === Animations & micro-interactions === */

/* Standard easing — calm, snappy, no bounce */
:root { --ease: cubic-bezier(.2,.7,.2,1); }

/* View activation — fade & slide up gently */
.view.active {
  animation: viewIn 0.24s var(--ease);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Goal-bar (large interactive card) entrance on Tider tab */
#view-goals.active .goal-bar {
  animation: lift 0.3s var(--ease) backwards;
  animation-delay: 30ms;
}
#view-goals.active .cat-section {
  animation: lift 0.3s var(--ease) backwards;
  animation-delay: 80ms;
}
#view-goals.active .open-calc-btn {
  animation: lift 0.3s var(--ease) backwards;
  animation-delay: 130ms;
}
@keyframes lift {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pacegrupper rows — staggered fade-in */
.cat-row { animation: rowIn 0.26s var(--ease) backwards; }
.cat-row:nth-child(1) { animation-delay: 110ms; }
.cat-row:nth-child(2) { animation-delay: 135ms; }
.cat-row:nth-child(3) { animation-delay: 160ms; }
.cat-row:nth-child(4) { animation-delay: 185ms; }
.cat-row:nth-child(5) { animation-delay: 210ms; }
.cat-row:nth-child(6) { animation-delay: 235ms; }
.cat-row:nth-child(7) { animation-delay: 260ms; }
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Week cards — quick staggered entrance */
.week-card { animation: cardIn 0.26s var(--ease) backwards; }
.week-card:nth-child(1)  { animation-delay: 0ms; }
.week-card:nth-child(2)  { animation-delay: 16ms; }
.week-card:nth-child(3)  { animation-delay: 32ms; }
.week-card:nth-child(4)  { animation-delay: 48ms; }
.week-card:nth-child(5)  { animation-delay: 64ms; }
.week-card:nth-child(6)  { animation-delay: 80ms; }
.week-card:nth-child(7)  { animation-delay: 96ms; }
.week-card:nth-child(8)  { animation-delay: 112ms; }
.week-card:nth-child(9)  { animation-delay: 128ms; }
.week-card:nth-child(n+10) { animation-delay: 144ms; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Status panel + chart entrance */
#view-stats.active .stats-panel {
  animation: lift 0.3s var(--ease) backwards;
  animation-delay: 30ms;
}
#view-stats.active .chart-panel {
  animation: lift 0.32s var(--ease) backwards;
  animation-delay: 80ms;
}
#view-stats.active .legend {
  animation: lift 0.3s var(--ease) backwards;
  animation-delay: 130ms;
}

/* Chart bars rise from baseline */
.chart-stack { animation: stackIn 0.4s var(--ease) backwards; }
.chart-col:nth-child(1)  .chart-stack { animation-delay: 100ms; }
.chart-col:nth-child(2)  .chart-stack { animation-delay: 115ms; }
.chart-col:nth-child(3)  .chart-stack { animation-delay: 130ms; }
.chart-col:nth-child(4)  .chart-stack { animation-delay: 145ms; }
.chart-col:nth-child(5)  .chart-stack { animation-delay: 160ms; }
.chart-col:nth-child(6)  .chart-stack { animation-delay: 175ms; }
.chart-col:nth-child(7)  .chart-stack { animation-delay: 190ms; }
.chart-col:nth-child(8)  .chart-stack { animation-delay: 205ms; }
.chart-col:nth-child(9)  .chart-stack { animation-delay: 220ms; }
.chart-col:nth-child(10) .chart-stack { animation-delay: 235ms; }
.chart-col:nth-child(11) .chart-stack { animation-delay: 250ms; }
.chart-col:nth-child(12) .chart-stack { animation-delay: 265ms; }
.chart-col:nth-child(13) .chart-stack { animation-delay: 280ms; }
.chart-col:nth-child(14) .chart-stack { animation-delay: 295ms; }
.chart-col:nth-child(15) .chart-stack { animation-delay: 310ms; }
.chart-col:nth-child(16) .chart-stack { animation-delay: 325ms; }
.chart-col:nth-child(17) .chart-stack { animation-delay: 340ms; }
.chart-col:nth-child(18) .chart-stack { animation-delay: 355ms; }
.chart-col:nth-child(19) .chart-stack { animation-delay: 370ms; }
.chart-col:nth-child(20) .chart-stack { animation-delay: 385ms; }
@keyframes stackIn {
  from { opacity: 0; transform: scaleY(0.6); }
  to   { opacity: 1; transform: scaleY(1); }
}
.chart-stack { transform-origin: bottom center; }

/* Smooth color transitions on key state changes */
.session,
.session-check,
.cat-row,
.week-progress,
.session-title b,
.cell-value {
  transition-property: color, background-color, border-color, opacity;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

/* Check pop — small, calm */
@keyframes checkPop {
  from { opacity: 0; transform: rotate(45deg) translate(-1px, -1px) scale(0.6); }
  to   { opacity: 1; transform: rotate(45deg) translate(-1px, -1px) scale(1); }
}

/* Modal — backdrop fade + box rise */
.modal { animation: fadein 0.18s ease; }
.modal-box { animation: modalIn 0.22s var(--ease); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Button press feedback */
.tab,
.distance-pills button,
.calc-cell,
.session-check,
.step,
.hms-step,
.primary-btn,
.reset-btn,
.back-btn,
.open-calc-btn,
.modal-close,
.week-head,
.type-dot,
.chart-col {
  transition: transform 0.08s ease, background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.tab:active,
.distance-pills button:active,
.calc-cell:active,
.session-check:active,
.step:active,
.hms-step:active,
.primary-btn:active,
.reset-btn:active,
.back-btn:active,
.modal-close:active,
.type-dot:active,
.chart-col:active {
  transform: scale(0.96);
}

/* The card-style buttons feel best with a smaller scale */
.open-calc-btn:active { transform: scale(0.985); }
.week-head:active { transform: scale(0.997); }

/* Hint nudges in cells */
.calc-cell { transition: background 0.15s ease; }
.calc-cell.active .cell-value { transition: color 0.18s ease; }

/* Slider thumb feedback */
#slider::-webkit-slider-thumb { transition: transform 0.1s ease, box-shadow 0.12s ease; }
#slider::-moz-range-thumb     { transition: transform 0.1s ease, box-shadow 0.12s ease; }
#slider:active::-webkit-slider-thumb { transform: scale(1.12); }
#slider:active::-moz-range-thumb     { transform: scale(1.12); }

/* Splits modal rows — tiny stagger */
.modal-body .split-row { animation: rowIn 0.18s var(--ease) backwards; }
.modal-body .split-row:nth-child(2)  { animation-delay: 12ms; }
.modal-body .split-row:nth-child(3)  { animation-delay: 24ms; }
.modal-body .split-row:nth-child(4)  { animation-delay: 36ms; }
.modal-body .split-row:nth-child(5)  { animation-delay: 48ms; }
.modal-body .split-row:nth-child(n+6) { animation-delay: 60ms; }

/* Dot tooltip — already animates, ensure GPU smoothing */
.type-dot, .type-dot-fill, .type-dot-tip { will-change: max-width, opacity; }

/* Reduced motion — honor user preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Responsive === */
@media (min-width: 600px) {
  .hero { padding-top: 36px; }
  .logo-text { font-size: 26px; }
  .chevron-mark { width: 72px; height: 50px; }
  .calc-cell.calc-time .cell-value { font-size: 72px; }
  .cell-value { font-size: 52px; }
  .chart { height: 240px; }
}

@media (max-width: 380px) {
  .hms-cell { min-width: 48px; }
  .hms-cell input { font-size: 24px; }
}
