/* Woodshed — "inside the piano": warm ebony case, aged ivory, brass hardware,
   felt-red reserved for the downbeat. Tokens per docs/DESIGN.md §4. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-roman.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bravura";
  src: url("/fonts/Bravura.woff2") format("woff2");
  font-display: block;
}

:root {
  --gold: #ecc766;
  --sage: #8fae82;
  --bronze: #9a6b3f;
  --ebony: #191410;
  --ebony-raised: #26201a;
  --ebony-edge: #3a3128;
  --ivory: #eee5d3;
  --ivory-dim: #a2947d;
  --brass: #c9a35c;
  --brass-bright: #e3c284;
  --felt: #b0463c;
  --serif: "Fraunces", "Didot", "Bodoni MT", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }
/* No pull-to-refresh: the pages are shorter than the screen, so every downward
   drag is an overscroll at the top (WSHED-45). Sheets and lists scroll inside
   their own containers and are unaffected. */
html, body { overscroll-behavior-y: none; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, #2a2118 0%, transparent 60%),
    var(--ebony);
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}

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

/* ---------- shell: navbar + tool picker ---------- */

/* Pinned: the header (and whatever a tool puts in its nav slot) never scrolls away. */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 clamp(0.6rem, 2vh, 1.25rem);
  padding: calc(0.6rem + env(safe-area-inset-top, 0)) 1rem 0.6rem;
  background: linear-gradient(180deg, #211a13 0%, #1d1712 70%, rgba(25, 20, 16, 0.9) 100%);
}
.navbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ebony-edge);
}
.navbar-row {
  width: min(100%, 30rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.navbar-row .brand, .navbar-row .tool-picker { flex: none; }
.nav-slot { width: min(100%, 30rem); display: flex; justify-content: center; }
.nav-slot:empty { display: none; }

.wordmark {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 550;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--ivory);
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ivory-dim);
  margin-top: 0.1rem;
}

.tool-picker { position: relative; margin-top: 0.2rem; }

.picker-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font: 500 0.95rem var(--sans);
  color: var(--ivory);
  background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
}
.picker-btn .chevron { color: var(--ivory-dim); font-size: 0.75em; }
.picker-btn[aria-expanded="true"] { border-color: var(--brass); }

/* One fixed box per glyph so labels line up whatever the icon's natural size. */
.picker-glyph {
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  font-size: 1.1rem;
  line-height: 1;
}
.picker-glyph svg, .picker-glyph .ic { width: 1.1rem; height: 1.1rem; }

.picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 11rem;
  background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge);
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 20;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  font: 500 0.95rem var(--sans);
  color: var(--ivory);
  background: transparent;
  border: none;
  padding: 0.65rem 1rem;
  cursor: pointer;
}
.picker-item:hover { background: var(--ebony-edge); }
.picker-item[aria-checked="true"] { color: var(--brass); }
.picker-rule { height: 1px; background: var(--ebony-edge); margin: 0.3rem 0.6rem; }

.noscript { color: var(--ivory-dim); text-align: center; max-width: 26rem; }

#tool-root { margin-block: auto; width: 100%; display: flex; justify-content: center; padding: 0 1rem 1.5rem; }

/* ---------- metronome ---------- */

.metronome {
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.5vh, 1.4rem);
}

/* pendulum — the signature; angle is set from JS off the audio clock */
.pendulum { width: min(78%, 17rem); overflow: visible; }
.pendulum .arc {
  fill: none;
  stroke: var(--ebony-edge);
  stroke-width: 1.5;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}
.pendulum .arm line {
  stroke: var(--brass);
  stroke-width: 3;
  stroke-linecap: round;
}
.pendulum .bob {
  fill: var(--brass);
  transition: fill 90ms linear;
}
.pendulum .bob.down { fill: var(--felt); }
.pendulum .pivot { fill: var(--ivory-dim); }

/* beat dots */
.beat-dots { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.dot {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid var(--ivory-dim);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 90ms ease-out, background 90ms, border-color 90ms, opacity 90ms;
}
.dot.accent { background: var(--felt); border-color: var(--felt); }
.dot.normal { border-color: var(--ivory); }
.dot.muted { opacity: 0.3; }
.dot.now { transform: scale(1.45); }

/* tempo */
.tempo { text-align: center; }
.bpm {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: clamp(4.5rem, 24vw, 7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}
.marking {
  font-family: var(--serif);
  color: var(--ivory-dim);
  font-size: 1.1rem;
  margin-top: 0.25rem;
}
.marking em { font-style: italic; color: var(--brass); font-size: 1.25rem; }

.tempo-adjust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.nudge {
  font: 600 0.85rem var(--sans);
  color: var(--ivory-dim);
  background: transparent;
  border: 1px solid var(--ebony-edge);
  border-radius: 999px;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.nudge:hover { color: var(--brass); border-color: var(--brass); }
.nudge:active { background: var(--ebony-raised); }

/* --- app chrome: icon buttons, round transport, view headers -------------- */
.ic { width: 1.35rem; height: 1.35rem; display: block; }

.icon-btn {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--ebony-edge);
  background: transparent;
  color: var(--ivory-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.icon-btn:hover { color: var(--brass); border-color: var(--brass); }
.icon-btn[aria-pressed="true"] { color: var(--brass); border-color: var(--brass); }
.icon-btn[aria-pressed="false"] { color: var(--ivory-dim); }
.icon-btn[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 50%;
  height: 1.6px;
  background: currentColor;
  transform: rotate(-45deg);
  border-radius: 1px;
}

.btn-round {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--brass-bright), var(--brass));
  color: var(--ebony);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.btn-round .ic { width: 1.7rem; height: 1.7rem; }
.btn-round .ic-play { margin-left: 0.2rem; } /* optical centering */
.btn-round:hover { filter: brightness(1.06); }
.btn-round.running {
  background: transparent;
  border: 2px solid var(--brass);
  color: var(--brass);
  box-shadow: none;
}

.ss-head {
  width: 100%;
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.6rem;
}
.ss-head-title {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ivory-dim);
  font-size: 0.95rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-chip {
  justify-self: end;
  color: var(--brass);
  font-size: 0.9rem;
  white-space: nowrap;
}

.tap .ic { width: 1.05rem; height: 1.05rem; }
.tap { display: inline-flex; align-items: center; gap: 0.45rem; }

input[type="range"] { accent-color: var(--brass); flex: 1; min-width: 4rem; }
#bpm-slider { width: 8rem; }

/* parameter row */
.params {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  justify-content: center;
  align-items: center;
}
.param {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.param select {
  font: 500 0.95rem var(--sans);
  color: var(--ivory);
  background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge);
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
}
.segmented { display: flex; border: 1px solid var(--ebony-edge); border-radius: 0.5rem; overflow: hidden; }
.segmented button {
  font: 500 0.95rem var(--sans);
  color: var(--ivory-dim);
  background: var(--ebony-raised);
  border: none;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--ebony-edge); }
.segmented button[aria-pressed="true"] { color: var(--ebony); background: var(--brass); }

/* transport */
.transport { display: flex; align-items: center; gap: 1rem; margin-top: 0.4rem; }
.start {
  font: 600 1.1rem var(--sans);
  letter-spacing: 0.04em;
  color: var(--ebony);
  background: linear-gradient(180deg, var(--brass-bright), var(--brass));
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2.8rem;
  cursor: pointer;
  transition: filter 120ms;
}
.start:hover { filter: brightness(1.06); }
.start.running {
  background: transparent;
  border: 2px solid var(--brass);
  color: var(--brass);
  padding: calc(0.85rem - 2px) calc(2.8rem - 2px);
}
.tap {
  font: 500 0.95rem var(--sans);
  color: var(--ivory-dim);
  background: transparent;
  border: 1px solid var(--ebony-edge);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
}
.tap:active { color: var(--brass); border-color: var(--brass); }

/* ---------- pitch pipe ---------- */

.pitchpipe {
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 1.6rem);
}

.pipe-ring {
  --ring: min(82vw, 21rem);
  position: relative;
  width: var(--ring);
  height: var(--ring);
  border-radius: 50%;
  border: 1px solid var(--ebony-edge);
  background: radial-gradient(circle at 50% 42%, #241d16 0%, var(--ebony) 72%);
}

.pipe-note {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.7rem;
  height: 2.7rem;
  margin: -1.35rem;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ivory);
  background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge);
  cursor: pointer;
  transform: rotate(calc(var(--i) * 30deg))
             translateY(calc(var(--ring) / -2 + 1.8rem))
             rotate(calc(var(--i) * -30deg));
  transition: background 100ms, color 100ms, border-color 100ms;
}
.pipe-note.black { color: var(--ivory-dim); background: var(--ebony); }
.pipe-note.active { background: var(--brass); border-color: var(--brass); color: var(--ebony); }
.pipe-note:hover:not(.active) { border-color: var(--brass); }

.pipe-center {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-align: center;
}
.pipe-note-name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: 2rem;
  line-height: 1.1;
}
.pipe-freq {
  font-family: var(--serif);
  color: var(--ivory-dim);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.pipe-state {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-top: 0.35rem;
}
.pipe-ring.sounding .pipe-note-name { color: var(--brass); }
.pipe-ring.sounding .pipe-center { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

#pp-a4 { width: 6.5rem; }
#pp-a4-out { font-variant-numeric: tabular-nums; color: var(--ivory); min-width: 2.6rem; }

/* ---------- tuner ---------- */

.tuner {
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.7rem, 2vh, 1.1rem);
}

.dial { width: min(82%, 19rem); overflow: visible; }
.dial .arc {
  fill: none;
  stroke: var(--ebony-edge);
  stroke-width: 1.5;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}
.dial #tn-ticks line { stroke: var(--ebony-edge); stroke-width: 2; stroke-linecap: round; }
.dial #tn-ticks line.center { stroke: var(--brass); }
.dial-label { fill: var(--ivory-dim); font-size: 13px; }
.dial #tn-needle line {
  stroke: var(--ivory-dim);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke 120ms;
}
.dial #tn-needle.intune line { stroke: var(--brass); }
.dial #tn-needle.far line { stroke: var(--felt); }
.dial .pivot { fill: var(--ivory-dim); }

.tuner-note {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: 2.6rem;
  line-height: 1.1;
  transition: color 120ms;
}
.tuner-note.intune { color: var(--brass); }

.tuner-read {
  font-family: var(--serif);
  color: var(--ivory-dim);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  min-height: 1.4rem;
}

#tn-a4 { width: 6.5rem; }
#tn-a4-out { font-variant-numeric: tabular-nums; color: var(--ivory); min-width: 2.6rem; }

.tuner-status {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ivory-dim);
  min-height: 1rem;
  text-align: center;
}

/* ---------- staff (lib/staff) ---------- */

.staff-svg { display: block; user-select: none; }
.staff-svg text { font-family: "Bravura"; fill: var(--ivory); }
.staff-svg .sline { stroke: #7d7161; stroke-width: 1.1; }
.staff-svg .sline-bar { fill: #7d7161; }
.staff-svg .stem, .staff-svg .beam { fill: var(--ivory); }
.staff-svg .tie { fill: none; stroke: var(--ivory); stroke-width: 1.4; }
.staff-svg .halo { fill: transparent; transition: fill 150ms; }

/* "current" is the un-graded fill while a note sounds: a brighter warm white,
   deliberately nothing like the gold tier. Position itself is the n-here halo. */
.note.n-current .head, .note.n-current .head-part, .note.n-current .stem, .note.n-current .rest { fill: #fff8ea; }
.note.n-nailed .head, .note.n-nailed .head-part, .note.n-nailed .stem { fill: var(--gold); }
.note.n-nailed .halo { fill: rgba(236, 199, 102, 0.14); animation: shimmer 2s ease-in-out infinite; }
.note.n-good .head, .note.n-good .head-part, .note.n-good .stem { fill: var(--sage); }
.note.n-rough .head, .note.n-rough .head-part, .note.n-rough .stem { fill: var(--bronze); }
.note.n-missed .head, .note.n-missed .head-part, .note.n-missed .stem { fill: var(--felt); }

/* Position marker — orthogonal to the grade classes, defined after them so the
   ivory "you are here" halo wins while the note is current. */
.note.n-here .halo { fill: rgba(238, 229, 211, 0.22); animation: breathe 1.1s ease-in-out infinite; }

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .note.n-here .halo { animation: none; }
}

/* ---------- sight singing ---------- */

.sightsinging {
  width: min(100%, 44rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.8rem, 2vh, 1.2rem);
}

.ss-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  justify-content: center;
  align-items: center;
}

.ss-meta {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ivory-dim);
  font-size: 0.95rem;
  text-align: center;
}

.ss-staffcard {
  width: 100%;
  background: #1e1913;
  border: 1px solid var(--ebony-edge);
  border-radius: 0.8rem;
  padding: 0.9rem 1rem;
}

.ss-results { text-align: center; }
.ss-score {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 3rem;
  line-height: 1.1;
  color: var(--gold);
}
.ss-tiers { color: var(--ivory-dim); font-size: 0.9rem; margin-top: 0.25rem; }
.ss-tiers .tier::before {
  content: "●";
  margin-right: 0.3rem;
  font-size: 0.8em;
}
.ss-tiers .tier-nailed::before { color: var(--gold); }
.ss-tiers .tier-good::before { color: var(--sage); }
.ss-tiers .tier-rough::before { color: var(--bronze); }
.ss-tiers .tier-missed::before { color: var(--felt); }

/* while an exercise runs: settings give way to the pitch lane */
.ss-running .ss-controls { display: none; }
.ss-running #ss-hear { display: none; }

.start { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }
.start .ic, .tap .ic { width: 1.05rem; height: 1.05rem; }
.start, .tap { white-space: nowrap; }

/* whenever results are up (interstitial or summary), their buttons take over */
.ss-results-open #ss-runner .transport, .ss-results-open #ss-runner .tuner-status { display: none; }

/* live-grade pop: a quick satisfying bounce on the notehead group */
.staff-svg .note { transform-box: fill-box; transform-origin: center; }
.note.n-pop { animation: notepop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes notepop {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* pitch lane — the horizontal tuner */
.pitch-lane {
  position: relative;
  width: 100%;
  background: #1e1913;
  border: 1px solid var(--ebony-edge);
  border-radius: 0.8rem;
  padding: 0.3rem 0.5rem;
}
.pitch-lane svg { display: block; width: 100%; height: 72px; }
.lane-mark {
  position: absolute;
  left: 0.6rem;
  color: var(--ivory-dim);
  font-size: 0.8rem;
  line-height: 1;
}
.lane-sharp { top: 0.45rem; }
.lane-flat { bottom: 0.45rem; }
.lane-guide {
  stroke: var(--ebony-edge);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}
.lane-center {
  stroke: var(--ivory-dim);
  stroke-width: 1.6;
  transition: stroke 120ms;
}
.lane-dot { fill: var(--ivory-dim); transition: fill 120ms; }
.lane-tail { fill: var(--ivory-dim); }
.pitch-lane.zone-nailed .lane-center { stroke: var(--gold); filter: drop-shadow(0 0 4px rgba(236, 199, 102, 0.9)); }
.pitch-lane.zone-nailed .lane-dot { fill: var(--gold); filter: drop-shadow(0 0 7px rgba(236, 199, 102, 1)); }
.pitch-lane.zone-nailed .lane-tail { fill: var(--gold); }
.pitch-lane.zone-good .lane-dot { fill: var(--sage); filter: drop-shadow(0 0 4px rgba(143, 174, 130, 0.8)); }
.pitch-lane.zone-good .lane-tail { fill: var(--sage); }
.pitch-lane.zone-rough .lane-dot { fill: var(--bronze); }
.pitch-lane.zone-rough .lane-tail { fill: var(--bronze); }
.pitch-lane.zone-missed .lane-dot { fill: var(--felt); }
.pitch-lane.zone-missed .lane-tail { fill: var(--felt); }

/* ---------- sight singing v2: landing / campaign map / challenge ---------- */

.ss-home {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  min-height: 55vh;
}
.ss-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(17rem, 80vw);
  padding: 2rem 1.4rem;
  background: #1e1913;
  border: 1px solid var(--ebony-edge);
  border-radius: 1rem;
  color: var(--ivory);
  cursor: pointer;
  transition: border-color 150ms, transform 150ms;
}
.ss-mode-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.ss-mode-glyph { font-size: 2rem; color: var(--brass); }
.ss-mode-name { font-family: var(--serif); font-size: 1.5rem; }
.ss-mode-line { color: var(--ivory-dim); font-size: 0.95rem; }
.ss-mode-sub { color: var(--brass); font-size: 0.85rem; margin-top: 0.4rem; }

.ss-map { align-items: stretch; }
.ss-book {
  background: #1e1913;
  border: 1px solid var(--ebony-edge);
  border-radius: 1rem;
  padding: 1.1rem 1.3rem;
}
.ss-book h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; }
.ss-blurb { color: var(--ivory-dim); font-size: 0.9rem; margin: 0.2rem 0 0.9rem; }
.ss-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  align-items: flex-start;
}
.ss-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: 2px solid var(--ebony-edge);
  background: var(--ebony);
  color: var(--ivory);
  cursor: pointer;
  justify-content: center;
  transition: border-color 150ms;
}
.ss-node:nth-child(even) { transform: translateY(0.7rem); } /* gentle path wave */
.ss-node-num { font-family: var(--serif); font-size: 1.05rem; line-height: 1; }
.ss-node-stars { font-size: 0.55rem; letter-spacing: 0.08em; color: var(--gold); line-height: 1; }
.ss-node.locked { opacity: 0.35; cursor: default; }
.ss-node.current {
  border-color: var(--brass);
  box-shadow: 0 0 10px rgba(201, 163, 92, 0.45);
}
.ss-node.done { border-color: var(--gold); }
.ss-node:not(.locked):hover { border-color: var(--brass-bright); }

.ss-panel {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--ebony-edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.ss-panel-title { font-family: var(--serif); font-style: italic; }
.ss-panel-list { list-style: none; text-align: center; font-size: 0.9rem; }
.ss-panel-list li { margin: 0.15rem 0; }
.ss-dim { color: var(--ivory-dim); }

.ss-config .ss-controls { flex-direction: column; gap: 0.8rem; }

.ss-summary-list { list-style: none; text-align: center; margin: 0.5rem 0; }
.ss-summary-list li { margin: 0.2rem 0; }

/* the star-award moment: teacher's stickers stamped on one by one */
.ss-stars { display: flex; justify-content: center; gap: 0.6rem; font-size: 2rem; margin: 0.3rem 0; }
.ss-stars .star { color: var(--ebony-edge); }
.ss-stars .star.earned {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(236, 199, 102, 0.8);
  opacity: 0;
  animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-18deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .pendulum .bob, .start, .pipe-note { transition: none; }
  .pipe-ring.sounding .pipe-center { animation: none; }
  .note.n-pop { animation: none; }
  .note.n-nailed .halo { animation: none; }
  .pitch-lane .lane-center, .pitch-lane .lane-dot { filter: none; }
  .ss-stars .star.earned { animation: none; opacity: 1; }
  .ss-mode-card:hover { transform: none; }
  .ss-node:nth-child(even) { transform: none; }
}

/* ---------- shell: session chip (the Logbook's clock, on every tool) ---------- */

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: center;
  margin-left: auto;
  margin-right: 0.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--ebony-edge);
  border-radius: 999px;
  color: var(--brass);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 14rem;
}
.session-chip[hidden] { display: none; }
.session-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 6px var(--brass);
  animation: chip-pulse 1.6s ease-in-out infinite;
  flex: none;
}
.session-dot.t-technique { background: var(--ivory-dim); box-shadow: 0 0 6px var(--ivory-dim); }
.session-dot.t-other { background: var(--sage); box-shadow: 0 0 6px var(--sage); }
.session-goal {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.session-goal:empty { display: none; }
/* On a phone the row can't fit brand + chip + picker; the type-coloured dot carries the goal. */
@media (max-width: 30rem) { .session-goal { display: none; } }
@keyframes chip-pulse { 50% { opacity: 0.4; } }

/* ---------- logbook ---------- */

/* The Logbook is a document, not an instrument: anchor it to the top so the
   today · goals · history strip never moves as content height changes. */
#tool-root.top-anchored { margin-block: 0 auto; align-items: flex-start; }
.logbook {
  width: min(100%, 30rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  min-height: 60vh;
}
.lb-strip { align-self: center; }
.lb-strip button { padding: 0.45rem 1.2rem; min-height: 2.5rem; }

.lb-dim { color: var(--ivory-dim); }
.lb-center { text-align: center; }
.lb-sect {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.lb-sect::after { content: ""; flex: 1; height: 1px; background: var(--ebony-edge); }
.lb-empty { color: var(--ivory-dim); font-size: 0.95rem; line-height: 1.45; }
.lb-empty em { color: var(--ivory); font-style: italic; font-family: var(--serif); }
.lb-link { background: none; border: none; color: var(--brass); font: 500 0.9rem var(--sans); cursor: pointer; padding: 0.3rem 0; }
.lb-link:hover { text-decoration: underline; }
.lb-danger { color: var(--felt); }
.lb-foot { display: flex; gap: 1.2rem; justify-content: center; margin-top: 0.6rem; font-size: 0.85rem; }
.lb-err { color: var(--felt); font-size: 0.85rem; min-height: 1.1em; margin: 0.2rem 0 0; }
.lb-err:empty { display: none; }
.lb-back { padding: 0.5rem 0.85rem; }
.lb-date { font-family: var(--serif); font-style: italic; color: var(--ivory-dim); font-size: 1rem; text-align: center; }

/* goal type: glyph always present, colour never the only signal */
.lb-type { font-style: normal; font-size: 0.75em; line-height: 1; display: inline-block; width: 1.1em; text-align: center; flex: none; }
.t-piece { color: var(--brass); }
.t-technique { color: var(--ivory-dim); }
.t-other { color: var(--sage); }
.lb-auto { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ivory-dim); border: 1px solid var(--ebony-edge); border-radius: 4px; padding: 0 0.3rem; }

/* inputs + chips */
.lb-input, .lb-select {
  width: 100%; font: 400 1rem var(--sans); color: var(--ivory);
  background: var(--ebony-raised); border: 1px solid var(--ebony-edge); border-radius: 0.6rem; padding: 0.6rem 0.8rem;
}
.lb-input:focus { outline: none; border-color: var(--brass); }
.lb-input::placeholder { color: var(--ivory-dim); opacity: 0.8; }
.lb-input-lg { font-size: 1.15rem; padding: 0.75rem 0.9rem; }
input.lb-search { -webkit-appearance: none; appearance: none; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.lb-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: 500 0.85rem var(--sans); color: var(--ivory); background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer; user-select: none; -webkit-user-select: none;
  min-height: 2.2rem;
}
.lb-chip.on { color: var(--ebony); background: var(--brass); border-color: var(--brass); }
.lb-chip.on .lb-type { color: var(--ebony); }
.lb-stepper { display: flex; align-items: center; justify-content: center; gap: 0.8rem; margin: 0.4rem 0; }
.lb-minutes { font-family: var(--serif); font-size: 2rem; font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: center; }
.lb-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem);
  background: var(--ebony-raised); color: var(--ivory); border: 1px solid var(--brass);
  border-radius: 999px; padding: 0.5rem 1rem; font-size: 0.9rem; opacity: 0; pointer-events: none;
  transition: opacity 150ms, transform 150ms; z-index: 60; max-width: 90vw; text-align: center;
}
.lb-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- sheets: bottom sheet on phones, centred card on desktop ---- */
.lb-sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(12, 9, 6, 0.55); opacity: 0; transition: opacity 200ms; }
.lb-sheet-wrap.open .lb-backdrop { opacity: 1; }
.lb-sheet {
  position: relative; width: 100%; max-height: 88vh; display: flex; flex-direction: column;
  background: #1e1913; border: 1px solid var(--ebony-edge); border-bottom: none;
  border-radius: 1.1rem 1.1rem 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%); animation: sheet-up 260ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  padding-bottom: env(safe-area-inset-bottom);
}
.lb-sheet-wrap.closing .lb-sheet { animation: sheet-down 220ms ease-in forwards; }
.lb-sheet-wrap.closing .lb-backdrop { opacity: 0; }
@keyframes sheet-up { to { transform: translateY(0); } }
@keyframes sheet-down { from { transform: translateY(0); } to { transform: translateY(100%); } }
.lb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.9rem 1rem 0.4rem 1.1rem; }
.lb-sheet-title { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0; }
.lb-close { background: none; border: none; color: var(--ivory-dim); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.5rem; min-width: 2.75rem; min-height: 2.75rem; }
.lb-close:hover { color: var(--ivory); }
.lb-sheet-body { padding: 0.2rem 1rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.7rem; }
@media (min-width: 40rem) {
  .lb-sheet-wrap { align-items: center; }
  .lb-sheet { width: min(92vw, 30rem); max-height: 80vh; border-radius: 1rem; border-bottom: 1px solid var(--ebony-edge); transform: translateY(0) scale(0.96); opacity: 0; animation: card-in 200ms ease-out forwards; }
  .lb-sheet-wrap.closing .lb-sheet { animation: card-out 160ms ease-in forwards; }
  @keyframes card-in { to { transform: scale(1); opacity: 1; } }
  @keyframes card-out { from { transform: scale(1); opacity: 1; } to { transform: scale(0.96); opacity: 0; } }
}

/* picker */
.lb-pick-list { display: flex; flex-direction: column; min-height: 6rem; max-height: 52vh; overflow-y: auto; margin: 0 -0.3rem; }
.lb-pick-sect { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory-dim); padding: 0.7rem 0.6rem 0.25rem; }
.lb-pick-row {
  display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; background: none; border: none; border-radius: 0.6rem;
  padding: 0.7rem 0.6rem; color: var(--ivory); font: 500 1rem var(--sans); cursor: pointer; min-height: 3rem;
}
.lb-pick-row[aria-selected="true"], .lb-pick-row:hover { background: var(--ebony-raised); }
.lb-pick-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pick-sub { color: var(--ivory-dim); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-pick-dim { color: var(--ivory-dim); }
.lb-pick-now { opacity: 0.55; }
.lb-pick-new { color: var(--brass); border-top: 1px dashed var(--ebony-edge); border-radius: 0; margin-top: 0.3rem; }
.lb-pick-new .lb-type { color: var(--brass); font-size: 1.1em; }
.lb-pick-empty { padding: 0.6rem; }
.lb-pick-foot { display: flex; justify-content: flex-end; }
.lb-pick-goal { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; text-align: center; margin: 0.2rem 0; }
.lb-minute-chips { justify-content: center; }

/* creation sheet */
.lb-typechips { display: flex; gap: 0.5rem; }
.lb-typechip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  font: 500 0.85rem var(--sans); color: var(--ivory); background: var(--ebony-raised);
  border: 1px solid var(--ebony-edge); border-radius: 0.8rem; padding: 0.7rem 0.4rem; cursor: pointer; min-height: 3.6rem;
}
.lb-typechip .lb-type { font-size: 1.2rem; }
.lb-typechip[aria-checked="true"] { border-color: var(--brass); background: #2c251d; box-shadow: inset 0 0 0 1px var(--brass); }
.lb-examples { font-family: var(--serif); font-style: italic; color: var(--ivory-dim); text-align: center; font-size: 0.95rem; margin: 0; min-height: 1.3em; }
.lb-create-form { display: flex; flex-direction: column; gap: 0.5rem; }

/* notes: the button, the thread, the modal */
.lb-addnote {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; align-self: center;
  font: 600 0.95rem var(--sans); color: var(--brass); background: transparent;
  border: 2px solid var(--brass); border-radius: 999px; padding: 0.65rem 1.4rem; min-height: 3rem; cursor: pointer;
  transition: transform 90ms, background 120ms; margin: 0.1rem 0 0.5rem;
}
.lb-addnote:hover { background: rgba(201, 163, 92, 0.1); }
.lb-addnote:active { transform: scale(0.95); background: rgba(201, 163, 92, 0.2); }
.lb-addnote-glyph { font-size: 1.1rem; line-height: 1; }
.lb-notemodal { display: flex; flex-direction: column; gap: 0.6rem; }
.lb-notearea { resize: none; line-height: 1.45; font-family: var(--serif); font-size: 1.05rem; min-height: 6rem; padding: 0.8rem 0.9rem; }
.lb-modal-acts { display: flex; justify-content: flex-end; gap: 0.6rem; }
.lb-modal-cancel { font: 500 0.95rem var(--sans); color: var(--ivory-dim); background: none; border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.65rem 1.2rem; min-height: 3rem; cursor: pointer; }
.lb-modal-cancel:hover { color: var(--ivory); border-color: var(--ivory-dim); }
.lb-modal-save { font: 600 0.95rem var(--sans); color: var(--ebony); background: linear-gradient(180deg, var(--brass-bright), var(--brass)); border: none; border-radius: 999px; padding: 0.65rem 1.5rem; min-height: 3rem; cursor: pointer; transition: transform 90ms; }
.lb-modal-save:active, .lb-modal-save.lb-saved { transform: scale(0.94); }
.lb-noteitem.lb-stamp { box-shadow: inset 0 0 0 1px var(--brass); animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both, brass-glow 600ms ease-out; }
.lb-hero-note.lb-stamp { animation: brass-glow 600ms ease-out; border-radius: 0.5rem; }
.lb-notes { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.lb-noteitem { display: grid; grid-template-columns: 5rem 1fr; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--ebony-edge); }
.lb-noteday { color: var(--ivory-dim); font-size: 0.75rem; padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.lb-notebody { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.lb-lastnote { font-family: var(--serif); font-style: italic; line-height: 1.4; margin: 0; }
.lb-lastnote .lb-dim { font-family: var(--sans); font-style: normal; font-size: 0.75rem; }

/* ---- Today: hero ---- */
.lb-hero {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
  background: #1e1913; border: 1px solid var(--ebony-edge); border-radius: 1rem; padding: 1.1rem 1rem 1rem;
}
.lb-hero.idle { flex-direction: row; justify-content: center; gap: 1rem; padding: 0.9rem 1rem; }
.lb-hero-play {
  width: 3.6rem; height: 3.6rem; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: linear-gradient(180deg, var(--brass-bright), var(--brass)); color: var(--ebony);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(201, 163, 92, 0.25); transition: transform 120ms;
}
.lb-hero-play:active { transform: scale(0.94); }
.lb-hero-play .ic { width: 1.5rem; height: 1.5rem; margin-left: 0.2rem; }
.lb-hero-total { font-family: var(--serif); font-size: 1.2rem; color: var(--ivory-dim); text-align: left; }
.lb-hero-total b { color: var(--ivory); font-weight: 500; font-size: 1.5rem; }
.lb-hero-type { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; }
.lb-hero-goal {
  background: none; border: none; cursor: pointer; color: var(--ivory);
  font: 600 1.25rem var(--sans); line-height: 1.2; padding: 0.1rem 0.2rem; max-width: 100%;
}
.lb-hero-goal.lb-arriving { opacity: 0; }
.lb-hero-elapsed { font-family: var(--serif); font-size: 3.2rem; font-variant-numeric: tabular-nums; line-height: 1; margin: 0.25rem 0 0.1rem; color: var(--ivory); }
.lb-hero-sub { color: var(--ivory-dim); font-size: 0.85rem; }
.lb-hero-sub b { color: var(--ivory); font-weight: 500; font-variant-numeric: tabular-nums; }
.lb-hero-note { width: 100%; margin-top: 0.5rem; border-top: 1px dashed var(--ebony-edge); padding-top: 0.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.lb-hero-note-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; }
.lb-hero-note-head .lb-link { padding: 0.35rem 0.2rem; min-height: 2.2rem; }
.lb-hero-note-body {
  background: none; border: none; cursor: pointer; text-align: left; padding: 0; color: var(--ivory);
  font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;
}
.lb-hero-acts { display: flex; gap: 0.7rem; margin-top: 0.8rem; width: 100%; justify-content: center; }
.lb-stop, .lb-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; cursor: pointer;
  font: 600 0.95rem var(--sans); border-radius: 999px; padding: 0.7rem 1.3rem; min-height: 3rem; min-width: 7.5rem;
}
.lb-stop { background: transparent; border: 2px solid var(--brass); color: var(--brass); }
.lb-stop .ic { width: 1rem; height: 1rem; }
.lb-switch { background: var(--ebony-raised); border: 1px solid var(--ebony-edge); color: var(--ivory); }
.lb-switch:hover { border-color: var(--brass); }

/* week strip */
.lb-week { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; justify-content: center; flex-wrap: wrap; }
.lb-week i { width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1px solid var(--ivory-dim); display: block; }
.lb-week i.on { background: var(--ivory); border-color: var(--ivory); }
.lb-week i.gold { background: var(--gold); border-color: var(--gold); }
.lb-week i.today { outline: 1px solid var(--brass); outline-offset: 2px; }
.lb-week .lb-dim { margin-left: 0.4rem; }
.lb-week-total b { color: var(--ivory); font-weight: 500; font-variant-numeric: tabular-nums; }

/* practiced-today rows (also History's day report) */
.lb-today-list { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.lb-trow { border-bottom: 1px solid var(--ebony-edge); }
.lb-trow-main {
  display: grid; grid-template-columns: 1.4rem 1fr auto auto; align-items: center; gap: 0.5rem;
  width: 100%; background: none; border: none; text-align: left; color: var(--ivory);
  padding: 0.75rem 0.2rem; cursor: pointer; font: 500 1rem var(--sans); min-height: 3rem;
}
.lb-trow-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-trow-min { font-family: var(--serif); font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--ivory); }
.lb-trow.live .lb-type { animation: breathe 1.6s ease-in-out infinite; }
.lb-trow.live .lb-trow-min { color: var(--brass); }

/* ---- Goals: library ---- */
.lb-libhead { display: flex; gap: 0.5rem; align-items: center; }
.lb-addgoal {
  flex: none; font: 600 0.9rem var(--sans); color: var(--ebony); white-space: nowrap;
  background: linear-gradient(180deg, var(--brass-bright), var(--brass)); border: none; border-radius: 999px; padding: 0.6rem 1.1rem; cursor: pointer; min-height: 2.75rem;
}
.lb-filters { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lb-filterchips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.lb-filterchips .lb-chip { padding: 0.3rem 0.7rem; font-size: 0.8rem; min-height: 2rem; }
.lb-sort { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.lb-sort select { font: 500 0.85rem var(--sans); color: var(--ivory); background: var(--ebony-raised); border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.3rem 0.6rem; }
.lb-list { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.lb-row { border-bottom: 1px solid var(--ebony-edge); }
.lb-row-main { display: grid; grid-template-columns: 1.4rem 1fr; align-items: center; gap: 0.5rem; width: 100%; background: none; border: none; padding: 0.65rem 0.2rem; cursor: pointer; text-align: left; color: var(--ivory); min-height: 3rem; }
.lb-row-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.lb-row-title { font: 600 1rem var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row-sub { color: var(--ivory-dim); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.lb-details summary { cursor: pointer; color: var(--ivory-dim); font-size: 0.85rem; padding: 0.5rem 0; }

/* ---- goal page ---- */
.lb-goalpage { gap: 0.8rem; }
.lb-gp-head { grid-template-columns: 2.75rem 1fr auto; }
.lb-gp-type { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--ebony-raised); border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.35rem 0.7rem; font: 500 0.78rem var(--sans); color: var(--ivory); cursor: pointer; min-height: 2.2rem; }
.lb-gp-type:disabled { cursor: default; opacity: 0.8; }
.lb-gp-name { width: 100%; background: transparent; border: none; border-bottom: 1px solid transparent; color: var(--ivory); font: 500 1.5rem var(--serif); text-align: center; padding: 0.2rem 0.4rem; }
.lb-gp-name:hover, .lb-gp-name:focus { border-bottom-color: var(--ebony-edge); outline: none; }
.lb-gp-name-static { font: 500 1.5rem var(--serif); text-align: center; margin: 0; }
.lb-gp-builtin { font-size: 0.85rem; }
.lb-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; justify-content: center; color: var(--ivory-dim); font-size: 0.85rem; }
.lb-stats b { color: var(--ivory); font-family: var(--serif); font-weight: 500; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lb-gp-acts { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.lb-gp-acts .start { flex: 1 1 100%; max-width: 22rem; }
.lb-tempo { font-family: var(--serif); font-variant-numeric: tabular-nums; color: var(--brass); border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.15rem 0.55rem; text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
.lb-tempo:hover { border-color: var(--brass); }
.lb-spark { display: block; width: 100%; height: 64px; margin: 0.3rem 0 0.1rem; }
.lb-spark-target { stroke: var(--ebony-edge); stroke-dasharray: 3 4; }
.lb-spark-line { fill: none; stroke: var(--brass); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.lb-spark-fill { fill: var(--brass); opacity: 0.12; }
.lb-spark-last { fill: var(--gold); }
.lb-spark-cap { display: flex; justify-content: space-between; align-items: center; color: var(--ivory-dim); font-size: 0.75rem; font-variant-numeric: tabular-nums; margin-bottom: 0.2rem; }
.lb-spark-cap b { color: var(--ivory); }
.lb-seglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lb-segday { display: grid; grid-template-columns: 5rem 1fr; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px dashed var(--ebony-edge); }
.lb-segday-h { color: var(--ivory-dim); font-size: 0.75rem; }
.lb-segs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lb-seg { font: 500 0.82rem var(--sans); color: var(--ivory); background: var(--ebony-raised); border: 1px solid var(--ebony-edge); border-radius: 999px; padding: 0.25rem 0.6rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.lb-seg small { color: var(--brass); }
.lb-seg.live { border-color: var(--brass); color: var(--brass); }

/* ---- history ---- */
.lb-month-head { grid-template-columns: 2.75rem 1fr 2.75rem; }
.lb-month-title { font-family: var(--serif); font-size: 1.2rem; text-align: center; }
.lb-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; max-width: 20rem; align-self: center; width: 100%; }
.lb-cal-h { text-align: center; font-size: 0.65rem; letter-spacing: 0.1em; color: var(--ivory-dim); }
.lb-day { aspect-ratio: 1; background: none; border: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.lb-day i { width: 78%; height: 78%; border-radius: 50%; background: var(--ebony-raised); transform: scale(0.5); transition: transform 120ms; }
.lb-day.on i { background: var(--ivory); transform: scale(var(--sz)); }
.lb-day.gold i { background: var(--gold); box-shadow: 0 0 8px rgba(236, 199, 102, 0.5); }
.lb-day.today { outline: 1px solid var(--brass); outline-offset: -2px; }
.lb-day.sel { background: var(--ebony-raised); }
.lb-totals { text-align: center; color: var(--ivory-dim); font-size: 0.9rem; }
.lb-totals b { color: var(--ivory); font-family: var(--serif); font-weight: 500; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lb-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.lb-bar { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto; align-items: center; gap: 0.6rem; }
.lb-bar-name { display: flex; align-items: center; gap: 0.4rem; background: none; border: none; color: var(--ivory); font: 500 0.9rem var(--sans); text-align: left; padding: 0.3rem 0; cursor: pointer; min-width: 0; }
.lb-bar-name span, .lb-bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-bar-track { height: 0.5rem; background: var(--ebony-raised); border-radius: 999px; overflow: hidden; }
.lb-bar-fill { display: block; height: 100%; background: var(--brass); border-radius: 999px; }
.lb-bar-fill.t-technique { background: var(--ivory-dim); }
.lb-bar-fill.t-other { background: var(--sage); }
.lb-bar-min { font-family: var(--serif); font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--ivory); white-space: nowrap; }

/* ---- flourishes (docs/LOGBOOK_V2_DESIGN.md §6) ---- */
.lb-stamp { animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.lb-trow.lb-stamp, .lb-row.lb-stamp { box-shadow: inset 0 0 0 1px var(--brass); animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both, brass-glow 600ms ease-out; }
@keyframes brass-glow { 0% { background: rgba(201, 163, 92, 0.28); } 100% { background: transparent; } }
.lb-ghost {
  position: fixed; z-index: 70; pointer-events: none; display: flex; align-items: center; padding: 0 0.6rem;
  color: var(--ivory); font: 600 1rem var(--sans); white-space: nowrap; overflow: hidden; transform-origin: top left;
  background: rgba(30, 25, 19, 0.85); border-radius: 0.6rem;
}
.lb-ghost-num { font-family: var(--serif); font-size: 3.2rem; font-variant-numeric: tabular-nums; background: none; justify-content: center; transform-origin: top right; }
.lb-tick { animation: felt-tick 600ms ease-out; }
@keyframes felt-tick { 0% { box-shadow: inset 4px 0 0 var(--felt); background: rgba(176, 70, 60, 0.18); } 100% { box-shadow: inset 4px 0 0 transparent; background: transparent; } }
.lb-slide-in { animation: slide-in 120ms ease-out; }
@keyframes slide-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.lb-week i.lb-glow { animation: week-glow 600ms ease-out; }
@keyframes week-glow { 0% { box-shadow: 0 0 0 0 rgba(201, 163, 92, 0.9); } 100% { box-shadow: 0 0 0 8px rgba(201, 163, 92, 0); } }

@media (prefers-reduced-motion: reduce) {
  .session-dot { animation: none; }
  .lb-day i { transition: none; }
  .lb-sheet, .lb-sheet-wrap.closing .lb-sheet { animation: none; transform: none; opacity: 1; }
  .lb-backdrop { transition: none; }
  .lb-stamp, .lb-trow.lb-stamp, .lb-row.lb-stamp, .lb-noteitem.lb-stamp, .lb-hero-note.lb-stamp, .lb-tick, .lb-slide-in, .lb-week i.lb-glow, .lb-trow.live .lb-type { animation: none; }
  .lb-hero-play, .lb-addnote, .lb-modal-save { transition: none; }
  .lb-hero-goal.lb-arriving { opacity: 1; }
}
