/* Decision Lab visual system — local, responsive, and deliberately calm. */
:root {
  --navy-950: #182337;
  --navy-900: #21314b;
  --navy-800: #2e4161;
  --ink: #223047;
  --ink-soft: #53627a;
  --muted: #7f8aa0;
  --paper: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-alt: #edf2f3;
  --line: #dfe6e8;
  --line-strong: #cbd5d8;
  --accent: #d76d56;
  --accent-deep: #ae4c3b;
  --accent-wash: #fff0eb;
  --teal: #297e76;
  --teal-deep: #17685f;
  --teal-wash: #e5f4f1;
  --gold: #dbab44;
  --gold-wash: #fdf4de;
  --blue-wash: #ecf2ff;
  --success: #277d63;
  --shadow-xs: 0 1px 2px rgba(25, 38, 57, .04);
  --shadow-sm: 0 5px 16px rgba(25, 38, 57, .06);
  --shadow-md: 0 16px 38px rgba(25, 38, 57, .09);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, ui-serif, serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 77% -10%, rgba(213, 109, 86, .10), transparent 25rem),
    radial-gradient(circle at 15% 80%, rgba(40, 126, 118, .06), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .text-button:focus-visible {
  outline: 3px solid rgba(215, 109, 86, .36);
  outline-offset: 3px;
}
::selection { background: rgba(215, 109, 86, .22); color: var(--ink); }

.skip-link {
  position: fixed; left: 16px; top: -65px; z-index: 100;
  padding: 9px 13px; border-radius: 0 0 10px 10px;
  background: var(--navy-950); color: #fff; text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* Shell and navigation */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 16px 18px;
  overflow: hidden;
  color: #f4f7fb;
  background:
    radial-gradient(circle at 8% 0%, rgba(93, 123, 168, .27), transparent 15rem),
    linear-gradient(160deg, #1b2940 0%, #152136 72%, #111b2e 100%);
}
.sidebar::after {
  content: ""; position: absolute; right: -80px; bottom: 70px; width: 215px; height: 215px;
  border: 1px solid rgba(255,255,255,.075); border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.025), 0 0 0 64px rgba(255,255,255,.015);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 12px 28px; position: relative; z-index: 1; }
.brand-mark {
  display: grid; place-items: center; width: 39px; height: 39px;
  border-radius: 13px; color: #fff; background: linear-gradient(145deg, #e58871, #cf604d);
  box-shadow: 0 9px 16px rgba(0,0,0,.19); font-size: 24px; font-weight: 850;
}
.brand h1, .brand p { margin: 0; }
.brand h1 { font-family: var(--font-display); font-size: 21px; letter-spacing: -.03em; line-height: 1; font-weight: 700; }
.eyebrow {
  margin: 0 0 6px; color: var(--muted);
  font-size: 10px; font-weight: 800; line-height: 1.25; letter-spacing: .115em;
}
.brand .eyebrow { color: #a5b2c6; font-size: 8.5px; letter-spacing: .15em; }
.nav-list { position: relative; z-index: 1; display: grid; gap: 5px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border: 1px solid transparent; border-radius: 12px;
  color: #c6d1e0; background: transparent; font-size: 14px; font-weight: 690; text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.nav-item span {
  display: grid; width: 23px; height: 23px; place-items: center;
  color: #a6b7d0; border-radius: 8px; font-size: 17px; line-height: 1;
  transition: background .18s ease, color .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.065); transform: translateX(2px); }
.nav-item:hover span { color: #fff; }
.nav-item.active { color: #fff; border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.105); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.active span { color: #fff0eb; background: rgba(215,109,86,.20); }
.sidebar-footer {
  position: relative; z-index: 1; display: grid; gap: 10px; margin-top: auto;
  padding: 20px 12px 2px; border-top: 1px solid rgba(255,255,255,.10);
}
.sidebar-footer .text-button { width: max-content; padding: 0; border: 0; color: #c3cfde; background: none; font-size: 12px; text-align: left; text-decoration: none; }
.sidebar-footer .text-button:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.sidebar-footer .danger { color: #efaa9c; }
.sidebar-footer .danger:hover { color: #ffc6ba; }
.sidebar-footer p { max-width: 195px; margin: 6px 0 0; color: #8494aa; font-size: 11px; line-height: 1.55; }
.import-label { cursor: pointer; }

/* Main pages */
.main-content { width: 100%; max-width: 1660px; margin: 0 auto; padding: 38px clamp(26px, 4vw, 72px) 78px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 31px; }
.topbar h2 { margin: 0; font-family: var(--font-display); font-size: clamp(33px, 3.2vw, 45px); font-weight: 700; letter-spacing: -.055em; line-height: .98; }
.topbar .eyebrow { margin-bottom: 9px; color: var(--accent-deep); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.view { display: none; animation: page-enter .26s ease both; }
.view.active { display: block; }
@keyframes page-enter { from { opacity: .24; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Controls */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 12px;
  font-size: 13px; font-weight: 790; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #fff; background: linear-gradient(135deg, #dc7b65, #cf5f4c); box-shadow: 0 8px 17px rgba(191, 78, 58, .23); }
.button-primary:hover { background: linear-gradient(135deg, #d87059, #bb4f3f); box-shadow: 0 11px 20px rgba(191, 78, 58, .28); }
.button-secondary { color: #fff; background: var(--navy-900); box-shadow: 0 6px 12px rgba(25,38,57,.10); }
.button-secondary:hover { background: var(--navy-800); }
.button-ghost { color: var(--ink); border-color: var(--line-strong); background: var(--surface); box-shadow: var(--shadow-xs); }
.button-ghost:hover { border-color: #aab8bf; background: var(--surface-soft); }
.link-button { padding: 2px 0; border: 0; color: var(--accent-deep); background: transparent; font-size: 12px; font-weight: 800; }
.link-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Base content blocks */
.card {
  background: rgba(255,255,255,.93); border: 1px solid rgba(219, 226, 229, .94); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card:hover { border-color: #d0dbdd; }
.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-heading h3, .form-intro h3 {
  margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.04em; line-height: 1.05;
}
.muted { color: var(--muted); }

/* Dashboard */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(270px, .92fr); gap: 18px; }
.hero-card {
  position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 263px; padding: 34px 36px;
  overflow: hidden; border-color: #eedad3;
  background: linear-gradient(118deg, #fffdfc 0%, #fff7f4 59%, #fbe8e1 100%);
}
.hero-card::before {
  content: ""; position: absolute; right: -116px; top: -130px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle at 35% 60%, rgba(229,130,108,.26), rgba(229,130,108,.035) 56%, transparent 57%);
  pointer-events: none;
}
.hero-card::after {
  content: ""; position: absolute; left: 36px; top: 31px; width: 35px; height: 2px; border-radius: 99px; background: var(--accent);
}
.hero-copy { position: relative; z-index: 2; max-width: 490px; padding-top: 8px; }
.hero-card h3, .principle-card h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.048em; line-height: 1.02; }
.hero-card h3 { font-size: clamp(29px, 3.1vw, 41px); }
.hero-card p:not(.eyebrow) { max-width: 450px; margin: 0 0 22px; color: var(--ink-soft); font-size: 16px; }
.hero-card .eyebrow { color: var(--accent-deep); }
.hero-orbit { position: relative; z-index: 2; flex: 0 0 auto; width: 176px; height: 176px; margin-right: 8px; border: 1px dashed rgba(195, 92, 70, .50); border-radius: 50%; }
.orbit-core {
  position: absolute; left: 53px; top: 53px; display: grid; place-items: center; width: 70px; height: 70px;
  border: 7px solid #fff7f3; border-radius: 50%; color: #fff;
  background: linear-gradient(145deg, #e07a63, #c95c4a); box-shadow: 0 11px 22px rgba(197,87,66,.29);
  font-family: var(--font-display); font-size: 35px; font-weight: 700;
}
.orbit-label { position: absolute; color: #98665a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.orbit-label.one { left: 47px; top: 8px; }
.orbit-label.two { bottom: 10px; left: 12px; }
.orbit-label.three { top: 83px; right: -18px; }
.principle-card {
  position: relative; min-height: 263px; padding: 31px 29px; overflow: hidden; color: #f7fafc;
  background: linear-gradient(145deg, #243651, #17243a 78%);
}
.principle-card::after { content: "“"; position: absolute; right: 18px; bottom: -31px; color: rgba(255,255,255,.075); font-family: var(--font-display); font-size: 150px; line-height: 1; }
.principle-card .eyebrow { color: #b9c6d8; }
.principle-card h3 { position: relative; z-index: 1; max-width: 300px; font-size: 30px; }
.principle-card p:not(.eyebrow) { position: relative; z-index: 1; max-width: 310px; margin: 0; color: #c5d1df; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 137px; padding: 20px 20px 18px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card::after { content: ""; position: absolute; right: -14px; top: -23px; width: 80px; height: 80px; border-radius: 50%; background: var(--surface-alt); opacity: .8; }
.metric-card:nth-child(1)::after { background: var(--blue-wash); }.metric-card:nth-child(2)::after { background: var(--accent-wash); }.metric-card:nth-child(3)::after { background: var(--teal-wash); }.metric-card:nth-child(4)::after { background: var(--gold-wash); }
.metric-card .metric-value { position: relative; z-index: 1; font-family: var(--font-display); font-size: 38px; font-weight: 700; letter-spacing: -.06em; line-height: .93; }
.metric-card .metric-label { color: var(--ink); font-size: 13px; font-weight: 800; }
.metric-card .metric-detail { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wide-card { padding: 23px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.card-heading h3 { margin: 0; font-family: var(--font-display); font-size: 21px; letter-spacing: -.035em; line-height: 1.05; }
.card-heading .eyebrow { margin-bottom: 4px; }

/* Lists */
.stack-list, .journal-list, .review-list { display: grid; gap: 10px; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 13px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.list-row:hover { border-color: #c2ced2; transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.list-row-main { min-width: 0; }
.list-row-title { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.list-row-action { padding: 4px 0; border: 0; color: var(--accent-deep); background: transparent; font-size: 12px; font-weight: 820; white-space: nowrap; }
.list-row-action:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.tag {
  display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px;
  color: var(--ink-soft); background: var(--surface-alt); font-size: 10.5px; font-weight: 790; line-height: 1.15;
}
.tag.due { color: #a44031; border-color: #f2d7d0; background: var(--accent-wash); }
.tag.reviewed { color: #176b61; border-color: #cae7e1; background: var(--teal-wash); }
.tag.open { color: #425e91; border-color: #d9e4fa; background: var(--blue-wash); }

/* Forms */
.form-intro { max-width: 750px; margin: 0 0 25px; }
.form-intro h3 { margin-bottom: 10px; font-size: clamp(30px, 3.2vw, 41px); }
.form-intro p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 16px; }
.decision-form { max-width: 1090px; }
.form-layout { display: grid; gap: 17px; }
.form-panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.panel-heading h4 { margin: 0 0 3px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; }
.panel-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.step-number {
  display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px;
  border-radius: 10px; color: #fff; background: linear-gradient(145deg, #e37e67, #cf5c49); box-shadow: 0 5px 9px rgba(202,92,72,.19); font-size: 12px; font-weight: 850;
}
.field-grid { display: grid; gap: 17px; }
.field-grid.two-col { grid-template-columns: 1fr 1fr; }
.field.full { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--ink); font-size: 12.5px; font-weight: 790; }
.field b { color: var(--accent); }
.field small { margin-top: -2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.field input, .field textarea, .field select, .search-box input {
  width: 100%; border: 1px solid #d2dcdf; border-radius: 11px; color: var(--ink); background: #fff;
  box-shadow: inset 0 1px 1px rgba(25,38,57,.02); padding: 10px 12px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input, .field select { min-height: 43px; }
.field textarea { min-height: 78px; line-height: 1.45; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .search-box input::placeholder { color: #9aa5b5; }
.field input:hover, .field textarea:hover, .field select:hover, .search-box input:hover { border-color: #b9c7cb; }
.field input:focus, .field textarea:focus, .field select:focus, .search-box input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgba(215, 109, 86, .12); }
.probability-wrap { margin-bottom: 19px; padding: 19px; border: 1px solid #f5ddd6; border-radius: 16px; background: linear-gradient(135deg, #fff6f3, #fffaf7); }
.probability-field { gap: 10px; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px; align-items: center; gap: 15px; }
.range-row input[type="range"] { width: 100%; height: 7px; margin: 0; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--accent) 0%, #edb19f 100%); }
.range-row input[type="range"]::-webkit-slider-thumb { width: 21px; height: 21px; appearance: none; border: 4px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 3px 7px rgba(171,73,56,.30); }
.range-row input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 4px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 3px 7px rgba(171,73,56,.30); }
.range-row output {
  display: grid; min-height: 43px; place-items: center; border-radius: 12px; color: #fff; background: var(--accent); box-shadow: 0 5px 10px rgba(198,78,58,.17); font-size: 17px; font-weight: 850; letter-spacing: -.02em;
}
.probability-scale { display: flex; justify-content: space-between; margin: 8px 87px 0 0; color: var(--muted); font-size: 10px; font-weight: 720; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 19px; }
.sticky-actions { position: sticky; z-index: 10; bottom: 16px; padding: 11px; border: 1px solid rgba(210,220,223,.94); border-radius: 15px; background: rgba(255,255,255,.88); box-shadow: 0 12px 24px rgba(25,38,57,.09); backdrop-filter: blur(10px); }

/* Journal */
.journal-heading { align-items: flex-end; }
.journal-heading p { margin: 6px 0 0; }
.journal-tools { display: flex; align-items: center; gap: 9px; }
.search-box { position: relative; display: flex; align-items: center; min-width: 250px; }
.search-box > span { position: absolute; z-index: 1; left: 12px; color: var(--muted); font-size: 18px; line-height: 1; }
.search-box input { padding-left: 34px; }
.journal-tools select { min-height: 43px; padding: 8px 31px 8px 11px; border: 1px solid #d2dcdf; border-radius: 11px; color: var(--ink); background: #fff; }
.decision-card { display: grid; gap: 14px; padding: 20px; transition: transform .16s ease, box-shadow .16s ease; }
.decision-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.decision-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.decision-card h4 { margin: 0 0 5px; color: var(--ink); font-family: var(--font-display); font-size: 21px; letter-spacing: -.03em; line-height: 1.06; }
.decision-card p { margin: 0; color: var(--ink-soft); }
.decision-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.probability-chip { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 9px; color: #fff; background: var(--navy-900); box-shadow: 0 3px 7px rgba(25,38,57,.12); font-size: 11.5px; font-weight: 850; }
.decision-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.decision-card-bottom > .list-row-meta { max-width: 60%; margin: 0; }
.card-actions { display: flex; align-items: center; gap: 13px; }
.small-button { padding: 3px 0; border: 0; color: var(--accent-deep); background: transparent; font-size: 12px; font-weight: 820; }
.small-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.small-button.neutral { color: var(--ink-soft); }

/* Review */
.review-layout { display: grid; grid-template-columns: 312px minmax(0, 1fr); gap: 19px; align-items: start; }
.review-sidebar { position: sticky; top: 20px; padding: 18px; }
.review-sidebar > .eyebrow { padding: 2px 3px 9px; }
.review-workspace { min-height: 475px; padding: 29px; }
.review-item { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.review-item:hover { border-color: #bdc9cd; transform: translateY(-1px); }
.review-item.active { border-color: #e5a191; background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--accent); }
.review-item-title { font-size: 13px; font-weight: 790; line-height: 1.25; }
.review-item-meta { margin-top: 4px; color: var(--muted); font-size: 11px; }
.review-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
.review-title-row h3 { margin: 0; font-family: var(--font-display); font-size: 28px; letter-spacing: -.04em; line-height: 1.02; }
.original-forecast { margin: 0 0 19px; padding: 17px; border: 1px solid #dce7e7; border-radius: 15px; background: linear-gradient(135deg, #f5fbfa, #eef6f5); }
.original-forecast h4 { margin: 0 0 8px; color: var(--teal-deep); font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.original-forecast p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }
.original-forecast b { color: var(--ink); }
.review-form .field-grid { margin-top: 18px; }
.review-form .field-grid.two-col { grid-template-columns: 1fr 1fr; }
.review-form .range-row { grid-template-columns: minmax(0,1fr) 61px; }
.review-form .range-row output { min-height: 39px; background: var(--teal); font-size: 13px; }
.review-form input[type="range"] { background: linear-gradient(90deg, var(--teal) 0%, #9ed8cf 100%); }
.review-form input[type="range"]::-webkit-slider-thumb { background: var(--teal); }
.review-form input[type="range"]::-moz-range-thumb { background: var(--teal); }
.rating-group { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.rating-option { position: relative; display: grid; place-items: center; min-height: 42px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 11.5px; font-weight: 760; transition: border .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.rating-option:hover { border-color: #b9c9c9; transform: translateY(-1px); }
.rating-option input { position: absolute; opacity: 0; pointer-events: none; }
.rating-option:has(input:checked) { border-color: #8ec9c0; color: var(--teal-deep); background: var(--teal-wash); box-shadow: inset 0 0 0 1px rgba(42,126,118,.04); }
.review-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 21px; }

/* Insights */
.insights-grid { display: grid; grid-template-columns: 1.25fr .86fr .86fr; gap: 18px; }
.chart-card { padding: 22px; }
.chart-note { margin: -4px 0 17px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.calibration-chart { display: grid; gap: 12px; }
.calibration-row { display: grid; grid-template-columns: 60px minmax(0,1fr) 66px; align-items: center; gap: 11px; }
.calibration-label { color: var(--ink-soft); font-size: 11.5px; font-weight: 770; }
.bar-track { position: relative; height: 24px; overflow: hidden; border-radius: 9px; background: #edf1f2; box-shadow: inset 0 1px 2px rgba(25,38,57,.04); }
.bar-predicted, .bar-actual { position: absolute; top: 0; height: 100%; border-radius: 9px; }
.bar-predicted { left: 0; background: #b9c8d5; }.bar-actual { left: 0; background: var(--teal); opacity: .9; }
.calibration-value { color: var(--ink-soft); font-size: 10.5px; text-align: right; }
.breakdown-list, .pattern-list { display: grid; gap: 10px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; padding: 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); font-size: 12.5px; }
.breakdown-count { color: var(--ink); font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.pattern-item { padding: 8px 0 8px 12px; border-left: 3px solid var(--gold); }
.pattern-item h4 { margin: 0 0 3px; color: var(--ink); font-size: 12.5px; }.pattern-item p { margin: 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.4; }

/* Guide */
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.guide-card { position: relative; min-height: 275px; padding: 24px; overflow: hidden; }
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); transition: transform .16s ease, box-shadow .16s ease; }
.guide-index { display: inline-grid; min-width: 33px; min-height: 24px; place-items: center; margin-bottom: 23px; border-radius: 8px; color: var(--accent-deep); background: var(--accent-wash); font-size: 10px; font-weight: 860; letter-spacing: .06em; }
.guide-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 24px; letter-spacing: -.035em; line-height: 1.05; }
.guide-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.52; }
.guide-prompt { position: absolute; right: 17px; bottom: 17px; left: 17px; padding: 11px 12px; border-radius: 11px; color: var(--ink-soft); background: var(--surface-alt); font-size: 11.5px; line-height: 1.4; }

/* Empty states + overlays */
.empty-state { display: grid; min-height: 174px; place-items: center; align-content: center; padding: 26px; border: 1px dashed #bdcbce; border-radius: 15px; color: var(--ink-soft); background: rgba(249,251,250,.65); text-align: center; }
.empty-state.tall { min-height: 390px; }
.empty-state h3 { margin: 10px 0 5px; color: var(--ink); font-family: var(--font-display); font-size: 22px; letter-spacing: -.03em; }.empty-state p { max-width: 420px; margin: 0 0 15px; }
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #f1d4cb; border-radius: 50%; color: var(--accent-deep); background: var(--accent-wash); font-family: var(--font-display); font-size: 23px; font-weight: 800; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(17,29,47,.56); backdrop-filter: blur(4px); }
/* Explicitly respect the HTML hidden attribute. Without this, the author-level display:grid declaration can override the browser's default hidden styling and leave an empty overlay visible. */
.modal-backdrop[hidden] { display: none !important; }
.modal { width: 100%; max-width: 700px; max-height: min(810px, 90vh); overflow: auto; padding: 27px; border: 1px solid rgba(255,255,255,.55); border-radius: 22px; background: #fff; box-shadow: 0 24px 75px rgba(0,0,0,.28); }
.modal h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 29px; letter-spacing: -.04em; line-height: 1.03; }.modal h4 { margin: 19px 0 5px; color: var(--ink); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; }.modal p { margin: 0; color: var(--ink-soft); white-space: pre-wrap; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }.modal-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.modal-detail { padding: 12px; border-radius: 11px; background: var(--surface-alt); }.modal-detail .label { margin-bottom: 3px; color: var(--muted); font-size: 9.5px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }.modal-detail p { color: var(--ink); font-size: 13px; }
.toast { position: fixed; z-index: 70; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; color: #fff; background: var(--navy-950); box-shadow: 0 15px 30px rgba(20,30,48,.22); font-size: 13px; font-weight: 700; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .22s ease, transform .22s ease; }.toast.show { opacity: 1; transform: translateY(0); }

.mobile-nav { display: none; }

/* Responsive */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 252px minmax(0,1fr); }
  .hero-grid { grid-template-columns: minmax(0,1.48fr) minmax(260px,.92fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .insights-grid { grid-template-columns: 1.18fr 1fr; }
  .insights-grid .chart-card:first-child { grid-column: 1 / -1; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 880px) {
  .app-shell { display: block; }.sidebar { display: none; }
  .main-content { padding: 28px 18px 98px; }
  .topbar { margin-bottom: 26px; }.topbar h2 { font-size: 38px; }
  .hero-grid, .dashboard-grid, .review-layout { grid-template-columns: 1fr; }
  .hero-card { min-height: 246px; padding: 29px; }.principle-card { min-height: auto; padding: 26px; }
  .hero-orbit { width: 144px; height: 144px; margin-right: -12px; }.orbit-core { left: 42px; top: 42px; width: 60px; height: 60px; font-size: 30px; }.orbit-label { font-size: 8px; }.orbit-label.one { left: 37px; }.orbit-label.two { left: 7px; }.orbit-label.three { top: 67px; right: -17px; }
  .form-panel, .review-workspace { padding: 22px; }.review-sidebar { position: static; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 2px; height: calc(70px + env(safe-area-inset-bottom)); padding: 7px 11px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(207,217,219,.95); background: rgba(255,255,255,.94); box-shadow: 0 -8px 25px rgba(20,33,51,.09); backdrop-filter: blur(13px); }
  .mobile-nav-item { display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font-size: 9.5px; font-weight: 780; }.mobile-nav-item span { font-size: 18px; line-height: 1; }.mobile-nav-item.active { color: var(--accent-deep); background: var(--accent-wash); }.mobile-nav-item.create { width: 47px; height: 47px; align-self: center; justify-self: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #de7963, #ca5948); box-shadow: 0 8px 16px rgba(191,78,58,.29); }.mobile-nav-item.create span { font-size: 29px; line-height: .85; }
  .journal-heading { align-items: stretch; flex-direction: column; }.journal-tools { width: 100%; }.search-box { flex: 1; }.guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 14px; }
  .main-content { padding-right: 14px; padding-left: 14px; }.topbar { align-items: flex-end; gap: 12px; }.topbar h2 { font-size: 34px; }.topbar-actions .button { min-height: 38px; padding: 9px 11px; font-size: 11.5px; }
  .hero-card { min-height: 238px; padding: 26px 23px; }.hero-orbit { display: none; }.hero-card h3 { font-size: 35px; }.hero-card p:not(.eyebrow) { font-size: 14.5px; }.principle-card h3 { font-size: 28px; }
  .section-block { margin-top: 29px; }.section-heading h3, .form-intro h3 { font-size: 29px; }.section-heading { margin-bottom: 12px; }
  .metric-grid { gap: 10px; }.metric-card { min-height: 117px; padding: 16px; }.metric-card .metric-value { font-size: 32px; }.metric-card .metric-label { font-size: 12px; }.metric-card .metric-detail { font-size: 10px; }
  .wide-card, .chart-card { padding: 18px; }.card-heading h3 { font-size: 20px; }.list-row { padding: 12px; }
  .form-intro { margin-bottom: 20px; }.form-intro p:not(.eyebrow) { font-size: 14.5px; }.form-panel, .review-workspace { padding: 18px; }.panel-heading { gap: 11px; margin-bottom: 18px; padding-bottom: 16px; }.panel-heading h4 { font-size: 20px; }.panel-heading p { font-size: 12px; }.field-grid.two-col, .review-form .field-grid.two-col { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.probability-wrap { padding: 15px; }.probability-scale { margin-right: 0; }
  .sticky-actions { bottom: 12px; justify-content: space-between; }.sticky-actions .button { flex: 1; }
  .journal-tools { display: grid; grid-template-columns: 1fr; }.search-box { min-width: 0; }.journal-tools select { width: 100%; }.decision-card { gap: 12px; padding: 17px; }.decision-card h4 { font-size: 20px; }.decision-card-bottom { align-items: flex-start; flex-direction: column; }.decision-card-bottom > .list-row-meta { max-width: none; }.card-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .review-layout { gap: 13px; }.review-sidebar { padding: 15px; }.review-workspace { min-height: 395px; }.review-title-row h3 { font-size: 25px; }.rating-group { grid-template-columns: 1fr; }.review-actions { justify-content: stretch; }.review-actions .button { flex: 1; }
  .modal-backdrop { align-items: end; padding: 10px; }.modal { max-height: calc(100vh - 20px); padding: 21px; border-radius: 19px; }.modal h3 { font-size: 26px; }.modal-detail-grid { grid-template-columns: 1fr; }.modal-actions { flex-direction: column-reverse; }.modal-actions .button { width: 100%; }
  .calibration-row { grid-template-columns: 49px minmax(0,1fr) 58px; gap: 8px; }.insights-grid { grid-template-columns: 1fr; }.insights-grid .chart-card:first-child { grid-column: auto; }.guide-card { min-height: 265px; }.toast { right: 12px; bottom: 84px; max-width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; } }
@media print { .sidebar, .mobile-nav, .topbar-actions, .sticky-actions, .card-actions, .journal-tools { display: none !important; }.app-shell { display: block; }.main-content { padding: 0; }.view { display: none !important; }.view.active { display: block !important; }.card { box-shadow: none; }.toast { display: none; } }
