:root {
  --bg: #f7f6f0;
  --surface: #fffefb;
  --surface-2: #f0f5e8;
  --ink: #17231a;
  --muted: #687167;
  --line: #dfe3d7;
  --brand: #246b42;
  --brand-2: #348a59;
  --brand-soft: #e3f1df;
  --navy: #183849;
  --orange: #b5612d;
  --orange-soft: #f8eadf;
  --shadow: 0 18px 60px rgba(25, 58, 46, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(52,138,89,.10), transparent 30%),
    radial-gradient(circle at 95% 12%, rgba(181,97,45,.08), transparent 28%),
    var(--bg);
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(52,138,89,.35); outline-offset: 2px;
}
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px max(20px, calc((100vw - 1440px)/2));
  background: rgba(247,246,240,.9); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(223,227,215,.9);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg,var(--brand),var(--navy)); color: #fff; font-size: 23px; font-weight: 900; box-shadow: 0 8px 22px rgba(36,107,66,.20); }
.brand-wrap strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand-wrap span { display: block; font-size: 12px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
.status-pill::before { content:""; width: 8px; height: 8px; border-radius: 99px; background: #929991; }
.status-pill.ready { color: var(--brand); background: #f4fbf3; border-color: #bddbbd; }
.status-pill.ready::before { background: var(--brand-2); box-shadow: 0 0 0 4px rgba(52,138,89,.13); }

.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 26px; padding: 58px 0 24px; }
.hero-copy, .hero-card { border-radius: 30px; box-shadow: var(--shadow); }
.hero-copy { position: relative; overflow: hidden; padding: 54px; color: #fff; background: linear-gradient(135deg, rgba(24,56,73,.98), rgba(36,107,66,.95)); }
.hero-copy::before { content:""; position:absolute; right:-70px; top:-110px; width:280px; height:280px; border:44px solid rgba(255,255,255,.07); border-radius:50%; }
.hero-copy::after { content:""; position:absolute; right:80px; bottom:-100px; width:220px; height:220px; border:30px solid rgba(241,218,194,.09); border-radius:50%; }
.hero-copy .eyebrow { color:#b6efd0; }
h1 { max-width: 900px; margin: 8px 0 16px; font-size: clamp(39px,5vw,72px); line-height:.98; letter-spacing:-.055em; }
.lede { max-width: 850px; margin:0; color:rgba(255,255,255,.84); font-size:clamp(16px,1.5vw,21px); }
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }
.hero-card { display:grid; align-content:center; gap:14px; padding:28px; background:linear-gradient(180deg,#fffefb,#f6f7f0); border:1px solid var(--line); }
.mini-step { display:grid; grid-template-columns:42px 1fr; gap:12px; align-items:center; padding:17px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.mini-step>span { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:var(--brand-soft); color:var(--brand); font-weight:900; }
.mini-step strong,.mini-step small { display:block; }
.mini-step small { color:var(--muted); }

.impact-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
.impact-strip>div { padding:14px 16px; border:1px solid var(--line); border-radius:15px; background:rgba(255,254,251,.86); }
.impact-strip strong { display:block; font-size:13px; color:var(--navy); }
.impact-strip span { display:block; margin-top:2px; font-size:11px; color:var(--muted); }

.eyebrow { margin:0; font-size:11px; font-weight:900; letter-spacing:.14em; color:var(--brand); }
h2 { margin:3px 0 0; font-size:23px; line-height:1.15; letter-spacing:-.03em; }
h3 { margin:0; line-height:1.2; letter-spacing:-.02em; }
.card { background:rgba(255,254,251,.96); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.primary,.secondary,.ghost,.text-button,.icon-button { border:0; border-radius:13px; font-weight:850; transition:transform .15s ease,background .15s ease,box-shadow .15s ease; }
.primary { padding:12px 16px; background:var(--brand); color:#fff; box-shadow:0 8px 18px rgba(36,107,66,.18); }
.primary:hover { background:var(--brand-2); transform:translateY(-1px); }
.hero .primary { background:#fff; color:var(--navy); }
.hero .primary:hover { background:#effff5; }
.secondary { padding:12px 16px; background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.26); }
.secondary:hover { background:rgba(255,255,255,.18); }
.ghost { padding:10px 12px; background:#f6f8f2; color:var(--navy); border:1px solid var(--line); }
.ghost:hover { background:var(--brand-soft); }
.text-button { background:transparent; color:var(--brand); padding:6px; }
.icon-button { width:38px; height:38px; background:#f2f4ec; color:var(--navy); font-size:22px; }
.full-button { width:100%; margin-top:20px; }

.workspace { display:grid; grid-template-columns:300px minmax(0,1fr) 320px; gap:18px; align-items:start; }
.profile,.results,.plan { padding:22px; }
.profile,.plan { position:sticky; top:88px; }
.field-label { display:block; margin:16px 0 6px; font-size:12px; font-weight:850; }
input[type="text"],input[type="date"],select,textarea { width:100%; border:1px solid var(--line); border-radius:12px; padding:11px 12px; color:var(--ink); background:#fff; }
.tip { margin-top:20px; padding:15px; border-radius:15px; background:var(--surface-2); border:1px solid #d7e7cf; }
.tip strong { font-size:12px; color:var(--brand); }
.tip p { margin:7px 0 0; color:var(--muted); font-size:12px; }
.count { font-size:12px; font-weight:850; color:var(--muted); background:#f2f4ed; border-radius:999px; padding:7px 10px; }
.results-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:20px; }
.option-card { position:relative; display:flex; flex-direction:column; min-height:320px; padding:18px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(180deg,#fff,#fcfdf9); }
.option-card.selected { border-color:#80bf93; box-shadow:inset 0 0 0 2px rgba(52,138,89,.13); }
.option-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.option-type { display:inline-block; margin:5px 0 11px; padding:4px 8px; border-radius:999px; background:var(--orange-soft); color:var(--orange); font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.score-badge { min-width:64px; text-align:center; padding:8px 9px; border-radius:12px; background:var(--brand-soft); color:var(--brand); font-weight:900; }
.score-badge small { display:block; font-size:8px; color:#50725b; letter-spacing:.06em; }
.option-summary { margin:0; color:var(--muted); font-size:13px; }
.meta-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; margin-top:14px; }
.meta { padding:8px 9px; border:1px solid #e6e9df; border-radius:11px; background:#fafbf7; }
.meta strong { display:block; font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.meta span { display:block; margin-top:2px; font-size:12px; font-weight:800; }
.option-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; padding-top:16px; }
.saved-star { color:#c17725; font-size:17px; }

.empty-state { display:grid; place-items:center; text-align:center; min-height:260px; color:var(--muted); }
.empty-state p { margin:8px 0 2px; color:var(--ink); font-weight:850; }
.empty-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:17px; background:var(--brand-soft); color:var(--brand); font-size:24px; font-weight:900; }
.plan-hero { margin-top:18px; padding:16px; border:1px solid #cfe2ca; border-radius:15px; background:linear-gradient(135deg,var(--surface-2),#fff); }
.plan-hero strong { display:block; }
.plan-hero span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.checklist { list-style:none; padding:0; margin:12px 0 0; }
.checklist li { display:grid; grid-template-columns:24px 1fr; gap:9px; padding:9px 0; border-bottom:1px solid #ecefe7; font-size:12px; }
.checklist li::before { content:"✓"; width:21px; height:21px; display:grid; place-items:center; border-radius:8px; background:var(--brand-soft); color:var(--brand); font-weight:900; }

.split-section { display:grid; grid-template-columns:1.08fr .92fr; gap:18px; margin-top:18px; }
.tools-panel,.activity-panel,.why-section,.handoff-section { padding:24px; }
.tool-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:18px; }
.tool-item { padding:14px; border:1px solid var(--line); border-radius:15px; background:#fcfdf9; }
.tool-item code { font-size:12px; font-weight:900; color:var(--brand); word-break:break-word; }
.tool-item p { margin:6px 0 0; color:var(--muted); font-size:12px; }
.tool-kind { display:inline-block; margin-top:8px; padding:4px 7px; border-radius:999px; background:#eef2f4; color:var(--navy); font-size:9px; font-weight:900; letter-spacing:.05em; }
.activity-log { max-height:330px; overflow:auto; margin:18px 0 0; padding-left:23px; }
.activity-log li { padding:8px 4px; border-bottom:1px solid #ecefe7; color:var(--muted); font-size:12px; }
.activity-log strong { color:var(--ink); }

.handoff-section { margin-top:18px; }
.handoff-wrap { display:grid; grid-template-columns:.8fr 1.2fr; gap:22px; align-items:start; }
.handoff-copy>p:not(.eyebrow) { color:var(--muted); }
.safety-note { margin-top:16px; padding:12px 14px; border-radius:13px; background:#fff7ea; border:1px solid #eddabb; color:#7b5628; font-size:12px; font-weight:700; }
.handoff-form { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:18px; border:1px solid var(--line); border-radius:17px; background:#fcfdf9; }
.handoff-form .full { grid-column:1/-1; }
.handoff-form label { display:block; margin-bottom:5px; font-size:12px; font-weight:850; }
.form-note { margin:8px 0 0; color:var(--muted); font-size:11px; }
form:tool-form-active { outline:3px dashed var(--brand-2); outline-offset:5px; }
button:tool-submit-active { outline:3px dashed var(--orange); outline-offset:4px; }

.why-section { margin-top:18px; }
.why-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:18px; }
.why-grid article { padding:16px; border:1px solid var(--line); border-radius:15px; background:#fcfdf9; }
.why-grid strong { color:var(--navy); }
.why-grid p { margin:7px 0 0; color:var(--muted); font-size:12px; }

dialog { border:0; padding:0; background:transparent; }
dialog::backdrop { background:rgba(9,26,21,.46); backdrop-filter:blur(4px); }
.dialog-card { width:min(760px,calc(100vw - 30px)); border:0; border-radius:24px; padding:0; overflow:hidden; box-shadow:0 25px 100px rgba(0,0,0,.22); }
.dialog-head { display:flex; justify-content:space-between; gap:12px; padding:23px; border-bottom:1px solid var(--line); }
#dialogBody { padding:23px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.detail-item { padding:13px; border:1px solid var(--line); border-radius:14px; background:#fcfdf9; }
.detail-item strong { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.detail-item span { display:block; margin-top:4px; font-size:12px; }
.toast { position:fixed; right:20px; bottom:20px; z-index:50; max-width:360px; padding:13px 16px; border-radius:14px; background:var(--navy); color:#fff; box-shadow:0 15px 40px rgba(0,0,0,.2); opacity:0; transform:translateY(10px); pointer-events:none; transition:.2s ease; }
.toast.show { opacity:1; transform:translateY(0); }
.footer { padding:28px 0 42px; color:var(--muted); font-size:12px; }
.footer p { margin:0; }

@media (max-width:1120px) {
  .workspace { grid-template-columns:270px 1fr; }
  .plan { grid-column:1/-1; position:static; }
  .profile { top:82px; }
  .why-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:820px) {
  .shell { width:min(100% - 24px,1440px); }
  .hero { grid-template-columns:1fr; padding-top:26px; }
  .hero-copy { padding:34px 24px; }
  .impact-strip { grid-template-columns:repeat(2,1fr); }
  .workspace,.split-section,.handoff-wrap { grid-template-columns:1fr; }
  .profile { position:static; }
  .results-grid,.tool-list { grid-template-columns:1fr; }
  .handoff-form { grid-template-columns:1fr; }
  .handoff-form>* { grid-column:1/-1; }
}
@media (max-width:520px) {
  .topbar { padding:10px 12px; }
  .brand-wrap span { display:none; }
  .status-pill { max-width:165px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  h1 { font-size:40px; }
  .impact-strip,.why-grid,.detail-grid,.meta-grid { grid-template-columns:1fr; }
}
