  :root {
    --paper: #fbf9f4;
    --paper-border: #e6e0d2;
    --rule: #ece6d6;
    --ink: #1f1b14;
    --ink-soft: #2b2620;
    --muted: #8a7f68;
    --muted-soft: #766c58;
    --mono-muted: #7a7260;
    --dropped: #a89f8c;
    --status-full: #4c7a53;
    --status-basic: #b5872a;
    --status-new: #4a6fa5;
    --status-dropped: #a89f8c;
    --status-tbd: #cfc7b0;
    --status-pending: #cfc7b0;                    /* same tone the tbd state used */
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 40px 24px 80px;
    background: #f3efe4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink-soft);
  }

  main {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
  }

  .demo-label {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
  }

  .ledger {
    background: var(--paper);
    border: 1px solid var(--paper-border);
    border-radius: 10px;
    padding: 28px 32px;
  }

  /* breadcrumb */
  .crumb {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: 18px;
  }
  .crumb a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted #c9bfa4; }
  .crumb a:hover { color: var(--ink-soft); }

  /* headings */
  h1, h2, h3 { font-family: Georgia, "Iowan Old Style", serif; margin: 0 0 4px; color: var(--ink); }
  .masthead { font-size: 40px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 24px; }
  h2 { font-size: 20px; font-weight: 600; }
  .dek { font-size: 13px; color: var(--muted-soft); margin: 0 0 20px; }

  /* card grid — home + segment index */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .card {
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color .15s;
  }
  .card:hover { border-color: #c9bfa4; }
  .card h3 { font-size: 16px; margin: 0 0 6px; }
  .card .count { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
  .bar { height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; display: flex; }
  .bar span { height: 100%; }
  .bar .tbd { background: var(--status-tbd); }
  .bar .full { background: var(--status-full); }
  .bar .basic { background: var(--status-basic); }
  .bar .new { background: var(--status-new); }
  .bar .dropped { background: var(--status-dropped); }
  .bar .pending { background: var(--status-pending); }

  .legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 16px; flex-wrap: wrap; }
  .legend span { display: inline-flex; align-items: center; gap: 4px; }

  /* home-page column explainer (Status/Workflow/E2E/Enhanced) */
  .col-key-heading {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 24px 0 10px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
  }
  .col-key { display: flex; flex-direction: column; gap: 16px; margin: 0; }
  .col-key dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink);
    margin-bottom: 4px;
  }
  .col-key dd { margin: 0; font-size: 12.5px; color: var(--muted-soft); line-height: 1.5; }
  .col-key-list { list-style: none; margin: 6px 0 0; padding: 0; max-width: 640px; columns: 2; column-gap: 24px; }
  .col-key-list li { margin-bottom: 3px; break-inside: avoid; }
  .col-key-sub { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }

  /* status dot (table + legend) */
  .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; position: relative; top: -1px; }
  .dot.full { background: var(--status-full); }
  .dot.basic { background: var(--status-basic); }
  .dot.new { background: var(--status-new); }
  .dot.dropped { background: var(--status-dropped); }
  .dot.tbd { background: transparent; border: 1px solid var(--status-tbd); }
  .dot.pending { background: transparent; border: 1px solid var(--status-pending); }
  td:has(.dot) { white-space: nowrap; } /* status cell: dot + label stay on one line */

  /* module table — scrolls horizontally inside .table-scroll instead of overflowing the ledger */
  .table-scroll { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  th {
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: 0 14px 10px 0;
    border-bottom: 1px solid #d8d0bc;
  }
  td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
  tr:last-child td { border-bottom: none; }
  td:last-child { white-space: nowrap; } /* Roles is always the last column (both table shapes) — long text scrolls via .table-scroll rather than wrapping */
  .page-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
  tr.dropped .page-name { text-decoration: line-through; color: var(--dropped); }
  .ref { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--mono-muted); white-space: nowrap; }

  /* ref/route tooltips — short visible value, full description on hover (tooltip.js) */
  .tip { border-bottom: 1px dotted #c9bfa4; cursor: help; }
  .tip-bubble {
    position: fixed;
    z-index: 10;
    max-width: 460px;
    background: var(--ink);
    color: #f6f2e8;
    padding: 8px 11px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    line-height: 1.55;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(31, 27, 20, .25);
  }
  .status-text { font-size: 12.5px; white-space: nowrap; color: var(--muted-soft); }
  .tbd-text { font-size: 12.5px; color: var(--muted); }
  .note {
    margin-top: 18px;
    background: #f4efe0;
    border: 1px solid var(--paper-border);
    border-radius: 6px;
    overflow: hidden;
  }
  .note-title {
    font-family: Georgia, "Iowan Old Style", serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    background: #ecdfc0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--paper-border);
  }
  .note-body {
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.65;
    color: var(--muted-soft);
  }

  /* Phase C: per-module Features tables — user stories and descriptions wrap
     instead of inheriting the pages table's nowrap cells */
  table.features .page-name { white-space: normal; }
  table.features td:last-child { white-space: normal; }
