/* Web polish pass (Cale, 2026-10-01 — "functionally excellent, just
   ugly… make it PRETTY", "I just want professional"). Loaded LAST, so it
   refines the per-area sheets rather than replacing them.
     - Everywhere: wallpaper (Cale's web_ art, or a soft accent glow until
       it lands), nicer buttons / inputs / dialogs / scrollbars, motion.
     - Wide (>= 768px): a floating glass app frame — sidebar with logo,
       pill nav and profile chip; content and player as glass panels;
       left-aligned page headers; list rows as cards; desktop layouts for
       Band, Menu, Calendar, Music and Chat.
   Theme tokens only (set in js/core/theme.js) — no literal colours. */

/* ── Backdrop ───────────────────────────────────────────────────────── */
html {
  background:
    radial-gradient(1100px 620px at 8% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(900px 560px at 108% 112%, var(--accent-soft), transparent 60%),
    var(--background);
}
/* Transparent, or body's own background would paint over the wallpaper
   layer below (body::before, z-index -1). */
body { background: transparent; }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* The theme's web art: always fills the window from the centre (cover) —
   never stretched, tiled or letterboxed. */
html[data-wallpaper='on'] body::before {
  background: linear-gradient(var(--wallpaper-dim), var(--wallpaper-dim)), var(--wallpaper) center / cover no-repeat;
}
#app { position: relative; z-index: 0; }

/* Phone layout (< 768px): the phone app's own background instead of the
   web art (2026-10-01) — flips at the same moment the layout does. Masks
   are tinted with the accent at 40%, photos shown at 60%, like
   mobile's AppBackground; plain theme colour behind, no glow. */
body::after { content: none; }
@media (max-width: 767px) {
  html { background: var(--background); }
  html[data-wallpaper='on'] body::before { background: none; }
  body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
  html[data-phone-wallpaper='photo'] body::after { background: var(--phone-wallpaper) center / cover no-repeat; opacity: 0.6; }
  html[data-phone-wallpaper='mask'] body::after {
    background-color: var(--accent);
    -webkit-mask: var(--phone-wallpaper) center / cover no-repeat;
    mask: var(--phone-wallpaper) center / cover no-repeat;
    opacity: 0.4;
  }
}

/* ── Appearance open: clear the main window (the art shows) ────────── */
.shell__main { transition: opacity 200ms ease-out; }
html.appearance-open .shell__main { opacity: 0; pointer-events: none; }
html.appearance-open .dialog-backdrop:has(.dialog-card--appearance) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.dialog-card--appearance { background-color: var(--chrome); -webkit-backdrop-filter: blur(var(--glass-blur, 20px)); backdrop-filter: blur(var(--glass-blur, 20px)); }

/* ── Scrollbars ─────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--accent-border); }

/* ── Buttons / inputs / dialogs ─────────────────────────────────────── */
.btn { border-radius: 12px; transition: transform 120ms ease-out, filter 150ms, box-shadow 150ms, background-color 150ms; }
.btn--primary { border-color: transparent; box-shadow: 0 6px 18px var(--accent-glow); }
.btn--secondary { background: var(--panel); border-color: var(--hairline); }
.btn--primary .mdi { color: var(--on-accent); }
.btn:disabled { opacity: 0.4; box-shadow: none; filter: saturate(0.4); }
@media (hover: hover) {
  .btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
  .btn--secondary:hover:not(:disabled) { background: var(--panel-hover); }
}
.input { background: var(--panel); border-color: var(--hairline); border-radius: 12px; transition: border-color 150ms, box-shadow 150ms; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-button { border-radius: 12px; transition: background-color 150ms, transform 120ms; }
@media (hover: hover) { .icon-button:hover { background: var(--panel-hover); } }

.dialog-backdrop { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-card {
  border-radius: 20px;
  border-color: var(--hairline);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: pop-in 160ms ease-out;
}
.dialog-card--menu { padding: 10px; }
.overlay-card { border-radius: 20px; border-color: var(--hairline); box-shadow: var(--shadow-lg); }
.picker-popover, #layers > .picker-popover { border-color: var(--hairline); box-shadow: var(--shadow-lg); }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.segmented { background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; }
.segmented__option { border-radius: 9px; transition: background-color 150ms, color 150ms; }
.segmented__option--active { box-shadow: var(--shadow-sm); }

/* ── Login / full-page states: a glass card ─────────────────────────── */
.login {
  padding: 32px 28px;
  border-radius: 24px;
  border: 1px solid var(--hairline);
  background: var(--chrome);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(160%);
  box-shadow: var(--shadow-lg);
}

/* ── Profile details (inline, all widths) ───────────────────────────── */
.profile-details { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.profile-details__card { background: var(--panel); border: 1px solid var(--hairline); border-radius: 20px; padding: 20px; }
.profile-details__title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.profile-details__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.profile-details__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.profile-details .roles-block .field__label { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.profile-details .roles-block .roles-list { max-height: none; }
.profile-header__name { cursor: default; }

/* ── Sidebar pieces exist at every width; shown on wide only ────────── */
@media (max-width: 767px) { .tab--wide-only { display: none !important; } }
@media (min-width: 768px) { .tab--narrow-only, .narrow-only { display: none !important; } }
.shell__brand, .shell__me { display: none; }
.shell__tabs { display: contents; }
.tab-sub { display: none; }
@media (max-width: 767px) {
  .tab__badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; }
  .tab { position: relative; }
}
.tab-groups { display: none; }

/* ══ Wide screens ═══════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* App frame: sidebar | content, with the title/player bar along the
     bottom of the content (Cale, 2026-10-02 — was across the top; same bar,
     nothing at the top now). */
  .shell {
    grid-template-columns: 252px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      'nav main'
      'nav player';
    gap: 12px;
    padding: 12px;
  }
  .shell__nav,
  .shell__main {
    background: var(--chrome);
    -webkit-backdrop-filter: blur(var(--glass-blur, 28px)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur, 28px)) saturate(160%);
    border: 1px solid var(--hairline);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
  }
  .shell__nav {
    padding: 16px 12px 12px;
    gap: 0;
    border-right: 1px solid var(--hairline);
  }
  .shell__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
  .shell__brand .logo-button__img { width: 44px; height: 44px; border-radius: 12px; box-shadow: var(--shadow-sm); }
  .shell__brand .logo-button__badge { border-color: var(--background); }
  .shell__wordmark { display: flex; flex-direction: column; min-width: 0; }
  .shell__wordmark-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
  .shell__wordmark-sub { font-size: 12px; color: var(--text-tertiary); opacity: 0.7; }
  /* Scrolls on its own when every group is expanded; logo stays at the
     top and the profile pill at the bottom (2026-10-01). */
  .shell__nav { min-height: 0; overflow: hidden; }
  .shell__tabs { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px 8px; padding: 0 6px; }

  .tab {
    gap: 14px;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--text);
    transition: background-color 150ms, color 150ms;
  }
  .tab .tab__icon,
  .tab--active .tab__icon { font-size: 24px !important; width: 24px !important; height: 24px !important; color: var(--text-tertiary); opacity: 0.85; }
  .tab__label, .tab--active .tab__label { font-size: 15px; font-weight: 600; color: var(--text); }
  @media (hover: hover) { .tab:hover { background: var(--panel-hover); } }
  .tab--active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  .tab--active .tab__icon { color: var(--accent); opacity: 1; }
  .tab--active .tab__label { color: var(--accent); font-weight: 700; }

  .shell__me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--hairline);
    transition: background-color 150ms;
  }
  .shell__me-text { display: flex; flex-direction: column; min-width: 0; }
  .shell__me-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell__me-sub { font-size: 12px; color: var(--text-tertiary); opacity: 0.7; }
  .shell__me-text { flex: 1; }
  .shell__me .shell__me-cog { color: var(--text-tertiary); opacity: 0.7; transition: transform 300ms, opacity 150ms; }
  @media (hover: hover) { .shell__me:hover .shell__me-cog { transform: rotate(60deg); opacity: 1; color: var(--accent); } }
  .shell__me--active { background: var(--accent-soft); border-color: var(--accent-border); }
  .shell__me--active .shell__me-cog { color: var(--accent); opacity: 1; }
  .tab--wide-only { width: 100%; text-align: left; }

  /* Band tree: one group per band (logo + name), plus Superadmin. */
  .tab-groups { display: flex; flex-direction: column; gap: 4px; }
  .tab-group__head .square-avatar { border-radius: 7px !important; }
  .tab-group__head .tab__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-group__toggle { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .tab-group__toggle .mdi { color: var(--text-tertiary); transition: transform 180ms ease-out; transform: rotate(-90deg); }
  .tab-group__head--open .tab-group__toggle .mdi { transform: none; }
  @media (hover: hover) { .tab-group__toggle:hover { background: var(--panel-hover); } }

  /* Submenus (open while in that section, foldable). */
  .tab-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 26px; padding-left: 10px; border-left: 1px solid var(--hairline); }
  .tab-sub--open { display: flex; animation: fade-in 160ms ease-out; }
  .tab-sub__item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-tertiary); transition: background-color 150ms, color 150ms; }
  .tab-sub__item .tab-sub__icon { color: var(--text-tertiary); opacity: 0.75; }
  @media (hover: hover) { .tab-sub__item:hover { background: var(--panel-hover); color: var(--text); } }
  .tab-sub__item--active { color: var(--accent); background: var(--accent-soft); }
  .tab-sub__item--active .tab-sub__icon { color: var(--accent); opacity: 1; }

  .shell__main { overflow-y: auto; }
  /* Title bar (2026-10-01): page header on the left, the player (art,
     labels, controls) on the right — one glass bar across the top. */
  .shell__player {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 8px 14px 8px 20px;
    border-radius: 22px;
    border: 1px solid var(--hairline);
    border-top: 1px solid var(--hairline);
    background: var(--chrome);
    -webkit-backdrop-filter: blur(var(--glass-blur, 20px)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur, 20px)) saturate(160%);
    box-shadow: var(--shadow-lg);
  }
  .shell__title { flex: 1; min-width: 0; display: flex; align-items: center; }
  .shell__title .screen-header { flex: 1; min-width: 0; min-height: 0; padding: 0; gap: 10px; }
  .shell__title .screen-header__title { font-size: 22px; }
  .shell__player .mini-player {
    flex: 0 1 auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .shell__player .mini-player__text { flex: 0 1 240px; width: 240px; }
  .mini-player__art { border-radius: 12px; border-color: var(--hairline); }
  .mini-player__title { font-size: 15px; }
  .mini-player__play { box-shadow: 0 6px 18px var(--accent-glow); }
  .mini-player__controls { gap: 12px; }

  /* Sidebar pages have no Back button (2026-10-01). */
  .shell--menu-page .shell__title .back-button { display: none; }
  /* Chat's unread badge on its sidebar item. */
  .tab { position: relative; }
  .tab__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }

  /* ── Page headers: big, left-aligned, logo lives in the sidebar ───── */
  .screen-header .logo-button { display: none; }
  .screen-header { min-height: 76px; padding: 18px 28px 10px; gap: 12px; }
  .screen-header__side:first-child { flex: 0 0 auto; }
  .screen-header__side:first-child:empty { display: none; }
  .screen-header__title { flex: 1 1 auto; text-align: left; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
  .screen-header__side--right { flex: 0 0 auto; gap: 6px; }
  .screen-header .icon-button { width: 42px; height: 42px; background: var(--panel); border: 1px solid var(--hairline); }
  .screen-header .icon-button .mdi { font-size: 22px !important; width: 22px !important; height: 22px !important; }
  .back-button { padding: 8px 12px 8px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--hairline); font-size: 15px; font-weight: 600; }
  @media (hover: hover) { .back-button:hover { background: var(--panel-hover); } }
  .conversation__header { min-height: 68px; padding: 12px 24px; border-bottom: 1px solid var(--hairline); }
  .conversation__title { font-size: 20px; font-weight: 800; }
  .conversation__header .icon-button { width: 42px; height: 42px; background: var(--panel); border: 1px solid var(--hairline); }
  .conversation__header .icon-button .mdi { font-size: 22px !important; width: 22px !important; height: 22px !important; }

  /* Headings live in the title bar now, so pages start at the top and sit
     left, using the full width (no centred column with dead space). */
  .page, .page--wide { max-width: none; margin: 0; padding: 22px 28px 40px; }
  .calendar { max-width: none !important; margin: 0 !important; padding-top: 22px; }
  .page--menu { margin: 0; }
  .section-label, .music-section { font-size: 12px; letter-spacing: 0.12em; margin: 22px 0 10px; }
  .cal-feed__header { margin-top: 4px; }

  /* Empty states ("No songs yet…") as a soft dashed panel, not bare text. */
  .page > .empty-text, .gallery-grid > .empty-text, .cal-feed > .empty-text {
    padding: 36px 24px;
    text-align: center;
    border: 1px dashed var(--hairline);
    border-radius: 18px;
    background: var(--panel);
    font-size: 15px;
  }

  /* ── List rows become cards ───────────────────────────────────────── */
  .shell__main :is(.list-link, .rec-row, .band-link, .cal-event, .menu-row, .gig-row, .admin-row, .switch-row, .trash-row, .music-search__row, .band-card) {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    margin: 0 0 8px;
    padding: 14px 16px;
    transition: background-color 150ms, transform 150ms, box-shadow 150ms, border-color 150ms;
  }
  .shell__main :is(.band-link--last, .menu-row--no-border, .admin-row--no-border) { border-bottom: 1px solid var(--hairline); }
  @media (hover: hover) {
    .shell__main :is(.list-link, .rec-row, .band-link, .cal-event, .menu-row, .gig-row, .switch-row, .music-search__row, .band-card):hover {
      background: var(--panel-hover);
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
      border-color: var(--accent-border);
    }
    .shell__main button.admin-row:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--accent-border); }
  }

  /* ── Chat ─────────────────────────────────────────────────────────── */
  .chat-layout__list { flex: 0 0 380px; border-right: 1px solid var(--hairline); }
  .chat-list { padding: 4px 14px 16px; gap: 4px; }
  .chat-row { margin: 0; padding: 10px 12px; border-bottom: 0; border-radius: 16px; transition: background-color 150ms; }
  @media (hover: hover) { .chat-row:hover { background: var(--panel-hover); } }
  .chat-row--active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  .chat-row .square-avatar, .chat-row__general { border-radius: 14px !important; }
  .chat-layout__empty { gap: 14px; color: var(--text-tertiary); }
  .chat-layout__empty .mdi {
    font-size: 40px !important;
    width: 96px !important;
    height: 96px !important;
    border-radius: 28px;
    background: var(--accent-soft);
    color: var(--accent);
  }
  .msg-list { padding: 12px 28px 16px; }
  .msg-list > * { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }
  .msg-list > .msg-row--first { margin-top: 12px; }
  .msg-bubble { padding: 9px 14px; }
  .composer { padding: 10px 28px 16px; }
  .composer > * { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }
  .composer__box { background: var(--panel); border-color: var(--hairline); border-radius: 22px; padding: 6px 8px 6px 16px; }
  .composer__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .msg-day span { background: var(--panel); border: 1px solid var(--hairline); }

  /* ── Band hub: identity column + tool tiles ───────────────────────── */
  .band-hub { padding-top: 12px; }
  .band-hub__logo .square-avatar { box-shadow: var(--shadow-lg); }
  .band-links { margin-top: 12px; }
  .band-link { gap: 16px; font-size: 16px; }
  .band-link .mdi { font-size: 26px !important; width: 44px !important; height: 44px !important; border-radius: 12px; background: var(--accent-soft); }

  /* ── Profile & Settings: profile card left, details + roles right ─── */
  .page--menu {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    grid-template-areas: 'top details' 'list details';
    grid-template-rows: auto 1fr;
    column-gap: 20px;
    align-items: start;
  }
  .page--menu > .menu-top { grid-area: top; }
  .page--menu > .profile-details { grid-area: details; margin-top: 8px; }
  .page--menu > .menu-list { grid-area: list; }
  .profile-header {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 24px;
    padding: 28px 24px;
    margin-top: 8px;
    margin-bottom: 16px;
  }
  .profile-header__avatar { box-shadow: var(--shadow-lg); }
  .menu-list { gap: 0; }
  .menu-logout { margin-top: 12px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px; }
  @media (hover: hover) { .menu-logout:hover { background: var(--panel-hover); } }

  /* ── Calendar: the month grid gets its own panel ──────────────────── */
  .calendar { padding: 4px 28px 28px; }
  .cal-grid {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 20px;
    padding: 16px;
  }
  .cal-day__circle { width: 38px; height: 38px; border-radius: 12px; transition: background-color 120ms; }
  .cal-day__circle--today { box-shadow: 0 6px 16px var(--accent-glow); }
  .cal-filter { margin: 0 auto 14px; display: inline-flex; }
  .cal-filter .segmented__option { padding: 8px 18px; white-space: nowrap; }
  .cal-event__badge { width: 52px; height: 52px; border-radius: 14px; background: var(--panel); }
  .cal-event__badge--mine { background: var(--accent-soft); }
  .cal-event__title { font-size: 16px; }

  /* ── Music: bigger art, roomier rows ──────────────────────────────── */
  .music-row { gap: 18px; padding: 6px 2px 12px; }
  .music-tile { width: 132px; gap: 8px; }
  .music-tile--small { width: 88px; }
  .music-tile__art { width: 132px; height: 132px; border-radius: 16px; border-color: var(--hairline); box-shadow: var(--shadow-sm); transition: transform 160ms, box-shadow 160ms; }
  /* Artist logos + radio tiles match the release art (they're sized
     inline for the phone). */
  .music-tile > .square-avatar, .music-tile > .radio-art { width: 132px !important; height: 132px !important; border-radius: 16px !important; box-shadow: var(--shadow-sm); transition: transform 160ms, box-shadow 160ms; }
  .music-tile--small > .square-avatar { width: 88px !important; height: 88px !important; }
  /* Radio tiles at 66% of the album / artist art, centred in the same
     132px box so the titles still line up (2026-10-01). */
  .music-tile > .radio-art { width: 88px !important; height: 88px !important; margin: 22px 0; border-radius: 14px !important; }
  .music-search__input { margin: 4px 0 6px; max-width: 520px; }
  .music-home .music-search__results:not(:empty) { max-width: 720px; }
  @media (hover: hover) { .music-tile:hover > .square-avatar { transform: translateY(-3px); box-shadow: var(--shadow-lg); } }
  @media (hover: hover) {
    .music-tile:hover .music-tile__art, .music-tile:hover .radio-art { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  }
  .music-tile__title { font-size: 13px; }
  .release__art { width: 72px; height: 72px; border-radius: 14px; }
  .track-row { border-bottom-color: var(--hairline); padding: 11px 10px; border-radius: 10px; }
  @media (hover: hover) { .track-row:hover { background: var(--panel-hover); } }

  /* ── Gallery ──────────────────────────────────────────────────────── */
  .gallery-grid { gap: 8px; }
  .gallery-tile { border-radius: 12px; }
  .gallery-tile__img { transition: transform 300ms ease-out; }
  @media (hover: hover) { .gallery-tile:hover .gallery-tile__img { transform: scale(1.04); } }
  .gallery-dropdown { background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; }
  .gallery-selectbar { border-top-color: var(--hairline); }

  /* ── Set list / song library cards ────────────────────────────────── */
  .song-card { background: var(--panel); border-color: var(--hairline); border-radius: 16px; transition: background-color 150ms, transform 150ms; }
  @media (hover: hover) { .song-card:hover { background: var(--panel-hover); transform: translateY(-1px); } }
  .setlist-line { background: transparent; border-bottom-color: var(--hairline); }
}

/* Band Admin card (all widths). */
.band-card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Dashboards (Band + Superadmin): the real pages as panels ───────── */
/* From 768px — the moment the sidebar appears — there's ONE dashboard
   (2026-10-01: it used to step through two older band layouts first).
   It rearranges by the space the content panel actually has (container
   queries below), not the window width. */
@media (min-width: 768px) {
  .shell__main { container: main / inline-size; }
  /* Band dashboard: no band-name header (the sidebar says which band),
     full width, tight padding — all the room goes to the panels. */
  .shell__main:has(> .band-hub > .dash) > div:first-child { display: none; }
  .page.band-hub:has(> .dash) { max-width: none; margin: 0; padding: 16px 16px 20px; }
  .dash { display: flex; flex-direction: column; gap: 16px; }
  .dash__cards { display: flex; flex-direction: column; gap: 6px; }
  .dash__top { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
  .dash__left { display: flex; flex-direction: column; gap: 6px; }
  /* Logo fills the column width; the three cards are one fixed size. */
  .dash__left .band-hub__logo { align-self: stretch; margin: 0 0 4px; }
  .dash__left .band-hub__logo > .square-avatar { width: 100% !important; height: auto !important; aspect-ratio: 1; }
  .dash__left .band-card { margin: 0; height: 80px; padding: 0 16px; flex-shrink: 0; overflow: hidden; }
  .dash__left .band-card .square-avatar, .dash__left .band-card__archie, .dash__left .band-card__icon { width: 48px !important; height: 48px !important; }
  .dash__left .band-card__title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dash__left .band-card__subtitle { font-size: 13px; }
  .dash__right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .dash__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
  .dash__pair--media { grid-template-columns: minmax(320px, 1fr) minmax(0, 1.6fr); }

  .dash-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 22px;
    overflow: hidden;
  }
  .dash-panel__head { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 18px; border-bottom: 1px solid var(--hairline); }
  .dash-panel__title { display: inline-flex; align-items: center; gap: 2px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; border-radius: 8px; }
  .dash-panel__title .mdi { color: var(--text-tertiary); opacity: 0.6; transition: transform 150ms, opacity 150ms; }
  @media (hover: hover) { .dash-panel__title:hover .mdi { transform: translateX(3px); opacity: 1; color: var(--accent); } }
  .dash-panel__buttons { display: flex; gap: 8px; margin-right: auto; }
  .dash-upload { min-height: 34px; padding: 6px 12px; font-size: 13px; }
  .dash-panel__body { position: static; overflow-y: auto; min-height: 0; }

  /* The embedded screen's own header becomes the panel's action bar:
     its title and Back go (our head says which page it is), its action
     buttons sit top-right of the panel. */
  .dash-panel__body > div > .screen-header,
  .dash-panel__body > .screen-header {
    position: absolute;
    top: 8px;
    right: 12px;
    min-height: 0;
    padding: 0;
    gap: 6px;
    z-index: 2;
  }
  .dash-panel .screen-header__title,
  .dash-panel .screen-header__side:first-child { display: none; }
  .dash-panel .screen-header .icon-button { width: 38px; height: 38px; }
  .dash-panel .screen-header .icon-button .mdi { font-size: 20px !important; width: 20px !important; height: 20px !important; }
  /* Upload buttons above the panel replace these header icons. */
  .dash-panel [title='Add to Gallery'],
  .dash-panel [title='Add release'],
  .dash-panel [title='Band info'] { display: none; }
  .dash-panel .page { max-width: none; padding: 14px 18px 18px; margin: 0; }
  .dash-panel .shell__main, .dash-panel .page > .empty-text { margin: 0; }
  .dash-panel .section-label:first-child, .dash-panel .music-section:first-child { margin-top: 2px; }
  .dash-panel :is(.list-link, .rec-row, .cal-event, .admin-row) { background: var(--panel); }

  /* Per-panel sizing. */
  /* Month grid left, upcoming events beside it (scrolling), so the panel
     matches the logo + cards column instead of towering over it. */
  .dash-panel--calendar .dash-panel__body { overflow: hidden; display: flex; flex-direction: column; }
  .dash-panel--calendar .calendar { flex: 1; min-height: 0; flex-direction: row; align-items: stretch; max-width: none; margin: 0; padding: 14px 18px 18px; gap: 20px; }
  /* Compact event rows so the list doesn't swamp the panel. */
  .dash-panel--calendar .cal-event { padding: 8px 12px; margin-bottom: 6px; border-radius: 12px; gap: 10px; }
  .dash-panel--calendar .cal-event__badge { width: 40px; height: 40px; border-radius: 10px; }
  .dash-panel--calendar .cal-event__day { font-size: 14px; }
  .dash-panel--calendar .cal-event__title { font-size: 14px; }
  .dash-panel--calendar .cal-event__band { margin-top: 1px; }
  .dash-panel--calendar .cal-event__sub { font-size: 12px; margin-top: 1px; }
  .dash-panel--calendar .cal-event__tags { flex-direction: row; gap: 4px; }
  .dash-panel--calendar .cal-tag { padding: 3px 6px; font-size: 9px; }
  .dash-panel--calendar .calendar__grid-col { flex: 0 0 360px; position: static; }
  .dash-panel--calendar .cal-grid { background: transparent; border: 0; padding: 0; }
  .dash-panel--calendar .cal-day__circle { width: 34px; height: 34px; }
  .dash-panel--calendar .cal-feed { flex: 1; min-width: 0; overflow-y: auto; padding-right: 4px; }
  .dash-panel--calendar .cal-feed__header { margin-top: 2px; }
  /* Fixed tile sizes (Cale, 2026-10-01 — "give everything a tile that
     won't dynamically change size"): panels never grow with content,
     they scroll inside. */
  .dash-panel__body { flex: 1; }
  /* Calendar is exactly as tall as the logo + chat cards beside it. */
  .dash__top { align-items: stretch; }
  .dash__right:has(> .dash-panel--calendar) { position: relative; }
  .dash-panel--calendar { height: 0; min-height: 100%; }
  .dash-panel--setlists, .dash-panel--songs { height: 340px; }
  .dash-panel--recordings, .dash-panel--music { height: 440px; }
  .dash-panel--gallery { height: 660px; }
  .dash-panel--setlists .dash-panel__body,
  .dash-panel--songs .dash-panel__body,
  .dash-panel--recordings .dash-panel__body,
  .dash-panel--music .dash-panel__body,
  .dash-panel--gallery .dash-panel__body { max-height: none; }
  .dash-panel--music .artist-top { display: none; }

  .dash-panel--gallery .gallery-toolbar { padding-top: 0; }

  /* Superadmin dashboard. It's a sidebar item now, so no Back. */
  .shell__main:has(.page--dash) > .screen-header .screen-header__side:first-child { display: none; }
  .page.page--dash { max-width: 1440px; }
  .dash__left .superadmin__logo { margin: 0 0 4px; }
  .dash__left .superadmin__logo img { width: 160px; height: 160px; box-shadow: var(--shadow-lg); }
  .dash-panel--reporting .dash-panel__body,
  .dash-panel--trash .dash-panel__body { max-height: 420px; }
  .dash-panel--users .dash-panel__body,
  .dash-panel--bands .dash-panel__body,
  .dash-panel--logs .dash-panel__body { max-height: 520px; }
  .dash-panel--mfa .mfa-status__title { font-size: 16px; }
  .dash-panel--mfa .mfa-qr { width: 160px; height: 160px; }
}

/* Medium content width: logo + chat cards as a row above a full-width
   calendar; logo matches the two cards' height. */
@container main (max-width: 1099px) {
  .dash__top { grid-template-columns: minmax(0, 1fr); }
  .dash__left { flex-direction: row; align-items: stretch; gap: 12px; }
  .dash__left .band-hub__logo { flex: 0 0 166px; width: 166px; margin: 0; align-self: flex-start; }
  .dash__left .dash__cards { flex: 1; min-width: 0; }
  .dash__left .superadmin__logo img { width: 120px; height: 120px; }
  .dash-panel--calendar { height: 500px; min-height: 0; }
  .dash__pair--media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Narrow content width: everything stacks; the calendar's events go
   under its month grid. */
@container main (max-width: 760px) {
  .dash__pair, .dash__pair--media { grid-template-columns: minmax(0, 1fr); }
  .dash-panel--calendar { height: auto; }
  .dash-panel--calendar .calendar { flex-direction: column; }
  .dash-panel--calendar .calendar__grid-col { flex: none; }
  .dash-panel--calendar .cal-feed { max-height: 300px; }
}

/* Phone width keeps the phone layout; a touch more finish only. */
@media (max-width: 767px) {
  .shell__nav { background: var(--chrome); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-top: 1px solid var(--hairline); }
}

/* Chat list pane tools (2026-10-01): search box + New chat. */
.chat-list__tools { display: flex; gap: 8px; align-items: center; padding: 12px 14px 6px; }
.chat-list__search { flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px; }
.chat-list__new { flex-shrink: 0; white-space: nowrap; }
.chat-list__messages { padding-top: 4px; }

/* Calendar tile: + top-left, All/Our toggle centred (2026-10-01). */
.cal-grid__top { position: relative; display: flex; justify-content: center; align-items: center; min-height: 40px; margin-bottom: 6px; }
.cal-grid__add { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 12px; background: var(--accent); }
.cal-grid__add .mdi { color: var(--on-accent); }
.cal-grid__top .cal-filter { margin: 0; }

/* Gallery toolbar: label dropdown + upload + select (2026-10-01). */
.gallery-toolbar { display: flex; align-items: center; gap: 8px; }
.gallery-tool { width: 40px; height: 40px; background: var(--panel); border: 1px solid var(--hairline); }
.gallery-tool:disabled { opacity: 0.4; }

/* Page action buttons (2026-10-01): a labelled button top-left of the
   page, and a small right-aligned labelled tool row for editors. */
.page-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.page-action { text-decoration: none; }
.tool-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.tool-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; background: var(--panel); border: 1px solid var(--hairline); font-size: 13px; font-weight: 600; color: var(--text); }
.tool-button .mdi { color: var(--accent); }
@media (hover: hover) { .tool-button:hover { background: var(--panel-hover); } }
.tool-button--primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.tool-button--primary .mdi { color: var(--on-accent); }
.tool-button--danger { color: var(--danger); }
.tool-button--danger .mdi { color: var(--danger); }

/* Song Library list + song page (2026-10-01). */
.song-row__len { font-size: 13px; color: var(--text-tertiary); opacity: 0.8; font-variant-numeric: tabular-nums; }
.song-page { display: flex; flex-direction: column; gap: 10px; }
.song-page__meta { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 8px; }
.song-page__texts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@container main (max-width: 760px) { .song-page__texts { grid-template-columns: minmax(0, 1fr); } }
.song-page__lyrics { min-height: 360px; line-height: 1.55; }

/* Band Admin (2026-10-01): logo + details left, members right (sized for
   ~10 members, scrolls past that), Reporting below. */
.band-admin__grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
@container main (max-width: 860px) { .band-admin__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .band-admin__grid { grid-template-columns: minmax(0, 1fr); } }
.band-admin__top { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 0; padding: 18px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 22px; }
.band-admin__logo { align-self: center; margin: 0 0 6px; }
.band-admin__logo > .square-avatar { width: 280px !important; height: 280px !important; max-width: 100%; }
.band-admin__name { align-self: center; font-size: 20px; }
.band-admin__bio-input { min-height: 96px; resize: vertical; }
.band-admin__save { display: flex; justify-content: flex-end; }
.band-admin__members { padding: 14px 16px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 22px; max-height: 720px; overflow-y: auto; }
.band-admin__members-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.band-admin__members-head .section-label { margin: 0; }
.band-admin__members .admin-row { padding: 8px 12px; margin-bottom: 6px; }
.dash-panel--band-reporting { height: 460px; }
.dash-panel--band-reporting .dash-panel__body { max-height: none; }

/* Sidebar (2026-10-01): Chat + Music Player fixed above the scrolling
   band tree; profile card with Appearance (palette) + Profile (cog). */
.shell__fixed-tabs { display: contents; }
@media (min-width: 768px) {
  .shell__fixed-tabs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; flex-shrink: 0; }
  .shell__me { gap: 4px; padding: 8px; }
  .shell__me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border-radius: 12px; padding: 2px; }
  .shell__me-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell__me-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background-color 150ms; }
  .shell__me-icon .mdi { color: var(--text-tertiary); }
  @media (hover: hover) {
    .shell__me-icon:hover { background: var(--panel-hover); }
    .shell__me-icon:hover .mdi { color: var(--accent); }
    .shell__me-link:hover .shell__me-name { color: var(--accent); }
  }
  .shell__me--active .shell__me-icon[href] .mdi { color: var(--accent); }

  /* Click the page title to hide the main pane (admire the wallpaper). */
  .shell__title .screen-header__title { cursor: pointer; }
  .shell--pane-hidden .shell__main { opacity: 0; pointer-events: none; }
}

/* Smaller New chat button. */
.chat-list__new { min-height: 32px; padding: 5px 10px; font-size: 12px; gap: 5px; }
.chat-list__new .mdi { font-size: 15px !important; width: 15px !important; height: 15px !important; }
.page-actions--inline { margin: 18px 28px 0; }
@media (max-width: 767px) { .page-actions--inline { margin: 12px 16px 0; } }
.dash-panel .page-actions--inline { margin: 12px 18px 0; }
.about-card .about-row { padding: 12px 4px; }
@media (min-width: 768px) { .shell__me-sub { font-size: 11px; } .shell__me-name { font-size: 13px; } }

/* Artist page (2026-10-01): logo left, name / bio / Contact Band right. */
.artist-top__info { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.artist-top__name { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
@media (min-width: 768px) {
  .artist-top { flex-direction: row; align-items: center; gap: 28px; margin: 4px 0 24px; }
  .artist-top__info { align-items: flex-start; min-width: 0; }
  .artist-top__bio { text-align: left; margin-top: 0; max-width: 720px; font-size: 14px; line-height: 1.55; }
}
.artist-top__contact { margin-top: 6px; }
/* Wordmark: tagline no wider than "edneyHQ" (2026-10-01). */
@media (min-width: 768px) {
  .shell__wordmark { align-items: center; }
  .shell__wordmark-name { line-height: 1.15; }
  .shell__wordmark-sub { font-size: 9.5px; letter-spacing: 0.01em; white-space: nowrap; text-align: center; }
}

/* ── Icon rail (2026-10-01) ───────────────────────────────────────── */
.shell__rail-toggle { display: none; }
@media (min-width: 768px) {
  .shell__rail-toggle { display: flex; margin-left: auto; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; flex-shrink: 0; }
  .shell__rail-toggle .mdi { color: var(--text-tertiary); }
  @media (hover: hover) { .shell__rail-toggle:hover { background: var(--panel-hover); } .shell__rail-toggle:hover .mdi { color: var(--accent); } }

  .shell.shell--rail { grid-template-columns: 76px minmax(0, 1fr); }
  .shell--rail .shell__nav { padding: 14px 8px 10px; align-items: center; }
  .shell--rail .shell__brand { flex-direction: column; gap: 10px; padding: 2px 0 14px; }
  .shell--rail .shell__rail-toggle { margin: 0; }
  .shell--rail .shell__wordmark,
  .shell--rail .tab__label,
  .shell--rail .tab-group__toggle,
  .shell--rail .shell__nav .tab-sub { display: none !important; }
  .shell--rail .shell__fixed-tabs, .shell--rail .shell__tabs { align-items: center; width: 100%; }
  .shell--rail .shell__tabs { margin: 0; padding: 0; }
  .shell--rail .tab { width: 52px; height: 48px; padding: 0; justify-content: center; gap: 0; }
  .shell--rail .tab-group__head .square-avatar { width: 32px !important; height: 32px !important; border-radius: 9px !important; }
  .shell--rail .tab--flyout-open { background: var(--panel-hover); }
  .shell--rail .tab__badge { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.5px; line-height: 16px; border-radius: 8px; }
  /* Profile card -> Appearance above Profile (cog), no avatar / name. */
  .shell--rail .shell__me { flex-direction: column; gap: 4px; padding: 0; background: transparent; border: 0; }
  .shell--rail .shell__me-link { display: none; }
  .shell--rail .shell__me-icon { width: 44px; height: 40px; }
}
/* Flyout menu next to a rail icon. */
.rail-flyout {
  position: fixed;
  z-index: 150;
  min-width: 210px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  animation: pop-in 140ms ease-out;
}
.rail-flyout__title { padding: 6px 10px 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.rail-flyout .tab-sub { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; border: 0; animation: none; }
