:root {
  color-scheme: dark;
  --bg: #070b13;
  --surface: rgba(16, 23, 38, 0.88);
  --surface-solid: #101726;
  --surface-raised: #151e30;
  --line: rgba(151, 174, 214, 0.14);
  --line-strong: rgba(132, 177, 255, 0.26);
  --text: #f3f7ff;
  --muted: #8d9bb3;
  --muted-strong: #b3bfd2;
  --cyan: #55dfeb;
  --blue: #73a6ff;
  --violet: #a78bfa;
  --green: #5ce1a1;
  --red: #ff738a;
  --amber: #ffc56f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --glow: 0 0 34px rgba(85, 223, 235, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 12% 5%, rgba(124, 58, 237, 0.19), transparent 32rem),
    radial-gradient(circle at 89% 16%, rgba(34, 211, 238, 0.12), transparent 29rem),
    radial-gradient(circle at 55% 92%, rgba(244, 114, 182, 0.09), transparent 32rem),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.studio-global-bar .topbar-actions { justify-self: end; }

@media (max-width: 1180px) {
  .studio-global-bar .project-chip { display: none; }
  .studio-global-bar .health span { display: none; }
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

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

::selection { background: rgba(85, 223, 235, 0.25); color: white; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.12;
}
.ambient-one { left: -20rem; top: 28%; background: var(--violet); }
.ambient-two { right: -22rem; bottom: -8rem; background: var(--cyan); }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 74px;
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 19, 0.78);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--text); text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 16px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(93, 226, 233, 0.35);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(87, 223, 235, 0.18), rgba(126, 111, 255, 0.18));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 22px rgba(85,223,235,.12);
  color: #dfffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.03em;
}

.topbar-center { justify-self: center; }
.project-chip, .health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--muted-strong);
  font-size: 12px;
}
.project-chip { padding: 7px 13px; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.health { padding: 7px 10px; }
.health i, .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px currentColor; }
.health.online i, .dot { background: var(--green); }
.health.offline i { background: var(--red); }

.icon-button, .avatar-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
  color: var(--muted-strong);
}
.icon-button:hover, .avatar-button:hover { border-color: var(--line-strong); color: white; background: rgba(255,255,255,.06); }
.avatar-button { border-radius: 50%; color: #c8fbff; font-size: 11px; font-weight: 800; }

.navigation {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 14px clamp(18px, 4vw, 56px) 0;
  scrollbar-width: none;
}
.navigation::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.nav-item span { color: #6d7990; }
.nav-item:hover { color: white; background: rgba(255,255,255,.03); }
.nav-item.active { border-color: rgba(85,223,235,.18); background: rgba(85,223,235,.075); color: #e9feff; box-shadow: inset 0 0 20px rgba(85,223,235,.03); }
.nav-item.active span { color: var(--cyan); }

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 56px) 70px;
}
.workspace { min-width: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panel-in .22s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }

.page-heading, .section-heading, .card-title, .mini-title, .sections-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-heading { margin-bottom: 20px; }
.page-heading h1, .section-heading h2, .stats-heading h2 { margin: 3px 0 4px; letter-spacing: -0.035em; }
.page-heading h1 { font-size: clamp(27px, 3vw, 38px); line-height: 1.15; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 680px; }
.eyebrow { margin: 0; color: var(--cyan); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.heading-actions { display: flex; gap: 9px; }

.builder-card, .settings-card, .results-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(21, 30, 48, .92), rgba(12, 18, 31, .92));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025);
}
.builder-card { padding: clamp(19px, 3vw, 30px); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field > span, .choice-block legend { color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.field > span b, .choice-block legend b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border: 1px solid rgba(85,223,235,.2);
  border-radius: 7px;
  color: var(--cyan);
  font-size: 10px;
}
.field-wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 8, 16, .42);
  color: var(--text);
  padding: 10px 12px;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #637089; }
input:hover, select:hover, textarea:hover { border-color: rgba(151,174,214,.25); }
input:focus, select:focus, textarea:focus { border-color: rgba(85,223,235,.52); outline: none; box-shadow: 0 0 0 3px rgba(85,223,235,.07); background: rgba(4,8,16,.6); }
select:disabled, input:disabled { opacity: .68; }

.fragment-preview {
  display: grid;
  grid-template-columns: 130px 130px 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(85,223,235,.13);
  border-radius: var(--radius-md);
  background: rgba(85,223,235,.035);
}
.fragment-preview > div { display: grid; align-content: center; }
.fragment-preview span { color: var(--muted); font-size: 11px; }
.fragment-preview strong { font-size: 15px; }
.fragment-preview p { max-height: 100px; overflow: auto; margin: 0; color: var(--muted-strong); white-space: pre-line; font-size: 13px; }

.choice-block { margin: 24px 0 0; padding: 0; border: 0; }
.choice-block legend { margin-bottom: 10px; }
.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.segmented label input, .visual-choices label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--muted-strong);
  cursor: pointer;
}
.segmented label input:checked + span { border-color: rgba(85,223,235,.45); background: rgba(85,223,235,.1); color: white; box-shadow: var(--glow); }
.compact-field { width: 150px; margin-top: 10px; }
.inline-warning { margin: 9px 0 0; color: var(--amber); font-size: 12px; }

.visual-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.visual-choices label > span {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0 10px;
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  cursor: pointer;
}
.visual-choices i { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(115,166,255,.09); color: var(--blue); font-style: normal; }
.visual-choices strong { align-self: end; font-size: 13px; }
.visual-choices small { align-self: start; color: var(--muted); font-size: 10px; }
.visual-choices input:checked + span { border-color: rgba(85,223,235,.4); background: rgba(85,223,235,.07); box-shadow: var(--glow); }

.builder-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.builder-footer p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: white;
  font-weight: 750;
  font-size: 12px;
  transition: transform .15s, filter .15s, border-color .15s, background .15s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.button-primary { background: linear-gradient(120deg, #4088ea, #53c8d2); box-shadow: 0 8px 26px rgba(73, 174, 220, .16); }
.button-secondary { border-color: var(--line); background: rgba(255,255,255,.045); color: var(--muted-strong); }
.button-magic { border-color: rgba(167,139,250,.28); background: rgba(167,139,250,.08); color: #d9caff; }
.button-success { border-color: rgba(92,225,161,.26); background: rgba(92,225,161,.1); color: #a5f5cc; }
.button-danger { border-color: rgba(255,115,138,.25); background: rgba(255,115,138,.08); color: #ffadbb; }
.button-wide { width: 100%; }
.button.loading span::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.text-button { border: 0; background: none; color: var(--cyan); font-weight: 700; }

.song-overview { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.02); }
.song-overview p { margin: 0; color: var(--muted); }
.overview-tags, .tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); background: rgba(255,255,255,.025); font-size: 10px; }

.playlist { display: grid; gap: 9px; margin-top: 20px; }
.empty-state { display: grid; place-items: center; min-height: 160px; padding: 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--muted-strong); }
.playlist-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}
.playlist-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(85,223,235,.08); color: var(--cyan); font-weight: 800; }
.playlist-info { display: grid; }
.playlist-info span { color: var(--muted); font-size: 11px; }
.compatibility { margin-top: 3px; font-size: 10px; }
.compatibility.excellent { color: var(--green); }
.compatibility.transition { color: var(--amber); }
.compatibility.not_recommended { color: var(--red); }
.playlist-actions { display: flex; gap: 5px; }
.playlist-actions button { width: 31px; height: 31px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.03); color: var(--muted); }

.stats-panel {
  position: sticky;
  top: 102px;
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(13, 19, 32, .72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.stats-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.stats-heading h2 { font-size: 20px; }
.stats-heading > span { padding: 3px 7px; border-radius: 6px; background: rgba(92,225,161,.08); color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric-grid article { display: grid; gap: 2px; padding: 11px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.metric-grid span { color: var(--muted); font-size: 9px; }
.metric-grid strong { font-size: 20px; letter-spacing: -.04em; }
.mini-section { padding-top: 14px; border-top: 1px solid var(--line); }
.mini-title { align-items: center; }
.mini-title h3 { margin: 0; font-size: 12px; }
.mini-title span { color: var(--muted); font-size: 9px; }
.channel-activity { display: grid; gap: 10px; margin-top: 12px; }
.activity-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.activity-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.activity-row > span { color: var(--cyan); font-size: 11px; }
.activity-row small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.smart-note { display: flex; gap: 10px; }
.smart-note .spark { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: rgba(167,139,250,.1); color: var(--violet); }
.smart-note strong { font-size: 11px; }
.smart-note p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.resource-note { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resource-note div { display: grid; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.025); }
.resource-note span { color: var(--muted); font-size: 9px; }

.library-toolbar { display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-box { position: relative; }
.search-box span { position: absolute; left: 13px; top: 9px; color: var(--muted); font-size: 18px; }
.search-box input { padding-left: 40px; }
.library-count { color: var(--muted); font-size: 11px; }
.song-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.song-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(16,23,38,.76); }
.song-card-head { display: flex; justify-content: space-between; gap: 15px; }
.song-card h3 { margin: 0; font-size: 15px; }
.song-card p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; }
.song-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.song-card-actions { display: flex; gap: 6px; }
.song-card-actions button { border: 0; background: none; color: var(--muted-strong); font-size: 11px; }
.language-badge { padding: 4px 7px; border-radius: 7px; background: rgba(115,166,255,.09); color: #a9c9ff; font-size: 9px; font-weight: 800; text-transform: uppercase; }

.history-filters { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; }
.history-filters button { flex: 0 0 auto; min-height: 35px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 11px; }
.history-filters button.active { border-color: rgba(85,223,235,.34); background: rgba(85,223,235,.08); color: white; }
.history-list { display: grid; gap: 10px; }
.history-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(16,23,38,.72); }
.history-card h3 { margin: 0; font-size: 14px; }
.history-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.status-badge { align-self: start; padding: 4px 8px; border-radius: 8px; background: rgba(115,166,255,.1); color: #a9c9ff; font-size: 9px; font-weight: 800; }
.status-badge.saved { color: #d6c6ff; background: rgba(167,139,250,.1); }
.status-badge.done { color: #a9f2cc; background: rgba(92,225,161,.1); }
.status-badge.published { color: #bcefff; background: rgba(85,223,235,.1); }
.status-badge.rejected { color: #ffadbb; background: rgba(255,115,138,.1); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 20px; }
.settings-card h2 { margin: 0; font-size: 17px; }
.channels-list { display: grid; gap: 8px; margin-top: 15px; }
.channel-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; }
.channel-row strong { font-size: 12px; }
.channel-row span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.channel-row a { color: var(--cyan); font-size: 10px; text-decoration: none; }
.inline-form { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-card > .field { margin-top: 14px; }

.results-section { margin-top: 24px; padding: clamp(19px, 3vw, 30px); }
.section-heading { align-items: flex-start; margin-bottom: 16px; }
.section-heading h2 { font-size: 24px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.result-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.02); }
.result-card.wide { grid-column: 1 / -1; }
.result-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.result-card h3 { margin: 0; color: var(--muted-strong); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.result-card p { margin: 0; color: #d8e0ee; white-space: pre-line; }
.copy-button { border: 0; background: none; color: var(--cyan); font-size: 10px; }
.scene-list { display: grid; gap: 8px; }
.scene { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 11px; border-radius: 11px; background: rgba(4,8,16,.35); }
.scene-time { color: var(--cyan); font-weight: 800; font-size: 11px; }
.scene-body { display: grid; gap: 5px; }
.scene-body p, .scene-body small { margin: 0; }
.scene-body small { color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,8,14,.82);
  backdrop-filter: blur(22px);
}
.pin-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line-strong); border-radius: 28px; background: rgba(15,22,36,.94); box-shadow: 0 35px 100px rgba(0,0,0,.55), 0 0 80px rgba(85,223,235,.07); text-align: center; }
.pin-card .brand-mark { margin: 0 auto 17px; width: 54px; height: 54px; border-radius: 17px; }
.pin-card h1 { margin: 5px 0; font-size: 31px; letter-spacing: -.04em; }
.pin-card > p:not(.eyebrow) { margin: 0 auto 20px; max-width: 310px; color: var(--muted); }
.pin-card .field { text-align: left; margin-bottom: 12px; }
.pin-card small { display: block; margin-top: 13px; color: var(--muted); }
.form-message { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 11px; }

.modal { width: min(900px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface-solid); color: var(--text); box-shadow: 0 36px 120px rgba(0,0,0,.68); }
.modal::backdrop { background: rgba(3,5,10,.76); backdrop-filter: blur(10px); }
.modal-card { padding: 24px; overflow: auto; max-height: calc(100vh - 26px); }
.compact-modal { max-width: 720px; margin: auto; }
.modal-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.modal-header h2 { margin: 3px 0 0; }
.modal-intro { color: var(--muted); }
.modal-footer { position: sticky; bottom: -24px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 20px -24px -24px; padding: 15px 24px; border-top: 1px solid var(--line); background: rgba(16,23,38,.96); }
.modal-footer .form-message { margin-right: auto; }
.sections-heading { align-items: center; margin: 24px 0 10px; }
.sections-heading h3 { margin: 0; }
.sections-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.section-editor { display: grid; gap: 10px; }
.section-row { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.section-row-top { display: grid; grid-template-columns: 150px 1fr 90px 90px auto; gap: 8px; align-items: end; }
.section-row textarea { margin-top: 9px; min-height: 100px; }
.section-row-actions { display: flex; gap: 4px; }
.section-row-actions button { width: 30px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.03); color: var(--muted); }
.file-drop { display: grid; place-items: center; min-height: 130px; margin: 15px 0; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: rgba(85,223,235,.025); cursor: pointer; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop > span { color: var(--cyan); font-size: 22px; }
.file-drop small { color: var(--muted); }
.import-report { margin-top: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.import-report.success { border-color: rgba(92,225,161,.25); color: var(--green); }
.import-report.error { border-color: rgba(255,115,138,.25); color: var(--red); white-space: pre-line; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; max-width: 360px; padding: 12px 15px; border: 1px solid rgba(85,223,235,.26); border-radius: 12px; background: #172235; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,115,138,.35); }

@media (max-width: 1120px) {
  .app-layout { grid-template-columns: 1fr; }
  .stats-panel { position: static; grid-template-columns: 1fr 1fr; }
  .stats-heading, .metric-grid { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 66px; padding-inline: 15px; }
  .topbar-center, .health span { display: none; }
  .navigation { padding-inline: 12px; }
  .app-layout { padding: 22px 12px 55px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .button, .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .form-grid, .settings-grid, .song-library, .result-grid { grid-template-columns: 1fr; }
  .field-wide, .result-card.wide { grid-column: auto; }
  .visual-choices { grid-template-columns: 1fr; }
  .fragment-preview { grid-template-columns: 1fr 1fr; }
  .fragment-preview p { grid-column: 1 / -1; }
  .builder-footer { align-items: stretch; flex-direction: column; }
  .builder-footer .button { width: 100%; }
  .stats-panel { grid-template-columns: 1fr; }
  .stats-heading, .metric-grid { grid-column: auto; }
  .library-toolbar { grid-template-columns: 1fr 120px; }
  .library-count { grid-column: 1 / -1; }
  .section-row-top { grid-template-columns: 1fr 1fr; }
  .section-row-top .field:nth-child(2) { grid-column: 1 / -1; }
  .section-row-actions { grid-column: 1 / -1; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .form-message { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
