:root {
  --ink: #172523;
  --muted: #64716c;
  --paper: #f7f5ed;
  --card: #fffdf8;
  --line: #d9dfd4;
  --accent: #e5603e;
  --accent-dark: #bd4426;
  --sage: #c7dfbd;
  --sage-ink: #315e48;
  --gold: #f1c96d;
  --skip: #824341;
  --shadow: 0 18px 50px rgb(30 55 43 / 8%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgb(229 96 62 / 45%); outline-offset: 3px; }

.app-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 60px; }
.hero { max-width: 710px; padding: 10px 0 50px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-family: "Fraunces", serif; }
.eyebrow, .kicker { margin: 0; color: var(--accent-dark); font-family: "DM Mono", monospace; font-size: .73rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.hero .eyebrow { margin-top: 52px; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 650px; margin: 9px 0 16px; font-family: "Fraunces", serif; font-size: clamp(2.7rem, 7vw, 5.25rem); font-weight: 600; letter-spacing: -.055em; line-height: .98; }
h1 em { color: var(--accent); font-style: italic; }
h2 { margin: 3px 0 0; font-family: "Fraunces", serif; font-size: 1.55rem; letter-spacing: -.03em; line-height: 1.08; }
.hero-copy { max-width: 530px; margin: 0; color: var(--muted); font-size: 1.08rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); gap: 24px; align-items: stretch; }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.form-card, .result-card { padding: clamp(24px, 4vw, 40px); }
.result-card { display: flex; flex-direction: column; background: #eef4e9; }
.section-heading, .history-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.step { color: var(--muted); font-family: "DM Mono", monospace; font-size: .7rem; white-space: nowrap; }
form { margin-top: 34px; }
.field-group { margin-bottom: 24px; }
label, legend { display: block; margin-bottom: 9px; font-size: .92rem; font-weight: 600; }
fieldset { min-width: 0; padding: 0; border: 0; }
.label-hint { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="number"], input[type="password"] { width: 100%; min-height: 50px; border: 1px solid #cbd4c8; border-radius: 9px; padding: 0 14px; color: var(--ink); background: #fffefa; transition: border .15s, box-shadow .15s; }
input::placeholder { color: #99a39e; }
input:hover { border-color: #aebbb3; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; top: 13px; left: 14px; color: var(--muted); }
.input-prefix input { padding-left: 29px; }
.range-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: .76rem; }
.range-meta output { color: var(--ink); font-family: "DM Mono", monospace; font-size: .75rem; font-weight: 500; }
input[type="range"] { width: 100%; height: 8px; margin: 9px 0 0; appearance: none; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) 66.67%, #d8ded6 66.67%, #d8ded6 100%); }
input[type="range"]::-webkit-slider-thumb { width: 21px; height: 21px; appearance: none; border: 3px solid var(--card); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgb(0 0 0 / 25%); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid var(--card); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgb(0 0 0 / 25%); }
.range-ticks { display: flex; justify-content: space-between; padding: 0 2px; color: #829088; font-family: "DM Mono", monospace; font-size: .66rem; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice { display: flex; min-height: 50px; align-items: center; gap: 8px; margin: 0; border: 1px solid #d3dbd1; border-radius: 9px; padding: 9px 11px; color: #3e4a45; font-size: .82rem; font-weight: 400; background: #fffefa; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--sage-ink); color: var(--sage-ink); background: #edf6e8; box-shadow: inset 0 0 0 1px var(--sage-ink); }
.choice input { width: 15px; height: 15px; accent-color: var(--sage-ink); }
.ai-details { margin: 5px 0 19px; border-top: 1px solid var(--line); padding-top: 17px; color: var(--muted); }
.ai-details summary { color: var(--ink); font-size: .87rem; font-weight: 600; cursor: pointer; }
.ai-details p { margin: 9px 0 13px; font-size: .8rem; }
.pill { display: inline-block; margin-left: 5px; border-radius: 20px; padding: 2px 6px; color: var(--accent-dark); background: #fce4d9; font-family: "DM Mono", monospace; font-size: .62rem; font-weight: 500; vertical-align: 1px; }
.key-row { display: flex; gap: 8px; }
.text-button { border: 0; padding: 4px 0; color: var(--sage-ink); background: none; font-size: .82rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.key-row .text-button { flex: 0 0 auto; padding: 0 5px; }
.fine-print { color: #7b8780; font-size: .72rem !important; }
.form-message { min-height: 22px; margin: -6px 0 10px; color: #a23328; font-size: .84rem; font-weight: 500; }
.form-message.info { color: var(--sage-ink); }
.primary-button { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; border: 0; border-radius: 9px; padding: 0 18px; color: #fffdf8; background: var(--accent); box-shadow: 0 8px 18px rgb(229 96 62 / 24%); font-weight: 700; transition: transform .15s, background .15s; }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .72; transform: none; }

.empty-result { display: grid; flex: 1; place-content: center; padding: 35px 13px; color: var(--muted); text-align: center; }
.empty-result p { max-width: 245px; margin: 16px 0 0; }
.empty-icon { display: grid; width: 64px; height: 64px; place-self: center; place-items: center; border-radius: 50%; color: var(--sage-ink); background: #dcebd5; font-size: 1.75rem; }
.decision-result { margin-top: auto; padding-top: 44px; }
.verdict-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.verdict { margin: 0; font-family: "Fraunces", serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -.055em; line-height: 1; }
.verdict.buy { color: var(--sage-ink); }
.verdict.wait { color: #936d22; }
.verdict.skip { color: var(--skip); }
.source-badge { flex: 0 0 auto; border-radius: 99px; padding: 4px 8px; color: var(--sage-ink); background: #dcebd5; font-family: "DM Mono", monospace; font-size: .62rem; font-weight: 500; }
.result-item { margin: 10px 0 22px; color: var(--muted); font-size: .92rem; }
.reason { margin: 0 0 26px; font-size: 1.02rem; line-height: 1.6; }
.score-wrap { margin: 0 0 20px; }
.score-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: .75rem; }
.score-meta strong { color: var(--ink); font-family: "DM Mono", monospace; font-weight: 500; }
.score-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #d6e2d2; }
.score-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sage-ink); transition: width .45s ease; }
.considerations { display: grid; gap: 7px; }
.consideration { display: flex; gap: 8px; color: #486056; font-size: .82rem; }
.consideration::before { content: "·"; color: var(--accent); font-weight: 700; }
.next-step { margin: 21px 0 0; border-top: 1px solid #d4e0d0; padding-top: 16px; color: var(--sage-ink); font-size: .84rem; font-weight: 700; }
.saved-confirmation { margin: 14px 0 0; color: var(--sage-ink); font-size: .77rem; }

.history-section { margin-top: 80px; border-top: 1px solid var(--line); padding-top: 45px; }
.history-heading { margin-bottom: 24px; }
.history-copy { max-width: 560px; margin: 9px 0 0; color: var(--muted); }
.danger-button { color: #a44740; white-space: nowrap; }
.history-empty { border: 1px dashed #c4cec1; border-radius: 12px; padding: 25px; color: var(--muted); text-align: center; }
.history-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 17px 18px; background: var(--card); }
.history-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.history-item h3 { margin: 0; font-size: 1rem; }
.history-verdict { color: var(--sage-ink); font-family: "DM Mono", monospace; font-size: .7rem; font-weight: 500; text-transform: uppercase; }
.history-verdict.wait { color: #936d22; }.history-verdict.skip { color: var(--skip); }
.history-meta, .history-note { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.history-note { color: var(--sage-ink); font-weight: 600; }
.outcome-control { min-width: 138px; border: 1px solid #ccd6c9; border-radius: 7px; padding: 7px 8px; color: var(--ink); background: #fffefa; font-size: .78rem; }
footer { padding: 0 20px 34px; color: #7d8982; font-size: .75rem; text-align: center; }

@media (max-width: 780px) { .workspace { grid-template-columns: 1fr; }.result-card { min-height: 430px; }.decision-result { margin-top: 0; }.history-section { margin-top: 58px; } }
@media (max-width: 510px) { .app-shell { width: min(100% - 28px, 1120px); padding-top: 20px; }.hero { padding-bottom: 33px; }.hero .eyebrow { margin-top: 35px; }.form-card, .result-card { padding: 23px 19px; }.field-grid, .choice-grid { grid-template-columns: 1fr; }.range-meta span { max-width: 96px; }.history-item { grid-template-columns: 1fr; }.outcome-control { width: 100%; }.history-heading { display: block; }.danger-button { margin-top: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
