:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #070a12;
  --panel: rgba(14, 19, 32, 0.84);
  --panel-strong: #111827;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #929bb0;
  --text: #f7f8fb;
  --cyan: #5ce1e6;
  --violet: #916cff;
  --pink: #f15bb5;
  --error: #ff7185;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 70% -20%, rgba(83, 56, 170, 0.2), transparent 38%),
    linear-gradient(145deg, #080b13 0%, #070a12 48%, #090d18 100%);
}

button, textarea, select, input { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.13;
  pointer-events: none;
}

.ambient-one { top: 10%; left: -18rem; background: var(--cyan); }
.ambient-two { right: -18rem; bottom: -12rem; background: var(--violet); }

.topbar, .workspace, footer { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-decoration: none;
}

.brand-mark { display: flex; gap: 3px; height: 24px; align-items: center; }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: var(--cyan); }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 22px; }
.brand-mark i:nth-child(3) { height: 16px; background: var(--violet); }
.brand-mark i:nth-child(4) { height: 7px; background: var(--pink); }
.brand b { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; }

.engine-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.8rem; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: #f8c15c; box-shadow: 0 0 12px currentColor; }
.engine-state.ready .state-dot { background: #50e3a4; }
.engine-state.offline .state-dot { background: var(--error); }

.workspace {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 0.86fr);
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 24px;
}

.composer, .result-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.composer { padding: clamp(24px, 4vw, 44px); }

.intro { max-width: 670px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.17em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 4.3vw, 3.6rem); line-height: 1.04; letter-spacing: -0.055em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); letter-spacing: -0.035em; }
.intro > p:last-child, .result-panel p { color: var(--muted); line-height: 1.75; }

.field { margin-bottom: 22px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
label, .field-heading > label { color: #dce1ee; font-size: 0.92rem; font-weight: 700; }
.optional, output { color: var(--muted); font-size: 0.78rem; }
.text-button { padding: 0; border: 0; color: var(--cyan); background: transparent; font-size: 0.8rem; }

textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(5, 8, 16, 0.62);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea { min-height: 88px; padding: 15px 16px; resize: vertical; line-height: 1.65; }
select { height: 48px; padding: 0 14px; }
textarea:focus, select:focus { border-color: rgba(92, 225, 230, 0.7); box-shadow: 0 0 0 3px rgba(92, 225, 230, 0.1); }
textarea::placeholder { color: #60697d; }
.lyrics-review { margin: 9px 2px 0; color: var(--cyan); font-size: 0.78rem; line-height: 1.5; }
.field-note, .instrumental-lyrics-note, .manual-empty-hint { margin: 8px 2px 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }

.lyrics-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,8,16,.42); cursor: pointer; transition: 160ms ease; }
.mode-card:hover { border-color: rgba(92,225,230,.42); }
.mode-card:has(input:checked) { border-color: rgba(92,225,230,.75); background: rgba(92,225,230,.08); box-shadow: 0 0 0 2px rgba(92,225,230,.08); }
.mode-card input[type="radio"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--cyan); }
.mode-card > span { display: grid; flex: 1 1 auto; gap: 5px; min-width: 0; }
.mode-card strong { color: var(--text); font-size: .86rem; }
.mode-card small { color: var(--muted); font-size: .7rem; line-height: 1.45; font-weight: 400; }
.manual-lyrics-panel { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5,8,16,.3); }
.manual-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.manual-heading > div { display: grid; gap: 4px; }
.manual-heading strong { font-size: .84rem; }
.manual-heading span { color: var(--muted); font-size: .72rem; }

.control-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 18px; }
.compact > label { display: block; margin-bottom: 9px; }
.duration-field { padding-top: 1px; }

input[type="range"] { width: 100%; height: 5px; margin: 17px 0; accent-color: var(--cyan); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 16, 0.36);
}
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 27px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #30384a; transition: 180ms ease; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: white; transition: 180ms ease; }
.switch input:checked + span { background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.switch input:checked + span::after { transform: translateX(21px); }
.switch input:focus-visible + span { outline: 3px solid rgba(92, 225, 230, 0.35); }

.submit-row { display: block; }
.submit-row .primary-button { justify-content: center; width: 100%; }
.primary-button, .download-button, .secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  font-weight: 800;
  text-decoration: none;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  white-space: nowrap;
  color: #071019;
  background: linear-gradient(115deg, var(--cyan), #87bfff 48%, #af85ff);
  box-shadow: 0 10px 30px rgba(92, 225, 230, 0.18);
}
.primary-button:disabled { cursor: wait; opacity: 0.58; }
.button-wave { display: flex; gap: 2px; align-items: center; }
.button-wave i { width: 2px; height: 12px; background: #071019; border-radius: 2px; }
.button-wave i:nth-child(2) { height: 19px; }

.result-panel { position: sticky; top: 18px; height: calc(100vh - 36px); min-height: 620px; max-height: 860px; padding: clamp(26px, 4vw, 42px); overflow-x: hidden; overflow-y: auto; }
.result-panel > div { min-height: 100%; }
.result-idle, .result-working, .result-ready, .result-error { display: flex; flex-direction: column; justify-content: center; }
.result-ready { justify-content: flex-start; }
.record { position: relative; width: min(280px, 75%); aspect-ratio: 1; margin: 8px auto 48px; border-radius: 50%; background: repeating-radial-gradient(circle, #181e2c 0 6px, #0d111c 7px 11px); box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5); animation: spin 18s linear infinite; }
.record-ring { position: absolute; inset: 10%; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 50%; }
.record-label { position: absolute; inset: 33%; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(from 40deg, var(--pink), var(--violet), var(--cyan), var(--pink)); }
.record-label span { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.queue-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid rgba(92, 225, 230, .25);
  border-radius: 12px;
  background: rgba(92, 225, 230, .07);
}
.queue-summary strong { color: var(--cyan); font-size: 1.12rem; white-space: nowrap; }
.queue-summary span { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.visualizer { display: flex; align-items: center; justify-content: center; gap: 8px; height: 170px; margin-bottom: 30px; }
.visualizer i { width: 7px; height: 30%; border-radius: 5px; background: linear-gradient(to top, var(--violet), var(--cyan)); animation: pulse 1.3s ease-in-out infinite alternate; }
.visualizer i:nth-child(3n) { height: 70%; animation-delay: -0.7s; }
.visualizer i:nth-child(4n) { height: 95%; animation-delay: -0.35s; }
.visualizer i:nth-child(5n) { height: 50%; animation-delay: -1s; }
@keyframes pulse { to { transform: scaleY(0.22); opacity: 0.48; } }
.progress-track { height: 5px; margin: 24px 0 15px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 45%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); animation: travel 1.6s ease-in-out infinite; }
@keyframes travel { 0% { transform: translateX(-105%); } 100% { transform: translateX(230%); } }
.cover-art { position: relative; display: grid; place-items: center; width: min(220px, 68%); aspect-ratio: 1; margin: 2px auto 22px; overflow: hidden; border-radius: 20px; background: linear-gradient(145deg, #171e35, #0c1020); box-shadow: 0 22px 65px rgba(0,0,0,.45); }
.cover-grid { position: absolute; inset: -20%; background-image: linear-gradient(rgba(92,225,230,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(92,225,230,.08) 1px, transparent 1px); background-size: 28px 28px; transform: perspective(400px) rotateX(58deg) rotateZ(-15deg); }
.cover-orbit { position: absolute; width: 67%; height: 67%; border: 2px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 45px rgba(92,225,230,.45), inset 0 0 45px rgba(145,108,255,.25); }
.cover-art strong { z-index: 1; font-size: 4.2rem; letter-spacing: -0.08em; text-shadow: 0 0 30px var(--violet); }
audio { width: 100%; margin: 0 0 16px; }
.song-playback { margin: 0 0 16px; }
.song-playback audio { margin: 10px 0 0; display: block; }
.audio-load-button {
  width: 100%; min-height: 46px; padding: 12px 16px; border: 1px solid rgba(92,225,230,.28);
  border-radius: 12px; background: rgba(92,225,230,.08); color: var(--cyan);
  font: inherit; font-weight: 700; cursor: pointer;
}
.audio-load-button:disabled { cursor: default; color: var(--muted); }
.audio-load-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.audio-load-percent { color: var(--cyan); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.audio-load-progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; accent-color: var(--cyan); }
.audio-load-progress::-webkit-progress-bar { background: rgba(255,255,255,.08); border-radius: 99px; }
.audio-load-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; }
.audio-load-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; }
[aria-disabled="true"].download-button, .history-actions a[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.download-button, .secondary-button { display: grid; place-items: center; width: 100%; padding: 0 18px; }
.download-button { color: #061014; background: var(--cyan); }
.secondary-button { margin-top: 12px; color: var(--text); background: rgba(255,255,255,.08); }
.track-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; }
.track-meta div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.track-meta dt { color: var(--muted); font-size: .68rem; }
.track-meta dd { margin: 5px 0 0; font-size: .82rem; font-weight: 700; }
.error-mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 30px; border: 1px solid rgba(255,113,133,.5); border-radius: 50%; color: var(--error); font-size: 2.2rem; }
.result-error .eyebrow { color: var(--error); }

footer { display: flex; justify-content: center; gap: 18px; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 34px; color: #646d81; font-size: .72rem; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .result-panel { position: relative; top: auto; height: auto; min-height: 520px; max-height: none; overflow: hidden; }
}

@media (max-width: 580px) {
  .topbar, .workspace, footer { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 66px; }
  .engine-state span:last-child { display: none; }
  .workspace { margin-top: 18px; }
  .composer, .result-panel { border-radius: 18px; }
  .composer { padding: 22px 18px; }
  .control-grid { grid-template-columns: 1fr; gap: 0; }
  .primary-button { justify-content: center; width: 100%; }
  .result-panel { min-height: 500px; padding: 26px 20px; }
  footer { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.top-actions, .account-summary { display: flex; align-items: center; gap: 12px; }
.account-summary { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.account-summary strong { padding: 6px 10px; border-radius: 99px; color: var(--cyan); background: rgba(92,225,230,.1); }
.header-button, .close-button, .section-actions button { border: 0; color: var(--muted); background: transparent; }
.header-button { white-space: nowrap; }
.header-button:hover, .close-button:hover, .section-actions button:hover { color: var(--text); }
.purchase-button { padding: 7px 10px; border-radius: 9px; color: var(--cyan); background: rgba(92,225,230,.08); }
.purchase-button:hover, .purchase-button.needs-credit { color: #071019; background: var(--cyan); }
footer a { color: #8c96aa; text-decoration: none; }
footer a:hover { color: var(--cyan); }

.lyrics-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.section-list { display: grid; gap: 12px; }
.section-card { position: relative; overflow: visible; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,8,16,.5); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 7px 10px 7px 15px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-name { min-width: 64px; color: var(--cyan); font-size: .82rem; }
.section-title select { width: auto; height: 32px; padding: 0 28px 0 10px; border-radius: 8px; font-size: .76rem; }
.section-help-wrap { position: relative; flex: 0 0 auto; }
.section-help { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid rgba(92,225,230,.4); border-radius: 50%; color: var(--cyan); background: rgba(92,225,230,.07); font-size: .72rem; font-weight: 800; cursor: help; }
.section-help:focus-visible { outline: 3px solid rgba(92,225,230,.25); }
.section-tooltip { position: absolute; z-index: 8; left: 50%; top: calc(100% + 9px); width: min(290px, 70vw); padding: 10px 12px; border: 1px solid rgba(92,225,230,.25); border-radius: 10px; color: #dce1ee; background: #151c2b; box-shadow: 0 12px 35px rgba(0,0,0,.45); font-size: .72rem; font-weight: 400; line-height: 1.55; opacity: 0; pointer-events: none; transform: translate(-50%, -5px); transition: 140ms ease; }
.section-help-wrap:hover .section-tooltip, .section-help:focus + .section-tooltip, .section-help.open + .section-tooltip { opacity: 1; transform: translate(-50%, 0); }
.section-card textarea { min-height: 105px; border: 0; border-radius: 0 0 14px 14px; background: transparent; }
.section-card textarea:focus { box-shadow: inset 0 0 0 1px rgba(92,225,230,.38); }
.section-actions { display: flex; gap: 1px; }
.section-actions button { width: 31px; height: 31px; border-radius: 8px; font-size: 1rem; }
.section-actions button:disabled { cursor: default; opacity: .25; }
.add-section-button { width: 100%; margin-top: 10px; padding: 11px; border: 1px dashed rgba(92,225,230,.3); border-radius: 12px; color: var(--cyan); background: transparent; }
.add-section-button:hover { background: rgba(92,225,230,.06); }
.editor-disabled { opacity: .5; pointer-events: none; }
.import-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8,12,22,.85); }
.import-panel > label { display: block; margin-bottom: 8px; }
.import-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: .76rem; }
.small-button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 9px; color: #071019; background: var(--cyan); font-weight: 800; }
.small-button:disabled { opacity: .5; }

.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(3,5,10,.78); backdrop-filter: blur(14px); }
.auth-gate { z-index: 30; }
.modal-card { width: min(460px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: #101624; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.modal-copy { color: var(--muted); line-height: 1.65; }
.tab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 24px 0 20px; padding: 4px; border-radius: 11px; background: rgba(255,255,255,.05); }
.tab-button { min-height: 39px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.tab-button.active { color: var(--text); background: rgba(255,255,255,.09); }
.auth-form, .admin-box { display: grid; gap: 13px; }
.auth-form label, .admin-box label { display: grid; gap: 7px; color: #dce1ee; font-size: .78rem; font-weight: 700; }
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]) { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: rgba(5,8,16,.62); outline: none; }
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus { border-color: rgba(92,225,230,.7); box-shadow: 0 0 0 3px rgba(92,225,230,.1); }
.full-button { justify-content: center; width: 100%; margin-top: 4px; }
.terms-check { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; font-weight: 400 !important; line-height: 1.5; }
.terms-check input { margin-top: 3px; accent-color: var(--cyan); }
.terms-check a { margin: 0 2px; color: var(--cyan); }
.form-message { min-height: 18px; margin: 0; color: var(--error); font-size: .76rem; }

.admin-card { width: min(900px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.history-card { width: min(820px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.purchase-card { width: min(720px, 100%); }
.purchase-intro { margin: 8px 0 22px; color: var(--muted); line-height: 1.7; }
.purchase-layout { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(260px, 1.2fr); gap: 24px; align-items: center; }
.qr-wrap { display: grid; justify-items: center; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.qr-wrap img { display: block; width: 100%; max-width: 260px; height: auto; }
.qr-wrap span { color: #4b5568; font-size: .72rem; }
.price-list { display: grid; gap: 10px; }
.price-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,8,16,.42); }
.price-item strong { color: var(--cyan); font-size: 1.15rem; }
.price-item small { margin-left: 5px; padding: 3px 6px; border-radius: 99px; color: #071019; background: var(--cyan); font-size: .62rem; }
.price-item.recommended { border-color: rgba(92,225,230,.48); background: rgba(92,225,230,.07); }
.price-list > p { margin: 4px 2px 0; color: var(--muted); font-size: .72rem; line-height: 1.65; }
.history-intro { margin: 8px 0 20px; color: var(--muted); font-size: .8rem; }
.history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.history-item { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,8,16,.42); }
.history-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.history-item h3 { display: -webkit-box; margin: 0; overflow: hidden; font-size: .88rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.history-item time { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
.history-status { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; color: #f8c15c; background: rgba(248,193,92,.1); font-size: .66rem; }
.history-status.status-completed { color: #50e3a4; background: rgba(80,227,164,.1); }
.history-status.status-failed { color: var(--error); background: rgba(255,113,133,.1); }
.history-item audio { width: 100%; margin: 14px 0 8px; }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.history-actions a, .history-actions button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(92,225,230,.25); border-radius: 8px; color: var(--cyan); background: rgba(92,225,230,.07); font-size: .72rem; text-decoration: none; }
.history-actions a { display: inline-flex; align-items: center; }
.history-note, .history-empty { margin: 14px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.history-empty { grid-column: 1 / -1; padding: 36px 10px; text-align: center; }
.modal-title, .admin-list-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.modal-title h2, .admin-box h3 { margin-bottom: 0; }
.close-button { width: 42px; height: 42px; font-size: 1.8rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 16px; }
.admin-box { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,8,16,.4); }
.admin-card > .admin-box { margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }

.legal-page { width: min(780px, calc(100% - 40px)); margin: 50px auto; padding: clamp(24px,5vw,54px); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.legal-page h1 { font-size: clamp(2rem,5vw,3rem); }
.legal-page h2 { margin-top: 34px; font-size: 1.25rem; }
.legal-page p, .legal-page li { color: #b4bdcf; line-height: 1.8; }
.legal-page a { color: var(--cyan); }
.feedback-form { display: grid; gap: 18px; margin-top: 28px; }
.feedback-form label { display: grid; gap: 8px; }
.feedback-form textarea { min-height: 170px; }
.feedback-form .primary-button { justify-content: center; width: 100%; }
.feedback-success { color: #50e3a4; }

@media (max-width: 720px) {
  .top-actions { gap: 6px; }
  .engine-state { display: none; }
  .account-summary { padding-left: 0; border-left: 0; }
  .account-summary > span { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .history-list { grid-template-columns: 1fr; }
  .purchase-layout { grid-template-columns: 1fr; }
  .qr-wrap { width: min(280px, 100%); margin: 0 auto; }
}

@media (max-width: 480px) {
  .modal { padding: 10px; }
  .modal-card { padding: 22px 18px; border-radius: 17px; }
  .section-name { min-width: 56px; }
  .section-title { gap: 5px; }
  .section-title select { max-width: 110px; }
  .lyrics-mode-grid { grid-template-columns: 1fr; }
  .section-header { align-items: flex-start; }
  .section-title { flex-wrap: wrap; }
  .section-tooltip { left: 0; transform: translate(0, 5px); }
  .section-help-wrap:hover .section-tooltip, .section-help:focus + .section-tooltip, .section-help.open + .section-tooltip { transform: translate(0, 0); }
}
