:root {
  --canvas: #fffdfa;
  --surface: #ffffff;
  --surface-soft: #fff8f3;
  --ink: #4a342d;
  --ink-soft: #665149;
  --muted: #806e67;
  --faint: #a89f9d;
  --line: #ebe5e2;
  --brand: #f05223;
  --brand-bright: #ff792a;
  --brand-deep: #d84315;
  --brand-soft: #fff0e8;
  --success: #5e8e7e;
  --danger: #a73d31;
  --shadow-soft: 0 18px 55px rgba(74, 49, 39, .075);
  --shadow-card: 0 8px 30px rgba(74, 49, 39, .055);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: #f6f1ed; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: #f6f1ed; }
button, input, textarea, select { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [role="button"]:focus-visible { outline: 3px solid rgba(240, 82, 35, .24); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { width: min(100%, 430px); min-height: 100dvh; margin: 0 auto; background: var(--canvas); box-shadow: 0 0 70px rgba(67, 45, 36, .08); }
.screen { min-height: 100dvh; padding: 28px 26px calc(110px + env(safe-area-inset-bottom)); }
.screen--home { padding-top: 32px; }

.brand-lockup { display: flex; align-items: center; gap: 13px; width: fit-content; }
.brand-lockup[role="button"] { cursor: pointer; }
.brand-lockup img { width: 48px; height: 48px; object-fit: contain; }
.brand-lockup span { display: grid; gap: 3px; }
.brand-lockup strong { color: var(--ink); font-size: 21px; font-weight: 900; line-height: 1.1; letter-spacing: -.04em; }
.brand-lockup small { color: #756665; font-size: 11px; line-height: 1.2; letter-spacing: .02em; }
.brand-lockup--compact img { width: 42px; height: 42px; }
.brand-lockup--compact strong { font-size: 18px; }
.brand-lockup--compact small { font-size: 9px; }

.stepper { margin: 36px 0 0; }
.stepper > strong { display: block; margin-bottom: 17px; color: var(--brand); font-size: 17px; font-weight: 900; letter-spacing: .02em; }
.stepper__bars, .stepper__labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stepper__bars i { height: 8px; border-radius: 99px; background: #ece8e5; }
.stepper__bars i.is-active, .stepper__bars i.is-done { background: linear-gradient(90deg, var(--brand-bright), var(--brand)); }
.stepper__labels { margin-top: 10px; color: #827675; font-size: 12px; text-align: center; }
.stepper__labels .is-active { color: var(--brand); font-weight: 800; }
.stepper__labels .is-done { color: #be684d; }
.stepper--compact { margin-top: 28px; }
.stepper--compact > strong { margin-bottom: 13px; font-size: 14px; }
.stepper--compact .stepper__bars i { height: 6px; }

.hero-copy { margin: 49px 0 32px; }
.hero-copy h1, .page-heading h1, .complete-heading h1 { margin: 0; color: var(--ink); font-size: clamp(33px, 9.3vw, 40px); font-weight: 900; line-height: 1.24; letter-spacing: -.065em; }
.hero-copy h1 { position: relative; width: max-content; max-width: 100%; }
.hero-copy h1::after { content: ""; position: absolute; z-index: -1; left: -2px; bottom: 7px; width: 46%; height: 6px; border-radius: 99px; background: linear-gradient(90deg, #ffd7c4, var(--brand-bright)); }
.hero-copy p, .page-heading p, .complete-heading p { margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.75; }

.source-card, .poster-form-card, .replay-preview-card, .poster-controls, .profile-card, .truth-card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-soft); }
.source-card { padding: 24px 20px 21px; }
.tutorial-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-bottom: 14px; padding: 0 13px; border: 1px solid #f0c5b4; border-radius: 13px; color: #a94a2e; background: #fff8f2; box-shadow: 0 7px 18px rgba(103,63,46,.06); font-size: 12px; font-weight: 850; }
.tutorial-button span { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 10px; line-height: 1; }
.source-card textarea { width: 100%; height: clamp(260px, 31svh, 300px); resize: vertical; padding: 18px 16px; border: 1.5px solid #e4dedb; border-radius: 18px; color: var(--ink); background: #fff; font-size: 15px; line-height: 1.75; }
.source-card textarea::placeholder { color: #b5adab; }
.source-card textarea:focus { border-color: rgba(240,82,35,.55); }
.source-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; color: #756a69; font-size: 12px; }
.source-card__meta b { font-weight: 700; }
.source-card > .primary-button { margin-top: 12px; }
.paste-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0; border: 0; color: var(--brand); background: transparent; font-weight: 800; }
.paste-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 22px; border-radius: 17px; font-weight: 850; letter-spacing: -.01em; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.primary-button { border: 0; color: #fff; background: linear-gradient(110deg, var(--brand-bright), var(--brand)); box-shadow: 0 11px 24px rgba(240,82,35,.19); }
.primary-button--depth { position: relative; width: 100%; min-height: 61px; margin-bottom: 6px; border-radius: 19px; box-shadow: 0 8px 0 var(--brand-deep), 0 18px 32px rgba(240,82,35,.2); font-size: 17px; }
.primary-button--depth:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--brand-deep), 0 10px 22px rgba(240,82,35,.16); }
.primary-button span { font-size: 23px; font-weight: 500; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.secondary-button { border: 1.5px solid #e3d9d5; color: var(--ink); background: #fff; box-shadow: var(--shadow-card); }
.secondary-button--wide { width: 100%; }
.form-status { min-height: 20px; margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.form-status.is-error { color: var(--danger); }

.page-heading { margin: 38px 0 26px; }
.page-heading .back-button { margin-bottom: 20px; }
.page-heading > small { display: block; margin-bottom: 14px; color: var(--brand); font-size: 12px; font-weight: 850; }
.page-heading--nav { margin-top: 46px; }
.screen[data-view="tasks"] .page-heading h1 { font-size: 24px; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.back-button, .text-action { min-height: 44px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 13px; font-weight: 750; }

.replay-preview-card { padding: 16px; }
.preview-phone { height: 360px; margin-bottom: 14px; overflow: hidden; border: 1.5px solid #ded9d6; border-radius: 20px; background: #fffaf6; box-shadow: 0 10px 24px rgba(74,52,45,.07); }
.preview-feed { height: 100%; overflow-x: hidden; overflow-y: auto; padding: 18px 13px; background: #f2f1ef; }
.preview-message { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 9px; align-items: start; margin-bottom: 13px; }
.preview-avatar { display: grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid rgba(74,52,45,.08); border-radius: 5px; color: #fff; background: var(--brand); font-size: 11px; font-weight: 800; }
.preview-avatar img { width: 100%; height: 100%; object-fit: cover; }
.preview-bubble-shell { position: relative; min-width: 0; overflow: visible; border: 1px solid #dedbd7; border-radius: 5px; background: #fff; box-shadow: 0 1px 2px rgba(74,52,45,.035); }
.preview-bubble-shell::before { content: ""; position: absolute; z-index: 1; top: 10px; left: -6px; width: 10px; height: 10px; border: 1px solid #dedbd7; border-top: 0; border-right: 0; background: #fff; transform: rotate(45deg); }
.preview-bubble-shell:focus-within { border-color: rgba(240,82,35,.48); box-shadow: 0 0 0 2px rgba(240,82,35,.12); }
.preview-message__editor { position: relative; z-index: 2; display: block; width: 100%; min-height: 42px; margin: 0; resize: none; overflow: hidden; padding: 9px 11px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; font: inherit; font-size: 11px; line-height: 1.62; }
.preview-message__editor:focus, .preview-chapter-editor:focus { outline: 0; }
.preview-message--chapter { display: block; width: min(90%, 260px); margin: 10px auto 14px; border-radius: 13px; background: var(--brand-soft); }
.preview-chapter-editor { display: block; width: 100%; min-height: 34px; resize: none; overflow: hidden; padding: 7px 11px; border: 1px solid transparent; border-radius: 13px; color: var(--brand); background: transparent; font-size: 10px; font-weight: 800; line-height: 1.5; text-align: center; }
.preview-message--highlight .preview-bubble-shell,
.preview-message--highlight .preview-bubble-shell::before { border-color: #ead2c7; background: #fff6f0; }
.preview-message--highlight .preview-message__editor { color: #8f3f29; font-weight: 750; }
.flow-actions { margin-top: 26px; }

/* STEP 2 keeps the result and confirmation action close to one 390×844 screen. */
.screen[data-view="edit"] { padding-top: 20px; }
.screen[data-view="edit"] .stepper--compact { margin-top: 16px; }
.screen[data-view="edit"] .stepper--compact > strong { margin-bottom: 8px; font-size: 12px; }
.screen[data-view="edit"] .stepper--compact .stepper__labels { margin-top: 6px; font-size: 10px; }
.screen[data-view="edit"] .edit-back-row { margin: 10px 0 12px; }
.screen[data-view="edit"] .edit-back-row .back-button { min-height: 36px; }
.screen[data-view="edit"] .replay-preview-card { padding: 12px; }
.screen[data-view="edit"] .preview-phone { height: 250px; margin-bottom: 10px; border-width: 1px; border-radius: 18px; }
.screen[data-view="edit"] .preview-feed { height: 100%; padding: 12px 10px; }
.screen[data-view="edit"] .preview-message { margin-bottom: 9px; }
.screen[data-view="edit"] .secondary-button { min-height: 48px; }
.screen[data-view="edit"] .flow-actions { margin-top: clamp(18px, 3vh, 28px); }

.poster-form-card { padding: 18px; }
.photo-uploader { display: grid; grid-template-columns: 64px 1fr auto; gap: 13px; align-items: center; min-height: 92px; padding: 12px; border: 1.5px dashed #edc8ba; border-radius: 18px; background: var(--surface-soft); cursor: pointer; }
.photo-uploader input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-preview { display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border-radius: 17px; color: var(--brand); background: var(--brand-soft) center/cover no-repeat; font-size: 27px; font-weight: 400; }
.photo-preview.has-image b { display: none; }
.photo-uploader > span:nth-of-type(2) { display: grid; gap: 6px; }
.photo-uploader strong { font-size: 14px; }
.photo-uploader small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.photo-uploader > i { color: var(--brand); font-size: 11px; font-style: normal; font-weight: 850; }
.field { display: grid; gap: 9px; margin-top: 18px; }
.field > span { font-size: 13px; font-weight: 850; }
.field > span small { margin-left: 4px; color: var(--faint); font-weight: 500; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 13px 14px; border: 1.5px solid #e5dfdc; border-radius: 14px; color: var(--ink); background: #fff; line-height: 1.6; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b2aaa8; }

/* STEP 3 keeps every required poster field and the generation action in one 390×844 screen. */
.screen[data-view="poster"] { padding-top: 20px; }
.screen[data-view="poster"] .stepper--compact { margin-top: 16px; }
.screen[data-view="poster"] .stepper--compact > strong { margin-bottom: 8px; font-size: 12px; }
.screen[data-view="poster"] .stepper--compact .stepper__labels { margin-top: 6px; font-size: 10px; }
.screen[data-view="poster"] .poster-back-row { margin: 10px 0 12px; }
.screen[data-view="poster"] .poster-back-row .back-button { min-height: 36px; }
.screen[data-view="poster"] .poster-form-card { padding: 14px; border-radius: 20px; }
.screen[data-view="poster"] .photo-uploader { grid-template-columns: 54px 1fr auto; gap: 10px; min-height: 76px; padding: 9px; }
.screen[data-view="poster"] .photo-preview { width: 54px; height: 54px; border-radius: 14px; }
.screen[data-view="poster"] .field { gap: 6px; margin-top: 12px; }
.screen[data-view="poster"] .field input,
.screen[data-view="poster"] .field textarea { min-height: 44px; padding: 10px 12px; }
.screen[data-view="poster"] .field textarea { height: 58px; }
.screen[data-view="poster"] .flow-actions { margin-top: 16px; }
.screen[data-view="poster"] .primary-button--depth { min-height: 56px; }
.poster-more { margin-top: 12px; border-top: 1px solid var(--line); }
.poster-more summary { display: flex; align-items: center; min-height: 44px; color: var(--ink-soft); font-size: 12px; font-weight: 850; cursor: pointer; list-style: none; }
.poster-more summary::-webkit-details-marker { display: none; }
.poster-more summary::after { content: "+"; margin-left: auto; color: var(--brand); font-size: 18px; font-weight: 500; }
.poster-more[open] summary::after { content: "−"; }
.poster-more summary small { margin-left: 5px; color: var(--faint); font-weight: 500; }
.poster-more .field { margin-top: 8px !important; }
.layout-heading, .section-label { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 12px; }
.layout-heading span, .section-label strong { font-size: 13px; font-weight: 850; }
.layout-heading small, .section-label small { color: var(--faint); font-size: 10px; }
.poster-layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.layout-choice { position: relative; padding: 5px 5px 9px; overflow: hidden; border: 2px solid transparent; border-radius: 14px; background: #f8f4f1; }
.layout-choice img { display: block; width: 100%; aspect-ratio: 3/4; border-radius: 9px; object-fit: cover; }
.layout-choice span { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.layout-choice.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.layout-choice.is-selected::after { content: "✓"; position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 11px; font-weight: 900; }
.poster-canvas { display: block; width: 100%; height: auto; border-radius: 20px; background: #f2eeeb; box-shadow: var(--shadow-soft); }
.poster-controls { margin-top: 18px; padding-bottom: 8px; }
.poster-controls summary { min-height: 58px; font-size: 13px; font-weight: 850; }
.poster-controls .field, .poster-controls .range-field { margin-inline: 18px; }
.range-field { display: grid; grid-template-columns: 82px 1fr 44px; gap: 10px; align-items: center; min-height: 49px; font-size: 12px; }
.range-field input { accent-color: var(--brand); }
.range-field output { color: var(--muted); text-align: right; }

.complete-heading { margin: 42px 0 28px; text-align: center; }
.complete-heading > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 17px; color: #fff; background: var(--brand); box-shadow: 0 12px 26px rgba(240,82,35,.22); font-size: 25px; font-weight: 900; }
.final-poster { width: 88%; margin: 0 auto 24px; padding: 7px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 24px 55px rgba(57,38,31,.15); }
.final-poster canvas { display: block; width: 100%; height: auto; border-radius: 16px; }
.share-stats { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 18px; align-items: center; margin: 0 auto 20px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-card); }
.share-stats span { display: grid; gap: 4px; text-align: center; }
.share-stats strong { color: var(--ink); font-size: 22px; font-weight: 900; }
.share-stats small { color: var(--muted); font-size: 10px; }
.share-stats > i { width: 1px; height: 32px; background: var(--line); }
.complete-actions { display: grid; gap: 14px; }
.complete-actions .text-action { color: var(--brand); }
.screen--complete { padding-top: 20px; padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
.screen--complete .final-poster { width: 82%; max-width: 280px; margin: 28px auto 20px; padding: 5px; border-radius: 18px; }
.screen--complete .final-poster canvas { border-radius: 14px; }
.screen--complete .complete-actions { grid-template-columns: 1fr; gap: 10px; }
.screen--complete .complete-actions .primary-button { grid-column: 1 / -1; min-height: 56px; margin-bottom: 0; }
.screen--complete .complete-actions .text-action { min-height: 44px; padding-inline: 8px; font-size: 12px; }
.screen--complete .form-status:empty { display: none; }

.task-list { display: grid; gap: 13px; }
.task-item { display: grid; grid-template-columns: minmax(0,1fr) 58px; align-items: stretch; width: 100%; min-height: 88px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow-card); }
.task-item__open { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 13px; align-items: center; min-width: 0; padding: 14px 10px 14px 14px; border: 0; background: transparent; text-align: left; }
.task-item__delete { min-width: 58px; min-height: 44px; padding: 0; border: 0; border-left: 1px solid var(--line); color: var(--muted); background: #fffdfa; font-size: 10px; font-weight: 750; }
.task-item__delete:hover, .task-item__delete:focus-visible { color: var(--danger); background: #fff6f2; }
.task-item__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: var(--brand); background: var(--brand-soft); font-size: 19px; font-weight: 900; }
.task-item__copy { min-width: 0; }
.task-item__copy strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.task-item__copy small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.task-item__state { display: grid; gap: 6px; justify-items: end; color: var(--brand); font-size: 10px; font-weight: 850; }
.task-item__state i { font-size: 18px; font-style: normal; font-weight: 500; }
.empty-state { padding: 58px 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 17px; border-radius: 15px; color: var(--brand); background: var(--brand-soft); font-size: 24px; }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state p { margin: 12px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.screen--profile { padding-top: 24px; }
.screen--profile > .account-card { margin-top: 26px; }
.account-card { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-card); }
.account-card__avatar { width: 56px; height: 56px; border: 1px solid #eadfd9; border-radius: 16px; object-fit: cover; background: var(--brand-soft); }
.account-card__identity { display: grid; gap: 7px; min-width: 0; }
.account-card__identity strong { overflow: hidden; font-size: 18px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.account-card__identity small { color: var(--muted); font-size: 11px; }
.account-login-button { min-height: 44px; padding: 0 13px; border: 1px solid #efc5b5; border-radius: 13px; color: #a7472c; background: #fff8f3; font-size: 12px; font-weight: 850; }
.plan-card { margin-top: 14px; padding: 19px; overflow: hidden; border: 1px solid #efd8cd; border-radius: 22px; background: linear-gradient(135deg,#fff9f4,#fff1e8); box-shadow: var(--shadow-card); }
.plan-card__head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.plan-card__head > span { display: grid; gap: 7px; }
.plan-card__head small { color: var(--muted); font-size: 11px; }
.plan-card__head strong { font-size: 20px; font-weight: 900; }
.plan-card__head > button { min-height: 44px; padding: 0 14px; border: 1px solid #e9b9a6; border-radius: 13px; color: #fff; background: var(--brand); box-shadow: 0 7px 18px rgba(240,82,35,.15); font-size: 11px; font-weight: 850; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.plan-card__head > button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(240,82,35,.18); }
.plan-card__head > button:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(240,82,35,.12); }
.plan-card__usage { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 18px; align-items: center; margin-top: 20px; padding-top: 17px; border-top: 1px solid rgba(166,94,68,.14); }
.plan-card__usage > span { display: grid; gap: 4px; }
.plan-card__usage strong { color: var(--brand); font-size: 25px; font-weight: 900; }
.plan-card__usage small { color: var(--muted); font-size: 10px; }
.plan-card__usage > i { width: 1px; height: 34px; background: rgba(166,94,68,.15); }
.account-menu { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-card); }
.account-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 62px; padding: 9px 18px; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.account-menu span { display: grid; gap: 5px; }
.account-menu b { font-size: 14px; font-weight: 850; }
.account-menu small { color: var(--muted); font-size: 10px; }
.account-menu i { color: var(--faint); font-size: 24px; font-style: normal; font-weight: 400; transition: transform .18s ease; }

.bottom-nav { position: fixed; z-index: 50; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 430px); min-height: 78px; margin: 0 auto; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(235,229,226,.96); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
.bottom-nav button { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; min-width: 64px; min-height: 58px; padding: 0; border: 0; color: #726867; background: transparent; font-size: 11px; font-weight: 750; }
.bottom-nav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav button.is-active { color: var(--brand); }
.bottom-nav button.is-active::after { content: ""; position: absolute; bottom: 0; width: 22px; height: 3px; border-radius: 99px; background: var(--brand); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); max-width: calc(100% - 42px); padding: 12px 17px; border: 1px solid #e6d9d4; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 16px 45px rgba(55,37,31,.2); font-size: 12px; transform: translateX(-50%); }

.copy-tutorial { width: min(calc(100% - 40px), 370px); max-height: calc(100dvh - 32px); padding: 20px; overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 80px rgba(55,37,31,.2); }
.copy-tutorial::backdrop { background: rgba(64,45,38,.28); backdrop-filter: blur(3px); }
.copy-tutorial__head { display: flex; align-items: center; justify-content: space-between; color: var(--brand); font-size: 12px; font-weight: 850; }
.copy-tutorial__head button { width: 44px; height: 44px; margin: -11px -11px -11px 0; border: 0; color: var(--muted); background: transparent; font-size: 24px; font-weight: 400; }
.copy-tutorial h2 { margin: 10px 0 13px; font-size: 20px; line-height: 1.4; letter-spacing: -.03em; }
.tutorial-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 12px; padding: 4px; border-radius: 13px; background: #f3eeeb; }
.tutorial-tabs button { min-height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; }
.tutorial-tabs button.is-active { color: #a94a2e; background: #fff; box-shadow: 0 4px 14px rgba(70,45,36,.08); }
.tutorial-panel { animation: tutorial-panel-in .2s ease both; }
.tutorial-image-placeholder { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 96px; margin-bottom: 10px; border: 1.5px dashed #e4d6cf; border-radius: 15px; color: #a06a57; background: #fffaf6; text-align: center; }
.tutorial-image-placeholder::before { content: "▧"; font-size: 21px; }
.tutorial-image-placeholder span { font-size: 12px; font-weight: 800; }
.tutorial-image-placeholder small { color: var(--faint); font-size: 10px; }
.tutorial-image-placeholder--desktop { min-height: 96px; }
.copy-tutorial ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.copy-tutorial li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; min-height: 36px; color: var(--ink-soft); font-size: 13px; }
.copy-tutorial li b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 11px; }
.copy-tutorial > p { margin: 12px 0; padding: 10px 12px; border-radius: 13px; color: var(--muted); background: var(--surface-soft); font-size: 10px; line-height: 1.65; }
.copy-tutorial > .primary-button { width: 100%; min-height: 50px; }
.replay-preview-dialog { width: min(100%,430px); height: 100dvh; max-width: none; max-height: none; margin: 0 auto; padding: 0; overflow: hidden; border: 0; color: var(--ink); background: #f7f5f2; }
.replay-preview-dialog::backdrop { background: rgba(47,35,30,.35); backdrop-filter: blur(3px); }
.replay-preview-dialog[open] { display: grid; grid-template-rows: 58px minmax(0,1fr); }
.replay-preview-dialog__bar { display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) 16px 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.replay-preview-dialog__bar strong { font-size: 14px; font-weight: 850; }
.replay-preview-dialog__bar button { width: 44px; height: 44px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 25px; }
.replay-preview-dialog iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.confirm-dialog { width: min(calc(100% - 40px),350px); padding: 24px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 28px 80px rgba(55,37,31,.22); }
.confirm-dialog::backdrop { background: rgba(64,45,38,.3); backdrop-filter: blur(3px); }
.confirm-dialog h2 { margin: 0; font-size: 20px; }
.confirm-dialog p { margin: 10px 0 20px; color: var(--muted); font-size: 13px; }
.confirm-dialog > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-dialog .secondary-button, .danger-button { min-height: 48px; border-radius: 14px; }
.danger-button { border: 0; color: #fff; background: var(--danger); font-weight: 850; }
@keyframes tutorial-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-height: 720px) {
  .screen--home { padding-top: 14px; }
  .screen--home .brand-lockup img { width: 40px; height: 40px; }
  .screen--home .brand-lockup strong { font-size: 18px; }
  .screen--home .brand-lockup small { font-size: 9px; }
  .screen--home .stepper { margin-top: 12px; }
  .screen--home .stepper > strong { margin-bottom: 7px; font-size: 11px; }
  .screen--home .stepper__bars i { height: 5px; }
  .screen--home .stepper__labels { margin-top: 5px; font-size: 9px; }
  .screen--home .hero-copy { margin: 14px 0 12px; }
  .screen--home .hero-copy h1 { font-size: 25px; line-height: 1.18; }
  .screen--home .source-card { padding: 11px 12px 10px; border-radius: 19px; }
  .screen--home .tutorial-button { min-height: 34px; margin-bottom: 7px; }
  .screen--home .source-card textarea { height: 180px; padding: 11px 12px; border-radius: 14px; font-size: 13px; }
  .screen--home .source-card__meta { min-height: 38px; }
  .screen--home .paste-button { min-height: 38px; }
  .screen--home .primary-button--depth { min-height: 52px; margin-bottom: 3px; border-radius: 16px; font-size: 15px; }
  .screen--home .source-card > .primary-button { margin-top: 18px; }
  .screen--home .form-status:empty { display: none; }
  .screen[data-view="edit"], .screen[data-view="poster"] { padding-top: 14px; padding-bottom: calc(178px + env(safe-area-inset-bottom)); }
  .screen[data-view="edit"] .brand-lockup small, .screen[data-view="poster"] .brand-lockup small { display: none; }
  .screen[data-view="edit"] .stepper--compact, .screen[data-view="poster"] .stepper--compact { margin-top: 10px; }
  .screen[data-view="edit"] .stepper--compact > strong, .screen[data-view="poster"] .stepper--compact > strong { margin-bottom: 5px; }
  .screen[data-view="edit"] .stepper--compact .stepper__labels, .screen[data-view="poster"] .stepper--compact .stepper__labels { display: none; }
  .screen[data-view="edit"] .edit-back-row, .screen[data-view="poster"] .poster-back-row { margin: 6px 0 8px; }
  .screen[data-view="edit"] .preview-phone { height: 205px; }
  .screen[data-view="edit"] .preview-feed { height: 100%; }
  .screen[data-view="edit"] .flow-actions, .screen[data-view="poster"] .flow-actions { position: fixed; z-index: 45; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); width: min(calc(100% - 40px),390px); margin: 0; padding: 10px 0 6px; background: linear-gradient(180deg,rgba(255,253,250,0),var(--canvas) 18%); transform: translateX(-50%); }
  .screen[data-view="edit"] .flow-actions .form-status:empty, .screen[data-view="poster"] .flow-actions .form-status:empty { display: none; }
}

@media (max-width: 359px) {
  .screen { padding-inline: 18px; }
  .brand-lockup strong { font-size: 19px; }
  .hero-copy h1, .page-heading h1, .complete-heading h1 { font-size: 31px; }
  .photo-uploader { grid-template-columns: 58px 1fr; }
  .photo-uploader > i { display: none; }
}

@media (min-width: 720px) {
  .app-shell { margin-block: 18px; min-height: calc(100dvh - 36px); border-radius: 28px; overflow: hidden; }
  .bottom-nav { bottom: 18px; border: 1px solid var(--line); border-radius: 0 0 28px 28px; }
}

/* Allocate the home screen's remaining height to the input, including navigation. */
.screen--home {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 100svh;
  padding-top: clamp(14px, 2.5svh, 24px);
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}
.screen--home > .brand-lockup,
.screen--home > .stepper,
.screen--home > .hero-copy { flex-shrink: 0; }
.screen--home .brand-lockup img { width: 36px; height: 36px; }
.screen--home .brand-lockup strong { font-size: 17px; font-weight: 700; }
.screen--home .brand-lockup small { font-size: 10px; }
.screen--home .hero-copy h1 { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: -.035em; }
.screen--home .stepper { margin-top: clamp(12px, 2.5svh, 22px); }
.screen--home .stepper > strong { margin-bottom: 9px; font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.screen--home .stepper__bars i { height: 5px; }
.screen--home .stepper__labels { margin-top: 7px; font-size: 10px; font-weight: 400; }
.screen--home .stepper__labels .is-active { font-weight: 500; }
.screen--home .primary-button--depth { min-height: 50px; border-radius: 16px; font-size: 15px; font-weight: 600; box-shadow: 0 5px 0 var(--brand-deep), 0 12px 24px rgba(240,82,35,.15); }
.screen--home .primary-button--depth span { font-size: 20px; }
.screen--home .primary-button--depth:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--brand-deep), 0 6px 16px rgba(240,82,35,.12); }
.screen--home .hero-copy { margin: clamp(14px, 2.5svh, 24px) 0 clamp(12px, 2svh, 20px); }
.screen--home .source-card { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px 14px 16px; }
.screen--home .tutorial-button { align-self: flex-start; flex-shrink: 0; min-height: 44px; margin-bottom: 10px; }
.screen--home .source-card textarea { flex: 1; min-height: 60px; height: auto; resize: none; overflow-y: auto; }
.screen--home .source-card__meta { flex-shrink: 0; min-height: 44px; }
.screen--home .source-card > .primary-button { flex-shrink: 0; margin-top: 16px; }
.screen--home .form-status:empty { display: none; }
@media (max-width: 359px) and (max-height: 720px) {
  .screen--home .hero-copy h1 { font-size: 24px; }
}
@media (min-width: 720px) {
  .screen--home { height: calc(100svh - 36px); min-height: calc(100svh - 36px); }
}

/* Shared action geometry across the creation flow. */
.screen[data-view="tasks"] { display: flex; flex-direction: column; height: 100svh; min-height: 100svh; padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.screen[data-view="tasks"] > .brand-lockup, .screen[data-view="tasks"] > .page-heading { flex-shrink: 0; }
.screen[data-view="tasks"] .task-list { min-height: 0; overflow-y: auto; align-content: start; }
[data-membership-plans] { display: grid; gap: 12px; }
[data-membership-plans] button { padding: 12px; line-height: 1.5; white-space: normal; }
:root { --action-height: 50px; --action-radius: 16px; --action-font: 15px; }
.app-shell .screen .primary-button,
.app-shell .screen .secondary-button,
dialog .primary-button,
dialog .secondary-button,
dialog .danger-button {
  min-height: var(--action-height);
  border-radius: var(--action-radius);
  font-size: var(--action-font);
  font-weight: 600;
}
.app-shell .screen .primary-button--depth {
  box-shadow: 0 5px 0 var(--brand-deep), 0 12px 24px rgba(240,82,35,.15);
}
.app-shell .screen .primary-button--depth:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--brand-deep), 0 6px 16px rgba(240,82,35,.12);
}
.app-shell .screen .primary-button span { font-size: 20px; font-weight: 500; }
.tutorial-button, .account-login-button, .plan-card__head > button {
  min-height: 44px; padding-inline: 13px; border-radius: 13px; font-size: 12px; font-weight: 600;
}
.app-shell .screen:is([data-view="edit"], [data-view="poster"]) {
  display: flex; flex-direction: column;
  height: 100svh; min-height: 100svh;
  padding-bottom: calc(111px + env(safe-area-inset-bottom));
}
.app-shell .screen:is([data-view="edit"], [data-view="poster"]) > :not(.replay-preview-card):not(.poster-form-card):not(.flow-actions) { flex-shrink: 0; }
.app-shell .screen:is([data-view="edit"], [data-view="poster"]) .flow-actions {
  position: static; flex-shrink: 0; width: 100%; margin-top: auto; padding: 16px 0 0;
  background: none; transform: none;
}
.app-shell .screen .flow-actions .form-status:empty { display: none; }
.app-shell .screen[data-view="edit"] .replay-preview-card {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.app-shell .screen[data-view="edit"] .preview-phone { flex: 1; min-height: 0; height: auto; }
.app-shell .screen[data-view="edit"] .secondary-button { flex-shrink: 0; }
.app-shell .screen[data-view="poster"] .poster-form-card { min-height: 0; overflow-y: auto; }
.app-shell .screen--complete {
  display: flex; flex-direction: column; height: 100svh; min-height: 100svh;
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}
.app-shell .screen--complete > .brand-lockup { flex-shrink: 0; }
.app-shell .screen--complete .final-poster {
  flex-shrink: 0; width: min(82%, 280px, calc((100svh - 300px - env(safe-area-inset-bottom)) * .75));
}
.app-shell .screen--complete .complete-actions { flex-shrink: 0; margin-top: auto; }
@media (min-width: 720px) {
  .app-shell .screen:is([data-view="edit"], [data-view="poster"]) { height: calc(100svh - 36px); min-height: calc(100svh - 36px); }
  .app-shell .screen--complete { height: calc(100svh - 36px); min-height: calc(100svh - 36px); }
}

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