:root {
  color-scheme: dark;
  --bg: #100e16;
  --panel: #1a1723;
  --line: #3b344b;
  --text: #f7f1fc;
  --soft: #c0b6cc;
  --accent: #e4cafc;
  --warning: #ffcfb0;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { width: min(1120px, 100%); margin: auto; padding: 0 28px 30px; }
.header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 56px 0 30px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: clamp(48px,8vw,94px); line-height: .94; letter-spacing: -.075em; }
h1 span { color: var(--accent); }
.header p { margin: 19px 0 0; color: var(--soft); max-width: 455px; }
.layout { display: grid; grid-template-columns: 285px minmax(0,1fr); gap: 16px; padding-top: 20px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
label { font-size: 13px; color: var(--soft); }
.settings label { display: block; margin: 12px 0 5px; }
input[type=text], input[type=search], textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; padding: 9px 11px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #a99cb8; }
button { font: 600 14px/1.3 "Segoe UI", system-ui, sans-serif; color: var(--text); border: 1px solid transparent; border-radius: 7px; cursor: pointer; padding: 9px 12px; }
button:disabled { cursor: default; opacity: .48; }
.primary { width: 100%; background: var(--accent); color: #21152e; }
.secondary { background: transparent; border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #30263c; }
:focus-visible { outline: 2px solid #f5a38e; outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; padding: 0; cursor: pointer; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.summary { margin: 8px 0; color: var(--accent); font-weight: 600; }
.muted { color: var(--soft); font-size: 13px; margin: 5px 0 10px; }
details { margin-top: 17px; font-size: 13px; color: var(--soft); }
summary { cursor: pointer; }
.list-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
#list-empty { color: var(--soft); margin: 18px 0 4px; }
#clips { margin-top: 12px; max-height: 485px; overflow-y: auto; }
.clip { display: grid; grid-template-columns: 20px minmax(0,1.5fr) minmax(0,1fr) auto; gap: 9px; align-items: end; border-top: 1px solid var(--line); padding: 11px 0; }
.clip label { display: grid; gap: 3px; }
.clip input[type=checkbox] { align-self: end; margin-bottom: 11px; }
.clip input[type=text] { font-size: 13px; padding: 7px; }
.clip button { font-size: 12px; padding: 7px 9px; }
#clear-selection { margin-top: 12px; }
#message { color: var(--accent); min-height: 1.5em; margin: 12px 0; font-size: 14px; }
#message[data-error=true] { color: var(--warning); }
.audition { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.audition audio { width: min(100%, 400px); }
#audition-label { overflow-wrap: anywhere; }
footer { color: var(--soft); margin-top: 16px; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 740px) {
  main { padding: 0 16px 20px; }
  .layout { grid-template-columns: minmax(0,1fr); }
  .library { grid-row: 1; }
  .header { padding: 32px 0 20px; }
}
@media (max-width: 430px) {
  .header, .list-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 14px; }
  .clip { gap: 5px; }
  .clip button { padding: 7px 5px; }
}


.demo-banner { background: var(--accent); color: #21152e; font-size: 14px; padding: 8px 16px; text-align: center; }
.demo-banner a { color: #21152e; font-weight: 600; }
dialog { max-width: min(460px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(16, 14, 22, .75); }
dialog p { color: var(--soft); margin: 10px 0 18px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions a.primary { display: inline-block; width: auto; border-radius: 7px; padding: 9px 12px; font: 600 14px/1.3 "Segoe UI", system-ui, sans-serif; text-decoration: none; }
