:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #68726f;
  --line: #d9dedb;
  --paper: #f5f4ef;
  --surface: #ffffff;
  --deep: #12312d;
  --deep-2: #214a43;
  --sand: #b78d51;
  --sand-soft: #eee4d3;
  --good: #2f6b57;
  --danger: #98534b;
  --radius: 3px;
  --shadow: 0 16px 50px rgb(28 44 39 / 7%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.prototype-notice {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 20px;
  color: #f6f4ed;
  background: var(--deep);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.prototype-notice span { color: #d9c49e; }

.topbar {
  height: 68px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -.02em;
}
.brand > span:last-child span { color: var(--sand); }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--deep);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 13px;
}
.topbar nav { display: flex; justify-content: center; gap: 28px; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .03em;
}
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.workspace-state { display: flex; align-items: center; gap: 8px; min-width: 132px; }
.workspace-state > span:last-child { display: grid; }
.workspace-state strong { font-size: 10px; line-height: 1.2; }
.workspace-state small { color: var(--muted); font-size: 9px; }
.workspace-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgb(47 107 87 / 10%); }
.quiet-button, .watch-button, .room-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--deep);
  border-radius: var(--radius);
  background: var(--deep);
  color: white;
  font-weight: 600;
}
.room-button { color: var(--deep); background: #dfc08c; border-color: #dfc08c; }
.quiet-button.watched, .watch-button.watched { background: var(--good); border-color: var(--good); }

.app-shell {
  max-width: 1500px;
  min-height: calc(100vh - 102px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-rail {
  padding: 30px 22px;
  background: #eeeee8;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
}
.search-label, .data-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.search-wrap {
  height: 48px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  padding: 0 12px;
  background: white;
  border: 1px solid #cbd0cd;
  border-radius: var(--radius);
}
.search-wrap span { color: var(--muted); font-size: 20px; }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-help { margin: 9px 0 24px; color: var(--muted); font-size: 12px; }
.result-count { color: var(--muted); font-size: 11px; letter-spacing: .04em; margin-bottom: 8px; }
.project-results { display: grid; gap: 5px; }
.project-result {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 13px 12px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
}
.project-result:hover { background: rgb(255 255 255 / 55%); }
.project-result.selected { background: white; border-color: #c7ceca; box-shadow: 0 4px 18px rgb(18 49 45 / 5%); }
.project-result strong { display: block; font-size: 13px; }
.project-result small, .result-area { display: block; color: var(--muted); font-size: 11px; }
.result-area { padding-top: 6px; border-top: 1px solid #e2e4e1; }
.rail-note { margin-top: 30px; padding-top: 20px; border-top: 1px solid #cdd1ce; }
.rail-note-title { font-family: Georgia, serif; font-size: 14px; }
.rail-note p { color: var(--muted); font-size: 11px; line-height: 1.6; }

.project-workspace { min-width: 0; padding: 44px clamp(24px, 5vw, 74px) 80px; }
.project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
}
.eyebrow { color: var(--sand); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 8px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.045em;
}
.project-byline { margin: 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 10px; padding-top: 7px; }
.record-pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
}
.record-pill.fixture { color: #795e35; background: var(--sand-soft); }
.record-pill.official { color: #f4f8f6; background: var(--good); }

.decision-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.decision-strip > div { min-width: 0; padding: 19px 18px 20px 0; }
.decision-strip > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.decision-strip strong { display: block; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 21px; font-weight: 400; }
.decision-strip small { color: var(--muted); font-size: 10px; }

.watch-return { margin: 24px 0 0; padding: 22px 24px; border: 1px solid #abc4b8; border-radius: 14px; background: linear-gradient(135deg, #edf6f0, #f8faf6); }
.watch-return.changed { border-color: #c69b62; background: linear-gradient(135deg, #fff5e6, #fbf8f1); }
.watch-return.unavailable { border-color: var(--line); background: var(--paper); }
.watch-return-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.watch-return-heading span { color: var(--good); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.watch-return-heading h2 { margin: 5px 0 0; font: 400 25px/1.1 Georgia, serif; }
.watch-return-heading small, .watch-return > p { color: var(--muted); }
.watch-return-actions { display: grid; justify-items: end; gap: 9px; }
.watch-return-actions button { border: 0; padding: 0; color: #8a4a38; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.watch-return > p { margin: 10px 0 0; max-width: 720px; font-size: 12px; }
.watch-return-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.watch-return-list article { min-width: 0; padding: 13px; border: 1px solid rgba(18,49,45,.15); border-radius: 10px; background: rgba(255,255,255,.72); }
.watch-return-list strong, .watch-return-list span, .watch-return-list small { display: block; overflow-wrap: anywhere; }
.watch-return-list strong { font-size: 11px; }
.watch-return-list span { margin-top: 5px; font: 400 17px/1.25 Georgia, serif; }
.watch-return-list small { margin-top: 5px; color: var(--muted); font-size: 9px; }

.workspace-section { padding: 42px 0 45px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.section-heading > div:first-child { display: flex; gap: 15px; align-items: baseline; }
.section-number { color: var(--sand); font-family: Georgia, serif; font-size: 12px; }
h2 { margin: 0; font-family: Georgia, serif; font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.section-heading > p { max-width: 370px; margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.construction-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 55px; }
.progress-reading { padding: 28px; background: var(--deep); color: white; }
.progress-number { display: flex; align-items: baseline; gap: 12px; }
.progress-number strong { font-family: Georgia, serif; font-size: 56px; font-weight: 400; }
.progress-number span { color: #b9cbc6; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.progress-track { height: 3px; margin: 24px 0 15px; background: #47635d; }
.progress-track span { display: block; height: 100%; background: #d9c49e; transition: width .35s ease; }
.progress-meta { display: flex; justify-content: space-between; color: #b9cbc6; font-size: 10px; }
.facts-list { min-width: 0; border-top: 1px solid var(--ink); }
.facts-list > div { min-width: 0; display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts-list span { color: var(--muted); font-size: 11px; }
.facts-list strong { min-width: 0; overflow-wrap: anywhere; text-align: right; font-size: 12px; }

.change-ledger { border-top: 1px solid var(--ink); }
.change-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 25px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.change-date span, .change-date small { display: block; }
.change-date span { font-family: Georgia, serif; }
.change-date small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.change-row h3 { margin: 0 0 5px; font-size: 13px; }
.change-row p { display: flex; gap: 10px; align-items: center; margin: 0; font-family: Georgia, serif; font-size: 18px; }
.change-row del { color: var(--muted); }
.change-proof { color: var(--good); font-size: 10px; }

.cash-heading { align-items: flex-end; }
.price-control { min-width: 250px; }
.price-control > span:first-child { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.price-input-wrap { height: 43px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #bcc3bf; }
.price-input-wrap b { color: var(--sand); font-size: 11px; }
.price-input-wrap input { width: 100%; border: 0; outline: 0; font-weight: 650; }
.price-input-wrap:has(input:disabled) { background: #efefeb; border-color: var(--line); }
.price-input-wrap input:disabled { color: var(--muted); background: transparent; cursor: not-allowed; }
.cash-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 30px; align-items: end; padding: 18px 0; border-top: 1px solid var(--ink); }
.cash-summary p { max-width: 600px; margin: 0; color: var(--muted); font-size: 12px; grid-row: span 2; }
.cash-summary strong { font-family: Georgia, serif; font-size: 25px; font-weight: 400; text-align: right; }
.cash-summary span { color: var(--muted); font-size: 9px; text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 8px; text-align: right; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
th:first-child, td:first-child { text-align: left; }
td { padding: 14px 8px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 2px; font-size: 10px; }

.evidence-section { border-bottom: 0; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.evidence-grid article { padding: 20px 22px 6px 0; }
.evidence-grid article + article { padding-left: 22px; border-left: 1px solid var(--line); }
.evidence-class { color: var(--good); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.evidence-class.unknown { color: var(--danger); }
.evidence-grid h3 { margin: 9px 0 8px; font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.evidence-grid p { color: var(--muted); font-size: 11px; line-height: 1.65; }

.resource-library {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.resource-card {
  min-width: 0;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 18px 0;
  color: var(--ink);
  text-decoration: none;
}
.resource-card + .resource-card { padding-left: 20px; border-left: 1px solid var(--line); }
.resource-card:nth-child(n + 5) { border-top: 1px solid var(--line); }
.resource-card:nth-child(4n + 1) { padding-left: 0; border-left: 0; }
.resource-card > span { color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.resource-card h3 { margin: 16px 0 7px; font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.resource-card p { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.resource-card strong { margin-top: auto; color: var(--muted); font-size: 10px; }
.resource-card.verified strong { color: var(--good); }
.resource-card.verified:hover h3, .resource-card.verified:focus-visible h3 { text-decoration: underline; text-underline-offset: 3px; }
.source-policy { display: grid; grid-template-columns: 150px 1fr; gap: 25px; padding-top: 17px; }
.source-policy strong { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.source-policy p { max-width: 760px; margin: 0; color: var(--muted); font-size: 11px; }

.room-create-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; padding: 28px; color: white; background: var(--deep); }
.room-create-panel h3 { margin: 8px 0; font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.room-create-panel p { max-width: 680px; margin: 0; color: #bdd0ca; font-size: 12px; line-height: 1.65; }
.room-create-actions { display: grid; gap: 9px; justify-items: stretch; min-width: 220px; }
.room-create-actions small { color: #bdd0ca; font-size: 9px; text-align: center; }
.decision-room-list { display: grid; gap: 12px; margin-top: 18px; }
.decision-room-card { padding: 20px; border: 1px solid var(--line); background: #fbfaf6; }
.decision-room-card.stale { border-left: 4px solid var(--danger); }
.room-card-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.room-card-heading span { color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.room-card-heading h3 { margin: 4px 0; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.room-card-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.room-card-heading > strong { color: var(--good); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.decision-room-card.stale .room-card-heading > strong { color: var(--danger); }
.room-card-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.room-card-facts > span { min-width: 0; padding: 12px 14px 12px 0; overflow-wrap: anywhere; font-size: 12px; }
.room-card-facts > span + span { padding-left: 14px; border-left: 1px solid var(--line); }
.room-card-facts small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.room-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.room-card-footer > small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.room-export { min-height: 36px; padding: 0 14px; color: var(--deep); background: transparent; border: 1px solid var(--deep); font-size: 10px; font-weight: 700; }
.room-empty { margin: 0; }

.article-list { border-top: 1px solid var(--ink); }
.article-list article {
  display: grid;
  grid-template-columns: 190px minmax(220px, .8fr) minmax(280px, 1.2fr);
  gap: 28px;
  align-items: baseline;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.article-list span { color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.article-list h3 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 400; line-height: 1.25; }
.article-list p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.article-section { border-bottom: 0; }
.empty-state { padding: 18px; color: var(--muted); border: 1px dashed #bec4c0; font-size: 12px; }

.watch-toast {
  display: flex;
  gap: 14px;
  align-items: center;
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  padding: 14px 18px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 50;
}
.watch-toast.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.watch-toast button { border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 6px 11px; color: white; background: transparent; font: inherit; font-weight: 800; cursor: pointer; }

:focus-visible { outline: 3px solid #d3ad72; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 230px minmax(0, 1fr) auto;
    gap: 16px;
    padding: 0 20px;
  }
  .topbar nav { gap: 20px; }
  .app-shell { grid-template-columns: 280px minmax(0, 1fr); }
  .project-workspace { padding: 38px 32px 72px; }
  .project-heading, .section-heading { flex-wrap: wrap; }
  .heading-actions { flex-shrink: 0; }
  .decision-strip strong { font-size: 18px; }
  .construction-grid { gap: 32px; }
}

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 20px; }
  .topbar nav { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .project-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-results { grid-template-columns: repeat(3, 1fr); }
  .rail-note { display: none; }
  .decision-strip { grid-template-columns: repeat(2, 1fr); }
  .decision-strip > div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .decision-strip > div:nth-child(4) { border-top: 1px solid var(--line); }
  .resource-library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .resource-card:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  .article-list article { grid-template-columns: 150px minmax(0, 1fr); }
  .article-list p { grid-column: 2; }
  .room-create-panel { grid-template-columns: 1fr; }
  .room-create-actions { justify-self: start; }
  .room-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-card-facts > span:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .room-card-facts > span:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .prototype-notice { display: block; text-align: center; }
  .prototype-notice span { display: none; }
  .topbar { height: 62px; }
  .quiet-button { display: none; }
  .project-rail { padding: 22px 16px; }
  .project-results { grid-template-columns: 1fr; }
  .project-workspace { padding: 28px 16px 60px; }
  .project-heading { display: block; }
  .watch-return-heading { display: block; }
  .watch-return-heading small { display: block; margin-top: 8px; }
  .watch-return-actions { justify-items: start; margin-top: 10px; }
  .watch-return-list { grid-template-columns: 1fr; }
  .heading-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 20px; }
  .heading-actions .room-button { order: 3; width: 100%; }
  h1 { font-size: 42px; }
  .decision-strip { grid-template-columns: 1fr 1fr; }
  .decision-strip > div { padding: 15px 10px 15px 0; }
  .decision-strip > div + div { padding-left: 10px; }
  .section-heading, .cash-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .construction-grid { grid-template-columns: 1fr; gap: 20px; }
  .change-row { grid-template-columns: 1fr; gap: 8px; }
  .change-proof { justify-self: start; }
  .price-control { display: block; margin-top: 20px; }
  .cash-summary { grid-template-columns: 1fr; }
  .cash-summary p { grid-row: auto; }
  .cash-summary strong, .cash-summary span { text-align: left; }
  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-grid article, .evidence-grid article + article { padding: 18px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .progress-meta { display: grid; gap: 4px; }
  .resource-library { grid-template-columns: 1fr; }
  .resource-card, .resource-card + .resource-card, .resource-card:nth-child(3), .resource-card:nth-child(4) {
    min-height: 0;
    padding: 18px 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }
  .source-policy { grid-template-columns: 1fr; gap: 7px; }
  .article-list article { grid-template-columns: 1fr; gap: 7px; }
  .article-list p { grid-column: 1; }
  .room-create-panel { padding: 22px 18px; }
  .room-create-actions { width: 100%; min-width: 0; }
  .room-card-heading, .room-card-footer { display: grid; gap: 12px; }
  .room-card-facts { grid-template-columns: 1fr; }
  .room-card-facts > span, .room-card-facts > span + span, .room-card-facts > span:nth-child(3), .room-card-facts > span:nth-child(4) { padding: 10px 0; border-left: 0; border-top: 1px solid var(--line); }
  .room-card-facts > span:first-child { border-top: 0; }
  .room-export { width: 100%; }
}
