/* Tutti web — follows /DESIGN.md. iOS (DesignSystem.swift) is the reference. */

/* Schibsted Grotesk for text. Tutti Text is Edwin (MuseScore), the score text face based on New Century Schoolbook,
   subset and renamed as its Reserved Font Name requires; used only for musical numbers. Licences are in fonts/. */
@font-face { font-family: "Tutti Text"; src: url("fonts/tutti-text.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Tutti Text"; src: url("fonts/tutti-text-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Tutti Text"; src: url("fonts/tutti-text-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Tutti Text"; src: url("fonts/tutti-text-bold-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  /* Tutti 2 (see /DESIGN.md): warm white, ink with a hint of plum, one accent per role. */
  --canvas: #FAF9F7;
  --card: #FFFFFF;
  --raised: #FFFFFF;
  --ink: #1F1B2A;
  --ink2: #5D586B;
  --ink3: #6E697B;
  --hair: rgb(31 27 42 / 0.09);
  --hair-strong: rgb(31 27 42 / 0.17);
  --shadow: 0 1px 2px rgb(31 27 42 / 0.05);
  --shadow-lift: 0 0 0 1px rgb(31 27 42 / 0.06), 0 18px 48px -12px rgb(31 27 42 / 0.22);

  --plum: #4E3F87; --plum-on: #4E3F87; --plum-text: #FFFFFF;
  --forest: #2C7352; --forest-on: #23633F; --forest-text: #FFFFFF;
  --amber: #E8B86D; --amber-on: #835500; --amber-text: #2A1D05;
  --coral-on: #A63C2F;

  --accent: var(--plum);
  --accent-on: var(--plum-on);
  --accent-text: var(--plum-text);
  --accent-wash: rgb(78 63 135 / 0.09);

  --well: var(--forest-on);
  --stuck: var(--amber-on);
  --help: var(--coral-on);

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Score numerals: bar numbers, tempo marks, timers. Edwin, the text face of engraved music. */
  --serif: "Tutti Text", "Century Schoolbook", Georgia, serif;

  --r-sm: 10px; --r-md: 16px; --r-lg: 22px;
  --gutter: 20px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-move: cubic-bezier(.65, 0, .35, 1);
  --drawer: cubic-bezier(.32, .72, 0, 1);
}

/* Any element can carry a role, so one page can show a teacher's screen and a pupil's phone side by side. */
[data-role="student"] { --accent: var(--forest); --accent-on: var(--forest-on); --accent-text: var(--forest-text); --accent-wash: rgb(44 115 82 / 0.10); }
[data-role="parent"]  { --accent: var(--amber);  --accent-on: var(--amber-on);  --accent-text: var(--amber-text);  --accent-wash: rgb(232 184 109 / 0.20); }
[data-role="teacher"] { --accent: var(--plum); --accent-on: var(--plum-on); --accent-text: var(--plum-text); --accent-wash: rgb(78 63 135 / 0.09); }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #131316;
    --card: #1C1C21;
    --raised: #25252B;
    --ink: #F3F2F6;
    --ink2: #B9B6C2;
    --ink3: #9E9AA8;
    --hair: rgb(255 255 255 / 0.08);
    --hair-strong: rgb(255 255 255 / 0.16);
    --shadow: none;
    --shadow-lift: 0 0 0 1px rgb(255 255 255 / 0.06), 0 18px 48px rgb(0 0 0 / 0.5);
    --plum: #6E5CB0; --plum-on: #C6BAF2; --plum-text: #FFFFFF;
    --forest: #33825C; --forest-on: #8FD3B0; --forest-text: #FFFFFF;
    --amber: #F0C57E; --amber-on: #F3D397;
    --coral-on: #F2A097;
    --accent-wash: rgb(198 186 242 / 0.12);
  }
  [data-role="student"] { --accent-wash: rgb(143 211 176 / 0.12); }
  [data-role="parent"]  { --accent-wash: rgb(240 197 126 / 0.16); }
  [data-role="teacher"] { --accent-wash: rgb(198 186 242 / 0.12); }
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Copy written both ways for whether pupils approve each connection: app.js sets data-approval
   from the server, and until it has, nothing promises approval. */
:root:not([data-approval="on"]) .approval-on, :root[data-approval="on"] .approval-off { display: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "tnum" 0;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; }
p { max-width: 68ch; }
a { color: var(--accent-on); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .55; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2.5px solid var(--accent-on); outline-offset: 2px; }
svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -100px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--raised); box-shadow: var(--shadow-lift); }
.skip:focus { top: 12px; }
#main:focus { outline: none; }
.muted { color: var(--ink2); }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; font-weight: 400; letter-spacing: 0; }

.loading { display: grid; min-height: 80dvh; place-content: center; justify-items: center; gap: 14px; color: var(--ink2); }
.loading img { border-radius: 14px; }
.loading h1 { color: var(--ink); font-size: 22px; }

/* Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  background: var(--accent-wash); color: var(--accent-on);
  transition: transform .12s var(--ease), background-color .15s, filter .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.large { min-height: 52px; font-size: 17px; border-radius: 999px; padding: 0 24px; }
.btn.block { display: flex; width: 100%; }
.btn.plain { background: none; padding: 0 8px; min-height: 44px; }
.btn.plain:hover { background: var(--accent-wash); }
.btn.quiet { background: transparent; color: var(--ink2); }
.btn.quiet:hover { background: var(--hair); }
.btn.ink { background: var(--ink); color: var(--canvas); border-radius: 999px; padding: 0 20px; }
.btn.ink.large { padding: 0 26px; }
@media (hover: hover) and (pointer: fine) { .btn.ink:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); } }
.btn.quiet.large { border-radius: 999px; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hair-strong); }
/* Secondary: a capsule with a hairline edge. Small: for rows of related actions. */
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-strong); }
.btn.secondary svg { color: var(--accent-on); }
@media (hover: hover) and (pointer: fine) { .btn.secondary:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); background: color-mix(in srgb, var(--card) 94%, var(--ink)); } }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; gap: 6px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.plain.small { padding: 0 8px; }
.btn.danger { background: rgb(166 60 47 / .1); color: var(--help); }
.btn svg { width: 18px; height: 18px; stroke-width: 2.1; }
.btn.primary svg { stroke-width: 2.3; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink2); }
.icon-btn:hover { background: var(--hair); color: var(--ink); }
.link { color: var(--accent-on); font-weight: 700; font-size: 15px; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--hair); color: var(--ink); font-weight: 650; font-size: 14px; }
.chip:hover { border-color: var(--hair-strong); }
.chip svg { width: 17px; height: 17px; color: var(--accent-on); }

/* Status */

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.well { color: var(--well); }
.status.stuck { color: var(--stuck); }
.status.help { color: var(--help); }
.status.none { color: var(--ink3); font-weight: 600; }

/* Avatars */

.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .01em;
  background: var(--av, #3F7D5E); }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
/* An instrument part (Pno., Vln.) set like the part names in a score. */
.avatar.part { font: italic 400 13px/1 var(--serif); letter-spacing: 0; }
.avatar.part.lg { font-size: 19px; }
.avatar.part.sm { font-size: 11px; }
.av0 { --av: #3F7D5E; } .av1 { --av: #C2553F; } .av2 { --av: #4F7489; } .av3 { --av: #93733A; } .av4 { --av: #5B4B8A; }

/* Page structure */

.page-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 28px; }
.page-head h1 { font-size: 34px; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--ink2); margin-top: 6px; font-size: 16px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head.with-avatar { align-items: center; justify-content: flex-start; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 10px -8px; padding: 0 8px; min-height: 40px; border-radius: 10px; color: var(--accent-on); font-weight: 700; font-size: 15px; }
.back:hover { background: var(--accent-wash); }

.section { margin-bottom: 32px; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; min-height: 44px; }
.section-head h2 { font-size: 19px; font-weight: 750; flex: 1; min-width: 0; }
.section-head .count { color: var(--ink2); font-weight: 600; font-size: 14.5px; }
.section-head .btn.plain { margin-right: -8px; }
.tile { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-wash); color: var(--accent-on); flex-shrink: 0; }
.tile svg { width: 16px; height: 16px; stroke-width: 2; }

.columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 0 36px; align-items: start; }
.columns.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.narrow { max-width: 760px; }
.mobile-only, .phone-only { display: none; }

/* Cards and grouped lists */

.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 20px; }
.group { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.item { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; text-decoration: none; color: inherit; background: none; transition: background-color .12s; }
@media (hover: hover) and (pointer: fine) { button.item:hover, a.item:hover { background: color-mix(in srgb, var(--card) 96%, var(--ink)); } }
button.item:active, a.item:active { background: color-mix(in srgb, var(--card) 93%, var(--ink)); }
button.item:disabled { opacity: 1; }
.item + .item::before { content: ""; position: absolute; top: 0; left: var(--inset, 70px); right: 0; height: 1px; background: var(--hair); }
.item.flush + .item.flush::before, .group.flush .item::before { left: 16px; }
.item-main { flex: 1; min-width: 0; }
.item-title { display: block; font-weight: 700; font-size: 16px; line-height: 1.3; }
.item-sub { display: block; color: var(--ink2); font-size: 14px; line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.item-sub .status { margin-left: 6px; vertical-align: 1px; }
.item.clamp .item-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-sub.wrap { white-space: normal; }
.item-trail { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 15px; font-variant-numeric: tabular-nums; flex-shrink: 0; text-align: right; }
.item-trail .chev { color: var(--ink3); width: 16px; height: 16px; stroke-width: 2.2; }
.time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.time { text-align: right; line-height: 1.25; }
.time small { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink3); }
.item-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-wash); color: var(--accent-on); flex-shrink: 0; }
.item-icon svg { width: 19px; height: 19px; }
.item.done .item-title { color: var(--ink2); }
.quote { display: block; margin-top: 6px; color: var(--ink); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.quote::before { content: "“"; } .quote::after { content: "”"; }

.empty-line { padding: 18px 16px; color: var(--ink2); font-size: 15px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 34px 24px 30px; }
.empty img { width: 76px; height: 76px; margin-bottom: 4px; }
.empty h3 { font-weight: 750; font-size: 20px; letter-spacing: -0.015em; }
.empty p { color: var(--ink2); font-size: 15px; max-width: 36ch; }
.empty .btn { margin-top: 8px; }

/* Focus card: the teacher's instruction is the most important text in the product. */

.focus { padding: 22px; border-radius: var(--r-lg); }
.focus-label { display: flex; align-items: center; gap: 8px; color: var(--accent-on); font-weight: 750; font-size: 14px; }
.focus-label svg { width: 17px; height: 17px; }
.focus h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 10px 0 8px; font-weight: 800; } /* the front page film */
.focus h3 { font-size: 25px; line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 10px; font-weight: 800; text-wrap: balance; }
.focus .instruction { font-size: 17.5px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; text-wrap: pretty; }
.focus-meta { margin-top: 12px; color: var(--ink2); font-size: 14px; }
.focus .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; color: var(--ink2); font-size: 14px; }
.focus .meta span { display: inline-flex; align-items: center; gap: 6px; }
.focus .meta svg { width: 15px; height: 15px; }
.materials { margin-top: 16px; display: grid; gap: 8px; }
.material { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--hair); text-align: left; }
@media (hover: hover) and (pointer: fine) { .material:hover { border-color: var(--hair-strong); } }
.material .dur { font-size: 16px; color: var(--ink2); }
.material .item-icon { width: 38px; height: 38px; border-radius: 9px; }
.focus-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 20px; }
.focus-actions:has(> :only-child) { grid-template-columns: 1fr; }
.checkin { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--hair); font-size: 15px; }
.checkin .status { margin-bottom: 4px; }

.recap { font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.byline { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--ink2); font-size: 14px; line-height: 1.3; }
.byline strong { display: block; color: var(--ink); font-weight: 700; }
.byline span span { display: block; }

.private { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-wash); color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.private svg { width: 17px; height: 17px; margin-top: 2px; color: var(--accent-on); }
.fine { color: var(--ink3); font-size: 13.5px; line-height: 1.45; }

/* Stats: only when they carry information */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 16px; }
.stat + .stat { border-left: 1px solid var(--hair); }
.stat .num { display: block; font-size: 30px; line-height: 1.1; }
.stat span { color: var(--ink2); font-size: 13.5px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 16px 16px 12px; }
.bar { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; text-align: center; font-size: 12.5px; color: var(--ink3); font-weight: 650; }
.bar i { align-self: end; display: block; border-radius: 6px 6px 3px 3px; background: var(--accent); min-height: 4px; opacity: .9; }
.bar.today span { color: var(--ink); }

/* Forms */

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; font-size: 14.5px; font-weight: 700; }
.field small, .hint { font-weight: 500; color: var(--ink3); font-size: 13.5px; }
.field input, .field textarea, .field select, .search {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--hair-strong); background: var(--raised); color: var(--ink);
  font-weight: 500; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23756D88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--help); font-size: 14.5px; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }
.fieldset-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 750; margin-top: 8px; letter-spacing: -0.01em; }
.fieldset-title .tile { display: none; }
.segmented { display: flex; padding: 3px; gap: 2px; border-radius: 11px; background: rgb(45 42 61 / .07); }
.segmented button { flex: 1; min-height: 40px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink2); text-align: center; transition: background-color .15s, color .15s; }
.segmented button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.search-wrap { position: relative; margin-bottom: 18px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink3); pointer-events: none; }
.search { padding-left: 44px; }

/* App shell */

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 26px; padding: 22px 14px; border-right: 1px solid var(--hair); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 0 8px; min-height: 44px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.brand span { font-weight: 800; font-size: 21px; letter-spacing: -0.03em; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 11px; color: var(--ink2); text-decoration: none; font-weight: 650; font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .side-nav a:hover { background: var(--hair); color: var(--ink); } }
.side-nav a { transition: background-color .12s, color .12s; }
.side-nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-on); }
.side-nav svg { width: 20px; height: 20px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; font-size: 14px; }
.person strong { display: block; font-weight: 700; }
.person small { display: block; color: var(--ink2); font-size: 13px; line-height: 1.3; }
.person strong { line-height: 1.3; }

.workspace { min-width: 0; position: relative; }
.demo-bar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 12px; padding: 10px 32px; background: color-mix(in srgb, var(--canvas) 96%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--hair); }
.demo-bar .label { display: grid; font-size: 13px; line-height: 1.3; color: var(--ink2); max-width: none; }
.demo-bar .label b { color: var(--ink); font-size: 14px; font-weight: 750; }
.demo-bar .segmented { width: 300px; }
.demo-bar .spacer { flex: 1; }
.mobile-top { display: none; }
.content { position: relative; max-width: 1180px; margin: 0 auto; padding: 36px 40px 64px; }
.offline { padding: 10px 32px; font-size: 14px; font-weight: 600; background: rgb(232 184 109 / .2); color: var(--amber-on); }
.mobile-nav { display: none; }

/* Calendar */

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-toolbar h2 { font-size: 19px; font-weight: 750; }
.cal-toolbar .actions { display: flex; align-items: center; gap: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.day { min-height: 300px; padding: 12px 8px; }
.day + .day { border-left: 1px solid var(--hair); }
.day-label { display: grid; justify-items: center; gap: 2px; margin-bottom: 12px; color: var(--ink2); font-size: 13px; font-weight: 700; }
.day-label b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: var(--ink); font-weight: 750; }
.day.today .day-label b { background: var(--accent); color: var(--accent-text); }
.slot { display: grid; gap: 1px; width: 100%; padding: 8px 9px; margin-bottom: 6px; border-radius: 10px; text-align: left; font-size: 13px; line-height: 1.3; background: var(--accent-wash); color: var(--ink); border-left: 0; }
.slot:hover { filter: brightness(.97); }
.slot b { font-weight: 750; }
.slot span { color: var(--ink2); font-variant-numeric: tabular-nums; }
.agenda { display: none; }
.agenda-day { margin-bottom: 22px; }
.agenda-day h3 { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 750; margin: 0 4px 8px; color: var(--ink2); }
.agenda-day.today h3 { color: var(--accent-on); }
.agenda-day .none { margin: 0 4px; color: var(--ink3); font-size: 14px; }
.agenda-empty { margin: 0 4px 22px; color: var(--ink3); font-size: 14px; font-weight: 600; }

/* Billing */

.balance { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.balance .num { font-size: 44px; line-height: 1; }
.balance p { color: var(--ink2); margin-top: 8px; }
.amount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.amount.credit { color: var(--well); }
.amount.void { text-decoration: line-through; color: var(--ink3); }

/* Dialog: centred on desktop, a sheet on phones */

dialog {
  width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--hair); border-radius: var(--r-lg);
  background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-lift); overflow: auto;
}
dialog[open] { animation: rise .26s var(--drawer); }
dialog[open]::backdrop { animation: fade .26s var(--drawer); }
/* Leaving is quicker than arriving. */
dialog.closing { animation: leave .16s var(--ease) forwards; }
dialog.closing::backdrop { animation: fade .16s var(--ease) reverse forwards; }
@keyframes leave { to { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
.dialog-head h2:focus { outline: none; }
dialog::backdrop { background: rgb(20 18 32 / .38); backdrop-filter: blur(2px); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 24px; background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.dialog-head h2 { flex: 1; font-size: 20px; font-weight: 800; }
.dialog-head .sub { display: block; font-size: 14px; font-weight: 600; color: var(--ink2); margin-top: 2px; }
.dialog-body { padding: 4px 24px 24px; }
.dialog-actions { position: sticky; bottom: -24px; display: flex; justify-content: flex-end; gap: 10px; margin: 8px -24px -24px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--hair); }

/* Music tools */

.tool-hero { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 0 10px; }
.tool-hero .num { font-size: 72px; line-height: 1; }
.tool-hero .unit { color: var(--ink2); font-weight: 700; font-size: 15px; }
.tool-task { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); }
.tool-task b { display: block; font-weight: 750; }
.tool-task span { color: var(--ink2); font-size: 15px; line-height: 1.45; display: block; margin-top: 2px; }
.tool-controls { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.beats { display: flex; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.beat { width: 16px; height: 16px; border-radius: 50%; background: var(--hair-strong); transition: background-color .06s, transform .06s; }
.beat:first-child { width: 20px; height: 20px; margin-top: -2px; }
.beat.active { background: var(--accent); transform: scale(1.15); }
.range { width: 100%; accent-color: var(--accent); min-height: 32px; }
.tuner-note { font-family: var(--serif); font-size: 84px; line-height: 1; font-weight: 500; }
.tuner-status { color: var(--ink2); min-height: 24px; font-weight: 650; }
.record-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #D8453A; margin-right: 8px; }
.audio-preview { width: 100%; margin-top: 12px; }
.rating { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rating label { position: relative; }
.rating input { position: absolute; opacity: 0; }
.rating span { display: grid; place-items: center; min-height: 48px; padding: 6px; border-radius: 12px; border: 1px solid var(--hair-strong); background: var(--raised); font-weight: 700; font-size: 14.5px; text-align: center; cursor: pointer; }
.rating input:checked + span { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-on); box-shadow: inset 0 0 0 1px var(--accent); }
.rating input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.score-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.score-controls .field { grid-auto-flow: column; align-items: center; gap: 8px; }
.score-controls .field select { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.score-stage { overflow: auto; max-height: 64dvh; background: #fff; border: 1px solid var(--hair); border-radius: 12px; }
.score-stage canvas { display: block; margin: 0 auto; }
.score-readable { margin-top: 10px; color: var(--ink2); font-size: 14px; }

#notice { position: fixed; left: 50%; bottom: 28px; z-index: 30; transform: translateX(-50%); width: max-content; max-width: min(92vw, 520px); text-align: center; border-radius: 14px; background: var(--ink); color: var(--canvas); font-weight: 650; font-size: 15px; box-shadow: var(--shadow-lift); }
#notice:not(:empty) { padding: 13px 18px; animation: toast .24s var(--ease); }
#notice.leaving { animation: toast-out .18s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 6px); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#notice.error { background: #A63C2F; color: #fff; }

/* Musical markings, drawn the way they appear in a score */

.marks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 12px; }
.rehearsal { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px 4px; border: 1.6px solid var(--ink); border-radius: 3px; font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.1; font-variant-numeric: lining-nums; color: var(--ink); }
.rehearsal small { font-family: var(--font); font-weight: 700; font-size: 11.5px; letter-spacing: .02em; color: var(--ink2); }
.tempo-mark { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; min-height: 44px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-on); font-family: var(--serif); font-weight: 700; font-size: 17px; font-variant-numeric: lining-nums; transition: transform .12s var(--ease), box-shadow .12s; }
.tempo-mark.static { background: none; padding: 0; min-height: 0; font-size: 15px; color: var(--ink2); }
.crotchet { width: 9px; height: 16px; fill: currentColor; stroke: none; margin-right: 2px; transform: translateY(-1px); }
.tempo-mark.static .crotchet { width: 8px; height: 14px; }
button.tempo-mark:active { transform: scale(.96); }
button.tempo-mark[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.tempo-mark.pulse { animation: beat .16s var(--ease); }
@keyframes beat { from { box-shadow: 0 0 0 6px var(--accent-wash); } to { box-shadow: 0 0 0 0 transparent; } }

.week-bar { margin: 0; }
.week-bar svg { width: 100%; height: auto; display: block; overflow: visible; }
.week-bar .staff-lines line { stroke: var(--ink); stroke-opacity: .22; stroke-width: 1; }
.week-bar .barline { stroke: var(--ink); stroke-opacity: .45; stroke-width: 1.4; }
.week-bar .timesig { font: 700 18px var(--serif); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.week-bar .note ellipse { fill: var(--accent-on); }
.week-bar .note .stem { stroke: var(--accent-on); stroke-width: 1.6; }
.week-bar .rest { fill: var(--ink); opacity: .38; }
.week-bar .slot-today { fill: none; stroke: var(--accent-on); stroke-width: 1.6; stroke-dasharray: 3 3; }
.week-bar text:not(.timesig) { font: 600 9.5px var(--font); fill: var(--ink3); text-anchor: middle; letter-spacing: .02em; }
.week-bar text.today { fill: var(--accent-on); font-weight: 750; }
.week-bar figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; font-size: 15px; }
.week-bar figcaption .num { font-size: 17px; color: var(--ink); }
.week-bar figcaption b { font-weight: 750; }
.week-bar figcaption span { color: var(--ink2); font-size: 14px; font-weight: 650; }
.count.link { min-height: 44px; font-size: 14.5px; color: var(--accent-on); }

/* Progress: four weeks as four systems of a score */
.systems { display: grid; gap: 4px; padding: 14px 16px 10px; }
.system { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 10px; }
.system-label { grid-column: 1 / -1; font-size: 13px; font-weight: 750; color: var(--ink2); margin-bottom: -2px; }
.system .week-bar svg { max-height: 78px; }
.system:not(:first-child) .week-bar svg { margin-bottom: -18px; }
.system-count { font-size: 13.5px; font-weight: 700; color: var(--ink2); padding-bottom: 22px; min-width: 46px; text-align: right; }
.system + .system { border-top: 1px solid var(--hair); padding-top: 8px; }

/* The teacher's brief at the top of a lesson */

.brief { margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); }
.brief h3 { font-size: 14px; font-weight: 750; color: var(--ink2); margin-bottom: 8px; }
.brief ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.brief li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; }
.brief li > svg { width: 17px; height: 17px; margin-top: 2px; color: var(--accent-on); }
.brief b { font-weight: 750; }
.brief .tempo-mark.static { margin-left: 6px; }
.brief .quote { display: inline; margin: 0; }

.continue { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--hair-strong); background: var(--card); text-align: left; }
.continue:hover { border-color: var(--accent); }
.continue > svg { color: var(--accent-on); }
.continue b { display: block; font-weight: 750; font-size: 15px; }
.continue small { display: block; color: var(--ink2); font-size: 13.5px; margin-top: 1px; }
.chips.quick { margin-top: -8px; }
.reuse { border-radius: 12px; border: 1px solid var(--hair); background: var(--card); }
.reuse summary { cursor: pointer; list-style: none; padding: 12px 14px; min-height: 44px; font-weight: 700; font-size: 15px; color: var(--accent-on); }
.reuse summary::-webkit-details-marker { display: none; }
.reuse summary::after { content: " ›"; }
.reuse[open] summary::after { content: " ⌄"; }
.reuse-list { display: grid; border-top: 1px solid var(--hair); }
.reuse-item { display: grid; gap: 2px; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hair); }
.reuse-item:last-child { border-bottom: 0; }
.reuse-item:hover { background: var(--accent-wash); }
.reuse-item b { font-weight: 700; font-size: 15px; }
.reuse-item span { color: var(--ink2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips.quick .chip { min-height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 650; color: var(--ink2); background: var(--canvas); }
.chips.quick .chip:hover { color: var(--ink); }

/* Exam plan */

.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 16px 18px; }
.exam-head b { display: block; font-size: 18px; font-weight: 800; }
.exam-head span { color: var(--ink2); font-size: 14.5px; }
.exam-meter { display: grid; justify-items: center; line-height: 1; }
.exam-meter span { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); }
.exam-meter span small { font-size: 17px; color: var(--ink3); }
.exam-meter > small { color: var(--ink2); font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.marks-count { font-family: var(--serif); font-weight: 600; color: var(--ink3); font-size: 14px; min-width: 22px; text-align: right; }
.marks-count::after { content: " marks"; font-family: var(--font); font-size: 12px; font-weight: 600; }
.exam-foot { margin: 10px 4px 0; }
.exam-empty p { color: var(--ink2); margin-bottom: 14px; }

/* Practice tools */

.center { text-align: center; }
.plain-fieldset { border: 0; margin: 0; padding: 0; }
.plain-fieldset legend { margin-bottom: 8px; }
.click-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); }
.click-row .spacer { flex: 1; }
.click-row .fine { min-width: 0; line-height: 1.35; }
.tool-controls .btn.primary.large { min-width: 200px; }
.click-row .icon-btn { font-size: 22px; font-weight: 600; color: var(--accent-on); }
.tempo-name { font-family: var(--serif); font-style: italic; font-synthesis: style; font-size: 19px; color: var(--ink2); }
.stepper { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.icon-btn.big { width: 48px; height: 48px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); font-size: 24px; color: var(--ink); }
.beat.down { width: 20px; height: 20px; margin-top: -2px; }
.beat:first-child { width: 16px; height: 16px; margin-top: 0; }
.beat.down:first-child { width: 20px; height: 20px; margin-top: -2px; }

.tuner { display: grid; justify-items: center; gap: 8px; padding: 10px 0 4px; }
.tuner-note sub { font-size: .38em; vertical-align: baseline; color: var(--ink3); margin-left: 2px; }
.gauge { position: relative; width: min(100%, 320px); height: 64px; }
.gauge .ticks { position: absolute; inset: auto 0 10px 0; height: 28px; display: flex; justify-content: space-between; align-items: flex-end; }
.gauge .ticks i { display: block; width: 2px; height: 12px; border-radius: 1px; background: var(--hair-strong); }
.gauge .ticks i.mid { height: 26px; width: 3px; background: var(--ink3); }
.gauge::before { content: ""; position: absolute; left: 45%; right: 45%; bottom: 8px; height: 32px; border-radius: 8px; background: rgb(74 139 107 / .16); transition: background-color .2s; }
.gauge[data-state="in-tune"]::before { background: rgb(74 139 107 / .32); }
.needle { --c: 0; position: absolute; bottom: 4px; left: 50%; width: 3px; height: 52px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); transform: translateX(calc(var(--c) * 3.1px)); transition: transform .12s linear, background-color .2s; }
.gauge[data-state="idle"] .needle { opacity: .25; }
.gauge[data-state="in-tune"] .needle { background: var(--forest-on); }
.gauge[data-state="off"] .needle { background: var(--stuck); }
.gauge-labels { display: flex; justify-content: space-between; width: min(100%, 320px); font-size: 12.5px; font-weight: 700; color: var(--ink3); }
.level { width: 160px; height: 6px; margin-top: 10px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.level i { --v: 0; display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--accent); border-radius: 3px; transition: width .08s linear; }

.checkin { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.checkin .status { margin: 0; }
.checkin .quote { display: inline; margin: 0; }

/* Listening and building up tempo */
.listen-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.listen-controls .segmented { flex: 1; min-width: 220px; }
.chip[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-on); }
.build-up { margin: 8px 0 4px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-row input { appearance: none; flex-shrink: 0; width: 46px; height: 28px; border-radius: 14px; background: var(--hair-strong); position: relative; transition: background-color .2s; cursor: pointer; margin: 0; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(18px); }
.switch-row b { display: block; font-weight: 750; font-size: 15px; }
.switch-row small { display: block; color: var(--ink2); font-size: 13.5px; }
.build-target { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-left: 58px; }
.build-target .tempo-mark.static { font-size: 18px; color: var(--ink); }

/* Department preview */
.preview-note { margin-bottom: 28px; background: var(--accent-wash); border-color: transparent; box-shadow: none; }
.preview-note b { display: block; font-weight: 750; margin-bottom: 4px; }
.preview-note p { color: var(--ink2); font-size: 15px; }
.exam-mini { font-size: 14px; color: var(--ink2); white-space: nowrap; }
.exam-mini b { font-family: var(--serif); font-size: 19px; color: var(--ink); font-weight: 600; }
.dept-week > div { display: flex; align-items: baseline; gap: 10px; }
.dept-week .num { font-size: 40px; line-height: 1; }
.dept-week span:not(.num) { color: var(--ink2); }
.dept-week .fine { margin-top: 12px; }
.recap-rate { font-size: 14px; font-weight: 700; color: var(--well); white-space: nowrap; }
.recap-rate.low { color: var(--stuck); }
.demo-bar .segmented { width: 420px; }

/* Small utilities (the content security policy blocks inline style attributes) */
.seg-opt { flex: 1; display: flex; }
.seg-opt [data-seg] { flex: 1; }
.seg-opt input:focus-visible + [data-seg] { outline: 3px solid var(--accent); outline-offset: 1px; }
.seg-opt input:checked + [data-seg] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
textarea.short { min-height: 84px !important; }
.mt-xs { margin-top: 6px; } .mt-s { margin-top: 8px; } .mt-m { margin-top: 14px; } .mt-l { margin-top: 20px; }
.mb-s { margin-bottom: 8px; }
.stack-m { display: grid; gap: 10px; }
.note-below { margin: 10px 4px 0; }
.big-code { font-family: var(--serif); font-size: 40px; text-align: center; margin: 24px 0; letter-spacing: .1em; }
.card[data-pad="compact"] { padding: 16px; }
.num-lg { font-size: 26px; }
.code-input { font-size: 22px !important; letter-spacing: .12em; text-transform: uppercase; }
.code-value { font-size: 20px; color: var(--ink); }
.name-lg { font-size: 19px; }
.title-md { font-size: 17px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--ink2); font-size: 14px; }
.score-img { border-radius: 12px; }
.page-label { align-self: center; font-weight: 650; }
.bar i.h0 { height: 3%; } .bar i.h1 { height: 10%; } .bar i.h2 { height: 20%; } .bar i.h3 { height: 30%; } .bar i.h4 { height: 40%; } .bar i.h5 { height: 50%; } .bar i.h6 { height: 60%; } .bar i.h7 { height: 70%; } .bar i.h8 { height: 80%; } .bar i.h9 { height: 90%; } .bar i.h10 { height: 100%; }


/* ------------------------------------------------------------------------- */
/* Tutti 2 screens: shared pieces                                             */

/* The 7/4 week keeps the proportions of a printed bar instead of stretching with its card. */
.week-card { container-type: inline-size; }
.week-bar svg { max-width: 460px; }
@container (min-width: 520px) {
  .week-card .week-bar { display: grid; grid-template-columns: minmax(0, 460px) 1fr; align-items: end; gap: 24px; }
  .week-card .week-bar figcaption { display: grid; gap: 2px; margin: 0 0 22px; justify-items: end; text-align: right; }
}
.week-bar.compact svg { max-width: none; }
.week-bar .note { transform-box: fill-box; transform-origin: center; }
/* The day's note drops onto the week when practice is saved. */
.week-bar .note.drop { animation: drop .5s var(--ease) .2s both; }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }

/* Someone's own words, with who said them underneath. */
.said { display: block; margin-top: 6px; }
.said .quote { margin: 0; }
.said .who { display: block; margin-top: 2px; color: var(--ink3); font-size: 13px; font-weight: 600; }
.said-list { display: grid; gap: 12px; margin-top: 10px; }
.said-item { display: block; padding-left: 12px; border-left: 2px solid var(--hair-strong); }
.said-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; color: var(--ink2); }
.said-head .status { font-size: 13px; }
.attention .item { align-items: flex-start; padding-top: 14px; padding-bottom: 16px; }
.attention .item .avatar { margin-top: 2px; }
.attention .item-trail { align-self: center; }

.next-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 11.5px; font-weight: 750; vertical-align: 2px; letter-spacing: .01em; }
.item.is-next { background: color-mix(in srgb, var(--card) 94%, var(--accent)); }
.task-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.task-line .status { margin: 0; }
.move { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.move svg { width: 15px; height: 15px; color: var(--ink3); }
.move b { color: var(--ink); font-weight: 700; }

/* Practice this week, as a column of small staves, one per pupil. */
.practice-row { min-height: 54px; padding-top: 6px; padding-bottom: 6px; --inset: 60px; }
.practice-row .item-main { flex: 0 0 64px; }
.mini-week { flex: 1; min-width: 0; }
.mini-week .week-bar svg { height: 34px; width: 100%; }
.practice-row .item-trail { min-width: 62px; justify-content: flex-end; }

/* Pupils as a table on wide screens. */
.list-head { display: none; }
.col { display: none; }
@media (min-width: 900px) {
  .pupil-table .list-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 150px 16px; gap: 16px; padding: 10px 16px 10px 70px; border-bottom: 1px solid var(--hair); color: var(--ink2); font-size: 13px; font-weight: 650; }
  .pupil-table .item { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.35fr) 150px 16px; gap: 0 16px; }
  .pupil-table .item::before { left: 70px !important; }
  .pupil-table .list-head + .item::before { display: none; }
  .pupil-table .col { display: grid; gap: 2px; min-width: 0; font-size: 14.5px; }
  .pupil-table .col-title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pupil-table .item-trail { justify-content: flex-end; }
  .pupil-table .phone-only { display: none; }
}

/* A task card seen by the teacher, and the lesson list on a pupil's page. */
.card-foot { margin: 14px -8px -6px; }
.checkin { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--hair); font-size: 15px; display: block; }
.checkin.quiet { padding: 10px 14px; }
.checkin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.checkin .quote { display: block; margin: 6px 0 0; }
.details dl { display: grid; gap: 12px; margin: 0; }
.details dt { color: var(--ink2); font-size: 13px; font-weight: 650; }
.details dd { margin: 2px 0 0; font-size: 15.5px; overflow-wrap: anywhere; }
.lesson-list .item.past .item-icon { background: var(--hair); color: var(--ink2); }
.recap-card .btn.plain { margin: 10px -8px -6px; }
.recap-card .recap { text-wrap: pretty; }

/* Lesson editor details */
.brief-task { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.brief .said { margin-top: 4px; }
.task-block { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); }
.task-block h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 18px; font-weight: 750; letter-spacing: -0.015em; }
.task-block h4 svg { color: var(--well); }
.task-block .instruction { font-size: 16px; line-height: 1.55; white-space: pre-wrap; }
.task-block .marks { margin-bottom: 10px; }
.task-block.done h4 { color: var(--ink2); }
.meta-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px; color: var(--ink2); font-size: 14px; }
/* Carry on: the tempo number rolls up to the next metronome mark. */
.roll { display: inline-grid; height: 1.3em; overflow: hidden; vertical-align: bottom; font-family: var(--serif); font-weight: 700; color: var(--ink); }
.roll > span { grid-area: 1 / 1; line-height: 1.3; transition: transform .45s var(--ease), opacity .3s var(--ease); }
.roll > span + span { transform: translateY(100%); opacity: 0; }
.continue.rolled .roll > span:first-child { transform: translateY(-100%); opacity: 0; }
.continue.rolled .roll > span + span { transform: none; opacity: 1; }
.continue.rolled { border-style: solid; border-color: var(--accent); background: var(--accent-wash); cursor: default; opacity: 1; }
.continue.rolled > svg { transform: rotate(180deg); transition: transform .45s var(--ease); }

/* Calendar slots carry the pupil's colour as a thin edge, like a coloured tab. */
.slot { position: relative; padding: 8px 9px 9px 12px; transition: transform .12s var(--ease), background-color .12s; }
.slot::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent-on); opacity: .7; }
.slot.tone0::before { background: #3F7D5E; } .slot.tone1::before { background: #C2553F; } .slot.tone2::before { background: #4F7489; } .slot.tone3::before { background: #93733A; } .slot.tone4::before { background: #5B4B8A; }
.slot-time { font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--ink) !important; font-variant-numeric: lining-nums tabular-nums; }
.slot.done { opacity: .6; }
.slot:active { transform: scale(.97); }
.day.today { background: color-mix(in srgb, var(--card) 96%, var(--accent)); }
.agenda-day h3 span { font-weight: 600; color: var(--ink3); }

/* Practice tools as four destinations. */
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 960px; }
.tool-card { display: flex; align-items: center; gap: 16px; min-height: 96px; padding: 18px 18px 18px 20px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--hair); box-shadow: var(--shadow); text-align: left; transition: transform .14s var(--ease), border-color .14s; }
.tool-card > span { flex: 1; min-width: 0; display: grid; gap: 3px; }
.tool-card b { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.tool-card span span { color: var(--ink2); font-size: 14.5px; line-height: 1.4; }
.tool-card .item-icon { width: 48px; height: 48px; border-radius: 14px; }
.tool-card .item-icon svg { width: 23px; height: 23px; }
.tool-card .chev { color: var(--ink3); width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .tool-card:hover { border-color: var(--hair-strong); } }
.tool-card:active { transform: scale(.98); }

/* Progress journal */
.journal .item { align-items: flex-start; }
.journal .item-trail { align-self: center; }
.col-rating { flex-shrink: 0; align-self: center; }
.mins { min-width: 56px; text-align: right; color: var(--ink2); font-size: 13.5px; font-weight: 600; }
.mins .num { font-size: 18px; color: var(--ink); }
.with { color: var(--ink); font-weight: 600; }
.marks-count { font-family: var(--serif); font-weight: 700; color: var(--ink2); font-size: 15px; min-width: 52px; text-align: right; flex-shrink: 0; }
.marks-count::after { content: " marks"; font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--ink3); }
.exam-head > div:first-child { display: grid; gap: 1px; }
.exam-head.linked { text-decoration: none; color: inherit; }
@media (hover: hover) and (pointer: fine) { .exam-head.linked:hover { border-color: var(--hair-strong); } }

/* Department */
.dept-figure { display: flex; align-items: baseline; gap: 10px; }
.meter { height: 6px; margin-top: 14px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter .w0 { width: 0; } .meter .w5 { width: 5%; } .meter .w10 { width: 10%; } .meter .w15 { width: 15%; } .meter .w20 { width: 20%; } .meter .w25 { width: 25%; } .meter .w30 { width: 30%; } .meter .w35 { width: 35%; } .meter .w40 { width: 40%; } .meter .w45 { width: 45%; } .meter .w50 { width: 50%; } .meter .w55 { width: 55%; } .meter .w60 { width: 60%; } .meter .w65 { width: 65%; } .meter .w70 { width: 70%; } .meter .w75 { width: 75%; } .meter .w80 { width: 80%; } .meter .w85 { width: 85%; } .meter .w90 { width: 90%; } .meter .w95 { width: 95%; } .meter .w100 { width: 100%; }
.exam-mini { display: grid; justify-items: end; gap: 1px; }
.exam-mini small { font-size: 12.5px; color: var(--ink3); font-weight: 600; }
.recap-rate b { font-family: var(--serif); font-size: 17px; }
.amount.zero { color: var(--ink3); font-weight: 600; }
.profile .avatar.lg { width: 52px; height: 52px; }

/* Polish pass: fixes found walking every screen. */
/* Rows sit in clipped groups, so their focus ring is drawn inside the row. */
.group > .item:focus-visible, .group .item:focus-visible, .material:focus-visible { outline-offset: -3px; border-radius: 12px; }
/* Icon strokes are for line icons only: noteheads, rests and lettering in the week bar are filled. */
.week-bar svg text, .week-bar .note ellipse, .week-bar .rest, .week-bar .slot-today { stroke-linecap: butt; }
.week-bar svg text, .week-bar .note ellipse, .week-bar .rest { stroke: none; }
/* The sticky footer sits on the dialog's bottom edge, never below it. */
.dialog-actions { bottom: 0; }
.tool-card > span:not(.item-icon) { flex: 1; min-width: 0; display: grid; gap: 3px; }
.tool-card > .item-icon { flex: 0 0 auto; }
.page-head.with-avatar .head-text { flex: 1; min-width: 0; }
/* Every pupil's mini week the same width, whatever the count beside it says. */
.practice-row .item-trail { min-width: 84px; }
.continue.rolled .roll-next { display: none; }
.nowrap { white-space: nowrap; }
.big-code, .empty .big-code { font-size: 34px; letter-spacing: .08em; margin: 6px 0 2px; color: var(--ink); }
.empty .chips { justify-content: center; }
.empty .chips .btn { margin-top: 8px; }
/* Check-in choices take the colour of what they say. */
.rating input[value="green"]:checked + span { border-color: var(--well); color: var(--well); background: color-mix(in srgb, var(--well) 9%, var(--raised)); box-shadow: inset 0 0 0 1px var(--well); }
.rating input[value="yellow"]:checked + span { border-color: var(--stuck); color: var(--stuck); background: color-mix(in srgb, var(--amber) 16%, var(--raised)); box-shadow: inset 0 0 0 1px var(--stuck); }
.rating input[value="red"]:checked + span { border-color: var(--help); color: var(--help); background: color-mix(in srgb, var(--help) 8%, var(--raised)); box-shadow: inset 0 0 0 1px var(--help); }
/* Wide dialogs on desktop: the lesson editor with its context beside it, and scores at reading size. */
@media (min-width: 761px) { dialog.wide { width: min(1040px, calc(100% - 48px)); } }
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .editor-side { position: sticky; top: 76px; display: grid; gap: 20px; }
  .editor .dialog-actions { margin-left: 0; padding-left: 0; }
}
.editor-side { display: grid; gap: 16px; align-content: start; }
.editor-side .brief { margin: 0; }
.calendar-link { display: flex; gap: 8px; }
.calendar-link input { flex: 1; min-width: 0; font-size: 14px; }
.settings-note { padding: 14px 16px; color: var(--ink2); font-size: 14.5px; }
.slot .moving { color: var(--stuck); font-weight: 650; }
@media (min-width: 761px) { .day { min-height: max(300px, calc(100dvh - 330px)); } }

/* Medium screens */

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; align-items: center; }
  .sidebar .brand span, .side-nav a span, .sidebar-foot .person div, .sidebar-foot .link { display: none; }
  .side-nav a { justify-content: center; padding: 0; width: 52px; }
  .columns { grid-template-columns: 1fr; }
  .content { padding: 30px 28px 56px; }
  .demo-bar { padding: 10px 28px; }
}

/* Phones */

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .demo-bar { padding: 8px var(--gutter); gap: 10px; }
  .demo-bar .label, .demo-bar .spacer, .demo-bar .signin { display: none; }
  .demo-bar .segmented { width: 100%; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter) 0; }
  .mobile-top .brand { padding: 0; }
  .mobile-top .brand img { width: 28px; height: 28px; border-radius: 8px; }
  .mobile-top .brand span { font-size: 19px; }
  .content { padding: 14px var(--gutter) calc(104px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 22px; }
  .page-head h1 { font-size: 30px; }
  .page-head .actions .btn.primary { flex: 1; }
  .section { margin-bottom: 28px; }
  .focus { padding: 18px; }
  .focus h2 { font-size: 23px; }
  .focus-actions { grid-template-columns: 1fr; }
  .item { padding: 12px 14px; gap: 12px; }
  .item-sub { white-space: normal; }
  .week { display: none; }
  .agenda { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .stats .num { font-size: 26px; }
  .offline { padding: 10px var(--gutter); }

  .mobile-only, .phone-only { display: revert; }
  .mobile-only { display: block; }
  .columns.even { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; gap: 10px; }
  .tool-card { min-height: 80px; padding: 14px 14px 14px 16px; }
  .practice-row .item-main { flex-basis: 56px; }
  .marks-count { min-width: 40px; }
  .marks-count::after { content: ""; }
  .journal .col-rating { display: none; }
  .page-head.with-avatar .actions { width: 100%; }
  .demo-bar .segmented button { padding: 0 6px; font-size: 13.5px; }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; display: flex;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    /* Opaque, so nothing scrolled underneath shows through the labels. */
    background: var(--card);
    border-top: 1px solid var(--hair);
  }
  .mobile-nav a { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 58px; color: var(--ink2); text-decoration: none; font-size: 12px; font-weight: 700; }
  .mobile-nav a i { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; transition: background-color .2s; }
  .mobile-nav a[aria-current="page"] { color: var(--accent-on); }
  .mobile-nav a[aria-current="page"] i { background: var(--accent-wash); }
  .mobile-nav svg { width: 22px; height: 22px; }

  dialog { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  dialog[open] { animation: sheet .3s var(--drawer); }
  dialog.closing { animation: sheet-out .2s var(--ease) forwards; }
  .dialog-head { padding: 10px 10px 10px 20px; }
  .dialog-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; border-radius: 3px; background: var(--hair-strong); transform: translateX(-50%); }
  .dialog-head h2 { padding-top: 10px; font-size: 19px; }
  .dialog-body { padding: 4px 20px 24px; }
  .dialog-actions { margin: 8px -20px -24px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .dialog-actions .btn { flex: 1; }
  #notice { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }

@media (prefers-color-scheme: dark) {
  button.item:hover, a.item:hover { background: rgb(255 255 255 / .03); }
  .segmented { background: rgb(255 255 255 / .07); }
  .avatar { box-shadow: inset 0 -2px 6px rgb(0 0 0 / .2); }
  .score-stage { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  /* Fewer, gentler animations, not none: fades that explain a change stay; movement goes. */
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  * { transition-property: opacity, color, background-color, border-color !important; }
  /* The fades that explain a change come back, without the movement. */
  dialog[open], dialog[open]::backdrop, #notice:not(:empty) { animation: fade .2s ease-out !important; }
  dialog.closing, dialog.closing::backdrop, #notice.leaving { animation: fade .15s ease-out reverse forwards !important; }
  .week-bar .note.drop { animation: fade .35s ease-out .2s both !important; }
  .btn:active:not(:disabled), button.tempo-mark:active, .tool-card:active, .slot:active { transform: none; }
}

@media print {
  .sidebar, .mobile-nav, .demo-bar, .mobile-top { display: none !important; }
  .app-shell { display: block; }
}

/* ========================================================================= */
/* October revision (DESIGN.md section 9): built and reviewed on a design board first.
   No pills, no "·" strings; music's own marks carry the information. */

:root { --pencil: #6B6676; --r-sm: 8px; --r-md: 14px; --r-lg: 18px;
  /* A hairline and a contact shadow, never a floating one: a sheet lies on the desk. */
  --lift: 0 0 0 1px rgb(31 27 42 / .08), 0 1px 2px rgb(31 27 42 / .06); }
@media (prefers-color-scheme: dark) { :root { --pencil: #A8A3B4; --lift: 0 0 0 1px rgb(255 255 255 / .08); } }
.glyph-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Buttons: rounded rectangles in the role colour, never capsules. */
.btn, .btn.large, .btn.ink, .btn.quiet.large { border-radius: 12px; }
.btn.large { border-radius: 13px; font-weight: 650; }
.btn { font-weight: 650; }
.btn.primary { box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), 0 1px 2px rgb(31 27 42 / .14); }
.chip, .chips.quick .chip { border-radius: 10px; }
.next-tag { background: none; color: var(--accent-on); padding: 0; font-size: 12.5px; font-weight: 650; }

/* Status is a coloured word. A bar someone is stuck on is ringed in graphite pencil. */
.status { gap: 5px; font-weight: 650; font-size: 14px; white-space: normal; flex-wrap: wrap; align-items: baseline; }
.status::before { content: none; }
.ring { position: relative; display: inline-grid; place-items: center; min-width: 26px; padding: 3px 6px; margin: -3px 0; font: 700 15px/1 var(--serif); font-variant-numeric: lining-nums; color: var(--ink); }
.ring svg { position: absolute; inset: -3px -5px; width: calc(100% + 10px); height: calc(100% + 6px); overflow: visible; fill: none; stroke: var(--pencil); stroke-width: 1.4; stroke-linecap: round; }
.ring.draw path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: pencil .42s var(--ease) .35s forwards; }
@keyframes pencil { to { stroke-dashoffset: 0; } }

/* The tempo mark, unboxed as printed: ♩ = 60 in Tutti Text bold. Only the bar range is boxed. */
.marks { gap: 6px 16px; }
.rehearsal { border-radius: 2px; }
.tempo-mark { min-height: 40px; padding: 0 4px; margin: 0 -4px; gap: 6px; border-radius: 8px; background: none; color: var(--ink); font-size: 19px; }
.tempo-mark .eq { display: inline-flex; gap: 5px; }
button.tempo-mark:hover .eq { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
button.tempo-mark[aria-pressed="true"] { background: none; color: var(--accent-on); }
.tempo-mark.static { font-size: 15px; color: var(--ink); }
.tempo-mark .crotchet { width: 9.5px; height: 17px; }
.tempo-mark.static .crotchet { width: 8px; height: 14px; }
.tempo-name { font-size: 17px; }

/* Navigation: the page you're on is marked with a notehead, not a filled pill. */
.side-nav a { position: relative; padding-left: 18px; }
.side-nav a[aria-current="page"] { background: none; color: var(--ink); }
.side-nav a[aria-current="page"] svg { color: var(--accent-on); }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: 3px; top: 50%; width: 9px; height: 6.5px; margin-top: -3.25px; border-radius: 50%; background: var(--accent); transform: rotate(-22deg); }
@media (max-width: 1100px) { .side-nav a { padding-left: 0; } .side-nav a[aria-current="page"]::before { left: -2px; } }
.mobile-nav a[aria-current="page"] i { background: none; }
.mobile-nav a[aria-current="page"] i::after { content: ""; position: absolute; }

/* Avatars take the colour of their orchestral section, as a full score groups its parts. */
.avatar.sec-keys { --av: #4F5D75; } .avatar.sec-strings { --av: #A4493D; } .avatar.sec-woodwind { --av: #5E7F5B; }
.avatar.sec-brass { --av: #9A7424; } .avatar.sec-percussion { --av: #8C5A3C; } .avatar.sec-voice { --av: #9B4F72; } .avatar.sec-other { --av: #5D586B; }

/* Whose words: a rule in the colour of who said them, and their name underneath. */
blockquote.said { margin: 0; padding-left: 13px; border-left: 2px solid var(--voice, var(--hair-strong)); }
blockquote.said .quote { display: block; margin: 0; color: var(--ink); text-wrap: pretty; }
blockquote.said .who { display: block; margin-top: 4px; font-style: normal; font-size: 13.5px; font-weight: 600; color: var(--voice-text, var(--ink2)); }
.said.v-teacher { --voice: var(--plum); --voice-text: var(--plum-on); }
.said.v-pupil { --voice: var(--forest); --voice-text: var(--forest-on); }
.said.v-family { --voice: var(--amber); --voice-text: var(--amber-on); }
.said.instruction .quote::before, .said.instruction .quote::after { content: none; }
.said.instruction .quote { font-size: 19px; line-height: 1.55; white-space: pre-wrap; }

/* ------------------------------------------------------------------------- */
/* The practice sheet: the pupil's Today. Text and actions left, the music right. */
body[data-role="student"] .content, body[data-role="parent"] .content { --field: color-mix(in srgb, var(--accent) 7%, var(--canvas)); }
body[data-role="student"] .workspace, body[data-role="parent"] .workspace { background: color-mix(in srgb, var(--accent) 6%, var(--canvas)); }
@media (prefers-color-scheme: dark) { body[data-role="student"] .workspace, body[data-role="parent"] .workspace { background: color-mix(in srgb, var(--accent) 8%, var(--canvas)); } }
.sheet { display: grid; gap: 28px; padding: 30px 34px 32px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--lift); }
.sheet.has-music { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; }
.sheet-text { min-width: 0; display: grid; gap: 0; align-content: start; }
.sheet-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; max-width: none; }
.sheet-top b { color: var(--accent-on); font-weight: 650; }
.sheet-top span { color: var(--ink2); }
.sheet h2 { margin: 12px 0 12px; font-size: 38px; line-height: 1.04; font-weight: 750; letter-spacing: -.03em; text-wrap: balance; }
.sheet .marks { margin: 0 0 20px; }
.sheet .said.instruction { margin-bottom: 4px; }
.listen { display: flex; flex-wrap: wrap; gap: 2px 22px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.listen .fine { flex-basis: 100%; }
.listen-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); font-weight: 600; font-size: 15px; text-align: left; }
.listen-link svg { color: var(--accent-on); width: 19px; height: 19px; }
.listen-link small { color: var(--ink2); font-weight: 500; font-size: 14px; }
.listen-link small.num { font-size: 15px; margin-left: 2px; }
.listen-link:hover span { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair-strong); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sheet-actions .btn.primary { min-width: 210px; }
.told { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hair); display: grid; gap: 10px; }
.told-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14px; color: var(--ink2); max-width: none; }
.told .said .quote { font-size: 15.5px; }
.sheet-music { min-width: 0; display: grid; gap: 8px; }
.sheet-music > .fine { text-align: center; }

/* The bars themselves: on paper, never inverted in dark mode. */
.excerpt { display: block; width: 100%; padding: 8px 10px 4px; border-radius: 10px; background: #FFFEFB; box-shadow: inset 0 0 0 1px rgb(31 27 42 / .08); color: #1F1B2A; text-align: left; transition: box-shadow .15s var(--ease), transform .14s var(--ease); }
button.excerpt:hover { box-shadow: inset 0 0 0 1px rgb(31 27 42 / .16), 0 6px 18px -10px rgb(31 27 42 / .3); }
button.excerpt:active { transform: scale(.99); }
@media (prefers-color-scheme: dark) { .excerpt { background: #F4F1EA; } }
.excerpt svg.music, .excerpt img { display: block; width: 100%; height: auto; }
svg.music { fill: currentColor; color: #1F1B2A; }
svg.music .staff { stroke: currentColor; stroke-width: .88; }
svg.music .ledger { stroke: currentColor; stroke-width: 1.28; }
svg.music .stem { stroke: currentColor; stroke-width: .8; }
svg.music .barline { stroke: currentColor; stroke-width: 1.44; }
svg.music .barline.thick { stroke-width: 4.4; }
svg.music .t-barno { font: italic 400 10.5px var(--serif); }
svg.music .pencil use, svg.music .pencil text { fill: #6B6676; }
svg.music .pencil-ring { fill: none; stroke: #6B6676; stroke-width: 1.3; stroke-linecap: round; }
svg.music .pencil-text { font: italic 400 11px var(--serif); }
.excerpt.on-stand { position: relative; padding: 16px 18px 26px; }
.excerpt .study { position: absolute; right: 14px; bottom: 6px; font: italic 400 12px var(--serif); color: #6E697B; }
.stand-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin-top: 14px; }
.stand-bar .marks { margin: 0; }

/* The week, at full size on the pupil's page. */
.week-card { padding: 18px 22px 16px; border-radius: var(--r-lg); box-shadow: var(--lift); border: 0; }
.week-bar.large svg { max-width: none; }
.week-bar .staff-lines line { stroke-opacity: .3; stroke-width: 1.1; }
.week-bar .barline { stroke-opacity: .55; stroke-width: 1.5; }
.week-bar.large .timesig { font-size: 25px; }
.week-bar .note.dyn0 { opacity: .5; } .week-bar .note.dyn1 { opacity: .68; } .week-bar .note.dyn2 { opacity: .84; } .week-bar .note.dyn3 { opacity: 1; }
.week-bar .note ellipse { fill: var(--accent-on); }
.week-bar .note .stem { stroke: var(--accent-on); stroke-width: 2; }
.week-bar .rest { opacity: .42; }
.week-bar .slot-today { stroke-width: 1.6; stroke-dasharray: 3.2 3; }
.week-bar.large text.day { font: 600 13px var(--font); fill: var(--ink3); text-anchor: middle; }
.week-bar.large text.day.today { fill: var(--accent-on); font-weight: 700; }
.week-bar .mins { font: 400 12.5px var(--serif); fill: var(--ink2); text-anchor: middle; }
.week-bar .lesson-mark { font: italic 400 12.5px var(--serif); fill: var(--accent-on); text-anchor: middle; }
.week-bar.large figcaption { display: flex; justify-content: flex-start; gap: 8px; margin-top: 4px; font-size: 14.5px; color: var(--ink2); }
.week-bar.large figcaption b { color: var(--ink); font-weight: 650; }
.week-bar.large figcaption span { font-size: 14.5px; font-weight: 400; color: var(--ink2); }
.week-bar.large figcaption span::before { content: ", "; }
@container (min-width: 520px) { .week-card .week-bar.large { display: block; } .week-card .week-bar.large figcaption { display: flex; margin: 4px 0 0; justify-items: start; text-align: left; } }
/* Small weeks are a single line, as percussion is written. */
.week-bar.mini svg { width: 100%; height: 30px; }
.week-bar.mini .line { stroke: var(--ink); stroke-opacity: .35; stroke-width: 1.1; }
.week-bar.mini .barline { stroke: var(--ink); stroke-opacity: .5; stroke-width: 1.3; }
.week-bar.mini .note { fill: var(--accent-on); }
.week-bar.mini .rest { fill: var(--ink); opacity: .38; }
.week-bar.mini .slot-today { fill: none; stroke: var(--accent-on); stroke-width: 1.3; stroke-dasharray: 2.4 2.2; }

/* Under the sheet: next lesson, the last recap and the exam, side by side. */
.context-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; align-items: start; }
.context-row > .section { margin-bottom: 28px; }
.next-lesson { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); color: inherit; text-decoration: none; }
.next-lesson b { display: block; font-weight: 650; font-size: 15.5px; }
.next-lesson span span { display: block; color: var(--ink2); font-size: 14px; margin-top: 1px; }
.next-lesson .num { font-size: 19px; }
.recap-block blockquote.said .quote { font-size: 15.5px; line-height: 1.6; }
.recap-block .quote::before, .recap-block .quote::after { content: none; }
.recap-block .btn.plain { margin: 6px 0 0 6px; padding: 0 6px; }
.exam-link { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.exam-link b { font-weight: 650; font-size: 15.5px; }
.exam-link > span { color: var(--ink2); font-size: 14px; }
.noteheads { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; }
.noteheads svg { height: 16px; width: auto; overflow: visible; }
.noteheads.sm svg { height: 12px; }
.noteheads ellipse { stroke: var(--ink); stroke-width: 1.6; }
.noteheads ellipse.ready { fill: var(--ink); }
.noteheads ellipse.open { fill: none; }
.nh-label { color: var(--ink2); font-size: 14px; }
.nh-label b { font-weight: 400; color: var(--ink); }
.item-sub .noteheads { display: flex; margin-top: 6px; }

/* ------------------------------------------------------------------------- */
/* The teacher's day as a timeline. Hours in the margin; each hour line a barline. */
.timeline { display: grid; gap: 0; margin-bottom: 36px; }
.tl-hour { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; margin: 6px 0 10px; }
.tl-hour .num { font-size: 15px; color: var(--ink3); }
.tl-hour::after { content: ""; height: 1px; background: var(--hair-strong); }
.tl-lesson { padding-left: 58px; margin-bottom: 10px; }
.tl-now { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; margin: 0 0 10px; }
.tl-now .num { font-size: 13.5px; font-weight: 700; color: var(--accent-on); }
.tl-now i { position: relative; height: 2px; background: var(--accent); border-radius: 1px; }
.tl-now i::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lesson-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; width: 100%; padding: 14px 16px; border-radius: var(--r-md); background: var(--card); box-shadow: 0 0 0 1px var(--hair); text-align: left; transition: box-shadow .15s var(--ease), transform .14s var(--ease); }
@media (hover: hover) and (pointer: fine) { .lesson-card:hover { box-shadow: 0 0 0 1px var(--hair-strong), 0 6px 16px -10px rgb(31 27 42 / .3); } }
.lesson-card:active { transform: scale(.995); }
.lesson-card.next, .lesson-card.live { box-shadow: 0 0 0 1.5px var(--accent); }
.lesson-card.past .lc-who { color: var(--ink2); }
.lc-main { min-width: 0; display: grid; gap: 3px; }
.lc-who { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 16px; line-height: 1.25; }
.lc-who em { font-style: normal; font-weight: 650; font-size: 12.5px; color: var(--accent-on); }
.lc-who em.tag-now { color: var(--accent-text); background: var(--accent); padding: 1px 7px; border-radius: 4px; }
.lc-task { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--ink2); font-size: 14.5px; }
.lc-task .marks { margin: 0; gap: 4px 12px; }
.lc-task .rehearsal { font-size: 14px; padding: 1px 6px 2px; border-width: 1.3px; }
.lc-task .rehearsal small { font-size: 10px; }
.lc-state { margin-top: 3px; }
.lc-when { text-align: right; line-height: 1.15; }
.lc-when .num { display: block; font-size: 18px; color: var(--ink); }
.lc-when small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink3); font-weight: 500; }
.lc-said { grid-column: 2 / -1; display: grid; gap: 10px; margin-top: 10px; }
.lc-said .quote { font-size: 15px; line-height: 1.45; }
.lc-said .who { font-size: 12.5px; }
.side-col .day-group h3 { font-size: 14px; font-weight: 650; color: var(--ink2); margin: 2px 2px 6px; }
.side-col .day-group + .day-group { margin-top: 14px; }
.group.flush { background: none; border: 0; box-shadow: none; border-radius: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.group.flush .item { padding-left: 2px; padding-right: 2px; }
.group.flush .item::before { left: 0 !important; }
.item.compact { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
.item .time.num, .item-trail .time .num { font-family: var(--serif); font-weight: 400; font-size: 17px; }
.practice-row .mini-week { flex: 1; min-width: 0; }
.practice-row .item-main { flex: 0 0 64px; }
.attention .said-list { display: grid; gap: 10px; margin-top: 10px; }
.move b { font-weight: 650; }

/* The teacher's brief: where to start, then each check-in in the pupil's own words. */
.brief li.spot { align-items: center; }
.brief li.spot .ring { flex-shrink: 0; margin: 0 4px 0 2px; }
.brief .spot-detail { color: var(--ink2); font-size: 14px; }
.brief-ic svg { width: 17px; height: 17px; margin-top: 2px; color: var(--accent-on); }
.brief .said { margin-top: 6px; }

/* ------------------------------------------------------------------------- */
/* The Head of Music's full score. */
.preview-line { margin: -14px 0 26px; color: var(--ink2); font-size: 15px; max-width: 74ch; }
.full-score { margin: 0; padding: 20px 22px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--lift); }
.fs-scroll { overflow-x: auto; }
.full-score svg { display: block; width: 100%; min-width: 640px; height: auto; overflow: visible; }
.fs-part { font: italic 400 17px var(--serif); fill: var(--ink); }
.fs-who { font: 500 12.5px var(--font); fill: var(--ink3); }
.fs-num { font: italic 400 12px var(--serif); fill: var(--ink3); }
.fs-line { stroke: var(--ink); stroke-opacity: .32; stroke-width: 1.1; }
.fs-bar { stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.3; }
.fs-bracket { stroke: var(--ink); stroke-width: 4.2; fill: none; stroke-linecap: butt; }
.fs-curl { fill: var(--ink); }
.full-score ellipse.on { fill: var(--ink); }
.full-score ellipse.off { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.full-score figcaption { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; color: var(--ink2); font-size: 13.5px; }
.full-score figcaption span { display: inline-flex; align-items: center; gap: 8px; }
.full-score figcaption i { width: 12px; height: 8.5px; border-radius: 50%; transform: rotate(-22deg); border: 1.5px solid var(--ink); }
.full-score figcaption i.on { background: var(--ink); }
.dept-quiet { margin: -18px 2px 30px; }
.stuck-list { border-top: 1px solid var(--hair); }
.stuck-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--hair); }
.stuck-row b { display: block; font-weight: 650; }
.stuck-row span:not(.status):not(.ring) { display: block; color: var(--ink2); font-size: 14px; margin-top: 1px; }

/* Small screens */
@media (max-width: 1100px) {
  .sheet.has-music { grid-template-columns: minmax(0, 1fr); }
  .sheet-music { order: 2; }
  .context-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sheet { padding: 22px 20px 24px; gap: 20px; border-radius: 16px; }
  .sheet h2 { font-size: 31px; }
  .said.instruction .quote { font-size: 18px; }
  .sheet-actions { display: grid; }
  .sheet-actions .btn { width: 100%; }
  .tl-hour, .tl-now { grid-template-columns: 44px minmax(0, 1fr); }
  .tl-lesson { padding-left: 0; }
  /* The same three columns as on a desk (avatar, the lesson, the time), only tighter; the card
     takes the full width under its hour line so a title like "Minuet in G" never breaks. */
  .lesson-card { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 3px 10px; padding: 12px 14px; }
  .lesson-card .avatar { width: 34px; height: 34px; font-size: 11.5px; }
  .lc-when .num { font-size: 16px; }
  .lc-said { grid-column: 1 / -1; }
  .week-card { padding: 14px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring.draw path { animation: none; stroke-dashoffset: 0; }
}

/* Music drawings are filled shapes and hairlines: none of the icon stroke applies to them. */
svg.music, .week-bar svg, .full-score svg, .noteheads svg { stroke: none; fill: none; stroke-width: 1; stroke-linecap: butt; }
svg.music { fill: currentColor; }
svg.music use { stroke: none; }
.week-bar svg text, .full-score svg text, svg.music text { stroke: none; }
.week-bar .rest { fill: var(--ink); stroke: none; }
.week-bar .slot-today { fill: none; stroke: var(--accent-on); }
.week-bar.mini .nh { fill: var(--accent-on); }
.week-bar.mini .nh.dyn0 { opacity: .5; } .week-bar.mini .nh.dyn1 { opacity: .68; } .week-bar.mini .nh.dyn2 { opacity: .84; }
.mini-week .week-bar svg { height: 30px; max-width: none; }
.week-bar.large { container-type: inline-size; }
.week-bar.large .narrow { display: none; }
@container (max-width: 560px) { .week-bar.large .wide { display: none; } .week-bar.large .narrow { display: block; } }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 2.4% 0 9.2%; margin-top: 2px; text-align: center; }
.narrow .week-days { padding: 0 4.5% 0 13%; }
.week-days span { display: grid; gap: 1px; }
.week-days b { font-weight: 600; font-size: 13.5px; color: var(--ink3); }
.week-days small { font: 400 13px var(--serif); color: var(--ink2); }
.week-days .today b { color: var(--accent-on); font-weight: 700; }
.week-days .lesson-mark { font-style: italic; color: var(--accent-on); }
.week-bar.large figcaption { display: block; margin-top: 10px; }
.week-bar.large figcaption span::before { content: none; }
/* Rows lead with a plain icon in the role colour, not an icon in a tinted tile. */
.item-icon { width: 28px; height: 40px; border-radius: 0; background: none; }
.item-icon svg { width: 21px; height: 21px; }
.tool-card .item-icon { width: 36px; background: none; }
.tool-card .item-icon svg { width: 26px; height: 26px; }
.material .item-icon { width: 28px; background: none; }
.noteheads svg { height: 14px; }
/* Leland noteheads and rests are filled outlines. */
.week-bar .note .head path { fill: var(--accent-on); }
.week-bar.mini .nh { fill: var(--accent-on); }
.noteheads path { fill: var(--ink); stroke: none; }
.full-score path.on, .full-score path.off { fill: var(--ink); stroke: none; }
.sheet-text > .marks { margin-bottom: 20px; }
/* Phones and narrow windows: the bars come straight after the title and marks. */
@media (max-width: 1100px) {
  .sheet.has-music { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .sheet.has-music .sheet-text { display: contents; }
  .sheet.has-music .sheet-music { order: 3; margin: 0 0 18px; }
  .sheet.has-music .sheet-top { order: 0; } .sheet.has-music h2 { order: 1; } .sheet.has-music .marks { order: 2; }
  .sheet.has-music .said.instruction { order: 4; } .sheet.has-music .listen { order: 5; } .sheet.has-music .sheet-actions { order: 6; } .sheet.has-music .told { order: 7; }
  .sheet-music > .fine { display: none; }
}
@container (min-width: 520px) { .week-card .week-bar.large figcaption { display: block; } }
.narrow .week-days small { font-size: 12px; }
.narrow .week-days small:not(.lesson-mark) { font-size: 0; }
.narrow .week-days small:not(.lesson-mark)::before { content: attr(data-min); font-size: 12.5px; }

/* The check-in with trouble spots (flagship 2). Status words in their colours, bars as
   rehearsal numbers or tapped on the music, what happened as plain chips. */
.checkin-lede { margin: -6px 0 2px; color: var(--ink2); font-size: 15px; }
.how { display: grid; gap: 8px; }
.how label { position: relative; display: block; }
.how input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.how span { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; min-height: 54px; padding: 15px 16px 13px; border-radius: 12px; border: 1px solid var(--hair-strong); background: var(--raised); transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease); }
.how b { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.how small { color: var(--ink2); font-size: 13.5px; text-align: right; }
.how label.well b { color: var(--well); }
.how label.stuck b { color: var(--stuck); }
.how label.help b { color: var(--help); }
.how label.well input:checked + span { border-color: var(--well); box-shadow: inset 0 0 0 1px var(--well); background: color-mix(in srgb, var(--forest) 7%, var(--raised)); }
.how label.stuck input:checked + span { border-color: var(--stuck); box-shadow: inset 0 0 0 1px var(--stuck); background: color-mix(in srgb, var(--amber) 13%, var(--raised)); }
.how label.help input:checked + span { border-color: var(--help); box-shadow: inset 0 0 0 1px var(--help); background: color-mix(in srgb, var(--help) 8%, var(--raised)); }
.how input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .how input:not(:checked):hover + span { border-color: var(--ink3); } }

/* Steps appear with a transition from @starting-style, so changing the answer mid-way never restarts them. */
.spot-step { display: grid; gap: 10px; transition: opacity .18s var(--ease), transform .18s var(--ease); }
@starting-style { .spot-step { opacity: 0; transform: translateY(-3px); } }
.spot-step[hidden] { display: none; }
.spot-step h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 0; font-size: 15.5px; font-weight: 700; }
.spot-step h3 small { font-size: 13px; font-weight: 500; color: var(--ink3); }
.spot-step h3 small.nudge { color: var(--stuck); animation: nudge .5s var(--ease); }
@keyframes nudge { 30% { transform: translateX(-3px); } 60% { transform: translateX(2px); } }
.spot-step.better h3 { justify-content: flex-start; gap: 6px; }

.where-music { padding: 6px 8px 2px; border-radius: 10px; background: #FFFEFB; box-shadow: inset 0 0 0 1px rgb(31 27 42 / .08); color: #1F1B2A; }
@media (prefers-color-scheme: dark) { .where-music { background: #F4F1EA; } }
.where-music svg, .where-music img { display: block; width: 100%; height: auto; }
.bar-hit { fill: transparent; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .bar-hit:hover { fill: rgb(232 184 109 / .14); } }
.bar-mark { fill: rgb(232 184 109 / .26); stroke: #B97F21; stroke-width: 1.4px; vector-effect: non-scaling-stroke; animation: mark-in .16s var(--ease) both; }
@keyframes mark-in { from { opacity: 0; } }

.bar-chips, .tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bar-chip { min-width: 44px; min-height: 44px; padding: 2px 10px 0; border-radius: 3px; border: 1.5px solid var(--hair-strong); background: var(--raised); color: var(--ink); font: 700 18px/1 var(--serif); font-variant-numeric: lining-nums; transition: background-color .12s var(--ease), border-color .12s var(--ease), transform .12s var(--ease); }
.bar-chip small { font: italic 400 13px var(--serif); }
.bar-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--amber); color: var(--amber-text); }
.bar-chip.word { padding: 0 14px; border-radius: 10px; border-width: 1px; font: 600 14.5px var(--font); color: var(--ink2); }
.bar-chip.word[aria-pressed="true"] { border-color: var(--ink2); background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink2); }
.bar-chip:active, .tag-chip:active { transform: scale(.96); }
.other-bar input { max-width: 120px; font: 700 18px var(--serif); font-variant-numeric: lining-nums; }
.tag-chip { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--raised); color: var(--ink); font-weight: 600; font-size: 14.5px; transition: background-color .12s var(--ease), border-color .12s var(--ease), transform .12s var(--ease); }
.tag-chip[aria-pressed="true"] { border-color: var(--stuck); color: var(--stuck); background: color-mix(in srgb, var(--amber) 15%, var(--raised)); box-shadow: inset 0 0 0 1px var(--stuck); }
@media (prefers-reduced-motion: reduce) { .spot-step { transform: none; } .bar-mark, .spot-step h3 small.nudge { animation: none; } }

/* The teacher's brief: the passage with the hard bars boxed and their days, then one row per bar. */
.brief-music { margin: 2px 0 12px; }
.day-badge { fill: #835500; }
.day-badge-text { fill: #FFFFFF; font: 700 12.5px var(--font); text-anchor: middle; }
.brief li.spot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; }
.brief li.spot > .ring, .brief li.spot > .bar-fixed { grid-row: 1 / span 2; align-self: start; margin-top: 2px; }
.brief li.spot .spot-title { margin: 0; }
.brief li.spot .spot-detail { grid-column: 2 / -1; margin: 0; }
.brief li.spot .btn.small { grid-column: 3; grid-row: 1; min-height: 36px; padding: 0 12px; }
.brief .bar-fixed { display: inline-grid; place-items: center; min-width: 30px; height: 26px; margin: 0 4px 0 2px; border-radius: 3px; border: 1.5px solid var(--well); color: var(--well); font: 700 15px/1 var(--serif); font-variant-numeric: lining-nums; }
.brief li.spot.fixed b { color: var(--ink2); }
/* On a phone the full score scrolls sideways; a soft edge says there is more to the right. */
@media (max-width: 700px) {
  .fs-scroll { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
}

/* The bars on the card: adding them in the lesson editor (bars.js). */
.task-row { align-items: flex-start; }
.task-row .item-icon { margin-top: 2px; }
.task-row .item-trail { padding-top: 2px; }
.task-bars { margin-top: 10px; }
.add-bars { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px dashed var(--hair-strong); background: var(--card); color: var(--ink); text-align: left; transition: border-color .15s var(--ease); }
.add-bars:hover { border-color: var(--accent); }
.add-bars > svg { flex-shrink: 0; width: 22px; height: 22px; color: var(--accent-on); }
.add-bars b { display: block; font-weight: 750; font-size: 15px; }
.add-bars small { display: block; color: var(--ink2); font-size: 13.5px; margin-top: 1px; }
.bars-preview { display: grid; gap: 10px; }
.bars-preview .excerpt { max-width: 560px; }
.bars-preview .excerpt img { max-height: 260px; object-fit: contain; object-position: left top; }

/* The box screen: the page as paper, the box ringed in the accent, the rest of the page dimmed. */
@media (min-width: 761px) { .bars-dialog { width: min(980px, calc(100% - 48px)); } }
.bars-lede { margin: 0 0 18px; color: var(--ink2); font-size: 15.5px; line-height: 1.5; max-width: 60ch; }
.bars-dialog .group { margin-bottom: 16px; }
.bars-file { margin-top: 4px; cursor: pointer; }
.bars-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bars-dialog .fine { margin-top: 10px; }
.bars-loading { padding: 48px 0; text-align: center; color: var(--ink2); font-weight: 600; }
.bars-tools { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bars-tools:empty { display: none; }
.bars-page { font-weight: 650; font-size: 14.5px; color: var(--ink2); padding: 0 4px; font-variant-numeric: tabular-nums; }
.bars-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.bars-lines { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bars-lines-label { font-weight: 700; font-size: 14px; color: var(--ink2); margin-right: 4px; }
.bars-lines .bar-chip { min-width: 40px; min-height: 40px; font-size: 16px; }
.bars-lines .bar-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-on); }
.bars-numbers { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink2); }
.bars-numbers input { width: 64px; min-height: 44px; padding: 4px 8px; border-radius: 3px; border: 1.5px solid var(--hair-strong); background: var(--raised); color: var(--ink); text-align: center; font: 700 18px var(--serif); font-variant-numeric: lining-nums; }
.bars-numbers input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.bars-numbers input::placeholder { color: var(--ink3); font-weight: 400; }
.bars-stage { position: relative; overflow: hidden; margin: 0 auto; border-radius: 6px; background: #FFFEFB; box-shadow: inset 0 0 0 1px rgb(31 27 42 / .1); touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.bars-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.bars-page-image { display: block; width: 100%; height: auto; }
.bars-box { position: absolute; border: 2px solid var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 6%, transparent); box-shadow: 0 0 0 100vmax rgb(20 18 32 / .26); cursor: move; }
.bars-box.snapping { transition: left .18s var(--ease), top .18s var(--ease), width .18s var(--ease), height .18s var(--ease); }
.bars-box.too-large { border-color: var(--help); }
.bars-box i { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.bars-box i::before { content: ""; position: absolute; inset: -13px; }
.bars-box [data-handle="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.bars-box [data-handle="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.bars-box [data-handle="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.bars-box [data-handle="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
/* The range it covers, as a rehearsal mark sitting on the box. */
.bars-range { position: absolute; left: 10px; top: 0; transform: translateY(-115%); padding: 1px 7px 2px; border: 1.5px solid #1F1B2A; border-radius: 3px; background: #FFFEFB; color: #1F1B2A; font: 700 14px/1.2 var(--serif); font-variant-numeric: lining-nums; white-space: nowrap; pointer-events: none; }
.bars-hint { margin: 10px 0 12px; color: var(--ink2); font-size: 14.5px; }
.bars-note { margin: 12px 0 0; color: var(--ink2); font-size: 14px; }
.bars-note.warn { color: var(--help); font-weight: 650; }
.bars-dialog .form-error { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .bars-box.snapping { transition: none; } }
/* Boxed music on the pupil's card: small bar numbers, the bars outside the passage faded, and
   in the check-in each bar a tap target. The overlay shares the image's own pixel grid. */
.excerpt-art { position: relative; display: block; }
.excerpt-art img { display: block; width: 100%; height: auto; }
.excerpt-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; stroke: none; fill: none; }
.excerpt-marks .bar-fade { fill: #FFFEFB; opacity: .66; }
.excerpt-marks .bar-no { font-family: var(--serif); font-style: italic; fill: #6E697B; text-anchor: middle; }
.bars-lines .bar-chip.range { padding: 2px 10px 0; font-size: 15px; }
.bars-held { margin: 12px 0 0; color: var(--ink2); font-size: 14px; }
.bars-held.warn { color: var(--help); font-weight: 650; }
@media (prefers-color-scheme: dark) { .excerpt-marks .bar-fade { fill: #F4F1EA; } }
/* A boxed image is white; multiplied onto the paper panel it takes the panel's tone in dark mode. */
.excerpt, .where-music, .bars-preview .excerpt { isolation: isolate; }
.excerpt img, .where-music img { mix-blend-mode: multiply; }

/* The guided week (guide.js): one line beside the thing to press. It floats at the bottom of the page,
   and becomes a band at the top of the lesson's dialog while that is open. */
.guide { position: fixed; z-index: 60; left: 24px; bottom: calc(24px + var(--guide-lift, 0px) + env(safe-area-inset-bottom)); width: min(400px, calc(100vw - 32px)); padding: 16px 18px 10px; border-radius: 18px; background: var(--raised); color: var(--ink); box-shadow: var(--shadow-lift), 0 0 0 1px var(--hair); animation: rise .26s var(--drawer); }
.guide.in-dialog { position: sticky; left: auto; bottom: auto; z-index: 2; width: auto; margin: 0; padding: 14px 20px 8px; border-radius: 0; background: color-mix(in srgb, var(--accent) 9%, var(--raised)); box-shadow: 0 1px 0 var(--hair); animation: none; }
.guide-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 16px; }
.guide-step { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 2px solid currentColor; border-radius: 3px; font: 700 15px/1 var(--serif); }
.guide-step.guide-fine { border: 0; padding: 0; font-style: italic; font-weight: 700; font-size: 17px; }
.guide-of { margin-left: auto; color: var(--ink3); font-size: 13px; }
.guide p { max-width: none; margin: 0 0 6px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.guide-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.guide-target { outline: 3px solid var(--accent-on); outline-offset: 3px; animation: guide-pulse 1.6s ease-in-out infinite; }
@keyframes guide-pulse { 50% { outline-offset: 6px; outline-color: color-mix(in srgb, var(--accent-on) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .guide-target { animation: none; } }
@media (max-width: 760px) {
  .guide { left: 12px; right: 12px; width: auto; bottom: calc(12px + var(--guide-lift, 0px) + env(safe-area-inset-bottom)); }
  .demo-bar .guide-link { display: none; }
}
