/* ----------  tokens  ---------- */
:root {
  --bg:        #0e0f12;
  --surface:   #1a1c20;
  --surface-2: #23262c;
  --line:      #2c2f36;
  --text:      #f0f0f0;
  --text-2:    #a0a4ac;
  --text-3:    #6e7280;
  --accent:    #FFA22B;
  --accent-soft: rgba(255, 162, 43, 0.14);
  --rose:      #E55B6A;
  --lime:      #6EDB4D;
  --sky:       #4CC2FF;
  --danger:    #ff6b6b;
  --radius:    14px;
  --radius-sm: 8px;
  --pad:       16px;
  --shadow:    0 6px 20px rgba(0,0,0,0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea {
  font: inherit; color: inherit; background: none; border: none; outline: none;
}
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------  layout  ---------- */
.app {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  /* peripheral identity anchor — coloured strip in active profile's colour */
  border-top: 3px solid var(--profile-strip, var(--accent));
}
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 12px) var(--pad) 12px;
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}
.app-header .logo {
  font-weight: 800; font-size: 18px; letter-spacing: 1px;
}
.app-header .logo span { color: var(--accent); }
.app-header .spacer { flex: 1; }

.app-main {
  flex: 1;
  padding: 8px var(--pad) calc(var(--safe-bottom) + 88px);
  overflow-y: auto;
}

.bottom-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 720px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  z-index: 10;
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 4px 12px;
  color: var(--text-3);
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button .nav-icon {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}

/* ----------  profile chip  ---------- */
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line);
}
.profile-chip .dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: var(--bg);
}
.profile-chip .name { font-weight: 600; font-size: 13px; }
/* (FONT/V-SCALE label removed from profile chip — was visual noise on the
   identity badge. Grade scale lives in Me → settings now.) */

/* ----------  shared  ---------- */
.screen-title { font-size: 22px; font-weight: 700; margin: 12px 0 4px; }
.screen-sub   { color: var(--text-2); font-size: 14px; margin: 0 0 16px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: var(--pad);
  margin-bottom: 12px;
}
.card.padless { padding: 0; overflow: hidden; }
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--bg);
  font-weight: 700; padding: 12px 16px; border-radius: var(--radius-sm);
  min-height: 44px; width: 100%;
}
.button.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: white; }
.button.small { padding: 8px 12px; min-height: 36px; font-size: 13px; width: auto; }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 8px; }
.row > .button { flex: 1; }

.input, .select, .textarea {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px;
}
.textarea { min-height: 80px; resize: vertical; line-height: 1.4; }
.field { margin-bottom: 12px; }
.field label { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 6px; letter-spacing: 0.3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-2); font-size: 14px;
}
.empty .icon { font-size: 28px; margin-bottom: 8px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.profile { color: var(--bg); }
.tag.status-send     { background: rgba(110,219,77,0.18); color: var(--lime); }
.tag.status-flash    { background: rgba(255,162,43,0.18); color: var(--accent); }
.tag.status-project  { background: rgba(160,164,172,0.15); color: var(--text-2); }
.tag.status-progress { background: rgba(76,194,255,0.18); color: var(--sky); }
.tag.status-fall     { background: rgba(229,91,106,0.18); color: var(--rose); }

/* ----------  routes  ---------- */
.route-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 12px;
  padding: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px;
}
.route-row .thumb {
  width: 72px; height: 72px; border-radius: 10px;
  background: var(--surface-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 20px;
}
.route-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.route-row .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.route-row .meta .name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.route-row .meta .sub  { color: var(--text-2); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.route-row .grade {
  align-self: center; padding: 8px 10px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px;
}

/* ----- RPE + body-check chips on the attempt log ----- */
.rpe-row { gap: 4px; flex-wrap: wrap; }
.rpe-chip {
  min-width: 32px; padding: 6px 10px;
  font-weight: 700; font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.rpe-chip.rpe-easy  { color: var(--lime); }
.rpe-chip.rpe-mid   { color: var(--sky); }
.rpe-chip.rpe-hard  { color: var(--accent); }
.rpe-chip.rpe-limit { color: var(--rose); }
.rpe-chip.active.rpe-easy  { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.rpe-chip.active.rpe-mid   { background: var(--sky); color: var(--bg); border-color: var(--sky); }
.rpe-chip.active.rpe-hard  { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.rpe-chip.active.rpe-limit { background: var(--rose); color: var(--bg); border-color: var(--rose); }

.body-check-row { gap: 6px; flex-wrap: wrap; }
.body-check-chip {
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.body-check-chip.bc-great.active { background: rgba(110,219,77,0.18); border-color: var(--lime); color: var(--lime); }
.body-check-chip.bc-warn.active  { background: rgba(229,91,106,0.18); border-color: var(--rose); color: var(--rose); }

/* ----- Adaptive Sticky struggle card ----- */
.struggle-card.welcome-back {
  background: linear-gradient(135deg, rgba(76,194,255,0.10), rgba(110,219,77,0.05));
  border-color: rgba(76,194,255,0.4);
}
.struggle-card.welcome-back .struggle-eyebrow { color: var(--sky); }
.struggle-card.welcome-back .struggle-tip { border-left-color: var(--sky); }
.struggle-card.welcome-back .struggle-tip-eyebrow { color: var(--sky); }
.struggle-card {
  margin-top: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255,162,43,0.10), rgba(229,91,106,0.05));
  border: 1px solid rgba(255,162,43,0.4);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
}
.struggle-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--accent); text-transform: uppercase;
}
.struggle-headline { font-size: 15px; font-weight: 700; color: var(--text); }
.struggle-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.struggle-tip {
  margin-top: 4px; padding: 10px 12px;
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text);
}
.struggle-tip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--accent); text-transform: uppercase;
}

/* ----- Log tab ----- */
.log-section-title {
  margin: 18px 0 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-2); text-transform: uppercase;
}
.log-achievement {
  margin-top: 16px;
  padding: 14px; background: linear-gradient(135deg, var(--accent-soft), rgba(229,91,106,0.08));
  border: 1px solid var(--accent); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 4px;
}
.log-ach-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; color: var(--accent); }
.log-ach-grade   { font-size: 28px; font-weight: 800; color: var(--text); }
.log-ach-sub     { font-size: 12px; color: var(--text-2); }

/* Guest climber tile — visually distinct on the login picker. */
.login-profile-guest {
  background: var(--surface-2);
  border-style: dashed;
  opacity: 0.85;
}

/* Pre-session checklist inside the New session drawer. Reflective pause. */
.session-preflight {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.session-preflight-title { font-weight: 700; font-size: 14px; color: var(--accent); }
.session-preflight-sub { font-size: 12px; margin-bottom: 4px; }
.session-preflight-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 0; font-size: 13px; color: var(--text);
  cursor: pointer;
}
.session-preflight-item input { margin-top: 2px; }
.session-preflight-item input:checked + span { color: var(--text-3); text-decoration: line-through; }

.log-plateau {
  margin-top: 12px; padding: 14px;
  background: linear-gradient(135deg, rgba(110,219,77,0.08), rgba(76,194,255,0.06));
  border: 1px solid rgba(110,219,77,0.35);
  border-radius: var(--radius);
}
.log-plateau-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--lime); margin-bottom: 6px;
}
.log-plateau-text { font-size: 13px; color: var(--text); line-height: 1.55; }

.log-heatmap { margin-top: 4px; }
.log-heatmap-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.log-heatmap-cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--surface-2);
}
.log-heatmap-cell.on { background: var(--accent); }
.log-heatmap-legend { margin-top: 6px; font-size: 11px; display: flex; align-items: center; }
.log-heatmap-legend .log-heatmap-cell { width: 10px; height: 10px; aspect-ratio: auto; }

.log-pyramid { margin-top: 4px; }
.log-pyramid-bars {
  padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 5px;
}
.log-pyramid-row {
  display: grid; grid-template-columns: 36px 1fr 28px; gap: 8px;
  align-items: center;
}
.log-pyramid-row.empty .log-pyramid-grade { color: var(--text-3); }
.log-pyramid-grade { font-weight: 700; font-size: 13px; color: var(--text); }
.log-pyramid-bar-wrap { background: var(--surface-2); border-radius: 4px; height: 18px; overflow: hidden; }
.log-pyramid-bar {
  height: 100%; background: var(--accent);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px; color: var(--bg); font-weight: 700;
  transition: width 0.24s ease;
}
.log-pyramid-row.empty .log-pyramid-bar { background: var(--surface-2); color: var(--text-3); }
.log-pyramid-count { text-align: right; font-size: 12px; color: var(--text-2); font-weight: 600; }

.log-week-eyebrow {
  margin: 14px 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-2); text-transform: uppercase;
}

/* Voice dictation field — mic button + live status under a textarea. */
.voice-field { display: flex; flex-direction: column; gap: 6px; }
.voice-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-mic {
  font-size: 13px; font-weight: 600;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease, border-color 0.12s ease;
}
.voice-mic:active { transform: scale(0.97); }
.voice-mic.listening {
  background: rgba(229,91,106,0.12);
  border-color: var(--rose);
  color: var(--rose);
  animation: voice-pulse 1.4s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,91,106,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(229,91,106,0); }
}
.voice-status { font-size: 12px; font-style: italic; min-height: 14px; }

/* Quick-log pills inside route-row — at-the-wall ergonomics.
   Three taps log an attempt without opening the route detail. */
.route-quick-row {
  display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.route-quick-pill {
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease;
}
.route-quick-pill:active { transform: scale(0.95); }
.route-quick-pill.status-send     { color: var(--lime); border-color: rgba(110,219,77,0.4); background: rgba(110,219,77,0.08); }
.route-quick-pill.status-progress { color: var(--sky);  border-color: rgba(76,194,255,0.4); background: rgba(76,194,255,0.08); }
.route-quick-pill.status-fall     { color: var(--rose); border-color: rgba(229,91,106,0.4); background: rgba(229,91,106,0.08); }

.filter-row {
  display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap;
}
.filter-row button {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line);
}
.filter-row button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ----------  photo annotation  ---------- */
.annotate-stage {
  position: relative; width: 100%;
  background: var(--surface-2); border-radius: var(--radius);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
}
.annotate-stage img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
/* Annotation overlay — SVG sits on top of the photo and shows finger-drawn strokes. */
.annotate-stage .annotation-svg {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; pointer-events: none;
  z-index: 5;
}
/* Capture layer — only present when drawMode is on. Receives pointer events
   above the image but BELOW the markers (markers stay z=8 below this if needed). */
.annotate-stage .annotation-capture {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  z-index: 6;
  cursor: crosshair;
  touch-action: none;       /* prevent scrolling while drawing */
}
.annotate-stage.drawing { outline: 2px dashed var(--accent); outline-offset: -2px; }
.draw-toolbar {
  display: flex; gap: 8px; margin: 8px 0 0; flex-wrap: wrap;
}
.draw-toolbar .active-draw {
  background: var(--accent); color: var(--bg);
  border-color: var(--accent);
}
.annotate-stage .marker {
  position: absolute; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); font-weight: 800; font-size: 14px;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.annotate-stage .marker.body-LH { background: var(--sky); }
.annotate-stage .marker.body-RH { background: var(--lime); }
.annotate-stage .marker.body-LF { background: var(--rose); }
.annotate-stage .marker.body-RF { background: #c773ff; }
.annotate-stage .marker.body-BH { background: var(--accent); }
.annotate-stage .marker.body-MA { background: #fff; color: var(--bg); }
.annotate-stage .marker.active {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 0 4px rgba(255,162,43,0.5);
}
.annotate-stage .marker.dim { opacity: 0.4; }
.annotate-stage .placeholder {
  color: var(--text-3); padding: 40px 20px; text-align: center;
}
.annotate-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 12px 0;
}
.annotate-toolbar .hint {
  color: var(--text-2); font-size: 12px; flex: 1; min-width: 200px;
}

.sequence-list { margin: 12px 0 0; }
.sequence-list .step {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center;
  padding: 10px; background: var(--surface-2); border-radius: 10px; margin-bottom: 6px;
}
.sequence-list .step .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.sequence-list .step .num.body-LH { background: var(--sky); }
.sequence-list .step .num.body-RH { background: var(--lime); }
.sequence-list .step .num.body-LF { background: var(--rose); }
.sequence-list .step .num.body-RF { background: #c773ff; }
.sequence-list .step .num.body-MA { background: #fff; color: var(--bg); }
.sequence-list .step .desc { font-size: 13px; }
.sequence-list .step .desc small { color: var(--text-2); display: block; }

/* ----------  technique library  ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px;
}
.category-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  min-height: 90px;
}
.category-card .lbl { font-weight: 700; font-size: 14px; }
.category-card .hint { color: var(--text-3); font-size: 11px; line-height: 1.3; }
.category-card .count {
  margin-top: 8px;
  font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 0.3px;
}

.video-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.video-card .embed {
  position: relative; padding-bottom: 56.25%; height: 0; background: #000;
}
.video-card .embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.video-card .meta { padding: 10px 14px; display: flex; gap: 8px; align-items: center; }
.video-card .meta .title { flex: 1; font-weight: 600; font-size: 13px; }
.video-card .meta button { color: var(--text-3); font-size: 12px; padding: 4px 8px; }

.channel-list { display: flex; flex-direction: column; gap: 6px; }
.channel-list .channel {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px; background: var(--surface-2); border-radius: 10px;
}
.channel-list .channel .n { font-weight: 700; font-size: 13px; }
.channel-list .channel .w { font-size: 11px; color: var(--text-2); }
.channel-list .channel a {
  font-size: 12px; padding: 6px 10px; background: var(--bg);
  border-radius: 8px; border: 1px solid var(--line); color: var(--text);
}

/* ----------  sessions  ---------- */
.session-row {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px var(--pad); margin-bottom: 10px;
}
.session-row .head { display: flex; align-items: baseline; gap: 8px; }
.session-row .head .date { font-weight: 700; font-size: 14px; }
.session-row .head .gym  { color: var(--text-2); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.session-row .stats {
  display: flex; gap: 12px; margin-top: 8px;
  color: var(--text-2); font-size: 12px;
}
.session-row .stats b { color: var(--text); font-size: 14px; }
.session-row .climbs {
  margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap;
}

/* ----------  goals  ---------- */
.goal-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 8px;
}
.goal-row .check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--line); background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--lime); font-weight: 800;
}
.goal-row.done .check { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.goal-row.done .text  { color: var(--text-3); text-decoration: line-through; }
.goal-row .text { font-size: 14px; }
.goal-row .text small { display: block; color: var(--text-3); font-size: 11px; }

/* ----------  stats  ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px;
}
.stat-grid .stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.stat-grid .stat .lbl { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-grid .stat .val { font-weight: 800; font-size: 22px; margin-top: 4px; }

/* ----------  modal / drawer  ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
.drawer {
  width: 100%; max-width: 720px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 16px var(--pad) calc(var(--safe-bottom) + 16px);
  max-height: 90dvh; overflow-y: auto;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  animation: drawerIn 0.18s ease-out;
}
@keyframes drawerIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.drawer .grip {
  width: 40px; height: 4px; border-radius: 2px; background: var(--text-3);
  margin: 0 auto 12px; opacity: 0.5;
}
.drawer-title {
  font-size: 17px; font-weight: 700; margin: 0 0 12px;
}

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-row .chip {
  padding: 8px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600;
}
.chip-row .chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
/* Horizontally-scrollable variant — used for long lists like grades */
.chip-row.chip-row-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.chip-row.chip-row-scroll .chip {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

/* ----------  install hint / footer  ---------- */
.notice {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 12px 14px; color: var(--text-2); font-size: 13px; line-height: 1.5;
  margin-bottom: 12px;
}
.notice b { color: var(--text); }

/* ----------  body position guide  ---------- */
.guide-card {
  display: block; width: 100%; text-align: left;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255,162,43,0.22), transparent 60%),
    var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 18px;
  color: var(--text);
}
.guide-card-eyebrow {
  font-size: 10px; color: var(--accent); letter-spacing: 1.5px; font-weight: 800;
}
.guide-card-title { font-weight: 800; font-size: 19px; margin-top: 4px; }
.guide-card-sub   { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.guide-card-meta  { color: var(--text-3); font-size: 11px; margin-top: 10px; letter-spacing: 0.3px; }

.guide-section-title {
  font-size: 12px; color: var(--text-2); margin: 22px 0 6px;
  letter-spacing: 0.6px; text-transform: uppercase; font-weight: 700;
}
.guide-section-blurb {
  color: var(--text-3); font-size: 12px; margin: 0 0 12px;
}
.guide-principle-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.guide-principle-name {
  font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 6px;
}
.guide-principle-text {
  font-size: 14px; line-height: 1.55; color: var(--text); margin-bottom: 10px;
}
.guide-principle-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.guide-principle-vids { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.guide-principle-vid {
  background: var(--surface-2); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.guide-principle-vid .embed {
  position: relative; padding-bottom: 56.25%; height: 0; background: #000;
}
.guide-principle-vid .embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.guide-principle-vid-meta {
  padding: 8px 12px; font-size: 12px; color: var(--text-2);
}

.guide-scenario-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  border-left: 3px solid var(--sky);
}
.guide-scenario-situation {
  font-weight: 700; font-size: 14px; color: var(--sky); margin-bottom: 4px;
}
.guide-scenario-tech {
  font-size: 13.5px; line-height: 1.55; color: var(--text); margin-bottom: 10px;
}

.guide-mistake-card {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: flex-start;
  background: rgba(229,91,106,0.08);
  border: 1px solid rgba(229,91,106,0.3);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
}
.guide-mistake-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rose); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.guide-mistake-text {
  font-size: 13px; color: var(--text); line-height: 1.5;
}

/* ----------  Version footer (Me tab)  ---------- */
.version-footer {
  text-align: center; padding: 18px 14px 6px;
  font-size: 11px; line-height: 1.55;
}
.version-footer #version-build {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.2px;
}

/* ----------  Gym input + "Find me" button row  ---------- */
.gym-input-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch;
}
.gym-find {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 14px; min-height: 44px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
}
.gym-find:active { transform: scale(0.97); }
.gym-status {
  font-size: 11px; margin-top: 6px; line-height: 1.4;
  min-height: 14px;
}

/* ----------  Hand Technique Catalogue  ---------- */
.guide-card.catalogue-card {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(76, 194, 255, 0.18), transparent 60%),
    var(--surface);
  border-color: var(--sky);
}
.guide-card.catalogue-card .guide-card-eyebrow { color: var(--sky); }

.cat-entry {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.cat-entry-head {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px;
}
.cat-entry-title {
  flex: 1; font-weight: 700; font-size: 15px; color: var(--text);
}
.cat-entry-level {
  font-size: 10px; letter-spacing: 0.6px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid; background: transparent;
  white-space: nowrap;
}
.cat-entry-video {
  margin: 8px 0 10px;
  border-radius: 10px; overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.cat-entry-video .embed {
  position: relative; padding-bottom: 56.25%; height: 0;
}
.cat-entry-video .embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.cat-entry-video-credit {
  padding: 6px 10px; font-size: 10px; color: var(--text-3);
  background: var(--surface-2); border-top: 1px solid var(--line);
}

.cat-entry-desc {
  font-size: 13px; line-height: 1.5; color: var(--text); margin-bottom: 8px;
}
.cat-entry-safety {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: flex-start;
  background: rgba(229,91,106,0.10); border: 1px solid rgba(229,91,106,0.32);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}
.cat-entry-safety-icon {
  color: var(--rose); font-weight: 800; font-size: 13px; text-align: center;
}
.cat-entry-safety span:last-child {
  font-size: 12px; line-height: 1.45; color: var(--text);
}
.cat-entry-actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.cat-entry-saved-count {
  font-size: 11px; color: var(--lime); font-weight: 700;
  margin-left: auto;
}

/* ----------  Login overlay  ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: linear-gradient(135deg, #0a0b0e 0%, #14161b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: bsFadeIn 0.22s ease-out;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-brand {
  font-weight: 800; font-size: 28px; letter-spacing: 2px;
  text-align: center; color: var(--text);
}
.login-brand span { color: var(--accent); }
.login-tag {
  text-align: center; color: var(--text-3); font-size: 11px;
  letter-spacing: 0.6px; font-style: italic; margin-top: 2px;
}
.login-title {
  text-align: center; font-size: 16px; font-weight: 700;
  margin: 22px 0 14px; color: var(--text);
}
.login-profile {
  display: grid; grid-template-columns: 36px 1fr 24px; gap: 12px; align-items: center;
  width: 100%; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  cursor: pointer; text-align: left;
}
.login-profile:hover { background: rgba(255,255,255,0.04); }
.login-profile:active { transform: scale(0.99); }
.login-profile-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: var(--bg);
}
.login-dot-big { width: 56px; height: 56px; font-size: 22px; margin: 14px auto; }
.login-profile-name { font-weight: 700; font-size: 15px; }
.login-profile-lock { color: var(--text-3); font-size: 14px; text-align: right; }
.login-note {
  margin-top: 14px; padding: 10px 12px;
  background: rgba(76,194,255,0.06);
  border: 1px solid rgba(76,194,255,0.18);
  border-radius: 10px;
  color: var(--text-2); font-size: 12px; line-height: 1.5;
}
.login-note b { color: var(--text); }
.login-back {
  background: transparent; color: var(--text-3); border: 0;
  font-size: 12px; padding: 0 0 10px; cursor: pointer;
}
.login-pin {
  display: block; width: 60%; margin: 8px auto;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 22px; letter-spacing: 8px; text-align: center;
}
.login-error {
  text-align: center; color: var(--danger); font-size: 12px;
  min-height: 16px; margin: 4px 0;
}
.login-submit {
  display: block; width: 100%; margin-top: 10px;
  background: var(--accent); color: var(--bg);
  border: 0; border-radius: 10px;
  padding: 14px; font-size: 15px; font-weight: 800;
  cursor: pointer;
}

/* ----------  Privacy & PIN section in Me tab  ---------- */
.me-toggle {
  display: flex; gap: 12px; padding: 10px 0;
  cursor: pointer; align-items: flex-start;
}
.me-toggle input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px;
  accent-color: var(--accent); cursor: pointer;
}
.me-toggle-title { display: block; font-weight: 700; font-size: 14px; color: var(--text); }
.me-toggle-sub { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.me-divider {
  height: 1px; background: var(--line);
  margin: 12px 0;
}

/* ----------  Beta variant label on route detail  ---------- */
.beta-label {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 10px 0;
}
.beta-label-tag {
  font-size: 10px; letter-spacing: 1.2px; font-weight: 800;
  color: var(--accent);
  padding: 3px 8px; background: var(--accent-soft); border-radius: 6px;
}
.beta-label-explain { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; }

.family-private-tag {
  font-size: 9px; color: var(--text-3); margin-left: 6px;
  letter-spacing: 0.4px; text-transform: uppercase; font-weight: 600;
}

/* ----------  Beta Story launch button (on route detail)  ---------- */
.beta-story-launch {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  width: 100%;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(229,91,106,0.20), transparent 60%),
    linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 10px 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  position: relative; overflow: hidden;
}
.beta-story-launch:active { transform: scale(0.99); }
.beta-story-launch::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 0% 50%, rgba(255,162,43,0.18), transparent 50%);
  pointer-events: none;
}
.bs-launch-icon {
  width: 56px; height: 70px; display: flex; align-items: end; justify-content: center;
  position: relative; z-index: 1;
}
.bs-launch-icon svg { width: 100%; height: 100%; }
.bs-launch-text { position: relative; z-index: 1; }
.bs-launch-title { font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: 0.3px; }
.bs-launch-sub { color: var(--text-2); font-size: 12px; margin-top: 2px; font-style: italic; }

/* ----------  Beta Story full-screen overlay (Layer 2)  ---------- */
.beta-story {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: #000;
  animation: bsFadeIn 0.22s ease-out;
}
@keyframes bsFadeIn { from { opacity: 0; } to { opacity: 1; } }

.bs-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(0.85);
}
.bs-dim {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 60%, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.75) 70%, rgba(0,0,0,0.85) 100%);
}

.bs-stage {
  position: absolute; inset: 0;
  cursor: pointer;
}

.bs-pointer {
  position: absolute;
  width: 36px; height: 36px;
  margin-left: -18px; margin-top: -18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(255,162,43,0.35), 0 4px 12px rgba(0,0,0,0.7);
  animation: bsPointerPulse 1.4s ease-in-out infinite;
  z-index: 3;
}
@keyframes bsPointerPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(255,162,43,0.25), 0 4px 12px rgba(0,0,0,0.7); }
}

.bs-coach {
  position: absolute;
  width: 14%; max-width: 110px; min-width: 64px;
  transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(0.45, 0, 0.2, 1), top 0.5s cubic-bezier(0.45, 0, 0.2, 1);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  z-index: 4;
  animation: bsCoachBob 3.4s ease-in-out infinite;
}
@keyframes bsCoachBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}
.bs-coach svg { width: 100%; height: auto; display: block; }

.bs-bubble {
  position: absolute;
  left: 50%; bottom: 14%;
  transform: translateX(-50%);
  max-width: 86%; width: 480px;
  background: rgba(26,28,32,0.96);
  color: var(--text);
  border: 1px solid rgba(255,162,43,0.6);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 5;
  animation: bsBubbleIn 0.3s ease-out;
}
@keyframes bsBubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.bs-bubble::after {
  content: '';
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px;
  background: rgba(26,28,32,0.96);
  border-left: 1px solid rgba(255,162,43,0.6);
  border-top: 1px solid rgba(255,162,43,0.6);
  transform: translateX(-50%) rotate(45deg);
}
.bs-bubble-head {
  font-weight: 800; font-size: 14px; color: var(--accent);
  margin-bottom: 4px;
}
.bs-bubble-body {
  font-size: 15px; line-height: 1.5; color: var(--text);
}

.bs-topbar {
  position: relative; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: max(env(safe-area-inset-top, 0px), 12px) 14px 8px;
}
.bs-brand {
  flex: 1; text-align: center;
  font-weight: 800; font-size: 14px; color: var(--accent); letter-spacing: 0.6px;
}
.bs-tag {
  display: block;
  font-size: 10px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.3px; font-style: italic;
}
.bs-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.bs-btn:active { transform: scale(0.95); }
.bs-btn[aria-pressed="true"] {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.bs-close { padding: 8px 12px; }

.bs-bottom {
  position: relative; z-index: 6; margin-top: auto;
  display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center;
  padding: 10px 14px max(env(safe-area-inset-bottom, 0px), 14px);
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}
.bs-nav {
  background: rgba(255,255,255,0.12); color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 12px 14px; font-weight: 700;
  cursor: pointer;
}
.bs-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.bs-nav.bs-next {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  font-size: 13px;
}
.bs-progress {
  text-align: center; font-size: 11px; color: var(--text-2);
  letter-spacing: 0.6px; font-weight: 700;
}

/* ----------  Family Beta Book  ---------- */
.family-ascent-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.family-ascent-row:first-of-type { border-top: 0; }
.family-ascent-chip {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--bg);
}
.family-ascent-info { min-width: 0; }
.family-ascent-name { font-weight: 700; font-size: 14px; color: var(--text); }
.family-ascent-stats { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.your-ascents { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border-color: var(--accent); }
.ascent-attempt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.ascent-attempt:last-child { border-bottom: 0; }
.ascent-date { font-size: 12px; color: var(--text-2); }
.ascent-note { width: 100%; font-size: 12.5px; color: var(--text); padding-top: 4px; line-height: 1.4; }
.ascent-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  margin-top: 12px;
}
.ascent-actions .button { padding: 10px 6px; font-size: 12px; min-height: 40px; }

/* ----------  media rows  ---------- */
.media-section { margin-top: 12px; }
.media-label {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.6px;
  text-transform: uppercase; font-weight: 700; margin-bottom: 6px;
}
.media-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; margin-bottom: 6px;
}
.media-icon { font-size: 16px; }
.media-row audio { flex: 1; min-width: 0; }
.media-delete {
  background: transparent; color: var(--text-3); font-size: 12px;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--line); cursor: pointer;
}
.media-delete:hover { color: var(--danger); border-color: var(--danger); }

.media-video {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; margin-bottom: 8px;
}
.video-stage {
  position: relative; width: 100%; background: #000; border-radius: 6px; overflow: hidden;
}
.video-stage video { width: 100%; display: block; }
.pose-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.video-controls { background: transparent; border: 0; padding: 6px 0 0; gap: 6px; }

/* ----------  recorder drawer  ---------- */
.rec-preview {
  width: 100%; max-height: 60vh; background: #000;
  border-radius: 10px; margin-bottom: 8px; display: block;
}
.rec-status {
  font-size: 13px; color: var(--text-2); margin: 8px 0;
}
.rec-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 28px; font-weight: 700; color: var(--accent);
  text-align: center; margin: 4px 0 12px;
}

/* ----------  Today's Quest card  ---------- */
.quest-card {
  display: block; width: 100%; text-align: left;
  background:
    linear-gradient(135deg, rgba(255,162,43,0.18), rgba(110,219,77,0.05)),
    var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0 12px;
  color: var(--text);
  cursor: pointer;
}
.quest-card.done {
  border-color: var(--lime);
  background: linear-gradient(135deg, rgba(110,219,77,0.16), rgba(76,194,255,0.04)), var(--surface);
}
.quest-card:active { transform: scale(0.99); }
.quest-eyebrow {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--accent); letter-spacing: 1.2px; font-weight: 800;
}
.quest-card.done .quest-eyebrow { color: var(--lime); }
.quest-cat-icon { font-size: 14px; }
.quest-title { font-weight: 800; font-size: 17px; margin-top: 6px; }
.quest-kid { color: var(--text-2); font-size: 13px; margin-top: 2px; font-style: italic; }
.quest-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.quest-status {
  font-size: 12px; font-weight: 700; color: var(--text);
}
.quest-status.done { color: var(--lime); }
.quest-mins { font-size: 11px; color: var(--text-3); }

.quest-kid-line {
  font-size: 15px; font-style: italic; color: var(--accent);
  padding: 8px 0; line-height: 1.4;
}
.quest-intent {
  font-size: 14px; line-height: 1.55; color: var(--text);
}

/* ----------  finger-health card (Me tab)  ---------- */
.finger-health-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin: 10px 0;
}
.finger-health-card.youth {
  background: linear-gradient(135deg, rgba(229,91,106,0.10), transparent), var(--surface);
  border-color: rgba(229,91,106,0.45);
}
.fh-eyebrow {
  font-size: 10px; color: var(--text-3); letter-spacing: 1.2px; font-weight: 800;
  margin-bottom: 6px;
}
.finger-health-card.youth .fh-eyebrow { color: var(--rose); }
.fh-line {
  font-size: 13.5px; line-height: 1.55; color: var(--text); margin-bottom: 8px;
}
.fh-list {
  margin: 8px 0; padding-left: 18px; color: var(--text);
  font-size: 13px; line-height: 1.5;
}
.fh-list li { margin: 2px 0; }
.fh-sources {
  margin-top: 10px; font-size: 11px; color: var(--text-3);
  border-top: 1px solid var(--line); padding-top: 8px;
}
.fh-sources a { color: var(--sky); }

/* ----------  safety warning banner  ---------- */
.safety-warn {
  background: rgba(255,162,43,0.10);
  border: 1px solid rgba(255,162,43,0.35);
  border-radius: var(--radius);
  padding: 12px 14px; margin: 10px 0;
}
.safety-warn-title {
  font-weight: 800; font-size: 13px; color: var(--accent); letter-spacing: 0.3px;
}
.safety-warn-body {
  color: var(--text); font-size: 12.5px; line-height: 1.5; margin-top: 4px;
}

/* ----------  add-marker mode visual cue  ---------- */
.annotate-stage.adding {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  cursor: crosshair;
  position: relative;
}
.annotate-stage.adding::after {
  content: 'Tap a hold';
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--bg);
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  padding: 4px 12px; border-radius: 999px;
  pointer-events: none;
}
.annotate-stage.adding img { cursor: crosshair; }

.stepper-add {
  margin-top: 10px;
  width: 100%; padding: 10px; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px dashed var(--line);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.stepper-add:active { transform: scale(0.99); }
.stepper-add.active {
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent);
}

/* ----------  shadow-figure climber overlay  ---------- */
.climber-figure {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2;
  opacity: 0; transition: opacity 0.3s ease;
}
.climber-figure .figure-line {
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  transition:
    x1 0.55s cubic-bezier(0.5, 0, 0.25, 1.15),
    y1 0.55s cubic-bezier(0.5, 0, 0.25, 1.15),
    x2 0.55s cubic-bezier(0.5, 0, 0.25, 1.15),
    y2 0.55s cubic-bezier(0.5, 0, 0.25, 1.15);
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.85));
}
.climber-figure .figure-line.active {
  stroke: var(--accent);
  stroke-width: 3;
  filter: drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 1px rgba(0,0,0,0.6));
}
.climber-figure .figure-line.synth {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-dasharray: 2 2;
}
.climber-figure .figure-glow {
  fill: var(--accent);
  opacity: 0;
  transition: cx 0.55s cubic-bezier(0.5, 0, 0.25, 1.15), cy 0.55s cubic-bezier(0.5, 0, 0.25, 1.15), opacity 0.4s ease;
  filter: drop-shadow(0 0 6px var(--accent));
  animation: glow-pulse 1.6s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.35); }
}
.climber-head {
  position: absolute;
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.85);
  border: 2px solid var(--bg);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.55s cubic-bezier(0.5, 0, 0.25, 1.15),
    top  0.55s cubic-bezier(0.5, 0, 0.25, 1.15),
    opacity 0.3s ease;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0;
}

/* Markers stay on top so they remain tappable */
.annotate-stage .marker { z-index: 4; }

/* ----------  stepper  ---------- */
.stepper-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
}
.stepper-eyebrow {
  font-size: 10px; color: var(--accent); letter-spacing: 1.4px; font-weight: 800;
  text-align: center; margin-bottom: 10px;
}
.stepper-dots {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.stepper-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.stepper-dot:active { transform: scale(0.92); }
.stepper-dot.active {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,162,43,0.25);
}
.stepper-controls {
  display: grid; grid-template-columns: 40px 1fr 40px auto; gap: 8px; align-items: center;
}
.stepper-arrow {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  cursor: pointer;
}
.stepper-arrow:active { transform: scale(0.94); }
.stepper-label {
  text-align: center; font-weight: 700; font-size: 14px; color: var(--text);
}
.stepper-play {
  padding: 8px 14px; min-height: 40px; border-radius: 10px;
  background: var(--accent); color: var(--bg); font-weight: 800;
  border: 0; font-size: 13px;
  cursor: pointer;
}
.stepper-play:active { transform: scale(0.96); }
.stepper-hint {
  color: var(--text-3); font-size: 11px; text-align: center; margin-top: 8px; line-height: 1.4;
}

/* ----------  workspace hint (empty markers state)  ---------- */
.workspace-hint {
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
.workspace-hint-title {
  font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: 0.3px;
}
.workspace-hint-sub {
  color: var(--text-2); font-size: 12.5px; line-height: 1.5; margin-top: 4px;
}

/* ----------  discipline note in analysis  ---------- */
.analysis-discipline {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(76,194,255,0.10); border: 1px solid rgba(76,194,255,0.25);
  color: var(--sky); font-size: 12px; line-height: 1.4;
}
.analysis-discipline-icon { font-weight: 800; font-size: 10px; padding-top: 2px; }
.analysis-discipline span:last-child { color: var(--text); }

/* ----------  route analysis card  ---------- */
.analysis-card {
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(76,194,255,0.16), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sky);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
.analysis-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.analysis-eyebrow {
  font-size: 10px; color: var(--sky); letter-spacing: 1.4px; font-weight: 800;
}
.analysis-angle {
  font-size: 11px; color: var(--text);
  background: var(--surface-2); padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 700;
}
.analysis-line { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.analysis-sub  { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }
.analysis-block {
  display: grid; grid-template-columns: 92px 1fr; gap: 6px; padding: 6px 0;
  border-top: 1px solid var(--line);
}
.analysis-label {
  font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px;
  font-weight: 700; padding-top: 2px;
}
.analysis-value { font-size: 13px; color: var(--text); line-height: 1.45; }
.analysis-reason { color: var(--text-2); font-weight: 400; }
.analysis-finger {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 12px;
}
.analysis-finger.finger-high { background: rgba(229,91,106,0.12); color: var(--rose); }
.analysis-finger.finger-med  { background: rgba(255,162,43,0.12); color: var(--accent); }
.analysis-finger-dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}

/* ----------  per-move solver card (inside drawer)  ---------- */
.solver-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.solver-eyebrow {
  font-size: 10px; color: var(--accent); letter-spacing: 1.4px; font-weight: 800;
  margin-bottom: 8px;
}
.solver-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.solver-row:first-of-type { border-top: 0; padding-top: 4px; }
.solver-label {
  font-size: 10px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700; padding-top: 3px;
}
.solver-value { font-size: 13px; line-height: 1.5; color: var(--text); }
.solver-principle { font-weight: 700; color: var(--accent); }
.solver-cue       { font-weight: 700; color: var(--lime); font-style: italic; }
.solver-detail    { color: var(--text); }
.solver-row.solver-warn .solver-label { color: var(--rose); }
.solver-row.solver-warn .solver-value { color: var(--text-2); }

.solver-finger {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 12px; line-height: 1.4;
}
.solver-finger.finger-high { background: rgba(229,91,106,0.12); border: 1px solid rgba(229,91,106,0.35); color: var(--rose); }
.solver-finger.finger-med  { background: rgba(255,162,43,0.12); border: 1px solid rgba(255,162,43,0.35); color: var(--accent); }
.solver-finger.finger-low  { background: rgba(110,219,77,0.10); border: 1px solid rgba(110,219,77,0.30); color: var(--lime); }
.solver-finger-dot {
  width: 10px; height: 10px; border-radius: 50%; background: currentColor; margin-top: 4px; flex-shrink: 0;
}
.solver-finger-label { font-weight: 800; }
.solver-finger-detail { color: var(--text); font-weight: 400; }

/* ----------  technique chip on sequence step  ---------- */
.sequence-list .step .desc .desc-line { font-size: 13px; font-weight: 600; color: var(--text); }
.sequence-list .step .desc .desc-chips { margin-top: 6px; }
.tech-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(255, 162, 43, 0.4);
  font-size: 11px; font-weight: 700;
  cursor: pointer; line-height: 1.4;
}
.tech-chip:active { transform: scale(0.97); }
.tech-chip .tech-chip-icon { font-size: 9px; }
.tech-chip .tech-chip-count {
  background: var(--accent); color: var(--bg);
  border-radius: 999px; padding: 0 6px;
  font-size: 10px; min-width: 14px; text-align: center;
}
.tech-chip.suggested {
  background: var(--surface-2); color: var(--text-2);
  border-color: var(--line);
}
.tech-chip.suggested .tech-chip-icon { color: var(--text-3); }
.tech-chip.ghost {
  background: var(--surface-2); color: var(--text-2);
  border: 1px dashed var(--line);
}
.category-card.active-tag {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}

/* ----------  add-video drawer  ---------- */
.add-video-help {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 12px;
  font-size: 12.5px; line-height: 1.5; color: var(--text-2);
}
.add-video-help b { color: var(--text); }
.add-video-preview {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px; margin-bottom: 12px;
}
.add-video-preview-label {
  font-size: 10px; letter-spacing: 0.8px; color: var(--text-3);
  text-transform: uppercase; font-weight: 700; margin-bottom: 6px;
}
.add-video-preview .embed {
  position: relative; padding-bottom: 56.25%; height: 0; background: #000; border-radius: 6px; overflow: hidden;
}
.add-video-preview .embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

.provider-badge {
  display: inline-block; margin-left: 8px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.6px;
  background: var(--surface-2); color: var(--text-3);
  vertical-align: middle;
}

/* ----------  draft banner  ---------- */
.draft-banner {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px; margin: 14px 0 0;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.draft-banner:active { transform: scale(0.99); }
.draft-banner-title { font-weight: 800; font-size: 13px; color: var(--accent); letter-spacing: 0.3px; }
.draft-banner-sub   { font-size: 12px; color: var(--text-2); }

/* ----------  utility  ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-3); font-size: 12px; }
.right { text-align: right; }

/* Profile-themed accents for the active profile's name only */
.app-header .profile-chip .name[data-profile="dinah"]   { color: var(--rose); }
.app-header .profile-chip .name[data-profile="luca"]    { color: var(--lime); }
.app-header .profile-chip .name[data-profile="alessia"] { color: var(--sky); }
