/* ChordMaster custom theme.
 * Loaded AFTER Tailwind CDN so these utilities and tokens override / extend it.
 * Pure CSS, no preprocessor, compatible with iOS 12 Safari (no `gap` on flex).
 */

/* Tailwind 2 does not add !important to [hidden], so inline styles can override it.
 * This rule ensures elements with the hidden attribute are always invisible,
 * regardless of inline display values (e.g. display:contents on nav groups). */
[hidden] { display: none !important; }

:root {
  --stage-bg: #0a0a0d;
  --stage-bg-soft: #111118;
  --stage-surface: #161620;
  --stage-surface-hover: #1d1d2a;
  --stage-border: #262633;
  --stage-border-strong: #3a3a4a;
  --stage-text: #f5f5f7;
  --stage-muted: #9292a3;
  --stage-accent: #22d3ee;
  --stage-accent-strong: #06b6d4;
  --stage-accent-soft: rgba(34, 211, 238, 0.15);
  --stage-chord: #fbbf24;
  --stage-chord-soft: rgba(251, 191, 36, 0.18);
  --stage-violet: #a78bfa;
  --stage-success: #34d399;
  --stage-danger: #f87171;
  /* brand tokens used only by banner-hero / cta-banner */
  --brand-rose: #ec4899;
  --brand-rose-soft: rgba(236, 72, 153, 0.22);
  --brand-orange: #f97316;
  --brand-violet: #8b5cf6;
  color-scheme: dark;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--stage-bg);
  color: var(--stage-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-image:
    radial-gradient(800px 400px at 12% -10%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(700px 360px at 90% 8%, rgba(167, 139, 250, 0.06), transparent 60%);
  background-attachment: fixed;
}

button {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  cursor: pointer;
}

a { color: inherit; }

/* -------------------------------------------------------
 * Color utilities (replace the original Tailwind extend).
 * Used by HTML/JS classes like `bg-stage-bg`, `text-stage-muted`.
 * ------------------------------------------------------- */
.bg-stage-bg        { background-color: var(--stage-bg) !important; }
.bg-stage-bg-soft   { background-color: var(--stage-bg-soft) !important; }
.bg-stage-bg-95     { background-color: rgba(10, 10, 13, 0.92) !important; }
.bg-stage-surface   { background-color: var(--stage-surface) !important; }
.bg-stage-accent    { background-color: var(--stage-accent) !important; }
.bg-stage-chord     { background-color: var(--stage-chord) !important; }

.text-stage-text    { color: var(--stage-text) !important; }
.text-stage-muted   { color: var(--stage-muted) !important; }
.text-stage-accent  { color: var(--stage-accent) !important; }
.text-stage-chord   { color: var(--stage-chord) !important; }
.text-stage-bg      { color: var(--stage-bg) !important; }
.text-stage-violet  { color: var(--stage-violet) !important; }

.border-stage-border        { border-color: var(--stage-border) !important; }
.border-stage-border-strong { border-color: var(--stage-border-strong) !important; }
.border-stage-accent        { border-color: var(--stage-accent) !important; }

.placeholder-muted::placeholder { color: var(--stage-muted); }

.hover\:border-stage-accent:hover { border-color: var(--stage-accent) !important; }
.hover\:bg-stage-surface-hover:hover { background-color: var(--stage-surface-hover) !important; }
.hover\:text-stage-accent:hover { color: var(--stage-accent) !important; }

.ring-accent { box-shadow: 0 0 0 2px var(--stage-accent-soft); }

/* -------------------------------------------------------
 * Components.
 * ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  color: var(--stage-text);
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.btn > * + * { margin-left: 0.4rem; }
.btn:hover { background-color: var(--stage-surface-hover); border-color: var(--stage-border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--stage-accent); outline-offset: 2px; }

.btn-primary {
  background-color: var(--stage-accent);
  color: #04141b;
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover { background-color: var(--stage-accent-strong); border-color: transparent; }

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

.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; border-radius: 0.4rem; }

.input {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  color: var(--stage-text);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.input::placeholder { color: var(--stage-muted); }
.input:hover { border-color: var(--stage-border-strong); }
.input:focus {
  outline: none;
  border-color: var(--stage-accent);
  box-shadow: 0 0 0 3px var(--stage-accent-soft);
  background-color: var(--stage-bg-soft);
}

textarea.input { font-family: ui-monospace, Menlo, Consolas, monospace; min-height: 8rem; }

.label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stage-muted);
  font-weight: 600;
}

.card {
  display: block;
  border-radius: 0.85rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.card:hover {
  border-color: var(--stage-accent);
  background-color: var(--stage-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -20px rgba(34, 211, 238, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-bg-soft);
  color: var(--stage-muted);
}
.badge-key {
  border-color: var(--stage-chord-soft);
  background-color: var(--stage-chord-soft);
  color: var(--stage-chord);
}
.badge-accent {
  border-color: var(--stage-accent-soft);
  background-color: var(--stage-accent-soft);
  color: var(--stage-accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  color: var(--stage-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--stage-accent); color: var(--stage-accent); }
.chip-active { border-color: var(--stage-accent); background-color: var(--stage-accent-soft); color: var(--stage-accent); }

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.4rem;
  border-radius: 0.3rem;
  border: 1px solid var(--stage-border-strong);
  background-color: var(--stage-bg-soft);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--stage-muted);
}

.divider {
  height: 1px;
  background-color: var(--stage-border);
  margin: 1.5rem 0;
}

/* -------------------------------------------------------
 * App shell (sidebar + appbar)
 * ------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--stage-text);
}
.brand-logo { display: block; }
.brand-logo-full { height: 34px; width: auto; }
.brand-logo-mark { height: 32px; width: 32px; display: none; }
@media (max-width: 720px) {
  .brand-logo-full { display: none; }
  .brand-logo-mark { display: block; }
}

.sidebar-header .brand-logo-full { display: block; }
.sidebar-header .brand-logo-mark { display: none; }

.brand-appbar {
  flex-shrink: 0;
}
.brand-appbar .brand-logo-full { display: none; }
.brand-appbar .brand-logo-mark { display: block; height: 28px; width: 28px; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: rgba(10, 10, 13, 0.97);
  border-right: 1px solid var(--stage-border);
  transform: translateX(-100%);
  transition: transform 220ms ease;
}
body.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--stage-border);
  flex-shrink: 0;
}

.sidebar-close-btn,
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--stage-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 120ms ease, background-color 120ms ease;
}
.sidebar-close-btn:hover,
.hamburger-btn:hover {
  color: var(--stage-text);
  background-color: var(--stage-surface);
}
.sidebar-close-btn svg,
.hamburger-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.25rem;
  flex: 1;
}
.sidebar-nav #auth-slot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--stage-border);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  color: var(--stage-muted);
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}
.nav-link:hover { color: var(--stage-text); background-color: var(--stage-surface); }
.nav-link.is-active { color: var(--stage-text); background-color: var(--stage-surface); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.55);
}
body.sidebar-open .sidebar-overlay {
  display: block;
}
@media (min-width: 768px) {
  body.sidebar-open .sidebar-overlay {
    display: none;
  }
}

.appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background-color: rgba(10, 10, 13, 0.9);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--stage-border);
  transition: left 220ms ease;
}
@media (min-width: 768px) {
  body.sidebar-open .appbar {
    left: 240px;
  }
}

.topbar-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  display: flex;
  align-items: center;
}
.appbar .topbar-search {
  margin-left: auto;
}
.topbar-search svg {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--stage-muted);
}
.topbar-search input {
  width: 100%;
  background-color: rgba(10, 10, 13, 0.6);
  border: 1px solid var(--stage-border);
  color: var(--stage-text);
  border-radius: 999px;
  padding: 0.55rem 2.6rem 0.55rem 2.4rem;
  font-size: 0.9rem;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.topbar-search input::placeholder { color: var(--stage-muted); }
.topbar-search input:focus {
  outline: none;
  border-color: var(--stage-accent);
  background-color: rgba(10, 10, 13, 0.95);
  box-shadow: 0 0 0 3px var(--stage-accent-soft);
}
.topbar-search .kbd { position: absolute; right: 0.6rem; }
@media (max-width: 720px) {
  .appbar .topbar-search { display: none; }
}

#view.container-app,
.site-footer {
  margin-top: 52px;
  transition: margin-left 220ms ease;
}
@media (min-width: 768px) {
  body.sidebar-open #view.container-app,
  body.sidebar-open .site-footer {
    margin-left: 240px;
  }
}

/* -------------------------------------------------------
 * Hero (dashboard)
 * ------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid var(--stage-border);
  padding: 3rem 1.5rem 2.5rem;
  background:
    radial-gradient(70% 80% at 15% 0%, rgba(34, 211, 238, 0.20), transparent 60%),
    radial-gradient(60% 70% at 85% 30%, rgba(167, 139, 250, 0.18), transparent 60%),
    radial-gradient(40% 50% at 50% 110%, rgba(251, 191, 36, 0.10), transparent 60%),
    linear-gradient(180deg, #14141f 0%, #0c0c14 100%);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 24px);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--stage-border);
  background-color: rgba(34, 211, 238, 0.08);
  color: var(--stage-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-title {
  margin: 0.9rem 0 0.6rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero-title .gradient-text {
  background: linear-gradient(120deg, #fff 0%, #fff 30%, var(--stage-accent) 65%, var(--stage-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 42rem;
  color: var(--stage-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.search-jumbo {
  position: relative;
  max-width: 36rem;
}
.search-jumbo input {
  width: 100%;
  font-size: 1.05rem;
  padding: 1rem 1rem 1rem 3rem;
  border-radius: 999px;
  border: 1px solid var(--stage-border-strong);
  background-color: rgba(10, 10, 13, 0.7);
  color: var(--stage-text);
  transition: all 160ms ease;
}
.search-jumbo input:focus {
  outline: none;
  border-color: var(--stage-accent);
  box-shadow: 0 0 0 4px var(--stage-accent-soft);
  background-color: rgba(10, 10, 13, 0.95);
}
.search-jumbo .search-icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem; height: 1.1rem;
  color: var(--stage-muted);
}
.search-jumbo .search-hint {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  gap: 1rem;
}
.hero-stat {
  flex: 1 1 8rem;
  border: 1px solid var(--stage-border);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background-color: rgba(10, 10, 13, 0.55);
}
.hero-stat .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stage-muted);
  margin-bottom: 0.3rem;
}
.hero-stat .stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Section heading */
.section-head {
  display: flex;
  align-items: end;
  margin-bottom: 1rem;
}
.section-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-head .section-sub {
  font-size: 0.85rem;
  color: var(--stage-muted);
  margin-left: 0.6rem;
}
.section-head .section-action { margin-left: auto; }

/* Chip rail */
.chip-rail {
  display: flex;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.chip-rail::-webkit-scrollbar { height: 6px; }
.chip-rail::-webkit-scrollbar-thumb { background: var(--stage-border); border-radius: 999px; }
.chip-rail > * { flex-shrink: 0; }
.chip-rail > * + * { margin-left: 0.4rem; }

/* Featured card */
.feat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.feat-card .feat-title { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.feat-card .feat-artist { color: var(--stage-muted); font-size: 0.85rem; }
.feat-card .feat-meta {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Grids */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* KPI Dashboard */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kpi-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

.kpi-card {
  background: var(--stage-card, #13131a);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-card-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.kpi-card-label { font-size: 0.72rem; color: var(--stage-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-card-sub { font-size: 0.72rem; color: var(--stage-muted); }

.grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) { .grid-2col { grid-template-columns: 1fr 1fr; } }

.kpi-server-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .kpi-server-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .kpi-server-grid { grid-template-columns: repeat(4, 1fr); } }

/* Skeletons */
.skeleton {
  border-radius: 0.5rem;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent),
    var(--stage-surface);
  background-size: 200% 100%;
  animation: cm-shimmer 1.4s linear infinite;
}
@keyframes cm-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty {
  border: 1px dashed var(--stage-border);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--stage-muted);
  background-color: rgba(255,255,255,0.015);
}
.empty .empty-emoji {
  font-size: 1.6rem; line-height: 1; margin-bottom: 0.5rem;
}

/* Toasts */
#toast {
  pointer-events: none;
  position: fixed;
  inset-inline: 0;
  bottom: 1.5rem;
  z-index: 50;
  display: flex;
  justify-content: center;
}
#toast > * { pointer-events: auto; }
#toast > * + * { margin-top: 0.4rem; }
.toast-msg {
  display: inline-flex;
  align-items: center;
  border-radius: 0.6rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: 0 16px 40px -20px rgba(0,0,0,0.6);
}
.toast-error { color: #fca5a5; border-color: rgba(248,113,113,0.4); }
.toast-success { color: var(--stage-success); border-color: rgba(52,211,153,0.4); }

/* -------------------------------------------------------
 * Chord viewer (clean stage)
 * ------------------------------------------------------- */
.chord-page { max-width: 56rem; margin: 0 auto; }
.chord-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.chord-head .chord-info { flex: 1 1 16rem; min-width: 0; }
.chord-head h1 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.01em;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.2rem;
}
.chord-head .chord-meta { color: var(--stage-muted); font-size: 0.95rem; }

.chord-controls {
  display: flex;
  flex-wrap: wrap;
}
.chord-controls > * + * { margin-left: 0.4rem; }
.chord-controls .ctrl-group {
  display: inline-flex;
  border-radius: 0.55rem;
  border: 1px solid var(--stage-border);
  overflow: hidden;
  background-color: var(--stage-surface);
}
.chord-controls .ctrl-group .btn {
  border: none;
  border-radius: 0;
  background-color: transparent;
}
.chord-controls .ctrl-group .btn + .btn { border-left: 1px solid var(--stage-border); }

.chord-body {
  white-space: pre-wrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: normal;
  background: transparent;
}
.chord-line { color: var(--stage-chord); font-weight: 700; }

.player-wrap {
  margin-bottom: 1rem;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
}
.player-wrap iframe { display: block; width: 100%; }
.player-yt iframe { aspect-ratio: 16 / 9; height: auto; min-height: 240px; }
.player-sp iframe { height: 152px; }

.scroll-row {
  display: flex;
  align-items: center;
  margin: 1rem 0 1.25rem;
}
.scroll-row > * + * { margin-left: 0.6rem; }
.scroll-row input[type=range] { flex: 1; accent-color: var(--stage-accent); }

.playlist-queue-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-bg-soft);
}
.playlist-queue-bar > * + * { margin-left: 0.45rem; }
.playlist-queue-bar .queue-title {
  flex: 1 1 8rem;
  min-width: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
}
.sheet-modal[hidden] { display: none !important; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.sheet-panel {
  position: relative;
  width: min(26rem, 100%);
  max-height: 70vh;
  overflow: auto;
  margin: 0.75rem;
  padding: 1rem 1.1rem 1.2rem;
  z-index: 1;
  border-radius: 0.85rem 0.85rem 0 0;
  box-sizing: border-box;
}
@media (min-width: 540px) {
  .sheet-modal { align-items: center; }
  .sheet-panel { border-radius: 0.85rem; margin: 1rem; }
}

.stage-mode { background: #000; color: #fff; }
.stage-mode .appbar,
.stage-mode .sidebar,
.stage-mode .sidebar-overlay { display: none !important; }
.stage-mode body { background: #000; }
.stage-mode .chord-line { color: #ffd166; }
.stage-mode .chord-body { font-size: 1.2rem; line-height: 1.7; }

/* -------------------------------------------------------
 * Print (PDF export)
 * ------------------------------------------------------- */
@media print {
  /* hide navigation and UI chrome */
  .appbar, .sidebar, .sidebar-overlay, #toast, .player-wrap, .scroll-row, .chord-controls, .chord-actions,
  .playlist-queue-bar, .sheet-modal, .site-footer, details#share-panel,
  #pl-search, #pl-search-results, button, form { display: none !important; }
  #view.container-app,
  .site-footer {
    margin-top: 0 !important;
    margin-left: 0 !important;
  }
  body { background: #fff !important; color: #000 !important; }
  /* chord view */
  .chord-body { color: #000; font-size: 12pt; }
  .chord-line { color: #92400e; font-weight: 700; }
  .chord-page { max-width: none; }
  /* playlist / repertorio print */
  .pl-print-area { display: block !important; }
  .pl-print-area .card {
    page-break-inside: avoid;
    border: none !important;
    box-shadow: none !important;
    padding: 0.4rem 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
  }
  .pl-print-area .feat-title { font-size: 11pt; font-weight: 700; color: #000; }
  .pl-print-area .feat-artist { font-size: 9pt; color: #555; }
  .pl-print-area .badge-key { font-size: 9pt; border: 1px solid #999; padding: 0.1rem 0.3rem; border-radius: 3px; }
  /* hide buttons inside items */
  .pl-print-area button, .pl-print-area .btn { display: none !important; }
  /* counter-based numbering */
  .pl-print-area { counter-reset: pl-item; }
  .pl-print-area .card::before {
    counter-increment: pl-item;
    content: counter(pl-item) ".";
    font-size: 9pt;
    color: #999;
    min-width: 1.6rem;
    flex-shrink: 0;
  }
}

/* -------------------------------------------------------
 * Layout helpers
 * ------------------------------------------------------- */
.container-app { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
.stack > * + * { margin-top: 0.6rem; }
.stack-lg > * + * { margin-top: 1.2rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.row > * + * { margin-left: 0.6rem; }
.row-tight > * + * { margin-left: 0.35rem; }
.col { display: flex; flex-direction: column; }
.col > * + * { margin-top: 0.6rem; }
.spacer { flex: 1; }
.muted { color: var(--stage-muted); }
.tabular { font-variant-numeric: tabular-nums; }

.min-w-key { min-width: 3.5rem; }
.min-w-search { min-width: 12rem; }

/* iOS 12 / Safari < 14.1 do not support `gap` on flex.
 * The runtime check in app.js adds .no-flex-gap to <html>; we then emulate
 * gap with margins on direct children. Grid `gap` keeps working natively.
 */
.no-flex-gap .row > * + *,
.no-flex-gap .col > * + *,
.no-flex-gap .stack > * + *,
.no-flex-gap .stack-lg > * + *,
.no-flex-gap .chord-controls > * + *,
.no-flex-gap .chord-controls .ctrl-group .btn + .btn,
.no-flex-gap .scroll-row > * + *,
.no-flex-gap .chip-rail > * + * { /* keep margins defined above */ }

.no-flex-gap .sidebar-nav {
  gap: 0;
}
.no-flex-gap .sidebar-nav .nav-link + .nav-link {
  margin-top: 0.25rem;
}
.no-flex-gap .sidebar-nav #auth-slot {
  margin-top: auto;
}

.no-flex-gap .hero-stats > * + * { margin-left: 1rem; }
.no-flex-gap .chord-head > * + * { margin-left: 1rem; }

/* Override Tailwind utility `gap-*` when not natively supported, by injecting
 * margins on direct children of any flex container that uses it. */
.no-flex-gap [class*="gap-"]:not(.grid) > * + * { margin-left: 0.5rem; }
.no-flex-gap [class*="gap-"]:not(.grid).flex.flex-col > * + * { margin-left: 0; margin-top: 0.5rem; }

/* =====================================================================
 * Dashboard "cifras-tube" sections
 * ===================================================================== */

.section-block { margin-top: 2.25rem; }
.section-block:first-child { margin-top: 0; }

/* ---------- Banner promocional ---------- */
.banner-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 220px;
  padding: 2rem 1.6rem;
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(236, 72, 153, 0.45), transparent 65%),
    radial-gradient(60% 100% at 100% 100%, rgba(139, 92, 246, 0.42), transparent 65%),
    linear-gradient(120deg, var(--brand-rose), var(--brand-orange) 50%, var(--brand-violet));
  color: #fff;
}
@media (min-width: 720px) {
  .banner-hero {
    grid-template-columns: 1.4fr 1fr;
    min-height: 260px;
    padding: 2.6rem 2.2rem;
  }
}
.banner-text { max-width: 32rem; position: relative; z-index: 1; }
.banner-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.28);
  color: #fff;
}
.banner-title {
  margin: 0.75rem 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.banner-sub {
  margin: 0 0 1.2rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}
.banner-cta {
  display: inline-flex;
  align-items: center;
  background-color: #0a0a0d;
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 120ms ease, background-color 120ms ease;
}
.banner-cta:hover { transform: translateY(-1px); background-color: #15151c; }
.banner-art {
  position: relative;
  display: none;
}
@media (min-width: 720px) {
  .banner-art { display: block; }
}
.banner-art img {
  position: absolute;
  right: -1rem; bottom: -1rem;
  width: 220px; height: 220px;
  object-fit: contain;
  transform: rotate(-8deg);
  filter: drop-shadow(0 30px 60px rgba(236, 72, 153, 0.45));
  opacity: 0.95;
}
.banner-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 26px);
  pointer-events: none;
}

/* ---------- Section heads (refined) ---------- */
.dash-section { margin-top: 2.25rem; }
.dash-section .section-head { margin-bottom: 0.85rem; }
.dash-section .section-head h2 { font-size: 1.15rem; font-weight: 700; }
.dash-section .section-action a {
  font-size: 0.85rem;
  color: var(--stage-muted);
  text-decoration: none;
  transition: color 120ms ease;
}
.dash-section .section-action a:hover { color: var(--stage-accent); }

/* ---------- Cifras em alta (numbered list, 2 columns) ---------- */
.song-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem 1.5rem;
}
@media (min-width: 900px) {
  .song-list { grid-template-columns: 1fr 1fr; }
}
.song-row {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 0.7rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 120ms ease, transform 120ms ease;
}
.song-row > * + * { margin-left: 0.85rem; }
.song-row:hover { background-color: var(--stage-surface); transform: translateX(2px); }
.song-rank {
  width: 1.6rem;
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--stage-muted);
  text-align: right;
}
.song-row:hover .song-rank { color: var(--stage-accent); }
.song-thumb {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem; color: #fff;
}
.song-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.song-info .song-title {
  display: block;
  font-weight: 600; font-size: 0.95rem;
  color: var(--stage-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.song-info .song-artist {
  display: block;
  color: var(--stage-muted); font-size: 0.78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 0.1rem;
}
.song-row .badge { flex-shrink: 0; }

/* ---------- Artistas populares (circular strip) ---------- */
.artist-strip {
  display: flex;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.artist-strip::-webkit-scrollbar { height: 6px; }
.artist-strip::-webkit-scrollbar-thumb { background: var(--stage-border); border-radius: 999px; }
.artist-strip > * { flex-shrink: 0; }
.artist-strip > * + * { margin-left: 1rem; }

.artist-tile {
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.45rem;
  width: 5.5rem;
  text-align: center;
  color: inherit;
}
.artist-tile > * + * { margin-top: 0.45rem; }
.artist-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; color: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease;
  border: 2px solid rgba(255,255,255,0.05);
}
.artist-tile:hover .artist-circle { transform: scale(1.06); box-shadow: 0 14px 30px -14px rgba(236, 72, 153, 0.6); }
.artist-name {
  font-size: 0.78rem;
  color: var(--stage-text);
  max-width: 5.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.artist-count { font-size: 0.7rem; color: var(--stage-muted); }

/* ---------- Novas cifras (lesson cards) ---------- */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 560px) { .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .lesson-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.lesson-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.lesson-card:hover { transform: translateY(-3px); border-color: var(--stage-accent); box-shadow: 0 18px 40px -22px rgba(34, 211, 238, 0.45); }
.lesson-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex; align-items: end; justify-content: flex-start;
  padding: 0.85rem;
  overflow: hidden;
}
.lesson-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.lesson-thumb-title {
  position: relative; z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 90%;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
.lesson-thumb .lesson-key {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1;
}
.lesson-thumb .lesson-play {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 1;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background-color: rgba(0,0,0,0.45);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.85rem;
}
.lesson-meta { padding: 0.7rem 0.85rem 0.85rem; }
.lesson-meta .lesson-title { font-weight: 600; font-size: 0.95rem; color: var(--stage-text); }
.lesson-meta .lesson-artist { font-size: 0.8rem; color: var(--stage-muted); margin-top: 0.15rem; }

/* Generated thumb gradients (mod 6) */
.thumb-1 { background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 60%, #06b6d4 100%); }
.thumb-2 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 60%, #8b5cf6 100%); }
.thumb-3 { background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #ec4899 100%); }
.thumb-4 { background: linear-gradient(135deg, #10b981 0%, #06b6d4 60%, #4f46e5 100%); }
.thumb-5 { background: linear-gradient(135deg, #f97316 0%, #ec4899 60%, #6366f1 100%); }
.thumb-6 { background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f97316 100%); }

/* Generated artist tile gradients (mod 6) */
.tile-1 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.tile-2 { background: linear-gradient(135deg, #f97316, #ec4899); }
.tile-3 { background: linear-gradient(135deg, #06b6d4, #4f46e5); }
.tile-4 { background: linear-gradient(135deg, #10b981, #22d3ee); }
.tile-5 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.tile-6 { background: linear-gradient(135deg, #8b5cf6, #06b6d4); }

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 2.4rem 1.6rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(34, 211, 238, 0.32), transparent 65%),
    linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, var(--brand-rose) 100%);
  color: #fff;
}
@media (min-width: 720px) {
  .cta-banner { grid-template-columns: 1.6fr 1fr; padding: 2.8rem 2.4rem; }
}
.cta-banner h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.cta-banner p { margin: 0; color: rgba(255, 255, 255, 0.9); max-width: 32rem; }
.cta-banner .cta-actions { margin-top: 1.1rem; display: inline-flex; flex-wrap: wrap; }
.cta-banner .cta-actions > * + * { margin-left: 0.6rem; }
.cta-banner .cta-btn {
  display: inline-flex; align-items: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background-color: #fff;
  color: #1e1b4b;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms ease;
}
.cta-banner .cta-btn:hover { transform: translateY(-1px); }
.cta-banner .cta-btn-ghost {
  background-color: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ---------- Filtro alfabetico ---------- */
.alpha-row {
  display: flex;
  flex-wrap: wrap;
}
.alpha-row > * { margin: 0.2rem 0.2rem 0.2rem 0; }
.alpha-letter {
  width: 2.2rem; height: 2.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--stage-border);
  background-color: var(--stage-surface);
  color: var(--stage-muted);
  font-weight: 600; font-size: 0.85rem;
  cursor: pointer;
  transition: all 120ms ease;
}
.alpha-letter:hover { color: var(--stage-text); border-color: var(--stage-border-strong); }
.alpha-letter.is-active { border-color: var(--stage-accent); background-color: var(--stage-accent-soft); color: var(--stage-accent); }

/* =====================================================================
 * Chord view extras: tom picker + video toggle
 * ===================================================================== */

.tom-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 0.4rem;
}
.tom-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--stage-text);
  margin-right: 0.4rem;
  letter-spacing: -0.01em;
}
.tom-value {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.55rem;
  border-radius: 0.55rem;
  color: var(--stage-chord);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.tom-value:hover { background-color: var(--stage-surface); border-color: var(--stage-border); }
.tom-value:focus { outline: none; background-color: var(--stage-surface); border-color: var(--stage-accent); }
.tom-caret {
  width: 0.85rem; height: 0.85rem;
  margin-left: 0.45rem;
  opacity: 0.7;
  transition: transform 160ms ease;
}
.tom-value[aria-expanded="true"] .tom-caret { transform: rotate(180deg); }
.tom-original {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  color: var(--stage-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.key-picker {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(22rem, calc(100vw - 1.25rem));
  max-width: calc(100vw - 2rem);
  background-color: var(--stage-surface);
  border: 1px solid var(--stage-border);
  border-radius: 0.85rem;
  padding: 0.85rem;
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, 0.75);
  z-index: 40;
}
.key-picker[hidden] { display: none !important; }
.key-picker::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 1.4rem;
  width: 12px; height: 12px;
  background-color: var(--stage-surface);
  border-left: 1px solid var(--stage-border);
  border-top: 1px solid var(--stage-border);
  transform: rotate(45deg);
}
.key-picker-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.key-step {
  background-color: var(--stage-bg-soft);
  border: 1px solid var(--stage-border);
  color: var(--stage-text);
  border-radius: 0.55rem;
  padding: 0.55rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}
.key-step:hover { border-color: var(--stage-accent); color: var(--stage-accent); }

.key-picker-rel-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.55rem;
}
.key-picker-rel-label {
  font-size: 0.72rem;
  width: 100%;
}
.key-picker-rel-mode .btn-sm.is-active-mode {
  border-color: var(--stage-accent);
  color: var(--stage-accent);
  background-color: var(--stage-accent-soft);
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
@media (min-width: 520px) {
  .key-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 380px) {
  .key-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
  }
}
.key-cell {
  position: relative;
  background-color: var(--stage-bg-soft);
  border: 1px solid var(--stage-border);
  color: var(--stage-text);
  border-radius: 0.55rem;
  padding: 0.45rem 0.12rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 100ms ease, color 100ms ease, background-color 100ms ease, transform 100ms ease;
}
.key-cell-minor {
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--stage-muted);
}
@media (max-width: 420px) {
  .key-cell { font-size: 0.72rem; padding: 0.38rem 0.06rem; }
  .key-cell-minor { font-size: 0.66rem; }
}
.key-cell:hover { border-color: var(--stage-accent); color: var(--stage-accent); }
.key-cell:focus { outline: none; border-color: var(--stage-accent); }
.key-cell.is-active {
  background-color: var(--stage-text);
  color: var(--stage-bg);
  border-color: var(--stage-text);
}
.key-cell.is-original::after {
  content: "";
  position: absolute;
  top: 4px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background-color: var(--stage-chord);
}

.key-reset {
  width: 100%;
  background: none;
  border: 1px solid var(--stage-border);
  color: var(--stage-muted);
  border-radius: 0.55rem;
  padding: 0.55rem 0;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.key-reset:hover { color: var(--stage-text); border-color: var(--stage-border-strong); }

/* Player wrap collapsed state (when user hides video) */
.player-wrap { position: relative; }
.player-wrap.player-collapsed { padding: 0; }
.player-wrap.player-collapsed iframe { display: none; }
.player-collapsed-bar {
  display: none;
  align-items: center;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  color: var(--stage-muted);
}
.player-wrap.player-collapsed .player-collapsed-bar { display: flex; }
.player-collapsed-bar .show-video {
  margin-left: auto; cursor: pointer;
  background: none; border: 1px solid var(--stage-border); color: var(--stage-text);
  padding: 0.25rem 0.6rem; border-radius: 0.4rem; font-size: 0.8rem;
}
.player-collapsed-bar .show-video:hover { border-color: var(--stage-accent); color: var(--stage-accent); }

.video-toggle-on  .icon-eye-off,
.video-toggle-off .icon-eye { display: none; }

/* In stage mode, video is always hidden */
.stage-mode .player-wrap { display: none !important; }

/* =====================================================================
 * Site footer (rich)
 * ===================================================================== */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--stage-border);
  background-color: rgba(10, 10, 13, 0.55);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
}
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 2fr; gap: 2.4rem; }
}
.footer-brand .footer-logo { height: 38px; width: auto; display: block; }
.footer-tag { color: var(--stage-muted); margin: 0.85rem 0 0; max-width: 18rem; font-size: 0.9rem; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6rem; }
}
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stage-muted);
  margin: 0 0 0.6rem;
  font-weight: 700;
}
.footer-col a, .footer-col span {
  display: block;
  font-size: 0.88rem;
  color: var(--stage-text);
  text-decoration: none;
  padding: 0.2rem 0;
}
.footer-col a:hover { color: var(--stage-accent); }
.footer-col .muted { color: var(--stage-muted); }
.footer-meta {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.6rem 1rem 1.6rem;
  font-size: 0.78rem;
}

/* Hide footer in stage mode + print */
.stage-mode .site-footer, .stage-mode .appbar, .stage-mode .sidebar { display: none !important; }
/* site-footer print handled in main @media print block above */

/* =====================================================================
 * Carousel / Banner Slides
 * ===================================================================== */
.carousel-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 1.2rem;
}
.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-slide {
  flex: 0 0 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1.2rem;
  background: var(--stage-surface);
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,13,0.65);
  border: 1px solid var(--stage-border);
  color: var(--stage-text);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 2;
  transition: background 120ms;
}
.carousel-btn:hover { background: rgba(34,211,238,0.2); border-color: var(--stage-accent); }
.carousel-btn-prev { left: 0.6rem; }
.carousel-btn-next { right: 0.6rem; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--stage-border-strong);
  cursor: pointer;
  transition: background 150ms;
}
.carousel-dot.is-active { background: var(--stage-accent); }

/* =====================================================================
 * Modal overlay (troca de senha obrigatória, etc.)
 * ===================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--stage-surface);
  border: 1px solid var(--stage-border-strong);
  border-radius: 1.1rem;
  padding: 2rem 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stage-text);
  margin: 0 0 0.35rem;
}
.modal-sub { color: var(--stage-muted); font-size: 0.88rem; margin: 0 0 1.25rem; }

/* =====================================================================
 * Admin panel tabs & layout
 * ===================================================================== */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--stage-border);
  margin-bottom: 1.5rem;
  padding-bottom: 0.1rem;
}
.admin-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: var(--stage-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
  border-radius: 0;
}
.admin-tab:hover { color: var(--stage-text); }
.admin-tab.is-active { color: var(--stage-accent); border-bottom-color: var(--stage-accent); font-weight: 600; }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }

/* =====================================================================
 * Table (admin listing)
 * ===================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--stage-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--stage-border);
}
.data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--stage-border);
  color: var(--stage-text);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--stage-bg-soft); }
.data-table .td-actions { display: flex; gap: 0.3rem; align-items: center; }

/* =====================================================================
 * Status badges
 * ===================================================================== */
.badge-success { background: rgba(52,211,153,0.18); color: var(--stage-success); }
.badge-danger  { background: rgba(248,113,113,0.18); color: var(--stage-danger); }
.badge-warn    { background: rgba(251,191,36,0.18); color: var(--stage-chord); }
.badge-muted   { background: var(--stage-bg-soft); color: var(--stage-muted); }

/* =====================================================================
 * Artist card
 * ===================================================================== */
.artist-card {
  background: var(--stage-surface);
  border: 1px solid var(--stage-border);
  border-radius: 0.85rem;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms, background 150ms;
}
.artist-card:hover { border-color: var(--stage-accent); background: var(--stage-bg-soft); }
.artist-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--stage-bg-soft);
  border: 2px solid var(--stage-border);
}
.artist-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--stage-bg-soft);
  border: 2px solid var(--stage-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--stage-muted);
}
.artist-card-name { font-weight: 600; font-size: 0.95rem; }
.artist-card-count { font-size: 0.78rem; color: var(--stage-muted); }

/* =====================================================================
 * Chord cover image in listing / detail
 * ===================================================================== */
.chord-cover {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 0.85rem;
  margin-bottom: 1rem;
  display: block;
}
.lesson-card .card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* =====================================================================
 * Backup panel
 * ===================================================================== */
.backup-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
}
.backup-status.ok      { background: rgba(52,211,153,0.15); color: var(--stage-success); }
.backup-status.error   { background: rgba(248,113,113,0.15); color: var(--stage-danger); }
.backup-status.running { background: rgba(251,191,36,0.15);  color: var(--stage-chord); }

/* =====================================================================
 * Import panel result display
 * ===================================================================== */
.import-result {
  background: var(--stage-bg-soft);
  border: 1px solid var(--stage-border);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
  font-size: 0.83rem;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 0.85rem;
}
.import-ok   { color: var(--stage-success); }
.import-err  { color: var(--stage-danger); }

/* =====================================================================
 * Toggle switch
 * ===================================================================== */
.toggle-wrap { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.toggle-input { display: none; }
.toggle-track {
  width: 40px; height: 22px;
  background: var(--stage-border-strong);
  border-radius: 99px;
  position: relative;
  transition: background 150ms;
}
.toggle-input:checked + .toggle-track { background: var(--stage-accent); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 150ms;
}
.toggle-input:checked + .toggle-track .toggle-thumb { left: 21px; }
