/* Tunedrop — stile
   Idea: la copertina di cartoncino di una cassetta. Carta azzurrina, inchiostro blu,
   il rosso della spia REC solo per ciò che registra, e un contatore meccanico a rulli
   che mostra quanti brani sono pronti. */

:root {
  --paper: #e7ebef;
  --sheet: #f5f7f9;
  --ink: #16233f;
  --ink-soft: #52607a;
  --rule: #c3cfdf;
  --rec: #d8352a;
  --rec-deep: #b12a21;
  --shell: #23262e;
  --shell-2: #323743;
  --shell-text: #eef1f5;
  --shell-soft: #b6bfcd;
  --ok: #2c7a5f;
  --focus: #2f6fdd;
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-s: 5px;
  --r-m: 10px;
  --r-l: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Barra in alto ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 800; font-stretch: 125%;
  font-size: 1.125rem; letter-spacing: -0.01em;
}
.brand-mark { width: 2rem; height: 2rem; }
.brand-mark rect { fill: var(--ink); }
.brand-mark circle { fill: var(--paper); }
.brand-mark .brand-dot { fill: var(--rec); }
.topbar-link { color: var(--ink-soft); font-weight: 600; text-underline-offset: 3px; }
.topbar-link:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding: clamp(1.5rem, 6vw, 4.5rem) 0 2.5rem; }
.hero h1 {
  margin: 0 0 1.1rem;
  max-width: 17ch;
  font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.lede {
  margin: 0 0 2rem;
  max-width: 60ch;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

/* Schede */
.tabs { display: flex; gap: 1.5rem; margin-bottom: .75rem; }
.tabs button {
  appearance: none; background: none; border: 0; padding: .35rem 0;
  font-weight: 700; color: var(--ink-soft); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button:hover { color: var(--ink); }

/* Campo di caricamento */
.loader { display: flex; gap: .75rem; align-items: flex-start; }
.loader-field { flex: 1; min-width: 0; }

.input {
  width: 100%;
  padding: .75rem .95rem;
  background: #fbfcfd;
  border: 2px solid var(--ink);
  border-radius: var(--r-m);
  outline: none;
}
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.input::placeholder { color: #8591a6; }
.input-lg { height: 3.5rem; font-size: 1.05rem; }
textarea.input { resize: vertical; min-height: 9rem; line-height: 1.6; }

.options {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.75rem;
  margin-top: 1rem; color: var(--ink-soft); font-size: .95rem;
}
.options label { display: inline-flex; align-items: center; gap: .5rem; }
.options select {
  padding: .35rem 1.9rem .35rem .6rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-s);
  background: #fbfcfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2316233f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right .55rem center / .6rem;
  appearance: none;
  color: var(--ink);
  font-weight: 600;
}
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.check input, .tk-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); cursor: pointer; }

/* ---------- Pulsanti ---------- */

.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .75rem 1.2rem;
  border-radius: var(--r-m);
  font-weight: 700; line-height: 1.2; text-decoration: none;
  white-space: nowrap;
}
.btn-lg { height: 3.5rem; padding-inline: 1.8rem; font-size: 1.05rem; }
.btn-primary { background: var(--ink); color: var(--sheet); }
.btn-primary:hover { background: #24345c; }
.btn-rec { background: var(--rec); color: #fff; }
.btn-rec:hover { background: var(--rec-deep); }
.btn-rec::before {
  content: ""; width: .6em; height: .6em; border-radius: 50%;
  background: #fff; flex: none;
}
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-ghost:hover { background: rgba(127, 139, 160, .14); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

/* ---------- Avvisi ---------- */

.notice {
  margin: 1rem 0 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--ink-soft);
  background: var(--sheet);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  max-width: 72ch;
}
.notice-error { border-left-color: var(--rec); color: #7c1d16; background: #fbeeed; }

/* ---------- Risultato: il guscio della cassetta ---------- */

.result { padding-bottom: 3rem; scroll-margin-top: 1rem; }

.shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.75rem 1.25rem 1.25rem;
  background: var(--shell);
  color: var(--shell-text);
  border-radius: var(--r-l);
}
.shell-cover {
  width: 136px; aspect-ratio: 1;
  padding: 0; border: 0; border-radius: var(--r-s);
  overflow: hidden; cursor: zoom-in;
  background: var(--shell-2);
}
.shell-cover img { width: 100%; height: 100%; object-fit: cover; }
.shell-cover.is-empty { cursor: default; }
.shell-info h2 {
  margin: 0 0 .3rem;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  font-weight: 750;
  font-stretch: 112%;
  line-height: 1.1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.shell-meta { margin: 0 0 1.1rem; color: var(--shell-soft); }
.shell-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.shell .btn-ghost { color: var(--shell-text); }
.shell .btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.shell-counter { text-align: right; align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: .5rem; }
.shell-counter-caption { color: var(--shell-soft); font-size: .875rem; }

/* ---------- Contatore meccanico (l'elemento firma) ---------- */

.counter {
  display: inline-flex; gap: .12em;
  font-stretch: 75%; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.digit {
  display: inline-block;
  width: .74em; height: 1.24em;
  overflow: hidden;
  border-radius: .12em;
  background: #0f1014;
  color: #f2f3f5;
  text-align: center;
  box-shadow:
    inset 0 .28em .3em -.1em rgba(0, 0, 0, .75),
    inset 0 -.28em .3em -.1em rgba(0, 0, 0, .75),
    0 0 0 1px rgba(255, 255, 255, .06);
}
.reel {
  display: flex; flex-direction: column;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.reel span { display: block; height: 1.24em; line-height: 1.24em; }
.counter-lg { font-size: 2.75rem; }
.counter-sm { font-size: .95rem; }
.sheet .digit { box-shadow: inset 0 .28em .3em -.1em rgba(0, 0, 0, .75), inset 0 -.28em .3em -.1em rgba(0, 0, 0, .75); }

/* ---------- Duplicati e note ---------- */

.dupes { margin-top: 1rem; color: var(--ink-soft); }
.dupes summary { cursor: pointer; font-weight: 600; }
.dupes ul { margin: .5rem 0 0; padding-left: 1.25rem; }

/* ---------- Elenco brani: il cartoncino rigato ---------- */

.sheet {
  position: relative;
  margin-top: 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-m);
  overflow: hidden;
}
.sheet::before {
  /* linea del margine, come sul cartoncino della cassetta */
  content: ""; position: absolute; top: 0; bottom: 0; left: 3.25rem;
  width: 1px; background: rgba(216, 53, 42, .4); pointer-events: none;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem .8rem .95rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 600; font-size: .95rem;
}
.sheet-head .check { gap: 1.55rem; }
.sheet-count { color: var(--ink-soft); font-weight: 500; }
.sheet-foot { padding: 0 1rem; }
.sheet-foot .btn { margin: 1rem 0 1rem 2.25rem; }
.sheet-foot:has(.btn[hidden]) { display: none; }

.tracks { list-style: none; margin: 0; padding: 0; }

.track {
  display: grid;
  grid-template-columns: 3.25rem 2rem 44px minmax(0, 1fr) 3.25rem auto 7.5rem;
  align-items: center;
  column-gap: .85rem;
  min-height: 4.25rem;
  padding: .55rem 1rem .55rem 0;
  border-bottom: 1px solid var(--rule);
}
.track:last-child { border-bottom: 0; }

.tk-check { display: flex; justify-content: center; }
.tk-num {
  text-align: right; color: var(--ink-soft);
  font-size: .875rem; font-variant-numeric: tabular-nums;
}
.track.is-active .tk-num { color: var(--rec); font-weight: 700; }

.tk-cover {
  width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 4px; overflow: hidden; cursor: zoom-in;
  background: #d5dde7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='3' y='8' width='26' height='16' rx='3' fill='none' stroke='%2352607a' stroke-width='2'/%3E%3Ccircle cx='11.5' cy='16' r='2.5' fill='%2352607a'/%3E%3Ccircle cx='20.5' cy='16' r='2.5' fill='%2352607a'/%3E%3C/svg%3E") center / 62% no-repeat;
}
.tk-cover img { width: 100%; height: 100%; object-fit: cover; }
.tk-cover.no-cover { cursor: default; }
.tk-cover.no-cover img { display: none; }

.tk-main { min-width: 0; display: flex; flex-direction: column; }
.tk-title, .tk-artist, .tk-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-title { font-weight: 650; }
.tk-artist { color: var(--ink-soft); font-size: .9rem; }
.tk-line { display: flex; align-items: baseline; gap: .6rem; min-width: 0; font-size: .8125rem; }
.tk-line[hidden] { display: none; }
.tk-status { min-width: 0; color: var(--ink-soft); }
.tk-status:empty { display: none; }
.tk-src {
  flex: none; appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font-size: .8125rem; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px;
}
.tk-src:hover { color: var(--rec-deep); }
.track.is-error .tk-line { flex-wrap: wrap; }
.track.is-done .tk-status { color: var(--ok); }
.track.is-error .tk-status { color: var(--rec-deep); white-space: normal; }
.tk-status a { text-underline-offset: 2px; }

.tk-dur { text-align: right; color: var(--ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; }

.tk-actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.tk-btn {
  appearance: none; cursor: pointer;
  padding: .45rem .75rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-s);
  background: transparent;
  font-size: .875rem; font-weight: 700; white-space: nowrap;
}
.tk-btn:hover { background: var(--ink); color: var(--sheet); }
.tk-btn:disabled { opacity: .5; cursor: progress; background: transparent; color: inherit; }
.track.is-done .tk-dl { background: var(--ink); color: var(--sheet); }
.track.is-done .tk-dl:hover { background: #24345c; }

/* ---------- Istruzioni e domande ---------- */

.howto {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3.5rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--rule);
}
.howto h2 {
  grid-column: 1 / -1;
  margin: 0 0 .5rem;
  font-size: 1.6rem; font-weight: 800; font-stretch: 125%; letter-spacing: -0.015em;
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative; counter-increment: step;
  padding: 0 0 1.25rem 2.75rem; max-width: 46ch;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.05em;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--sheet);
  font-weight: 700; font-size: .9rem;
}
.faq details { border-bottom: 1px solid var(--rule); padding: .8rem 0; }
.faq details:first-child { padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: .6rem 0 0; color: var(--ink-soft); max-width: 60ch; }

.footer { padding: 2rem 0 3rem; color: var(--ink-soft); font-size: .875rem; }
.footer p { margin: 0; max-width: 80ch; }

/* ---------- Login ---------- */

.login { display: grid; place-items: center; min-height: 62vh; }
.login-card {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: .75rem;
}
.login-card h1 { margin: 0; font-size: 2.2rem; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; line-height: 1.05; }
.login-card p { margin: 0; color: var(--ink-soft); }
.login-card .notice { margin: 0; }
.login-card .btn { align-self: flex-start; margin-top: .25rem; }
.field-label { font-weight: 700; font-size: .95rem; }

/* ---------- Finestre ---------- */

.dlg {
  width: min(560px, calc(100% - 2rem));
  padding: 1.5rem;
  border: 0; border-radius: var(--r-l);
  background: var(--sheet); color: var(--ink);
  box-shadow: 0 30px 80px rgba(22, 35, 63, .35);
}
.dlg::backdrop { background: rgba(22, 35, 63, .55); }
.dlg h3 { margin: 0 2rem .25rem 0; font-size: 1.35rem; font-weight: 800; font-stretch: 112%; }
.dlg-sub { margin: 0 0 1rem; color: var(--ink-soft); }
.dlg-close {
  position: absolute; top: .75rem; right: .75rem;
  width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%;
  background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft);
}
.dlg-close:hover { background: var(--rule); color: var(--ink); }
.dlg-cover { width: min(680px, calc(100% - 2rem)); padding: 1rem; background: var(--shell); color: var(--shell-text); }
.dlg-cover img { width: 100%; border-radius: var(--r-s); }
.dlg-cover p { margin: .75rem .25rem .25rem; color: var(--shell-soft); }
.dlg-cover .dlg-close { color: var(--shell-text); background: rgba(0, 0, 0, .45); z-index: 1; }

.source-list { list-style: none; margin: 0 0 1.25rem; padding: 0; max-height: 46vh; overflow: auto; }
.source-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; align-items: center;
  padding: .7rem 0; border-bottom: 1px solid var(--rule);
}
.source-list .src-title { font-weight: 650; overflow-wrap: anywhere; }
.source-list .src-meta { grid-column: 1; color: var(--ink-soft); font-size: .875rem; }
.source-list .src-meta a { text-underline-offset: 2px; }
.source-list .src-actions { grid-column: 2; grid-row: 1 / span 2; }
.source-list .is-current .src-title::after { content: " (in uso)"; color: var(--ok); font-weight: 600; }
.source-empty { color: var(--ink-soft); }
.source-row { display: flex; gap: .5rem; margin-top: .4rem; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 2rem);
  padding: .8rem 1.1rem;
  background: var(--ink); color: var(--sheet);
  border-radius: var(--r-m);
  box-shadow: 0 12px 30px rgba(22, 35, 63, .3);
  z-index: 50;
}
.toast.is-error { background: var(--rec-deep); }

/* ---------- Pannello admin ---------- */

.admin-main { padding: .5rem 0 3rem; }
.admin-main > .notice { margin: 0 0 1rem; }
.notice p { margin: 0; }
.notice details { margin-top: .5rem; }
.notice summary { cursor: pointer; font-weight: 600; }
.notice pre {
  margin: .5rem 0 0; max-height: 16rem; overflow: auto;
  white-space: pre-wrap; word-break: break-word; font-size: .8rem;
}
.notice-ok { border-left-color: var(--ok); background: #e7f3ee; color: #17493a; }

.link-btn {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.topbar-form { margin: 0; }

.admin-section { padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.admin-section:first-of-type { border-top: 0; padding-top: .5rem; }
.admin-head h1 {
  margin: 0 0 .4rem;
  font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; font-stretch: 125%;
  letter-spacing: -0.02em; line-height: 1.05;
}
.admin-lede { margin: 0; color: var(--ink-soft); }
.admin-section h2 { margin: 0 0 .9rem; font-size: 1.35rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }
.admin-row-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1.5rem; margin-bottom: .9rem;
}
.admin-row-head h2 { margin: 0; }
.admin-row-head form { margin: 0; }
.admin-text { margin: 0 0 1rem; max-width: 72ch; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1rem; }
.admin-actions form { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.admin-actions .inline-form { flex: 1 1 30rem; }
.inline-form .input { width: auto; flex: 1 1 16rem; padding: .6rem .8rem; }
.file-label input[type="file"] { max-width: 100%; font-size: .9rem; }
.admin-main .btn { padding: .6rem 1rem; font-size: .925rem; }

.tool-list {
  background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--r-m); overflow: hidden;
}
.tool {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem 1.5rem;
  padding: 1rem 1.1rem 1rem 1.25rem;
  border-bottom: 1px solid var(--rule); border-left: 4px solid transparent;
}
.tool:last-child { border-bottom: 0; }
.tool.is-ok { border-left-color: var(--ok); }
.tool.is-missing { border-left-color: var(--rec); }
.tool form { margin: 0; flex: none; }
.tool-main { min-width: 0; }
.tool h3 { margin: 0 0 .2rem; font-size: 1.1rem; font-weight: 800; font-stretch: 112%; }
.tool-desc { margin: 0 0 .35rem; color: var(--ink-soft); font-size: .925rem; max-width: 64ch; }
.tool-state { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.tool-state code, .diag code {
  font-family: inherit; font-stretch: 87.5%;
  background: rgba(127, 139, 160, .16); padding: .05rem .35rem; border-radius: 4px;
}
.tool-progress, .tool-error, .tool-done { margin: .45rem 0 0; font-size: .9rem; font-weight: 600; }
.tool-progress { display: flex; align-items: center; gap: .5rem; color: var(--rec-deep); }
.tool-error { color: var(--rec-deep); }
.tool-done { color: var(--ok); }
.rec-dot {
  width: .6rem; height: .6rem; border-radius: 50%; flex: none;
  background: var(--rec); animation: rec-blink 1.2s ease-in-out infinite;
}
@keyframes rec-blink { 50% { opacity: .25; } }

.diag-scroll {
  overflow-x: auto; margin-bottom: 1rem;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m);
}
.diag { width: 100%; border-collapse: collapse; font-size: .925rem; }
.diag th, .diag td { padding: .65rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.diag tbody tr:last-child > * { border-bottom: 0; }
.diag thead th { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }
.diag tbody th { font-weight: 650; white-space: nowrap; }
.diag td code { overflow-wrap: anywhere; }
.diag-hint { display: block; margin-top: .3rem; color: var(--ink-soft); font-size: .85rem; max-width: 60ch; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: #d9eee5; color: #17493a; }
.pill-bad { background: #fbe1de; color: #7c1d16; }
.pill-neutral { background: #dfe5ed; color: var(--ink-soft); }

.log-title { margin: 1rem 0 .5rem; font-size: 1rem; font-weight: 700; }
.log {
  margin: 0; padding: 1rem; max-height: 22rem; overflow: auto;
  background: var(--shell); color: var(--shell-text); border-radius: var(--r-m);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

/* ---------- Schermi stretti ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: auto minmax(0, 1fr); }
  .shell-counter { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 1rem; text-align: left; }
  .counter-lg { font-size: 2.1rem; }
  .howto { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .wrap { width: calc(100% - 1.5rem); }
  .loader { flex-direction: column; align-items: stretch; }
  .btn-lg { width: 100%; }
  .shell { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
  .shell-cover { width: 96px; }
  .shell-actions .btn { flex: 1 1 auto; }
  .sheet::before { left: 2.6rem; }
  .sheet-head .check { gap: 1.2rem; }
  .track {
    grid-template-columns: 2.6rem 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "chk cov main ctr"
      ".   .   act  act";
    row-gap: .5rem;
    padding-right: .75rem;
  }
  .tk-check { grid-area: chk; }
  .tk-cover { grid-area: cov; }
  .tk-main { grid-area: main; }
  .track .counter { grid-area: ctr; }
  .tk-actions { grid-area: act; justify-content: flex-start; }
  .tk-num, .tk-dur { display: none; }
  .sheet-foot .btn { margin-left: 0; }
  .tool { flex-direction: column; }
  .diag tbody th { white-space: normal; }
  .source-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .reel { transition: none; }
  .rec-dot { animation: none; }
  html { scroll-behavior: auto; }
}
