/* ----- tokens ----- */
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #FBF8F3;
  --ink: #1E1B18;
  --muted: #6F675F;
  --line: #E8DED4;
  --line-soft: #F0E8DD;

  --accent: #ED643B;
  --accent-text: #B8533A;
  --accent-hover: #C94E2E;
  --accent-soft: #FCE9DF;

  --blue: #6F9FB5;
  --blue-deep: #2F5868;
  --blue-soft: #EEF6F8;
  --blue-tint: #E1ECF1;

  --green: #6DA08A;

  /* user-tweakable backgrounds */
  --bg-global-rail: #FFFFFF;
  --bg-course-rail: #FAF7F2;
  --bg-lesson: #FAF7F2;
  --bg-panel: #FFFFFF;

  --r-sm: 6px;
  --r: 10px;
  --r-md: 12px;
  --r-lg: 14px;

  --shadow-card: 0 1px 0 rgba(30, 27, 24, 0.02), 0 1px 2px rgba(30, 27, 24, 0.03);

  --rail-global-w: 108px;
  --rail-global-w-tablet: 64px;
  --rail-course-w: 268px;

  --font-ui: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-density="cozy"] { --gap: 18px; }

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ----- device shell ----- */
.device-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.device-shell-fullbleed { background: var(--bg); }
.device-stage {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 28px 24px 60px;
  background: #EFE9DF;
  background-image:
    radial-gradient(900px 500px at 20% -10%, rgba(237,100,59,0.05), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(111,159,181,0.06), transparent 60%);
  overflow-x: auto;
  min-height: 100vh;
}
.device-frame {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(30,27,24,0.18), 0 4px 12px rgba(30,27,24,0.04);
  position: relative; flex: none;
}
.device-frame[data-mode="tablet"] { width: 900px; }
.device-frame[data-mode="mobile"] { width: 390px; }
.device-frame-fullbleed {
  width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none;
}

/* device floater (toggle) */
.device-floater {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  font-family: var(--font-ui);
}
.device-floater .df-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  box-shadow: 0 6px 14px -8px rgba(30,27,24,0.18);
  color: var(--muted); text-transform: capitalize;
  transition: all 0.15s ease;
}
.device-floater .df-trigger:hover { color: var(--ink); border-color: #D9CCBE; }
.device-floater .df-options {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 4px;
  display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 12px 28px -10px rgba(30,27,24,0.18);
  min-width: 140px;
}
.device-floater .df-options button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); border-radius: var(--r-sm);
  transition: all 0.15s;
}
.device-floater .df-options button:hover { background: var(--bg); color: var(--ink); }
.device-floater .df-options button.is-active { color: var(--accent-text); background: var(--accent-soft); }

/* ----- app shell -----
   3-column grid: global rail | course rail | main.
   When collapsed, the course rail's column goes to 0 — the rail vanishes
   entirely and the lesson area reclaims the full width. The arrows live in a
   floating element positioned just outside the global rail. */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-global-w) var(--rail-course-w) 1fr;
  background: var(--bg-lesson);
  position: relative;
  min-height: 100vh;
  transition: grid-template-columns 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-shell[data-course-collapsed="true"] {
  grid-template-columns: var(--rail-global-w) calc(var(--rail-course-w) - 60px) 1fr;
}
.app-shell[data-mode="tablet"] {
  grid-template-columns: var(--rail-global-w-tablet) var(--rail-course-w) 1fr;
}
.app-shell[data-mode="tablet"][data-course-collapsed="true"] {
  grid-template-columns: var(--rail-global-w-tablet) calc(var(--rail-course-w) - 60px) 1fr;
}
.app-shell[data-mode="mobile"] { grid-template-columns: 1fr; }

/* ----- global rail ----- */
.global-rail {
  border-right: 1px solid var(--line);
  background: var(--bg-global-rail);
  padding: 18px 8px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  align-self: stretch;
  height: 100vh;
  align-items: stretch;
}

.global-rail .gr-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.global-rail .gr-logo .gr-logo-icon { height: 36px; width: auto; }

.gr-list { display: flex; flex-direction: column; gap: 4px; }
.gr-list-top { flex: 1; }

.gr-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 10px 4px 9px;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 11.5px; font-weight: 500;
  color: var(--ink);
  transition: background 0.15s ease;
  position: relative;
  text-align: center;
  text-wrap: balance;
}
.gr-item .gr-icon { color: var(--ink); display: inline-flex; }
.gr-item .gr-label { line-height: 1.15; letter-spacing: 0.005em; }
.gr-item:hover { background: rgba(30,27,24,0.04); }

.gr-item.is-active {
  background: rgba(30,27,24,0.06);
}
.gr-item.is-active .gr-icon { color: var(--ink); }
.gr-item.is-active .gr-icon { color: var(--accent); }
.gr-item.is-active::before {
  content: ""; position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 2px;
  background: var(--accent);
}

.global-rail .gr-bottom {
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

/* tablet variant — icon-only, no labels */
.global-rail[data-mode="tablet"] { padding: 14px 6px; }
.global-rail[data-mode="tablet"] .gr-item .gr-label { display: none; }
.global-rail[data-mode="tablet"] .gr-item { padding: 10px 4px; }
.global-rail[data-mode="tablet"] .gr-logo .gr-logo-icon { height: 26px; }

/* ----- course rail ----- */
.course-rail {
  border-right: 1px solid var(--line);
  background: var(--bg-course-rail);
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
.course-rail.is-collapsed { border-right-color: transparent; }

.course-rail .cr-inner {
  width: var(--rail-course-w);
  height: 100%;
  display: flex; flex-direction: column;
  transform: translateX(0);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.course-rail.is-collapsed .cr-inner {
  pointer-events: none;
  transform: translateX(calc(-1 * var(--rail-course-w)));
}

.cr-header {
  padding: 16px 18px 16px;
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: relative;
  /* Match the global rail's logo divider height so the two horizontal
     dividers line up exactly. Global rail: 18 (rail pad) + 4 (logo top) +
     36 (icon) + 16 (logo bottom) = 74px. */
  min-height: 74px;
  box-sizing: border-box;
}

/* Clickable course title — links back to the course home page */
.cr-header .cr-title {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.25;
  color: var(--ink);
  text-align: left;
  padding: 2px 0;
  margin: 0;
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.cr-header .cr-title-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Progress block in the course rail header */
.cr-progress { display: flex; flex-direction: column; gap: 6px; }
.cr-progress-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 11.5px; color: var(--muted);
  letter-spacing: 0.01em;
}
.cr-progress-meta strong { color: var(--ink); font-weight: 600; }
.cr-progress-pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* Thin progress track — used in the course rail header AND in the
   Lesson Objectives card. Accent fill on a soft track. */
.cr-bar {
  width: 100%;
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.cr-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cr-header .cr-title-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cr-header .cr-collapse {
  position: absolute; top: 18px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.cr-collapse:hover { background: var(--bg); color: var(--ink); }

/* ----- "Show navigation" arrows (visible only when course rail is collapsed)
   Sits inside .app-shell (which is position: relative); positioned absolutely
   over the thin collapsed lane via offsets driven by the same CSS vars the
   grid uses, so geometry stays in sync. */
.cr-expander {
  position: absolute;
  left: calc(var(--rail-global-w) + var(--cr-arrow-x, 6px));
  top: var(--cr-arrow-y, 22px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-muted);
  border: 0;
  z-index: 6;
  cursor: pointer;
  padding: 6px 4px;
  /* hidden by default — shown only when the course rail is collapsed */
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s;
  transition-delay: 0s;
}
.app-shell[data-course-collapsed="true"] .cr-expander {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  /* wait for the rail to finish collapsing before fading in */
  transition-delay: 0.22s;
}
.app-shell[data-mode="tablet"] .cr-expander {
  left: calc(var(--rail-global-w-tablet) + var(--cr-arrow-x, 6px));
}
.cr-expander svg {
  width: var(--cr-arrow-size, 14px);
  height: var(--cr-arrow-size, 14px);
  transition: transform 0.2s;
}
.cr-expander-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  transition: color 0.15s;
}
.cr-expander:hover { color: var(--accent); }
.cr-expander:hover .cr-expander-label { color: var(--accent); }
.cr-expander:hover svg { transform: translateX(2px); }

.cr-body {
  flex: 1; overflow-y: auto;
  padding: 10px 10px 24px;
  display: flex; flex-direction: column;
  gap: 1px;
}

.cr-lesson {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--r);
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left; width: 100%;
  position: relative;
}
.cr-lesson:hover { background: var(--surface); }

.cr-lesson .cr-num {
  color: var(--muted);
  font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  width: 22px; flex: none;
  letter-spacing: 0.02em;
}
.cr-lesson .cr-name {
  flex: 1; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--muted);
}

/* current lesson — left accent bar + darker text, no fill */
.cr-lesson[data-status="current"] {
  background: transparent;
}
.cr-lesson[data-status="current"]::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.cr-lesson[data-status="current"] .cr-num {
  color: var(--ink);
  font-weight: 600;
}
.cr-lesson[data-status="current"] .cr-name {
  color: var(--ink);
  font-weight: 600;
}
.cr-lesson[data-status="current"]:hover { background: var(--surface); }

.cr-lesson[data-status="done"] .cr-name { color: var(--muted); }
.cr-lesson[data-status="done"] .cr-num { color: var(--muted); }

.cr-lesson.cr-parent .cr-name { font-weight: 600; color: var(--ink); }
.cr-lesson .cr-chev {
  margin-left: auto; color: var(--muted);
  display: inline-flex;
  transition: transform 0.2s ease;
}
.cr-lesson .cr-chev.is-open { transform: rotate(180deg); }

.cr-sublist {
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 0 6px 14px;
  margin-left: 6px;
  border-left: 1px solid var(--line-soft);
}
.cr-sublist .cr-lesson { padding-left: 14px; font-weight: 400; font-size: 12.5px; }
.cr-sublist .cr-lesson[data-status="current"]::before {
  left: -1px;
}

/* ----- main lesson area -----
   Left padding is driven by --lesson-pad-left (Tweak-controlled, default 40).
   At narrow widths the right/top/bottom paddings tighten but the left padding
   remains user-controlled so the lesson edge alignment is consistent. */
.main {
  padding: 32px 40px 80px var(--lesson-pad-left, 40px);
  width: 100%;
  max-width: 1180px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .main { padding: 24px 24px 60px var(--lesson-pad-left, 24px); }
}

/* ----- seamless lesson block (video + title + actions) ----- */
.lesson-block { overflow: hidden; margin-bottom: 16px; }

/* Stacked full-width section cards (Objectives, Notes) sit below lesson-block */
.main > .section-card { margin-bottom: 16px; }
.main > .section-card:last-child { margin-bottom: 0; }

.lesson-block .video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #15110E;
  overflow: hidden;
}
.lesson-block .video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* title row with reveal arrow */
.lb-title-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-title-row:hover { background: rgba(30,27,24,0.015); }
.lb-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: pretty;
}
@media (max-width: 700px) { .lb-title { font-size: 18px; } }

.lb-reveal {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  color: var(--ink);
  flex: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s;
}
.lb-title-row:hover .lb-reveal { background: var(--accent-soft); color: var(--accent-text); }
.lb-title-row.is-open .lb-reveal { transform: rotate(180deg); }

/* description reveal */
.lb-desc {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.lb-desc.is-open { grid-template-rows: 1fr; }
.lb-desc-inner {
  overflow: hidden;
  min-height: 0;
}
.lb-desc-inner p {
  margin: 0;
  padding: 16px 22px 4px;
  color: var(--muted);
  font-size: 14px; line-height: 1.6;
  text-wrap: pretty;
  max-width: 70ch;
}

/* lesson-block action row — Previous on left, Favourite + Next on right */
.lb-actions {
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.lb-actions .lb-actions-spacer { flex: 1 1 auto; }

/* card */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

/* video */
.video-card { margin-bottom: 16px; overflow: hidden; }
.video-card .video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #15110E;
  overflow: hidden;
}
.video-card .video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

.video-poster {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 30%, rgba(237,100,59,0.12), transparent 60%),
    linear-gradient(135deg, #1a1612 0%, #2a221c 100%);
}
.video-poster::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.video-poster .play {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(250,247,242,0.96);
  display: grid; place-items: center;
  color: var(--ink);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
  z-index: 1;
}
.video-poster:hover .play { transform: scale(1.05); }
.video-poster .meta-strip {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

/* legacy .lesson-row class — kept for any non-action rows that still use it.
   The lesson-block action row uses .lb-actions exclusively. */
.lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: nowrap;
}
@media (max-width: 560px) {
  .lesson-row { flex-wrap: wrap; gap: 8px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 500; font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-outline { border-color: var(--line); }
.btn-outline:hover { border-color: #D9CCBE; background: var(--surface-2); }
.btn-primary {
  background: var(--accent); color: white;
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 12px -6px rgba(237,100,59,0.5);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-blue {
  background: var(--blue-soft);
  color: var(--blue-deep);
  border: 1px solid var(--blue-tint);
}
.btn-blue:hover { background: #E6F1F5; border-color: #C9DCE3; }

.btn-fav.is-on {
  background: var(--accent-soft);
  border-color: #F4D5C4;
  color: var(--accent-text);
}
.btn-fav.is-on svg { color: var(--accent); }

.btn svg { flex: none; }

/* lower grid: Goals (left) + right column (notes + resources) */
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}
@media (max-width: 980px) {
  .lower-grid { grid-template-columns: 1fr; }
}
.section-card { padding: 20px 22px 20px; }

/* right column: notes on top, resources beneath */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.right-col .notes-card { flex: 1 1 auto; }

/* resources card */
.resources-card .resources-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.resources-card .resources-row .btn { flex: 1 1 auto; min-width: 0; }
.section-card .sc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.section-card h3 {
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}
.section-card .sc-meta {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  color: var(--blue-deep);
}
.section-card .sc-meta strong {
  font-weight: 600;
  color: var(--ink);
}
.section-card .sc-meta.saved-meta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green);
}
.section-card .sc-meta.saved-meta svg { color: var(--green); }

/* objectives — thin progress bar in head */
.section-card .sc-progress {
  margin: -4px 0 18px;
}
.section-card .sc-progress .cr-bar { height: 5px; }

/* goals (objectives) */
.goals { display: flex; flex-direction: column; }
.goal {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.goal:last-child { border-bottom: 0; }

.goal .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  background: var(--surface);
  color: transparent;
  transition: all 0.15s ease;
  flex: none;
}
.goal .check:hover { border-color: #C9B9A5; }
.goal[data-done="true"] .check {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: white;
}

.goal .g-title {
  font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
  min-width: 0;
}
.goal[data-done="true"] .g-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(0,0,0,0.18);
  text-decoration-thickness: 1px;
}
.goal.is-current .g-title { color: var(--accent-text); font-weight: 600; }

/* timestamp jump — single secondary chip */
.goal .g-time-jump {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  flex: none;
}
.goal .g-time-jump:hover {
  background: var(--blue-soft);
  border-color: var(--blue-tint);
  color: var(--blue-deep);
}
.goal .g-time-jump svg { opacity: 0.85; transform: translateY(0.5px); }
.goal.is-current .g-time-jump {
  background: var(--blue-soft);
  border-color: var(--blue-tint);
  color: var(--blue-deep);
}

/* notes */
.notes-card .sc-head { margin-bottom: 12px; }
.notes-card .notes-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
  font-size: 11.5px; font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.005em;
}
.notes-card .notes-status-saved { color: var(--green); }
.notes-card .notes-status-saved svg { color: var(--green); }
.notes-card .notes-status-saving { color: var(--accent-text); }
.notes-card .notes-status-saving .dot-spin { background: var(--accent); }

/* notes */
.notes-card textarea {
  outline: 0; resize: vertical;
  background: var(--bg-panel);
  font-family: var(--font-body);
  font-size: 13.5px; line-height: 1.6;
  color: var(--ink);
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}
.notes-card textarea:focus { border-color: var(--blue); }
.notes-card textarea::placeholder { color: var(--muted); opacity: 0.8; }
.dot-spin {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* mobile top bar */
.mobile-topbar {
  display: none;
  align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.mobile-topbar img { height: 26px; }
.mobile-topbar .mt-spacer { flex: 1; }
.mobile-topbar .mt-btn {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.app-shell[data-mode="mobile"] .global-rail,
.app-shell[data-mode="mobile"] .course-rail,
.app-shell[data-mode="mobile"] .cr-expander { display: none; }
.app-shell[data-mode="mobile"] .mobile-topbar { display: flex; }
.app-shell[data-mode="mobile"] .main { padding: 16px 14px 60px; }
.app-shell[data-mode="mobile"] .lh h1 { font-size: 22px; }
.app-shell[data-mode="mobile"] .lower-grid { grid-template-columns: 1fr; gap: 14px; }

/* drawer overlays */
.drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(30,27,24,0.4);
  backdrop-filter: blur(2px);
  z-index: 30;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 320px; background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 31;
  animation: slide-in 0.22s ease;
  display: flex; flex-direction: column;
}
.drawer.drawer-global { width: 220px; }
@keyframes slide-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-head .dh-title { font-family: var(--font-ui); font-weight: 600; font-size: 14px; }
.drawer-head .dh-close {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--muted);
}
.drawer-head .dh-close:hover { background: var(--bg); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
