:root {
  --bg: #fffaf1;
  --card: #ffffff;
  --ink: #1f2a44;
  --sub: #687086;
  --line: #e9e2d7;
  --line-soft: #f2ede4;
  --pp: #1f2a44;
  --pp-d: #141d32;
  --pp-l: #f3f7ff;
  --co: #ff6b5c;
  --co-l: #fff0ec;
  --yel: #ffc94a;
  --rec: #ff5f57;
  --dark: #121a2e;
  --soft2: #9aa2b4;
  --blue: #5da8ff;
  --blue-l: #eaf5ff;
  --yellow-l: #fff6cf;
  --shadow: 0 14px 36px rgba(50, 46, 38, 0.09);
  --shadow-soft: 0 7px 22px rgba(50, 46, 38, 0.065);
}

body {
  background: #f1ede5;
}

button,
input,
textarea {
  border-radius: 16px;
}

button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

button:active {
  transform: scale(0.98);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(93, 168, 255, 0.55);
  outline-offset: 2px;
}

.app {
  background:
    radial-gradient(circle at 92% 7%, rgba(93, 168, 255, 0.13), transparent 24%),
    radial-gradient(circle at 3% 28%, rgba(255, 201, 74, 0.13), transparent 24%),
    var(--bg);
}

.card {
  border: 1px solid rgba(31, 42, 68, 0.07);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.card + .card {
  margin-top: 14px;
}

.h {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 19px 0;
}

.btn-co,
.btn-pp {
  min-height: 54px;
  border-radius: 19px;
  letter-spacing: -0.01em;
}

.btn-co {
  box-shadow: 0 10px 24px rgba(255, 107, 92, 0.25);
}

.btn-soft {
  border: 1px solid rgba(31, 42, 68, 0.1);
  border-radius: 15px;
  box-shadow: 0 5px 16px rgba(31, 42, 68, 0.06);
}

.backlink {
  color: var(--sub);
}

/* Home */
#setup .scroll {
  padding: calc(26px + env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom));
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.brand strong {
  color: var(--co);
  font-weight: 850;
}

.brand-dot {
  width: 19px;
  height: 19px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: var(--co);
  box-shadow: 0 0 0 1px rgba(31, 42, 68, 0.08), 0 4px 10px rgba(255, 107, 92, 0.24);
}

.welcome-hero {
  position: relative;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid rgba(31, 42, 68, 0.06);
  border-radius: 32px;
  background: #fff6df;
  box-shadow: var(--shadow);
}

.welcome-hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(to bottom, transparent, rgba(255, 250, 241, 0.16));
  content: "";
  pointer-events: none;
}

.welcome-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 50%;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  padding: 23px 22px 0;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--co-l);
  color: #d64f43;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.eyebrow {
  padding: 6px 10px;
}

.welcome-copy h1 {
  margin-top: 11px;
  color: var(--ink);
  font-size: clamp(27px, 7.2vw, 35px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -0.055em;
}

.welcome-copy h1 em {
  color: var(--co);
  font-style: normal;
}

.welcome-copy p {
  max-width: 360px;
  margin-top: 10px;
  color: var(--sub);
  font-size: 13.5px;
  font-weight: 560;
  line-height: 1.55;
  letter-spacing: -0.02em;
}

.steps {
  gap: 8px;
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.step {
  min-width: 0;
  padding: 12px 6px;
  border: 1px solid rgba(31, 42, 68, 0.07);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(50, 46, 38, 0.045);
}

.step + .step {
  border-left: 1px solid rgba(31, 42, 68, 0.07);
}

.step .e {
  color: var(--co);
  font-size: 10px;
}

.step .t {
  margin-top: 4px;
  font-size: 13px;
}

.step .s {
  font-size: 10px;
}

.quick-starts {
  margin-top: 26px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  padding: 0 3px;
}

.section-kicker {
  padding: 0;
  background: transparent;
}

.section-heading h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 830;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.section-note {
  max-width: none;
  color: var(--soft2);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
  align-items: stretch;
}

.quick-grid button {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 134px;
  height: 100%;
  padding: 12px 8px 11px;
  border: 1px solid rgba(31, 42, 68, 0.06);
  border-radius: 23px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  text-align: left;
}


.idea-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 18px;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow: inset 0 -5px 10px rgba(31, 42, 68, 0.08);
}

.idea-orb.coral { background: var(--co); }
.idea-orb.blue { background: var(--blue); }
.idea-orb.yellow { background: var(--yel); color: #795708; }

.quick-grid b,
.quick-grid small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-grid b {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 820;
  white-space: nowrap;
}

.quick-grid small {
  margin-top: 3px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 26px;
}

.quick-starts + .card {
  margin-top: 23px !important;
}

#modeChips {
  gap: 10px;
}

#modeChips button {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 15px;
}

#modeChips button.sel {
  border-color: rgba(255, 107, 92, 0.45);
  background: var(--co-l);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 92, 0.08);
}

#modeChips button .reco {
  background: var(--co);
}

.chips {
  gap: 8px;
}

.chips .chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.chips .chip.sel {
  border-color: var(--ink);
  background: var(--ink);
}

#startBtn {
  position: relative;
  z-index: 2;
  margin-top: 18px !important;
}

#camError {
  border: 1px solid rgba(255, 107, 92, 0.32);
  border-radius: 18px;
}

/* Question, paste and script */
.wiztop {
  padding: calc(24px + env(safe-area-inset-top)) 18px 11px;
}

.wiztop .prog {
  background: var(--blue-l);
  color: #2877d5;
}

#mmwrap {
  padding: 0 18px 24px;
}

.qpill {
  border: 0;
  background: var(--co-l);
  color: #d64f43;
}

#qText {
  margin-top: 13px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

#qInput {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf8;
  padding: 13px 14px;
}

.prevbox {
  border: 1px solid #dce9fb;
  border-radius: 21px;
  background: var(--pp-l);
}

.qprevedit {
  border: 1px solid #dce4f1;
  border-radius: 15px;
}

#qPrevAlt,
#qSkip,
#qNext {
  border-radius: 17px;
}

.mmbox,
.prevscript,
#sumBar,
.sitem {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 5px 15px rgba(50, 46, 38, 0.04);
}

.mmbox.cur {
  border-color: rgba(255, 107, 92, 0.4);
  background: var(--co-l);
}

.mmbox {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.mmbox.dragging {
  position: relative;
  z-index: 20;
  border-color: var(--blue);
  box-shadow: 0 16px 34px rgba(31, 42, 68, 0.2);
  transform: scale(1.015);
}

.mmdrag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: -6px -5px -6px 0;
  padding: 0;
  flex: none;
  border-radius: 14px;
  background: #f2f5fa;
  color: #7e8aa2;
  cursor: grab;
  line-height: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mmdrag svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mmdrag.active {
  background: var(--blue);
  color: #fff;
  cursor: grabbing;
}

.mmadd,
.insline {
  border-radius: 17px;
}

#paste {
  padding: calc(26px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
}

#paste .ttl,
.schead .ttl {
  font-size: 27px;
  letter-spacing: -0.04em;
}

#pasteArea {
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.sctop {
  padding: calc(24px + env(safe-area-inset-top)) 18px 0;
}

.schead {
  padding: 9px 18px 0;
}

.slist {
  padding: 13px 18px 18px;
}

.sitem {
  padding: 13px;
}

.sitem .alt,
.sitem .del {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.scfoot {
  padding: 13px 18px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -8px 24px rgba(31, 42, 68, 0.06);
}

/* Camera */
#shoot {
  background: var(--dark);
}

#view,
.caption {
  border-radius: 24px;
}

.caption {
  border-radius: 0 0 24px 24px;
}

#capText,
.cappanel,
.sidebtn {
  border-radius: 18px;
}

.recbtn {
  min-height: 58px;
  border-radius: 20px;
}

.shbtns.review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shbtns.review #skipBtn {
  display: none;
}

.shbtns.review .recbtn.record,
.shbtns.review #finishBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 58px;
  padding: 12px 8px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.shbtns.review .recbtn.record {
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

.shbtns.review #finishBtn {
  border: 1.5px solid var(--co);
  background: var(--co);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 92, 0.28);
}

.shbtns.review #finishBtn::after {
  margin-left: 6px;
  content: "→";
  font-size: 17px;
  line-height: 1;
}

/* Completion */
#done .scroll {
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.donehero {
  margin-top: 0;
}

.done-art {
  display: block;
  width: min(72%, 320px);
  aspect-ratio: 4 / 3;
  margin: 0 auto -4px;
  border-radius: 28px;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.donehero .e {
  background: var(--blue-l);
  color: #2877d5;
}

.donehero .t {
  font-size: 28px;
}

.stats {
  gap: 7px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.stat {
  border: 1px solid rgba(31, 42, 68, 0.06);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.stat + .stat {
  border-left: 1px solid rgba(31, 42, 68, 0.06);
}

.clip,
#dnote {
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.clip.combined {
  border: 2px solid rgba(255, 107, 92, 0.5);
}

.clip video {
  border-radius: 18px;
}

.clip .reshoot,
.clip .save,
.clip .dl,
.recombine,
#againBtn {
  border-radius: 16px;
}

/* Sheets */
.sheetbg {
  background: rgba(18, 26, 46, 0.38);
  backdrop-filter: blur(5px);
}

.sheet {
  border: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 50px rgba(18, 26, 46, 0.16);
}

.choice,
#edArea {
  border: 1px solid var(--line);
  border-radius: 18px;
}

.choice.cur {
  border-color: rgba(93, 168, 255, 0.45);
  background: var(--blue-l);
}

/* Setup camera choices */
.setup-choice .chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
}

.setup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 11px;
  background: #f2f5fa;
  color: var(--ink);
}

.setup-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-icon.record-icon {
  background: var(--co-l);
  color: var(--co);
}

.setup-icon.record-icon svg {
  fill: currentColor;
  stroke: none;
}

.setup-choice .chip.sel .setup-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.setup-choice .chip-label {
  font-weight: 800;
  letter-spacing: -0.02em;
}

#recChips .chip.sel[data-rec="0"] {
  border-color: var(--blue);
  background: var(--blue);
}

/* Visual help guide */
#helpSheet .sheet {
  max-height: 92%;
  background: var(--bg);
}

.help-heading {
  padding: 18px 20px 13px;
  background: rgba(255, 250, 241, 0.96);
  border-bottom: 1px solid var(--line-soft);
}

.help-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px !important;
  letter-spacing: -0.03em;
}

.help-title svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--co);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.helpbody {
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}

.hstep {
  padding: 0 0 28px;
  border: 0;
}

.hstep + .hstep {
  padding-top: 2px;
}

.help-visual {
  display: block;
  width: 100%;
  height: 180px;
  border: 1px solid rgba(31, 42, 68, 0.06);
  border-radius: 25px;
  background: #fff6df;
  object-fit: cover;
  object-position: center;
  box-shadow: var(--shadow-soft);
}

.help-visual.recording {
  object-position: center 42%;
}

.hstep-copy {
  padding: 15px 3px 0;
}

.hstep b {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.hstep b span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 27px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--co-l);
  color: var(--co);
  font-size: 12px;
  letter-spacing: 0;
}

.hstep p {
  margin-top: 10px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 580;
  line-height: 1.72;
  letter-spacing: -0.02em;
}

.hstep ul {
  display: grid;
  gap: 7px;
  margin-top: 11px;
  padding: 12px 13px;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(50, 46, 38, 0.04);
  list-style: none;
}

.hstep li {
  position: relative;
  padding-left: 15px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.hstep li::before {
  position: absolute;
  top: 0.64em;
  left: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

#helpOk {
  margin-top: 0;
}

@media (max-width: 380px) {
  #setup .scroll,
  #mmwrap,
  .slist {
    padding-right: 14px;
    padding-left: 14px;
  }

  .welcome-copy {
    padding: 20px 18px 0;
  }

  .welcome-copy h1 {
    font-size: 27px;
  }


  .quick-grid {
    gap: 6px;
  }

  .quick-grid button {
    min-height: 124px;
    padding: 10px 7px;
  }

  .idea-orb {
    width: 43px;
    height: 43px;
    border-radius: 16px;
  }
}

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