:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  color: #f4f1ea;
  background: #0e1210;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [contenteditable]:focus-visible {
  outline: 2px solid #f4f1ea;
  outline-offset: 3px;
}
button[hidden], [hidden] { display: none !important; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0e1210;
  position: relative;
  overflow: hidden;
}
.workspace:fullscreen {
  width: 100%;
  height: 100%;
  background: #0e1210;
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: max(10px, env(safe-area-inset-top)) 12px 8px 16px;
  flex: none;
}
.brand {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: inherit;
}
.stats { font-size: 16px; color: #8e9c8d; }
.grow { flex: 1; }
.ghost, .icon {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 16px;
  color: #d5ddd4;
}
.ghost:hover, .icon:hover { background: rgba(255, 255, 255, .06); }
.icon { width: 44px; padding: 0; font-size: 18px; }
.timer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 84px;
  justify-content: flex-end;
}
#elapsed {
  font-size: 32px;
  font-weight: 720;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
#stateLabel:empty { display: none; }
#stateLabel {
  color: #ff5d5d;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
}
body.recording #elapsed { color: #fff; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.cue {
  position: absolute;
  top: 22px;
  left: 28px;
  right: 28px;
  border-top: 1px solid rgba(244, 241, 234, .35);
  z-index: 2;
  pointer-events: none;
}
.read-marker {
  position: absolute;
  top: 10px;
  left: 8px;
  color: rgba(244, 241, 234, .7);
  z-index: 2;
  pointer-events: none;
  font-size: 16px;
}
body.editing .cue,
body.editing .read-marker { display: none; }

#reader {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 0 28px;
  scroll-behavior: auto;
}
#script {
  max-width: 14em;
  padding: 22px 0 70vh;
  line-height: 1.28;
  font-weight: 560;
  letter-spacing: -0.025em;
}
.word { cursor: pointer; }
.word.note { color: rgba(244, 241, 234, .38); }
#script b, #script strong { font-weight: 760; }
#empty {
  max-width: 16em;
  padding-top: 48px;
}
#empty h2 {
  margin: 0 0 8px;
  font-size: 40px;
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
#empty p { margin: 0 0 20px; font-size: 18px; color: #b7c3b4; }

#editorPanel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 28px 12px;
}
#editor {
  flex: 1;
  overflow: auto;
  outline: none;
  width: min(14em, 100%);
  line-height: 1.28;
  font-weight: 560;
  letter-spacing: -0.025em;
}
#editor:empty:before {
  content: attr(data-placeholder);
  color: #6e7d6f;
}
.editor-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
}
.editor-bottom button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: #c9d4c6;
  border-radius: 999px;
}
.editor-bottom .play-btn { color: #141816; }

#camera {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 112px;
  height: 148px;
  object-fit: cover;
  border-radius: 14px;
  transform: scaleX(-1);
  z-index: 4;
  background: #000;
}

#countOverlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(14, 18, 16, .72);
}
#countNumber {
  font-size: clamp(120px, 22vw, 220px);
  font-weight: 680;
  letter-spacing: -0.06em;
  line-height: .8;
}
#skipCount {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 234, .3);
  font-size: 17px;
}

#downloadPanel {
  margin: 0 16px 8px;
  padding: 16px;
  background: #f4f1ea;
  color: #141816;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#downloadPanel p { margin: 0; font-size: 18px; font-weight: 650; }
.download-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.download-link, #retake {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.download-link { background: #141816; color: #f4f1ea; }
#retake { background: transparent; color: #141816; border: 1px solid #141816; }

.dock {
  flex: none;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px 20px;
  align-items: center;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(244, 241, 234, .1);
  background: #0e1210;
}
.speed-block {
  display: grid;
  grid-template-columns: auto auto minmax(80px, 1fr);
  gap: 10px;
  align-items: center;
}
.speed-block label, #speedVal { font-size: 16px; }
#speedVal { font-variant-numeric: tabular-nums; color: #f4f1ea; font-weight: 650; }
input[type="range"] {
  width: 100%;
  height: 32px;
  accent-color: #f4f1ea;
}
.transport-main { display: flex; gap: 8px; align-items: center; }
.play-btn, .record-btn, .square-btn {
  min-height: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 650;
}
.play-btn {
  padding: 0 22px;
  background: #f4f1ea;
  color: #141816;
}
.record-btn {
  padding: 0 18px;
  background: transparent;
  color: #f4f1ea;
  border: 1px solid rgba(244, 241, 234, .28);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5d5d;
  flex: none;
}
body.recording .record-dot { box-shadow: 0 0 0 4px rgba(255, 93, 93, .25); }
.square-btn {
  width: 52px;
  padding: 0;
  border: 1px solid rgba(244, 241, 234, .18);
  color: #f4f1ea;
  font-size: 18px;
}
.btn-ico { margin-right: 6px; }

.sheet {
  display: none;
}
.workspace.setup-open #reader,
.workspace.setup-open #editorPanel { padding-right: min(452px, calc(100% - 120px)); }
.workspace.setup-open .cue { right: min(452px, calc(100% - 120px)); }
.workspace.setup-open .sheet {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: absolute;
  z-index: 20;
  top: 72px;
  right: 16px;
  bottom: 120px;
  width: min(420px, calc(100% - 32px));
  overflow: auto;
  background: #171c19;
  border: 1px solid rgba(244, 241, 234, .1);
  border-radius: 18px;
  padding: 22px 22px 28px;
}
.sheet h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.sheet section { display: flex; flex-direction: column; gap: 12px; }
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}
#sizeVal { font-variant-numeric: tabular-nums; }
.presets, .swatches { display: flex; gap: 8px; }
.presets button, .sheet-actions button, .editor-bottom button {
  min-height: 48px;
}
.presets button {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 234, .16);
  font-size: 16px;
}
.presets button.active {
  background: #f4f1ea;
  color: #141816;
  border-color: #f4f1ea;
}
.swatches button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid transparent;
}
.swatches button.active { border-color: #f4f1ea; }
.range-labels {
  display: flex;
  justify-content: space-between;
  color: #8e9c8d;
  font-size: 15px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
.toggle-row b { display: block; font-size: 17px; font-weight: 620; }
.toggle-row small, #voiceInfo, .sheet-note {
  display: block;
  color: #a9b7a6;
  font-size: 15px;
  line-height: 1.4;
}
#voiceInfo, .sheet-note { margin: 0; }
.switch {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #2c3830;
  position: relative;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f4f1ea;
}
.switch[aria-checked="true"] { background: #f4f1ea; }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: #141816; }
select {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(244, 241, 234, .18);
  background: #0e1210;
  font-size: 17px;
}
.countdown-setting { align-items: center; }
.sheet-actions { gap: 4px; }
.sheet-actions button {
  text-align: left;
  padding: 0 2px;
  font-size: 17px;
  color: #f4f1ea;
  border-radius: 8px;
}

body.taking #editTab,
body.taking #promptTab { display: none !important; }
body.editing #editTab { display: none !important; }
body:not(.editing) #promptTab { display: none !important; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: #f4f1ea;
  color: #141816;
  font-size: 16px;
}
dialog {
  border: 0;
  border-radius: 18px;
  background: #171c19;
  color: #f4f1ea;
  width: min(460px, calc(100% - 32px));
  padding: 28px 24px 24px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -0.04em; }
dialog p { margin: 0 0 12px; font-size: 17px; line-height: 1.45; color: #c9d4c6; }
.key-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  font-size: 16px;
}
kbd {
  font-family: inherit;
  font-size: 15px;
  border: 1px solid rgba(244, 241, 234, .25);
  border-radius: 6px;
  padding: 2px 8px;
}
.close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  color: #f4f1ea;
}
.feedback, #payPanel {
  margin: 0 16px 8px;
  padding: 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback {
  background: #171c19;
  border: 1px solid rgba(244, 241, 234, .1);
}
.feedback label, #restoreForm label { font-size: 16px; }
.feedback textarea, .feedback input, #restoreEmail {
  width: 100%;
  border: 1px solid rgba(244, 241, 234, .16);
  border-radius: 12px;
  background: #0e1210;
  color: #f4f1ea;
  font-size: 16px;
  padding: 12px;
}
.feedback textarea { min-height: 88px; resize: vertical; }
.feedback button, #payClose, #restoreForm button, .sheet-pay {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 650;
  align-self: flex-start;
}
.feedback button, #payWeek, #restoreForm button { background: #f4f1ea; color: #141816; }
.feedback-take:not(:has(.feedback-fields:not([hidden]))) { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.feedback-take .feedback-lead { margin: 0; font-size: 18px; font-weight: 650; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-take .feedback-ghost { background: transparent; color: #d5ddd4; border: 1px solid rgba(244, 241, 234, .28); }
#payPanel #payWeek { background: #141816; color: #f4f1ea; }
#payPanel #restoreForm button { background: transparent; color: #141816; border: 1px solid #141816; }
#payPanel {
  background: #f4f1ea;
  color: #141816;
}
#payPanel p { margin: 0; font-size: 18px; font-weight: 650; }
#payYear, #payClose, .sheet-pay {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
#restoreEmail { background: #fff; color: #141816; }
.sheet .feedback { margin: 0; }
.sheet-pay { margin-top: 4px; }
.about {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 12px 0 80px;
}
.about-grid { display: grid; gap: 36px; margin-top: 48px; }
.about-grid h2 { margin-top: 0; }
.about-kicker { margin: 18px 0 0; font-size: 16px; color: #8e9c8d; }
.about h1 {
  margin: 10px 0 14px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: .98;
  letter-spacing: -0.045em;
  font-weight: 650;
}
.about .lede { max-width: 38rem; font-size: 20px; }
.about h2 { margin: 40px 0 12px; font-size: 22px; font-weight: 650; }
.about p { margin: 0 0 12px; font-size: 18px; line-height: 1.45; color: #d5ddd4; }
.about-back, .about-open { display: inline-flex; align-items: center; text-decoration: none; }
.about-back { margin-top: 8px; }
.about-steps, .about-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.about-steps li, .about-list li { font-size: 18px; line-height: 1.4; color: #d5ddd4; }
.about-steps { counter-reset: step; }
.about-steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.about-steps li::before { content: counter(step); font-size: 18px; font-weight: 700; color: #f4f1ea; }
.about-prices { display: flex; flex-direction: column; gap: 8px; }
.about-prices p { margin: 0; }
@media (min-width: 960px) {
  .about-grid { grid-template-columns: 1.15fr .85fr; column-gap: 72px; row-gap: 48px; }
  .landing .topbar { padding-left: max(24px, calc((100% - 1120px) / 2)); padding-right: max(16px, calc((100% - 1120px) / 2)); }
}

.mint-btn, dialog .play-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f4f1ea;
  color: #141816;
  font-size: 16px;
  font-weight: 650;
}

@media (max-width: 720px) {
  .stats { display: none; }
  .topbar { padding-left: 14px; padding-right: 8px; gap: 4px; }
  .ghost { padding: 0 8px; }
  #reader, #editorPanel { padding-left: 18px; padding-right: 18px; }
  .cue { left: 18px; right: 18px; }
  .dock {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .transport-main { display: flex; }
  .play-btn, .record-btn { flex: 1; justify-content: center; padding-left: 12px; padding-right: 12px; }
  .workspace.setup-open #reader,
  .workspace.setup-open #editorPanel { padding-right: 18px; }
  .workspace.setup-open .cue { right: 18px; }
  .workspace.setup-open .sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: min(78dvh, 640px);
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  #camera { width: 84px; height: 112px; }
  #empty h2 { font-size: 34px; }
}

@media (min-width: 1100px) {
  #reader, #editorPanel { padding-left: 8vw; padding-right: 8vw; }
  .cue { left: 8vw; right: 8vw; }
}
