:root {
  color-scheme: light;
  --ink: #111412;
  --ink-soft: #252a26;
  --paper: #f3f0e8;
  --paper-deep: #e7e2d6;
  --panel: #fbfaf6;
  --line: #d8d4c9;
  --muted: #6e746c;
  --muted-light: #9ea49c;
  --coral: #ff6b4a;
  --coral-dark: #d94a2b;
  --lime: #c8f05a;
  --blue: #87a7ff;
  --danger: #bc3f30;
  --success: #2e7a50;
  --shadow: 0 24px 70px rgba(17, 20, 18, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(200, 240, 90, 0.18), transparent 24rem),
    radial-gradient(circle at 94% 22%, rgba(255, 107, 74, 0.11), transparent 28rem),
    var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

[hidden] {
  display: none !important;
}

button,
input,
a {
  font: inherit;
}

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

button {
  color: inherit;
}

button:not(:disabled),
input[type="range"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.47;
}

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

::selection {
  color: var(--ink);
  background: var(--lime);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 14px;
  left: 14px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(1480px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(17, 20, 18, 0.13);
}

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

.brand-mark {
  position: relative;
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  overflow: hidden;
  background: var(--ink);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
}

.brand-mark::before {
  width: 18px;
  height: 18px;
  background: var(--coral);
  border-radius: 50%;
  transform: translate(-4px, -4px);
}

.brand-mark::after {
  right: 7px;
  bottom: 7px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--lime);
  border-radius: 4px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.99rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 13px;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(46, 122, 80, 0.1);
}

main {
  padding: 66px 0 84px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: clamp(32px, 7vw, 110px);
  align-items: end;
  margin-bottom: 52px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.1rem, 7.6vw, 7.4rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.86;
}

.intro h1 span {
  color: var(--coral);
}

.intro-copy {
  max-width: 510px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}

.workbench {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(17, 20, 18, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  min-height: 123px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div:first-child {
  position: relative;
  padding-left: 52px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  letter-spacing: -0.045em;
}

.panel-heading .eyebrow {
  margin-bottom: 5px;
}

.step-number {
  position: absolute;
  top: 50%;
  left: 0;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.step-number::after {
  position: absolute;
  top: 50%;
  left: 26px;
  width: 15px;
  height: 1px;
  background: var(--line);
  content: "";
}

.recording-state {
  display: grid;
  min-width: 235px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.recording-state-dot {
  width: 8px;
  height: 8px;
  background: var(--muted-light);
  border-radius: 50%;
}

.recording-state strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.recording-state.is-live .recording-state-dot {
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 107, 74, 0.14);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

.recorder-grid {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(290px, 355px) minmax(0, 1fr);
}

.capture-controls {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border-right: 1px solid var(--line);
}

.control-group + .control-group {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.control-heading,
.control-heading > div,
.subheading-row,
.timeline-heading,
.stage-toolbar,
.stage-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-heading > div {
  justify-content: flex-start;
  gap: 10px;
}

.control-heading h3,
.subheading-row h3,
.timeline-heading h3,
.export-section h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.control-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
}

.permission-pill,
.keep-pill {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permission-pill.is-active,
.keep-pill {
  color: var(--success);
  background: rgba(46, 122, 80, 0.1);
}

.keep-pill.is-removed {
  color: var(--danger);
  background: rgba(188, 63, 48, 0.1);
}

.control-help {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.5;
}

.source-button {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  transition: transform 160ms ease, background 160ms ease;
}

.source-button:hover {
  background: #242824;
  transform: translateY(-1px);
}

.source-button-icon {
  position: relative;
  display: block;
  width: 31px;
  height: 25px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
}

.source-button-icon::after {
  position: absolute;
  bottom: -5px;
  left: 9px;
  width: 12px;
  height: 4px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.75);
  content: "";
}

.source-button strong,
.source-button small {
  display: block;
}

.source-button strong {
  margin-bottom: 4px;
  font-size: 0.77rem;
}

.source-button small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-arrow {
  color: var(--lime);
  font-size: 1.05rem;
}

.toggle-row {
  display: flex;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(216, 212, 201, 0.72);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.toggle-copy strong,
.toggle-copy small {
  display: block;
}

.toggle-copy strong {
  margin-bottom: 2px;
  font-size: 0.77rem;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.toggle-icon {
  position: relative;
  display: block;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.region-icon::after {
  position: absolute;
  inset: 5px;
  border: 1px dashed var(--muted);
  content: "";
}

.camera-icon::before {
  position: absolute;
  top: 7px;
  left: 5px;
  width: 10px;
  height: 9px;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
  content: "";
}

.camera-icon::after {
  position: absolute;
  top: 9px;
  right: 4px;
  border: 4px solid transparent;
  border-right: 0;
  border-left-color: var(--muted);
  content: "";
}

.mic-icon::before {
  position: absolute;
  top: 4px;
  left: 9px;
  width: 6px;
  height: 10px;
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  content: "";
}

.mic-icon::after {
  position: absolute;
  bottom: 4px;
  left: 6px;
  width: 11px;
  height: 8px;
  border-bottom: 1.5px solid var(--muted);
  border-left: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  border-radius: 0 0 7px 7px;
  content: "";
}

.audio-icon::before {
  position: absolute;
  top: 8px;
  left: 5px;
  width: 4px;
  height: 8px;
  background: var(--muted);
  border-radius: 3px;
  box-shadow: 6px -3px 0 var(--muted), 12px -6px 0 var(--muted);
  content: "";
}

.switch {
  position: relative;
  display: block;
  width: 39px;
  height: 23px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #c9cbc5;
  border-radius: 999px;
  transition: background 160ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(17, 20, 18, 0.2);
  content: "";
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--ink);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.region-numbers {
  margin-top: 18px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.capture-actions {
  margin-top: auto;
  padding-top: 25px;
}

.primary-button,
.stop-button,
.download-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  color: #fff;
  background: var(--coral);
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(217, 74, 43, 0.2);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:not(:disabled):hover,
.download-button:hover {
  background: var(--coral-dark);
  box-shadow: 0 14px 30px rgba(217, 74, 43, 0.28);
  transform: translateY(-2px);
}

.record-button,
.stop-button {
  width: 100%;
}

.stop-button {
  background: var(--ink);
  box-shadow: none;
}

.stop-button:hover {
  background: #2b302c;
}

.record-dot {
  width: 11px;
  height: 11px;
  background: #fff;
  border-radius: 50%;
}

.stop-square {
  width: 10px;
  height: 10px;
  background: var(--coral);
  border-radius: 2px;
}

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

kbd {
  display: inline-block;
  padding: 2px 5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.6rem;
}

.capture-stage-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px 25px 18px;
  background: #ece9e1;
}

.stage-toolbar,
.stage-footnote {
  min-height: 34px;
  gap: 16px;
}

.stage-title,
.stage-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-light {
  width: 7px;
  height: 7px;
  background: var(--muted-light);
  border-radius: 50%;
}

.stage-title.is-live .stage-light {
  background: var(--coral);
}

.stage-badges span {
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 20, 18, 0.09);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.58rem;
}

.capture-stage {
  position: relative;
  display: grid;
  min-height: 495px;
  flex: 1;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #151815;
  background-size: 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(17, 20, 18, 0.18);
}

.empty-stage {
  width: min(380px, calc(100% - 40px));
  color: #fff;
  text-align: center;
}

.empty-stage-illustration {
  position: relative;
  width: 132px;
  height: 91px;
  margin: 0 auto 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  box-shadow: 11px 11px 0 -5px rgba(200, 240, 90, 0.22);
}

.empty-window-bar {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 19px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  box-shadow: 25px 0 0 rgba(255, 255, 255, 0.16);
}

.empty-cursor {
  position: absolute;
  right: 31px;
  bottom: 19px;
  width: 20px;
  height: 26px;
  background: var(--coral);
  clip-path: polygon(0 0, 100% 70%, 59% 73%, 43% 100%);
  transform: rotate(-10deg);
}

.empty-stage h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.empty-stage p {
  margin: 0 auto 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.77rem;
  line-height: 1.55;
}

.secondary-button,
.quiet-button,
.text-button {
  border: 0;
  font-weight: 750;
}

.secondary-button {
  min-height: 39px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 10px;
  font-size: 0.74rem;
}

.secondary-button:hover {
  filter: brightness(0.95);
}

.quiet-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.7rem;
}

.quiet-button:hover {
  background: rgba(17, 20, 18, 0.04);
}

.text-button {
  padding: 4px 0;
  color: var(--coral-dark);
  background: transparent;
  font-size: 0.68rem;
}

.source-preview-shell {
  position: relative;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  touch-action: none;
  background: #090a09;
}

.source-preview-shell video,
#recordCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#recordCanvas {
  max-width: 100%;
  max-height: 100%;
}

.selection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 24px;
  min-height: 24px;
  border: 2px solid var(--lime);
  box-shadow: 0 0 0 9999px rgba(5, 7, 5, 0.58), inset 0 0 0 1px rgba(17, 20, 18, 0.45);
  cursor: move;
  touch-action: none;
}

.selection-overlay::before,
.selection-overlay::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.selection-overlay::before {
  top: 33.333%;
  bottom: 33.333%;
  left: -2px;
  right: -2px;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
}

.selection-overlay::after {
  top: -2px;
  bottom: -2px;
  left: 33.333%;
  right: 33.333%;
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  border-right: 1px solid rgba(255, 255, 255, 0.32);
}

.selection-size,
.crop-label {
  position: absolute;
  top: 9px;
  left: 10px;
  z-index: 2;
  padding: 4px 6px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.selection-handle {
  position: absolute;
  z-index: 4;
  width: 16px;
  height: 16px;
  padding: 0;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--lime);
  touch-action: none;
}

.selection-handle.nw { top: -8px; left: -8px; cursor: nwse-resize; }
.selection-handle.ne { top: -8px; right: -8px; cursor: nesw-resize; }
.selection-handle.sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.selection-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }

.recording-overlay {
  position: absolute;
  z-index: 9;
  top: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(9, 11, 9, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 0.63rem;
}

.recording-overlay span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--coral);
  font-weight: 900;
}

.recording-overlay i {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.recording-overlay strong {
  font-size: 0.63rem;
}

.stage-footnote {
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.67rem;
}

.stage-footnote p {
  margin: 0;
}

.import-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 26px 0 72px;
  padding: 20px 26px;
  border: 1px dashed #b9b6ac;
  border-radius: var(--radius-lg);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.import-strip.is-over {
  background: rgba(200, 240, 90, 0.16);
  border-color: var(--success);
  transform: translateY(-2px);
}

.import-strip > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.import-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  font-size: 1.3rem;
}

.import-strip strong,
.import-strip div span {
  display: block;
}

.import-strip strong {
  margin-bottom: 3px;
  font-size: 0.85rem;
}

.import-strip div span:not(.import-icon) {
  color: var(--muted);
  font-size: 0.72rem;
}

.editor-workbench {
  scroll-margin-top: 24px;
}

.editor-heading {
  background: var(--ink);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.13);
}

.editor-heading .eyebrow {
  color: rgba(255, 255, 255, 0.45);
}

.file-chip {
  display: flex;
  max-width: 340px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.file-chip-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 8px;
  font-size: 0.65rem;
}

.file-chip strong,
.file-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip strong {
  max-width: 250px;
  font-size: 0.74rem;
}

.file-chip small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.62rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  background: #1b1e1b;
}

.preview-column {
  min-width: 0;
  padding: 28px;
}

.editor-preview-wrap {
  position: relative;
  display: grid;
  width: 100%;
  max-height: min(62vh, 610px);
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, #232723 25%, transparent 25%),
    linear-gradient(-45deg, #232723 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #232723 75%),
    linear-gradient(-45deg, transparent 75%, #232723 75%),
    #1b1e1b;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

.editor-preview-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(62vh, 610px);
  object-fit: contain;
}

.crop-shade {
  position: absolute;
  z-index: 3;
  background: rgba(5, 7, 5, 0.7);
  pointer-events: none;
}

.crop-selection {
  z-index: 4;
  box-shadow: inset 0 0 0 1px rgba(17, 20, 18, 0.45);
}

.crop-label {
  color: var(--ink);
  font-size: 0.52rem;
}

.preview-loading {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.66);
  background: #171a17;
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-loading span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.transport {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 12px 4px 0;
  color: #fff;
}

.round-button,
.play-button {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.round-button {
  width: 36px;
  height: 36px;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.play-button {
  width: 45px;
  height: 45px;
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
  font-size: 0.75rem;
}

.round-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.transport-time {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.transport-time strong {
  color: #fff;
  font-weight: 650;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
}

.volume-control input {
  width: 86px;
  accent-color: var(--lime);
}

.editor-inspector {
  background: var(--panel);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.inspector-section {
  padding: 27px 25px;
  border-bottom: 1px solid var(--line);
}

.inspector-section .eyebrow,
.timeline-heading .eyebrow,
.export-section .eyebrow {
  margin-bottom: 5px;
}

.number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.number-grid label,
.time-inputs label {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 750;
}

.number-grid label > span {
  display: flex;
  height: 40px;
  align-items: center;
  margin-top: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.number-grid input,
.time-inputs input,
.speed-input-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.number-grid input {
  height: 100%;
  padding: 0 4px 0 10px;
}

.number-grid small {
  padding-right: 8px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.compact-number-grid {
  gap: 7px;
  margin-top: 12px;
}

.compact-number-grid label > span {
  height: 34px;
  background: var(--panel);
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.time-inputs label > div {
  display: flex;
  height: 41px;
  align-items: center;
  margin-top: 6px;
  padding: 0 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.time-inputs span,
.speed-input-wrap span {
  color: var(--muted-light);
  font-size: 0.66rem;
}

.speed-control {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.speed-control strong,
.speed-control small {
  display: block;
}

.speed-control strong {
  font-size: 0.74rem;
}

.speed-control small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.speed-input-wrap {
  display: flex;
  width: 74px;
  height: 38px;
  align-items: center;
  padding: 0 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.edit-button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-top: 16px;
}

.edit-button-grid button,
.remove-button {
  min-height: 42px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.64rem;
  font-weight: 750;
}

.edit-button-grid button:hover {
  background: var(--paper);
}

.remove-button {
  width: 100%;
  margin-top: 9px;
  color: var(--danger);
  border-color: rgba(188, 63, 48, 0.23);
}

.remove-button.is-restore {
  color: var(--success);
  border-color: rgba(46, 122, 80, 0.25);
}

.timeline-section {
  padding: 30px 34px 32px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.timeline-actions {
  display: flex;
  gap: 7px;
}

.timeline-ruler {
  position: relative;
  height: 30px;
  margin-top: 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.56rem;
}

.ruler-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 7px;
  background: var(--line);
}

.ruler-tick span {
  position: absolute;
  bottom: 10px;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ruler-tick:first-child span { transform: none; }

.timeline-track {
  position: relative;
  height: 74px;
  margin-top: 10px;
  overflow: visible;
  background: #e9e5db;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: crosshair;
  touch-action: none;
}

.segment-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px;
}

.timeline-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2px;
  overflow: hidden;
  color: var(--ink);
  background: var(--lime);
  border-right: 2px solid var(--panel);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
  transition: filter 120ms ease;
}

.timeline-segment:nth-child(even) {
  background: #b9dfa1;
}

.timeline-segment:hover,
.timeline-segment.is-selected {
  filter: saturate(1.2) brightness(0.93);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.timeline-segment.is-removed {
  color: #7b746b;
  background:
    repeating-linear-gradient(135deg, rgba(17, 20, 18, 0.08) 0 6px, transparent 6px 12px),
    #d7d2c7;
  text-decoration: line-through;
}

.playhead {
  position: absolute;
  z-index: 7;
  top: -10px;
  bottom: -10px;
  left: 0;
  width: 2px;
  background: var(--coral);
  pointer-events: none;
  transform: translateX(-1px);
}

.playhead span {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 11px;
  height: 11px;
  background: var(--coral);
  border-radius: 3px 3px 7px 7px;
  transform: translate(-50%, -50%);
}

.timeline-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.segment-list {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.segment-card {
  display: grid;
  min-width: 166px;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 10px 11px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.segment-card:hover,
.segment-card.is-selected {
  border-color: var(--ink);
}

.segment-card strong,
.segment-card small {
  display: block;
}

.segment-card strong {
  margin-bottom: 3px;
  font-size: 0.68rem;
}

.segment-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.segment-card em {
  padding: 4px 6px;
  color: var(--success);
  background: rgba(46, 122, 80, 0.1);
  border-radius: 999px;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 850;
}

.segment-card.is-removed {
  opacity: 0.62;
}

.segment-card.is-removed em {
  color: var(--danger);
  background: rgba(188, 63, 48, 0.1);
}

.export-section {
  display: flex;
  min-height: 145px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 34px;
  background: var(--lime);
}

.export-section h3 {
  font-size: 1.25rem;
}

.export-section p:not(.eyebrow) {
  max-width: 600px;
  margin: 8px 0 0;
  color: rgba(17, 20, 18, 0.66);
  font-size: 0.74rem;
}

.export-actions {
  display: grid;
  min-width: min(100%, 330px);
  gap: 10px;
}

.original-download-button {
  display: grid;
  min-height: 57px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(17, 20, 18, 0.17);
  border-radius: 12px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.original-download-button:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(17, 20, 18, 0.42);
  transform: translateY(-1px);
}

.original-download-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--lime);
  background: var(--ink);
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 900;
}

.original-download-button strong,
.original-download-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.original-download-button strong {
  font-size: 0.72rem;
}

.original-download-button small {
  margin-top: 3px;
  color: rgba(17, 20, 18, 0.58);
  font-size: 0.59rem;
  font-weight: 650;
}

.original-download-arrow {
  color: var(--coral-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.export-button,
.download-button {
  min-width: 210px;
  color: #fff;
  background: var(--ink);
  box-shadow: none;
}

.export-button:not(:disabled):hover,
.download-button:hover {
  background: #2b302c;
  box-shadow: none;
}

.download-button {
  background: var(--success);
}

.export-status {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(17, 20, 18, 0.11);
  border-radius: 10px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  background: rgba(17, 20, 18, 0.12);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  border-radius: inherit;
  transition: width 250ms ease;
}

.export-status > div:last-child {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 7px;
  font-size: 0.64rem;
}

.export-status strong {
  font-family: var(--mono);
}

.site-footer {
  display: grid;
  min-height: 105px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  border-top: 1px solid rgba(17, 20, 18, 0.13);
  font-size: 0.68rem;
}

.site-footer > span {
  color: var(--ink);
  font-weight: 850;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  justify-self: end;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(380px, calc(100% - 40px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: #fff;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 4px solid var(--lime);
  border-radius: 11px;
  box-shadow: 0 15px 36px rgba(17, 20, 18, 0.25);
  font-size: 0.74rem;
  line-height: 1.45;
  animation: toast-in 220ms ease both;
}

.toast.is-error {
  border-left-color: var(--coral);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1100px) {
  .recorder-grid {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .capture-stage {
    min-height: 420px;
  }

  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .preview-column {
    padding: 22px;
  }
}

@media (max-width: 850px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 30px, 720px);
  }

  main {
    padding-top: 46px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .intro h1 {
    font-size: clamp(3rem, 14vw, 6rem);
  }

  .intro-copy {
    max-width: 620px;
  }

  .recorder-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .capture-controls,
  .editor-inspector {
    border-right: 0;
    border-left: 0;
  }

  .capture-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }

  .control-group + .control-group {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .region-numbers,
  .capture-actions {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .capture-stage-column {
    min-height: 560px;
    border-top: 1px solid var(--line);
  }

  .editor-inspector {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .inspector-section {
    border-right: 1px solid var(--line);
  }

  .segment-inspector {
    border-right: 0;
  }
}

@media (max-width: 600px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 22px);
  }

  .site-header {
    min-height: 74px;
  }

  .privacy-note {
    display: none;
  }

  main {
    padding: 38px 0 60px;
  }

  .intro {
    margin-bottom: 34px;
  }

  .intro h1 {
    font-size: clamp(2.8rem, 16vw, 4.8rem);
  }

  .workbench {
    border-radius: 21px;
  }

  .panel-heading,
  .editor-heading {
    min-height: 104px;
    align-items: flex-start;
    padding: 23px 19px;
  }

  .recording-state {
    min-width: auto;
    grid-template-columns: auto auto;
  }

  .recording-state #recordingStateText {
    display: none;
  }

  .capture-controls {
    display: block;
    padding: 22px 18px;
  }

  .control-group + .control-group {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }

  .region-numbers,
  .capture-actions {
    margin-top: 20px;
  }

  .capture-stage-column {
    min-height: 430px;
    padding: 14px 12px 12px;
  }

  .capture-stage {
    min-height: 345px;
    border-radius: 15px;
  }

  .stage-badges span:last-child {
    display: none;
  }

  .import-strip {
    align-items: flex-start;
    margin-bottom: 52px;
    padding: 18px;
  }

  .import-strip > div > div span {
    display: none !important;
  }

  .import-strip .secondary-button {
    flex: 0 0 auto;
  }

  .file-chip {
    max-width: 145px;
  }

  .file-chip strong {
    max-width: 88px;
  }

  .file-chip small {
    display: none;
  }

  .preview-column {
    padding: 13px;
  }

  .editor-preview-wrap {
    min-height: 230px;
  }

  .transport {
    gap: 7px;
  }

  .transport-time {
    margin-left: 1px;
    font-size: 0.57rem;
  }

  .volume-control {
    display: none;
  }

  .editor-inspector {
    display: block;
  }

  .inspector-section {
    padding: 24px 19px;
    border-right: 0;
  }

  .timeline-section {
    padding: 27px 19px;
  }

  .timeline-heading {
    align-items: flex-end;
  }

  .timeline-actions .quiet-button {
    width: 40px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .timeline-actions .quiet-button::after {
    font-size: 1rem;
  }

  #jumpPreviousButton::after { content: "←"; }
  #jumpNextButton::after { content: "→"; }

  .export-section {
    display: block;
    padding: 25px 19px;
  }

  .export-actions {
    width: 100%;
    margin-top: 22px;
  }

  .export-button,
  .download-button,
  .original-download-button {
    width: 100%;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
