:root {
  --ink: #171725;
  --muted: #686876;
  --quiet: #90909a;
  --line: #e6e4e1;
  --line-strong: #d8d5d1;
  --surface: #fff;
  --surface-soft: #faf9f7;
  --orange: #ff5a1f;
  --orange-dark: #e4470f;
  --orange-pale: #fff4ed;
  --green: #16845a;
  --nav: #1a1a2e;
  --nav-soft: #1b1f35;
  --shadow: 0 12px 36px rgba(28, 26, 38, .08);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(255, 90, 31, .33);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 250px;
  padding: 30px 14px 18px;
  color: #f7f7fb;
  background: var(--nav);
}

.brand {
  padding: 0 10px 26px;
  color: var(--orange);
  font-size: 27px;
  font-weight: 780;
  letter-spacing: -.8px;
}
.brand-dot { color: #ff8a63; }
.brand small { display: block; margin-top: 3px; color: #88899b; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.account-card { width: 100%; min-height: 42px; margin: -8px 0 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,107,53,.42); border-radius: 9px; color: #ff8462; background: rgba(255,107,53,.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 11px 7px; color: #686a82; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.nav-list { display: grid; gap: 8px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 9px;
  color: #e9e9f0;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item svg, .profile svg, .topbar svg, .ask-box svg, .source-note svg, .metadata svg, .continue-row svg, .decision-panel svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}
.nav-item:hover { background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-item.active { color: var(--orange); background: var(--nav-soft); font-weight: 680; }
.nav-item.active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}

.profile {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: auto;
  padding: 10px 4px;
  border: 0;
  color: #f6f6fa;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.profile:hover .profile-name { color: var(--orange); }
.profile > svg { width: 18px; margin-left: auto; }
.avatar {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.profile-name { overflow: hidden; font-size: 13px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy { min-width: 0; display: grid; gap: 2px; }
.profile-copy small { color: #8f90a2; font-size: 9px; }
.footer-link { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 12px; }

.page { width: calc(100% - 250px); margin-left: 250px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
}
.topbar-title { min-width: 0; display: grid; gap: 3px; }
.topbar strong { font-size: 18px; letter-spacing: -.35px; }
.topbar-title small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.icon-button, .menu-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.icon-button svg, .menu-button svg, .search-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-button:hover, .menu-button:hover { background: var(--surface-soft); border-color: var(--line); }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.menu-button { display: none; margin-right: 8px; }
.search-button { 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; }
.search-button kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: 9px; }
.explore-button { 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; }
.explore-button:hover { background: var(--orange-dark); }

.main-content {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 54px 0 36px;
}
.hero { text-align: center; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.sparkle { font-size: 15px; }
h1 {
  max-width: 950px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(35px, 4.1vw, 55px);
  line-height: 1.06;
  letter-spacing: -.035em;
}
.hero-subtitle { margin: 13px 0 29px; color: var(--muted); font-size: 15px; }

.ask-box {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  max-width: 950px;
  min-height: 86px;
  margin: 0 auto;
  padding: 15px 17px 15px 26px;
  border: 1.5px solid #ff9e70;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(255, 90, 31, .1);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ask-box:focus-within { border-color: var(--orange); box-shadow: 0 12px 34px rgba(255, 90, 31, .16); }
.ask-spark { color: var(--orange); font-size: 28px; }
.ask-box textarea {
  width: 100%;
  min-height: 28px;
  max-height: 112px;
  padding: 4px 0;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
}
.ask-box textarea::placeholder { color: #777783; opacity: 1; }
.attach-button, .send-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  cursor: pointer;
}
.attach-button { border: 1px solid var(--line); background: #fff; color: #4b4b57; }
.attach-button:hover { border-color: #bcb8b3; background: var(--surface-soft); }
.send-button { border: 0; color: #fff; background: var(--orange); box-shadow: 0 7px 17px rgba(255,90,31,.22); }
.send-button:hover { background: var(--orange-dark); transform: translateY(-1px); }

.prompt-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 23px auto 36px;
}
.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #3b3a46;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}
.prompt-chip span { color: var(--orange); font-size: 17px; }
.prompt-chip:hover { border-color: #ffa57e; color: var(--orange-dark); background: var(--orange-pale); transform: translateY(-1px); }

.conversation {
  max-width: 950px;
  margin: 0 auto 14px;
  text-align: left;
}
.conversation[hidden] { display: none; }
.message { display: flex; gap: 11px; margin: 9px 0; animation: rise .25s ease both; }
.message.user { justify-content: flex-end; }
.message-bubble { max-width: min(680px, 85%); padding: 12px 15px; border-radius: 15px; line-height: 1.5; font-size: 14px; }
.message.user .message-bubble { color: #fff; background: var(--ink); border-bottom-right-radius: 5px; }
.message.sapio .message-bubble { border: 1px solid #ffd5c2; background: var(--orange-pale); border-bottom-left-radius: 5px; }
.message.sapio::before { content: "✦"; display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; margin-top: 4px; border-radius: 8px; color: var(--orange); background: #fff0e8; }
.typing { color: var(--muted); }
.typing i { display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%; background: var(--orange); animation: blink 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1.06fr; gap: 18px; }
.card, .continue-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.card { min-width: 0; padding: 24px; }
.card-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; text-align: left; }
.card-heading h2 { margin: 1px 0 4px; font-size: 16px; letter-spacing: -.01em; }
.card-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.section-icon { color: var(--orange); font-size: 21px; line-height: 1; }
.target-icon { font-size: 24px; }

.brief-list { border-top: 1px solid var(--line); }
.brief-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.brief-item:hover .brief-copy strong { color: var(--orange-dark); }
.signal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px var(--orange-pale); }
.brief-copy { display: grid; gap: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.brief-copy strong { color: var(--ink); font-size: 12.5px; transition: color .18s ease; }
.chevron { width: 16px !important; color: var(--quiet); transition: transform .2s ease; }
.brief-item[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.brief-detail {
  padding: 13px 14px 14px 23px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: left;
  animation: reveal .2s ease both;
}
.brief-detail[hidden] { display: none; }
.brief-detail div { display: grid; gap: 3px; margin-bottom: 11px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.brief-detail div:last-child { margin-bottom: 0; }
.brief-detail strong { color: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.source-note { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 15px; color: var(--muted); font-size: 11px; }
.source-note svg { width: 17px; }

.next-move-card { display: flex; flex-direction: column; }
.recommendation {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 19px;
  border: 1px solid #ffd6bf;
  border-radius: 13px;
  background: linear-gradient(135deg, #fffaf7, #fffefc);
}
.recommendation-top { display: grid; grid-template-columns: 74px 1fr; gap: 16px; align-items: center; }
.shield { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: var(--orange); background: #ffebdc; }
.shield svg { width: 46px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rank-label { color: var(--orange-dark); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.recommendation h3 { margin: 5px 0 7px; font-family: var(--serif); font-size: 21px; line-height: 1.15; }
.recommendation p { margin: 0; color: #494853; font-size: 13px; line-height: 1.5; }
.metadata { display: flex; flex-wrap: wrap; gap: 9px; margin: 17px 0; }
.metadata span { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 11px; }
.metadata svg { width: 15px; }
.metadata .confidence { color: var(--green); }
.metadata i, .confidence-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.primary-button, .secondary-button {
  min-height: 47px;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
}
.primary-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; color: #fff; background: var(--orange); }
.primary-button span { margin-left: auto; font-size: 20px; font-weight: 400; }
.primary-button:hover { background: var(--orange-dark); }
.secondary-button { border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.secondary-button:hover { border-color: #ffa37b; background: var(--orange-pale); }

.continue-card { margin-top: 18px; padding: 20px; }
.compact-heading { margin-bottom: 13px; }
.continue-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.continue-row:hover { border-color: #ffac89; box-shadow: 0 7px 18px rgba(30,25,20,.06); transform: translateY(-1px); }
.work-icon { color: var(--orange); }
.work-icon svg { width: 25px; }
.continue-copy { display: grid; min-width: 0; gap: 4px; }
.continue-copy strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.continue-copy span { color: var(--muted); font-size: 11px; }
.continue-copy i { margin: 0 5px; font-style: normal; }
.row-arrow { width: 18px !important; }
.continue-progress { display: flex; gap: 3px; }
.continue-progress i { display: block; width: 16px; height: 3px; border-radius: 4px; background: var(--line); }
.continue-progress i:nth-child(-n+2) { background: var(--orange); }
.prototype-note { margin: 20px 0 0; color: var(--quiet); font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 15, 29, .55);
  backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
.modal-backdrop[hidden] { display: none; }
.decision-panel {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(12, 12, 22, .28);
  animation: panelIn .24s ease both;
}
.panel-header { display: flex; align-items: flex-start; gap: 20px; padding: 25px 27px 20px; border-bottom: 1px solid var(--line); }
.panel-header > div:first-child { min-width: 0; }
.panel-kicker { color: var(--orange-dark); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.panel-header h2 { margin: 7px 0 0; font-family: var(--serif); font-size: 29px; line-height: 1.12; }
.close-button { flex: 0 0 auto; margin-left: auto; }
.panel-body { padding: 23px 27px; overflow-y: auto; }
.panel-summary { padding: 17px; border-radius: 12px; background: var(--orange-pale); }
.panel-summary p { margin: 10px 0 0; line-height: 1.55; }
.confidence-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 700; }
.panel-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 17px 0; }
.panel-columns > div { padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.panel-columns h3 { margin: 0 0 7px; font-size: 13px; }
.panel-columns p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.evidence-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-details summary { display: flex; align-items: center; gap: 10px; padding: 15px 2px; cursor: pointer; font-size: 13px; font-weight: 650; }
.evidence-details summary span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.evidence-details ul { margin: 0 0 16px; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.evidence-details li + li { margin-top: 7px; }
.evidence-details strong { color: var(--ink); }
.panel-question { margin-top: 16px; padding: 14px; border: 1px solid #ffd6c3; border-radius: 10px; background: #fff9f6; font-size: 12px; line-height: 1.55; }
.panel-question[hidden] { display: none; }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 27px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.panel-actions .primary-button { width: auto; min-width: 150px; }
.review-button span { margin-left: 6px; }

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 48px));
  padding: 13px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.4;
  animation: rise .2s ease both;
}
.toast[hidden] { display: none; }
.mobile-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(13,15,29,.47); }
.mobile-scrim[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes blink { from { opacity: .25; transform: translateY(1px); } to { opacity: 1; transform: translateY(-1px); } }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-102%); transition: transform .23s ease; box-shadow: 12px 0 36px rgba(4,5,15,.22); }
  .sidebar.open { transform: translateX(0); }
  .page { width: 100%; margin-left: 0; }
  .menu-button { display: grid; }
  .topbar-title small { display: none; }
  .explore-button { padding: 0 11px; font-size: 0; }
  .explore-button span { font-size: 14px; }
  .main-content { width: min(100% - 38px, 800px); padding-top: 42px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { height: 62px; padding: 0 14px; }
  .top-actions .icon-button, .search-button kbd, .explore-button { display: none; }
  .search-button { width: 42px; padding: 0; justify-content: center; }
  .search-button span { display: none; }
  .main-content { width: calc(100% - 28px); padding-top: 30px; }
  .eyebrow { margin-bottom: 7px; }
  h1 { font-size: 34px; }
  .hero-subtitle { margin: 10px auto 21px; font-size: 13px; }
  .ask-box { grid-template-columns: auto 1fr auto; min-height: 72px; padding: 10px 11px 10px 16px; border-radius: 14px; gap: 9px; }
  .ask-spark { font-size: 21px; }
  .ask-box textarea { font-size: 15px; }
  .attach-button { display: none; }
  .send-button { width: 44px; height: 44px; }
  .prompt-chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 16px -14px 25px; padding: 0 14px 6px; scrollbar-width: none; }
  .prompt-chips::-webkit-scrollbar { display: none; }
  .prompt-chip { flex: 0 0 auto; }
  .card { padding: 18px; }
  .recommendation-top { grid-template-columns: 56px 1fr; gap: 12px; }
  .shield { width: 56px; height: 56px; }
  .shield svg { width: 36px; }
  .recommendation h3 { font-size: 19px; }
  .continue-card { padding: 17px; }
  .continue-row { grid-template-columns: auto 1fr auto; padding: 13px; }
  .continue-progress { display: none; }
  .continue-copy strong { white-space: normal; line-height: 1.35; }
  .modal-backdrop { align-items: end; padding: 0; }
  .decision-panel { width: 100%; max-height: 93vh; border-radius: 18px 18px 0 0; }
  .panel-header { padding: 21px 18px 17px; }
  .panel-header h2 { font-size: 24px; }
  .panel-body { padding: 18px; }
  .panel-columns { grid-template-columns: 1fr; }
  .panel-actions { display: grid; grid-template-columns: 1fr; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .panel-actions .primary-button { width: 100%; }
}

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