/* Setlist — estilos do app (portados do protótipo; SPEC §1.11 e §1.12 mobile-first). Tokens em tokens.css. */
a {
  color: var(--accent-ink);
}
a:hover {
  color: var(--accent-deep);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3 {
  margin: 0;
}
.cond {
  font-family: var(--font-cond);
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

/* Header */
.app-header {
  background: var(--dark);
  color: #fff;
}
.app-header .inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  min-height: 64px;
}
.brand {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.5px;
  color: #fff;
  text-decoration: none;
}
.brand:hover {
  color: #fff;
}
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  align-self: stretch;
  flex-wrap: wrap;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  color: var(--on-dark-muted);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  box-shadow: inset 0 -3px 0 transparent;
}
.main-nav a:hover {
  color: #fff;
}
.main-nav a[aria-current="page"] {
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--accent);
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.account a {
  color: #fff;
  font-size: 14px;
  padding: 10px 6px;
}
.badge-admin {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
}

/* Layout */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page.narrow {
  max-width: 1100px;
}
.page.xnarrow {
  max-width: 760px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-title {
  font-family: var(--font-cond);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}
.page-sub {
  margin: 6px 0 0;
  color: var(--muted);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.card-pad {
  padding: 20px;
}
.section-title {
  font-family: var(--font-cond);
  font-size: 24px;
  font-weight: 700;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--control);
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-dark {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
  font-weight: 700;
}
.btn-dark:hover {
  background: #2a2927;
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}
.btn-accent:hover {
  background: #f97316;
  color: var(--ink);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 700;
}
.btn-danger:hover {
  background: #991b1b;
  color: #fff;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 16px;
}
.btn-xl {
  height: 56px;
  font-size: 18px;
  border-radius: 10px;
}
.btn-icon {
  width: 44px;
  padding: 0;
}
.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.link-btn {
  border: 0;
  background: transparent;
  padding: 8px 2px;
  color: var(--accent-ink);
  font-weight: 700;
}
.chip {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--control);
}
.chip[aria-pressed="true"] {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.seg {
  display: flex;
  background: #eceae4;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--control);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[aria-selected="true"] .step-num,
[aria-current="step"] .step-num {
  background: var(--accent);
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
.input {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  font-weight: 400;
  min-width: 0;
  width: 100%;
}
.input-lg {
  height: 52px;
  font-size: 18px;
}
.input-soft {
  border-color: transparent;
  background: var(--bg);
}
.search {
  position: relative;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search .input {
  padding-left: 38px;
  height: 44px;
}
.dur-input {
  width: 84px;
  flex: none;
  height: 42px;
  text-align: right;
  padding: 0 10px;
  border-radius: 6px;
  font-family: var(--font-cond);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  border: 1px solid transparent;
  background: var(--bg);
}
.dur-input.missing {
  border: 1.5px dashed var(--accent-ink);
  background: var(--accent-soft);
}
.dur-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: #fff;
}
.dur-big {
  width: 140px;
  height: 52px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-cond);
  font-size: 30px;
  font-weight: 700;
  text-align: right;
  padding: 0 14px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
kbd {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 18px;
  border: 1px solid var(--control);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--dark);
  flex: none;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.error-text {
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

/* Notices */
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.notice-warn {
  background: var(--accent-soft-2);
  color: #7c2d12;
  border: 1px solid #fdba74;
}
.notice-error {
  background: var(--danger-soft);
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}
.notice-ok {
  background: var(--ok-soft);
  color: #14532d;
  border: 1px solid #86efac;
}
.notice-info {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}
.notice .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.pill {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--bg);
}
.pill-accent {
  background: var(--accent-soft-2);
  color: var(--accent-deep);
}
.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Lists */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-scroll {
  max-height: 860px;
  overflow-y: auto;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 20px;
  min-height: 52px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.list-head {
  display: flex;
  gap: 12px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.t-title {
  font-weight: 600;
  font-size: 16px;
}
.t-artist {
  font-size: 13px;
  color: var(--muted);
}
.grip {
  width: 24px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #8c8a84;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-width: calc(100% - 32px);
}
.toast button {
  background: transparent;
  border: 0;
  color: #fdba74;
  font-weight: 700;
  padding: 6px;
}

/* Dialog */
dialog.dlg {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(520px, calc(100% - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog.dlg::backdrop {
  background: rgba(21, 21, 21, 0.6);
}
.dlg-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dlg-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* Table (admin) */
.table-wrap {
  overflow-x: auto;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.tbl td.num,
.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media print {
  html,
  body {
    background: #fff !important;
  }
  .no-print {
    display: none !important;
  }
  .print-root {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }
  .sheet {
    box-shadow: none !important;
    margin: 0 !important;
    break-after: page;
  }
  .sheet:last-child {
    break-after: auto;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 16px 48px;
  }
  .page-title {
    font-size: 34px;
  }
  .app-header .inner {
    padding: 0 16px;
  }
  .list-row,
  .list-head {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* =====================================================================
   MOBILE-FIRST (SPEC §1.12) — celular é o uso principal.
   Breakpoint único: ≤ 760px = celular. Tudo abaixo vale para o protótipo
   e deve ser reproduzido na implementação.
   ===================================================================== */
:root {
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  -webkit-tap-highlight-color: transparent;
}
input,
select,
textarea {
  font-size: max(16px, 1em);
} /* evita zoom automático do iOS */
button,
a,
.grip {
  touch-action: manipulation;
}

.tabbar {
  display: none;
}
.actionbar {
  display: none;
}
@media (min-width: 761px) {
  .mob-only {
    display: none !important;
  }
}

/* Bottom sheet / action sheet */
.as-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.as-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
}
.as-list button:hover,
.as-list button:focus-visible {
  background: var(--bg);
}
.as-list button.danger {
  color: var(--danger);
}
.as-list button[disabled] {
  opacity: 0.35;
}

/* Arrastar por ponteiro (mouse + toque) */
.grip {
  touch-action: none;
  cursor: grab;
}
.sort-ghost {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  opacity: 0.95;
  background: #fff;
  transform: scale(1.02);
}
.sort-src {
  opacity: 0.35;
}
.drop-before {
  box-shadow: inset 0 3px 0 var(--accent) !important;
}
.drop-after {
  box-shadow: inset 0 -3px 0 var(--accent) !important;
}
.drop-into {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}
body.sorting {
  user-select: none;
  -webkit-user-select: none;
}

/* Preencher tempos — teclado numérico próprio (o teclado numérico do iOS não tem Enter) */
dialog.filler {
  border: 0;
  padding: 0;
  width: min(440px, 100%);
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog.filler::backdrop {
  background: rgba(21, 21, 21, 0.6);
}
.filler-in {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px calc(16px + var(--safe-b));
  min-height: 100%;
  box-sizing: border-box;
}
.filler-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filler-prog {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.filler-song {
  text-align: center;
  padding: 4px 8px;
}
.filler-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
}
.filler-time {
  display: block;
  text-align: center;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 76px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
}
.filler-time.empty {
  color: #a8a59d;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.keypad button {
  height: 60px;
  border-radius: 12px;
  border: 1px solid var(--control);
  background: #fff;
  font-family: var(--font-cond);
  font-size: 30px;
  font-weight: 700;
}
.keypad button:active {
  background: var(--bg);
}
.filler-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}
.filler-actions .btn {
  height: 56px;
  font-size: 17px;
}

@media (max-width: 760px) {
  .desk-only {
    display: none !important;
  }
  .app-header .inner {
    min-height: 56px;
    padding: 0 16px;
    padding-top: var(--safe-t);
    gap: 8px;
  }
  .brand {
    font-size: 26px;
  }
  .main-nav,
  .account .acc-text,
  .account .acc-out,
  .badge-admin {
    display: none;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b);
  }
  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tabbar-h);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
  }
  .tabbar a[aria-current="page"] {
    color: var(--ink);
    font-weight: 700;
  }
  .tabbar a[aria-current="page"] svg {
    color: var(--accent);
  }
  body.has-tabbar {
    padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  }

  .actionbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    gap: 10px;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + var(--safe-b));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  }
  .actionbar .btn {
    flex: 1 1 0;
    height: 52px;
    font-size: 16px;
    min-width: 0;
  }
  body.has-actionbar {
    padding-bottom: calc(76px + var(--safe-b));
  }
  body.has-actionbar .tabbar {
    display: none;
  }

  dialog.dlg {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  dialog.dlg::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: var(--control);
    margin: 8px auto 0;
  }
  .dlg-body {
    padding: 14px 16px calc(16px + var(--safe-b));
  }
  .dlg-actions {
    flex-direction: column-reverse;
  }
  .dlg-actions .btn {
    width: 100%;
    height: 52px;
  }
  dialog.filler {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .filler-title {
    font-size: 28px;
  }

  .page {
    padding: 16px 16px 32px;
    gap: 16px;
  }
  .page-title {
    font-size: 32px;
  }
  .page-sub {
    font-size: 14px;
  }
  .card-pad {
    padding: 16px;
  }
  .toast {
    bottom: calc(var(--tabbar-h) + 16px + var(--safe-b));
  }
  body.has-actionbar .toast {
    bottom: calc(86px + var(--safe-b));
  }
}

/* =====================================================================
   Complementos do app (fora do protótipo compartilhado)
   ===================================================================== */
.link-on-dark {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 14px;
  padding: 10px 6px;
  text-decoration: underline;
}
.acc-out {
  display: inline;
  margin: 0;
}
.avatar-link {
  padding: 0 !important;
  display: inline-flex;
  text-decoration: none;
}
.btn-fill {
  border-color: var(--accent-ink) !important;
  color: var(--accent-deep) !important;
}
.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.rules li[data-ok="true"] {
  color: var(--ok);
  font-weight: 600;
}
.rules li .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.empty-state {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}
.pager:empty {
  display: none;
}
.toolbar {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips .chip {
  flex: none;
}
.kbd-grabbed {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Entrar */
.auth {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
}
.auth-hero {
  flex: 1 1 420px;
  background: var(--dark);
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.auth-hero h1 {
  font-family: var(--font-cond);
  font-size: 64px;
  line-height: 0.95;
  max-width: 520px;
  text-wrap: balance;
}
.auth-hero p {
  font-size: 18px;
  color: #d6d4cd;
  max-width: 440px;
  margin: 20px 0 0;
}
.mini-sheet {
  max-width: 340px;
  background: #fff;
  color: #111;
  padding: 16px 18px;
  border-radius: 4px;
  transform: rotate(-2deg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mini-sheet .lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 2px solid #111;
  padding-bottom: 2px;
}
.mini-sheet .r {
  display: flex;
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px solid #c9c6be;
}
.mini-sheet .r:last-child {
  border-bottom: 0;
}
.mini-sheet .n {
  font-size: 12px;
  color: #4a4945;
  width: 18px;
  text-align: right;
}
.mini-sheet .t {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  display: block;
}
.mini-sheet .a {
  font-size: 10px;
  color: #4a4945;
  display: block;
}
.auth-form {
  flex: 1 1 420px;
  padding: 56px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-box .seg button {
  flex: 1;
  height: 44px;
}

/* Repertórios */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px;
}
.rep {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rep-name {
  font-family: var(--font-cond);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.rep-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.rep-stats b {
  font-family: var(--font-cond);
  font-size: 26px;
  line-height: 1;
  display: block;
}
.rep-stats span {
  font-size: 12px;
  color: var(--muted);
}
.rep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.rep-actions .grow {
  flex: 1 1 auto;
}

/* Minhas músicas */
.sugg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sugg button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--control);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
}
.song-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 20px;
  min-height: 60px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.c-main {
  flex: 1 1 auto;
  min-width: 0;
}
.c-used {
  width: 104px;
  text-align: center;
  flex: none;
  font-size: 14px;
  color: var(--muted);
}
.c-act {
  width: 92px;
  flex: none;
  display: flex;
  justify-content: flex-end;
}
.dur-chip {
  flex: none;
  min-width: 72px;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg);
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dur-chip.missing {
  border: 1.5px dashed var(--accent-ink);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--font);
  font-size: 14px;
}
.dups-box {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.dup-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
}
.dup-text {
  flex: 1 1 240px;
}
.new-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.new-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.dur-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 14px;
  color: var(--ink-2);
}
.mob-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-foot {
  margin: 0;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 0 0 14px 14px;
}

/* Montar e Folha: cabeçalho do repertório */
.subhead {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.subhead .inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.name-input {
  flex: 3 1 260px;
  height: 48px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 28px;
}
.date-input {
  flex: 1 1 140px;
  height: 48px;
  font-size: 17px;
  font-weight: 600;
}
.sub-title {
  font-size: 28px;
  flex: 1 1 260px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.steps a {
  height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
}
.steps a[aria-current="step"] {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.save-state {
  min-width: 64px;
}

/* Montar */
.summary {
  background: var(--dark);
  color: #fff;
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}
.summary .k {
  font-size: 12px;
  color: var(--on-dark-muted);
  display: block;
}
.summary .v {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
}
.summary input {
  width: 60px;
  height: 44px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--dark-line);
  background: var(--dark-2);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.summary .diff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.missing-link {
  background: transparent !important;
  border: 1px dashed #fdba74 !important;
  color: #fdba74 !important;
}
.bar {
  height: 6px;
  background: #2e2d2a;
  border-radius: 3px;
  overflow: hidden;
  display: block;
  margin-top: 4px;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.cols {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.picker {
  flex: 1 1 360px;
  min-width: 0;
  overflow: hidden;
  position: sticky;
  top: 12px;
}
.picker-head {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.pick-list {
  max-height: 62vh;
  overflow-y: auto;
}
.picker-foot {
  padding: 12px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.blocks {
  flex: 2 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 8px;
  min-height: 56px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.pick-row.used {
  background: var(--surface-2);
}
/* "Esmaecida" (CA-05.5) sem perder o contraste AA (§1.10): cor secundária em vez de opacidade. */
.pick-row.used .t-title,
.pick-row.used .t-artist,
.pick-row.used .dur-ro,
.ps-row[aria-disabled="true"] .t-title,
.ps-row[aria-disabled="true"] .t-artist {
  color: var(--muted);
}
.pick-row.used .dur-ro.miss {
  color: var(--muted);
}
.grip-space {
  width: 36px;
  flex: none;
}
.used-check {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #15803d;
}
.block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.block.active {
  border: 2px solid var(--accent);
}
.block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  flex-wrap: wrap;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
}
.block-name {
  flex: 1 1 160px;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 22px;
}
.block-name:focus {
  border-color: var(--control);
  background: #fff;
}
.recv {
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--control);
}
.recv .d {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #a8a59d;
}
.recv[aria-pressed="true"] {
  background: var(--accent-soft-2);
  color: var(--accent-deep);
  border-color: #fdba74;
}
.recv[aria-pressed="true"] .d {
  background: var(--accent);
  border-color: var(--accent);
}
.item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 2px;
  min-height: 56px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
button.grip {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 6px;
}
.item .grip,
.pick-row .grip {
  width: 36px;
  height: 52px;
}
.item .n {
  width: 24px;
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}
.item-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 0;
}
.dur-ro {
  width: 50px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
}
.dur-ro.miss {
  font-size: 11px;
  color: var(--accent-deep);
}
.arrow {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
}
.arrow:hover:not([disabled]) {
  background: var(--bg);
}
.arrow[disabled] {
  opacity: 0.25;
  cursor: default;
}
.empty-zone {
  min-height: 64px;
  margin: 10px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}
.add-in-block {
  width: 100%;
  height: 52px;
  border: 0;
  border-top: 1px solid var(--line-2);
  background: #fff;
  color: var(--accent-ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.add-block {
  border: 2px dashed var(--control) !important;
  background: transparent !important;
  border-radius: 12px !important;
}
dialog.picker-sheet {
  height: 92vh;
}
.ps-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 0 !important;
}
.ps-list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0 -16px;
  border-top: 1px solid var(--line);
}
.ps-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 6px 16px;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
  text-align: left;
}
.ps-row .plus {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ps-row[aria-disabled="true"] {
  background: var(--surface-2);
}
.ps-row[aria-disabled="true"] .plus {
  border-color: #15803d;
  color: #15803d;
}
.ps-foot {
  position: sticky;
  bottom: 0;
  background: #fff;
  margin: 0 -16px;
  padding: 10px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}

/* Folha */
.folha-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.opts {
  flex: 1 1 300px;
  max-width: 340px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 12px;
}
.opts-legend {
  font-size: 22px;
}
.fmts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fmt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--control);
}
.fmt[aria-checked="true"] {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  padding: 11px;
}
.fmt .ic {
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: repeating-linear-gradient(#fff 0 3px, #a8a59d 3px 4px);
}
.fmt .txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fmt-name {
  font-weight: 700;
  font-size: 16px;
}
.fmt-rec {
  font-size: 10px;
  text-transform: uppercase;
}
.opts fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.opts legend {
  font-weight: 700;
  padding: 0;
  margin-bottom: 6px;
}
details.more > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  font-weight: 700;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary::after {
  content: "▾";
  font-size: 14px;
  color: var(--muted);
}
details.more[open] > summary::after {
  content: "▴";
}
details.more .inner-opts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 4px;
}
.preview {
  flex: 3 1 600px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stage {
  background: #d9d6cf;
  border-radius: 12px;
  padding: 32px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-scale {
  margin: 0 auto;
}
.sheet-stack {
  transform-origin: top left;
  width: max-content;
}
svg.sheet {
  display: block;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
svg.sheet + svg.sheet {
  margin-top: 12mm;
}

/* Administração */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat {
  padding: 16px 18px;
}
.stat b {
  font-family: var(--font-cond);
  font-size: 40px;
  line-height: 1;
  display: block;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
/* Ações da conta: uma coluna da tabela por ação, então os botões ficam alinhados entre as
   linhas mesmo quando o texto muda (Bloquear/Desbloquear) ou falta um botão (sua conta). */
.tbl td.act {
  width: 1%;
  white-space: nowrap;
  padding-left: 3px;
  padding-right: 3px;
}
.tbl td.act-reset {
  padding-left: 14px;
}
.tbl td.act-del {
  padding-right: 14px;
}
.tbl td.act .btn {
  width: 100%;
  height: 44px;
}
.btn-del {
  color: var(--danger);
}
.temp-pw {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--bg);
  border: 1px dashed var(--control);
  border-radius: 8px;
  padding: 10px 14px;
  flex: 1 1 auto;
  user-select: all;
}

@media print {
  /* A folha sai sempre em tamanho real, mesmo com a prévia reduzida na tela. */
  .sheet-scale {
    width: auto !important;
    height: auto !important;
  }
  .sheet-scale > .sheet-stack {
    transform: none !important;
  }
  body.has-actionbar,
  body.has-tabbar {
    padding: 0 !important;
  }
  .folha-layout,
  .preview {
    display: block;
    padding: 0;
    margin: 0;
    max-width: none;
  }
  svg.sheet {
    box-shadow: none !important;
    margin: 0 !important;
    break-after: page;
  }
  svg.sheet:last-child {
    break-after: auto;
  }
}

@media (max-width: 760px) {
  .btn-block-mob {
    width: 100%;
  }
  .page-head > div {
    width: 100%;
  }
  /* Entrar */
  .auth {
    flex-direction: column;
    min-height: 0;
  }
  .auth-hero {
    flex: none;
    padding: calc(20px + var(--safe-t)) 20px 20px;
    gap: 10px;
  }
  .auth-hero h1 {
    font-size: 30px;
  }
  .auth-hero p,
  .mini-sheet {
    display: none;
  }
  .auth-form {
    flex: none;
    padding: 20px 16px calc(32px + var(--safe-b));
    align-items: flex-start;
  }
  .auth-box h2 {
    font-size: 28px !important;
  }
  /* Repertórios */
  .grid-cards {
    gap: 12px;
  }
  .rep {
    padding: 16px;
    gap: 12px;
  }
  .rep-name {
    font-size: 26px;
  }
  .rep-stats b {
    font-size: 22px;
  }
  /* Minhas músicas */
  #new-home {
    display: none;
  }
  .song-row {
    padding: 8px 4px 8px 16px;
    gap: 8px;
  }
  .toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px 12px;
  }
  .toolbar .search {
    flex: 1 1 100%;
    max-width: none !important;
  }
  .new-fields .field,
  .new-fields .btn {
    flex: 1 1 100% !important;
  }
  .new-fields .dur-big {
    width: 100%;
  }
  .dup-card .btn {
    flex: 1 1 100%;
  }
  #dlg-new .new-card {
    border: 0;
    padding: 0;
  }
  #dlg-new .new-submit {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  /* Montar e Folha */
  .subhead .inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .name-input {
    flex: 1 1 0;
    font-size: 24px;
    height: 44px;
  }
  .date-input {
    flex: 1 1 100%;
    height: 44px;
    font-size: 16px;
  }
  .sub-title {
    font-size: 22px;
    flex: 1 1 0;
  }
  .steps {
    flex: 1 1 100%;
  }
  .steps a {
    flex: 1;
    padding: 0 8px;
    font-size: 14px;
    height: 44px;
  }
  .save-state {
    display: none;
  }
  .summary {
    padding: 12px 14px;
    gap: 10px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .summary .v {
    font-size: 24px;
  }
  .summary .diff {
    grid-column: 1 / -1;
  }
  .picker {
    display: none;
  }
  .blocks {
    flex-basis: 100%;
  }
  .block-head {
    padding: 6px 4px 6px 8px;
  }
  .item {
    padding-right: 0;
  }
  .folha-layout {
    padding: 12px 12px 24px;
    gap: 12px;
  }
  .opts {
    max-width: none;
    position: static;
    padding: 12px;
    gap: 8px;
    flex-basis: 100%;
  }
  .opts-legend {
    font-size: 15px !important;
    margin-bottom: 4px;
  }
  .fmts {
    flex-direction: row;
    gap: 6px;
  }
  .fmt {
    flex-direction: column;
    gap: 6px;
    padding: 10px 4px;
    text-align: center;
    align-items: center;
  }
  .fmt[aria-checked="true"] {
    padding: 9px 3px;
  }
  .fmt .hint,
  .fmt .pill {
    display: none;
  }
  .fmt .txt {
    align-items: center;
  }
  .fmt-name {
    font-size: 14px;
  }
  .preview {
    flex-basis: 100%;
  }
  .stage {
    padding: 12px;
    border-radius: 10px;
  }
  .desk-actions {
    display: none !important;
  }
  /* Administração */
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat b {
    font-size: 32px;
  }
  .tbl-cards thead {
    display: none;
  }
  .tbl-cards,
  .tbl-cards tbody,
  .tbl-cards tr,
  .tbl-cards td {
    display: block;
    width: auto;
  }
  .tbl-cards tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .tbl-cards td {
    border: 0;
    padding: 2px 0;
    text-align: left !important;
  }
  .tbl-cards td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
  }
  #rows td.num {
    display: inline-block;
    margin-right: 12px;
  }
  /* Cartões: "Redefinir senha" na largura toda; Bloquear e Excluir lado a lado, sempre iguais. */
  .tbl-cards td.act {
    display: inline-block;
    vertical-align: top;
    width: 100%;
    padding: 8px 0 0;
  }
  .tbl-cards td.act-block,
  .tbl-cards td.act-del {
    width: calc(50% - 4px);
  }
  .tbl-cards td.act-block {
    margin-right: 8px;
  }
  .tbl-cards td.act:empty {
    display: none;
  }
}

/* §1.12: alvos de toque ≥ 44 px no celular (o protótipo tinha chips e segmentos de 40 px). */
@media (max-width: 760px) {
  .chip,
  .seg button,
  .btn-sm,
  .check {
    min-height: 44px;
  }
}

/* Linhas de lista: só a coluna de texto encolhe (com reticências); botões e tempo não. */
.btn-icon,
.arrow,
.grip,
.dur-chip,
.dur-input,
.dur-ro {
  flex-shrink: 0;
}
.c-main,
.item-main {
  flex: 1 1 0;
  min-width: 0;
}

/* Entrar: a tela cabe inteira na janela, sem rolagem (espaços e letras acompanham a altura). */
.auth {
  min-height: 100dvh;
}
.auth-hero {
  padding: clamp(24px, 6vh, 56px) clamp(24px, 4vw, 48px);
  gap: clamp(16px, 4vh, 40px);
}
.auth-hero h1 {
  font-size: clamp(36px, 7vh, 64px);
}
.auth-hero p {
  font-size: clamp(15px, 2.2vh, 18px);
  margin-top: clamp(8px, 2vh, 20px);
}
.auth-form {
  padding: clamp(24px, 6vh, 56px) 24px;
}
.auth-help {
  margin: 0;
  line-height: 1.5;
}
@media (min-width: 761px) and (max-height: 720px) {
  .mini-sheet {
    display: none;
  }
}
@media (max-width: 760px) {
  .auth-hero {
    padding: calc(16px + var(--safe-t)) 20px 16px;
    gap: 6px;
  }
  .auth-hero h1 {
    font-size: 28px;
  }
  .auth-form {
    padding: 16px 16px calc(16px + var(--safe-b));
  }
}

/* Montar: sem espaço para as duas colunas (≤ 950 px), a coleção vira a folha "Adicionar músicas". */
@media (max-width: 950px) {
  .page-montar .picker {
    display: none;
  }
  .page-montar .blocks {
    flex-basis: 100%;
  }
}
