:root {
  color-scheme: dark;
  --bg: #07080a;
  --white: #f4f5f9;
  --muted: #a0a7ba;
  --line: #2a2b32;
  --signal: #aeb8ff;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --gutter: clamp(20px, 6vw, 76px);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--white); font: 400 16px/1.55 Inter, system-ui, sans-serif; }
a { color: var(--signal); text-underline-offset: .18em; }
a:hover { color: var(--white); }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.layout { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; z-index: 5; top: 12px; left: var(--gutter); padding: 10px 16px; background: var(--signal); color: var(--bg); transform: translateY(-160%); }
.skip:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.masthead a { text-decoration: none; }
.masthead .brand { margin-right: auto; color: var(--white); font-size: 1.08rem; font-weight: 800; letter-spacing: -.035em; }
.brand span, h1 span { color: var(--signal); }
.masthead nav > a:not(.brand) { font-size: .86rem; }
main { padding-block: clamp(36px, 5.5vw, 68px) 12px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin-bottom: 17px; color: #b5c0ff; font: 500 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .09em; }
h1 { font-size: clamp(52px, 6.6vw, 86px); font-weight: 700; line-height: .97; letter-spacing: -.065em; }
.intro p:not(.eyebrow) { max-width: 49ch; margin-top: 20px; color: #e8eaf1; font-size: clamp(16px, 1.8vw, 20px); letter-spacing: -.025em; line-height: 1.45; }
h2 { font-size: 1.5rem; font-weight: 650; line-height: 1.2; letter-spacing: -.04em; }

button, select { min-height: 44px; padding: 10px 15px; border: 1px solid #3e414e; border-radius: 8px; background: transparent; color: var(--white); font-size: .85rem; cursor: pointer; }
button { font-weight: 550; }
button:hover:not(:disabled), select:hover:not(:disabled) { border-color: #626986; background: #181d2c; }
button:disabled { opacity: .45; cursor: default; }
button.primary { border-color: transparent; border-radius: 100px; background: #e4e7fb; color: #13172b; font-weight: 700; }
button.primary:hover:not(:disabled) { border-color: transparent; background: #fff; }
.intro > button { flex: 0 0 auto; padding-inline: 22px; margin-bottom: 3px; }
.status { min-height: 24px; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.status.error { color: #ffc29b; }
#connection { margin-bottom: 7px; }
details { max-width: 75ch; color: var(--muted); font-size: .81rem; }
summary { width: fit-content; color: var(--white); cursor: pointer; }
details p { margin-top: 10px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 25px 0 18px; }
.local-note { margin-left: auto; color: var(--muted); font: 400 .67rem/1.5 var(--mono); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, 1fr); border: 1px solid #35394b; border-radius: 16px; overflow: hidden; background: #0e1018; }
.browser { min-width: 0; border-right: 1px solid #35394b; }
.tabs { display: flex; align-items: stretch; gap: 0; border-bottom: 1px solid #35394b; }
.tabs button { flex: 1 1 0; min-width: 0; padding: 17px 10px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: .79rem; font-weight: 500; white-space: normal; }
.tabs button:hover:not(:disabled) { color: var(--white); background: #171c2c; }
.tabs button span { margin-left: 5px; font: 400 .66rem/1.4 var(--mono); }
.tabs button.active { background: #191f33; color: var(--white); box-shadow: inset 0 -2px var(--signal); }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 17px 18px; }
.filters input[type=search] { flex: 1 1 200px; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #393d4d; border-radius: 8px; background: #080a10; color: var(--white); font-size: .85rem; }
.filters input::placeholder { color: #858da3; opacity: 1; }
.filters select { flex: 1 1 120px; min-width: 0; max-width: 100%; background: #080a10; font-size: .78rem; }
.filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--signal); }
.catalog-note { padding: 0 18px 14px; color: var(--muted); font: 400 .68rem/1.6 var(--mono); }
.sound-list { height: 400px; overflow: auto; scrollbar-color: #474f6c #0e1018; scrollbar-width: thin; }
.sound-list button { display: flex; align-items: baseline; gap: 12px; width: 100%; min-height: 47px; padding: 11px 18px; border: 0; border-bottom: 1px solid #222633; border-radius: 0; background: transparent; text-align: left; white-space: normal; }
.sound-list button:hover:not(:disabled) { background: #181d2c; }
.sound-list button.selected { background: #232b49; box-shadow: inset 2px 0 var(--signal); }
.sound-list button .number { flex: 0 0 28px; color: #8f99b8; font: 400 .69rem/1.5 var(--mono); }
.sound-list button .name { flex: 1 1 auto; min-width: 0; font-size: .87rem; font-weight: 550; overflow-wrap: anywhere; }
.sound-list button .bank { flex: 0 1 145px; min-width: 0; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .7rem; }
.sound-list button .star { flex: 0 0 auto; color: var(--signal); }
.sound-list button:focus-visible { outline-offset: -4px; }
#empty { padding: 4px 18px 24px; color: var(--muted); font-size: .85rem; }

.inspector { min-width: 0; padding: 26px; align-self: start; }
.selection-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selection-title h2 { min-width: 0; overflow-wrap: anywhere; }
.selection-title button { flex: 0 0 30px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--signal); font-size: 25px; line-height: 1; }
#selected-bank, .muted { color: var(--muted); font-size: .78rem; line-height: 1.6; overflow-wrap: anywhere; }
#selected-bank { margin-top: 8px; }
.preview { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 25px; margin-bottom: 10px; }
.preview select { padding-inline: 9px; font: 400 .78rem/1.5 var(--mono); }
.preview button:first-child { background: #242b46; border-color: #414966; color: var(--white); }
.preview button:first-child:hover:not(:disabled) { background: #333e60; }
.device-actions { display: grid; gap: 10px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.device-actions button { text-align: center; }
.device-actions p { margin-top: 3px; color: var(--muted); font-size: .77rem; line-height: 1.6; overflow-wrap: anywhere; }
.management { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 23px; }
.management button { min-height: 36px; padding: 7px 10px; font-size: .69rem; }
button.danger { color: #ffc29b; }
.device-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.device-footer button { min-height: 39px; font-size: .76rem; }
#message { margin-top: 16px; }

footer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 22px; padding-block: 21px 32px; margin-top: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
footer > :first-child { margin-right: auto; }
footer a { font-size: .76rem; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 28px; overflow: auto; border: 1px solid #555e80; border-radius: 16px; background: #111522; color: var(--white); }
dialog::backdrop { background: #000b; }
dialog p { margin-block: 16px; }
dialog label { display: block; font-size: .84rem; }
dialog select { width: 100%; margin-block: 8px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 26px; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .browser { border-right: 0; border-bottom: 1px solid #35394b; }
  .sound-list { height: 310px; }
  .inspector { padding: 23px; }
  .device-footer { justify-content: flex-start; }
}

@media (max-width: 540px) {
  .masthead nav { min-height: 64px; gap: 18px; }
  .masthead .brand { font-size: 1rem; }
  .masthead nav > a:not(.brand) { font-size: .76rem; }
  .intro { align-items: flex-start; flex-direction: column; gap: 21px; margin-bottom: 17px; }
  h1 { font-size: 56px; }
  .intro p:not(.eyebrow) { margin-top: 16px; }
  .intro > button { margin-bottom: 0; }
  .local-note { width: 100%; margin-left: 0; }
  .toolbar button { padding-inline: 12px; font-size: .76rem; }
  .tabs button { padding: 14px 6px; font-size: .74rem; }
  .tabs button span { display: block; margin: 3px 0 0; font-size: .63rem; }
  .filters { gap: 10px; padding: 14px; }
  .filters input[type=search] { flex-basis: 100%; }
  .sound-list { height: 280px; }
  .sound-list button { gap: 8px; padding-inline: 14px; }
  .sound-list button .bank { max-width: 98px; font-size: .66rem; }
  .sound-list button .number { flex-basis: 25px; font-size: .65rem; }
  .inspector { padding: 21px 18px; }
  .device-footer button { font-size: .72rem; }
  footer { gap: 10px 17px; }
  footer > :first-child { width: 100%; }
  dialog { padding: 23px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, select { transition: background .12s, border-color .12s; }
}

/* Sound and project tools share the White Rabbit page frame. */
.tool-tabs { display: flex; align-items: stretch; gap: 26px; margin: 28px 0 24px; border-bottom: 1px solid var(--line); }
.tool-tabs button { min-height: 48px; padding: 10px 0 13px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: .93rem; }
.tool-tabs button.active, .tool-tabs button[aria-selected="true"], .tool-tabs button[aria-pressed="true"] { color: var(--white); box-shadow: inset 0 -2px var(--signal); }
.tool-tabs button:hover:not(:disabled) { background: transparent; color: var(--white); }
.project-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.project-card { min-width: 0; padding: clamp(20px, 3vw, 28px); border: 1px solid #35394b; border-radius: 16px; background: #0e1018; }
.project-card h2 { margin-bottom: 12px; }
.project-card > p { color: var(--muted); font-size: .85rem; }
.project-card p + p { margin-top: 10px; }
.project-card label { display: block; margin-top: 18px; color: var(--muted); font: 400 .73rem/1.5 var(--mono); }
.project-card input:not([type=checkbox]), .project-card select { width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 12px; border: 1px solid #393d4d; border-radius: 8px; background: #080a10; color: var(--white); font: 400 .84rem/1.5 Inter, system-ui, sans-serif; }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.project-actions button { min-height: 43px; }
.project-summary { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font: 400 .75rem/1.6 var(--mono); }
.project-summary dt { color: var(--muted); }
.project-summary dd { margin: 0; color: var(--white); overflow-wrap: anywhere; }
.project-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.project-status { margin-top: 15px; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.project-status.error { color: #ffc29b; }
@media (max-width: 740px) {
  .project-workspace { grid-template-columns: minmax(0, 1fr); }
}

#page-title { color: var(--white); }
.collection-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px 12px; }
.collection-filters select { width: 100%; min-width: 0; font-size: .76rem; background: #080a10; }
#selected-credit { margin-top: 7px; font-size: .7rem; }
#selected-credit:empty { display: none; }
#project-progress { width: 100%; height: 8px; margin-bottom: 12px; accent-color: var(--signal); }
.project-status { grid-column: 1 / -1; }
@media (max-width: 540px) { .collection-filters { padding-inline: 14px; } }

/* Keep the catalogue and audition controls close to the page title. */
main { padding-block: 32px 12px; }
.intro { margin-bottom: 12px; }
.intro .eyebrow { margin-bottom: 10px; }
h1 { font-size: clamp(44px, 5.4vw, 64px); }
.intro p:not(.eyebrow) { margin-top: 12px; font-size: 18px; }
.tool-tabs { margin-block: 16px; }
.toolbar { margin-block: 18px 14px; }
