/* ============================================================
   Music Tester's design system, v1 (J27's mockups, approved by
   the owner 2026-11-28; built in J39). The reference is
   docs/mockups/J27/ (ui.css, ui2.css, words.md, editor2.html).
   Geist for everything read and pressed; Campton only for a page's
   title and a project's name (--font-title); corners 6 / 8 / 12;
   capital first letters on everything that isn't a sentence,
   written so in the markup.
   ============================================================ */

/* The site's own files: no font is fetched from anyone else */
@font-face { font-family: "Geist"; font-weight: 100 900; font-style: normal; src: url("geist.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Campton"; font-weight: 600; src: url("campton-semibold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Campton"; font-weight: 700; src: url("campton-bold.woff2") format("woff2"); font-display: swap; }

:root {
  /* The grey scale on true black (the brand's) */
  --black: #000000;
  --ink: #0d0d0d;
  --charcoal: #1a1a1a;
  --graphite: #262626;
  --iron: #3d3d3d;
  --steel: #595959;
  --fog: #8a8a8a;
  --mist: #b8b8b8;
  --white: #ffffff;

  /* Colour: the app's green and pink, and the brand's red and amber */
  --green: #00F5A0;       /* primary action, on, selected, focus */
  --pink: #FF2D85;        /* markers; never an error */
  --signal-text: #ff3b30; /* danger: red words, and red buttons with black words */
  --amber: #d49a1f;       /* warnings */
  --mute: #00B8F0;        /* mute, when on */
  --solo: #FFD43B;        /* solo, when on */

  /* What each is for */
  --bg: var(--black);
  --surface-1: var(--ink);       /* panels, inputs */
  --surface-2: var(--charcoal);  /* raised: cards, controls, menus, dialogs */
  --surface-3: var(--graphite);  /* hover */
  --line: var(--graphite);
  --line-strong: var(--iron);
  --text: var(--white);
  --text-2: var(--mist);
  --text-3: var(--fog);
  --text-off: var(--steel);
  --accent: var(--green);
  --on-accent: var(--black);
  --danger: var(--signal-text);
  --focus: var(--green);

  /* Type */
  --font: "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-title: "Campton", "Geist", "Helvetica Neue", Arial, sans-serif;
  --fs-11: 11px;  /* eyebrows (capitals, tracked) */
  --fs-12: 12px;  /* captions, meta, small print */
  --fs-13: 13px;  /* dense UI: rows, buttons, inputs */
  --fs-14: 14px;  /* body, menus, dialog text */
  --fs-16: 16px;  /* dialog titles */
  --fs-28: 28px;  /* page titles (Campton, capitals) */
  --fs-40: 40px;  /* the sign-in page's line */

  /* Corners (Soft) */
  --r-1: 6px;   /* small: tags, chips */
  --r-2: 8px;   /* controls */
  --r-3: 12px;  /* panels, cards, rows, menus, dialogs */

  /* Controls */
  --ctl: 32px;
  --ctl-sm: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 120ms;
  --base: 200ms;
  --shadow-pop: 0 16px 48px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* Today's names, kept so the editor's working area (rebuilt in later jobs)
     takes the system's values */
  --panel: var(--surface-1);
  --panel-2: var(--surface-2);
  --muted: var(--text-3);
  --radius: var(--r-3);
}

/* A finger needs room */
@media (hover: none) {
  :root { --ctl: 44px; --ctl-sm: 36px; }
}

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

html, body {
  height: 100%;
}
/* A double tap never zooms the page (T-159: the owner's iPhone, zoom in pressed
   twice); a pinch still does, and the lane's own pinch is its own (pan-y) */
html { touch-action: manipulation; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* Views and buttons set their own display, so make `hidden` win everywhere. */
[hidden] { display: none !important; }

/* One focus ring everywhere, for the keyboard */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--text-3); }
.small-text { font-size: var(--fs-12); line-height: 1.5; margin: 8px 0 12px; }
.eyebrow { font-size: var(--fs-11); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }

/* Line icons */
svg.stroke {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 14px; height: 14px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ctl);
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast);
}
.btn:hover { background: var(--surface-3); border-color: #555; }
.btn:active { background: #1f1f1f; }
.btn:disabled { background: transparent; border-color: var(--line); color: var(--text-off); cursor: default; }
.btn.small { min-height: 28px; padding: 0 10px; font-size: var(--fs-12); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: #5cffc1; border-color: #5cffc1; }
.btn.primary:active { background: #00c985; border-color: #00c985; }
.btn.primary:disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-off); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }

/* Red with black words (never white on red) */
.btn.danger { background: var(--signal-text); border-color: var(--signal-text); color: #000; font-weight: 600; }
.btn.danger:hover { background: #ff5a50; border-color: #ff5a50; }
.btn.danger:disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-off); }

/* An icon in place of a word (Share, the cog): always a title and an aria-label */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--ctl);
  height: var(--ctl);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { color: var(--text-off); cursor: default; }
.icon-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* A button that reads as a link */
.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-2);
  font-size: var(--fs-13);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--iron);
  cursor: pointer;
}
.link:hover { color: var(--text); }

/* ---------- Inputs ---------- */
.login-form input, .share-row input, .search-form input, .feedback-field textarea, .rename-input {
  min-width: 0;
  min-height: var(--ctl);
  padding: 0 12px;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  color: var(--text);
  font-size: var(--fs-13);
  transition: border-color var(--fast);
}
.login-form input::placeholder, .share-row input::placeholder, .search-form input::placeholder, .feedback-field textarea::placeholder { color: var(--text-3); }
.login-form input:hover, .share-row input:hover, .search-form input:hover, .feedback-field textarea:hover { border-color: #555; }
.login-form input:focus, .share-row input:focus, .search-form input:focus, .feedback-field textarea:focus, .rename-input {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.15);
}
.login-form input[readonly] { color: var(--text-3); }
.login-form input[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }

/* Renaming in place: a project, your name */
.rename-input { width: 240px; padding: 0 8px; min-height: 28px; font-weight: 600; }

/* A switch (settings only; player functions use icon toggles) */
.switch { width: 34px; height: 20px; border-radius: var(--r-3); background: var(--iron); border: 0; position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); transition: transform var(--base) var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(14px); background: var(--black); }

/* A bar (storage) */
.bar { height: 6px; border-radius: 3px; background: var(--graphite); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width var(--base) var(--ease); }
.bar.warn > i { background: var(--amber); }
.bar.full > i { background: var(--signal-text); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px 8px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

/* The sign-in page has its own brand panel */
body:has(#viewLogin:not([hidden])) .topbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* The logo, a hairline and the name: home */
.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  margin: -4px -6px;
  background: none;
  border: none;
  border-radius: var(--r-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.brand-home:hover { background: var(--surface-2); }
.brand-logo { display: block; height: 20px; width: auto; }
.brand-rule { width: 1px; height: 20px; background: var(--iron); }
.brand-name { font-size: 15px; font-weight: 500; letter-spacing: -0.005em; }

/* Beta: small grey capitals, plainly a label and not a button */
.beta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* Touch screens have no hover to show it's a link: a back arrow instead */
.home-chevron { display: none; width: 18px; height: 18px; margin-right: -6px; flex-shrink: 0; }

.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.crumb-sep { color: var(--iron); }
/* Renaming the project: the box gives way too, and stops short of the buttons */
.crumb-title .rename-input { flex: 0 1 240px; width: 240px; min-width: 80px; max-width: 100%; }
.crumb-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* A project's name: Campton (the second of its two places) */
.crumb-name {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px dashed transparent;
}
.crumb-name:hover { border-bottom-color: var(--text-3); }

/* Saved, as a word with a tick, beside the name */
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--text-3);
  white-space: nowrap;
  cursor: default;
}
.save-state svg { width: 12px; height: 12px; }
.save-state:is([data-state="saving"], [data-state="error"], [data-state="offline"]) svg { display: none; }
.save-state[data-state="error"] { color: var(--danger); }
.save-state[data-state="offline"] { color: var(--amber); }

.crumb-note {
  color: var(--text-3);
  font-size: var(--fs-12);
  white-space: nowrap;
}

/* Its buttons keep their size; the project's name gives way */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Signed in: Feedback and the cog */
.account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
/* With no editor buttons beside it (the picker), no divider is needed */
.topbar-actions[hidden] ~ .account { padding-left: 0; border-left: none; }

/* ---------- The cog's menu (part 7) ---------- */
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 320px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-pop);
}
.menu-who { padding: 10px 10px 8px; min-width: 0; }
/* Your name: press it (or its pencil) to change it, in place */
.menu-name-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.menu-name {
  min-width: 0;
  padding: 4px 6px;
  margin: -4px 0 -4px -6px;
  border-radius: var(--r-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}
.menu-name:hover { background: var(--surface-3); }
.name-pencil { width: 24px; height: 24px; color: var(--text-3); }
.name-pencil svg { width: 14px; height: 14px; }
.menu-name[hidden] ~ .name-pencil { display: none; }
.menu-name-row .rename-input { flex: 1; width: auto; font-size: 15px; }
.menu-email { margin-top: 6px; font-size: var(--fs-13); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-storage { padding: 8px 10px 10px; }
.menu-storage-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.menu-storage-top b { font-size: var(--fs-12); color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.menu-storage p { margin: 8px 0 0; font-size: var(--fs-12); color: var(--text-3); line-height: 1.4; }
.menu-storage p:empty { display: none; }
.menu-storage p.warn { color: var(--amber); }
.menu-storage p.full { color: var(--danger); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-14);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-foot { padding: 6px 10px 4px; font-size: var(--fs-12); color: var(--text-3); }
.menu-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; }
.menu-switch-words { font-size: var(--fs-14); color: var(--text); }
.menu-switch-words small { display: block; font-size: var(--fs-12); color: var(--text-3); }

/* ---------- First run (part 9): Show Guidance's steps, and the hint ---------- */
/* The steps read as instructions, not buttons (the owner's look at J44: "Looks like a
   button. None of these are buttons"): words in a line, each with its number or a
   tick, nothing behind them; the next one green */
.guide-bar { display: flex; align-items: center; gap: 28px; padding: 9px 14px 9px 20px; border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.guide-bar:has(+ .app[hidden]) { display: none !important; } /* only over the editor */
.guide-step { flex: 0 1 auto; min-width: 0; font-size: var(--fs-13); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.guide-num { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 6px; }
.guide-step.is-next, .guide-step.is-next .guide-num { color: var(--green); font-weight: 600; }
.guide-step.is-done { color: var(--text-2); }
.guide-step.is-done .guide-num { color: var(--green); }
.guide-x { flex: none; margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: var(--r-1); }
.guide-x:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 600px) { .guide-step:not(.is-next) { display: none; } }

/* The hint floats from the transport and the lane's box, over the page, so nothing
   moves when it comes or goes (the owner's look at J44: the picture grew when it
   went). On a computer it sits over the picture's foot, pointing down at the lane;
   up to 900 px under the lane, pointing up at it (below) */
.lane-wrap { position: relative; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; min-width: 0; }
.sync-hint { position: absolute; z-index: 6; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); width: min(420px, calc(100% - 24px));
  background: var(--white); color: var(--black);
  border-radius: var(--r-3); padding: 12px 14px; box-shadow: var(--shadow-pop); font-size: var(--fs-13); line-height: 1.45; }
.sync-hint::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; width: 14px; height: 14px; background: var(--white); transform: rotate(45deg); }
@media (max-width: 900px) {
  /* Under the lane; under the pinned picture (z-index 3) when the page scrolls */
  .sync-hint { z-index: 2; bottom: auto; top: calc(100% + 10px); }
  .sync-hint::after { bottom: auto; top: -7px; }
}
.sync-hint b { display: block; margin-bottom: 2px; }
.sync-hint span { display: block; }
.sync-hint .btn { margin-top: 8px; background: var(--black); color: var(--white); border-color: var(--black); }
body.read-only :is(#guideBar, #syncHint) { display: none !important; }

/* A card's ⋯ menu (the picker) */
.card-menu { top: calc(100% - 10px); right: 8px; width: 200px; }

/* ---------- Sign in (part 8): the brand beside the form ---------- */
.signin {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.signin-brand {
  position: relative;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  background:
    radial-gradient(40% 50% at 62% 46%, rgba(108, 195, 232, 0.55) 0%, rgba(31, 93, 125, 0.35) 35%, transparent 70%),
    radial-gradient(90% 90% at 50% 50%, #0b2533 0%, #050505 70%);
}
.signin-brand::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.8); pointer-events: none; }
.signin-brand > * { position: relative; z-index: 1; }
.signin-lockup { display: inline-flex; align-items: center; gap: 14px; }
.signin-lockup img { height: 32px; width: auto; display: block; }
.signin-lockup .brand-rule { height: 32px; }
.signin-lockup .brand-name { font-size: 22px; }
.signin-brand h2 {
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--fs-40);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  max-width: 420px;
}
.signin-brand p { color: var(--text-2); max-width: 380px; font-size: 15px; line-height: 1.5; }

.signin-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 48px 32px;
}

.login-card h1 { font-size: 24px; font-weight: 600; line-height: 1.2; }
.login-lead {
  color: var(--text-2);
  font-size: var(--fs-14);
  line-height: 1.5;
  margin: 6px 0 20px;
}
.login-lead:empty { display: none; }
/* An email's link: a title and one button, with no line between them */
#confirmForm { margin-top: 20px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--text-2);
}
.signin .login-form input { min-height: 40px; font-size: var(--fs-14); }
.signin .login-form .btn.primary { min-height: 40px; font-size: var(--fs-14); }
.login-form .btn { margin-top: 4px; }

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.login-msg {
  font-size: var(--fs-13);
  line-height: 1.5;
  margin-top: 16px;
}
.login-msg:empty { display: none; }
.login-msg.error { color: var(--danger); }
.login-msg.ok { color: var(--accent); }

/* Sign In | Create Account: the two ways in, side by side at the top */
.seg.login-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-1);
  overflow: visible;
}
.seg.login-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-13);
  font-weight: 500;
}
.seg.login-tabs button + button { border-left: 0; }
.seg.login-tabs button:hover { color: var(--text); }
.seg.login-tabs button.active { background: var(--surface-3); color: var(--text); font-weight: 500; }

/* The bot check's box (a page of the server's own): it sizes itself, and is
   0 high unless Cloudflare needs the person to do something. Empty, it takes
   no room: the form's gap above it is taken back. */
.bot-check iframe { display: block; width: 100%; height: 0; border: 0; background: transparent; }
.bot-check.is-empty { margin-top: -14px; }

.login-terms { font-size: var(--fs-12); color: var(--text-3); line-height: 1.45; }
.login-terms a, .privacy-card a, .login-foot a { color: var(--text-2); }
.login-terms a:hover, .privacy-card a:hover, .login-foot a:hover { color: var(--text); }

/* In beta, and Privacy And Terms, under the form */
.login-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  font-size: var(--fs-12);
  color: var(--text-3);
}
.login-foot a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--iron); }

/* Sent: a tick-mail above the title */
.login-done-icon { display: none; width: 32px; height: 32px; color: var(--accent); margin-bottom: 12px; }
.signin[data-mode="sent"] .login-done-icon { display: block; }

/* ---------- A notice, and Privacy And Terms: one column under the top bar ---------- */
.login {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 40px;
}
.login .login-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 24px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
}
.login .login-card h1 { font-size: 20px; }

/* Privacy and terms (#privacy) */
.login .privacy-card { max-width: 680px; padding: 32px; background: var(--surface-1); border-color: var(--line); }
.privacy-card h1 {
  font-family: var(--font-title);
  font-size: var(--fs-28);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 12px 0 4px;
}
.privacy-card h2 { font-size: 15px; font-weight: 600; margin: 24px 0 6px; }
.privacy-card p, .privacy-card li { font-size: var(--fs-14); line-height: 1.6; color: var(--text-2); }
.privacy-card strong { color: var(--text); font-weight: 600; }
.privacy-card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Projects ---------- */
.picker {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.picker-inner {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 40px;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

/* The page's title: Campton, bold capitals */
.page-title {
  font-family: var(--font-title);
  font-size: var(--fs-28);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.picker .empty {
  max-width: 420px;
  margin: 48px auto 0;
  padding: 32px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-3);
}
.empty-title { font-size: var(--fs-16); font-weight: 600; color: var(--text); }

.project-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.project-card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  cursor: pointer;
  transition: border-color var(--fast);
}
.project-card:hover { border-color: var(--line-strong); }
.project-card:focus-visible { border-color: var(--accent); outline: none; }

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-3) var(--r-3) 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-off);
}
.project-thumb svg { width: 36px; height: 36px; }
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info { padding: 12px 8px 14px 16px; }
.project-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.project-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-name-row .rename-input { flex: 1; width: auto; }
.project-sub {
  font-size: var(--fs-12);
  color: var(--text-3);
  line-height: 1.5;
}

/* The card's ⋯ */
.card-action { width: 28px; height: 28px; margin: -4px 0; }
.card-action svg { width: 18px; height: 18px; }

/* Your Projects, Shared With You */
.picker-subhead { margin: 0 0 12px; }
.shared-projects { margin-top: 36px; }

.picker-error {
  color: var(--danger);
  margin: 0 0 16px;
}

.account-footer { margin-top: 32px; }
.import-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  font-size: var(--fs-13);
}

/* In beta, along the foot of the projects */
.picker-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-12);
  color: var(--text-3);
}

/* ---------- Layout (J40: editor2.html) ---------- */
/* The picture, its transport and the lane on the left; the tabs, Add Music and
   the mixer on the right */
.app {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
}

/* ---------- Stage ---------- */
.stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 14px 14px 12px;
}

.video-frame {
  flex: 1;
  position: relative;
  background: #000;
  border-radius: var(--r-2);
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.video-frame.has-video video { display: block; }
.video-frame.has-video .dropzone { display: none; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
}

.dropzone:hover { border-color: var(--accent); color: var(--text-2); }
.dropzone svg { width: 56px; height: 56px; opacity: 0.5; }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone .drop-title { font-size: var(--fs-16); }
.dropzone .drop-text { font-size: 13px; line-height: 1.5; color: var(--text-3); }

/* Preview Quality (words.md): the account's copy is playing here, on the picture's
   corner and on a track's row; its tooltip says how to get the full quality */
.quality-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-1); background: rgba(0, 0, 0, 0.6);
  font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; flex: none; }
#previewChip { position: absolute; top: 10px; left: 10px; z-index: 2; border: 0; font-family: inherit; cursor: pointer; }
#previewChip:hover, #previewChip[aria-expanded="true"] { color: var(--text); background: rgba(0, 0, 0, 0.8); }
.track-chip { cursor: pointer; }
/* Pressed, a chip says its sentence just under it (a finger can't rest on it: the owner's look at J44) */
.quality-note { position: fixed; z-index: 20; max-width: min(300px, calc(100vw - 16px)); margin: 0; padding: 8px 10px; border-radius: var(--r-2);
  background: var(--white); color: var(--black); font-size: var(--fs-13); line-height: 1.4; box-shadow: var(--shadow-pop); }
.track-chip { height: 18px; padding: 0 6px; margin-left: 6px; background: var(--surface-3); font-size: 10px; vertical-align: middle; }

/* The picture still loading (T-145): said over its place, never pressed */
.video-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-2);
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  z-index: 2;
}
.video-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--iron); border-top-color: var(--text); animation: video-spin 0.8s linear infinite; }
@keyframes video-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .video-spin { animation: none; } }
/* (while the video has no size yet, its "Drop a video here" isn't offered under it) */
.video-frame.is-loading .dropzone { visibility: hidden; }

/* ---------- Transport ---------- */
/* Play, back to the start, loop, the time, the line about a track you can't
   hear; the zoom on the right */
.transport { display: flex; flex-direction: column; flex-shrink: 0; }
.transport-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; row-gap: 6px; min-width: 0; }
.transport-gap { flex: 1; }
.transport .icon-btn { width: 36px; height: 36px; color: var(--text); }
.transport .icon-btn:disabled { color: var(--text-off); }
.icon-btn svg.stroke { width: 19px; height: 19px; }
/* Play: round and white, the transport's one big control */
#playBtn { width: 40px; height: 40px; border-radius: 50%; background: var(--white); color: var(--black); }
#playBtn:hover:not(:disabled) { background: var(--mist); color: var(--black); }
#playBtn:disabled { background: var(--surface-3); color: var(--text-off); }

/* A toggle among the transport's icons: Loop. On = accent, like a player's repeat */
.icon-btn.toggle-icon { color: var(--text-3); }
.icon-btn.toggle-icon[aria-pressed="true"] { color: var(--accent); background: rgba(0, 245, 160, 0.12); }

.times { margin-left: 6px; white-space: nowrap; font-size: var(--fs-13); font-weight: 500; font-variant-numeric: tabular-nums; }
.times .muted { color: var(--text-3); }
/* No video yet (first run, part 9): the words in place of the time, as long as
   the picture's place is empty (the drop zone's own rule) */
.times .no-video-yet { display: none; color: var(--text-3); }
.app:has(.video-frame:not(.has-video)) .times .timecode { display: none; }
.app:has(.video-frame:not(.has-video)) .times .no-video-yet { display: inline; }

/* A track you can't hear: one line, with the fix. Nothing in the mixer flashes. */
.hear-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 2px 0 10px;
  margin-left: 4px;
  border-radius: var(--r-2);
  background: rgba(0, 184, 240, 0.12);
  border: 1px solid rgba(0, 184, 240, 0.55);
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
}
.hear-line svg { color: var(--mute); }
.hear-line .btn { height: 24px; }
.hear-x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 4px 6px; font-size: 13px; }
.hear-x:hover { color: var(--text); }

.timecode { font-variant-numeric: tabular-nums; }

/* ---------- The lane: the picked track under the picture ---------- */
.timeline {
  position: relative;
  /* A stacking context of its own (T-153): its handles, playhead and tip
     (z-index 3 to 5) stay inside it, so up to 900 px, where the video is
     pinned (z-index 3) and the page scrolls under it, they go under the
     picture with the lane instead of being drawn over it */
  isolation: isolate;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tl-lab { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 10px; border-right: 1px solid var(--line); color: var(--text-3); }
.tl-lab .eyebrow { font-size: 10px; }
.tl-ruler, .tl-lab:first-child { height: 24px; border-bottom: 1px solid var(--line); }
.tl-ruler { position: relative; cursor: pointer; overflow: hidden; touch-action: pan-y; }
.tl-ruler .tick { position: absolute; bottom: 0; width: 1px; height: 5px; background: var(--iron); }
.tl-ruler .tick.big { height: 9px; background: var(--fog); }
.tl-ruler .num { position: absolute; top: 3px; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-ruler:focus-visible { outline-offset: -2px; }
.tl-lab-pic, .tl-film { height: 30px; border-bottom: 1px solid var(--line); }
.tl-film { position: relative; display: flex; overflow: hidden; background: var(--surface-1); cursor: pointer; touch-action: pan-y; }
.tl-film i { flex: 1; min-width: 0; border-right: 1px solid #000; background-size: cover; background-position: center; }
/* A view link's row: the strip the editor kept, drawn on a canvas (T-144) */
.tl-film .tl-strip { width: 100%; height: 100%; display: block; }
.tl-lab-music { height: 76px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; border-left: 4px solid var(--track-color, var(--line-strong)); color: var(--text); }
.tl-lab-music b { max-width: 100%; font-size: var(--fs-13); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lab-music span { max-width: 100%; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lane { position: relative; height: 76px; background: var(--surface-1); cursor: grab; touch-action: pan-y; }
.tl-lane.is-dragging { cursor: grabbing; }
.tl-lane.is-empty, body.read-only .tl-lane { cursor: default; }
.tl-lane canvas { position: absolute; left: 0; top: 7px; width: 100%; height: calc(100% - 14px); }
.tl-lane:focus-visible { outline-offset: -2px; }
.tl-edge { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; padding: 2px 6px; font-size: 10px; font-weight: 600; color: var(--text-2);
  background: rgba(13, 13, 13, 0.85); border: 1px solid var(--line-strong); border-radius: var(--r-1); pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-edge.l { left: 10px; }
.tl-edge.r { right: 10px; }
.tl-empty { position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center; padding: 0 10px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-2); color: var(--text-3); font-size: var(--fs-13); }
.tl-empty:empty { display: none; }
.tl-msg { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 11px; color: var(--text-3); pointer-events: none; }
/* The fades' handles (dots on the top corners) and the trims' (brackets on the
   bottom corners): J41, as editor2.html draws them. Each a bigger target than
   it looks (::after). */
.tl-handles { position: absolute; z-index: 3; pointer-events: none; } /* placed over the lane (placeHandles) */
.tl-handles > * { pointer-events: auto; }
.tl-handles > .tl-tip { pointer-events: none; }
.tl-fh { position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); cursor: ew-resize; z-index: 3; touch-action: none; }
.tl-th { position: absolute; bottom: 3px; width: 12px; height: 18px; z-index: 3; cursor: ew-resize; touch-action: none; border: 2px solid #fff; background: rgba(0, 0, 0, 0.5); }
.tl-th.l { border-right: 0; border-radius: 4px 0 0 4px; }
.tl-th.r { margin-left: -12px; border-left: 0; border-radius: 0 4px 4px 0; }
/* Wider than they look sideways and into the lane, but never past its top or
   bottom: nothing over the picture's row, the ruler, or Undo and Save */
.tl-fh::after, .tl-th::after { content: ''; position: absolute; left: -12px; right: -12px; }
.tl-fh::after { top: -3px; bottom: -12px; }
.tl-th::after { top: -12px; bottom: -3px; }
.tl-fh:focus-visible, .tl-th:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* While a handle's dragged: what it's set to */
.tl-tip { position: absolute; top: 22px; transform: translateX(-50%); z-index: 4; padding: 2px 6px; font-size: 11px; font-weight: 600; color: var(--text);
  background: rgba(13, 13, 13, 0.9); border: 1px solid var(--line-strong); border-radius: var(--r-1); pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (hover: none) {
  .tl-fh { width: 18px; height: 18px; margin-left: -9px; }
  .tl-th { width: 16px; height: 22px; }
  .tl-th.r { margin-left: -16px; }
}
/* Still being read: a plain line, shimmering */
.tl-lane.is-working::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: wave-working 1.4s linear infinite;
  pointer-events: none;
}
@keyframes wave-working { from { background-position: -100% 0; } to { background-position: 200% 0; } }
.tl-lab-foot, .tl-foot { height: 40px; border-top: 1px solid var(--line); }
.tl-foot { display: flex; align-items: center; gap: 10px; padding: 0 10px; min-width: 0; }
.tl-foot .kv { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.tl-foot .kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-gap { flex: 1; }
.tl-saved { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; cursor: default; }
.timeline.no-track .tl-foot > * { visibility: hidden; }
/* The playhead: one for the picture and the music */
.tl-head { position: absolute; top: 0; bottom: 40px; width: 2px; margin-left: -1px; background: var(--text); z-index: 5; pointer-events: none; }
.tl-head::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top: 8px solid var(--text); }

/* ---------- Panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.tab-btn {
  position: relative;
  flex: 1;
  min-height: 44px;
  padding: 0 12px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-weight: 500;
  font-size: var(--fs-13);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 1px; background: var(--accent); }

.tab {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

.tab.active { display: flex; }

.empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.empty p + p { margin-top: 10px; }
.empty[hidden] { display: none; }

/* ---------- Track list ---------- */
.track-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* A row (J42, part-row.html): its name and artist, under them its waveform
   (the whole track, the part that plays under the picture lit), beside them
   its time and its bin. The whole row is pressed to pick it; the picked row
   is lit. Its element is kept for as long as the track is (app.js, THE ROWS). */
.track {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto 20px;
  column-gap: 6px;
  row-gap: 5px;
  align-items: center;
  padding: 8px 4px 8px 14px;
  background: var(--panel-2);
  border-radius: var(--r-3);
  overflow: hidden;
  cursor: pointer;
}
.track::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--track-color); }
.track:hover { background: #202020; }
.track.active { background: var(--surface-3); }
.track.active::before { width: 5px; }

.track-main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.track-text {
  min-width: 0;
}

.track-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track.active .track-name { color: var(--text); font-weight: 600; }

.track-artist {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-main .track-name { flex: 0 1 auto; min-width: 0; }
.track-main .track-artist { flex: 1 1 0; min-width: 0; }

/* The second line: the waveform (dragged left or right to sync, as the lane
   is; a finger moving up or down scrolls the list) */
.track-line { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 8px; min-width: 0; }
.track-wave { flex: 1 1 0; min-width: 0; width: 100%; height: 20px; display: block; cursor: ew-resize; touch-action: pan-y; }
body.read-only .track-wave { cursor: pointer; }
.track.is-dragging { background: var(--surface-3); }
.track-drag {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--r-1);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.track-time {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.track.active .track-time { color: var(--track-color); }

/* In the waveform's place: "Loading…", where its file is (J22), or that it
   couldn't load (pressing the row tries again) */
.track.has-state .track-line { display: none; }
.track.has-state .track-time {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track.has-state .track-time.is-waiting { white-space: normal; line-height: 1.25; }
.track.has-state:has(.track-time.is-waiting) { grid-template-rows: auto auto; }
.track.is-failed .track-time { color: var(--danger); }

/* The bin: always there, quiet until it's pointed at; a thumb's size on a touch screen */
.track-bin {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.track-bin:hover, .track-bin:focus-visible { color: var(--danger); background: rgba(255, 59, 48, 0.12); }
@media (hover: none) { .track-bin { width: 44px; height: 44px; } }
body.read-only .track-bin { display: none; }

/* A track removed, in its row's place, for as long as its Undo is up */
.track-gone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 6px 4px 14px;
  border-radius: var(--r-3);
  border: 1px dashed var(--line-strong, var(--line));
  color: var(--text-3);
  font-size: 13px;
  overflow: hidden;
}
.track-gone b { flex: 1; min-width: 0; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-gone .drain { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--text-3); animation: track-drain var(--ttl, 8s) linear forwards; }
@keyframes track-drain { from { width: 100%; } to { width: 0; } }
@media (prefers-reduced-motion: reduce) { .track-gone .drain { animation: none; width: 0; } }

/* Read by a screen reader only */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.remove:hover { color: var(--danger); }

/* ---------- The mixer, under Add Music ---------- */
.mixdock { flex-shrink: 0; display: flex; flex-direction: column; gap: 0; padding: 6px 12px 10px; border-top: 1px solid var(--line); }
.mix-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: -6px; position: relative; z-index: 1; }
.mix-fold { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); font-size: var(--fs-12); cursor: pointer; }
.mix-fold:hover { background: var(--surface-2); color: var(--text); }
.mix-fold svg { transition: transform var(--base) var(--ease); }
.mix-body { display: flex; justify-content: center; gap: 8px; }
.mix-grp { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 8px; border-radius: var(--r-3); border: 1px solid transparent; }
.mix-vid { border-color: var(--line-strong); background: var(--surface-2); }
/* Each channel one fixed width, whatever the picked track's name (T-156: the
   pair is centred, so a channel as wide as its name moved both on a pick);
   a long name is cut short with … */
.mix-vid, .mix-mus { box-sizing: border-box; width: 138px; flex: none; }
.mix-top { max-width: 100%; min-width: 0; }
.mix-mus .spotify-chip { max-width: 100%; overflow: hidden; }
.mix-top { height: 38px; display: flex; align-items: center; justify-content: center; }
.ms-row { display: flex; gap: 4px; }
.ms {
  width: 28px; height: 24px;
  border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.ms:hover { color: var(--text); border-color: var(--fog); }
.ms.mute[aria-pressed="true"] { background: var(--mute); border-color: var(--mute); color: #000; }
.ms.solo[aria-pressed="true"] { background: var(--solo); border-color: var(--solo); color: #000; }
.db { height: 16px; font-size: var(--fs-12); color: var(--text-2); font-variant-numeric: tabular-nums; }
.mix-grp.is-muted .db { color: var(--text-off); }
.ch-name { font-size: var(--fs-13); font-weight: 600; }
.now { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; font-size: var(--fs-12); font-weight: 600; }
.now i { width: 8px; height: 8px; border-radius: 50%; background: var(--track-color); flex: none; }
.now span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now.none { color: var(--text-3); font-weight: 500; }
.now.none i { display: none; }

/* An upright fader: its scale on the left, the rail, a console's cap. Dragged
   with the pointer held on the fader itself, which nothing redraws. */
.vfader { position: relative; width: 64px; height: 150px; touch-action: none; cursor: ns-resize; }
.vfader .rail { position: absolute; left: 40px; top: 6px; bottom: 6px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--graphite); }
.vfader .fill { position: absolute; left: 40px; bottom: 6px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--mist); }
.mix-mus .vfader .fill { background: var(--track-color, var(--mist)); }
.vfader .cap { position: absolute; left: 40px; width: 28px; height: 14px; margin: -7px 0 0 -14px; border-radius: var(--r-1); background: linear-gradient(#fff, #d9d9d9); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.vfader .cap::after { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; height: 2px; border-radius: 1px; background: #111; }
.vfader .tk { position: absolute; left: 0; width: 26px; text-align: right; font-size: 9px; font-weight: 600; color: var(--text-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.vfader .tl { position: absolute; left: 29px; width: 6px; height: 1px; background: var(--iron); }
.vfader .tl.zero { width: 22px; background: var(--fog); }
.vfader:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
.mix-grp.is-muted .vfader .fill { background: var(--iron); }
.mix-grp.is-muted .vfader .cap { background: linear-gradient(#9a9a9a, #7a7a7a); }

/* The original music's control: small and round. Colour means on. */
.orig { display: flex; align-items: center; gap: 8px; }
.orig-btn {
  position: relative; width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--green); background: var(--green); color: #000; cursor: pointer;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.orig-btn:hover { background: #5cffc1; }
.orig-ic { width: 18px; height: 18px; display: none; }
.orig[data-state="on"] .orig-ic-on, .orig[data-state="working"] .orig-ic-on, .orig[data-state="limit"] .orig-ic-on { display: block; }
.orig[data-state="off"] .orig-ic-off, .orig[data-state="fail"] .orig-ic-fail { display: block; }
.orig[data-state="off"] .orig-btn { background: transparent; border: 1.5px solid #fff; color: #fff; }
.orig[data-state="fail"] .orig-btn { background: transparent; border-color: var(--danger); color: var(--danger); }
.orig[data-state="limit"] .orig-btn, .orig-btn:disabled { background: transparent; border-color: var(--line); color: var(--text-off); cursor: default; }
.orig[data-state="working"] .orig-btn { cursor: default; border-color: transparent; }
.orig-ring { position: absolute; inset: -4px; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; display: none; }
.orig[data-state="working"] .orig-ring { display: block; }
.orig-ring circle { fill: none; stroke-width: 3; }
.orig-ring .bg { stroke: var(--graphite); }
.orig-ring .fg { stroke-linecap: round; transition: stroke-dashoffset 600ms linear; }
.orig-txt { display: flex; flex-direction: column; align-items: flex-start; }
.orig-lab { font-size: 11px; font-weight: 500; color: var(--text-2); line-height: 1.2; white-space: nowrap; }
.orig-st { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--green); white-space: nowrap; }
.orig[data-state="off"] .orig-st { color: #fff; }
.orig[data-state="working"] .orig-st, .orig[data-state="limit"] .orig-st { color: var(--text-3); }
.orig[data-state="fail"] .orig-st { color: var(--danger); }
.dots { display: inline-block; width: 1.2em; text-align: left; }
.dots i { font-style: normal; animation: dot 1.6s infinite; }
.dots i:nth-child(2) { animation-name: dot2; }
.dots i:nth-child(3) { animation-name: dot3; }
@keyframes dot { 0%, 24% { opacity: 0; } 25%, 100% { opacity: 1; } }
@keyframes dot2 { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes dot3 { 0%, 74% { opacity: 0; } 75%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dots i { animation: none !important; opacity: 1 !important; }
  .orig-ring .fg { transition: none; }
}

/* Folded away: one strip, the same grouping (the original music and Video in
   one pill, then the track's name). Never in the phone's sheet, which is the
   fold itself. */
@media (min-width: 601px) {
  .mixdock.folded .mix-head { margin-bottom: 4px; }
  .mixdock.folded .mix-fold svg { transform: rotate(180deg); }
  .mixdock.folded .mix-body { align-items: center; gap: 14px; }
  .mixdock.folded .mix-grp { flex-direction: row; gap: 6px; padding: 4px 8px 4px 4px; }
  .mixdock.folded .mix-vid { border-radius: 22px; }
  .mixdock.folded .mix-vid { width: auto; } /* (its parts never change width) */
  /* The strip's Music: as wide as the room allows, up to 180 px, never as its name (T-156) */
  .mixdock.folded .mix-mus { padding: 0; width: auto; flex: 1 1 0; min-width: 0; max-width: 180px; justify-content: flex-start; }
  .mixdock.folded .mix-mus .mix-top { flex: 1 1 0; min-width: 0; justify-content: flex-start; }
  .mixdock.folded :is(.vfader, .solo, .orig-txt, .orig-why) { display: none; }
  .mixdock.folded .mix-top { height: auto; }
  .mixdock.folded .mix-vid .ch-name { order: 1; font-size: var(--fs-12); font-weight: 500; }
  .mixdock.folded .mix-vid .ms-row { order: 2; }
  .mixdock.folded .mix-vid .db { order: 3; }
  .mixdock.folded .mix-mus .ch-name { display: none; }
  .mixdock.folded .ms { width: 24px; height: 22px; font-size: 10px; }
  .mixdock.folded .db { height: auto; min-width: 44px; text-align: right; }
  .mixdock.folded .now span { max-width: none; }
}

/* iPhone and iPad ignore a media element's volume set from code. The music's fader is a gain
   node there (audio.js), but the video's own sound has none, so its fader goes; and a view
   link's tracks play from their elements (until they have small copies), so its music fader goes
   too. */
.no-volume #videoChannel:not(.fader-heard) :is(.vfader, .db), .no-volume.read-only #musicChannel :is(.vfader, .db) { display: none; }

/* Spotify has the music: its chip in place of the track's name, the channel quiet */
#musicChannel.is-spotify .now, #musicChannel.is-spotify .ms-row, #musicChannel.is-spotify .vfader { display: none; }

/* Bluetooth headphones (Safari on iPhone and iPad): on = accent, like Loop */
.channel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; padding-top: 10px; }
.mute-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px 5px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mute-btn svg { width: 18px; height: 18px; }
.bt-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(0, 245, 160, 0.12); }
.bt-why { flex: 1 1 160px; min-width: 0; font-size: 12px; color: var(--muted); }

/* The sheet's own parts, shown only up to 600 px (the phone's block below) */
.mixer-btn, .mix-grab, .mix-done, .ios-note, .mix-scrim, .bt-tport { display: none; }
/* No More Today's reason, on a touch screen only (a mouse rests on the tooltip) */
.orig-why { display: none; max-width: 140px; margin: -4px 0 0; font-size: 11px; line-height: 1.35; color: var(--text-3); text-align: center; }
@media (hover: none) { .orig-why:not([hidden]) { display: block; } }

/* ---------- Search ---------- */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input { flex: 1; }
/* Search's box and its cross (T-158): the browser's own cross goes, ours is
   the same everywhere and a finger's size */
.search-box { position: relative; flex: 1; display: flex; min-width: 0; }
.search-box input { flex: 1; min-width: 0; padding-right: 40px; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); cursor: pointer; }
.search-clear:hover { color: var(--text); }

/* Kept In This Project, then Results (J42): results stay in this tab */
.search-group { margin-top: 14px; }
.search-group > .eyebrow { display: block; margin: 0 2px 8px; }
.apple-note { margin-top: 14px; }

.results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--panel-2);
  border-radius: var(--r-2);
}

.result img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-1);
  object-fit: cover;
  background: var(--surface-3);
}

.result .track-name, .result .track-artist { display: block; }
.result .keep { width: 30px; height: 30px; }
.result .keep[aria-pressed="true"] { color: var(--accent); }

/* "Listen on Apple Music", with every preview: it opens the track's page
   (T-052). A plain link in the row's own type, on a line of its own (a kept
   row's: under its waveform; a result's: under its artist), covering nothing;
   Apple's own badge goes in its place when the owner supplies its file. */
.apple-badge {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.apple-badge:hover, .apple-badge:focus-visible { color: var(--text); }
.result .apple-badge { display: inline-block; margin-top: 2px; }
.track > .apple-badge { grid-column: 1; grid-row: 3; justify-self: start; }

.result-status {
  grid-column: 1 / -1;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Spotify lanes ---------- */
.lanes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lane {
  background: var(--panel-2);
  border-radius: var(--r-3);
  padding: 12px;
  border-left: 3px solid var(--track-color);
}

.lane-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.lane-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.lane-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--track-color);
  flex: 1;
}

.lane iframe {
  width: 100%;
  border: none;
  border-radius: var(--r-2);
  display: block;
}

/* Spotify has the music (one piece of music at a time) */
.lane.is-on { box-shadow: inset 0 0 0 1px var(--track-color); }
.lane-on { font-size: 11px; color: var(--track-color); font-weight: 600; white-space: nowrap; }

.spotify-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px 5px 8px;
  background: var(--panel-2);
  border: 1px solid var(--track-color);
  border-radius: var(--r-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.spotify-chip svg { width: 12px; height: 12px; fill: var(--track-color); }
.spotify-chip .chip-sub { color: var(--muted); font-weight: 400; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

.list-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: var(--r-2);
  border-left: 3px solid var(--track-color, var(--accent));
  background: var(--panel-2);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.list-note strong { color: var(--text); font-weight: 600; }

/* ---------- Drop overlay ---------- */
.drop-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: 2px dashed var(--accent);
  font-size: 20px;
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.drop-overlay[hidden] { display: none; }

/* ---------- Add music, at the foot of the track list ---------- */
.add-music {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--r-3);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.add-music:hover { border-color: var(--accent); color: var(--text-2); }
.add-music > svg { width: 22px; height: 22px; flex-shrink: 0; }
.add-music strong { display: block; color: var(--text); font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.add-music .add-sub { font-size: 12px; line-height: 1.4; }

/* No tracks yet: the same area, bigger, is the empty state */
.add-music.is-empty { flex-direction: column; text-align: center; padding: 30px 16px; gap: 10px; margin-top: 0; }
.add-music.is-empty > svg { width: 30px; height: 30px; }
/* Its words: at the foot of a list, or (first run, part 9) what goes here, with
   its button, green once the edit is in */
.add-first { display: none; flex-direction: column; align-items: center; gap: 8px; }
.add-music.is-empty .add-row { display: none; }
.add-music.is-empty .add-first { display: flex; }
.add-first strong { font-size: var(--fs-16); margin-bottom: 0; }
.add-first .add-sub { display: block; max-width: 300px; font-size: 13px; color: var(--text-3); }
.add-first .add-with-video, .app:has(.video-frame.has-video) .add-first .add-no-video { display: none; }
.app:has(.video-frame.has-video) .add-first .add-with-video { display: block; }
.add-first-btn { margin-top: 4px; pointer-events: none; }
.app:has(.video-frame.has-video) .add-first-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.tracks-empty { font-size: 12px; line-height: 1.5; margin-top: 12px; padding: 0 4px; }
.tracks-empty .view-only-text { display: none; font-size: 13px; text-align: center; padding: 24px 8px; color: var(--text); }
body.read-only .tracks-empty .view-only-text { display: block; }

/* Words for a mouse, or for a finger */
.touch-only { display: none; }
@media (hover: none) {
  .mouse-only { display: none; }
  .touch-only { display: inline; }
}
/* An iPhone zooms the page in on any typing box with text under 16px, and
   leaves it zoomed and pushed sideways (the owner's iPhone, 2026-11-17). Any
   touch screen, so an iPad with a trackpad (which says it can hover) too. */
@media (hover: none), (any-pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  /* Room for a finger, and buttons it can hit */
  .ms { width: 36px; height: 32px; }
}

/* ---------- Tablets and phones ---------- */
/* Back to the projects: only from inside one (on the projects there's nowhere to go back to) */
@media (max-width: 900px), (hover: none) {
  .brand:has(.crumb:not([hidden])) .home-chevron { display: block; }
}

@media (max-width: 900px) {
  /* The page scrolls as a whole (so a phone's browser bars can tuck away),
     and the video stays at the top, full width, while the controls and the
     list scroll under it. Tapping the video plays or pauses. */
  html, body { height: auto; }
  body { overflow: visible; }
  .app { flex: none; display: flex; flex-direction: column; padding: 0 12px 16px; gap: 10px; }
  .stage { display: contents; }
  /* Its width given, not stretched: with the keyboard up, an iPhone sized it
     from its height instead, leaving a strip of page beside it */
  .video-frame { position: sticky; top: 0; z-index: 3; flex: none; aspect-ratio: 16 / 9; margin: 0 -12px; border-radius: 0;
    width: calc(100% + 24px); max-height: 55vh; max-height: 55svh; }
  /* A box or a lane scrolled into view lands below the pinned video, not under
     it: the video's height, as just above, and a gap (app.js revealBelowVideo
     does the same where a phone ignores this) */
  html { scroll-padding-top: calc(min(56.25vw, 55vh) + 12px); scroll-padding-top: calc(min(56.25vw, 55svh) + 12px); }
  .panel { min-height: 0; overflow: visible; }
  .tab { overflow: visible; }
  /* The open tab fills at least the screen below the video, so the page can
     always scroll a box at its top up to just below the video: with nothing
     under the search box, the page ended too soon and an iPhone's keyboard
     left it under the video (the owner, 2026-11-17) */
  /* (Search and Spotify, whose boxes are typed in: the Tracks tab has none, and
     has the mixer under it above 600 px, its own room) */
  .tab.active:not(#tab-tracks) { min-height: calc(100vh - min(56.25vw, 55vh)); min-height: calc(100lvh - min(56.25vw, 55svh)); }
  /* The transport and the lane under the picture, then the panel: the list,
     and the mixer beside it */
  .transport, .timeline { margin: 0; }
  .panel { display: grid; grid-template-columns: minmax(0, 1fr) 310px; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--r-3); }
  .tabs { grid-column: 1 / -1; }
  .tab { grid-column: 1; grid-row: 2; }
  .mixdock { grid-column: 2; grid-row: 2; align-self: start; border-top: 0; border-left: 1px solid var(--line); padding-top: 10px; }
}

/* The top bar narrows: in a project the logo stands for the name; then the
   words beside icons go (their tooltips and labels stay) */
@media (max-width: 1100px) {
  .brand:has(.crumb:not([hidden])) :is(.brand-rule, .brand-name, .beta) { display: none; }
}
@media (max-width: 860px) {
  .topbar { padding: 8px 12px 8px 16px; gap: 12px; }
  /* The sign-in page: the brand above the form */
  .signin { grid-template-columns: 1fr; }
  .signin-brand { padding: 32px; gap: 24px; }
  .signin-brand h2 { font-size: var(--fs-28); }
  .signin-side { padding: 32px 24px; justify-content: flex-start; }
  .btn-word.can-go { display: none; }
  .btn:has(.btn-word.can-go) { padding: 0 8px; }
}
@media (max-width: 600px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { gap: 8px; }
  .topbar-right, .topbar-actions { gap: 4px; }
  .account { padding-left: 4px; border-left: none; gap: 4px; }
  .btn-word.phone-goes { display: none; }
  .btn:has(.btn-word.phone-goes) { padding: 0 8px; }
  /* "Saved" under the name; a view link's "View Only · Shared By …" too.
     The logo stands before the name: no slash (it wrapped onto a line of its own) */
  .crumb { flex-wrap: wrap; row-gap: 2px; }
  .crumb-sep { display: none; }
  .crumb-title { flex-direction: column; align-items: flex-start; gap: 0; max-width: 100%; }
  .crumb-name { max-width: 100%; font-size: 15px; }
  .brand:has(.rename-input), .brand:has(.rename-input) .crumb, .brand:has(.rename-input) .crumb-title { flex: 1 1 auto; }
  .crumb-title .rename-input { flex: none; width: 100%; min-width: 0; }
  .crumb .crumb-note { flex-basis: 100%; white-space: normal; }
  /* The sign-in page: the brand panel a band above the form */
  .signin { grid-template-columns: 1fr; }
  .signin-brand { padding: 20px; gap: 16px; }
  .signin-brand h2 { font-size: 24px; margin: 0; }
  .signin-brand p, .signin-brand > .beta { display: none; }
  .signin-lockup img, .signin-lockup .brand-rule { height: 24px; }
  .signin-lockup .brand-name { font-size: 18px; }
  .signin-side { padding: 28px 20px 24px; justify-content: flex-start; }
  .picker-inner { padding: 28px 16px; }
  .picker-foot { padding: 14px 16px; }

  /* The transport: the time, then the zoom, on one row; the line about a
     track you can't hear on its own row under them */
  .transport-row { gap: 4px; }
  .hear-line { order: 9; margin: 2px 0 0; flex: 1 1 100%; justify-content: flex-start; white-space: normal; height: auto; min-height: 32px; }
  .hear-line #hearText { flex: 1; }
  /* The transport on one row with the Mixer button: its icon buttons narrower
     (as tall), the gaps smaller */
  .transport-row { gap: 2px; }
  .transport .icon-btn:not(#playBtn) { width: 30px; }
  .mixer-btn { display: inline-flex; gap: 4px; padding: 0 8px; }
  /* The time as the current time only ("0:24.3"), so Headphones fits too (T-160);
     the edit's length is on the ruler */
  #timeTotal { display: none; }
  /* Headphones in the transport, not in the sheet (T-160) */
  .bt-tport:not([hidden]) { display: inline-flex; }
  #btChannel { display: none; }

  /* The transport and the lane pinned under the pinned picture, on Tracks only
     (the owner, 2026-11-29: on Search and Spotify the keyboard needs the room).
     At the picture's foot as measured (app.js pinMeasure: --pin-top), the
     formula until then. Its own background, full width, so the list scrolls
     away under it; the hint (inside it) goes with it. */
  .lane-wrap { margin: -10px -12px 0; padding: 8px 12px 10px; background: var(--bg); }
  .app:has(#tab-tracks.active) .lane-wrap { position: sticky; top: var(--pin-top, min(56.25vw, 55svh)); z-index: 2; border-bottom: 1px solid var(--line); }
  /* A box or row scrolled into view on Tracks lands below the whole pinned block */
  html:has(#viewProject:not([hidden]) #tab-tracks.active) { scroll-padding-top: calc(var(--pin-h, 440px) + 12px); }

  /* The lane: the music under the picture, no labels and no film (the name is
     in the list and the mixer); a finger's room to drag it. 20 px further in
     from each side than the page (T-147: a sideways drag that starts near the
     screen's edge is the phone's "back"): the timeline clips its handles'
     targets, so none comes nearer the edge than 32 px */
  .timeline { grid-template-columns: minmax(0, 1fr); margin: 0 20px; }
  .tl-lab, .tl-film { display: none; }
  .tl-ruler { height: 28px; border-bottom: 1px solid var(--line); }
  .tl-lane { border-left: 4px solid var(--track-color, var(--line-strong)); }
  /* Thumb-sized handles on the 76 px lane: dots 22 px, brackets 18 x 26, each
     target 44 wide and 38 tall, the dots' from the lane's top and the brackets'
     from its foot, so at a corner they meet and never overlap */
  .tl-fh { width: 22px; height: 22px; margin-left: -11px; }
  .tl-fh::after { left: -11px; right: -11px; top: -3px; bottom: auto; height: 38px; }
  .tl-th { width: 18px; height: 26px; }
  .tl-th.r { margin-left: -18px; }
  .tl-th::after { left: -13px; right: -13px; top: auto; bottom: -3px; height: 38px; }
  /* The tip over the ruler, not under the finger */
  .tl-tip { top: -24px; }

  /* The mixer: a sheet from the foot of the screen, opened by Mixer in the
     transport (the same element, nothing moved or rebuilt: app.js, MIXER) */
  .panel { display: flex; flex-direction: column; }
  .mixdock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: calc(100svh - 24px); overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 16px max(20px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0;
    background: var(--surface-2); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(105%); visibility: hidden; transition: transform 260ms var(--ease); }
  body.mixer-open .mixdock { transform: none; }
  /* Shown from the press until its slide down is over (app.js: a timer, not the
     transition's end, which Safari was seen to hold when it drew no frames) */
  body.mixer-shown .mixdock { visibility: visible; }
  .mixdock.is-dragged { transition: none; }
  .mix-grab { display: block; flex: none; width: 40px; height: 4px; margin: 4px auto 6px; border-radius: 2px; background: var(--iron); box-sizing: content-box;
    padding: 8px 40px; background-clip: content-box; touch-action: none; cursor: grab; }
  .mix-head { margin-bottom: 8px; touch-action: none; }
  .mix-head .eyebrow { font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
  .mix-fold { display: none; }
  .mix-done { display: inline-flex; }
  .mix-body { gap: 12px; }
  .mix-vid { align-self: flex-start; }
  .vfader { height: 190px; }
  .channel { justify-content: center; }
  .no-volume .mixdock:has(#videoChannel:not(.fader-heard):not(.reading)) .ios-note { display: block; margin: 10px 0 0; font-size: 12px; color: var(--text-3); text-align: center; }
  .mix-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.5); }
  body.mixer-open .mix-scrim { display: block; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .mixdock { transition: none; }
}
/* On a phone, either way up: Spotify plays previews unless signed in to it here */
.phone-only-text { display: none; }
@media (hover: none) and (max-width: 600px), (hover: none) and (max-height: 600px) {
  .phone-only-text { display: block; }
}

/* ---------- Account: the sync line ---------- */
.sync-bar {
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
  min-width: 0;
}

.sync-text {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-text.warn, .warn-text { color: var(--amber); }

/* A two-way switch (Sign In | Create Account) */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  flex-shrink: 0;
}

.seg button {
  background: var(--panel-2);
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
  white-space: nowrap;
}

.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: #000; font-weight: 600; }
.seg button:disabled { opacity: 0.4; cursor: default; }

/* ---------- View only: a project opened from a view-only link ----------
   Hidden here, and also refused in app.js (state.readOnly): the CSS is what
   the viewer sees, the code is what keeps their session from writing. */

.stage-note {
  max-width: 360px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

body.read-only #editorActions,
body.read-only #saveState,
body.read-only #laneFoot :is(#laneUndo, #laneSave, .tl-saved),
body.read-only #addMusicBtn,
body.read-only .dropzone,
body.read-only .tab-btn[data-tab="search"],
body.read-only #spotifyForm,
body.read-only .lane-header .remove,
body.read-only #tracksEmpty .muted,
body.read-only #lanesEmpty .muted { display: none !important; }

/* The client's view: the line above the tracks; the Spotify tab's own sentence */
.view-line { margin: 0 0 8px; padding: 2px 4px 10px; font-size: var(--fs-12); line-height: 1.45; color: var(--text-2); border-bottom: 1px solid var(--line); }
#tab-spotify .view-only-text { display: none; }
body.read-only #tab-spotify .view-only-text { display: inline; }
body.read-only #tab-spotify .edit-text { display: none; }

body.read-only .crumb-name { cursor: default; }
body.read-only .crumb-name:hover { border-bottom-color: transparent; }

/* ---------- Dialogs: Share, Feedback, Delete Account, and the app's own
   confirm boxes (part 13) ---------- */

.share-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  margin: auto;
  padding: 20px 20px 22px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-pop);
}
/* The small ones: a question, a form */
.share-dialog.narrow { width: min(420px, calc(100vw - 32px)); }

.share-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.share-dialog h2 { font-size: var(--fs-16); font-weight: 600; line-height: 1.3; margin-bottom: 8px; padding-right: 36px; overflow-wrap: anywhere; }
/* The project's name in the Share dialog's title: Campton */
.share-dialog h2 .title-name { font-family: var(--font-title); font-weight: 600; }
.share-dialog h3 { font-size: var(--fs-14); font-weight: 600; }
.share-dialog p { color: var(--text-2); }
.share-dialog p strong { color: var(--text); font-weight: 600; }
.share-close { position: absolute; top: 12px; right: 12px; }
.share-close .icon-btn { font-size: 20px; line-height: 1; }
.share-section { margin-top: 16px; }
.share-section + .share-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.share-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.share-row input { flex: 1; }
/* A dialog's buttons: at its foot, on the right */
.dialog-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.dialog-text { font-size: var(--fs-14); line-height: 1.5; }

.share-handoff { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(212, 154, 31, 0.45); border-radius: var(--r-2); }
.share-handoff .small-text { margin: 0; }
/* T-149: changes not saved, and their Save (the owner's look at J44) */
.share-unsaved { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(212, 154, 31, 0.45); border-radius: var(--r-2); }
.share-unsaved .small-text { flex: 1; margin: 0; }
.share-unsaved b { color: var(--amber); font-weight: 600; }
.share-msg { font-size: var(--fs-12); line-height: 1.5; margin-top: 8px; }
.share-msg:empty { display: none; }
.share-msg.error { color: var(--danger); }
.share-msg.ok { color: var(--accent); }

/* Delete Your Account?: the short list, the full one a press away */
.delete-list { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; color: var(--text-2); }
.delete-more { margin: 0 0 16px; font-size: var(--fs-12); color: var(--text-3); }
.delete-more summary { cursor: pointer; color: var(--text-2); width: max-content; }
.delete-more summary:hover { color: var(--text); }
.delete-more ul { padding-left: 18px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.delete-more strong { color: var(--text-2); font-weight: 600; }

/* ---------- Feedback ---------- */

.feedback-form { gap: 0; margin-top: 12px; }
#feedbackFields { display: flex; flex-direction: column; gap: 14px; }
.feedback-field textarea {
  width: 100%;
  min-height: 64px;
  padding: 9px 12px;
  font-size: var(--fs-14);
  line-height: 1.45;
  resize: vertical;
}
.feedback-field .feedback-full { color: var(--amber); }
.feedback-field .feedback-full:empty { display: none; }
.feedback-form .dialog-acts { margin-top: 16px; }

.people { list-style: none; margin-top: 12px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.people .who { flex: 1; min-width: 0; }
.people .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .sub { color: var(--text-3); font-size: var(--fs-12); }
.people .av { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-2); flex: none; }
.people .role { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.people-bin { width: 32px; height: 32px; color: var(--text-3); }
.people-bin:hover { color: var(--danger); background: rgba(255, 59, 48, 0.12); }
@media (hover: none) { .people-bin { width: 44px; height: 44px; } }
/* The link's switch beside its title, and Make A New Link as a quiet link */
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-quiet { border: 0; background: none; padding: 0; margin-top: 10px; color: var(--text-2); font: inherit; font-size: var(--fs-12); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--iron); cursor: pointer; }
.link-quiet:hover { color: var(--text); }
