:root {
  --ink: #312a31;
  --ink-soft: #766f75;
  --paper: #f3f1ed;
  --paper-deep: #e9e5df;
  --card: rgba(255, 254, 251, 0.94);
  --line: rgba(49, 42, 49, 0.16);
  --accent: #cf705e;
  --accent-dark: #9e5148;
  --acid: #dce99b;
  --white: #fffdfa;
  --mono: "DM Mono", monospace;
  --sans: "DM Sans", sans-serif;
  --display: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(207, 112, 94, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 91%, rgba(220, 233, 155, 0.26), transparent 31rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(49, 42, 49, 0.08);
  border-radius: 50%;
}

.ambient-one { width: 48rem; height: 48rem; left: -26rem; top: 35%; }
.ambient-two { width: 38rem; height: 38rem; right: -22rem; top: -16rem; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 1480px);
  margin: 0 auto;
  padding: 28px 0 25px;
}

.topbar, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
}

.topbar { min-height: 50px; margin-bottom: 46px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(49, 42, 49, 0.46);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
}
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-family: var(--display); font-size: 20px; line-height: 1; letter-spacing: 0.02em; }
.brand-subtitle, .topbar-status, .rail-index, .eyebrow, .section-kicker, .result-label, .output-state, .footer {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.brand-subtitle { color: rgba(49, 42, 49, 0.55); font-size: 8px; }
.topbar-status { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 9px; }
.status-dot, .result-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(214, 233, 130, 0.12); }

.content-grid {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: clamp(30px, 5vw, 88px);
  align-items: start;
}

.intro-rail { min-height: 780px; color: rgba(49, 42, 49, 0.58); position: relative; display: flex; flex-direction: column; align-items: center; }
.rail-index { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9px; }
.rail-line { width: 1px; flex: 1; min-height: 510px; margin: 19px 0; background: linear-gradient(to bottom, rgba(49,42,49,.32), transparent); }
.rail-note { width: 170px; margin: 0; color: rgba(49, 42, 49, 0.55); font-size: 11px; line-height: 1.45; writing-mode: vertical-rl; transform: rotate(180deg); }
.rail-stamp { margin-top: auto; color: var(--accent); font-family: var(--display); font-size: 17px; line-height: .84; text-align: center; }
.rail-stamp span { font-family: var(--mono); font-size: 7px; letter-spacing: .08em; }

.form-column, .output-column { min-width: 0; animation: rise-in .75s both; }
.output-column { animation-delay: .11s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.section-kicker { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 9px; }
.section-kicker span { width: 24px; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 650px; margin: 22px 0 15px; color: var(--ink); font-family: var(--display); font-size: clamp(42px, 5vw, 78px); line-height: .98; letter-spacing: -0.047em; }
.lead { max-width: 500px; margin-bottom: 65px; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }

.form-heading, .result-card-header, .output-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.form-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 8px; }
.form-heading h2, .output-intro h2 { margin: 6px 0 0; font-family: var(--display); font-weight: 600; }
.form-heading h2 { color: var(--ink); font-size: 25px; letter-spacing: -.025em; }
.text-button { padding: 3px 0; border: 0; color: var(--accent-dark); background: transparent; font-family: var(--mono); font-size: 9px; letter-spacing: .03em; }
.text-button span { color: var(--ink); font-size: 13px; }

.entry-controls { display: grid; grid-template-columns: minmax(155px, .46fr) minmax(0, 1fr); align-items: start; gap: 22px; margin-top: 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.input-mode-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.input-mode-fieldset .field-label { display: block; margin-bottom: 9px; }
.input-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.input-mode-option { position: relative; display: flex; min-width: 0; cursor: pointer; }
.input-mode-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.input-mode-copy { display: grid; gap: 4px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: rgba(255, 254, 251, .4); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.input-mode-copy strong { color: var(--ink); font-size: 10px; font-weight: 600; line-height: 1.25; }
.input-mode-copy small { color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.input-mode-option input:checked + .input-mode-copy { border-color: var(--accent); background: rgba(207, 112, 94, .09); box-shadow: inset 3px 0 0 var(--accent); }
.input-mode-option input:focus-visible + .input-mode-copy { outline: 2px solid var(--accent); outline-offset: 3px; }
.input-mode-option:hover .input-mode-copy { border-color: var(--accent-dark); transform: translateY(-1px); }

.field { display: grid; gap: 9px; min-width: 0; }
.field-row { display: grid; gap: 20px; }
.split-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.individual-fields, .complete-fields { margin-top: 25px; }
.individual-fields > .field-row + .field,
.individual-fields > .field-row + .clothing-fields { margin-top: 26px; }
.clothing-fields { margin-top: 29px; padding-top: 0; }
.optional-row { margin-top: 0 !important; }
.field-label { color: var(--ink); font-size: 11px; font-weight: 600; }
.field-label b { color: var(--accent); font-weight: 600; }
input, textarea, select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(49, 42, 49, .28);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  transition: border-color .2s ease, background .2s ease;
}
input, select { min-height: 39px; padding: 0 0 10px; }
textarea { min-height: 116px; padding: 8px 0 10px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent-dark) 50%), linear-gradient(135deg, var(--accent-dark) 50%, transparent 50%); background-position: calc(100% - 8px) 17px, calc(100% - 3px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select option { color: var(--ink); background: var(--paper); }
input::placeholder, textarea::placeholder { color: rgba(49, 42, 49, .42); }
input:focus, textarea:focus, select:focus { border-color: var(--acid); background: rgba(214, 233, 130, .035); }
.field-hint { color: var(--ink-soft); font-size: 10px; line-height: 1.35; }
.character-count { text-align: right; font-family: var(--mono); font-size: 9px; }
.mode-note { margin: 13px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }

.form-section-label { display: flex; align-items: center; gap: 9px; margin: 1px 0 19px; color: var(--accent-dark); font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.form-section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-section-label span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid rgba(158, 81, 72, .38); border-radius: 50%; color: var(--accent-dark); font-size: 8px; }
.optional-section-label { margin-top: 34px; margin-bottom: 16px; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 37px; padding-top: 20px; border-top: 1px solid var(--line); }
.truth-check { display: flex; align-items: center; gap: 10px; max-width: 280px; color: var(--ink-soft); font-size: 10px; line-height: 1.35; cursor: pointer; }
.truth-check input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.custom-check { display: grid; flex: 0 0 auto; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(49, 42, 49, .4); transition: .2s ease; }
.truth-check input:checked + .custom-check { border-color: var(--acid); background: var(--acid); }
.truth-check input:checked + .custom-check::after { content: "✓"; color: var(--ink); font-size: 12px; font-weight: 700; }
.truth-check input:focus-visible + .custom-check { outline: 2px solid var(--acid); outline-offset: 3px; }
.primary-button { display: inline-flex; align-items: center; gap: 28px; min-height: 52px; padding: 0 17px 0 20px; border: 1px solid var(--accent); color: var(--ink); background: var(--accent); font-size: 11px; font-weight: 700; transition: background .2s ease, transform .2s ease, border-color .2s ease; }
.primary-button:hover { border-color: var(--acid); background: var(--acid); transform: translateY(-2px); }
.primary-button:disabled { cursor: wait; opacity: .62; transform: none; }
.button-arrow { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 14px; }
.form-error { margin: 16px 0 0; color: var(--accent-dark); font-size: 11px; line-height: 1.45; }

.output-column { padding: 27px; color: var(--ink); background: var(--white); border: 1px solid rgba(49, 42, 49, .11); box-shadow: 0 24px 80px rgba(49, 42, 49, .1); }
.output-topline { align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.output-topline .section-kicker { color: var(--accent-dark); }
.output-state { color: var(--ink-soft); font-size: 8px; }
.output-intro { padding: 29px 0 23px; }
.output-intro .eyebrow { color: var(--accent-dark); }
.output-intro h2 { font-size: 31px; line-height: 1.05; letter-spacing: -.03em; }
.empty-output { display: grid; place-items: center; min-height: 455px; padding: 30px; border: 1px dashed rgba(49, 42, 49, .24); background: rgba(243, 241, 237, .5); text-align: center; }
.empty-orbit { display: grid; place-items: center; width: 98px; height: 98px; border: 1px solid rgba(43, 30, 45, .26); border-radius: 50%; position: relative; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; inset: 12px -8px; border: 1px solid rgba(216, 111, 88, .4); border-radius: 50%; transform: rotate(43deg); }
.empty-orbit::after { inset: -8px 12px; transform: rotate(-43deg); }
.empty-orbit span { color: var(--accent-dark); font-family: var(--display); font-size: 22px; }
.empty-output p { margin: 30px 0 4px; font-family: var(--display); font-size: 20px; }
.empty-output > span { color: var(--ink-soft); font-size: 11px; }
.questions-card { padding: 22px; border: 1px solid rgba(216, 111, 88, .4); background: #f8e7dc; }
.questions-card h3 { margin: 12px 0 14px; font-family: var(--display); font-size: 25px; line-height: 1.05; }
.questions-card ul { margin: 0; padding-left: 17px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.questions-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 10px; }
.result-label { display: flex; align-items: center; gap: 8px; color: var(--accent-dark); font-size: 8px; }
.question-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(216, 111, 88, .12); }
.generated-output { display: grid; gap: 18px; }
.result-card { padding: 20px; border: 1px solid var(--line); background: var(--card); }
.result-card-header { align-items: center; }
.result-card h3 { margin: 7px 0 0; font-family: var(--display); font-size: 24px; line-height: 1; letter-spacing: -.025em; }
.copy-button { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-family: var(--mono); font-size: 9px; transition: .2s ease; }
.copy-button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.copy-button span { color: var(--accent-dark); }
.preview-frame-wrap { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.preview-frame-wrap iframe { display: block; width: 100%; height: 315px; border: 0; background: #fff; }
.source-details { margin-top: 13px; }
.source-details summary { color: var(--ink-soft); cursor: pointer; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.source-details pre { max-height: 250px; margin: 12px 0 0; padding: 14px; overflow: auto; color: var(--paper); background: var(--ink); font-family: var(--mono); font-size: 10px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.seo-card { background: var(--acid); border-color: rgba(43, 30, 45, .2); }
.seo-card .result-label { color: var(--ink); }
.seo-dot { background: var(--ink); box-shadow: 0 0 0 4px rgba(43, 30, 45, .12); }
.seo-output { margin: 18px 0 0; color: var(--ink); font-size: 12px; line-height: 1.6; }
.output-footnote { margin: 20px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.footer { margin-top: 44px; padding-top: 19px; border-top: 1px solid var(--line); color: rgba(49, 42, 49, .52); font-size: 8px; }
.footer span:last-child { color: var(--accent-dark); }
.toast { position: fixed; z-index: 4; right: 22px; bottom: 22px; max-width: 290px; padding: 13px 15px; border: 1px solid var(--acid); color: var(--ink); background: var(--acid); box-shadow: 0 12px 35px rgba(8, 2, 10, .2); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .22s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .content-grid { grid-template-columns: 42px minmax(0, 1fr); gap: 28px; }
  .output-column { grid-column: 2; }
  .intro-rail { min-height: 100%; }
  .rail-line { min-height: 560px; }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 28px, 560px); padding-top: 17px; }
  .topbar { margin-bottom: 38px; }
  .topbar-status { font-size: 7px; }
  .content-grid { display: block; }
  .intro-rail { display: none; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .lead { margin-bottom: 43px; }
  .entry-controls { grid-template-columns: 1fr; gap: 22px; }
  .input-mode-options { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr; gap: 22px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .truth-check { max-width: none; }
  .primary-button { justify-content: space-between; }
  .output-column { margin-top: 55px; padding: 19px; }
  .output-intro h2 { font-size: 28px; }
  .result-card-header { align-items: flex-start; flex-direction: column; }
  .copy-button { align-self: stretch; }
  .footer { align-items: flex-start; flex-direction: column; gap: 7px; }
}

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