:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-glow: rgba(65, 135, 108, 0.16);
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #eef3f0;
  --border: #dce5e0;
  --border-strong: #c4d2cb;
  --text: #14211b;
  --muted: #63736b;
  --accent: #2f7359;
  --accent-strong: #205a44;
  --accent-contrast: #ffffff;
  --accent-soft: #e1f1e9;
  --chord: #17664c;
  --chord-bg: #dcf2e7;
  --danger: #a93226;
  --danger-soft: #fbe9e7;
  --warning: #8a5a14;
  --shadow: 0 18px 50px rgba(26, 61, 47, 0.12);
  --shadow-soft: 0 6px 20px rgba(26, 61, 47, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Segoe UI", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f0d;
  --bg-glow: rgba(80, 190, 148, 0.12);
  --surface: #141a17;
  --surface-2: #1a211d;
  --surface-3: #202824;
  --border: #2a352f;
  --border-strong: #3a4a42;
  --text: #edf4f0;
  --muted: #9baba3;
  --accent: #82c8aa;
  --accent-strong: #a5e2c7;
  --accent-contrast: #0d1f18;
  --accent-soft: #1c362c;
  --chord: #8fe3bf;
  --chord-bg: #17362a;
  --danger: #ff9b8f;
  --danger-soft: #3a1e1b;
  --warning: #e0b05c;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 600px at 85% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(700px 500px at -10% 110%, var(--bg-glow), transparent 65%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.editor-open { overflow: hidden; }

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

code, pre, textarea { font-family: var(--mono); }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand--large { justify-content: center; padding: 0 0 22px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.brand__mark .icon { width: 24px; height: 24px; }

.brand__text { font-size: 1.15rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover { background: var(--accent-strong); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
}

.text-btn .icon { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }

.field__label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.field__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.req { color: var(--danger); }

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

textarea {
  min-height: 320px;
  resize: vertical;
  line-height: 1.6;
  tab-size: 2;
}

.hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text);
}

/* ---------- Login ---------- */

.login {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px 18px;
  overflow: hidden;
}

.login__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.login__orb--one {
  width: 460px;
  height: 460px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 68%);
}

.login__orb--two {
  width: 380px;
  height: 380px;
  bottom: -180px;
  left: -130px;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, #c9a227 22%, transparent), transparent 68%);
}

.login__card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login__card h1 {
  margin: 0;
  font-size: 1.55rem;
  text-align: center;
  letter-spacing: -0.3px;
}

.login__lead {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.login__server {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
  word-break: break-all;
}

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover { background: var(--surface-2); color: var(--text); }

.form-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.86rem;
  line-height: 1.45;
}

/* ---------- App shell ---------- */

.app {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100dvh;
  flex: none;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(12px);
}

.nav { padding: 6px 12px; flex: 1; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent); }

.sidebar__footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user { display: flex; align-items: center; gap: 10px; min-width: 0; }

.user__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.user__meta { display: flex; flex-direction: column; min-width: 0; }
.user__email { font-size: 0.83rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user__role { font-size: 0.72rem; color: var(--muted); }

.main {
  flex: 1;
  min-width: 0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 16px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.topbar__titles h1 { margin: 0; font-size: 1.8rem; letter-spacing: -0.6px; }
.topbar__titles p { margin: 4px 0 0; color: var(--muted); font-size: 0.84rem; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.content { display: flex; flex-direction: column; gap: 14px; }

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.search .icon { color: var(--muted); }
.search input { border: 0; background: transparent; box-shadow: none; padding: 13px 0; }
.search input:focus { box-shadow: none; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); color: var(--accent); }
.chip__count { font-weight: 500; opacity: 0.78; }

.chip--button { cursor: pointer; }

.chips--select .chip { cursor: pointer; }

/* ---------- Song list ---------- */

.song-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 64px minmax(0, 1.2fr) 116px 76px;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}

.song-row:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }

.song-row__title { min-width: 0; }
.song-row__title strong { display: block; font-size: 0.96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row__title span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.key-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.song-row__artist, .song-row__updated {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-row__tags { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }

.tag-pill {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-row__actions { display: flex; justify-content: flex-end; gap: 4px; }

.song-row .icon-btn { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.song-row .icon-btn:hover { background: var(--surface-3); }
.song-row .icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state h2 { margin: 4px 0 0; color: var(--text); font-size: 1.15rem; }
.empty-state p { margin: 0 0 8px; max-width: 420px; line-height: 1.5; }
.empty-state__icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: var(--surface-3); }
.empty-state__icon .icon { width: 30px; height: 30px; }

/* ---------- Editor ---------- */

.editor {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
}

.editor__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.editor__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.editor__heading h2 { margin: 0; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor__subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; }
.editor__actions { display: flex; align-items: center; gap: 12px; flex: none; }
.save-state { font-size: 0.76rem; color: var(--muted); }
.save-state.is-error { color: var(--danger); }
.save-state.is-ok { color: var(--accent); }

.editor__tabs {
  display: none;
  padding: 8px 16px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.editor-tab {
  flex: 1;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.editor-tab.is-active { background: var(--accent-soft); color: var(--accent); }

.editor__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.editor__pane {
  min-width: 0;
  overflow: auto;
  padding: 20px;
}

.editor__pane--form {
  width: 50%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor__pane--preview {
  width: 50%;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

.field--grow { flex: 1; }
.field--grow textarea { flex: 1; min-height: 300px; }

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.inline-form input { flex: 1; min-width: 140px; }

.optional {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 14px;
}

.optional summary {
  padding: 13px 0;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9rem;
  list-style: none;
}

.optional summary::-webkit-details-marker { display: none; }

.optional summary::before {
  content: "＋";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
}

.optional[open] summary::before { content: "−"; }

.optional__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 0 16px;
}

.field--wide { grid-column: 1 / -1; }

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.9rem;
}

.preview-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.preview-meta { color: var(--muted); font-size: 0.72rem; font-weight: 500; }

.scale-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.scale-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.scale-btn:hover { background: var(--surface-3); color: var(--text); }
.scale-label { min-width: 38px; text-align: center; color: var(--muted); font-size: 0.68rem; font-weight: 600; }

.preview {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  line-height: 1.5;
  font-size: calc(1rem * var(--preview-scale, 1));
}

.preview:empty::before {
  content: "Начните вводить текст песни — предпросмотр обновится сразу.";
  color: var(--muted);
  font-size: 0.86rem;
}

.preview__section {
  margin: 18px 0 8px;
  color: var(--accent);
  font-size: calc(0.78rem * var(--preview-scale, 1));
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.preview__section:first-child { margin-top: 0; }

.preview__spacer { height: 10px; }

.lyric-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 2px;
  margin: 3px 0;
}

.lyric-group {
  display: flex;
  align-items: flex-start;
  flex: none;
}

.lyric-piece {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lyric-chord {
  display: block;
  min-height: 1.5em;
  font-size: calc(0.76rem * var(--preview-scale, 1));
  line-height: 1.5;
  font-weight: 700;
  color: var(--chord);
  white-space: pre;
}

.lyric-text {
  white-space: pre;
  font-size: calc(0.96rem * var(--preview-scale, 1));
}

.chord-only {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0;
}

.chord-only .lyric-chord {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--chord-bg);
  color: var(--chord);
  min-height: 0;
  font-size: calc(0.78rem * var(--preview-scale, 1));
}

.chord-toolbar {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.chord-toolbar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.chord-toolbar__row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tool-btn {
  flex: none;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.tool-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.tool-btn--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tool-btn--section { background: var(--surface-3); color: var(--muted); }

/* ---------- Utilities ---------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(2px);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  text-align: center;
}

.toast.is-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }

.noscript { padding: 24px; text-align: center; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .song-row { grid-template-columns: minmax(0, 2.4fr) 64px minmax(0, 1.2fr) 76px; }
  .song-row__updated { display: none; }
}

@media (max-width: 860px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar .brand { padding: 12px 14px; }
  .sidebar .brand__mark { width: 36px; height: 36px; }
  .sidebar .brand__text { font-size: 1rem; }
  .nav { display: none; }
  .sidebar__footer { border: 0; padding: 8px 14px; flex-direction: row; align-items: center; margin-left: auto; }
  .sidebar__footer .user { display: none; }
  .sidebar__footer .btn { width: auto; min-height: 38px; padding: 7px 11px; }

  .app { flex-direction: column; }
  .main { width: 100%; padding: 0 14px 28px; }
  .topbar { position: static; padding: 18px 0 12px; align-items: flex-start; }
  .topbar__titles h1 { font-size: 1.5rem; }
  .topbar__actions { gap: 6px; }
  .topbar__actions .btn span { display: none; }
  .topbar__actions .btn { padding: 8px 11px; }

  .song-list { gap: 7px; }
  .song-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 11px 12px;
  }
  .song-row__artist, .song-row__tags, .song-row__updated { display: none; }
  .song-row__title { grid-column: 2; }
  .song-row__title span { margin-top: 2px; }
  .key-badge { grid-column: 1; grid-row: 1; }
  .song-row__actions { grid-column: 3; grid-row: 1; }

  .editor__tabs { display: flex; }
  .editor__body { display: block; position: relative; }
  .editor__pane { width: 100%; border-right: 0; padding: 16px; }
  .editor[data-pane="form"] .editor__pane--preview { display: none; }
  .editor[data-pane="preview"] .editor__pane--form { display: none; }
  .editor__pane--preview { height: 100%; }
  .editor__topbar { padding: 8px 12px; }
  .editor__topbar .editor__subtitle { display: none; }
  .editor__topbar h2 { max-width: 42vw; }
  .editor__actions .save-state { display: none; }
  .optional__grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  textarea { min-height: 42vh; }
  .chord-toolbar { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 520px) {
  .login { padding: 14px; }
  .login__card { padding: 24px 18px; border-radius: 20px; }
  .topbar__actions .icon-btn { display: none; }
  .topbar__actions .btn--ghost { display: none; }
  .editor__heading h2 { max-width: 38vw; }
  .editor__actions .btn span { display: none; }
  .editor__actions .btn { padding: 8px 11px; }
  .preview { padding: 14px; }
  .preview-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .preview-tools { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
