:root {
  --background: #FAFAFA;
  --foreground: #0F172A;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --ink-soft: #475569;
  --accent: #0052FF;
  --accent-secondary: #4D7CFF;
  --on-accent: #FFFFFF;
  --border: #E2E8F0;
  --card: #FFFFFF;
  --ok: #047857;
  --ok-bg: #D1FAE5;
  --accent-bg: #E6EEFF;
  --font-display: "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-mono: "Nunito Sans", system-ui, sans-serif;
  --radius-input: 8px;
  --radius-button: 12px;
  --radius-card: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
  --shadow-accent: 0 4px 14px rgba(0,82,255,0.25);
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 40px 96px;
}
.wrap { max-width: 1200px; margin: 0 auto; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.label {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 9999px;
  background: var(--card);
  font: 500 12px/1.2 var(--font-mono); letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent);
}
.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1, h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; }
.grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.head-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lead { margin: 0; color: var(--ink-soft); max-width: 52ch; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-button);
  font: 600 15px var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--gradient); color: var(--on-accent); border-color: transparent; min-height: 48px; font-size: 16px; font-weight: 700; }
.btn.primary:hover { box-shadow: var(--shadow-accent); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted-foreground); cursor: pointer;
  transition: background 180ms ease-out, color 180ms ease-out;
}
.icon-btn:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; min-height: 36px;
  border: 1px solid var(--border); border-radius: 9999px; background: var(--card);
  font: 500 13px var(--font-body); color: var(--ink-soft); cursor: pointer;
}
.chip b { font-variant-numeric: tabular-nums; color: var(--foreground); }
.chip[aria-pressed="true"] { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.chip[aria-pressed="true"] b { color: var(--background); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); overflow: hidden; }
.cols, .row {
  display: grid; align-items: center; column-gap: 12px;
  grid-template-columns: 44px minmax(140px, 1.4fr) minmax(90px, 0.7fr) minmax(190px, 1.2fr) 108px minmax(100px, 1fr) 170px 152px;
  padding: 0 16px;
}
.cols { min-height: 44px; background: var(--muted); border-bottom: 1px solid var(--border); font: 500 12px var(--font-mono); letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-soft); }
.set-head { padding: 14px 16px 8px; background: var(--card); border-top: 1px solid var(--border); }
.set-head:first-child { border-top: 0; }
.row { min-height: 60px; border-top: 1px solid var(--border); transition: background 180ms ease-out; }
.group-empty { padding: 8px 16px 20px; font-size: 14px; color: var(--muted-foreground); }
.set-head + .row { border-top: 0; }
.row:hover { background: #F8FAFC; }
.row.is-live { background: var(--accent-bg); }
.row.is-done .title { color: var(--muted-foreground); text-decoration: line-through; text-decoration-color: var(--border); }
.num { font: 500 14px var(--font-mono); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.c-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.title { font-weight: 700; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.c-perf, .c-inst, .c-note { font-size: 14px; color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; padding: 8px 0; }
.dim { color: var(--muted-foreground); }
.k { display: none; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); margin-right: 8px; }
.badge {
  display: none; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 9999px;
  font: 700 11px var(--font-body); white-space: nowrap; background: var(--muted); color: var(--ink-soft);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); }
.badge.s-ready { background: var(--accent-bg); color: var(--accent); }
.badge.s-ready::before { background: var(--accent); }
.badge.s-live { background: var(--accent); color: var(--on-accent); }
.badge.s-live::before { background: var(--on-accent); }
.badge.s-done { background: var(--ok-bg); color: var(--ok); }
.badge.s-done::before { background: var(--ok); }
.tog { display: none; }
.details { display: contents; }
.lyr { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 0; }
.lyr svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease-out; }
.lyr:hover svg { transform: translateX(4px); }
.lyr .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.lyr.empty { color: var(--muted-foreground); font-weight: 500; }
.actions { display: flex; justify-content: flex-end; }
.dd { position: relative; display: inline-block; width: 100%; max-width: 200px; }
.dd-btn {
  width: 100%; height: 36px; padding: 0 12px 0 14px; display: flex; align-items: center; gap: 8px;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--muted); color: var(--ink-soft);
  font: 700 13px var(--font-body); cursor: pointer; text-align: left;
  transition: box-shadow 180ms ease-out, background 180ms ease-out;
}
.dd-btn:hover { box-shadow: var(--shadow-sm); }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.dd-btn .dd-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-btn svg { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease-out; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-foreground); }
.dd.s-ready .dd-btn { background: var(--accent-bg); border-color: transparent; color: var(--accent); }
.dd.s-live .dd-btn { background: var(--gradient); border-color: transparent; color: var(--on-accent); box-shadow: var(--shadow-accent); }
.dd.s-done .dd-btn { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.dd.s-ready .dd-dot { background: var(--accent); }
.dd.s-live .dd-dot { background: var(--on-accent); animation: pulse 2s ease-in-out infinite; }
.dd.s-done .dd-dot { background: var(--ok); }
@keyframes pulse { 50% { opacity: 0.35; } }
.dd-list {
  position: fixed; z-index: 100; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-button); box-shadow: var(--shadow-xl);
}
.dd-list[hidden] { display: none; }
.dd-opt {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px;
  font: 600 14px var(--font-body); color: var(--foreground); cursor: pointer; white-space: nowrap;
}
.dd-opt .dd-text { flex: 1; }
.dd-opt svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.dd-opt[aria-selected="true"] svg { visibility: visible; }
.dd-opt:hover, .dd-opt:focus { background: var(--muted); outline: none; }
.dd-opt[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); }
.dd-opt.s-ready .dd-dot { background: var(--accent); }
.dd-opt.s-live .dd-dot { background: var(--accent-secondary); }
.dd-opt.s-done .dd-dot { background: var(--ok); }
.empty-state { padding: 56px 24px; text-align: center; color: var(--ink-soft); }
.foot { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--muted-foreground); font-size: 14px; }
.link-btn { background: none; border: 0; padding: 8px 0; font: 500 14px var(--font-body); color: var(--muted-foreground); text-decoration: underline; cursor: pointer; }
dialog { border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-xl); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--foreground); }
dialog::backdrop { background: rgba(15, 23, 42, 0.4); }
.form { display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.form h2 { font-size: 32px; line-height: 1.15; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-input);
  background: var(--card); font: 400 16px var(--font-body); color: var(--foreground); width: 100%;
}
.field textarea { padding: 12px; min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.lyrics-card { padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-soft); font-size: 14px; }
.meta b { color: var(--foreground); font-weight: 600; }
.lyrics-text { white-space: pre-wrap; font-size: 20px; line-height: 1.8; margin: 0; max-width: 60ch; font-family: var(--font-body); }
.lyrics-edit { width: 100%; min-height: 360px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-button); font: 400 18px/1.7 var(--font-body); color: var(--foreground); background: var(--card); resize: vertical; }
.lyrics-edit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; }
.crumb { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 32px; font-size: 14px; font-weight: 600; text-decoration: none; }
.crumb svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.placeholder { color: var(--muted-foreground); font-size: 16px; margin: 0; }
@media (max-width: 1120px) {
  .cols { display: none; }
  .row {
    grid-template-columns: 36px 1fr 44px;
    grid-template-areas: "num title tog" "num perf tog" "det det det";
    row-gap: 0; padding: 14px 16px;
  }
  .row { cursor: pointer; }
  .badge { display: inline-flex; }
  .details { cursor: default; }
  .row > .num { grid-area: num; align-self: start; padding-top: 2px; }
  .row > .c-title { grid-area: title; }
  .row > .c-perf { grid-area: perf; padding: 2px 0 0; }
  .tog { display: inline-grid; grid-area: tog; align-self: center; justify-self: end; }
  .tog svg { transition: transform 180ms ease-out; }
  .row.open .tog svg { transform: rotate(180deg); }
  .details { display: none; grid-area: det; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 12px 0 0 36px; }
  .row.open .details { display: grid; }
  .k { display: inline; }
  .details .c-inst, .details .c-lyr { grid-column: auto; }
  .details .c-note, .details .c-status, .details .actions { grid-column: 1 / -1; }
  .details .actions { justify-content: flex-start; }
  
}
@media (max-width: 520px) {
  .two { grid-template-columns: 1fr; }
  .form { padding: 24px; }
  .lyrics-card { padding: 20px; }
  .lyrics-text { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.band { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.band-inst { color: var(--ink-soft); font-size: 14px; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 9999px;
  background: var(--muted); color: var(--ink-soft); font: 700 12px var(--font-body); white-space: nowrap; border: 0;
}
.tag.bpm { background: var(--accent-bg); color: var(--accent); cursor: pointer; transition: transform 180ms ease-out, box-shadow 180ms ease-out; }
.tag.bpm:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent); }
.two.three { grid-template-columns: 1fr 1fr 1fr; }
.metro { position: sticky; bottom: 16px; z-index: 20; margin-top: 32px; }
.metro-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-xl);
}
.metro.running .metro-inner { border-color: var(--accent); box-shadow: var(--shadow-xl), 0 0 0 2px var(--accent-bg); }
.metro-play {
  width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer;
  background: var(--gradient); color: var(--on-accent); box-shadow: var(--shadow-accent);
  transition: transform 180ms ease-out;
}
.metro-play:active { transform: scale(0.96); }
.metro-play svg { width: 20px; height: 20px; fill: currentColor; }
.metro-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.metro-title { font: 700 12px var(--font-body); letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.metro-song { font-size: 14px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metro-bpm { display: flex; align-items: center; gap: 4px; }
.metro-bpm input {
  width: 64px; height: 40px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-input);
  font: 900 20px var(--font-body); color: var(--foreground); background: var(--card); font-variant-numeric: tabular-nums;
}
.metro-bpm input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.metro-unit { font: 700 12px var(--font-body); color: var(--muted-foreground); letter-spacing: 0.1em; margin: 0 4px; }
.metro-bpm .icon-btn { font-size: 20px; font-weight: 700; color: var(--ink-soft); }
.metro-range { width: 160px; accent-color: var(--accent); }
.metro-beats { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); font: 600 14px var(--font-body); color: var(--foreground); }
.metro-dots { display: flex; gap: 8px; align-items: center; }
.metro-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); transition: background 80ms linear, transform 80ms linear; }
.metro-dot.first { border: 2px solid var(--accent); background: var(--card); }
.metro-dot.on { background: var(--accent-secondary); transform: scale(1.3); }
.metro-dot.first.on { background: var(--accent); }
@media (max-width: 520px) {
  .two.three { grid-template-columns: 1fr; }
  .metro-range { width: 100%; order: 5; }
  .metro { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

.metro[hidden] { display: none; }
.metro-close { margin-left: auto; }

.metro-ctrls { display: flex; align-items: center; gap: 8px; flex: none; }
.metro-sec {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background 180ms ease-out, color 180ms ease-out;
}
.metro-sec:hover { background: var(--muted); color: var(--foreground); }
.metro-sec svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mStop svg { fill: currentColor; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.sm svg { width: 16px; height: 16px; }
body.no-scroll { overflow: hidden; }
.reader { gap: 16px; padding: 0; }
.reader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card); position: sticky; top: 0; z-index: 5; }
.reader-bar .btn { box-shadow: none; }
.speed { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.speed input { width: 120px; accent-color: var(--accent); }
.speed b { min-width: 28px; font-variant-numeric: tabular-nums; color: var(--foreground); }
.size { display: inline-flex; gap: 2px; }
.size .icon-btn { width: 40px; font: 700 14px var(--font-body); color: var(--ink-soft); }
.reader-bar #editBtn { margin-left: auto; }
.reader-title { display: none; }
.reader .md, .reader .placeholder { padding: 8px 32px 32px; }
.reader-end { height: 0; }
.md { font-size: 22px; line-height: 1.75; max-width: 60ch; overflow-wrap: anywhere; }
.md p { margin: 0 0 1em; }
.md h2, .md h3, .md h4 { font-family: var(--font-display); font-weight: 900; line-height: 1.2; margin: 1.4em 0 0.5em; letter-spacing: -0.01em; }
.md h2 { font-size: 1.5em; }
.md h3 { font-size: 1.2em; color: var(--accent); }
.md h4 { font-size: 1em; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.md blockquote { margin: 0 0 1em; padding: 8px 14px; border-radius: 8px; background: var(--muted); color: var(--ink-soft); font-size: 0.85em; }
.md ul { margin: 0 0 1em; padding-left: 1.2em; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.reader.is-fs, .reader.pseudo-fs { background: var(--background); border: 0; border-radius: 0; box-shadow: none; overflow-y: auto; }
.reader.pseudo-fs { position: fixed; inset: 0; z-index: 200; }
.reader.is-fs .reader-title { display: block; padding: 24px 32px 0; font: 900 clamp(32px, 5vw, 56px)/1.1 var(--font-display); letter-spacing: -0.02em; }
.reader.is-fs .reader-title small { display: block; margin-top: 6px; font: 600 18px var(--font-body); color: var(--muted-foreground); letter-spacing: 0; }
.reader.is-fs .md { max-width: 900px; margin: 0 auto; padding: 24px 32px 55vh; }
.reader.is-fs .reader-title { max-width: 964px; margin: 0 auto; }
.reader.is-fs .reader-end { height: 0; }
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fmt { height: 36px; min-width: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--foreground); font: 600 14px var(--font-body); cursor: pointer; }
.fmt:hover { background: var(--muted); }
.fmt-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.save-state { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.save-state.saving { color: var(--accent); }
.save-state.saved { color: var(--ok); }
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-split .lyrics-edit { min-height: 420px; font-size: 16px; line-height: 1.7; font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; }
.preview { border: 1px dashed var(--border); border-radius: var(--radius-button); padding: 16px; font-size: 16px; min-height: 420px; max-height: 70vh; overflow-y: auto; background: var(--background); }
@media (max-width: 760px) {
  .editor-split { grid-template-columns: 1fr; }
  .editor-split .lyrics-edit, .preview { min-height: 260px; }
  .reader .md, .reader .placeholder { padding: 8px 20px 24px; }
  .speed input { width: 90px; }
  .md { font-size: 20px; }
}

.sync { margin-left: 16px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sync:empty { display: none; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-foreground); }
.sync[data-mode="synced"]::before { background: var(--ok); }
.sync[data-mode="offline"]::before { background: #B45309; }

.files { margin-top: 24px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.files[hidden] { display: none; }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.files-head h2 { font-size: 24px; }
.files-head .btn { box-shadow: none; }
.files-msg { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.files-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.files-list li:first-child { border-top: 0; }
.f-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.f-main a { font-weight: 700; overflow-wrap: anywhere; }
.f-main .dim { font-size: 13px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.files audio { height: 36px; max-width: 100%; }
.f-del { padding: 8px 0; }

.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.event-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.event-card.is-past { background: var(--muted); box-shadow: none; }
.event-card h2 { font-size: 28px; line-height: 1.15; }
.ev-link { color: var(--foreground); text-decoration: none; }
.ev-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.ev-link:focus-visible { outline: none; }
.ev-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-actions { display: flex; position: relative; z-index: 2; margin-right: -8px; }
.ev-actions .icon-btn.armed { background: #FEE2E2; color: #B91C1C; }
.ev-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 9999px; background: var(--muted); color: var(--ink-soft); font: 700 12px var(--font-body); }
.event-card.is-past .ev-badge { background: var(--card); }
.ev-badge.soon { background: var(--accent-bg); color: var(--accent); }
.ev-meta { margin: 0; color: var(--ink-soft); font-size: 15px; }
.ev-foot { margin: auto 0 0; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--accent); padding-top: 8px; }
.ev-foot svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease-out; }
.event-card:hover .ev-foot svg { transform: translateX(4px); }
.events-note { min-height: 20px; margin: 16px 0 0; font-size: 14px; color: var(--ink-soft); }
#formErr { margin: 0; color: #B91C1C; }
[hidden] { display: none !important; }

.ro .edit-only { display: none !important; }
.ro .files-msg { display: none; }
.authbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; margin: -16px 0 24px; font-size: 13px; color: var(--ink-soft); }
.authbar[hidden] { display: none; }
.auth-who { overflow-wrap: anywhere; }
.auth-link { font-weight: 700; color: var(--accent); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-link.primary { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 9999px; background: var(--accent-bg); }
.dd-btn.dd-static { cursor: default; width: auto; display: inline-flex; padding-right: 14px; }
.dd-static:hover { box-shadow: none; }

button.set-head { width: 100%; display: flex; align-items: center; gap: 10px; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.set-head:hover { background: #F8FAFC; }
.set-head .chev svg { width: 16px; height: 16px; stroke: var(--ink-soft); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; display: block; transition: transform 180ms ease-out; }
.set-head[aria-expanded="false"] .chev svg { transform: rotate(-90deg); }
.set-count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ev-info { display: flex; gap: 20px; align-items: flex-start; padding: 20px; margin-bottom: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); }
.ev-info[hidden] { display: none; }
.ev-info-thumb { width: 112px; height: 112px; object-fit: cover; border-radius: var(--radius-button); border: 1px solid var(--border); flex: none; }
.ev-info-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ev-line { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.ev-line svg { width: 18px; height: 18px; flex: none; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ev-line a { color: var(--accent); overflow-wrap: anywhere; }
.ev-desc-md { font-size: 15px; line-height: 1.6; max-width: 70ch; color: var(--ink-soft); }
.ev-desc-md p { margin: 0 0 0.6em; }
.ev-desc-md h2, .ev-desc-md h3, .ev-desc-md h4 { margin: 0.8em 0 0.3em; font-size: 1.1em; }
@media (max-width: 520px) { .ev-info { flex-direction: column; } .ev-info-thumb { width: 88px; height: 88px; } }
.ev-top { gap: 12px; }
.ev-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); flex: none; }
.ev-top .ev-actions { margin-left: auto; }
.event-card.is-soon { border-color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 1px var(--accent); }
.ev-desc { margin: 0; font-size: 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
dialog.wide { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.img-fields { display: flex; flex-direction: column; gap: 16px; }
.img-fields[hidden] { display: none; }
.img-label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.img-row { display: flex; align-items: center; gap: 16px; }
.img-prev { background: var(--muted) center / cover no-repeat; border: 1px dashed var(--border); border-radius: var(--radius-button); flex: none; }
.img-prev.has { border-style: solid; }
.thumb-prev { width: 72px; height: 72px; }
.bg-prev { width: 128px; height: 72px; }
.img-btns { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-btns .btn { box-shadow: none; }
.img-btns .link-btn[hidden] { display: none; }
textarea#fDesc { min-height: 96px; padding: 12px; }

.cols-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.cols-pick select { height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); font: 600 14px var(--font-body); color: var(--foreground); }
.btn.icon-only { width: 36px; padding: 0; }
.btn.icon-only svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md.multi { max-width: none; column-gap: 40px; }
.md.multi p, .md.multi ul, .md.multi blockquote, .md.multi h2, .md.multi h3, .md.multi h4 { break-inside: avoid; }
.reader.is-fs .md.multi { max-width: none; margin: 0; padding-left: 32px; padding-right: 32px; }
.pdf-viewer { margin-top: 24px; padding: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
.pdf-viewer[hidden] { display: none; }
.pdf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.pdf-title { font-weight: 700; flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-ctrl { display: inline-flex; align-items: center; gap: 2px; }
.pdf-ctrl .icon-btn svg, #pFull svg, #pClose svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pdf-zoom { min-width: 56px; height: 36px; border: 0; border-radius: 8px; background: transparent; font: 700 13px var(--font-body); color: var(--foreground); cursor: pointer; font-variant-numeric: tabular-nums; }
.pdf-zoom:hover { background: var(--muted); }
.pdf-page { font: 700 13px var(--font-body); color: var(--muted-foreground); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.pdf-bar .btn { box-shadow: none; }
.pdf-scroll { height: 75vh; overflow: auto; background: #CBD5E1; padding: 12px; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; width: max-content; min-width: 100%; }
.pdf-page-wrap { background: #fff; box-shadow: var(--shadow-md); flex: none; }
.pdf-page-wrap canvas { display: block; width: 100%; height: 100%; }
.pdf-msg { margin: 24px; text-align: center; color: var(--ink-soft); }
.pdf-viewer:fullscreen { border-radius: 0; border: 0; }
.pdf-viewer:fullscreen .pdf-scroll, .pdf-viewer.pseudo-fs .pdf-scroll { height: auto; flex: 1; }
.pdf-viewer.pseudo-fs { position: fixed; inset: 0; z-index: 200; border-radius: 0; margin: 0; }
.f-view { box-shadow: none; }
.pdf-viewer:fullscreen .pdf-scroll, .pdf-viewer.pseudo-fs .pdf-scroll { min-height: 0; }
.pdf-viewer:fullscreen, .pdf-viewer.pseudo-fs { background: var(--card); }

.offline-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 20px; margin-bottom: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); }
.offline-bar[hidden] { display: none; }
.off-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 240px; }
.off-text strong { font-size: 15px; }
.off-text span { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.off-btns { display: flex; align-items: center; gap: 16px; }
.off-btns .btn { box-shadow: none; }
.off-btns .btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.off-btns .link-btn[hidden] { display: none; }
.off-progress { flex: 1 1 100%; height: 6px; border-radius: 9999px; background: var(--muted); overflow: hidden; }
.off-progress[hidden] { display: none; }
.off-progress span { display: block; height: 100%; width: 0; background: var(--gradient); transition: width 180ms ease-out; }
.ev-badge.off { background: var(--ok-bg); color: var(--ok); }
.event-card.unavail { opacity: 0.5; }
.event-card.unavail .ev-link { pointer-events: none; }

.authbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; margin: -16px 0 16px; padding: 8px 0; background: rgba(250, 250, 250, 0.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.now-slot, .auth-slot { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.now-slot:empty, .auth-slot:empty { display: none; }
.now-pill { display: inline-flex; align-items: center; gap: 8px; max-width: min(100%, 420px); min-height: 36px; padding: 0 14px; border-radius: 9999px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-size: 13px; box-shadow: var(--shadow-accent); transition: transform 180ms ease-out, box-shadow 180ms ease-out; }
a.now-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg, 0 8px 24px rgba(0, 82, 255, 0.35)); }
.now-pill.here { background: var(--accent-bg); color: var(--accent); box-shadow: none; }
.now-pill svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease-out; }
a.now-pill:hover svg { transform: translateX(3px); }
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: pulse 2s ease-in-out infinite; }
.now-label { font-weight: 600; white-space: nowrap; opacity: 0.9; }
.now-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
@media (max-width: 520px) { .now-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .now-dot { animation: none; } }

.io-btns { display: inline-flex; align-items: center; gap: 20px; }
.io-btns .link-btn.edit-only { }
.io-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 12px; padding: 12px 16px; background: var(--accent-bg); border-radius: var(--radius-button); font-size: 14px; }
.io-confirm[hidden] { display: none; }
.io-confirm span { flex: 1 1 260px; }
.io-confirm .btn { box-shadow: none; }

.anon-only { display: none; }
.ro .anon-only { display: inline-flex; }
.ro .anon-only[hidden] { display: none; }
.reader-bar .anon-only { margin-left: auto; }
.rev-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px; background: #FEF3C7; color: #92400E; font: 700 11px var(--font-body); white-space: nowrap; }
.jump-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.jump-bar[hidden] { display: none; }
.chip.jump { cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.chip.jump:hover { background: var(--muted); }
.sect-bar { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.sect-bar[hidden] { display: none; }
.sect-bar .chip { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.md h2, .md h3, .md h4 { scroll-margin-top: 150px; }
.files-list li.flash { background: var(--accent-bg); border-radius: 8px; transition: background 400ms; }
.revs { margin-top: 24px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.revs[hidden] { display: none; }
.revs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.revs-head h2 { font-size: 24px; }
.revs-head .btn { box-shadow: none; }
.rev-ok { margin: 0; padding: 10px 14px; border-radius: var(--radius-button); background: var(--ok-bg); color: var(--ok); font-size: 14px; font-weight: 600; }
.rev-hint { margin: 0; font-size: 14px; color: var(--ink-soft); }
.rev-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
@media (max-width: 640px) { .rev-fields { grid-template-columns: 1fr; } }
.rev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rev-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.rev-list li:first-child { border-top: 0; }
.rev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; font-size: 14px; }
.rev-note { color: var(--ink-soft); overflow-wrap: anywhere; }
.rev-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rev-btns .btn { box-shadow: none; }
.rev-status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px; font: 700 11px var(--font-body); background: #FEF3C7; color: #92400E; }
.rev-status.s-accepted { background: var(--ok-bg); color: var(--ok); }
.rev-status.s-gone { background: var(--muted); color: var(--ink-soft); }
.rev-view { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.rev-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev-tabs .link-btn { margin-left: auto; }
.rev-decide { display: flex; gap: 10px; flex-wrap: wrap; }
.rev-decide .btn { box-shadow: none; }
.rev-md { max-width: none; font-size: 18px; }
.df { border: 1px solid var(--border); border-radius: var(--radius-button); overflow: hidden; font: 400 15px/1.6 ui-monospace, Consolas, "Courier New", monospace; background: var(--card); }
.df-line { display: flex; gap: 8px; padding: 0 12px; }
.df-sign { width: 14px; flex: none; text-align: center; color: var(--muted-foreground); user-select: none; }
.df-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.df-del { background: #FEE2E2; }
.df-add { background: #DCFCE7; }
.df-del .df-sign { color: #B91C1C; }
.df-add .df-sign { color: #047857; }
.df del { background: #FCA5A5; text-decoration: line-through; color: #7F1D1D; border-radius: 3px; }
.df ins { background: #86EFAC; text-decoration: none; color: #14532D; border-radius: 3px; }
.df-key del, .df-key ins { padding: 0 6px; border-radius: 3px; }
.df-key del { background: #FCA5A5; color: #7F1D1D; }
.df-key ins { background: #86EFAC; color: #14532D; text-decoration: none; }

.rev-banner { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; border-radius: var(--radius-button); background: #FEF3C7; color: #92400E; font-size: 13px; }
.rev-banner b { font-weight: 900; }
.rev-banner .btn { margin-left: auto; box-shadow: none; min-height: 30px; }
.rev-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: #D97706; flex: none; animation: pulse 2s ease-in-out infinite; }
.reader.previewing { border-color: #F59E0B; box-shadow: var(--shadow-md), 0 0 0 1px #F59E0B; }

.seg { display: inline-block; vertical-align: baseline; text-align: left; }
.seg .ch { display: block; width: max-content; margin: 0 6px 2px 0; padding: 0 7px; border-radius: 6px; background: var(--accent-bg); color: var(--accent); font: 900 0.72em/1.45 var(--font-body); letter-spacing: 0; white-space: nowrap; }
.seg .tx { display: block; white-space: pre; }
.md.chords p, .md.chords li { line-height: 1.5; }
.md.chords p { margin-bottom: 1.2em; }
.md.chords .seg .ch { font-size: 0.74em; }
.md blockquote .seg .ch { background: var(--card); }
.chord-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chord-toggle[hidden] { display: none; }
.import-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.import-row[hidden] { display: none; }
.import-row input { flex: 1 1 280px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-input); font: 400 15px var(--font-body); color: var(--foreground); background: var(--card); }
.import-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.import-row .btn { box-shadow: none; }
.imp-msg { flex: 1 1 100%; font-size: 13px; color: #B91C1C; }
.imp-msg:empty { display: none; }

.chip.sel-toggle { margin-left: auto; }
.chip.sel-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.sel-mode .row { cursor: pointer; }
.row.is-selected { background: var(--accent-bg); }
.row-sel { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); pointer-events: none; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 30; margin-top: 16px; padding: 12px 16px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius-card); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; gap: 10px; }
.bulk-bar[hidden] { display: none; }
.bulk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bulk-top .link-btn { margin-left: auto; font-weight: 700; }
.bulk-quick { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.bulk-quick .chip { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.bulk-actions > span#bulkStatuses { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.bulk-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.bulk-st { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--border); background: var(--muted); color: var(--ink-soft); font: 700 13px var(--font-body); cursor: pointer; transition: transform 180ms ease-out, box-shadow 180ms ease-out; }
.bulk-st:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.bulk-st:disabled { opacity: 0.4; cursor: default; }
.bulk-st.s-ready { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.bulk-st.s-live { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.bulk-st.s-done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.bulk-st .dd-dot { background: currentColor; }
.bulk-msg { font-size: 13px; font-weight: 600; color: var(--ok); }
.bulk-msg:empty { display: none; }

.transpose { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.transpose[hidden] { display: none; }
.tr-label { margin-right: 2px; }
.tr-val { min-width: 28px; text-align: center; font-size: 15px; color: var(--foreground); font-variant-numeric: tabular-nums; }
.transpose .icon-btn { width: 32px; height: 32px; font-size: 18px; font-weight: 700; color: var(--ink-soft); border-color: var(--border); }
.tr-key { margin-left: 4px; color: var(--accent); }
.tr-key:empty { display: none; }
.transpose .link-btn { padding: 4px 6px; font-size: 12px; }
.transpose .link-btn[hidden] { display: none; }

.head-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.q-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.q-results li { padding: 8px 12px; border-radius: var(--radius-input); background: var(--muted); color: var(--ink-soft); overflow-wrap: anywhere; }
.q-results li.ok { background: var(--ok-bg); color: var(--ok); }
.q-results li.bad { background: #FEE2E2; color: #B91C1C; }
.q-results li.skip { background: #FEF3C7; color: #92400E; }
.q-results:empty { display: none; }
dialog textarea#qUrls { min-height: 96px; padding: 12px; font: 400 14px var(--font-body); }

.reader.is-fs .reader-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; transition: transform 250ms ease-out, opacity 250ms ease-out; box-shadow: var(--shadow-md); }
.reader.is-fs.bar-hidden .reader-bar { transform: translateY(-105%); opacity: 0; pointer-events: none; }
.reader.is-fs .reader-title { padding-top: calc(var(--bar-h, 72px) + 16px); }
.reader.is-fs.bar-hidden { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .reader.is-fs .reader-bar { transition: none; } }

.head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-side .btn { box-shadow: none; }
.vl { display: block; padding: 2px 0 2px 14px; margin: 2px 0; border-left: 4px solid transparent; border-radius: 0 8px 8px 0; }
.vl[data-vi] { border-left-color: var(--vc); background: color-mix(in srgb, var(--vc) 8%, transparent); }
.vn { display: inline-block; margin-right: 8px; padding: 0 9px; border-radius: 9999px; background: var(--vc); color: #fff; font: 900 0.55em/1.9 var(--font-body); vertical-align: middle; letter-spacing: 0.02em; }
.md[data-mine] .vl[data-vi]:not(.shared) { opacity: 0.28; }
.md[data-mine].mine-0 .vl[data-vi="0"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-1 .vl[data-vi="1"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-2 .vl[data-vi="2"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-3 .vl[data-vi="3"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-4 .vl[data-vi="4"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-5 .vl[data-vi="5"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-6 .vl[data-vi="6"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-7 .vl[data-vi="7"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-8 .vl[data-vi="8"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-9 .vl[data-vi="9"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-10 .vl[data-vi="10"]:not(.shared) { opacity: 1; }
.md[data-mine].mine-11 .vl[data-vi="11"]:not(.shared) { opacity: 1; }
.md.marking .vl { cursor: pointer; }
.md.marking .vl:hover { background: var(--accent-bg); }
.md.marking [data-sec] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.vl.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-bg) !important; opacity: 1 !important; }
.voice-bar { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip.voice { border-color: var(--vc); color: var(--vc); font-weight: 700; display: inline-flex; align-items: center; }
.chip.voice[aria-pressed="true"] { background: var(--vc); color: #fff; }
.chip.voice[disabled] { opacity: 0.4; cursor: default; }
.vdot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 6px; flex: none; }
.chip.mark-toggle { margin-left: auto; }
.chip.mark-toggle[aria-pressed="true"] { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.mark-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(720px, calc(100vw - 32px)); z-index: 60; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius-card); box-shadow: var(--shadow-xl); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.mark-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; }
.mark-top .link-btn { margin-left: auto; font-weight: 700; }
.mark-singers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mark-singers input { min-height: 34px; width: 130px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9999px; font: 400 14px var(--font-body); color: var(--foreground); background: var(--card); }
.mark-singers .btn { box-shadow: none; }
.mark-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 13px; }
.mark-actions .link-btn { padding: 4px 0; font-size: 13px; }
.mark-actions .link-btn[disabled] { opacity: 0.4; }
.mark-msg { color: var(--ok); font-weight: 600; }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.voice-row[hidden] { display: none; }
.voice-row input { flex: 1 1 220px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-input); font: 400 15px var(--font-body); color: var(--foreground); background: var(--card); }
.voice-row .btn { box-shadow: none; }

.tags-wrap { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); font-weight: 400; }
.tags-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chips:empty { display: none; }
.tchip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 9999px; background: var(--muted); color: var(--foreground); font: 700 13px var(--font-body); }
.tchip.band { background: var(--accent); color: var(--on-accent); }
.tchip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0.7; }
.tchip button:hover { opacity: 1; background: rgba(0, 0, 0, 0.12); }
.field .tags-wrap input.tag-in { min-height: 34px; border: 0; padding: 0 4px; box-shadow: none; width: 100%; font: 400 15px var(--font-body); background: transparent; }
.field .tags-wrap input.tag-in:focus { box-shadow: none; }
.tag-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-sugg:empty { display: none; }
.tsug { height: 28px; padding: 0 10px; border-radius: 9999px; border: 1px dashed var(--border); background: transparent; color: var(--ink-soft); font: 600 12px var(--font-body); cursor: pointer; }
.tsug:hover { border-color: var(--accent); color: var(--accent); }
.itag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 9999px; background: var(--muted); color: var(--ink-soft); font: 700 12px var(--font-body); white-space: nowrap; }
.itag.band { background: var(--accent-bg); color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -8px 0 20px; }
.filters:empty { display: none; }
.filters .dd { width: auto; max-width: none; }
.filters .dd-btn { width: auto; background: var(--card); }
.filters .dd.active .dd-btn { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.dd.generic .dd-dot { display: none; }
.dd.generic .dd-btn b { font-weight: 900; }
.filters .link-btn { padding: 6px 0; font-size: 13px; font-weight: 700; }

.head-song { flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; }
.head-song .head-text { flex: 1 1 auto; min-width: 0; }
.head-song .head-side { flex: none; flex-direction: column; align-items: flex-end; gap: 10px; }
.head-song .head-side .dd { width: auto; max-width: none; }
.head-song .head-side .dd-btn:not(.dd-static) { min-width: 200px; }
@media (max-width: 640px) {
  .head-song { flex-wrap: wrap; }
  .head-song .head-side { flex-direction: row; align-items: center; margin-left: 0; }
}
.chip.mark-toggle.icon { width: 36px; padding: 0; justify-content: center; margin-left: auto; }
.chip.mark-toggle.icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bar-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.reader-bar .bar-right .btn { margin-left: 0; }
.btn.mark-toggle[aria-pressed="true"] { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.voice-bar:empty { display: none; }

.chord-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reader.is-fs .reader-bar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.reader.is-fs .md { padding-bottom: calc(55vh + env(safe-area-inset-bottom, 0px)); }
.pdf-viewer:fullscreen .pdf-bar, .pdf-viewer.pseudo-fs .pdf-bar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (hover: none) and (pointer: coarse) {
  .reader.is-fs .reader-bar { padding-top: calc(12px + max(env(safe-area-inset-top, 0px), 28px)); }
  .pdf-viewer:fullscreen .pdf-bar, .pdf-viewer.pseudo-fs .pdf-bar { padding-top: calc(10px + max(env(safe-area-inset-top, 0px), 28px)); }
  .reader.is-fs .reader-bar .btn, .reader.is-fs .reader-bar .icon-btn, .reader.is-fs .reader-bar select { min-height: 40px; }
  .reader.is-fs .reader-bar .icon-btn { min-width: 40px; }
}

.title-link { color: inherit; text-decoration: none; }
.title-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hid-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px; background: #E2E8F0; color: #334155; font: 700 11px var(--font-body); white-space: nowrap; margin-left: 6px; }
.row.is-hidden { opacity: 0.62; }
.row.is-hidden:hover { opacity: 1; }
.ev-badge.hid { background: #E2E8F0; color: #334155; }
.event-card.is-hidden { opacity: 0.7; border-style: dashed; }
.tag.meter { background: var(--muted); }
.bulk-more { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.btn.danger-soft { background: #FEE2E2; color: #B91C1C; border-color: transparent; box-shadow: none; }
.form-actions .grow { flex: 1; }
.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.archive-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.archive-list li:first-child { border-top: 0; }
.ar-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 240px; }
.ar-main b { overflow-wrap: anywhere; }
.ar-main span { font-size: 13px; color: var(--ink-soft); }
.ar-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-btns .btn { box-shadow: none; }

.btn[aria-pressed="true"].icon-only { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.reader .metro { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(960px, calc(100vw - 32px)); margin: 0; z-index: 70; }

.metro-tap { height: 40px; min-width: 56px; padding: 0 14px; border-radius: var(--radius-input); border: 1px solid var(--border); background: var(--card); color: var(--foreground); font: 900 14px var(--font-body); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; margin-left: 6px; transition: transform 80ms ease-out, background 80ms ease-out; }
.metro-tap.hit { transform: scale(0.94); background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.metro-limit { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.metro-limit select { height: 40px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); font: 600 14px var(--font-body); color: var(--foreground); }
.metro-bars { min-width: 96px; font: 700 13px var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.metro-bars:empty { display: none; }

.metro-accent { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.metro-accent input { width: 18px; height: 18px; accent-color: var(--accent); }

html[data-mode="dark"], [data-mode="dark"] {
  --background: #0B1220;
  --foreground: #E5E7EB;
  --muted: #1E293B;
  --muted-foreground: #94A3B8;
  --ink-soft: #CBD5E1;
  --border: #334155;
  --card: #111827;
  --ok: #34D399;
  --ok-bg: #064E3B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
  color-scheme: dark;
}
html[data-mode="dark"] .row:hover, html[data-mode="dark"] button.set-head:hover { background: #162033; }
html[data-mode="dark"] .authbar { background: rgba(11, 18, 32, 0.82); }
html[data-mode="dark"] .btn { background: var(--card); color: var(--foreground); border-color: var(--border); }
html[data-mode="dark"] .btn.primary { background: var(--gradient); color: var(--on-accent); border-color: transparent; }
html[data-mode="dark"] .ev-actions .icon-btn.armed, html[data-mode="dark"] .btn.danger-soft { background: #7F1D1D; color: #FECACA; }
html[data-mode="dark"] .hid-badge, html[data-mode="dark"] .ev-badge.hid { background: #334155; color: #E2E8F0; }
html[data-mode="dark"] .rev-badge, html[data-mode="dark"] .rev-status, html[data-mode="dark"] .rev-banner { background: #78350F; color: #FDE68A; }
html[data-mode="dark"] .tchip button:hover { background: rgba(255, 255, 255, 0.16); }
html[data-mode="dark"] .pdf-scroll { background: #0F172A; }
html[data-mode="dark"] .reader.previewing { border-color: #F59E0B; }
.theme-field { gap: 10px; }
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border: 2px solid var(--border); border-radius: 9999px; background: var(--card); color: var(--foreground); font: 600 13px var(--font-body); cursor: pointer; }
.swatch .dot { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.theme-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 14px; font-weight: 600; }
.theme-color { display: inline-flex; align-items: center; gap: 10px; }
.theme-color input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); cursor: pointer; }
.seg-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 9999px; overflow: hidden; }
.seg-switch button { height: 34px; padding: 0 16px; border: 0; background: var(--card); color: var(--ink-soft); font: 700 13px var(--font-body); cursor: pointer; }
.seg-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.theme-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-button); background: var(--background); color: var(--foreground); }
.theme-preview b { font-size: 14px; }
.event-card[data-themed] { border-top: 4px solid var(--ev-accent); }

.follow-bar { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-radius: var(--radius-button); background: var(--muted); }
.follow-bar[hidden] { display: none; }
.fb-ctrl { display: inline-flex; align-items: center; gap: 4px; }
.fb-ctrl .icon-btn { width: 36px; font: 700 12px var(--font-body); color: var(--ink-soft); }
.fb-ctrl .icon-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; }
.fb-ctrl .btn.icon-only.primary { width: 44px; height: 40px; }
.fb-ctrl [hidden] { display: none; }
.fb-clock { font: 900 18px var(--font-body); font-variant-numeric: tabular-nums; min-width: 82px; }
.fb-clock[hidden], .fb-bars[hidden] { display: none; }
.fb-bars { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.fb-bars input { width: 56px; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); color: var(--foreground); font: 700 14px var(--font-body); text-align: center; }
.fb-pos { font: 700 13px var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.fb-hint { flex: 1 1 240px; font-size: 12px; color: var(--ink-soft); }
.vt { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground); font: 700 0.5em/1.9 var(--font-body); font-variant-numeric: tabular-nums; vertical-align: middle; }
.md.following .vl { opacity: 0.5; transition: opacity 200ms ease-out, background 200ms ease-out; }
.md.following .vl.nxt { opacity: 0.85; }
.md.following .vl.cur { opacity: 1; background: var(--accent-bg); border-left-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.md.following h2.cur, .md.following h3.cur, .md.following h4.cur { text-decoration: underline; text-underline-offset: 6px; }
.md.following [data-ln] { cursor: pointer; }
.time-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.time-row[hidden] { display: none; }
.time-row .field.mini { font-size: 12px; width: 150px; }
.time-row .field.mini input { min-height: 38px; }
.time-shift { display: inline-flex; align-items: center; gap: 6px; }
.time-shift input { width: 72px; min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); color: var(--foreground); font: 400 14px var(--font-body); }
.time-row .btn { box-shadow: none; }

.ev-badge.st-live { background: var(--accent); color: #fff; }
.ev-badge.st-kickoff { background: #FEF3C7; color: #92400E; }
.ev-badge.st-planning { background: var(--muted); color: var(--ink-soft); }
.ev-badge.st-postponed { background: #FFEDD5; color: #9A3412; }
.ev-badge.st-cancelled { background: #FEE2E2; color: #991B1B; }
.event-card.is-live { box-shadow: var(--shadow-md), 0 0 0 2px var(--accent); }
html[data-mode="dark"] .ev-badge.st-kickoff, html[data-mode="dark"] .ev-badge.st-postponed, html[data-mode="dark"] .ev-badge.st-cancelled { background: #334155; color: #E2E8F0; }
.viewas-note { font-weight: 700; color: #92400E; background: #FEF3C7; padding: 3px 10px; border-radius: 9999px; font-size: 12px; }
html[data-mode="dark"] .viewas-note { background: #78350F; color: #FDE68A; }
button.auth-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; color: inherit; }

.fb-metro[hidden] { display: none; }
.fb-metro { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fb-metro .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.time-bars { display: inline-flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.vt.vb { background: var(--accent-bg); color: var(--accent); }

.to-top { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 150; width: 44px; height: 44px; border-radius: 9999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); box-shadow: var(--shadow-md); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.to-top[hidden] { display: none; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reader.is-fs .to-top, .reader.pseudo-fs .to-top { z-index: 210; }
