:root {
  --page: #f2f1eb;
  --surface: #fffefa;
  --surface-muted: #f7f7f1;
  --ink: #202f28;
  --muted: #58665d;
  --line: #dbded4;
  --line-strong: #c6cdc2;
  --green: #285641;
  --green-dark: #194132;
  --green-light: #e8efe6;
  --rail: #182c24;
  --rail-ink: #f4f2e6;
  --rail-muted: #afc0b3;
  --rail-line: #3c5145;
  --warning: #79481a;
  --warning-light: #f7eddb;
  --panel-radius: 10px;
  --font-sans: "Instrument Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-title: "Instrument Serif", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  color: var(--ink);
  background-color: var(--page);
  font-family: var(--font-sans);
  font-size: 14px;
  font-synthesis: none;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 320px; margin: 0; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #438161;
  outline-offset: 3px;
}
::selection { background: #c9dec8; color: #15291d; }
[hidden] { display: none !important; }

.shell {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100dvh;
  min-height: 520px;
  padding: 28px 17px 19px;
  background: var(--rail);
  color: var(--rail-ink);
}

.sidebar :focus-visible { outline-color: #b8d8b4; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 0 7px;
  color: var(--rail-ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #a0b19d;
  border-radius: 8px;
  color: #f0ecd7;
  font-family: var(--font-title);
  font-size: 20px;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { color: var(--rail-ink); font-family: var(--font-title); font-size: 26px; font-weight: 700; letter-spacing: .05em; line-height: 1.05; }
.brand small { display: block; margin-top: 4px; color: var(--rail-muted); font-family: var(--font-sans); font-size: 11px; font-weight: 450; letter-spacing: .07em; }
.sidebar-section { min-width: 0; }
.sidebar-section > p, .sidebar-section > h2, .sidebar-section-label {
  margin: 0 0 9px 9px;
  color: var(--rail-muted);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .075em;
}
.sidebar nav { display: grid; gap: 4px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #c6d4c7;
  font-size: 13px;
  font-weight: 520;
  text-align: left;
  text-decoration: none;
}
.nav-link:hover { background: #223d31; color: var(--rail-ink); }
.nav-link:is(.active, .is-active, [aria-current="page"], [aria-current="step"], [aria-pressed="true"]) {
  border-color: #506b59;
  background: #2c493a;
  box-shadow: inset 2px 0 #b5c8a7;
  color: var(--rail-ink);
  font-weight: 690;
}
.nav-index {
  flex: 0 0 24px;
  width: 24px;
  color: #b1c0b1;
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}
.nav-text { min-width: 0; }
.nav-link svg { flex: 0 0 16px; width: 16px; height: 16px; }
.sidebar-project {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid var(--rail-line);
  border-radius: 7px;
  background: #1e372c;
  color: #e5ecde;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sidebar-project :is(small, p, .muted, .eyebrow) { color: var(--rail-muted); font-size: 11px; }
.sidebar-project > span { color: var(--rail-muted); font-size: 11px; }
.sidebar-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 11px 5px 0;
  border-top: 1px solid var(--rail-line);
  color: var(--rail-muted);
  font-size: 11px;
}
.sidebar-foot .button, .sidebar-foot .button-link { color: #deead9; }
.sidebar-foot .button:hover, .sidebar-foot .button-link:hover { background: #284336; }

.main { min-width: 0; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 61px;
  padding: 10px clamp(22px, 3.1vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.breadcrumbs strong, .breadcrumbs [aria-current] { color: var(--ink); font-weight: 680; }
.top-actions, .heading-actions, .panel-actions, .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.workflow-menu { position: relative; z-index: 2; }
.workflow-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  list-style: none;
  cursor: pointer;
}
.workflow-menu > summary::-webkit-details-marker { display: none; }
.workflow-menu > summary::after {
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
  content: '';
}
.workflow-menu[open] > summary, .workflow-menu > summary:hover { border-color: var(--line); background: var(--surface-muted); color: var(--green-dark); }
.workflow-menu > summary:focus-visible { outline: 2px solid #438161; outline-offset: 3px; }
.workflow-menu-items {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 186px;
  max-width: min(290px, calc(100vw - 28px));
  max-height: min(34vh, 255px);
  padding: 5px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 9px 24px #172e241a;
}
.workflow-menu-items > :is(button, a) {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  white-space: normal;
}
.workflow-menu-items > :is(button, a):hover { background: var(--green-light); }
.workflow-menu-items > :is(button, a):focus-visible { outline-offset: -2px; }
.workflow-menu-items > button[aria-pressed="true"] { background: #eaf0e6; color: var(--green-dark); font-weight: 690; }
.workflow-menu-items > p { margin: 4px 5px 0; padding: 6px 4px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.workspace {
  max-width: 1430px;
  margin-inline: auto;
  padding: clamp(26px, 3vw, 44px) clamp(22px, 3.1vw, 52px) 54px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.page-heading > :first-child { min-width: 0; }
.page-heading h1 {
  margin: 6px 0 8px;
  font-family: var(--font-title);
  font-size: clamp(32px, 3.25vw, 52px);
  font-weight: 740;
  letter-spacing: -.055em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 690;
  letter-spacing: .095em;
}
.page-description { max-width: 62ch; color: var(--muted); font-size: 14px; line-height: 1.65; }
.heading-actions { flex: 0 0 auto; }
.estimate-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.button svg { flex: 0 0 15px; width: 15px; height: 15px; }
.button:hover { border-color: #8e9f8d; background: var(--green-light); }
.button-primary { border-color: var(--green); background: var(--green); color: #fffef6; }
.button-primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button-quiet { background: transparent; }
.button-quiet:hover { background: #edf2e9; }
.button-link { min-height: 30px; padding: 3px 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--green); }
.button-link:hover { border-color: transparent; }
.button:disabled { opacity: .56; }
.stage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-width: 0;
  padding-top: 13px;
  border-top: 1px solid var(--line-strong);
}
.workspace > .stage-footer { grid-column: 1 / -1; margin-top: 17px; }
.stage-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 39px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
}
.stage-back:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.stage-next { margin-inline-start: auto; white-space: normal; }
.stage-next:not(.button-primary) { border-color: transparent; background: transparent; color: var(--green-dark); }
.stage-next:not(.button-primary):hover { background: var(--green-light); }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 124px;
  padding: 14px clamp(12px, 1.5vw, 23px) 15px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}
.metric:first-child { border-color: #bccfc0; background: #e6eee4; }
.metric-label { color: #3c5848; font-size: 12px; font-weight: 690; }
.metric-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 1px 6px;
  border: 1px solid #c6d6c6;
  border-radius: 4px;
  background: #f4f7ee;
  color: #3a5a46;
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}
.metric-status:is(.is-pending, .tag-warning), .metric[data-tone="warning"] .metric-status {
  border-color: #e6d6b8;
  background: #fbf1df;
  color: var(--warning);
}
.metric-value {
  margin: 7px 0 4px;
  color: #1d3e2f;
  font-size: clamp(24px, 2.65vw, 39px);
  font-weight: 710;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.048em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.metric-value :is(small, span) { font-size: .5em; font-weight: 580; letter-spacing: 0; }
.metric-note { margin-top: auto; color: var(--muted); font-size: 12px; line-height: 1.4; }
.metric:is(.warning, .metric-warning) .metric-value { color: var(--warning); }
.metric[data-tone="warning"] { border-color: #e9ddc6; background: #fcf8ef; }
.metric[data-tone="warning"] .metric-value { color: var(--warning); }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}
.panel + .panel { margin-top: 16px; }
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-height: 69px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 18px; font-weight: 720; line-height: 1.25; }
.panel-note { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty-quote {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, .82fr);
  align-items: stretch;
  min-height: 218px;
  border-color: #cbd5ca;
  overflow: hidden;
}
.empty-quote-body {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: clamp(22px, 3vw, 40px);
  border-left: 3px solid #74977e;
}
.empty-quote-body .panel-title { color: var(--green-dark); font-size: clamp(20px, 2vw, 28px); }
.empty-quote-body .panel-note { max-width: 55ch; margin-top: 7px; font-size: 13px; }
.empty-quote-body :is(.heading-actions, .form-actions) { margin-top: 18px; }
.empty-quote-preview {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  min-width: 0;
  padding: 18px 26px;
  border-left: 1px solid #d8e0d5;
  background: #edf1e8;
  color: #385749;
}
.empty-quote-preview h3 { color: var(--green-dark); font-size: 13px; font-weight: 720; }
.empty-quote-preview ul { display: grid; gap: 6px; margin: 0; padding-left: 16px; font-size: 13px; }
.empty-quote-preview li::marker { color: #6d937a; }
.table-wrap { container-type: inline-size; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.quote-table { width: 100%; min-width: 675px; border-collapse: collapse; font-size: 12px; text-align: left; }
.quote-table thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eaefe6;
  color: #3f5749;
  font-size: 12px;
  font-weight: 670;
  letter-spacing: .035em;
  white-space: nowrap;
}
.quote-table tbody :is(th, td) { padding: 12px 12px; border-bottom: 1px solid #e6e8df; vertical-align: middle; }
.quote-table :is(th, td):first-child { padding-left: 18px; }
.quote-table :is(th, td):last-child { padding-right: 18px; text-align: right; }
.quote-table :is(th, td):nth-child(4) { width: 25%; }
.quote-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.quote-table tbody tr:hover, .quote-table tbody tr:focus-within { background: #f6f8f1; }
.quote-table tr.row-excluded { background: #f8f8f3; color: var(--muted); }
.quote-table [type="checkbox"] { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.item-cell { min-width: 148px; font-weight: 400; }
.item-main { display: flex; align-items: center; gap: 8px; min-height: 21px; font-size: 13px; font-weight: 700; line-height: 1.35; cursor: pointer; }
.item-description { display: block; max-width: 32ch; margin: 3px 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.42; }
.quantity-input, .supplier-select, .manual-input, .field-input {
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fffefa;
  color: var(--ink);
  font-size: 12px;
}
:is(.quantity-input, .supplier-select, .manual-input, .field-input):hover { border-color: #9aa897; }
.quantity-input { width: 63px; font-variant-numeric: tabular-nums; }
.supplier-select { width: 100%; max-width: 230px; padding-right: 18px; }
.manual-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.manual-input { width: 86px; max-width: 100%; font-variant-numeric: tabular-nums; }
.quote-table :is(input, select):disabled { background: #f1f2ec; color: #68726c; opacity: 1; }
.cell-value { display: block; font-size: 13px; font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-value[data-row-cost] { color: #234635; font-size: 14px; font-weight: 720; }
.cell-subtle { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.quote-unit { color: var(--muted); font-size: 11px; font-weight: 550; }
.quantity-input + .quote-unit { margin-left: 6px; }
.source-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: .14em;
}
.source-link:hover { color: var(--green-dark); }
.row-status { display: inline-block; color: var(--muted); font-size: 11px; font-weight: 545; white-space: nowrap; }
.row-status.is-pending { padding: 1px 5px; border-radius: 4px; background: var(--warning-light); color: var(--warning); font-weight: 680; }
.summary-note {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.summary-note .tag { margin-right: 7px; }
.value-panel { border-left: 3px solid #819b79; }
.value-panel .panel-header { align-items: flex-start; border-bottom: 0; }
.value-panel .panel-note { max-width: 68ch; }
.value-disclosure { border-left: 1px solid var(--line); }
.value-disclosure > summary {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: calc(var(--panel-radius) - 1px);
  color: #3b5145;
  font-size: 13px;
  font-weight: 660;
  cursor: pointer;
}
.value-disclosure > summary::marker { color: var(--green); }
.value-disclosure > summary:hover { background: var(--surface-muted); }
.value-disclosure > summary:focus-visible { outline: 2px solid #438161; outline-offset: 3px; }
.value-disclosure > summary span { margin-inline-start: 6px; color: var(--muted); font-size: 11px; font-weight: 470; }
.value-disclosure > .panel-note { margin: 0 18px 10px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 19px 20px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; color: #344a3d; font-size: 12px; font-weight: 665; }
.field-full { grid-column: 1 / -1; }
.field .field-input { width: 100%; min-height: 41px; padding: 8px 10px; font-size: 14px; font-weight: 440; }
.field textarea.field-input { min-height: 92px; line-height: 1.6; resize: vertical; }
.field :is(small, .muted) { font-size: 11px; font-weight: 450; }
.form-actions { justify-content: flex-end; padding: 13px 20px; border-top: 1px solid var(--line); }
.notice {
  padding: 11px 14px;
  border: 1px solid #d7dfd1;
  border-radius: 6px;
  background: #eff3e9;
  color: #415d48;
  font-size: 12px;
  line-height: 1.55;
}
.notice:is(.warning, .notice-warning) { border-color: #e1d1b5; background: var(--warning-light); color: var(--warning); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid #cbdccc; border-radius: 4px; background: var(--green-light); color: #315a43; font-size: 11px; font-weight: 630; line-height: 1.4; white-space: nowrap; }
.tag-warning { border-color: #e7d6bd; background: var(--warning-light); color: var(--warning); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }

.proposal {
  max-width: 870px;
  margin-inline: auto;
  padding: clamp(21px, 4vw, 58px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.panel + .proposal { margin-top: 20px; }
.budget-feedback { margin: 0; padding: 0 20px 13px; }
.budget-feedback:empty { padding: 0; }
.proposal-header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.proposal-header :is(h1, h2) { margin: 6px 0 8px; font-family: var(--font-title); font-size: clamp(27px, 3.3vw, 47px); line-height: 1.18; }
.proposal-section { display: grid; gap: 5px; margin: 17px 0 0; }
.proposal-section :is(h2, h3) { color: var(--green-dark); font-size: 16px; }
.proposal-section p, .proposal-header p { white-space: pre-line; }
.proposal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.proposal-budget { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; padding: 14px; border: 1px solid #cbdacc; border-radius: 5px; background: var(--green-light); color: var(--green-dark); }
.proposal-budget > div { display: grid; gap: 3px; }
.proposal-budget strong { font-size: clamp(20px, 2.6vw, 31px); font-variant-numeric: tabular-nums; line-height: 1.25; }
.proposal .summary-note { margin-top: 16px; padding: 10px 0 0; }

.source-dialog {
  width: min(640px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 50px #142a2337;
  overflow: auto;
}
.source-dialog::backdrop { background: #132a22a6; }
.dialog-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-header h2 { font-size: 18px; }
.source-list { display: grid; gap: 10px; margin: 0; padding: 15px 18px 20px; list-style: none; }
.source-card { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; overflow-wrap: anywhere; }
.source-card :is(a, .source-link) { width: fit-content; color: var(--green); font-weight: 650; }
.source-card p { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.workshop-heading { margin-bottom: 20px; }
.workshop-heading h1 { letter-spacing: -.043em; }
.workshop-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.workshop-examples > span { margin-right: 5px; color: var(--muted); font-size: 12px; font-weight: 630; }
.workshop-example {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: #435b4c;
  font-size: 12px;
}
.workshop-example:hover { background: var(--surface); }
.workshop-example[aria-pressed="true"] { border-color: #a9bda8; background: var(--green-light); color: var(--green-dark); font-weight: 680; }
.workshop-message, .quote-stale { margin-bottom: 14px; }
.workshop-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 16px;
}
.workshop-layout > .panel + .panel, .paths-grid > .panel + .panel { margin-top: 0; }
.workshop-input .panel-header { background: #f7f8f1; border-radius: calc(var(--panel-radius) - 1px) calc(var(--panel-radius) - 1px) 0 0; }
.workshop-result .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px 11px;
  background: #eaf0e6;
  border-radius: 7px 7px 0 0;
}
.workshop-result .panel-header .panel-note { margin-top: 7px; color: #3d5949; font-size: 13px; }
.workshop-result .panel-title { color: var(--green-dark); }
.workshop-result .panel-header .tag { background: var(--surface-muted); }
.workshop-compose { display: grid; gap: 15px; padding: 15px 18px; }
.workshop-compose > textarea, .question textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fffefa;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}
.workshop-compose > textarea { min-height: 210px; max-height: 62dvh; }
.workshop-compose > textarea:hover, .question textarea:hover { border-color: #9aa897; }
.workshop-compose textarea::placeholder, .question textarea::placeholder { color: #626f65; }
.workspace-evidence small { margin-left: 4px; color: var(--muted); }
.workspace-evidence textarea.field-input { min-height: 72px; max-height: 43dvh; }
.workshop-actions { gap: 8px; }
.workshop-stale { margin: 13px 18px 0; border-color: #e1d1b5; background: var(--warning-light); color: var(--warning); }
.source-dialog .dialog-copy { padding: 15px 18px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.diagnostic-block { padding: 15px 18px; }
.diagnostic-block + .diagnostic-block { border-top: 1px solid #e7e9e0; }
.diagnostic-block h3 { margin-bottom: 8px; color: var(--green-dark); font-size: 13px; font-weight: 720; }
.diagnostic-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.diagnostic-list li { padding-left: 11px; border-left: 2px solid #9eb59a; overflow-wrap: anywhere; }
.diagnostic-list.issues li { border-color: #c8a571; }
.diagnostic-list strong { display: block; font-size: 13px; font-weight: 660; }
.diagnostic-list p, .question p { margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.question-list { display: grid; gap: 9px; }
.question { min-width: 0; padding: 10px; border: 1px solid #e2e5db; border-radius: 5px; background: #f8f8f2; overflow-wrap: anywhere; }
.question label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 680; }
.question-index { color: var(--green); font-size: 11px; font-variant-numeric: tabular-nums; }
.question textarea { min-height: 57px; margin-top: 7px; font-size: 12px; }

.prep-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: stretch; }
.prep-layout .workshop-input { display: flex; flex-direction: column; }
.prep-layout .workshop-actions { margin-top: auto; }
.prep-compose .field textarea { line-height: 1.7; }
.prep-compose .field:first-child textarea { min-height: 147px; }
.prep-compose .field:last-child textarea { min-height: 69px; }
.prep-summary { background: #f8faf3; }
.prep-summary .panel-header {
  align-items: flex-start;
  gap: 10px 12px;
  padding-block: 17px;
  border-color: #3e5549;
  border-radius: calc(var(--panel-radius) - 1px) calc(var(--panel-radius) - 1px) 0 0;
  background: #29493b;
  color: #fffdf0;
}
.prep-summary .panel-header > div { flex: 1 1 200px; min-width: 0; }
.prep-summary .panel-note { color: #e1ebdf; line-height: 1.62; }
.prep-summary .panel-header .tag { border-color: #718d77; background: #385948; color: #f7f6e6; }
.prep-objectives {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px 21px 16px 37px;
  color: #294339;
  font-size: 14px;
  font-weight: 610;
  line-height: 1.65;
}
.prep-objectives li::marker, .prep-preview-evidence li::marker { color: #46735c; }
.prep-preview-evidence { padding: 13px 17px; background: #eff3e9; color: #31483d; overflow-wrap: anywhere; }
.prep-summary > .prep-preview-evidence { margin: 0 18px 17px; border: 1px solid #dbe4d7; border-radius: 5px; }
.prep-summary > .suggested-question { margin-top: 14px; margin-bottom: 0; border-color: #cbdcc8; background: #eaf1e6; }
.prep-summary > .suggested-question:last-child { margin-bottom: 17px; }
.prep-preview-evidence h3 { color: var(--green-dark); font-size: 12px; font-weight: 735; }
.prep-preview-evidence ul { display: grid; gap: 5px; margin: 5px 0 0; padding-left: 17px; font-size: 12px; }
.prep-preview-evidence p { margin-top: 1px; color: var(--muted); font-size: 12px; }
.prep-layout + .panel, .proposal + .handoff-panel { margin-top: 17px; }

.prep-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 11px;
  padding: 15px 18px 18px;
}
.prep-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #dce1d6;
  border-radius: 6px;
  background: #f8f8f1;
  overflow-wrap: anywhere;
}
.prep-card h3, .prep-verify-item h3 { color: var(--green-dark); font-size: 14px; font-weight: 720; }
.prep-card > p, .prep-verify-item > p { color: var(--muted); font-size: 12px; }
.prep-card dl { display: grid; gap: 3px; margin: 3px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; }
.prep-card dl > div { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 7px; }
.prep-card dt { color: #415b4b; font-weight: 680; }
.prep-card dd { color: var(--muted); }
.prep-card .field { margin-top: auto; }
.prep-card .field textarea, .guide-group .field textarea { min-height: 62px; font-size: 13px; }

.prep-guide-body { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 11px; padding: 15px 18px 18px; }
.guide-group { min-width: 0; overflow-wrap: anywhere; }
.prep-guide-body > .guide-group:only-child { grid-column: 1 / -1; }
.prep-guide-body > .field { grid-column: span 1; }
.guide-group h3 { padding: 5px 8px; border-bottom: 1px solid #d7e1d4; background: #edf2e8; color: var(--green-dark); font-size: 12px; font-weight: 720; }
.guide-group ul { margin: 0; padding: 0; list-style: none; }
.guide-group li { padding: 9px 8px; border-bottom: 1px solid #e6e8df; }
.guide-group li:last-child { border-bottom: 0; }
.guide-group li > .guide-question + p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.guide-question { display: flex; align-items: flex-start; gap: 8px; color: #2d4739; font-size: 13px; line-height: 1.55; }
label.guide-question { cursor: pointer; }
.guide-question input { flex: 0 0 16px; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--green); cursor: pointer; }
.guide-question strong { min-width: 0; font-weight: 645; }
.guide-group .field { margin-top: 8px; }
.prep-interview-guide { padding: 12px 18px 16px; border-top: 1px solid var(--line); background: #f7f8f1; }
.prep-interview-guide summary { width: fit-content; color: var(--green-dark); font-size: 13px; font-weight: 715; cursor: pointer; }
.prep-interview-guide summary:focus-visible { outline: 2px solid #438161; outline-offset: 3px; }
.prep-interview-guide .guide-group { margin-top: 12px; }

.verify-layout { grid-template-columns: minmax(0, 1.11fr) minmax(0, 1fr); }
.prep-next .panel-header { border-radius: 7px 7px 0 0; background: #eaf0e6; color: var(--green-dark); }
.prep-verify-records { display: grid; gap: 12px; padding: 13px 18px 17px; }
.prep-verify-item + .prep-verify-item { padding-top: 12px; border-top: 1px solid var(--line); }
.prep-verify-item .field { margin-top: 8px; }
.prep-verify-item .field textarea { min-height: 78px; }
.prep-next .prep-preview-evidence { border: 1px solid #dce4d7; border-radius: 5px; }
.handoff-panel { max-width: 870px; margin-inline: auto; }
.handoff-panel .panel-header { border-radius: 7px 7px 0 0; background: #f1f3ea; }
.handoff-panel .field-grid { grid-template-columns: minmax(145px, .65fr) minmax(0, 1.35fr); }
.handoff-panel .field textarea { min-height: 65px; }

.paths-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.path-card { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.path-card .panel-header { border-radius: 7px 7px 0 0; background: #edf1e7; }
.path-card .panel-title { margin-top: 4px; color: var(--green-dark); font-size: clamp(17px, 1.55vw, 24px); }
.path-approach { padding: 14px 18px 0; font-size: 14px; font-weight: 580; }
.path-card :is(h3, h4) { margin: 0 0 4px; color: var(--green-dark); font-size: 12px; font-weight: 720; }
.path-tradeoff { margin: 13px 18px 0; padding: 10px 12px; border-left: 2px solid #b69f72; background: #f5f1e5; }
.path-tradeoff p, .path-scope p { color: #4d5e52; font-size: 13px; }
.path-scope, .path-items { padding: 12px 18px 0; }
.path-items { padding-bottom: 16px; }
.path-items ul { display: grid; margin: 7px 0 0; padding: 0; list-style: none; }
.path-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; min-width: 0; padding: 8px 0; border-top: 1px solid #e7e9e0; }
.path-items li > div { min-width: 0; }
.path-items li > span { flex: 0 0 auto; max-width: 40%; color: var(--green-dark); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.path-items li b { display: block; font-size: 12px; font-weight: 685; }
.path-items li small { display: block; color: var(--muted); font-size: 11px; }
.path-card .form-actions { margin-top: auto; }
.outcome-panel { margin-top: 16px; }
.outcome { display: grid; grid-template-columns: minmax(100px, .55fr) minmax(0, 2fr); align-items: start; gap: 10px 16px; padding: 12px 18px; overflow-wrap: anywhere; }
.outcome + .outcome { border-top: 1px solid #e7e9e0; }
.outcome > strong { color: var(--green-dark); font-size: 13px; }
.outcome dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.outcome dt { color: var(--muted); font-size: 11px; font-weight: 670; }
.outcome dd { margin-top: 2px; font-size: 12px; }

@media screen and (min-width: 1190px) {
  .workspace:has(> #budget-form + .proposal) {
    display: grid;
    grid-template-columns: minmax(238px, .6fr) minmax(0, 1.25fr);
    align-items: start;
    gap: 14px 18px;
  }
  .workspace:has(> #budget-form + .proposal) > :is(.page-heading, .quote-stale) { grid-column: 1 / -1; margin-bottom: 0; }
  .workspace > #budget-form { grid-column: 1; }
  .workspace > #budget-form + .proposal { grid-area: 2 / 2 / span 2; max-width: none; width: 100%; margin: 0; }
  .workspace:has(> .quote-stale) > #budget-form + .proposal { grid-row-start: 3; }
  .workspace > .proposal + .handoff-panel { grid-column: 1; max-width: none; width: 100%; margin: 0; }
  .workspace > #budget-form .field-grid, .workspace > .handoff-panel .field-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace > #budget-form + .proposal { padding: clamp(23px, 3vw, 47px); }
}

@media (max-width: 1070px) {
  .shell { grid-template-columns: 187px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .topbar, .workspace { padding-inline: 23px; }
  .quote-table :is(thead th, tbody th, tbody td) { padding-inline: 9px; }
}

@media (min-width: 761px) and (max-width: 930px) {
  .workshop-layout { grid-template-columns: minmax(0, 1fr); }
  .workshop-compose > textarea { min-height: 155px; max-height: 42dvh; }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; height: auto; min-height: 0; padding: 10px 15px; }
  .brand { min-height: 36px; padding: 0 1px; }
  .brand-mark { flex-basis: 28px; width: 28px; height: 28px; font-size: 16px; }
  .brand-mark svg { width: 16px; height: 16px; }
  .brand-name { font-size: 21px; }
  .brand small { margin-top: 2px; font-size: 10px; }
  .sidebar-section { flex: 1 0 100%; order: 2; }
  .sidebar-section-label, .sidebar-section > p, .sidebar-section > h2, .sidebar-project { display: none; }
  .sidebar-foot { margin-left: auto; padding: 0; border-top: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .nav-link { width: auto; min-height: 34px; padding: 5px 7px; gap: 4px; font-size: 12px; white-space: nowrap; }
  .nav-index { flex: 0 0 auto; width: auto; font-size: 10px; }
  .topbar { min-height: 51px; padding-inline: 15px; }
  .workspace { padding: 20px 15px 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 17px; }
  .page-heading h1 { font-size: 34px; }
  .estimate-heading { padding-bottom: 13px; }
  .metrics { gap: 7px; margin-bottom: 15px; }
  .metric { min-height: 100px; padding-block: 10px; }
  .workshop-layout, .paths-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .workshop-compose > textarea { min-height: 155px; max-height: 42dvh; }
}

@media (max-width: 640px) {
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar nav .nav-link { justify-content: center; min-height: 40px; padding-inline: 4px; }
  .prep-guide-body, .handoff-panel .field-grid { grid-template-columns: minmax(0, 1fr); }
  .empty-quote { grid-template-columns: minmax(0, 1fr); }
  .empty-quote-body { border-left: 0; }
  .empty-quote-preview { padding: 13px 21px 15px; border-top: 1px solid #d8e0d5; border-left: 0; }
}

@container (max-width: 690px) {
  .quote-table, .quote-table tbody { display: block; min-width: 0; }
  .quote-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .quote-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    gap: 1px 14px;
    min-width: 0;
    padding: 9px 14px 11px;
    border-bottom: 1px solid var(--line);
  }
  .quote-table tbody tr:last-child { border-bottom: 0; }
  .quote-table tbody tr > :is(th, td):nth-child(n) { width: auto; min-width: 0; padding: 6px 0; border: 0; text-align: left; }
  .quote-table .item-cell { grid-column: 1 / -1; }
  .quote-table tbody td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    content: attr(data-label);
  }
  .quote-table .source-link { overflow-wrap: anywhere; }
  .quote-table .cell-value { overflow-wrap: anywhere; white-space: normal; }
  .item-description { max-width: none; }
}

@media (max-width: 475px) {
  .topbar { gap: 7px; }
  .top-actions { gap: 4px; }
  .top-actions .button { min-height: 32px; padding-inline: 7px; }
  .stage-footer { gap: 5px 9px; }
  .workflow-menu > summary { min-height: 34px; padding: 5px 7px; }
  .value-disclosure > summary, .budget-feedback { padding-inline: 13px; }
  .value-disclosure > .panel-note { margin-inline: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 78px; }
  .panel-header, .summary-note, .field-grid, .form-actions { padding-inline: 13px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .proposal-grid, .proposal-budget { grid-template-columns: minmax(0, 1fr); }
  .workshop-compose, .diagnostic-block, .path-approach, .path-scope, .path-items, .outcome { padding-inline: 13px; }
  .workshop-compose textarea, .workshop-compose .field textarea, .question textarea,
  .prep-card .field textarea, .guide-group .field textarea, .prep-verify-records .field-input, .handoff-panel .field-input { font-size: 16px; }
  .workshop-stale, .path-tradeoff { margin-inline: 13px; }
  .outcome, .outcome dl { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .outcome dl > div { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px; }
  .outcome dd { margin-top: 0; }
  .prep-cards, .prep-guide-body, .prep-verify-records, .prep-interview-guide { padding-inline: 13px; }
  .prep-summary > .prep-preview-evidence { margin-inline: 13px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

@media print {
  @page { margin: 14mm; }
  :root, body, .main, .proposal { background: #fff; color: #171d19; }
  .shell { display: block; }
  .sidebar, .topbar, .page-heading, .source-dialog, .stage-footer, .workspace > :not(.proposal) { display: none !important; }
  .workspace { max-width: none; margin: 0; padding: 0; }
  .proposal { max-width: none; margin: 0; padding: 12px 0 0; border: 0; }
  .panel + .proposal { margin: 0; }
  .proposal-section, .proposal-budget { break-inside: avoid; }
}
.value-reference {
  grid-template-columns: 1fr 1fr 1fr;
  padding-top: 0;
}

.value-reference output {
  display: block;
  padding: 0.5rem 0;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #24483c;
}

@media (max-width: 640px) {
  .value-reference {
    grid-template-columns: 1fr;
  }
}
.captured-replies {
  color: var(--ink, #1a3329);
  border-bottom: 1px solid var(--line, #d5d8cc);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.captured-replies summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.captured-replies ul {
  margin-top: 12px;
}
.workshop-heading h1 {
  text-wrap: balance;
}

.suggested-question p {
  margin: 4px 0 8px;
  line-height: 1.6;
}

#outline-title {
  scroll-margin-top: 18px;
}

.delivery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.delivery-layout > .panel { margin-top: 0; }
.delivery-scope .panel-header, .delivery-acceptance .panel-header { background: var(--surface-muted); }
.delivery-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 16px 20px;
  overflow-wrap: anywhere;
}
.delivery-summary dt { color: var(--green-dark); font-size: 12px; font-weight: 700; }
.delivery-summary dd { margin: 4px 0 0; font-size: 13px; }
.delivery-task-list { margin: 0; padding: 0; list-style: none; }
.delivery-task { padding: 14px 20px 16px; }
.delivery-task + .delivery-task { border-top: 1px solid var(--line); }
.delivery-task-header h3 { font-size: 14px; }
.delivery-task-header p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.delivery-task-controls { grid-template-columns: 1.1fr 1fr 1fr; padding: 11px 0 0; }
.delivery-empty-tasks { margin: 0; padding: 16px 20px; }

@media (min-width: 961px) {
  .delivery-layout { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.2fr); }
  .delivery-scope { grid-area: 1 / 1; }
  .delivery-tasks { grid-area: 1 / 2 / span 2; }
  .delivery-acceptance { grid-area: 2 / 1; }
}

@media (max-width: 640px) {
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sidebar nav .nav-index { display: none; }
  .sidebar nav .nav-link:last-child { grid-column: span 2; }
  .delivery-task { padding-inline: 13px; }
  .delivery-task-controls { grid-template-columns: minmax(0, 1fr); }
}
.prep-reference { margin-top: 12px; padding: 0 16px 12px; }
.prep-reference > summary, .prep-research-disclosure > summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 680;
}
.prep-research-disclosure {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.prep-research-disclosure > summary { padding: 12px 0; }
