:root {
  color-scheme: light;
  --page: #edf3f1;
  --paper: #fff;
  --ink: #192c29;
  --muted: #526763;
  --border: #cfdcd8;
  --green: #066451;
  --green-dark: #064c3f;
  --mint: #94f0d2;
  --deck: #162d2b;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 79% 3%, #d4ebe2 0%, transparent 40rem), var(--page);
  line-height: 1.55;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-dark); text-underline-offset: .19em; }
button, input { color: inherit; font: inherit; }
button, label[for="file"], input[type="range"] { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
:focus-visible { outline: 3px solid #208875; outline-offset: 3px; }
.width { width: min(100% - 2.75rem, 66rem); margin-inline: auto; }
.top { border-bottom: 1px solid #c8dcd4; }
.top-line { min-height: 4.1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
}
.brand-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: .58rem;
  background: #16453b;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .13rem;
}
.brand-icon i {
  width: .135rem;
  height: .4rem;
  border-radius: 1rem;
  background: var(--mint);
}
.brand-icon i:nth-child(2), .brand-icon i:nth-child(4) { height: .72rem; }
.brand-icon i:nth-child(3) { height: 1rem; }
.top-link { color: #304d48; font-weight: 670; text-decoration: none; font-size: .92rem; }
.top-link:hover { text-decoration: underline; }
.hero { padding: clamp(2.15rem, 6vw, 4.45rem) 0 clamp(1.4rem, 3.6vw, 2.3rem); }
h1 {
  font-size: clamp(2.7rem, 7.1vw, 5.45rem);
  line-height: 1.02;
  letter-spacing: -.065em;
  font-weight: 770;
}
h1 span { color: var(--green); }
.hero p { max-width: 41rem; margin-top: .85rem; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.11rem); }

.editor { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 14px 34px #163c2e12; padding: clamp(.9rem, 2.7vw, 1.45rem); }
.load-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem;
  padding: .82rem .85rem;
  border: 1px dashed #9cb9ae;
  border-radius: .65rem;
  background: #f8fbf9;
}
.load-zone:focus-within, .load-zone.drag { outline: 3px solid #208875; outline-offset: 2px; }
.source-heading { min-width: 0; max-width: 100%; }
.source-heading h2 { font-size: .84rem; font-weight: 730; color: var(--muted); }
#file-name { font-size: 1.12rem; font-weight: 760; overflow-wrap: anywhere; }
.secondary-text { font-size: .89rem; color: var(--muted); }
.source-actions { display: flex; flex-wrap: wrap; gap: .52rem; align-items: center; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  min-height: 2.85rem;
  padding: .45rem .9rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-weight: 720;
  font-size: .95rem;
  line-height: 1.2;
  text-align: center;
}
.choose { color: white; background: var(--green); }
.choose:hover { background: var(--green-dark); }
.source-actions:has(input:disabled) .choose { cursor: default; background: #d5e2dd; color: #4a655a; }
.demo { border-color: var(--border); background: #fff; color: var(--green-dark); }
.demo:hover:not(:disabled) { background: #e5f2ed; }
.demo:disabled { color: #647871; }
.load-status, .problem, #export-status { margin-top: .6rem; }
.problem {
  border-radius: .5rem;
  padding: .48rem .65rem;
  background: #fff0ed;
  color: #8b3428;
  border: 1px solid #edc1b8;
  font-size: .91rem;
}
.timeline {
  border-radius: .75rem;
  padding: .9rem .95rem;
  margin-top: .85rem;
  color: #e9f7f3;
  background: var(--deck);
}
.timeline-title, .scale, .transport {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
}
.timeline-title h3 { font-size: .91rem; font-weight: 690; }
#clip-timing { color: var(--mint); font: .92rem var(--mono); font-variant-numeric: tabular-nums; }
.wave-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(6.3rem, 15vw, 9rem);
  margin-top: .55rem;
  border: 1px solid #46645d;
  border-radius: .48rem;
  background: #102421;
}
.wave-stage.loaded { cursor: crosshair; }
#wave { display: block; width: 100%; height: 100%; }
#no-wave {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: .5rem;
  text-align: center;
  color: #c4d9d3;
  font-size: .92rem;
}
.wave-selection {
  position: absolute;
  inset-block: 0;
  pointer-events: none;
  border-inline: 2px solid #adf5dc;
  background: #83eeca15;
  box-shadow: 0 0 0 100rem #0a15177f;
}
.wave-selection::before, .wave-selection::after {
  content: "";
  position: absolute;
  width: .24rem;
  height: 1.15rem;
  top: calc(50% - .575rem);
  border-radius: .2rem;
  background: #95e9cc;
}
.wave-selection::before { left: .12rem; }
.wave-selection::after { right: .12rem; }
.playhead {
  position: absolute;
  inset-block: 0;
  pointer-events: none;
  border-left: 2px solid #fff2c1;
}
.scale {
  margin-top: .38rem;
  color: #bfd5cf;
  font: .79rem var(--mono);
}
.transport { margin-top: .7rem; gap: .85rem; }
.listen { flex: 0 0 auto; background: var(--mint); border-color: var(--mint); color: #143e35; }
.listen:hover:not(:disabled) { background: #bef8e5; }
.listen:disabled { background: #284440; border-color: #4b6762; color: #d0dedb; }
.play-icon {
  width: 0;
  height: 0;
  border-top: .35rem solid transparent;
  border-bottom: .35rem solid transparent;
  border-left: .57rem solid currentColor;
}
.listen.playing .play-icon {
  width: .62rem;
  height: .74rem;
  border: 0;
  border-inline: .19rem solid currentColor;
}
#seek { min-width: 0; width: 100%; margin: 0; height: 2rem; accent-color: var(--mint); }
#seek:disabled { opacity: .66; }
.trim-form {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(12rem, .9fr);
  gap: .72rem;
  margin-top: .95rem;
  align-items: start;
}
.trim-field { min-width: 0; }
.trim-label { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem; margin: 0 0 .25rem; }
.trim-label label { font-weight: 740; }
.text-button {
  border: 0;
  padding: .1rem 0;
  background: transparent;
  color: var(--green-dark);
  font-size: .875rem;
  font-weight: 680;
  text-underline-offset: .16em;
}
.text-button:disabled { color: #63736e; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.number-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: #f9fbfa;
  border-radius: .54rem;
}
.number-field:has(input[aria-invalid="true"]) { border-color: #ae6759; }
.number-field input {
  min-width: 0;
  width: 100%;
  min-height: 2.8rem;
  font: .98rem var(--mono);
  padding: .43rem .6rem;
  border-radius: .54rem;
  border: 0;
  background: transparent;
}
.number-field input:disabled { opacity: .76; }
.number-field span { color: var(--muted); font-size: .87rem; padding-right: .65rem; }
.download-box { padding-top: 1.8rem; }
.download { width: 100%; background: var(--green); color: #fff; }
.download:hover:not(:disabled) { background: var(--green-dark); }
.download:disabled { color: #536960; background: #e3ece8; }
#export-info { text-align: center; margin-top: .28rem; }
.editor-foot { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; margin-top: .55rem; }
#reset { flex-shrink: 0; }

.guide { margin: 2.15rem 0 2.3rem; scroll-margin: 1rem; }
.guide h2 { font-size: 1.45rem; letter-spacing: -.03em; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .7rem; }
.guide article { border-top: 2px solid #a5c9bc; padding-top: .66rem; }
.guide h3 { font-size: 1rem; margin-bottom: .32rem; }
.guide p { color: var(--muted); }
.guide a { display: inline-block; margin-top: .4rem; font-size: .91rem; font-weight: 680; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; border-top: 1px solid var(--border); padding: .8rem 0 1.4rem; color: var(--muted); font-size: .88rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 42rem) {
  .trim-form { grid-template-columns: 1fr 1fr; }
  .download-box { grid-column: 1 / -1; padding-top: 0; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 26rem) {
  .width { width: calc(100% - 1.4rem); }
  .timeline { padding-inline: .68rem; }
  .trim-label { flex-wrap: wrap; }
  .number-field span { padding-right: .38rem; font-size: .8rem; }
  .number-field input { padding-inline: .39rem; }
}
