:root {
  color-scheme: dark;
  --orange: #fe5000;
  --orange-soft: #ff7a3d;
  --ink: #0c0b0a;
  --surface: #171513;
  --surface-raised: #211e1b;
  --line: #39332d;
  --paper: #f7f0e6;
  --muted: #b9afa3;
  --good: #8fe09a;
  --danger: #ff7470;
  --focus: #ffb18d;
  --radius: 14px;
  font-family: "Arial Nova", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 240px;
  height: 282px;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

button,
input,
select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
.wheel-focus {
  outline: none !important;
}

.wheel-focus {
  filter: brightness(1.10) drop-shadow(0 0 2px rgba(254, 80, 0, .70));
}

select[data-wheel-editing="true"] {
  color: #241007 !important;
  background: var(--orange) !important;
}

[hidden] { display: none !important; }

.field {
  position: relative;
  width: 240px;
  height: 282px;
  overflow: hidden;
  padding: 7px 8px 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(254, 80, 0, .07), transparent 38%),
    var(--ink);
}

.topbar {
  height: 36px;
  display: grid;
  grid-template-columns: auto 1fr 44px;
  align-items: center;
  gap: 5px;
}

.wordmark,
.icon-button,
.close-button,
.back-button,
.save-button {
  border: 0;
  color: inherit;
  background: transparent;
}

.wordmark {
  min-width: 55px;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.signal-mark {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5px;
  border-radius: 50%;
  background: var(--orange);
}

.signal-mark i {
  width: 1.5px;
  height: 4px;
  border-radius: 1px;
  background: #160801;
}

.signal-mark i:nth-child(2) { height: 7px; }

.top-status {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
}

.top-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(143, 224, 154, .11);
}

.field[data-state="recording"] .status-dot,
.field[data-state="saving"] .status-dot {
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(254, 80, 0, .18);
}

.field[data-state="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 116, 112, .16);
}

.icon-button {
  width: 44px;
  height: 44px;
  margin-right: -7px;
  padding: 12px;
  border-radius: 10px;
}

.icon-button svg,
.round-action svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen {
  height: 231px;
  min-height: 0;
}

.recorder-screen {
  display: grid;
  grid-template-rows: 54px 57px 16px 77px 20px;
  align-items: center;
}

.recorder-readout {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
}

.state-label {
  color: var(--orange-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.timer {
  margin-top: -1px;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  line-height: 1;
  font-weight: 690;
  letter-spacing: -.04em;
}

.level {
  position: absolute;
  right: 1px;
  bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.waveform {
  width: 224px;
  height: 56px;
  display: block;
}

.live-wave {
  border-radius: 12px 12px 5px 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

.record-actions {
  display: grid;
  grid-template-columns: 44px 72px 44px;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.round-action {
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 50%;
  color: var(--paper);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--line);
}

.round-action:disabled {
  color: #655d55;
  background: #151311;
  box-shadow: inset 0 0 0 1px #292521;
}

.pause-icon { display: none; }
.round-action.is-playing .play-icon { display: none; }
.round-action.is-playing .pause-icon { display: block; }

.record-button {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid #44372f;
  border-radius: 50%;
  color: var(--paper);
  background: #13110f;
  box-shadow: inset 0 0 0 5px #211b17;
  transition: transform 180ms cubic-bezier(.2, .9, .2, 1), box-shadow 180ms ease, border-color 180ms ease;
  touch-action: none;
}

.record-core {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--orange);
  transition: inset 160ms cubic-bezier(.2, .9, .2, 1), border-radius 160ms ease;
}

.record-copy {
  position: relative;
  z-index: 1;
  color: #1a0801;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.field[data-state="recording"] .record-button {
  transform: scale(.95);
  border-color: var(--orange-soft);
  box-shadow: 0 0 0 4px rgba(254, 80, 0, .12), inset 0 0 0 5px #24150f;
}

.field[data-state="recording"] .record-core {
  inset: 20px;
  border-radius: 7px;
}

.field[data-state="saving"] .record-core { opacity: .55; }

.recorder-footer {
  align-self: end;
  display: flex;
  justify-content: space-between;
  align-items: end;
  color: var(--muted);
  font-size: 9px;
}

.section-heading,
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.section-heading { padding: 8px 2px 12px; }
.compact-heading { padding: 3px 1px 7px; }

.kicker {
  display: block;
  margin-bottom: 1px;
  color: var(--orange-soft);
  font-size: 9px;
  font-weight: 680;
}

h1,
h2,
p { margin: 0; }

h1 {
  font-size: 20px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: -.035em;
}

.close-button,
.back-button {
  width: 44px;
  height: 44px;
  margin: -7px -8px 0 0;
  color: var(--muted);
  font-size: 24px;
}

.deck-list { display: grid; gap: 7px; }

.deck-row {
  min-height: 70px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 38px 1fr 12px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius) var(--radius) 5px var(--radius);
  color: var(--paper);
  text-align: left;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.deck-row:first-child { background: var(--orange); color: #1a0801; }
.deck-number { font-size: 21px; font-weight: 740; font-variant-numeric: tabular-nums; }
.deck-icon { font-size: 27px; }
.deck-row strong { display: block; font-size: 14px; }
.deck-row small { display: block; margin-top: 2px; color: currentColor; opacity: .72; font-size: 10px; }
.deck-row > span:last-child { font-size: 24px; opacity: .7; }
.hardware-note { margin-top: 14px; color: var(--muted); text-align: center; font-size: 10px; }

.library-screen {
  position: relative;
  display: grid;
  grid-template-rows: 43px minmax(0, 1fr) 45px;
}

.sample-list {
  height: auto;
  overflow: auto;
  scrollbar-width: none;
  display: grid;
  align-content: start;
  gap: 4px;
}

.sample-list::-webkit-scrollbar,
.editor-tools::-webkit-scrollbar,
.settings-scroll::-webkit-scrollbar { display: none; }

.sample-row {
  width: 100%;
  min-height: 48px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 11px;
  color: var(--paper);
  text-align: left;
  background: transparent;
}

.sample-row.selected { background: var(--surface-raised); }
.sample-index { color: var(--orange-soft); font-size: 9px; font-variant-numeric: tabular-nums; }
.sample-copy { min-width: 0; }
.sample-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.sample-copy small { color: var(--muted); font-size: 9px; }
.sample-favorite { color: var(--orange-soft); font-size: 13px; }

.empty-library {
  height: auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.empty-library strong { color: var(--paper); font-size: 12px; }
.empty-library small { font-size: 9px; }

.empty-rings {
  position: relative;
  width: 56px;
  height: 38px;
  margin-bottom: 4px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.empty-rings::after {
  content: "";
  position: absolute;
  inset: 7px 12px;
  border: 2px solid var(--orange);
  border-radius: 50%;
}

.library-actions {
  height: 45px;
  display: grid;
  grid-template-columns: 44px 1fr 44px 1fr;
  gap: 5px;
}

.tool-button,
.edit-tool,
.editor-play,
.save-button,
.settings-actions button,
.group-title button {
  border: 0;
  border-radius: 10px;
  color: var(--paper);
  background: var(--surface-raised);
}

.tool-button { min-height: 44px; }
.text-tool { font-size: 10px; font-weight: 700; }
.danger-tool { color: var(--danger); }

.editor-head { height: 44px; align-items: center; }
.editor-head .back-button { margin: 0 0 0 -8px; }
.editor-head h1 { max-width: 115px; overflow: hidden; text-overflow: ellipsis; font-size: 16px; white-space: nowrap; }
.editor-head .kicker { text-align: center; }
.save-button { width: 52px; height: 44px; color: #1a0801; background: var(--orange); font-size: 10px; font-weight: 780; }

.editor-wave-wrap {
  position: relative;
  height: 56px;
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.edit-wave { height: 56px; }

.trim-marker {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--orange);
  box-shadow: 0 0 0 2px rgba(254, 80, 0, .16);
}

.start-marker { left: 0; }
.end-marker { right: 0; }

.parameter-readout {
  height: 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.parameter-readout strong { color: var(--paper); font-size: 15px; font-variant-numeric: tabular-nums; }

.editor-tools {
  height: 45px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px 2px;
}

.edit-tool {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.edit-tool.active {
  color: var(--orange-soft);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px rgba(254, 80, 0, .32);
}

.edit-tool.is-on,
.edit-tool.is-on.active {
  color: #241007;
  background: var(--orange);
  box-shadow: none;
}

.edit-tool.is-on::after {
  content: " ✓";
  font-weight: 900;
}

.editor-play {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  color: var(--paper);
  font-size: 11px;
  font-weight: 720;
}

.settings-screen { position: relative; }
.analysis-screen { position: relative; }
.sticky-heading { height: 43px; background: var(--ink); }
.settings-scroll,
.analysis-scroll { height: 188px; overflow: auto; padding: 1px 1px 12px; scrollbar-width: none; }
.settings-group { padding: 10px 0 11px; border-top: 1px solid var(--line); }
.settings-group:first-child { border-top: 0; }

.settings-group h2 {
  margin: 0 7px 5px;
  color: var(--orange-soft);
  font-size: 10px;
  font-weight: 760;
}

.setting-line {
  width: 100%;
  min-height: 49px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 0;
  color: var(--paper);
  text-align: left;
  background: transparent;
}

.setting-line strong { display: block; font-size: 11px; }
.setting-line small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; }

.setting-line select {
  width: 96px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  color: var(--paper);
  background: var(--surface-raised);
  font-size: 9px;
}

.action-line > span:last-child { color: var(--orange-soft); font-size: 9px; font-weight: 750; }

.toggle-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-line i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #312c27;
  transition: background 140ms ease;
}

.toggle-line i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms cubic-bezier(.2, .9, .2, 1), background 140ms ease;
}

.toggle-line input:checked + i { background: var(--orange); }
.toggle-line input:checked + i::after { transform: translateX(18px); background: #241007; }
.toggle-line:has(input:focus-visible) i { outline: 2px solid var(--focus); outline-offset: 2px; }

.key-setting { display: grid; gap: 4px; padding: 7px 8px; color: var(--muted); font-size: 9px; }
.key-setting input { height: 44px; padding: 0 10px; border: 0; border-radius: 10px; color: var(--paper); background: var(--surface-raised); }
.privacy-copy { padding: 2px 8px 7px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.settings-actions { display: grid; grid-template-columns: 1fr 52px 56px; gap: 5px; padding: 0 8px; }
.settings-actions button { min-height: 44px; font-size: 9px; font-weight: 740; }
.settings-actions button:first-child { color: #1a0801; background: var(--orange); }
.group-title { display: flex; justify-content: space-between; align-items: center; }
.group-title button { width: 58px; min-height: 44px; color: var(--orange-soft); font-size: 8px; }
.diagnostic-list { margin: 0; padding: 0 8px; }
.diagnostic-list div { min-height: 25px; display: flex; justify-content: space-between; align-items: center; font-size: 9px; }
.diagnostic-list dt { color: var(--muted); }
.diagnostic-list dd { margin: 0; font-weight: 700; }
.diagnostic-list dd.pass { color: var(--good); }
.diagnostic-list dd.warn { color: #ffd080; }
.diagnostic-list dd.fail { color: var(--danger); }
.diagnostic-note { padding: 7px 8px 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.version { padding: 9px; color: #786f67; text-align: center; font-size: 8px; }

.analysis-scroll { padding: 7px 3px 14px; }
.analysis-category { display: block; color: var(--orange-soft); font-size: 16px; letter-spacing: -.02em; }
.analysis-description { margin-top: 5px; color: var(--paper); font-size: 11px; line-height: 1.4; }
.analysis-block { margin-top: 13px; }
.analysis-block h2 { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.analysis-block p { color: var(--paper); font-size: 10px; line-height: 1.35; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-list span { padding: 4px 7px; border-radius: 10px; color: #241007; background: var(--orange-soft); font-size: 8px; font-weight: 740; }
.analysis-facts { margin: 12px 0; }
.analysis-facts div { min-height: 28px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); align-items: center; }
.analysis-facts dt { color: var(--muted); font-size: 9px; }
.analysis-facts dd { max-width: 130px; margin: 0; overflow: hidden; color: var(--paper); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.analysis-again { width: 100%; min-height: 44px; border: 0; border-radius: 10px; color: #241007; background: var(--orange); font-size: 10px; font-weight: 760; }

.field-dialog {
  width: 208px;
  margin: auto;
  padding: 15px;
  border: 0;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--line);
}

.field-dialog::backdrop { background: rgba(7, 6, 5, .76); }
.field-dialog form { display: grid; gap: 11px; }
.field-dialog label,
.field-dialog strong { font-size: 13px; }
.field-dialog p { color: var(--muted); font-size: 10px; line-height: 1.4; }
.field-dialog input { width: 100%; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; color: var(--paper); background: var(--ink); }
.field-dialog form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.field-dialog button { min-height: 44px; border: 0; border-radius: 10px; color: var(--paper); background: #312c27; }
.field-dialog .dialog-primary { color: #1a0801; background: var(--orange); font-weight: 750; }
.field-dialog .rabbit-refine { color: var(--orange-soft); background: #2b241f; font-size: 10px; }

.toast {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 10px;
  max-width: 210px;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--paper);
  background: #352f2a;
  box-shadow: inset 0 0 0 1px #50483f;
  transform: translateX(-50%);
  font-size: 9px;
  text-align: center;
}

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


/* Editor interaction feedback */
.edit-tool {
  transition:
    transform 90ms ease,
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.edit-tool:active {
  transform: scale(.94);
}

.edit-tool.is-on,
.edit-tool.is-on.active {
  color: #241007;
  background: var(--orange);
  box-shadow: none;
}
