/* Material 3 Expressive flavoured: pill shapes, tonal layers, springy motion. */
:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-low: #f0f2f8;
  --surface-high: #e6e9f1;
  --outline: #dfe3ec;
  --text: #191c22;
  --muted: #5a6274;
  --primary: #2563eb;
  --on-primary: #ffffff;
  --primary-container: #dbe6ff;
  --on-primary-container: #0f3a9e;
  --secondary-container: #e4e8f2;
  --on-secondary-container: #2b3242;
  --inverse-surface: #2e3138;
  --inverse-on-surface: #f2f3f8;
  --inverse-primary: #b3caff;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 10px 30px rgba(20, 24, 40, 0.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
:root[data-theme="dark"] {
    --bg: #121418;
    --surface: #1a1d23;
    --surface-low: #1f232a;
    --surface-high: #2a2f38;
    --outline: #2c313b;
    --text: #e7e9f0;
    --muted: #949cae;
    --primary: #8db2ff;
    --on-primary: #0b2a72;
    --primary-container: #1f3f8a;
    --on-primary-container: #dbe6ff;
    --secondary-container: #2b3140;
    --on-secondary-container: #dfe3ee;
    --inverse-surface: #e7e9f0;
    --inverse-on-surface: #1a1d23;
    --inverse-primary: #1d4ed8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 1.25em; height: 1.25em; flex: none; }
.only-desktop { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  transition: transform 0.35s var(--spring), background 0.15s, border-radius 0.35s var(--spring), opacity 0.15s;
}
.btn:active { transform: scale(0.96); border-radius: 16px; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.05rem; width: 100%; }
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-low);
  color: var(--text);
  transition: transform 0.35s var(--spring), border-radius 0.35s var(--spring), background 0.15s;
}
.icon-btn:active { transform: scale(0.92); border-radius: 14px; background: var(--surface-high); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-b));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 24px 0 20px;
  border: none;
  border-radius: 22px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--spring), border-radius 0.4s var(--spring), opacity 0.2s;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.94); border-radius: 30px; }
body.show-detail .fab { transform: translateY(140px); opacity: 0; pointer-events: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-t));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--primary); font-size: 1.2rem; letter-spacing: -0.01em; background: none; border: none; padding: 4px 8px; margin-left: -8px; border-radius: 999px; }
.brand:active { background: var(--surface-low); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 8px; }

/* ---------- overflow menu ---------- */
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: 8px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: pop 0.25s var(--spring);
  transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-low); }
.menu-item:active { background: var(--surface-high); }
.menu-item svg { width: 22px; height: 22px; color: var(--primary); }
.about-version { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.brand svg { width: 24px; height: 24px; }
.brand b { font-weight: 800; }
.topbar .btn { min-height: 44px; padding: 8px 16px; font-size: 0.9375rem; }

/* ---------- layout ---------- */
.app { flex: 1; display: flex; min-height: 0; }
.pane { flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pane-list { padding: 4px 16px; padding-bottom: calc(110px + var(--safe-b)); }
.pane-detail {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  padding: 0 16px 0;
}
body.show-detail .pane-detail { transform: translateX(0); }
body.show-detail .pane-list { visibility: hidden; }
.detail-placeholder { display: none; }

@media (min-width: 768px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: inline-flex !important; }
  p.only-desktop { display: block !important; }
  .pane-list { flex: 0 0 360px; padding: 8px 20px 24px; border-right: 1px solid var(--outline); }
  .pane-detail { position: static; transform: none; transition: none; padding: 24px 32px; }
  body.show-detail .pane-list { visibility: visible; }
  .detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    color: var(--muted);
  }
  .detail-placeholder svg { width: 56px; height: 56px; opacity: 0.5; }
  .detail { max-width: 560px; margin: 0 auto; }
}

.btn-add { width: 100%; min-height: 52px; margin-bottom: 12px; font-size: 1.05rem; }

/* ---------- drop overlay ---------- */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
body.is-dragging .drop-overlay { display: flex; }
.drop-message {
  padding: 18px 28px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* ---------- apply-to-all suggestion ---------- */
.suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 18px;
  background: var(--surface-low);
  color: var(--text);
  font-size: 0.9rem;
}
.suggest-thumb { flex: none; width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }
.suggest-text { flex: 1; min-width: 0; }
.suggest .btn { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.suggest .icon-btn { width: 36px; height: 36px; background: transparent; }
.suggest .icon-btn svg { width: 18px; height: 18px; }

/* ---------- skipped-files notice ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, #f59e0b 16%, var(--surface-low));
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.notice-text { flex: 1; min-width: 0; padding-top: 6px; word-break: break-word; }
.notice .icon-btn { width: 36px; height: 36px; background: transparent; }
.notice .icon-btn svg { width: 18px; height: 18px; }

/* ---------- track list ---------- */
.tracks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.track {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: 24px;
  background: var(--surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.3s var(--spring);
}
.track:active { transform: scale(0.98); }
.track.is-selected { background: var(--primary-container); color: var(--on-primary-container); }
.track.is-selected .track-sub { color: inherit; }
.track-thumb {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--surface-high);
  color: var(--muted);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.track-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.track-thumb svg { width: 24px; height: 24px; }
.track-body { flex: 1; min-width: 0; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.track-title .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.track.is-selected .dot { background: var(--on-primary-container); }
.track-sub { font-size: 0.9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px 24px; color: var(--muted); }
.empty-art {
  width: 96px;
  height: 96px;
  border-radius: 36px;
  background: var(--surface-low);
  display: grid;
  place-items: center;
  color: var(--primary);
  margin-bottom: 16px;
}
.empty-art svg { width: 40px; height: 40px; }
.empty-title { margin: 0 0 4px; font-weight: 600; color: var(--text); }
.empty-sub { margin: 0; font-size: 0.95rem; max-width: 26ch; }

/* ---------- detail ---------- */
.detail-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  padding-top: calc(12px + var(--safe-t));
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
@media (min-width: 768px) { .detail-bar { position: static; padding-top: 0; } }
.detail-heading {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
@media (min-width: 768px) { .detail-heading { text-align: left; font-size: 1.25rem; } }

.cover {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 8px auto 0;
  border-radius: 32px;
  overflow: hidden;
  background: var(--surface-low);
  box-shadow: var(--shadow);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}
.cover-empty svg { width: 64px; height: 64px; opacity: 0.4; }
.cover-cta {
  font-size: 1rem;
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.cover-cta:active { transform: translateX(-50%) scale(0.96); }
.cover-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--inverse-surface) 70%, transparent);
  color: var(--inverse-on-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.35s var(--spring);
}
.cover-remove:active { transform: scale(0.9); }
.cover-remove svg { width: 20px; height: 20px; }
.cover.is-over { outline: 4px solid var(--primary); outline-offset: -4px; }
.cover-info { margin: 10px 0 0; text-align: center; font-size: 0.875rem; color: var(--muted); min-height: 1.2em; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 0; }

.meta-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0 0 -12px;
  width: calc(100% + 24px);
  padding: 10px 12px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.15s, transform 0.3s var(--spring);
}
@media (hover: hover) { .meta-card:hover { background: var(--surface-low); } }
.meta-card:active { transform: scale(0.98); background: var(--surface-low); }
.meta-card:focus-visible { background: var(--surface-low); }
.meta-card > svg { width: 22px; height: 22px; color: var(--muted); transition: color 0.15s; }
.meta-card:hover > svg, .meta-card:active > svg { color: var(--primary); }
.meta-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta-main { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-file { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.meta-form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding-left: 14px; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface-low);
  color: var(--text);
  font: inherit;
  font-weight: 500;
}
.field input:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.field input::placeholder { color: var(--muted); opacity: 0.7; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#tagsFile { margin: 0; text-align: center; word-break: break-all; }

/* ---------- player ---------- */
.player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  background: var(--surface-low);
}
.play-btn {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  transition: border-radius 0.4s var(--spring), transform 0.4s var(--spring);
}
.play-btn svg { width: 26px; height: 26px; grid-area: 1 / 1; }
.play-btn .ic-pause { display: none; }
.player.is-playing .play-btn { border-radius: 18px; }
.player.is-playing .ic-play { display: none; }
.player.is-playing .ic-pause { display: block; }
.play-btn:active { transform: scale(0.92); }
.player-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.seek {
  --p: 0%;
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.seek::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) var(--p), var(--surface-high) var(--p));
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 26px;
  margin-top: -7px;
  border-radius: 3px;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--surface-low);
}
.seek::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) var(--p), var(--surface-high) var(--p));
}
.seek::-moz-range-thumb { width: 6px; height: 26px; border: none; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 4px var(--surface-low); }
.player-times { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Primary action stays reachable while the detail view scrolls (phones). */
.actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 20px -16px 0;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
@media (min-width: 768px) {
  .actions { position: static; margin: 20px 0 0; padding: 0; background: none; }
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
}
.text-btn svg { width: 16px; height: 16px; }
.text-btn:active, .text-btn:hover { background: var(--surface-low); }

/* ---------- library sheet ---------- */
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
@media (min-width: 768px) { .library-grid { grid-template-columns: repeat(4, 1fr); } }
.tile {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-high);
  cursor: pointer;
  transition: transform 0.3s var(--spring);
}
.tile:active { transform: scale(0.95); }
.tile-pick { display: block; width: 100%; height: 100%; padding: 0; border: none; background: transparent; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-label {
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--inverse-surface) 75%, transparent);
  color: var(--inverse-on-surface);
  font-size: 0.75rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: left;
}
.tile-remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: color-mix(in srgb, var(--inverse-surface) 75%, transparent);
  color: var(--inverse-on-surface);
}
.tile-remove svg { width: 14px; height: 14px; }

/* ---------- crop sheet ---------- */
.crop-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; -webkit-user-drag: none; max-width: none; }
.crop-hint { margin-top: 0; text-align: center; }
.crop-actions { display: flex; gap: 8px; }
.crop-actions .btn { flex: 1; min-height: 52px; }

/* ---------- toast / snackbar ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-b));
  transform: translate(-50%, 24px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.4s var(--spring);
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (max-width: 767px) { body:not(.show-detail) .toast { bottom: calc(96px + var(--safe-b)); } }
@media (min-width: 768px) {
  /* Large screens: bottom-left like M3, so it never covers the detail pane. */
  .toast { left: 24px; transform: translate(0, 24px); }
  .toast.is-visible { transform: translate(0, 0); }
}
.toast-action {
  flex: none;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--inverse-on-surface) 12%, transparent);
  color: var(--inverse-primary);
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- sheets (settings, about) ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 20, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade 0.18s var(--ease); }
.sheet-panel {
  touch-action: pan-y;
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: 28px 28px 0 0;
  padding: 8px 20px calc(20px + var(--safe-b));
  box-shadow: var(--shadow);
  animation: rise 0.32s var(--spring);
}
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--outline); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.sheet-body { display: flex; flex-direction: column; gap: 18px; }
/* Sticky footer inside a scrolling sheet */
.sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 8px -20px calc(-20px - var(--safe-b));
  padding: 12px 20px calc(16px + var(--safe-b));
  background: linear-gradient(to top, var(--surface) 75%, transparent);
}
@media (min-width: 768px) { .sheet-actions { margin: 8px -24px -24px; padding: 12px 24px 20px; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 768px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { max-width: 460px; border-radius: 28px; padding: 20px 24px 24px; max-height: calc(100dvh - 48px); }
  .sheet-handle { display: none; }
}

.setting-label { font-weight: 600; margin-bottom: 8px; }
.setting-hint { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-low); }
.seg button {
  flex: 1;
  min-height: 40px;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, transform 0.3s var(--spring);
}
.seg button:active { transform: scale(0.96); }
.seg button[aria-checked="true"] { background: var(--primary-container); color: var(--on-primary-container); }

.link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 18px;
  background: var(--surface-low);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  transition: background 0.15s, transform 0.3s var(--spring);
}
.link-row:active { transform: scale(0.98); background: var(--surface-high); }
.link-row > svg { width: 24px; height: 24px; color: var(--primary); }
.link-row.coffee > svg { color: #d9a400; }
.link-row.sponsor > svg { color: #db61a2; }
.link-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-label { font-weight: 600; }
.link-desc { font-size: 0.875rem; color: var(--muted); }
.link-chevron { width: 20px !important; height: 20px !important; color: var(--muted) !important; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-title { margin: 0 0 2px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.about-brand { text-align: center; padding-top: 4px; }
.about-logo { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 26px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; }
.about-logo svg { width: 34px; height: 34px; }
.about-name { font-size: 1.5rem; color: var(--primary); letter-spacing: -0.01em; }
.about-name b { font-weight: 800; }
.about-tagline { margin: 2px 0 0; color: var(--muted); }
.about-text { margin: 0; text-align: center; color: var(--muted); line-height: 1.55; }
.legal { border-top: 1px solid var(--outline); padding-top: 16px; }
.legal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legal-list li { position: relative; padding-left: 16px; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.legal-list li::before { content: '·'; position: absolute; left: 2px; color: var(--primary); font-weight: 800; }
.legal-list a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
