:root {
  color-scheme: light;
  --ink: #0b1020;
  --muted: #687085;
  --soft: #f7f8fa;
  --line: #dde1e8;
  --paper: #ffffff;
  --button: #000000;
  --button-text: #ffffff;
  --focus: #2563eb;
  --danger: #ff3b3b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

#app {
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.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;
}

.page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 5vh, 3.5rem) 1.5rem;
}

.app-shell {
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #ffffff;
}

.shell-main {
  height: 100svh;
  overflow: hidden;
  display: grid;
}

.app-shell .page {
  min-height: 100svh;
  padding: 2rem 1.5rem 5.5rem;
}

.step-footer {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  color: #9ca3af;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.center-page {
  justify-items: center;
}

.start-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

.start-panel {
  width: min(100%, 34rem);
  display: grid;
  justify-items: center;
}

.start-panel h1 {
  margin: 0 0 2.65rem;
  color: var(--ink);
  font-size: clamp(3.75rem, 4.7vw, 5.05rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.primary-button,
.start-button {
  display: inline-grid;
  place-items: center;
  border: 0.125rem solid #161616;
  border-radius: 0.5rem;
  background: var(--button);
  color: var(--button-text);
  box-shadow: 0 0.55rem 1rem rgb(0 0 0 / 14%);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.start-button {
  width: min(23rem, 100%);
  min-height: 6.95rem;
  border-radius: 1.25rem;
  font-size: 1.65rem;
  text-transform: uppercase;
  text-shadow: 0 0.125rem 0 rgb(255 255 255 / 18%);
}

.primary-button {
  min-width: 15.25rem;
  min-height: 4.6rem;
  padding: 0 1.65rem;
  font-size: 1.25rem;
}

.primary-button:hover,
.start-button:hover {
  transform: translateY(-0.1rem);
  box-shadow: 0 0.75rem 1.25rem rgb(0 0 0 / 17%);
}

.primary-button:active,
.start-button:active {
  transform: translateY(0);
  box-shadow: 0 0.35rem 0.7rem rgb(0 0 0 / 18%);
}

.primary-button:disabled,
.primary-button:disabled:hover,
.primary-button:disabled:active {
  cursor: not-allowed;
  transform: none;
  border-color: #b6bdca;
  background: #c5cad4;
  box-shadow: none;
  color: #ffffff;
}

.primary-button:focus-visible,
.start-button:focus-visible,
.prompt-option:focus-visible,
.text-button:focus-visible,
.record-pill:focus-visible,
.prep-paper-launch:focus-visible,
.prep-paper-tool:focus-visible,
select:focus-visible {
  outline: 0.22rem solid #111827;
  outline-offset: 0.25rem;
}

.theme-panel {
  width: min(100%, 37.5rem);
  display: grid;
  justify-items: center;
  gap: 2.45rem;
}

.page-title {
  margin: 0;
  font-size: clamp(2.9rem, 3.4vw, 3.55rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.theme-card {
  width: 100%;
  min-height: 11.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fbfbfc;
  font-size: clamp(2.8rem, 3.5vw, 3.45rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

.text-button:hover {
  color: var(--ink);
}

.list-page {
  width: min(100%, 50rem);
  margin: 0 auto;
  display: grid;
  gap: 2.15rem;
}

.list-title {
  margin: 0;
  font-size: clamp(2.35rem, 3vw, 3rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.prompt-list {
  display: grid;
  gap: 1rem;
}

.prompt-option {
  width: 100%;
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  align-items: start;
  gap: 1.1rem;
  min-height: 5rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.prompt-option:hover {
  border-color: #b9bfca;
  box-shadow: 0 0.5rem 1.5rem rgb(15 23 42 / 8%);
}

.prompt-number {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #000000;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.prompt-copy-wrap {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.38rem;
  row-gap: 0.25rem;
  font-size: 1rem;
  line-height: 1.55;
}

.quote-copy {
  color: var(--ink);
}

.quote-author {
  color: #6b7280;
  font-style: italic;
}

.timer-page {
  width: min(100%, 50rem);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 2rem;
}

.prompt-banner {
  max-width: 46rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fbfbfc;
  font-size: 1.05rem;
  line-height: 1.55;
  text-align: center;
  white-space: pre-line;
}

.stopwatch {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.time-display {
  font-variant-numeric: tabular-nums;
  font-size: clamp(5rem, 16vw, 9rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}

.timer-note {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.prep-button {
  border-radius: 1.25rem;
}

.prep-button.is-ending {
  border-color: #d6453d;
  background: #d6453d;
  box-shadow: 0 0.55rem 1.1rem rgb(214 69 61 / 16%);
}

.prep-button.is-ending:hover {
  box-shadow: 0 0.75rem 1.35rem rgb(214 69 61 / 20%);
}

.secondary-button {
  min-width: 9.5rem;
  min-height: 3.8rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.secondary-button:hover {
  border-color: #b9bfca;
}

.prep-paper-launch {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 31;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid #111827;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 0.55rem 1.5rem rgb(15 23 42 / 14%);
}

.prep-paper-launch.is-open {
  background: #111827;
  color: #ffffff;
}

.prep-paper-launch svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.prep-paper {
  position: fixed;
  bottom: 4.75rem;
  left: 1rem;
  z-index: 30;
  width: min(32.5rem, calc(100vw - 2rem));
  min-width: min(17.5rem, calc(100vw - 2rem));
  max-width: calc(100vw - 1rem);
  height: min(35rem, calc(100svh - 6rem));
  min-height: min(15rem, calc(100svh - 1rem));
  max-height: calc(100svh - 1rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d6dbe5;
  border-radius: 0.65rem;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1rem 2.2rem rgb(15 23 42 / 20%);
}

.prep-paper-header {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  user-select: none;
}

.prep-paper-tools {
  cursor: default;
}

.prep-paper-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
}

.prep-paper-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.prep-paper-tool {
  display: inline-grid;
  place-items: center;
  border: 1px solid #cdd3df;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  line-height: 1;
  min-width: 2.15rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
}

.prep-paper-tool:hover {
  border-color: #111827;
  background: #f7f8fa;
}

.prep-paper-tool.is-underlined {
  text-decoration: underline;
}

.prep-paper-editor {
  min-height: 12rem;
  padding: 0.75rem 1rem 1.15rem;
  overflow: auto;
  background:
    linear-gradient(
      to bottom,
      transparent calc(var(--note-line-height) - 1px),
      rgb(17 24 39 / 10%) calc(var(--note-line-height) - 1px),
      rgb(17 24 39 / 10%) var(--note-line-height)
    )
      0 0.75rem / 100% var(--note-line-height) repeat-y,
    #ffffff;
  color: #111827;
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: var(--note-font-size);
  font-weight: 700;
  line-height: var(--note-line-height);
  outline: none;
}

.is-resizing-prep-paper {
  user-select: none;
}

.prep-paper-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.prep-paper-editor:focus {
  box-shadow: inset 0 0 0 0.12rem rgb(17 24 39 / 16%);
}

.check-page {
  width: min(100%, 108rem);
  min-height: 100svh;
  margin: 0 auto;
  padding: 1.5rem 2rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(28rem, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 3vw, 3.5rem);
}

.check-preview-panel,
.check-control-panel {
  width: 100%;
}

.check-control-panel {
  display: grid;
  gap: 1.35rem;
  align-content: center;
}

.check-title {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: clamp(3.25rem, 3.8vw, 4.25rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
}

.camera-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
  border: 2px solid #161616;
  border-radius: 0.6rem;
  background: #000000;
  object-fit: contain;
}

.field-group {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  margin-top: 0;
}

.field-label {
  color: #9aa1b2;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0 0.85rem;
  border: 1px solid #cdd3df;
  border-radius: 0.35rem;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
}

.audio-check {
  width: 100%;
  margin-top: 0;
  padding: 1.35rem 1.15rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fbfbfc;
}

.audio-meter {
  height: 0.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.28rem;
}

.audio-dot {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: #c4c8d1;
  transform: scale(1);
}

.audio-dot.active {
  background: #111827;
  transform: scale(1.45);
}

.audio-status {
  min-height: 1.25rem;
  margin-top: 0.4rem;
  color: #9aa1b2;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.check-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.15rem;
}

.check-actions .primary-button {
  min-width: min(100%, 18rem);
  min-height: 3.8rem;
  padding: 0 1.5rem;
  font-size: 1.12rem;
}

.error-message {
  margin: 1rem 0 0;
  color: #b42318;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .check-page {
    grid-template-columns: minmax(0, 1.6fr) minmax(22rem, 0.8fr);
    gap: 1.5rem;
  }

  .check-title {
    font-size: clamp(2.65rem, 4.2vw, 3.55rem);
  }
}

.record-page {
  height: 100svh;
  position: relative;
  display: block;
  padding: 1rem;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000000;
  color: #ffffff;
}

.record-stage {
  position: relative;
  height: calc(100svh - 2rem);
  display: grid;
  place-items: stretch;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0.65rem;
}

.record-video {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  display: block;
  align-self: stretch;
  justify-self: stretch;
  background: #000000;
  object-fit: cover;
  object-position: center center;
}

.record-pill {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  min-width: 15.2rem;
  min-height: 3.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 0.8rem 2rem rgb(0 0 0 / 24%);
  font-weight: 800;
  font-size: 1.25rem;
}

.record-pill.is-recording {
  border: 1px solid rgb(255 255 255 / 44%);
  background: rgb(255 255 255 / 16%);
  color: #ffffff;
  box-shadow: none;
  backdrop-filter: blur(0.35rem);
}

.record-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--danger);
}

.record-sidebar {
  position: absolute;
  top: 1.45rem;
  right: 1.45rem;
  z-index: 4;
  min-height: auto;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.65rem;
  background: rgb(0 0 0 / 72%);
  box-shadow: 0 0.6rem 1.6rem rgb(0 0 0 / 28%);
  backdrop-filter: blur(0.35rem);
}

.available-label {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.available-time {
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: #ffffff;
  text-shadow: 0 0.1rem 0.35rem rgb(0 0 0 / 55%);
}

.available-time.negative {
  color: #ff6969;
}

.review-page {
  width: min(100%, 58rem);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.review-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.65rem;
  background: #000000;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.review-actions .primary-button,
.review-actions .secondary-button {
  border-radius: 1.25rem;
}

.review-actions .secondary-button {
  border-color: #9ca3af;
  border-radius: 1.75rem;
  color: #6b7280;
  font-weight: 700;
}

@media (max-width: 760px) {
  .page {
    padding: 2rem 1rem;
  }

  .check-page {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 1.25rem;
    padding: 1rem;
  }

  .check-title {
    font-size: clamp(2.5rem, 12vw, 3.25rem);
    text-align: center;
  }

  .check-actions {
    justify-content: center;
  }

  .record-page {
    padding: 0.5rem;
  }

  .record-video,
  .record-stage {
    height: calc(100svh - 1rem);
  }

  .record-sidebar {
    top: 1rem;
    right: 1rem;
    padding: 0.65rem 0.8rem 0.75rem;
  }

  .available-time {
    margin-top: 0;
    font-size: 1.55rem;
  }

  .record-pill {
    bottom: 0.75rem;
  }
}

@media (max-width: 520px) {
  .start-page {
    padding-top: 7.5rem;
  }

  .start-panel h1 {
    margin-bottom: 2rem;
    font-size: clamp(3.2rem, 18vw, 4.45rem);
  }

  .start-button {
    min-height: 5rem;
    border-radius: 0.7rem;
    font-size: 1.16rem;
  }

  .prompt-option {
    grid-template-columns: 1.55rem 1fr;
    padding: 1rem;
  }

  .check-control-panel {
    gap: 0.9rem;
  }

}
