/*
PROJECT ENGINEERING CONTRACT
Checklist and document workflow styles are mobile-first and owned here.
Modify the original component rule instead of adding a late cascade override.
*/

/*
 * Property Check stylesheet segment: 02-checklist-workflow.css
 * Guided checklist, document workflow, authentication, and case-detail refinements.
 *
 * Cascade contract: files are loaded in numeric order. Modify the owning file
 * instead of appending unrelated overrides to the final stylesheet.
 */

/* ============================================================
GUIDED STAGE MODE — one clear mission at a time
============================================================ */

/* Mobile-first: label + Sections button on row one, the bar gets
   its own full-width row, the resolved-count sits underneath.
   Grid areas keep this readable instead of guessing column order. */
.compact-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label  sections"
    "bar    bar"
    "small  small";
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 22px;
  padding: 13px 14px;
  background: var(--white);
  border: 1px solid var(--stone-line);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}
.compact-progress > span { grid-area: label; }
.compact-progress > div { grid-area: bar; height: 8px; overflow: hidden; border-radius: 99px; background: var(--stone-line); }
.compact-progress i { display: block; height: 100%; background: var(--copper); border-radius: inherit; }
.compact-progress > small { grid-area: small; color: var(--stone); font-family: var(--font-mono); font-size: 11px; }
.compact-progress .btn-sections { grid-area: sections; justify-self: end; }

@media (min-width: 761px) {
  .compact-progress {
    grid-template-columns: auto minmax(160px, 1fr) auto auto;
    grid-template-areas: "label bar small sections";
    padding: 12px 16px;
    border-radius: 999px;
    font-size: 12px;
  }
}

.stage-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, .8fr);
  gap: 22px;
  padding: 30px;
  margin-bottom: 20px;
  overflow: hidden;
  color: var(--white);
  background: var(--pine);
  border-radius: 24px;
  box-shadow: 0 16px 45px rgba(22, 33, 28, .14);
}
.stage-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  top: -125px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.035), 0 0 0 68px rgba(255,255,255,.025);
}
.stage-hero-main, .document-pack { position: relative; z-index: 1; }
.stage-eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--copper);
  color: #24160b;
  font: 700 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stage-hero h2 { margin: 0 0 12px; max-width: 650px; font: 600 clamp(26px, 4vw, 40px)/1.08 var(--font-display); }
.stage-instruction { margin: 0; max-width: 650px; color: #dbe5dd; font-size: 15px; line-height: 1.65; }
.mission-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
}
.mission-icon { font-size: 25px; }
.mission-card strong { color: var(--copper-light); }
.mission-card p { margin: 4px 0 0; color: #dbe5dd; font-size: 13px; line-height: 1.5; }
.document-pack {
  align-self: stretch;
  padding: 18px;
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: 16px;
}
.pack-label { display: block; margin-bottom: 11px; color: var(--stone); font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.pack-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--stone-line); font-size: 13px; font-weight: 600; }
.pack-item:last-child { border-bottom: 0; }
.pack-item span { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; background: #e6ebe4; color: var(--pine); font: 700 11px var(--font-mono); }
.stage-score { position: absolute; right: 34px; bottom: 13px; z-index: 2; display: none; }

.single-stage .section-card { border: 0; background: transparent; overflow: visible; }
.single-stage .section-header { cursor: default; padding: 18px 4px 14px; background: transparent; border: 0; }
.single-stage .section-toggle { display: none; }
.single-stage .section-title-row h2 { font-size: 24px; }
.single-stage .section-body { padding: 0; display: grid; gap: 12px; }
.single-stage .event-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--stone-line);
  border-left: 6px solid var(--stone-line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 4px 16px rgba(22,33,28,.04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.single-stage .event-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22,33,28,.09); }
.single-stage .event-card.high-stakes { border-left-color: var(--rust); background: var(--white); }
.single-stage .event-card.status-in_progress { border-left-color: var(--copper); }
.single-stage .event-card.status-done { opacity: 1; border-left-color: var(--pine); background: #e7f2e9; }
.single-stage .event-card.status-na { opacity: .72; border-left-color: var(--stone); }
.single-stage .event-row { grid-template-columns: auto 1fr; align-items: center; padding: 18px; }
.single-stage .status-pill { width: 54px; min-width: 54px; height: 54px; padding: 0; border-radius: 50%; }
.single-stage .status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.single-stage .status-icon { font-size: 22px; }
.single-stage .event-step { color: var(--copper); font-weight: 700; }
.single-stage .item-title { font-size: 17px; }
.single-stage .event-why { max-width: 700px; }
.single-stage .event-detail { margin: 0 15px 15px; padding: 18px; border-radius: 12px; background: var(--paper-raised); }
.stage-footer-note { margin: 18px 0; padding: 14px; text-align: center; color: var(--stone); font-size: 12px; }


@media (max-width: 760px) {
  .stage-hero { grid-template-columns: 1fr; padding: 22px; border-radius: 18px; }
  .stage-hero h2 { font-size: 29px; }
  .single-stage .event-row { grid-template-columns: 44px 1fr; gap: 10px; padding: 15px; }
  .single-stage .status-pill { width: 44px; min-width: 44px; height: 44px; }
  .section-progress-wrap { width: 125px; }
}

/* ============================================================
LEGAL DOCUMENT QUEST + MOBILE-FIRST CORRECTIONS
============================================================ */
.item-visual {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--paper-raised);
  overflow: hidden;
  flex-shrink: 0;
}
.item-visual img { width: 100%; height: 100%; object-fit: contain; }
.item-visual svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.next-steps-section-icon {
  display: block;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.single-stage .event-row:has(.item-visual) { grid-template-columns: 54px 112px minmax(0, 1fr); }
.single-stage .event-row:has(.item-visual) .status-pill { grid-column: 1; }
.single-stage .event-row:has(.item-visual) .item-visual { grid-column: 2; }
.single-stage .event-row:has(.item-visual) .event-body { grid-column: 3; }

.document-quest { margin: 0 0 18px; }
.quest-path { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: start; gap: 8px; margin-bottom: 16px; }
.quest-path > i { height: 2px; margin-top: 17px; background: var(--stone-line); }
.quest-node { display: grid; justify-items: center; gap: 5px; min-width: 62px; color: var(--stone); }
.quest-node span { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--stone-line); border-radius: 50%; background: var(--white); font: 700 12px var(--font-mono); }
.quest-node b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.quest-node.current span { border-color: var(--copper); color: var(--copper); box-shadow: 0 0 0 4px rgba(193,121,63,.12); }
.quest-node.complete { color: var(--pine); }
.quest-node.complete span { border-color: var(--pine); background: var(--pine); color: white; }

.quest-card { padding: 16px; border: 1px solid var(--stone-line); border-radius: 12px; background: var(--white); }
.quest-kicker { display: block; margin-bottom: 5px; color: var(--copper); font: 700 10px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.quest-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.quest-card small { color: var(--stone); }
.upload-zone { margin-top: 12px; }
.upload-label { display: grid; justify-items: center; gap: 6px; padding: 20px; border: 2px dashed var(--stone-line); border-radius: 12px; background: var(--white); cursor: pointer; text-align: center; }
.upload-label:hover { border-color: var(--copper); background: #fffaf3; }
.upload-label > span { font-size: 24px; color: var(--copper); }
.upload-label small { color: var(--stone); }
.uploaded-file { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #b8cdbd; border-radius: 12px; background: #f1f7f2; }
.file-check { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--pine); color: white; font-weight: 700; }
.uploaded-file strong, .uploaded-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-file small { margin-top: 3px; color: var(--stone); }
.uploaded-file button { border: 0; background: transparent; color: var(--pine); font-weight: 600; cursor: pointer; }
.verification-unlocked { margin-top: 12px; padding: 18px; border: 1px solid var(--copper-light); border-radius: 12px; background: #fff8ee; animation: revealQuest .35s ease-out; }
@keyframes revealQuest { from { opacity: 0; transform: translateY(8px); } }
.unlock-badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: var(--copper); color: #24160b; font: 700 10px var(--font-mono); text-transform: uppercase; }
.verification-unlocked h4 { margin: 12px 0 6px; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.verification-unlocked p { margin: 0 0 12px; line-height: 1.55; }
.official-office { padding: 12px; border-radius: 9px; background: var(--white); font-size: 13px; line-height: 1.5; }
.verification-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.verification-actions a, .verify-btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 13px; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none; }
.verification-actions a { border: 1px solid var(--pine); color: var(--pine); background: white; }
.verify-btn { border: 0; background: var(--pine); color: white; cursor: pointer; }
.verify-btn:disabled { opacity: .65; cursor: default; }
.item-complete-btn {
  min-height: 44px;
  margin-top: 18px;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--pine);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.item-complete-btn:hover { background: var(--pine-light); }
.item-complete-btn.is-complete {
  border: 1px solid #9fb8a7;
  background: #edf4ef;
  color: var(--pine);
}
.item-complete-btn.is-complete:hover {
  border-color: var(--pine-light);
  background: #e1ece4;
}
.locked-next { margin: 12px 0 0; padding: 11px; border-radius: 9px; background: #e9ede8; color: var(--stone); font-size: 12px; }

@media (max-width: 760px) {
  .main { width: 100%; padding: 18px 14px 60px; }
  .purchase-header { align-items: stretch; }
  .purchase-name-input { font-size: 28px; }
  .header-actions { width: auto; }
  .stage-hero { margin-left: -4px; margin-right: -4px; padding: 20px 16px; }
  .document-pack { padding: 14px; }
  .single-stage .section-header { padding-left: 0; padding-right: 0; }
  .single-stage .event-row,
  .single-stage .event-row:has(.item-visual) { grid-template-columns: 44px minmax(0,1fr); align-items: start; padding: 14px; }
  .single-stage .event-row:has(.item-visual) .status-pill { grid-column: 1; grid-row: 1; }
  .single-stage .event-row:has(.item-visual) .item-visual { grid-column: 2; grid-row: 1; width: 92px; height: 92px; justify-self: start; margin-bottom: 10px; }
  .single-stage .event-row:has(.item-visual) .event-body { grid-column: 1 / -1; grid-row: 2; }
  .single-stage .event-detail { padding: 12px; }
  .quest-path { gap: 4px; }
  .quest-node { min-width: 50px; }
  .quest-node b { font-size: 9px; }
  .uploaded-file { grid-template-columns: auto minmax(0,1fr); }
  .uploaded-file button { min-height: 38px; border: 1px solid var(--stone-line); border-radius: 7px; }
  .uploaded-file button:first-of-type { grid-column: 1; }
  .verification-actions { display: grid; grid-template-columns: 1fr; }
  .verification-actions a, .verify-btn { width: 100%; }
}

/* ============================================================
MOBILE-FIRST FOUNDATION
The default rules below are designed for phones. Wider layouts are
progressively enhanced with min-width queries.
============================================================ */

html {
  min-width: 320px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font-size: 16px;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

.app {
  display: block;
  width: 100%;
  min-height: 100svh;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  border-right: 0;
  border-bottom: 1px solid #1e3229;
}

.rail-head {
  align-items: center;
  gap: 10px;
  margin: 0;
}

.rail-mark {
  width: 24px;
  height: 24px;
}

.rail-head h1 {
  font-size: 20px;
}

.tagline {
  display: none;
}

.rail-toggle {
  display: flex;
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.rail-collapsible {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.rail-collapsible.open {
  display: block;
}

.purchase-list {
  max-height: min(42svh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.purchase-item,
.btn-new,
.btn-ghost {
  min-height: 46px;
}

.main {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 20px 14px calc(68px + env(safe-area-inset-bottom));
}

.empty-state {
  margin: 44px auto 0;
  max-width: 580px;
  padding: 0 10px;
}

.empty-state h2 {
  font-size: 30px;
}

.empty-state p {
  font-size: 16px;
  line-height: 1.6;
}

.purchase-header {
  position: relative;
  display: block;
  margin-bottom: 18px;
  padding: 2px 0 18px;
  border-bottom-width: 2px;
}

.purchase-header .titles {
  min-width: 0;
  width: 100%;
  padding-right: 92px;
}

.field-label {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.purchase-name-input {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 4px 0 7px;
  border: 0;
  border-bottom: 1px dashed var(--stone-line);
  border-radius: 0;
  font-size: clamp(27px, 8vw, 34px);
  line-height: 1.08;
}

.purchase-name-input:focus,
.purchase-name-input:hover {
  background: var(--paper-raised);
}

.header-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: auto;
  align-items: center;
  justify-content: flex-end;
}

.btn-danger {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--rust);
  border-radius: 8px;
  background: transparent;
  color: var(--rust);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.btn-danger .delete-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}








.stage-hero {
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 -2px 28px;
  padding: 22px 17px;
  border-radius: 18px;
}

.stage-eyebrow {
  margin-bottom: 11px;
  font-size: 10px;
}

.stage-hero h2 {
  font-size: clamp(29px, 9vw, 38px);
  line-height: 1.05;
}

.stage-instruction {
  font-size: 16px;
  line-height: 1.6;
}

.mission-card {
  margin-top: 17px;
  padding: 14px;
}

.mission-card p {
  font-size: 14px;
}

.document-pack {
  padding: 15px;
}

.pack-item {
  min-height: 46px;
  font-size: 14px;
  line-height: 1.4;
}

.single-stage .section-card {
  margin-bottom: 18px;
}

.single-stage .section-header {
  display: block;
  padding: 2px 0 16px;
}

.single-stage .section-heading {
  width: 100%;
}

.single-stage .section-title-row {
  align-items: flex-start;
}

.single-stage .section-title-row h2 {
  font-size: 25px;
  line-height: 1.15;
}

.single-stage .section-intro {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.single-stage .section-progress-wrap {
  width: 100%;
  margin-top: 13px;
}

.single-stage .section-body {
  gap: 14px;
}

.single-stage .event-card {
  border-radius: 16px;
}

.single-stage .event-card:hover {
  transform: none;
}

.single-stage .event-row,
.single-stage .event-row:has(.item-visual) {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 15px;
}

.single-stage .status-pill,
.single-stage .event-row:has(.item-visual) .status-pill {
  grid-column: 1;
  grid-row: 1;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}

.single-stage .event-body {
  grid-column: 2;
  grid-row: 1;
}

.single-stage .event-row:has(.item-visual) .item-visual {
  grid-column: 2;
  grid-row: 1;
  width: 104px;
  height: 104px;
  margin: 0 0 4px;
  justify-self: start;
}

.single-stage .event-row:has(.item-visual) .event-body {
  grid-column: 1 / -1;
  grid-row: 2;
}

.single-stage .event-step,
.stake-flag {
  font-size: 11px;
}

.single-stage .item-title {
  font-size: 18px;
  line-height: 1.3;
}

.single-stage .event-why {
  font-size: 14px;
  line-height: 1.55;
}

.expand-btn {
  min-height: 42px;
  margin-top: 7px;
  font-size: 14px;
}

.single-stage .event-detail {
  margin-top: 10px;
  padding: 13px;
}

.detail-block h4,
.notes-label,
.cost-field-label {
  font-size: 11px;
}

.detail-block p,
.item-notes,
.cost-field,
.quest-card p,
.official-office {
  font-size: 15px;
}

.item-notes {
  min-height: 92px;
  padding: 11px 12px;
}

.cost-fields {
  flex-direction: column;
  gap: 12px;
}

.cost-field,
.cost-field input {
  width: 100%;
}

.cost-field input {
  min-height: 46px;
  padding: 9px 10px;
  font-size: 16px;
}

.document-quest {
  margin-bottom: 16px;
}

.quest-path {
  gap: 4px;
}

.quest-node {
  min-width: 50px;
}

.quest-node span {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.quest-node b {
  font-size: 9px;
}

.quest-path > i {
  margin-top: 19px;
}

.quest-card,
.verification-unlocked {
  padding: 14px;
}

.upload-label {
  min-height: 132px;
  padding: 20px 14px;
}

.upload-label strong {
  font-size: 16px;
}

.upload-label small {
  font-size: 13px;
  line-height: 1.45;
}

.uploaded-file {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
}

.uploaded-file button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--stone-line);
  border-radius: 8px;
}

.uploaded-file button:first-of-type {
  grid-column: 1 / 2;
}

.verification-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.verification-actions a,
.verify-btn {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

.stage-footer-note {
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: calc(100vw - 28px);
  max-width: 520px;
  padding: 12px 14px;
  font-size: 14px;
}

@media (min-width: 761px) {
  .tagline {
    display: block;
  }

  .main {
    padding: 30px 28px 80px;
  }

  .purchase-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding-top: 4px;
  }

  .purchase-header .titles {
    padding-right: 0;
  }

  .purchase-name-input {
    font-size: 38px;
  }

  .header-actions {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
  }




  .single-stage .section-header {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .single-stage .section-progress-wrap {
    width: 210px;
    margin-top: 0;
  }

  .single-stage .event-row,
  .single-stage .event-row:has(.item-visual) {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .single-stage .status-pill,
  .single-stage .event-row:has(.item-visual) .status-pill {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
  }

  .single-stage .event-row:has(.item-visual) {
    grid-template-columns: 54px 112px minmax(0, 1fr);
  }

  .single-stage .event-row:has(.item-visual) .status-pill {
    grid-column: 1;
    grid-row: 1;
  }

  .single-stage .event-row:has(.item-visual) .item-visual {
    grid-column: 2;
    grid-row: 1;
    width: 112px;
    height: 112px;
    margin: 0;
  }

  .single-stage .event-row:has(.item-visual) .event-body {
    grid-column: 3;
    grid-row: 1;
  }

  .cost-fields {
    flex-direction: row;
  }

  .cost-field {
    width: auto;
    min-width: 180px;
  }

  .cost-field input {
    width: 180px;
  }

  .uploaded-file {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .uploaded-file button:first-of-type {
    grid-column: auto;
  }

  .verification-actions {
    display: flex;
  }

  .verification-actions a,
  .verify-btn {
    width: auto;
  }
}

@media (min-width: 900px) {
  .stage-hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.8fr);
    gap: 22px;
    padding: 30px;
    border-radius: 24px;
  }
}

@media (min-width: 961px) {
  .app {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .rail {
    position: sticky;
    top: 0;
    width: auto;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 22px;
    border-right: 1px solid #1e3229;
    border-bottom: 0;
  }

  .rail-head {
    align-items: center;
    margin-bottom: 28px;
  }

  .rail-toggle {
    display: none;
  }

  .rail-collapsible,
  .rail-collapsible.open {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .purchase-list {
    max-height: none;
    overflow: visible;
  }

  .main {
    max-width: 1180px;
    padding: 40px 48px 90px;
  }
}


/* ============================================================
   CLEAN PROJECT HEADER + SIDEBAR DELETE + MOBILE ICON ALIGNMENT
   ============================================================ */
.purchase-header .titles { padding-right: 0; }
.purchase-name-input {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}
.purchase-name-input::placeholder {
  color: var(--stone);
  opacity: .58;
  font-family: var(--font-body);
  font-size: .42em;
  font-weight: 600;
  letter-spacing: .08em;
}
.purchase-name-input:hover,
.purchase-name-input:focus {
  border-color: var(--stone-line);
  background: var(--paper-raised);
}
.header-actions { display: none; }

.btn-delete-project {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid #e79a89;
  border-radius: 8px;
  background: transparent;
  color: #ffd5cc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-delete-project:hover { background: rgba(168,69,47,.22); border-color: #ffc0b2; }
.btn-delete-project .delete-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The instruction panel now has one clear text block and one document list. */
.stage-hero-main { align-self: start; }

@media (max-width: 760px) {
  .purchase-header { padding-top: 0; }
  .purchase-name-input {
    min-height: 52px;
    padding: 9px 10px;
    border-bottom-style: solid;
  }
  .purchase-name-input::placeholder { font-size: 12px; }

  .single-stage .event-row:has(.item-visual) .item-visual {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    margin: 0 auto 4px;
  }
  .single-stage .event-row:has(.item-visual) .status-pill {
    grid-column: 1;
    grid-row: 2;
  }
  .single-stage .event-row:has(.item-visual) .event-body {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ============================================================
   LEGAL INSTRUCTIONS + COMPACT MOBILE CHECK CONTROLS
   ============================================================ */
.legal-stage-hero {
  display: block;
}

.legal-stage-hero .stage-hero-main {
  max-width: 850px;
  margin-bottom: 24px;
}

.legal-instruction-groups {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.18);
}

.instruction-group {
  min-width: 0;
}

.instruction-group h3 {
  margin: 0 0 14px;
  color: var(--copper-light);
  font: 600 16px/1.35 var(--font-body);
}

.instruction-list,
.verification-list {
  display: grid;
  gap: 0;
}

.instruction-item,
.verification-item {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.instruction-item:last-child,
.verification-item:last-child {
  border-bottom: 0;
}

.instruction-item > span,
.verification-item > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.11);
  color: var(--copper-light);
  font: 700 11px var(--font-mono);
}

.instruction-item p,
.verification-item p {
  margin: 2px 0 0;
  color: #f1f5f1;
  font-size: 13px;
  line-height: 1.45;
}

.verification-intro {
  margin: -4px 0 8px;
  color: #cbd8ce;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .legal-stage-hero {
    padding: 20px 16px;
  }

  .legal-stage-hero .stage-hero-main {
    margin-bottom: 18px;
  }

  .legal-stage-hero h2 {
    font-size: 27px;
  }

  .legal-instruction-groups {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 18px;
  }

  .instruction-group h3 {
    font-size: 15px;
  }

  .instruction-item,
  .verification-item {
    padding: 9px 0;
  }

  /* One centered icon, full-width content, compact status control. */
  .single-stage .event-card {
    position: relative;
  }

  .single-stage .event-row,
  .single-stage .event-row:has(.item-visual) {
    display: block;
    padding: 14px;
  }

  .single-stage .event-row:has(.item-visual) .item-visual {
    width: 86px;
    height: 86px;
    margin: 0 auto 8px;
    justify-self: auto;
  }

  .single-stage .event-body,
  .single-stage .event-row:has(.item-visual) .event-body {
    display: block;
    width: 100%;
  }

  .single-stage .status-pill,
  .single-stage .event-row:has(.item-visual) .status-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
  }

  .single-stage .status-pill .status-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .single-stage .status-pill .status-icon {
    font-size: 16px;
  }

  .single-stage .event-top-line {
    padding-right: 38px;
  }

  .purchase-name-input {
    min-height: 48px;
    padding: 8px 4px;
    font-size: 25px;
  }

  .purchase-name-input::placeholder {
    color: var(--stone);
    opacity: .72;
    font-size: 12px;
    letter-spacing: .07em;
  }
}


/* Compact legal request panel: one useful message, no duplicated inner checklist. */
.legal-stage-hero .stage-hero-main {
  max-width: 760px;
  margin-bottom: 14px;
}

.agent-request {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0;
  padding: 15px 18px;
  border: 1px solid rgba(255,255,255,.2);
  border-left: 4px solid var(--copper-light);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: #f4f7f4;
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .legal-stage-hero { padding: 18px 16px; }
  .legal-stage-hero .stage-hero-main { margin-bottom: 12px; }
  .legal-stage-hero h2 { font-size: 24px; }
  .legal-stage-hero .stage-instruction { font-size: 13px; line-height: 1.45; }
  .agent-request { padding: 13px 14px; font-size: 13.5px; }
}

/* ============================================================
SUPABASE ACCOUNT & AUTHENTICATION
============================================================ */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 0%, rgba(224, 168, 108, 0.17), transparent 28%),
    radial-gradient(circle at 96% 84%, rgba(193, 121, 63, 0.18), transparent 31%),
    linear-gradient(135deg, #082c23 0%, #0d3b2e 50%, #09271f 100%);
  color: var(--paper);
  isolation: isolate;
}

.auth-gate::before,
.auth-gate::after {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(224, 168, 108, 0.24);
  border-radius: 44% 56% 51% 49% / 43% 46% 54% 57%;
  content: "";
  pointer-events: none;
}

.auth-gate::before {
  top: -178px;
  right: -152px;
  box-shadow: 0 0 0 42px rgba(224, 168, 108, 0.05), 0 0 0 84px rgba(224, 168, 108, 0.035);
}

.auth-gate::after {
  bottom: -212px;
  left: -204px;
  border-color: rgba(224, 168, 108, 0.18);
  box-shadow: 0 0 0 38px rgba(224, 168, 108, 0.045), 0 0 0 76px rgba(224, 168, 108, 0.025);
}

body.auth-locked {
  overflow: hidden;
}

.auth-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  background: linear-gradient(145deg, rgba(23, 67, 52, 0.98), rgba(9, 43, 33, 0.98));
  border: 1px solid rgba(224, 168, 108, 0.44);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 22px 52px rgba(2, 19, 14, 0.34);
}

.auth-card::before {
  position: absolute;
  z-index: -1;
  top: -146px;
  right: -118px;
  width: 276px;
  height: 276px;
  border: 1px dashed rgba(224, 168, 108, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 31px rgba(224, 168, 108, 0.035), 0 0 0 62px rgba(224, 168, 108, 0.025);
  content: "";
  pointer-events: none;
}

.auth-card > * {
  position: relative;
}

.auth-brand {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.auth-back-link {
  min-height: 40px;
  margin: -8px 0 12px -8px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: rgba(247, 248, 244, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.auth-back-link:hover {
  color: var(--paper);
  text-decoration: underline;
}

.auth-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--copper-light);
}

.auth-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.06;
  font-weight: 600;
  color: var(--paper);
}

.auth-intro {
  margin: 14px 0 24px;
  color: rgba(238, 240, 233, 0.72);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(224, 168, 108, 0.28);
  border-radius: var(--radius-s);
  background: rgba(247, 248, 244, 0.96);
  color: var(--ink);
  font-size: 16px;
}

.auth-form input:focus {
  border-color: var(--copper-light);
  box-shadow: 0 0 0 3px rgba(224, 168, 108, 0.18);
  outline: 0;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.password-strength {
  display: grid;
  gap: 7px;
  margin-top: -2px;
}

.password-strength-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: rgba(238, 240, 233, 0.66);
  font-size: 11px;
}

.password-strength-head strong {
  color: var(--copper-light);
  font-weight: 600;
}

.password-strength-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(238, 240, 233, 0.22);
}

.password-strength-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--rust);
  transition: width 160ms ease, background-color 160ms ease;
}

.password-strength[data-score="1"] .password-strength-meter span { width: 25%; }
.password-strength[data-score="2"] .password-strength-meter span { width: 50%; }
.password-strength[data-score="3"] .password-strength-meter span {
  width: 75%;
  background: var(--copper);
}
.password-strength[data-score="4"] .password-strength-meter span {
  width: 100%;
  background: #8bc39c;
}

.password-strength p {
  margin: 0;
  color: rgba(238, 240, 233, 0.68);
  font-size: 10.5px;
  line-height: 1.45;
}

.auth-secondary-action,
.auth-mode-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

.auth-secondary-action {
  width: max-content;
  min-height: 40px;
  margin: -8px 0 -6px auto;
  color: var(--copper-light);
}

.auth-mode-toggle {
  margin-top: 0;
}

.auth-secondary-action:hover,
.auth-mode-toggle:hover {
  text-decoration: underline;
}

.auth-message {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.auth-message[data-tone="error"] { color: #ffb1a3; }
.auth-message[data-tone="ok"] { color: #a9d7b5; }
.auth-message[data-tone="busy"] { color: var(--copper-light); }

.user-account {
  margin: 8px 0 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-s);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 4px;
}

.user-account > span,
.user-account > small {
  color: #b9c6bc;
  font-size: 10.5px;
}

.user-account > strong {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-account > small[data-tone="ok"] { color: var(--copper-light); }
.user-account > small[data-tone="error"] { color: #ffb1a3; }

.user-account button {
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 12px;
}

.user-account button:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (min-width: 641px) {
  .auth-gate {
    align-items: center;
    padding: 28px;
  }

  .auth-card {
    padding: 34px;
    border-radius: var(--radius-l);
    box-shadow: 0 28px 80px rgba(2, 19, 14, 0.42);
  }
}

@media (max-height: 660px) {
  .auth-card {
    margin: 0;
  }
}


/* ============================================================
DOCUMENT FILE ACTIONS
Three equal, touch-friendly controls on mobile; compact on desktop.
============================================================ */
.uploaded-file {
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
}

.uploaded-file-info {
  min-width: 0;
}

.file-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.uploaded-file .file-actions button,
.uploaded-file .file-actions button:first-of-type {
  grid-column: auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--stone-line);
  border-radius: 8px;
  background: var(--white);
  color: var(--pine);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.file-actions button:hover {
  border-color: var(--pine);
  background: #f8fbf8;
}

.file-actions button:active {
  transform: translateY(1px);
}

.file-actions svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 761px) {
  .uploaded-file {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .file-actions {
    grid-column: auto;
    display: flex;
    width: auto;
  }

  .uploaded-file .file-actions button,
  .uploaded-file .file-actions button:first-of-type {
    min-height: 38px;
    padding: 7px 10px;
  }
}

.btn-sections {
  flex-shrink: 0;
  height: 30px;
  padding: 0 16px;
  border: 1px solid var(--stone-line);
  border-radius: 999px;
  background: var(--white);
  color: var(--pine);
  font: 600 12px var(--font-body);
  letter-spacing: .01em;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.btn-sections:hover { border-color: var(--pine); background: var(--pine); color: var(--white); transform: translateY(-1px); }
.btn-sections:active { transform: translateY(0); }

.journey-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(22, 33, 28, .55);
  opacity: 0;
  transition: opacity .2s ease;
}
.journey-overlay.open { opacity: 1; }
.journey-panel {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px max(24px, env(safe-area-inset-bottom));
  position: relative;
  transform: translateY(28px);
  transition: transform .25s ease;
  box-shadow: 0 -20px 50px rgba(22,33,28,.25);
}
.journey-overlay.open .journey-panel { transform: translateY(0); }
body.map-open { overflow: hidden; }

.journey-close {
  position: sticky;
  top: 0;
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--stone-line);
  background: var(--white);
  color: var(--stone);
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
}
.journey-close:hover { color: var(--rust); border-color: var(--rust); }

.map-panel-head { margin: 4px 0 22px; padding-right: 44px; clear: both; }
.map-panel-head h2 { margin: 0 0 6px; font: 600 24px var(--font-display); color: var(--ink); }
.map-panel-head p { margin: 0; font-size: 13px; color: var(--stone); }

.map-path { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.map-stop {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 26px;
}
.map-stop:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 58px;
  bottom: 2px;
  border-left: 3px dashed var(--stone-line);
}
.map-stop.complete:not(:last-child)::before { border-left-color: var(--pine-light); }

.map-node {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--stone-line);
  background: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform .15s ease;
}
.map-node:hover { transform: scale(1.06); }
.map-stop.current .map-node {
  border-color: var(--copper);
  background: var(--copper);
  box-shadow: 0 0 0 6px rgba(193,121,63,.18);
  animation: mapPulse 1.8s ease-in-out infinite;
}
.map-stop.complete .map-node {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--white);
}
@keyframes mapPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(193,121,63,.18); }
  50% { box-shadow: 0 0 0 10px rgba(193,121,63,.3); }
}
@media (prefers-reduced-motion: reduce) {
  .map-stop.current .map-node { animation: none; }
}

.map-stop-card {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 13px 15px;
  text-align: left;
  border: 1px solid var(--stone-line);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.map-stop-card:hover { transform: translateY(-1px); }
.map-stop.current .map-stop-card { border-color: var(--copper); box-shadow: 0 6px 18px rgba(193,121,63,.14); }
.map-stop.complete .map-stop-card { border-color: var(--pine-light); background: #f3f7f3; }

.map-stop-eyebrow { font: 700 10px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--stone); }
.map-stop-name { font: 600 18px/1.2 var(--font-display); color: var(--ink); }
.map-stop-title { font-size: 11.5px; color: var(--stone); }
.map-stop-blurb { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink); opacity: .82; }
.map-stop-progress { display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: var(--stone-line); overflow: hidden; }
.map-stop-progress i { display: block; height: 100%; background: var(--copper); border-radius: 99px; }
.map-stop.complete .map-stop-progress i { background: var(--pine); }
.map-stop-pct { margin-top: 3px; font-size: 11px; color: var(--stone); }

@media (min-width: 640px) {
  .journey-overlay { align-items: center; padding: 24px; }
  .journey-panel { border-radius: 24px; padding: 22px 26px 28px; }
}

/* ============================================================
DOCUMENT QUEST HIERARCHY REDESIGN
A calm, mobile-first sequence: current action first, completed work quiet.
============================================================ */
:root {
  --stone: #68776f;
  --stone-line: #d4dbd5;
  --paper: #f1f3ee;
  --paper-raised: #f8f9f6;
}

/* Keep the reading column comfortable even on wide screens. */
.single-stage .event-detail {
  max-width: 780px;
  background: var(--white);
  border-color: #dce2dc;
}

.document-quest {
  width: 100%;
  max-width: 740px;
  margin: 0 auto 8px;
  color: var(--ink);
}

.quest-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.quest-progress-head span {
  color: var(--copper);
  font: 700 11px var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.quest-progress-head strong {
  font-size: 15px;
  color: var(--ink);
}

.quest-path {
  margin: 0 0 18px;
  gap: 6px;
}

.quest-path > i {
  height: 2px;
  margin-top: 15px;
  background: #dfe4df;
}

.quest-path > i.complete,
.quest-path > i.active {
  background: var(--pine-light);
}

.quest-path > i.active {
  background: linear-gradient(90deg, var(--pine-light) 0 52%, #dfe4df 52% 100%);
}

.quest-node {
  min-width: 52px;
  gap: 4px;
  color: #87948d;
}

.quest-node span {
  width: 32px;
  height: 32px;
  border-width: 1.5px;
  font-size: 11px;
}

.quest-node b {
  font-size: 9.5px;
  letter-spacing: .055em;
}

.quest-node.complete {
  color: #557061;
}

.quest-node.complete span {
  border-color: var(--pine);
  background: var(--pine);
}

.quest-node.current {
  color: var(--copper);
}

.quest-node.current span {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(193, 121, 63, .11);
}

/* Request is prominent before upload and collapses after completion. */
.quest-card.request-card {
  padding: 16px;
  border: 1px solid var(--stone-line);
  border-left: 4px solid var(--copper);
  background: var(--white);
}

.quest-card p {
  max-width: 680px;
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.55;
}

.quest-card small {
  font-size: 13.5px;
  color: var(--stone);
}

.completed-step {
  overflow: hidden;
  border: 1px solid var(--stone-line);
  border-radius: 11px;
  background: #f7faf7;
}

.completed-step summary {
  min-height: 60px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.completed-step summary::-webkit-details-marker {
  display: none;
}

.completed-step-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pine);
  color: var(--white);
  font-weight: 700;
}

.completed-step summary strong,
.completed-step summary small {
  display: block;
}

.completed-step summary strong {
  font-size: 14px;
  color: var(--ink);
}

.completed-step summary small {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--stone);
}

.completed-step-action {
  color: var(--pine);
  font-size: 12.5px;
  font-weight: 600;
}

.completed-step[open] .completed-step-action {
  font-size: 0;
}

.completed-step[open] .completed-step-action::after {
  content: "Hide request";
  font-size: 12.5px;
}

.completed-step > p {
  margin: 0;
  padding: 12px 14px 14px 56px;
  border-top: 1px solid #e2e7e2;
  font-size: 14px;
  line-height: 1.55;
  color: #46544d;
}

.upload-zone {
  margin-top: 10px;
}

.upload-label {
  min-height: 120px;
  border-width: 1.5px;
  border-color: #bcc7bf;
  background: var(--white);
}

.upload-label strong {
  font-size: 17px;
}

.upload-label small {
  max-width: 380px;
  font-size: 13px;
  line-height: 1.45;
}

.uploaded-file {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border-color: #bfd0c3;
  background: #f4f8f4;
}

.file-check {
  width: 36px;
  height: 36px;
}

.uploaded-file-info strong {
  font-size: 15px;
  line-height: 1.35;
}

.uploaded-file-info small {
  font-size: 12.5px;
  color: var(--stone);
}

.file-actions {
  grid-column: 1 / -1;
  margin-top: 2px;
  gap: 7px;
}

.uploaded-file .file-actions button,
.uploaded-file .file-actions button:first-of-type {
  min-height: 46px;
  padding: 9px 6px;
  border-color: #c9d3cb;
  background: var(--white);
  font-size: 13px;
}

/* Current verification task is the only dominant panel. */
.verification-unlocked {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--stone-line);
  border-top: 4px solid var(--copper);
  border-radius: 13px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(22, 33, 28, .06);
}

.verification-unlocked.verification-complete {
  border-top-color: var(--pine);
  background: #f7faf7;
}

.current-step-label {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f8eadc;
  color: #8c4f20;
  font: 700 10px var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.verification-complete .current-step-label {
  background: #e2eee5;
  color: var(--pine);
}

.verification-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 11px;
}

.step-count {
  display: block;
  margin-bottom: 3px;
  color: var(--stone);
  font: 600 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.verification-unlocked h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.15;
}

.check-progress {
  flex: 0 0 auto;
  margin-top: 17px;
  color: var(--stone);
  font-size: 12.5px;
  white-space: nowrap;
}

.verification-intro {
  max-width: 650px;
  margin: 12px 0 18px !important;
  font-size: 15px;
  line-height: 1.55;
  color: #34423b;
}

.verification-checklist {
  margin: 0;
}

.verification-checklist h5 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.verification-check,
.official-confirm {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 8px;
  border-top: 1px solid #e3e7e3;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
}

.verification-check input,
.official-confirm input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid #9ca9a1;
  border-radius: 6px;
  background: var(--white);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.verification-check:hover .custom-check,
.official-confirm:hover .custom-check {
  border-color: var(--pine);
}

.verification-check.is-checked,
.official-confirm.is-checked {
  color: var(--pine);
}

.verification-check.is-checked .custom-check,
.official-confirm.is-checked .custom-check {
  border-color: var(--pine);
  background: var(--pine);
}

.verification-check.is-checked .custom-check::after,
.official-confirm.is-checked .custom-check::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: translateY(-1px) rotate(-45deg);
}

.verification-check input:focus-visible + .custom-check,
.official-confirm input:focus-visible + .custom-check {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.verification-check input:disabled ~ span,
.official-confirm input:disabled ~ span {
  cursor: default;
}

.official-check-card {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #d7ded8;
  border-radius: 11px;
  background: var(--paper-raised);
}

.official-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--copper);
  font: 700 10px var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.official-check-card > strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
}

.official-check-card > p {
  max-width: 620px;
  margin: 5px 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #4e5c55;
}

.official-link {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--copper);
  border-radius: 9px;
  background: #fff8ef;
  color: #75401b;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.official-link:hover {
  background: #f9e9d5;
}

.workflow-resource-link {
  margin-top: 8px;
}

.workflow-map {
  margin-top: 10px;
  border: 1px solid #d7ded8;
  border-radius: 9px;
  background: #fff;
}

.workflow-map summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 11px 13px;
  color: var(--pine);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.workflow-map > p {
  margin: 0;
  padding: 0 13px 12px;
  color: #5b6861;
  font-size: 13px;
  line-height: 1.5;
}

.workflow-map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  background: #edf1ed;
}

.workflow-map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.official-confirm {
  margin-top: 10px;
  padding-left: 2px;
  padding-right: 2px;
  border-top: 0;
  font-weight: 600;
}

.verify-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--pine);
  font-size: 15px;
}

.verify-btn:not(:disabled):hover {
  background: #233c30;
}

.verify-btn:disabled {
  background: #d6dcd7;
  color: #7b8981;
  opacity: 1;
}

.verification-complete .verify-btn:disabled {
  background: var(--pine);
  color: var(--white);
}

.completion-hint {
  margin: 8px 0 0 !important;
  text-align: center;
  color: var(--stone);
  font-size: 12.5px;
  line-height: 1.4;
}

.locked-next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px solid #dde2dd;
  background: #f1f3f0;
  color: #6d7b73;
  font-size: 13.5px;
  line-height: 1.45;
}

/* Notes stay out of the visual hierarchy until the user needs them. */
.notes-disclosure {
  max-width: 740px;
  margin: 14px auto 0;
  border-top: 1px solid var(--stone-line);
  padding-top: 8px;
}

.notes-disclosure summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--pine);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.notes-disclosure summary::-webkit-details-marker {
  display: none;
}

.notes-disclosure[open] summary {
  color: var(--stone);
}

.notes-disclosure .item-notes {
  margin-top: 4px;
  min-height: 90px;
  font-size: 16px;
  line-height: 1.5;
}

/* Stronger base readability for secondary content. */
.event-why,
.section-intro,
.stage-instruction,
.stage-footer-note,
.up-next-sub,
.map-stop-blurb {
  color: #617169;
}

@media (min-width: 761px) {
  .uploaded-file {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  .file-actions {
    grid-column: auto;
    margin-top: 0;
  }

  .uploaded-file .file-actions button,
  .uploaded-file .file-actions button:first-of-type {
    min-height: 40px;
    padding: 8px 11px;
  }

  .verification-unlocked {
    padding: 22px;
  }

  .official-link {
    width: auto;
    min-width: 270px;
    display: inline-flex;
  }

  .verify-btn {
    width: auto;
    min-width: 230px;
  }

  .completion-hint {
    max-width: 420px;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .single-stage .event-detail {
    margin: 8px 8px 10px;
    padding: 10px;
    border-radius: 11px;
  }

  .document-quest {
    max-width: none;
  }

  .quest-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .quest-progress-head strong {
    font-size: 16px;
  }

  .quest-path {
    margin-bottom: 14px;
  }

  .quest-node {
    min-width: 44px;
  }

  .quest-node span {
    width: 30px;
    height: 30px;
  }

  .quest-path > i {
    margin-top: 14px;
  }

  .quest-node b {
    font-size: 8.5px;
  }

  .completed-step summary {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .completed-step-action {
    grid-column: 2;
    margin-top: -4px;
  }

  .completed-step > p {
    padding: 12px 13px 14px;
  }

  .uploaded-file {
    padding: 10px;
  }

  .file-actions {
    gap: 6px;
  }

  .uploaded-file .file-actions button,
  .uploaded-file .file-actions button:first-of-type {
    min-height: 48px;
    font-size: 12.5px;
  }

  .file-actions svg {
    width: 18px;
    height: 18px;
  }

  .verification-unlocked {
    padding: 15px 13px;
  }

  .verification-heading-row {
    display: block;
  }

  .check-progress {
    display: block;
    margin-top: 7px;
  }

  .verification-intro {
    font-size: 15px;
  }

  .verification-check,
  .official-confirm {
    min-height: 52px;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 15px;
  }

  .official-check-card {
    padding: 13px;
  }

  .official-link,
  .verify-btn {
    min-height: 52px;
    font-size: 15px;
  }
}

/* ============================================================
UX REFINEMENT 2
Action-driven status, quieter completed rows and clearer hierarchy.
============================================================ */

/* Give the stage instruction room to breathe before the checklist begins. */
#stageWorkspace > .stage-hero {
  margin-bottom: clamp(38px, 4vw, 54px);
}

.single-stage .section-header {
  padding-top: 0;
}

.single-stage .section-progress-wrap {
  flex: 0 0 auto;
}

.single-stage .section-count {
  min-width: 42px;
  text-align: right;
  font-weight: 600;
  color: #74827a;
}

/* Step metadata supports the headline rather than competing with it. */
.single-stage .event-top-line {
  justify-content: flex-end;
  gap: 7px;
  margin-bottom: 8px;
  text-align: right;
}

.single-stage .event-step {
  color: #8a968f;
  font-weight: 600;
}

.single-stage .stake-flag {
  border: 1px solid #efd7cc;
  background: #fff7f3;
  color: #a64d37;
  font-weight: 600;
}

/* Guided document tasks no longer show a separate manual status control. */
.single-stage .event-card.guided-workflow,
.single-stage .event-card.guided-workflow.high-stakes,
.single-stage .event-card.guided-workflow.status-in_progress,
.single-stage .event-card.guided-workflow.status-done,
.single-stage .event-card.guided-workflow.status-na {
  border-left-width: 6px;
  border-left-color: var(--stone-line);
}

.single-stage .event-card.guided-workflow.status-in_progress {
  border-left-color: var(--copper);
}

.single-stage .event-card.guided-workflow.status-done {
  border-left-color: var(--pine);
  background: #e7f2e9;
}

.single-stage .event-card.guided-workflow .event-row,
.single-stage .event-card.guided-workflow .event-row:has(.item-visual) {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px;
}

.single-stage .event-card.guided-workflow .item-visual,
.single-stage .event-card.guided-workflow .event-row:has(.item-visual) .item-visual {
  grid-column: 1;
  grid-row: 1;
  width: 112px;
  height: 112px;
  margin: 0;
  justify-self: start;
}

.single-stage .event-card.guided-workflow .event-body,
.single-stage .event-card.guided-workflow .event-row:has(.item-visual) .event-body {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}

.single-stage .event-card.guided-workflow .event-detail {
  margin-top: 0;
}

/* The three-step path remains the main progress signal. Completed utility rows fade back. */
.completed-step,
.uploaded-file {
  border-color: #d6e0d8;
  background: #f8faf8;
}

.completed-step-icon,
.file-check {
  background: #dceade;
  color: #355844;
  box-shadow: inset 0 0 0 1px #c8ddcd;
}

.completed-step-action,
.uploaded-file .file-actions button {
  color: #4b6858;
}

/* The current task is neutral; emphasis belongs to its checklist and actions. */
.verification-unlocked,
.verification-unlocked.verification-complete {
  border: 1px solid var(--stone-line);
  border-top: 1px solid var(--stone-line);
  background: var(--white);
  box-shadow: 0 6px 18px rgba(22, 33, 28, .045);
}

.current-step-label,
.verification-complete .current-step-label {
  background: #edf2ee;
  color: #52685b;
}

.official-kicker {
  color: #66776e;
}

.official-link {
  border-color: var(--pine);
  background: var(--white);
  color: var(--pine);
}

.official-link:hover {
  background: #edf4ef;
}

/* Desktop keeps the section title and weighted progress on one calm line. */
@media (min-width: 761px) {
  .single-stage .section-header {
    align-items: flex-end;
    gap: 28px;
    padding-bottom: 18px;
  }

  .single-stage .section-heading {
    flex: 1 1 auto;
    min-width: 0;
  }

  .single-stage .section-progress-wrap {
    width: 250px;
    margin-left: auto;
    padding-bottom: 3px;
  }
}

/* Mobile keeps the icon useful without letting it dominate the task. */
@media (max-width: 760px) {
  #stageWorkspace > .stage-hero {
    margin-bottom: 28px;
  }

  .single-stage .section-header {
    padding-bottom: 18px;
  }

  .single-stage .section-progress-wrap {
    margin-top: 15px;
  }

  .single-stage .event-card.guided-workflow .event-row,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .single-stage .event-card.guided-workflow .item-visual,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) .item-visual {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
    margin: 0;
    justify-self: start;
  }

  .single-stage .event-card.guided-workflow .event-body,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) .event-body {
    grid-column: 2;
    grid-row: 1;
  }

  .single-stage .event-card.guided-workflow .event-top-line {
    min-height: 24px;
    flex-wrap: wrap;
  }

  .single-stage .event-card.guided-workflow .item-title {
    font-size: 17px;
    line-height: 1.25;
  }

  .single-stage .event-card.guided-workflow .event-why {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .single-stage .event-card.guided-workflow .event-detail {
    margin: 0 8px 8px;
  }
}

@media (max-width: 420px) {
  .single-stage .event-card.guided-workflow .event-row,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .single-stage .event-card.guided-workflow .item-visual,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) .item-visual {
    width: 62px;
    height: 62px;
  }

  .single-stage .event-card.guided-workflow .event-step,
  .single-stage .event-card.guided-workflow .stake-flag {
    font-size: 9.5px;
  }
}

/* ============================================================
UX REFINEMENT 3
Tighter desktop summary, full-width workflow and softer surfaces.
============================================================ */

/* The item itself is never pure white. Opening it changes the main surface
   to the same calm grey used behind the illustration. */
.single-stage .event-card.guided-workflow,
.single-stage .event-card.guided-workflow.high-stakes,
.single-stage .event-card.guided-workflow.status-in_progress,
.single-stage .event-card.guided-workflow.status-na {
  background: #fbfcf9;
}

.single-stage .event-card.guided-workflow.status-done {
  border-left-color: var(--pine);
  background: #e7f2e9;
}

.single-stage .event-card.guided-workflow.is-expanded,
.single-stage .event-card.guided-workflow.is-expanded.high-stakes,
.single-stage .event-card.guided-workflow.is-expanded.status-in_progress,
.single-stage .event-card.guided-workflow.is-expanded.status-na {
  background: #f5f6f2;
}

.single-stage .event-card.guided-workflow.is-expanded.status-done {
  border-left-color: var(--pine);
  background: #e7f2e9;
}

.single-stage .event-card.guided-workflow .item-visual,
.single-stage .event-card.guided-workflow .event-row:has(.item-visual) .item-visual {
  background: #f5f6f2;
}

/* The expanded workflow uses the available width. It no longer sits inside
   a second large white card with an empty right-hand side. */
.single-stage .event-card.guided-workflow .event-detail {
  width: auto;
  max-width: none;
  margin: 0 22px 22px;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #d8ded8;
  border-radius: 0;
  background: transparent;
}

.single-stage .event-card.guided-workflow .document-quest {
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Keep the request step on the same calm grey surface as its parent card.
   This applies to every guided due-diligence item, including Reservation
   agreement, instead of introducing a white card inside the grey panel. */
.single-stage .event-card.guided-workflow .quest-card.request-card {
  background: transparent;
}

/* The requested and uploaded document rows belong to the surrounding grey
   workflow surface; neither should introduce another white card. */
.single-stage .event-card.guided-workflow .completed-step,
.single-stage .event-card.guided-workflow .uploaded-file {
  background: #ecefeb;
  border-color: #d2d8d2;
}

.single-stage .event-card.guided-workflow .uploaded-file .file-actions button,
.single-stage .event-card.guided-workflow .uploaded-file .file-actions button:first-of-type {
  background: transparent;
}

/* Verification is a workflow section, not a nested card. */
.single-stage .event-card.guided-workflow .verification-unlocked,
.single-stage .event-card.guided-workflow .verification-unlocked.verification-complete {
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #d8ded8;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.single-stage .event-card.guided-workflow .verification-intro,
.single-stage .event-card.guided-workflow .official-check-card > p,
.single-stage .event-card.guided-workflow .notes-disclosure {
  max-width: none;
}

.single-stage .event-card.guided-workflow .notes-disclosure {
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid rgba(96, 112, 102, .18);
  border-radius: 0;
  background: transparent;
}

.notes-disclosure .rich-notes-editor {
  min-height: 150px;
  max-height: 300px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(96, 112, 102, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  color: var(--ink);
  white-space: normal;
}

.notes-disclosure .rich-notes-editor:focus {
  border-color: rgba(46, 91, 66, .38);
  box-shadow: 0 0 0 2px rgba(46, 91, 66, .06);
  outline: none;
}

.rich-notes-editor:empty::before {
  color: var(--stone);
  content: attr(data-placeholder);
  pointer-events: none;
}

.rich-notes-editor p,
.rich-notes-editor ul,
.rich-notes-editor ol {
  margin: 0 0 8px;
}

/* Keep verification integrated with the parent workflow surface. */
.single-stage .event-card.guided-workflow .verification-unlocked,
.single-stage .event-card.guided-workflow .verification-unlocked.verification-complete {
  background: transparent;
}

.single-stage .event-card.guided-workflow .official-check-card {
  background: #faf6ea;
  border-color: #e5ddc9;
}

.single-stage .event-card.guided-workflow .verification-check {
  background: rgba(255, 255, 255, .38);
}

/* Replace the long label with one compact risk signal. */
.event-why {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.risk-alert {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
  border: 1.5px solid #c96245;
  border-radius: 50%;
  color: #b34e35;
  font: 700 12px/1 var(--font-body);
}

/* Desktop: headline and metadata share the top row. The title starts at the
   same height as the illustration, and all summary content fits beside it. */
@media (min-width: 761px) {
  .single-stage .event-card.guided-workflow .event-row,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    padding: 22px;
  }

  .single-stage .event-card.guided-workflow .event-body,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) .event-body {
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr auto;
    column-gap: 18px;
    align-content: stretch;
  }

  .single-stage .event-card.guided-workflow .item-title-row {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin: 0;
  }

  .single-stage .event-card.guided-workflow .event-top-line {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    margin: 0;
    min-height: 0;
    white-space: nowrap;
  }

  .single-stage .event-card.guided-workflow .item-title {
    font-size: 19px;
    line-height: 1.25;
  }

  .single-stage .event-card.guided-workflow .event-why {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.45;
  }

  .single-stage .event-card.guided-workflow .expand-btn {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: start;
    align-self: end;
    min-height: 30px;
    margin: 4px 0 -3px;
    padding: 3px 0;
  }
}

@media (max-width: 760px) {
  .single-stage .event-card.guided-workflow .event-detail {
    margin: 0 14px 16px;
    padding-top: 15px;
  }

  .single-stage .event-card.guided-workflow .event-why {
    gap: 7px;
  }

  .risk-alert {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .single-stage .event-card.guided-workflow .event-detail {
    margin-left: 12px;
    margin-right: 12px;
  }
}


/* ============================================================
MOBILE CARD REFINEMENT
Concise titles, no step metadata, and details behind one information control.
============================================================ */

.single-stage .event-card.guided-workflow .event-body,
.single-stage .event-card.guided-workflow .event-row:has(.item-visual) .event-body {
  min-height: 0;
  display: block;
}

.single-stage .event-card.guided-workflow .item-title-row,
.item-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.single-stage .event-card.guided-workflow .item-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.info-toggle {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  margin: -2px 0 0;
  padding: 0;
  border: 1.5px solid #8d9a92;
  border-radius: 50%;
  background: #f7f8f4;
  color: #53665b;
  font: 700 15px/1 var(--font-display);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.info-toggle:hover {
  border-color: var(--pine);
  background: #eef3ef;
  color: var(--pine);
}

.info-toggle[aria-expanded="true"] {
  border-color: var(--copper);
  background: #fff4e8;
  color: #8f5428;
}

.info-toggle:active {
  transform: scale(.96);
}

/* Risk context belongs inside the opened panel, not in the collapsed card. */
.single-stage .event-card.guided-workflow .event-detail > .event-why,
.event-detail > .event-why {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #ead8cf;
  border-radius: 10px;
  background: #fbf4ef;
  color: #563e35;
  font-size: 13.5px;
  line-height: 1.5;
}

.event-detail > .event-why.muted {
  border-color: var(--stone-line);
  background: #f7f8f4;
  color: var(--pine-light);
}

@media (max-width: 760px) {
  .single-stage .event-card.guided-workflow .event-row,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) {
    align-items: start;
  }

  .single-stage .event-card.guided-workflow .event-body,
  .single-stage .event-card.guided-workflow .event-row:has(.item-visual) .event-body {
    padding-top: 1px;
  }

  .single-stage .event-card.guided-workflow .item-title {
    font-size: 17px;
    line-height: 1.22;
  }

  .info-toggle {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    margin-top: -2px;
    font-size: 14px;
  }

  .single-stage .event-card.guided-workflow .event-detail > .event-why,
  .event-detail > .event-why {
    margin-bottom: 14px;
    padding: 11px 12px;
  }
}

@media (max-width: 420px) {
  .single-stage .event-card.guided-workflow .item-title-row {
    gap: 8px;
  }

  .single-stage .event-card.guided-workflow .item-title {
    font-size: 16.5px;
  }
}

/* ============================================================
CARD-LEVEL DOCUMENT PROGRESS
The whole summary row opens the item; document state stays visible while
collapsed, with Requested as the one explicit user confirmation.
============================================================ */
.single-stage .event-card .event-row[data-expand-toggle] {
  cursor: pointer;
}

.single-stage .event-card .event-row[data-expand-toggle]:focus-visible {
  outline: 2px solid rgba(46, 91, 66, .35);
  outline-offset: -2px;
}

.item-workflow-progress {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-top: 20px;
}

.item-workflow-progress > i {
  height: 2px;
  margin-top: 15px;
  border-radius: 99px;
  background: #d7ddd7;
}

.item-workflow-progress > i.complete {
  background: var(--pine);
}

.workflow-stage {
  min-width: 62px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #7c8981;
}

.workflow-stage-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1.5px solid #c8d0c9;
  border-radius: 50%;
  background: rgba(255, 255, 255, .42);
  font: 700 11px var(--font-mono);
}

.workflow-stage b {
  font: 700 9.5px var(--font-mono);
  letter-spacing: .055em;
  text-transform: uppercase;
}

.workflow-stage.complete {
  color: var(--pine);
}

.workflow-stage.complete .workflow-stage-marker {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--white);
}

.workflow-stage.current {
  color: var(--copper);
}

.workflow-stage.current .workflow-stage-marker {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(193, 121, 63, .1);
}

.workflow-stage-requested {
  position: relative;
  cursor: pointer;
}

.workflow-stage-requested input {
  position: absolute;
  width: 32px;
  height: 32px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.workflow-stage-requested input:focus-visible + .workflow-stage-marker {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

.verification-checklist-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.verification-checklist-heading h5 {
  margin: 0;
}

.verification-checklist-heading .check-progress {
  margin: 0;
}

@media (max-width: 760px) {
  .item-workflow-progress {
    width: 100%;
    gap: 5px;
    margin-top: 16px;
  }

  .workflow-stage {
    min-width: 52px;
  }

  .workflow-stage-marker {
    width: 30px;
    height: 30px;
  }

  .item-workflow-progress > i {
    margin-top: 14px;
  }

  .workflow-stage b {
    font-size: 8.5px;
  }
}
