:root {
  --ink: #10162b;
  --muted: #687080;
  --line: #deddd9;
  --paper: #fbfaf7;
  --card: rgba(255, 255, 255, .76);
  --orange: #ff5c22;
  --orange-dark: #d9400c;
  --orange-soft: #fff0e8;
  --navy: #1a1a2e;
  --green: #4d9c55;
  --blue: #248ccc;
  --violet: #7756db;
  --shadow: 0 20px 60px rgba(31, 26, 18, .08);
  --focus: 0 0 0 3px rgba(37, 116, 255, .32);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 38%, rgba(255, 234, 217, .35), transparent 28rem),
    linear-gradient(120deg, #fff 0%, var(--paper) 58%, #f9f7f2 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 248px;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 14px 16px;
  color: #fff;
  background: var(--navy);
}

.brand { display: flex; align-items: center; gap: 9px; padding: 0 10px 22px; color: var(--orange); text-decoration: none; font-size: 22px; }
.brand strong { display: block; font-weight: 800; }
.brand small { display: block; margin-top: 2px; color: #85879b; font-size: 9px; font-weight: 500; }
.brand svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.account-card { width: 100%; min-height: 42px; margin-bottom: 14px; padding: 0 12px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #272733; background: #fff; text-align: left; cursor: pointer; font-size: 12px; }
.getting-started { width: 100%; margin-bottom: 17px; padding: 10px 11px 8px; border: 1px solid rgba(255,92,34,.42); border-radius: 9px; color: #ff8462; background: rgba(255,92,34,.08); cursor: pointer; text-align: left; }
.getting-started > span { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.getting-started small { font-size: 9px; }
.getting-started i { display: block; height: 3px; margin-top: 8px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.16); }
.getting-started b { display: block; width: 80%; height: 100%; background: var(--orange); }
.nav-label { margin: 0 10px 7px; color: #686a82; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.rail-nav { display: grid; gap: 4px; }
.rail-item {
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #e6e7ef;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.rail-item small { color: #77798d; }
.rail-item svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.rail-item:hover { background: rgba(255,255,255,.06); }
.rail-item.active { color: var(--orange); border-color: rgba(255,92,34,.22); background: rgba(255,92,34,.08); box-shadow: inset 3px 0 var(--orange); }
.rail-footer { margin-top: auto; display: grid; gap: 3px; }
.profile-button { width: 100%; padding: 9px 8px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 9px; border: 0; border-radius: 9px; color: white; background: transparent; cursor: pointer; text-align: left; }
.profile-button:hover { background: rgba(255,255,255,.06); }
.profile-button > span:last-child { min-width: 0; }
.profile-button strong, .profile-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button strong { font-size: 11px; }
.profile-button small { margin-top: 2px; color: #8d8fa2; font-size: 9px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.26); border-radius: 50%; color: #17182b; background: #fff; font-size: 11px; font-weight: 700; }
.footer-link { min-height: 34px; padding: 0 11px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; color: #c7c8d2; background: transparent; cursor: pointer; font-size: 11px; }
.footer-link:hover { color: white; background: rgba(255,255,255,.05); }

.shell-topbar { position: sticky; top: 0; z-index: 19; height: 64px; margin-left: 248px; padding: 0 26px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.shell-title { min-width: 0; display: grid; gap: 3px; }
.shell-title strong { font-size: 18px; letter-spacing: -.35px; }
.shell-title small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.shell-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.shell-search { height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; cursor: pointer; font-size: 12px; }
.shell-search kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #f7f6f2; font-size: 9px; }
.shell-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; }
.shell-icon:hover { background: #f4f2ed; }
.shell-icon svg, .shell-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.shell-explore { height: 38px; margin-left: 6px; padding: 0 14px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; color: #fff; background: #FF7033; cursor: pointer; font-size: 11px; font-weight: 720; }
.shell-explore:hover { background: var(--orange-dark); }

.page {
  min-height: calc(100vh - 64px);
  margin-left: 248px;
  padding: clamp(32px, 5vw, 72px) clamp(30px, 5.5vw, 92px) 28px;
  display: flex;
  flex-direction: column;
}

.outcome-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font-size: 14px; font-weight: 650; letter-spacing: .03em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4vw, 62px); font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.lede { margin: 14px 0 0; color: var(--muted); font-size: clamp(16px, 1.4vw, 20px); }
.ask-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 24px;
  border: 1.5px solid var(--orange);
  border-radius: 18px;
  color: var(--orange-dark);
  background: rgba(255,255,255,.66);
  box-shadow: 0 9px 30px rgba(255,92,34,.05);
  cursor: pointer;
  font-weight: 680;
}
.ask-button svg { width: 24px; fill: none; stroke: var(--orange); stroke-width: 1.6; }
.ask-button:hover { color: #fff; background: var(--orange); }
.ask-button:hover svg { stroke: #fff; }

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(390px, 1.22fr) minmax(250px, .7fr);
  gap: clamp(18px, 2vw, 30px);
  align-items: start;
  margin-top: clamp(36px, 5vw, 68px);
}
.outcomes-column { position: relative; padding-left: 28px; }
.journey-line { position: absolute; top: 72px; bottom: 50px; left: 12px; width: 1px; background: var(--line); }
.outcome-list { display: grid; gap: 18px; }
.outcome {
  position: relative;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 17px;
  align-items: center;
  width: 100%;
  min-height: 112px;
  padding: 18px 24px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 60px;
  text-align: left;
  background: rgba(255,255,255,.52);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.outcome::before { content: ""; position: absolute; left: -24px; width: 12px; height: 12px; border: 1px solid #c7c6c1; border-radius: 50%; background: var(--paper); }
.outcome:hover { transform: translateX(4px); border-color: #c6c4bd; background: #fff; }
.outcome[aria-selected="true"] { border-color: var(--orange); border-radius: 80px 24px 24px 80px; background: linear-gradient(110deg, rgba(255,251,247,.95), rgba(255,239,229,.62)); box-shadow: 0 18px 46px rgba(255,92,34,.07); }
.outcome[aria-selected="true"]::before { left: -25px; width: 14px; height: 14px; border-color: var(--orange); background: var(--orange); }
.outcome-icon { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 50%; color: var(--item-color); background: var(--item-soft); box-shadow: 0 5px 18px rgba(22,24,35,.08); font-size: 28px; }
.outcome-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.outcome-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.outcome h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 1.7vw, 26px); font-weight: 600; }
.status-pill { padding: 3px 8px; border-radius: 20px; color: #bf3c0f; background: #ffe4d6; font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.signal-line { margin: 9px 0 8px; color: var(--muted); font-size: 14px; }
.progress { display: flex; align-items: center; gap: 9px; }
.progress-track { width: min(140px, 70%); height: 5px; overflow: hidden; border-radius: 10px; background: #e7e5e0; }
.progress-bar { display: block; height: 100%; border-radius: inherit; background: var(--item-color); }
.progress small { color: var(--muted); font-size: 12px; }
.chevron { color: var(--muted); font-size: 26px; transition: transform .18s; }
.outcome[aria-selected="true"] .chevron { color: var(--orange); transform: translateX(3px); }

.decision-card {
  position: relative;
  min-height: 335px;
  padding: clamp(25px, 3vw, 42px);
  border: 1px solid #f3c7ad;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(255,245,236,.75));
  box-shadow: var(--shadow);
  transition: opacity .14s ease, transform .14s ease;
}
.decision-card.changing { opacity: .3; transform: translateY(4px); }
.decision-heading { display: flex; gap: 18px; align-items: center; }
.decision-icon { display: grid; flex: 0 0 auto; width: 58px; height: 58px; place-items: center; border: 1px solid #ff9d73; border-radius: 50%; color: var(--orange); background: var(--orange-soft); font-size: 27px; }
.mini-label { margin: 0 0 7px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.decision-card h2, .panel-header h2 { margin: 0; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.02em; }
.evidence-row { display: flex; gap: 30px; margin: 32px 0; }
.metric { display: flex; align-items: center; gap: 10px; padding-right: 30px; border-right: 1px solid #e0dbd4; }
.metric:last-child { border: 0; padding-right: 0; }
.metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--orange-dark); background: #ffe7d4; font-size: 18px; }
.metric span:last-child { display: grid; gap: 2px; }
.metric strong { font-size: 14px; }
.metric small { color: var(--muted); font-size: 11px; }
.summary { max-width: 610px; min-height: 48px; margin: 0; color: #4d5360; line-height: 1.6; }
.decision-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 27px; }
.text-button { border: 0; color: var(--orange-dark); background: transparent; cursor: pointer; font-weight: 680; text-decoration: underline; text-decoration-color: #ffc1a5; text-underline-offset: 4px; }
.primary-button, .secondary-button {
  min-height: 49px;
  padding: 0 22px;
  border: 1px solid var(--orange);
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
}
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 35px; color: #fff; background: linear-gradient(135deg, #ff4f0d, #ff682b); box-shadow: 0 10px 24px rgba(255,92,34,.18); }
.primary-button:hover { background: var(--orange-dark); }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--line); }

.nudge-card { min-height: 242px; padding: 28px 24px 22px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); }
.spark { color: var(--orange); font-size: 25px; }
.nudge-card > p { min-height: 64px; margin: 16px 0 10px; padding: 20px; border: 1px solid #e3e1dc; border-radius: 15px; background: linear-gradient(135deg, #fff, #f7f7f5); color: #343a46; line-height: 1.45; }
.nudge-card time { color: var(--muted); font-size: 12px; }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.chip:hover { border-color: #aaa8a2; }
.chip.accent { color: var(--orange-dark); border-color: var(--orange); }

.lifecycle { display: flex; align-items: center; margin-top: auto; padding: 17px 26px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.58); }
.life-step { display: flex; flex: 0 0 auto; align-items: center; gap: 11px; padding: 3px; border: 0; color: var(--ink); background: transparent; cursor: pointer; font-weight: 650; }
.life-step.active { color: var(--orange-dark); }
.life-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 20px; }
.life-step.active .life-icon { border-color: var(--orange); color: var(--orange); }
.connector { position: relative; flex: 1 1 80px; height: 1px; margin: 0 18px; background: #c4c4c0; }
.connector::after { content: ""; position: absolute; right: -2px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #9c9da1; }
.connector.done { background: linear-gradient(90deg, var(--orange), #ffb193); }

.scrim { position: fixed; inset: 0; z-index: 49; background: rgba(8, 12, 29, .32); backdrop-filter: blur(3px); }
.chat-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  display: flex;
  width: min(450px, 100vw);
  flex-direction: column;
  padding: 28px;
  background: #fffdf9;
  box-shadow: -20px 0 70px rgba(5,8,24,.2);
  animation: slideIn .25s ease both;
}
.chat-panel[hidden], .scrim[hidden] { display: none; }
@keyframes slideIn { from { transform: translateX(100%); } }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
.chat-context { margin-top: 22px; padding: 11px 14px; border: 1px solid #f2d0bd; border-radius: 11px; color: #824125; background: var(--orange-soft); font-size: 13px; font-weight: 650; }
.messages { display: flex; flex: 1 1 auto; min-height: 180px; flex-direction: column; gap: 15px; overflow-y: auto; padding: 26px 3px; }
.message { display: flex; gap: 10px; align-items: flex-start; }
.message p { max-width: 88%; margin: 0; padding: 13px 15px; border-radius: 5px 17px 17px 17px; background: #f2f1ed; line-height: 1.5; }
.message.user { justify-content: flex-end; }
.message.user p { color: #fff; border-radius: 17px 5px 17px 17px; background: var(--navy); }
.message-avatar { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--orange); font-size: 13px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.suggestions button { padding: 9px 11px; border: 1px solid #e2c8ba; border-radius: 20px; color: #7b3a20; background: #fff8f3; cursor: pointer; font-size: 12px; }
.chat-form { display: grid; grid-template-columns: 1fr 43px; gap: 8px; padding: 7px; border: 1px solid #cbc9c3; border-radius: 15px; background: #fff; }
.chat-form:focus-within { box-shadow: var(--focus); }
.chat-form input { min-width: 0; padding: 8px; border: 0; outline: 0; background: transparent; }
.chat-form button { border: 0; border-radius: 10px; color: #fff; background: var(--orange); cursor: pointer; font-size: 20px; }
.disclaimer { margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 10px; }

.review-dialog { width: min(680px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: #fffdf9; box-shadow: 0 30px 100px rgba(8,10,25,.28); }
.review-dialog::backdrop { background: rgba(8, 12, 29, .42); backdrop-filter: blur(3px); }
.dialog-shell { margin: 0; }
.review-dialog .panel-header { padding: 28px 30px 22px; border-bottom: 1px solid var(--line); }
.review-body { padding: 26px 30px; }
.recommendation { padding: 22px; border: 1px solid #efcab6; border-radius: 16px; background: var(--orange-soft); }
.recommendation span { display: block; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.recommendation strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 23px; }
.recommendation p { margin: 10px 0 0; color: #555b65; line-height: 1.5; }
.review-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.review-stats div { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.review-stats dt { color: var(--muted); font-size: 11px; }
.review-stats dd { margin: 5px 0 0; font-weight: 700; }
.evidence-link { display: flex; width: 100%; justify-content: space-between; padding: 13px 0; border: 0; background: transparent; cursor: pointer; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 30px 26px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 360px; padding: 13px 17px; border-radius: 11px; color: #fff; background: var(--navy); box-shadow: 0 12px 30px rgba(0,0,0,.2); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(300px, .85fr) minmax(390px, 1.15fr); }
  .nudge-card { grid-column: 2; min-height: auto; }
  .nudge-card > p { min-height: 0; }
  .lifecycle { margin-top: 34px; }
}

@media (max-width: 840px) {
  .rail { position: static; width: 100%; height: 72px; flex-direction: row; justify-content: space-between; padding: 10px 18px; }
  .brand { display: flex; align-items: center; padding: 0; font-size: 20px; }
  .brand small, .account-card, .getting-started, .nav-label, .rail-item span, .rail-item small, .rail-footer { display: none; }
  .brand svg { width: 23px; }
  .rail-nav { display: flex; gap: 6px; margin: 0; }
  .rail-item { width: 46px; min-height: 46px; padding: 0; place-items: center; border-radius: 13px; }
  .rail-item svg { width: 23px; }
  .shell-topbar { margin-left: 0; padding: 0 18px; }
  .shell-title small { display: none; }
  .shell-explore { padding: 0 11px; font-size: 0; }
  .shell-explore span { font-size: 14px; }
  .page { margin-left: 0; padding: 30px 22px 20px; }
  .outcome-header { align-items: flex-start; }
  .ask-button { min-height: 48px; padding: 0 16px; font-size: 0; }
  .ask-button svg { width: 25px; }
  .workspace { grid-template-columns: 1fr; margin-top: 34px; }
  .outcomes-column { padding-left: 20px; }
  .outcome-list { grid-template-columns: repeat(2, 1fr); }
  .journey-line { display: none; }
  .outcome { grid-template-columns: 52px 1fr auto; min-height: 94px; padding: 14px; border-radius: 18px; }
  .outcome::before { display: none; }
  .outcome[aria-selected="true"] { border-radius: 18px; }
  .outcome-icon { width: 50px; height: 50px; font-size: 22px; }
  .outcome-icon svg { width: 25px; }
  .outcome h2 { font-size: 18px; }
  .progress-track { width: 80px; }
  .decision-card, .nudge-card { grid-column: auto; }
  .lifecycle { margin-top: 30px; padding: 12px; }
  .life-step { flex-direction: column; gap: 4px; font-size: 11px; }
  .connector { margin: 0 7px; }
}

@media (max-width: 560px) {
  .shell-actions .shell-icon, .shell-search kbd, .shell-explore { display: none; }
  .shell-search { width: 42px; padding: 0; justify-content: center; }
  .shell-search span { display: none; }
  .avatar { display: none; }
  .rail-nav .rail-item:nth-child(n+3) { display: none; }
  h1 { font-size: 39px; }
  .eyebrow { font-size: 12px; }
  .outcome-list { grid-template-columns: 1fr; }
  .outcomes-column { padding: 0; }
  .outcome { min-height: 85px; }
  .decision-card { padding: 23px; border-radius: 21px; }
  .decision-heading { align-items: flex-start; }
  .evidence-row { flex-direction: column; gap: 12px; margin: 24px 0; }
  .metric { border: 0; padding: 0; }
  .decision-footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .lifecycle { overflow-x: auto; }
  .life-step { min-width: 58px; }
  .connector { min-width: 24px; }
  .review-stats { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}

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