:root {
  --navy: #0b1420;
  --navy-mid: #14233a;
  --navy-light: #1c2f47;
  --gold: #b8923f;
  --gold-bright: #d4af5a;
  --cream: #f8f5ee;
  --cream-dark: #efe8d6;
  --ink: #1a1a1a;
  --muted: #6b6558;
  --border: #e2dcc8;
  --success-bg: #e7efe6;
  --success-text: #2f5d3f;
  --warning-bg: #f7eed9;
  --warning-text: #7a5c14;
  --danger-bg: #f8e6e2;
  --danger-text: #8a2f22;
  --neutral-bg: #eef1f5;
  --neutral-text: #4c5a6d;
  --serif: "Fraunces", Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(11, 20, 32, 0.06), 0 1px 1px rgba(11, 20, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 20, 32, 0.08), 0 1px 3px rgba(11, 20, 32, 0.06);
  --shadow-lift: 0 8px 24px rgba(11, 20, 32, 0.12), 0 2px 6px rgba(11, 20, 32, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }

a { color: var(--navy); }

/* ============================================================
   Icons (inline SVGs, stroke-based, sit in a soft circular badge)
   ============================================================ */

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.icon-badge svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-badge.on-dark { background: rgba(212, 175, 90, 0.14); }
.icon-badge.on-dark svg { stroke: var(--gold-bright); }

/* ============================================================
   Site nav (landing / seller / buyer / status pages)
   ============================================================ */

.site-nav {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 12px rgba(11, 20, 32, 0.18);
  position: relative;
  z-index: 10;
}

.site-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.wordmark {
  color: #fff;
  text-decoration: none;
  font-size: 21px;
  letter-spacing: 0.14em;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}

.site-nav nav {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav nav a {
  color: #cdd6e3;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.site-nav nav a:hover { color: #fff; }

.site-nav nav a.cta {
  background: var(--gold);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 3px;
  font-weight: 600;
}

.site-nav nav a.cta:hover { background: var(--gold-bright); }

.site-nav nav a.muted { color: #7c8ba0; font-size: 12px; }

/* ============================================================
   Landing page: "Live market" section - real EIA spot prices as a tile
   grid, real commodity news (several RSS outlets, images where the feed
   has one) as a card grid. Each board self-hides via [hidden] if its
   feed comes back empty (e.g. EIA_API_KEY not configured) rather than
   showing an empty section.
   ============================================================ */

.market-section { background: var(--cream-dark); max-width: none; padding-left: 24px; padding-right: 24px; }
.market-section .price-board,
.market-section .news-board { max-width: 1120px; margin-left: auto; margin-right: auto; }

.market-subhead {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 16px;
}

.price-board { margin-bottom: 48px; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.price-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.price-tile-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.price-tile-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.price-tile-unit { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 5px; }

.price-tile-change { margin-top: 8px; font-size: 13px; font-weight: 600; }
.price-tile-change.up { color: var(--success-text); }
.price-tile-change.down { color: var(--danger-text); }
.price-tile-change.flat { color: var(--muted); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.news-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--cream-dark);
  display: block;
}

.news-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-family: var(--serif);
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}

.news-card-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  font-weight: 700;
}

.news-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Landing page
   ============================================================ */

.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 88px 24px 110px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-graphic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.hero-inner { max-width: 740px; margin: 0 auto; position: relative; z-index: 1; }

.eyebrow {
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.18;
  margin: 0 0 20px;
}

.hero p.lead {
  font-size: 17px;
  line-height: 1.65;
  color: #cdd6e3;
  margin: 0 0 40px;
}

.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 3px;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--sans);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.btn-gold { background: var(--gold); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn-gold:hover { background: var(--gold-bright); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline { border-color: rgba(255, 255, 255, 0.4); color: #fff; background: transparent; }
.btn-outline:hover { border-color: #fff; transform: translateY(-1px); }

.btn-navy { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-navy:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.section { max-width: 1120px; margin: 0 auto; padding: 76px 24px; }

.section-heading { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-heading .eyebrow { color: var(--gold); }
.section-heading h2 { font-size: 28px; margin: 0 0 12px; }
.section-heading p { color: var(--muted); line-height: 1.65; margin: 0; font-size: 15px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.feature-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.feature h3 { font-size: 16px; margin: 0 0 8px; font-family: var(--sans); font-weight: 600; }
.feature p { font-size: 14px; color: var(--muted); line-height: 1.65; margin: 0; }

.timeline {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
  margin-left: 13px;
}

.timeline-item { position: relative; padding: 0 0 40px 34px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: attr(data-index);
  position: absolute;
  left: -15px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-bright);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--sans);
}

.timeline-item h3 { font-size: 16px; margin: 0 0 6px; font-family: var(--sans); font-weight: 600; }
.timeline-item p { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 0; }

.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 68px 24px; }
.cta-band h2 { font-size: 26px; margin: 0 0 12px; }
.cta-band p { color: #cdd6e3; margin: 0 0 30px; }

footer.site-footer {
  background: var(--navy-mid);
  color: #9fb0c4;
  padding: 32px 24px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

footer.site-footer a { color: #cdd6e3; }
footer.site-footer .foot-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }

/* ============================================================
   Forms (both the wizard pages and the admin app)
   ============================================================ */

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px;
}

main.form-main { max-width: 640px; padding: 48px 24px 90px; }

.form-header { text-align: center; margin-bottom: 36px; }
.form-header h1 { font-size: 26px; margin: 0 0 10px; }
.form-header p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }

h2 { font-size: 20px; margin-bottom: 4px; }

.hint {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 20px;
  line-height: 1.5;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

legend {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 6px;
}

label {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 12px;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

label.checkbox input { width: auto; }

.req { color: var(--danger-text); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid #cfcdc4;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 146, 63, 0.15);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

textarea { resize: vertical; }

.submit-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.submit-btn:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: var(--cream-dark);
  border-color: var(--navy-light);
}

.form-result {
  margin-top: 14px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  display: none;
}

.form-result.show { display: block; }
.form-result.flagged { background: var(--danger-bg); color: var(--danger-text); }
.form-result.needs_review { background: var(--warning-bg); color: var(--warning-text); }
.form-result.clear_to_contact { background: var(--success-bg); color: var(--success-text); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

tbody tr { transition: background-color 0.12s var(--ease); }
tbody tr:hover { background-color: var(--cream-dark); }

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eae8e1;
  vertical-align: top;
}

th {
  color: #666;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge.flagged { background: var(--danger-bg); color: var(--danger-text); }
.badge.needs_review { background: var(--warning-bg); color: var(--warning-text); }
.badge.clear_to_contact { background: var(--success-bg); color: var(--success-text); }
.badge.pending { background: var(--neutral-bg); color: var(--neutral-text); }
.badge.in_progress { background: var(--warning-bg); color: var(--warning-text); }
.badge.complete { background: var(--success-bg); color: var(--success-text); }
.badge.verified { background: var(--success-bg); color: var(--success-text); }
.badge.failed { background: var(--danger-bg); color: var(--danger-text); }

.flag-list {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 12px;
  color: #666;
}

select.status-select {
  font-size: 12px;
  padding: 4px 6px;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  transition: color 0.15s var(--ease);
}

.delete-btn:hover,
.delete-btn:focus-visible {
  color: var(--danger-text);
}

.hidden { display: none !important; }

.link-btn {
  background: none;
  border: none;
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
  text-decoration: underline;
  font-family: var(--sans);
  transition: color 0.15s var(--ease);
}

.link-btn:hover { color: var(--navy-light); }

#deals-table { margin-top: 20px; }

.stage-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.stage-card.warning-card {
  border-color: #d99a9a;
  background: var(--danger-bg);
}

.stage-card h3 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
}

.stage-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #666;
  margin: 14px 0 8px;
}

.stage-card .checklist label.checkbox {
  align-items: flex-start;
  margin-bottom: 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-number {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-family: var(--sans);
}

.stat-card .stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.item-row {
  padding: 10px 0;
  border-bottom: 1px solid #f1f0eb;
}

.item-row:last-child {
  border-bottom: none;
}

.item-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-row {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f0eb;
}

.checklist-row:last-child { border-bottom: none; }

.checklist-doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 26px;
  flex-wrap: wrap;
}

.checklist-doc-row select {
  margin-top: 0;
  width: auto;
  max-width: 320px;
  font-size: 12px;
  padding: 4px 6px;
}

.side-tag {
  display: inline-block;
  background: var(--neutral-bg);
  color: var(--neutral-text);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  white-space: nowrap;
}

.sub-block {
  border-top: 1px solid #eae8e1;
  padding-top: 4px;
  margin-top: 16px;
}

.sub-block h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #666;
  font-family: var(--sans);
  font-weight: 600;
  margin: 14px 0 8px;
}

.outstanding-list,
.swift-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  font-size: 13px;
}

.outstanding-list li,
.swift-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f1f0eb;
}

.outstanding-list li.resolved label { color: #999; text-decoration: line-through; }

.inline-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.inline-add input[type="text"] {
  margin-top: 0;
  flex: 1;
  min-width: 180px;
}

.inline-add select {
  margin-top: 0;
  width: auto;
  flex: 1;
  min-width: 140px;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.step {
  flex: 1 1 130px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  font-size: 12px;
}

.step.current {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.step-index {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
  margin-bottom: 6px;
}

.step-name {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  min-height: 30px;
}

.status-link-row {
  font-size: 13px;
  margin: 4px 0;
  word-break: break-all;
}

.outstanding-response {
  font-size: 12px;
  color: var(--success-text);
  background: var(--success-bg);
  border-radius: 4px;
  padding: 6px 8px;
  margin: 6px 0 10px;
}

.response-input { margin: 8px 0; }

details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

details .stage-card {
  border: none;
  border-top: 1px solid #eae8e1;
  border-radius: 0;
  padding: 12px 0;
  margin-bottom: 0;
}

/* ============================================================
   Admin app shell: one persistent, docs-style tree sidebar for the whole
   app (top-level sections, and when a deal/counterparty is open, that
   record's own sections nest underneath it), instead of tabs at the top
   plus a separate nav once you're inside a record.
   ============================================================ */

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

.app-sidebar {
  flex: 0 0 260px;
  background: #fff;
  border-right: 1px solid #e5ddc8;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 20px 0 40px;
  font-family: var(--sans);
}

.app-sidebar-header {
  padding: 0 20px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5ddc8;
}

.app-sidebar-header a {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.app-panel { display: none; }
.app-panel.active { display: block; }

.sidebar-link {
  display: block;
  padding: 10px 20px;
  color: var(--navy);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.sidebar-link:hover { background: #f5f0e0; }
.sidebar-link.active { background: #ece3c9; font-weight: 600; }

.clickable-row { cursor: pointer; }

.stage-docs { margin-top: 10px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.dropzone:hover { border-color: var(--gold); background: var(--cream-dark); }
.dropzone.dropzone-active { border-color: var(--gold); background: rgba(184, 146, 63, 0.08); color: var(--navy); }

.procedure-card { border: 1px solid var(--border); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.procedure-card:hover { box-shadow: var(--shadow-sm); }
.procedure-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 146, 63, 0.15); }
.procedure-card summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--navy);
  margin: 8px 0;
  list-style: none;
}
.procedure-card summary::-webkit-details-marker { display: none; }
.procedure-card summary::before { content: "▸ "; color: var(--gold); }
.procedure-card details[open] summary::before { content: "▾ "; }
.procedure-card ol { padding-left: 20px; margin: 10px 0 0; }
.procedure-card li { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
.procedure-card li ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.procedure-card .procedure-select-btn { margin-top: 8px; }

.tree-group { margin-bottom: 2px; }

.tree-section-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

/* Disclosure arrow for tree nodes that reveal children when open (top-level
   sections with a record drilldown, and the Documents/Requirements nodes
   one level deeper), a single glyph rotated by CSS rather than swapped, so
   it animates instead of just flipping. Nodes with no children (Tracker,
   Overview) never get one. */
.tree-arrow {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  font-size: 19px;
  line-height: 1;
  color: #5c5138;
  transition: transform 0.15s var(--ease);
}

.tree-arrow.open { transform: rotate(90deg); }

.tree-link, .tree-subitem { display: flex; align-items: center; gap: 6px; }
.tree-subitem-deep { gap: 8px; }

/* Static, non-clickable category divider inside a drilled-down list (e.g.
   Documents grouped into Identity / Authority / Compliance...), so a flat
   17-item list reads as a handful of small chunks instead of one long scroll. */
.tree-group-header {
  padding: 10px 20px 4px 42px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8064;
  margin: 0;
}

.tree-item-label {
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.tree-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(11, 20, 32, 0.1);
}

.tree-status-dot.status-success { background: #2e9e52; }
.tree-status-dot.status-warning { background: #d9a417; }
.tree-status-dot.status-danger { background: #d6453f; }
.tree-status-dot.status-neutral { background: #b7ad8c; }

.tree-section-btn:hover { background: var(--cream-dark); }
.tree-section-btn.active { background: var(--cream-dark); }

.tree-children { padding: 2px 0 12px; }

.tree-link, .tree-subitem {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 6px 20px;
  font-size: 13px;
  font-family: var(--sans);
  color: #55503f;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.tree-subitem { padding-left: 30px; }

/* A third nesting level (e.g. each individual document under Documents),
   smaller and more indented so it reads as "inside" the subitem above it,
   truncated since document labels run long, full text is in the title
   attribute for hover. */
.tree-subitem-deep {
  padding-left: 42px;
  font-size: 12px;
}

.tree-link:hover, .tree-subitem:hover { background: var(--cream-dark); color: var(--navy); }

.tree-link.active, .tree-subitem.active {
  border-left-color: var(--gold);
  background: var(--cream-dark);
  color: var(--navy);
  font-weight: 600;
}

.tree-record-label {
  padding: 10px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  border-top: 1px solid #eee5cd;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-content-panel { display: none; }
.detail-content-panel.active { display: block; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-sidebar {
    position: static;
    height: auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5ddc8;
    max-height: 50vh;
  }
  .app-content { max-width: none; padding: 20px 16px 48px; }
}

/* ============================================================
   Wizard (seller / buyer intake pages)
   ============================================================ */

.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 36px;
  position: relative;
}

.wizard-progress::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.wizard-progress .p-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.wizard-progress .p-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.wizard-progress .p-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  max-width: 84px;
}

.wizard-progress .p-step.done .p-dot { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.wizard-progress .p-step.current .p-dot { border-color: var(--navy); color: var(--navy); }
.wizard-progress .p-step.current .p-label { color: var(--ink); font-weight: 600; }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.review-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 16px;
}

.review-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f0eb;
}

.review-list li:last-child { border-bottom: none; }
.review-list li span:first-child { color: var(--muted); }
.review-list li span:last-child { text-align: right; font-weight: 500; max-width: 60%; }

.confirmation-panel { text-align: center; padding: 20px 0 40px; }

.confirmation-panel .mark {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--gold);
  margin-bottom: 12px;
}

.confirmation-panel h2 { font-size: 22px; margin: 0 0 12px; }
.confirmation-panel p { color: var(--muted); font-size: 14px; line-height: 1.65; }

.confirmation-panel .status-link-box {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 24px 0;
  word-break: break-all;
  font-size: 13px;
}

.confirmation-panel .status-link-box a { font-weight: 600; }

/* ============================================================
   Table overflow (wrap any <table> in <div class="table-scroll">)
   ============================================================ */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.table-scroll table { margin-bottom: 0; min-width: 640px; }

/* ============================================================
   About page (team/photo placeholders)
   ============================================================ */

.draft-banner {
  background: var(--warning-bg);
  border: 1px solid #e0c98a;
  color: var(--warning-text);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.team-card { text-align: center; }

.photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

.team-card h4 { margin: 0 0 2px; font-size: 15px; }
.team-card .role { color: var(--gold); font-size: 12px; margin: 0 0 8px; }
.team-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

.placeholder-text { color: var(--muted); font-style: italic; }

/* ============================================================
   Project status page (deal tracking: milestone strip, current action,
   per-stage documents) - shared markup/classes between status.js
   (buyer/seller/agent token view) and admin.js's deal detail view.
   ============================================================ */

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.project-header h2 { margin: 0 0 8px; font-size: 22px; }

.project-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.role-chip.buyer { background: #e3ecf7; color: #2a4d78; }
.role-chip.seller { background: #ece3f7; color: #55328a; }
.role-chip.procedure { background: var(--cream-dark); color: var(--gold, #7a5c14); color: #7a5c14; }

.milestone-track-wrap { overflow-x: auto; padding: 22px 4px 8px; }

.milestone-track {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
}

.milestone-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  flex-shrink: 0;
  text-align: center;
  position: relative;
}

.milestone-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  z-index: 1;
  margin-bottom: 10px;
}

.milestone-step.complete .milestone-dot { background: var(--gold); border-color: var(--gold); }
.milestone-step.current .milestone-dot { background: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 20, 32, 0.12); }
.milestone-step.blocked .milestone-dot { background: var(--danger-bg); border-color: var(--danger-text); }

.milestone-connector {
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.milestone-step:first-child .milestone-connector { display: none; }
.milestone-step.connector-filled .milestone-connector { background: var(--gold); }

.milestone-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.milestone-step.current .milestone-label { color: var(--navy); }
.milestone-step:not(.complete):not(.current) .milestone-label { color: var(--muted); font-weight: 500; }

.milestone-date { font-size: 11px; color: var(--muted); margin-top: 3px; }

.current-action-card {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.current-action-card h3 { color: var(--navy); }

.stage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-row .stage-row-name { font-size: 13px; font-weight: 500; }

.doc-card-list { margin-top: 10px; }

.doc-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.doc-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

.doc-card-head a { font-weight: 600; text-decoration: none; }
.doc-card-head a:hover { text-decoration: underline; }

.doc-meta { color: var(--muted); font-size: 12px; }

.doc-preview-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin-top: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.doc-preview-pdf {
  display: block;
  width: 100%;
  height: 380px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.doc-preview-toggle { margin-top: 8px; }

.doc-preview-toggle summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-preview-toggle summary::-webkit-details-marker { display: none; }
.doc-preview-toggle summary::before {
  content: "▸";
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
.doc-preview-toggle[open] summary::before { content: "▾"; }

.doc-preview-toggle .doc-preview-body { margin-top: 8px; }

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 720px) {
  .hero { padding: 56px 20px 72px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 15px; }
  .btn { width: 100%; text-align: center; }
  .hero-ctas, .cta-band .hero-ctas { flex-direction: column; }

  .section { padding: 48px 20px; }
  .section-heading h2 { font-size: 22px; }

  .feature-grid { grid-template-columns: 1fr; gap: 28px; }
  .feature-grid.cols-4 { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .hero-graphic { opacity: 0.3; }

  .cta-band { padding: 48px 20px; }
  .cta-band h2 { font-size: 21px; }

  main { padding: 16px; }
  main.form-main { padding: 28px 16px 60px; }

  .wizard-progress .p-label { display: none; }
  .wizard-nav { flex-wrap: wrap; gap: 10px; }

  .stepper { flex-direction: column; }
  .step { flex: 1 1 auto; }

  .topbar-inner, .site-nav-inner { flex-direction: column; align-items: flex-start; }
  .topbar nav, .site-nav nav { width: 100%; }
  .tab-btn { flex: 1 1 auto; }

  .inline-add { flex-direction: column; align-items: stretch; }
  .inline-add input, .inline-add select { width: 100%; min-width: 0; }

  .review-list li { flex-direction: column; gap: 2px; }
  .review-list li span:last-child { text-align: left; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .btn-gold:hover, .btn-navy:hover, .btn-outline:hover { transform: none; }
}
