@charset "UTF-8";
#peak-label[data-clipping="true"] { color: #ff9388; }
.recovery-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

:root {
  color-scheme: dark;
  --bg: #101412;
  --surface: #191e1b;
  --surface-raised: #1e2420;
  --field: #141916;
  --wave: #121a16;
  --line: #333c34;
  --line-subtle: #2a322c;
  --text: #f2f5ee;
  --muted: #aeb9ad;
  --dim: #899588;
  --mint: #c7f66f;
  --mint-hover: #dbffa0;
  --ink: #172012;
  --danger: #ff917f;
  --ui-font: "Aptos", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

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

.site-header {
  border-bottom: 1px solid var(--line-subtle);
  background: #121613;
}

.header-inner, .workspace {
  width: min(calc(100% - 88px), 1296px);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--mint);
  text-decoration: none;
}

.brand-mark { flex: none; }

.brand-wordmark {
  color: var(--text);
  font-size: 1.43rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.brand-wordmark span { font-weight: 450; color: var(--muted); }

.workspace { padding-block: 40px 50px; }

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 19px;
}

h1, h2, p, dl, dd { margin: 0; }

h1 {
  font-size: clamp(2.375rem, 4vw, 3.9rem);
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.075em;
}

.name-field {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.name-field input { width: clamp(156px, 22vw, 254px); }

input[type="text"], select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  min-height: 40px;
  padding: 8px 11px;
}

input[type="text"]::placeholder { color: var(--dim); }

select {
  width: 100%;
  min-width: 0;
  appearance: none;
  padding-right: 37px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 315px);
  align-items: start;
  gap: 17px;
}

.studio, .panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  box-shadow: 0 16px 48px #080c0a46;
}

.studio {
  display: grid;
  min-width: 0;
  padding: 22px;
}

.transport, .clock, .controls, .wave-bar, .zoom-controls,
.edit-strip, .edit-actions, .gain-control, .export-strip, .export-actions {
  display: flex;
  align-items: center;
}

.transport {
  min-height: 89px;
  gap: 18px;
  justify-content: space-between;
  padding: 0 0 20px;
}

.clock {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

#state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.4;
}

#state::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
}

body[data-state="recording"] #state::before,
body.is-recording #state::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px #ff917f20;
}

#elapsed {
  font-family: var(--mono);
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  letter-spacing: -0.08em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.controls { gap: 8px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  min-height: 39px;
  padding: 7px 13px;
  font-size: 0.875rem;
  font-weight: 620;
  line-height: 1.2;
  white-space: nowrap;
  touch-action: manipulation;
}

.button:hover:not(:disabled) { background: #29332a; border-color: #536652; }
.button:disabled { color: var(--dim); opacity: 0.55; cursor: default; }

.button-primary {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--ink);
  font-weight: 760;
}

.button-primary:hover:not(:disabled) { background: var(--mint-hover); border-color: var(--mint-hover); }
.button-primary:disabled { border-color: var(--line); background: var(--surface-raised); }

#record, #stop {
  min-height: 46px;
  padding-inline: clamp(12px, 2vw, 22px);
  font-size: 0.95rem;
}

#record::before, #stop::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: currentColor;
}

#record::before { border-radius: 50%; }

#stop::before { border-radius: 1px; }

#stop:enabled { color: var(--danger); }

.wave-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--wave);
  min-width: 0;
}

.wave-bar, .wave-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 7px 12px;
}

.wave-bar {
  border-bottom: 1px solid var(--line-subtle);
  background: #181f19;
}

.wave-bar h2 {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 620;
}

.zoom-controls { gap: 4px; }

.button-compact {
  min-height: 30px;
  min-width: 33px;
  padding: 3px 7px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.zoom-icon { font-size: 1.15rem; font-weight: 500; }

#waveform {
  display: block;
  width: 100%;
  height: 288px;
  touch-action: none;
  cursor: crosshair;
  background:
    linear-gradient(transparent calc(50% - 0.5px), #687e6366 50%, transparent calc(50% + 0.5px)),
    linear-gradient(90deg, #70816b1a 1px, transparent 1px),
    linear-gradient(#70816b13 1px, transparent 1px),
    var(--wave);
  background-size: 100% 100%, 8.333% 100%, 100% 25%, auto;
}

#waveform:focus-visible { outline-offset: -3px; }

.wave-footer {
  border-top: 1px solid var(--line-subtle);
  background: #181f19;
  color: var(--dim);
  font-size: 0.8125rem;
}

#selection-text { color: var(--muted); }

.edit-strip {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
}

.edit-actions, .export-actions { gap: 6px; flex-wrap: wrap; }

.button-quiet { background: transparent; }

.gain-control { gap: 8px; min-width: 0; }

.gain-control label {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.875rem;
}

#gain-label, #peak-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: nowrap;
}

#gain-label { min-width: 46px; text-align: end; }

input[type="range"], input[type="checkbox"] {
  accent-color: var(--mint);
}

input[type="range"]:disabled { opacity: 0.48; }
#gain { width: clamp(55px, 6.5vw, 107px); margin: 0; }

.export-strip {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

#recording-detail { color: var(--dim); font-size: 0.8125rem; }
.button-accent-outline { background: #c7f66f0a; border-color: #627a47; color: var(--mint); }
.button-accent-outline:hover:not(:disabled) { color: var(--mint-hover); }

.sidebar { display: grid; gap: 12px; }

.panel { min-width: 0; padding: 17px; }

.panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 680;
  margin-bottom: 15px;
}

.panel h2 svg { flex: none; color: var(--mint); }

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.button-link {
  min-height: 33px;
  margin-top: 4px;
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: var(--mint);
  text-align: left;
}

.button-link:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
  color: var(--mint-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.signal { margin-top: 12px; }

.signal-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 4px;
}

#meter {
  width: 100%;
  height: 10px;
  display: block;
  accent-color: var(--mint);
  appearance: none;
}

#meter::-webkit-meter-bar {
  background: #111612;
  border: 1px solid var(--line);
  border-radius: 3px;
}

#meter::-webkit-meter-optimum-value,
#meter::-webkit-meter-suboptimum-value { background: var(--mint); }
#meter::-webkit-meter-even-less-good-value { background: var(--danger); }
#meter::-moz-meter-bar { background: var(--mint); }

.monitor {
  display: grid;
  grid-template-columns: auto minmax(45px, 1fr);
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

#monitor {
  display: grid;
  appearance: none;
  width: 30px;
  height: 17px;
  margin: 0;
  place-items: center start;
  border: 1px solid #566455;
  border-radius: 999px;
  background: #121713;
  padding: 2px;
  cursor: pointer;
}

#monitor::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--muted);
  border-radius: 50%;
}

#monitor:checked { background: var(--mint); border-color: var(--mint); }
#monitor:checked::before { transform: translateX(13px); background: var(--ink); }
#monitor-volume { width: 100%; margin: 0; }
#monitor-note { grid-column: 1 / -1; }

#monitor-note, .destination-description {
  color: var(--dim);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.destination-description {
  min-height: 2.9em;
  overflow-wrap: anywhere;
}

.save-status {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line-subtle);
  font-size: 0.875rem;
}

.save-status div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.save-status dt { color: var(--muted); flex-shrink: 0; }
.save-status dd { color: var(--text); text-align: end; min-width: 0; overflow-wrap: anywhere; }

#notice:empty, #recoveries:empty { display: none; }

#notice {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

#notice[data-type="error"], #notice.error { color: var(--danger); }

.recoveries {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.recoveries h2 { font-size: 1rem; margin-bottom: 8px; }
.recoveries ul { margin: 0; padding: 0; list-style: none; }
.recoveries li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recoveries li + li { margin-top: 8px; }
.recoveries button { cursor: pointer; }

dialog {
  width: min(calc(100vw - 28px), 454px);
  padding: 21px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}

dialog::backdrop { background: #070b09c9; backdrop-filter: blur(3px); }
dialog h2 { margin-bottom: 8px; font-size: 1.25rem; }
dialog p { margin-bottom: 14px; color: var(--muted); }
dialog input[type="text"] { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .header-inner, .workspace { width: calc(100% - 42px); }
  .workspace { padding-top: 32px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 277px; gap: 12px; }
  .studio { padding: 16px; }
}

@media (max-width: 770px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { min-height: 62px; }
  .workspace { padding-block: 23px 34px; }
  #waveform { height: 240px; }
}

@media (max-width: 490px) {
  .header-inner, .workspace { width: calc(100% - 24px); }
  .workspace-heading { align-items: start; flex-direction: column; gap: 12px; padding-bottom: 13px; }
  .name-field { width: 100%; }
  .name-field input { width: 100%; min-width: 0; }
  .studio { padding: 12px; }
  .transport { min-height: 78px; padding-bottom: 13px; gap: 8px; }
  #elapsed { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  #record, #stop { min-height: 40px; padding-inline: 9px; }
  .controls { gap: 5px; }
  #record::before, #stop::before { width: 7px; height: 7px; }
  #waveform { height: 220px; }
  .wave-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .gain-control { max-width: 100%; }
  #gain { flex: 1; min-width: 50px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (forced-colors: active) {
  #monitor { appearance: auto; width: auto; height: auto; }
  #monitor::before { display: none; }
}
