/* ============================================================
   v1.18 — Le tableau de bord qui se lit
   Three proposals, one token set copied from web/src/styles.css.
   A: guided workflow · B: tightened desk · C: dossier ledger
   ============================================================ */

:root {
  color-scheme: light;
  --paper: #f2f4f5;
  --paper-2: #ffffff;
  --ink: #1c2124;
  --ink-hover: #000000;
  --graphite: #5b666c;
  --graphite-2: #5f6a70;
  --hairline: #d7dde0;
  --hairline-2: #e6eaec;
  --field-line: #808b91;
  --marker: #e4ef4a;
  --marker-soft: #f2f6c4;
  --marker-ink: #1c2124;
  --correction: #b83f35;
  --correction-bg: #f7e9e7;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --r: 10px;
  --measure: 62ch;
  --mark-tile: #1c2124;
  --menu-shadow: 0 12px 30px rgba(28, 33, 36, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #14171a;
    --paper-2: #1b1f23;
    --ink: #eceff1;
    --ink-hover: #ffffff;
    --graphite: #98a2a8;
    --graphite-2: #7d878d;
    --hairline: #2a3036;
    --hairline-2: #23282d;
    --field-line: #626d73;
    --marker: #c8d63f;
    --marker-soft: #232c17;
    --marker-ink: #14171a;
    --correction: #f2695c;
    --correction-bg: #2c1a18;
    --menu-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--marker); color: var(--marker-ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; }

p { margin: 0; }

/* ---- shared marks and controls -------------------------------------- */

.mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mark-tile);
}
.mark::before {
  content: '';
  position: absolute; left: 6px; right: 6px; bottom: 7px; height: 4px;
  border-radius: 1px; background: var(--marker);
}
.mark::after {
  content: '';
  position: absolute; left: 6px; top: 7px; width: 9px; height: 4px;
  border-radius: 1px; background: #f2f4f5; opacity: 0.75;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: scale(0.985); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.tlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.tlink:hover { text-decoration-color: var(--ink); }
.tlink svg { width: 16px; height: 16px; flex: 0 0 auto; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip i {
  width: 8px; height: 8px; flex: 0 0 8px;
  border-radius: 50%; background: var(--graphite-2);
}
.chip.live { color: var(--ink); }
.chip.live i { background: var(--ink); }
.chip.working { color: var(--ink); background: var(--marker-soft); border-color: var(--marker); }
.chip.working i { background: var(--marker); border: 1px solid var(--ink); animation: pulse 1.4s var(--ease) infinite; }

.field { display: grid; gap: 8px; min-width: 0; }
.field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--r);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}
.input::placeholder { color: var(--graphite-2); }
.input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }

.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--paper-2);
}
.seg button {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink), inset 0 -4px 0 var(--marker);
}

.hint { color: var(--graphite); font-size: 14px; line-height: 1.5; }
.hint-s { color: var(--graphite-2); font-size: 12px; line-height: 1.5; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}
.track > span {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--hairline);
}
.track > span::after {
  content: '';
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  background: var(--ink);
}
.track > span.current::after { background: var(--marker); box-shadow: inset 0 -2px 0 var(--ink); }

.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 14px;
  color: var(--graphite-2);
  font-size: 12px;
}
.legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--graphite);
  text-underline-offset: 3px;
}
.legal a:hover { color: var(--ink); }
.legal .draft {
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--graphite);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 20px;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

@keyframes pulse { 50% { opacity: 0.35; } }

/* ============================================================
   A — the guided workflow
   One question per screen, a step rail, one fixed primary action.
   ============================================================ */

.a-head {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}
.a-quit { font-size: 14px; font-weight: 600; color: var(--graphite); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.a-quit:hover { color: var(--ink); }

.a-screen { display: none; scroll-margin-top: 64px; }
.a-screen:first-of-type { display: block; }
body:has(.a-screen:target) .a-screen:first-of-type:not(:target) { display: none; }
.a-screen:target { display: block; }

.a-main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 20px 148px;
}

.a-progress { margin-bottom: 40px; }
.a-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.a-bars span {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--hairline);
}
.a-bars span[data-state='done'] { background: var(--ink); }
.a-bars span[data-state='current'] { background: var(--marker); box-shadow: inset 0 -2px 0 var(--ink); }
.a-stepmeta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.a-stepmeta b { color: var(--ink); font-weight: 500; }

.a-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 1.5rem + 2.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.a-lede {
  max-width: 46ch;
  margin: 0 0 28px;
  color: var(--graphite);
  font-size: 17px;
  line-height: 1.55;
}

.a-offer { display: grid; gap: 18px; }
.a-offer .seg { margin-bottom: 2px; }
.a-offer .seg button { font-size: 14px; }

.a-read {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: var(--graphite);
  font-size: 14px;
}
.a-read svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 3px; color: var(--ink); }

.a-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
  padding: 20px;
}
.a-card + .a-card { margin-top: 14px; }
.a-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.a-card-head h2 { font-size: 16px; letter-spacing: -0.01em; }
.a-card-head span { color: var(--graphite-2); font-size: 12px; }
.a-card .field + .field { margin-top: 16px; }

.a-meta {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline-2);
}
.a-meta li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 14px;
}
.a-meta li span:first-child { color: var(--graphite); white-space: nowrap; }
.a-meta li span:last-child { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.a-meta .mono { font-size: 12px; }
@media (max-width: 380px) {
  .a-meta li.wide { flex-direction: column; align-items: flex-start; gap: 2px; }
  .a-meta li.wide span:last-child { text-align: left; }
}

.a-percent {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
}
.a-percent strong {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.a-percent strong small { font-size: 30px; letter-spacing: -0.02em; margin-left: 2px; }
.a-percent > span { color: var(--graphite); font-size: 14px; padding-bottom: 8px; text-align: right; }

.a-overall { margin-bottom: 30px; }
.a-overall .track { height: 10px; }

.a-nowline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -8px 0 8px;
  color: var(--ink);
  font-size: 15px;
}
.a-now-dot {
  position: relative;
  width: 9px; height: 9px;
  flex: 0 0 9px;
  margin-top: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--marker);
  animation: pulse 1.4s var(--ease) infinite;
}
.a-safety {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--graphite);
  font-size: 14px;
  line-height: 1.45;
}
.a-safety svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }

.a-steps { display: grid; gap: 0; margin: 0 0 26px; padding: 0; list-style: none; }
.a-step { padding: 14px 0; border-bottom: 1px solid var(--hairline-2); }
.a-step:first-child { border-top: 1px solid var(--hairline-2); }
.a-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.a-step-name { color: var(--ink); font-size: 15px; font-weight: 600; }
.a-step[data-state='pending'] .a-step-name { color: var(--graphite); font-weight: 500; }
.a-step-detail { display: block; margin-top: 8px; color: var(--graphite); font-size: 13px; }
.a-step-pct {
  color: var(--graphite-2);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.a-step[data-state='current'] .a-step-pct { color: var(--ink); font-weight: 500; }
.a-step .mini {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--hairline);
}
.a-step .mini i {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  background: var(--ink);
}
.a-step[data-state='current'] .mini i { background: var(--marker); box-shadow: inset 0 -2px 0 var(--ink); }

.a-pages { margin-top: 8px; }
.a-pages ul { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.a-pages li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 14px;
}
.a-pages li:last-child { border-bottom: 0; }
.a-pages .page-state { color: var(--graphite-2); font-size: 12px; white-space: nowrap; }
.a-pages li[data-state='writing'] .page-state { color: var(--ink); font-weight: 600; }
.a-pages li[data-state='writing'] .page-title { color: var(--ink); font-weight: 600; }

.pmark {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 1.5px solid var(--field-line);
  border-radius: 50%;
}
.pmark.done { border-color: var(--ink); background: var(--ink); }
.pmark.done::after {
  content: '';
  width: 7px; height: 4px;
  border-left: 1.5px solid var(--paper);
  border-bottom: 1.5px solid var(--paper);
  transform: rotate(-45deg) translate(1px, -1px);
}
.pmark.writing { border-color: var(--ink); background: var(--marker); animation: pulse 1.4s var(--ease) infinite; }

.a-promise {
  display: grid;
  gap: 6px;
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
}
.a-promise strong { font-family: var(--display); font-size: 16px; font-weight: 600; }
.a-promise p { color: var(--graphite); font-size: 15px; }
.a-promise .tlink { margin-top: 2px; font-size: 14px; }

.a-ready { display: grid; gap: 20px; margin-top: 6px; }
.a-ready-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
  padding: 20px;
}
.a-ready-card .a-meta { margin-top: 0; border-top: 0; }
.a-ready-card .a-meta li:first-child { padding-top: 0; }
.a-ready-card .a-meta li:last-child { border-bottom: 0; padding-bottom: 0; }
.a-done-mark {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--marker);
  color: var(--marker-ink);
  margin-bottom: 16px;
}
.a-done-mark svg { width: 28px; height: 28px; }
.a-actions { display: grid; gap: 10px; }
.a-next { display: flex; flex-wrap: wrap; gap: 0 24px; }

.a-demo {
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px dashed var(--hairline);
  color: var(--graphite-2);
  font-size: 12px;
}
.a-demo a { color: var(--graphite); min-height: 44px; display: inline-flex; align-items: center; }

.a-actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
}
.a-actionbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.a-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--graphite);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.a-back:hover { color: var(--ink); }
.a-back svg { width: 16px; height: 16px; }
.a-actionbar .btn { flex: 1; min-width: 0; }
.a-actionbar .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 760px) {
  .a-main { padding-top: 44px; padding-bottom: 72px; }
  .a-title { font-size: 44px; }
  .a-actionbar { position: static; padding: 0; border: 0; background: none; backdrop-filter: none; margin-top: 36px; }
  .a-actionbar-inner { max-width: none; }
  .a-actionbar .btn { flex: 0 0 auto; min-width: 240px; margin-left: auto; }
  .a-screen .legal { margin-top: 26px; }
}

/* ============================================================
   B — the desk, tightened
   Wide two-column workbench: composer left, session rail right.
   ============================================================ */

.b-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(10px);
}
.b-topbar-in {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 72px;
}
.b-nav { display: flex; align-items: center; gap: 4px; }
.b-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.b-nav a:hover { color: var(--ink); }
.b-nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink), inset 0 -4px 0 var(--marker); }
.b-top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.b-user { max-width: 190px; overflow: hidden; color: var(--graphite); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.b-signout { font-size: 13px; padding: 0 4px; white-space: nowrap; }
.b-iconbtn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.b-iconbtn:hover { border-color: var(--ink); }
.b-iconbtn svg { width: 18px; height: 18px; }
.b-menu-btn { display: none; }

.b-wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 40px; }

.b-greet { margin-bottom: 28px; }
.b-greet h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.b-greet p { max-width: 56ch; color: var(--graphite); font-size: 16px; line-height: 1.6; }

.b-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.b-left { display: contents; }
.b-newblock { order: 1; }
.b-rail { order: 2; }
.b-listblock { order: 3; }
.b-listblock .b-section-head { margin-top: 0; }

.b-new {
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
}
.b-new > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 20px;
  cursor: pointer;
  list-style: none;
}
.b-new > summary::-webkit-details-marker { display: none; }
.b-new > summary:hover .b-new-title { text-decoration-color: var(--ink); }
.b-new-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.b-new-hint { margin-left: auto; color: var(--graphite); font-size: 13px; }
.b-chev { width: 18px; height: 18px; flex: 0 0 auto; color: var(--graphite); transition: transform 0.25s var(--ease); }
.b-new[open] .b-chev { transform: rotate(180deg); }
.b-new-body { padding: 0 20px 20px; border-top: 1px solid var(--hairline-2); }
.b-new-body .field { margin-top: 16px; }
.b-new-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 16px;
}
.b-new-row .tlink { font-size: 14px; }
.b-new-row .hint-s { margin-right: auto; }
.b-new .btn { margin-top: 18px; width: 100%; }
.b-new-note { margin-top: 10px; color: var(--graphite); font-size: 14px; }

.b-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.b-section-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.b-section-head span { color: var(--graphite); font-size: 13px; }

.b-list { display: grid; margin: 0; padding: 0; list-style: none; }
.b-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
.b-row-main { min-width: 0; }
.b-row h3 { font-size: 19px; line-height: 1.25; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.b-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 4px;
}
.b-row-role { color: var(--graphite); font-size: 15px; overflow-wrap: anywhere; }
.b-row-date { color: var(--graphite-2); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.b-row-state { margin-top: 10px; }
.b-row-lastread { margin-top: 8px; color: var(--graphite); font-size: 13px; }

.b-menu { position: relative; justify-self: end; }
.b-menu > summary {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.b-menu > summary::-webkit-details-marker { display: none; }
.b-menu > summary:hover { border-color: var(--ink); }
.b-menu[open] > summary { border-color: var(--ink); background: var(--paper); }
.b-menu > summary svg { width: 18px; height: 18px; }
.b-menu-panel {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 10;
  width: min(240px, calc(100vw - 40px));
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
  box-shadow: var(--menu-shadow);
}
.b-menu-panel a,
.b-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.b-menu-panel a:hover,
.b-menu-panel button:hover { background: var(--paper); }
.b-menu-panel svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--graphite); }
.b-menu-panel .sep { height: 1px; margin: 6px 4px; background: var(--hairline-2); }

.b-rail { display: grid; gap: 28px; align-content: start; align-self: start; }
@media (min-width: 980px) {
  .b-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 340px;
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    row-gap: 36px;
    align-items: start;
  }
  .b-newblock { grid-column: 1; grid-row: 1; }
  .b-listblock { grid-column: 1; grid-row: 2; }
  .b-rail {
    grid-column: 2;
    grid-row: 1 / span 2;
    flex: none;
    position: sticky;
    top: 96px;
  }
}
.b-rail h2 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 4px; }
.b-rail-sub { color: var(--graphite); font-size: 13px; margin-bottom: 12px; }

.b-run {
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
  padding: 18px;
}
.b-run-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.b-run-top .chip { flex: 0 0 auto; }
.b-run h3 { font-size: 19px; letter-spacing: -0.015em; margin: 0 0 2px; overflow-wrap: anywhere; }
.b-run-role { color: var(--graphite); font-size: 14px; margin-bottom: 18px; }
.b-run-pct {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.b-run-pct strong {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.b-run-pct span { color: var(--graphite); font-size: 13px; }
.b-run .track { margin-bottom: 16px; }
.b-run-steps { display: grid; gap: 0; margin: 0 0 14px; padding: 0; list-style: none; }
.b-run-steps li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 14px;
}
.b-run-steps li:last-child { border-bottom: 0; }
.b-run-steps .name { color: var(--graphite); }
.b-run-steps li[data-state='done'] .name,
.b-run-steps li[data-state='current'] .name { color: var(--ink); }
.b-run-steps li[data-state='current'] .name { font-weight: 600; }
.b-run-steps .pct { color: var(--graphite-2); font-family: var(--mono); font-size: 12px; }
.b-run-now {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
.b-run-now b { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--graphite-2); margin-bottom: 3px; }
.b-run-note { margin-top: 12px; color: var(--graphite); font-size: 13px; }

.b-read {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--paper-2);
}
.b-read h3 { font-size: 15px; letter-spacing: -0.01em; }
.b-read p { color: var(--graphite); font-size: 13px; margin-top: 2px; }
.b-read .tlink { justify-self: end; }
.b-run-link { margin-top: 4px; font-size: 14px; }
.b-read-link { font-size: 14px; }

@media (max-width: 720px) {
  .b-read { grid-template-columns: minmax(0, 1fr); }
  .b-read .tlink { justify-self: start; }
}
@media (max-width: 600px) {
  .b-new-row {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 0 20px;
  }
  .b-new-row .hint-s { grid-column: 1 / -1; margin-right: 0; }
}

.b-foot {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 4px;
}
.b-foot p { color: var(--graphite-2); font-size: 12px; line-height: 1.6; }
.b-foot .legal { margin-bottom: 2px; }

@media (max-width: 900px) {
  .b-nav { display: none; }
  .b-menu-btn { display: grid; }
  .b-user, .b-signout { display: none; }
  .b-topbar-in { gap: 12px; min-height: 64px; }
  .b-wrap { padding-top: 24px; }
}
@media (max-width: 430px) {
  .b-topbar .wordmark span:last-child { display: none; }
  .b-new > summary { padding: 0 16px; }
  .b-new-body { padding: 0 16px 18px; }
  .b-new-hint { display: none; }
}
@media (max-width: 380px) {
  .b-row h3 { font-size: 18px; }
}

/* ============================================================
   C — the dossier ledger
   List first; creation lives in a slide-over panel.
   ============================================================ */

.c-topbar {
  border-bottom: 1px solid var(--hairline);
}
.c-topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 20px;
  min-height: 64px;
}
.c-new {
  min-height: 44px;
  padding: 0 16px;
  gap: 8px;
  font-size: 14px;
}
.c-new svg { width: 16px; height: 16px; }

.c-main { max-width: 820px; margin: 0 auto; padding: 36px 20px 48px; }
.c-intro { margin-bottom: 8px; }
.c-intro h1 {
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.c-intro p { max-width: 62ch; color: var(--graphite); font-size: 16px; }

.c-book { position: relative; margin-top: 32px; }
.c-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'date act' 'body body';
  align-items: start;
  gap: 6px 16px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}
.c-row:last-of-type { border-bottom: 1px solid var(--hairline); }
.c-date {
  grid-area: date;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--graphite-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.c-date .year { color: var(--graphite-2); opacity: 0.7; font-size: 11px; }
.c-body { grid-area: body; min-width: 0; }
.c-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.c-row h2 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.c-role { color: var(--graphite); font-size: 16px; margin-top: 2px; }
.c-state { margin-top: 10px; }
.c-act { grid-area: act; align-self: start; padding-top: 2px; }
.c-open-mark {
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 3px;
  background: var(--marker);
}
.c-open-mark::after {
  content: '';
  position: absolute;
  left: 0; top: 0; width: 2px; height: 100%;
  background: var(--ink);
}
.c-inline {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
}
.c-inline .track { margin-bottom: 12px; }
.c-inline-now { color: var(--ink); font-size: 14px; }
.c-inline-now b { font-weight: 600; }
.c-inline-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.c-inline-steps li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--hairline-2);
  color: var(--graphite);
  font-size: 13px;
}
.c-inline-steps li[data-state='current'] { color: var(--ink); font-weight: 600; }
.c-inline-steps .pct { font-family: var(--mono); font-size: 12px; color: var(--graphite-2); white-space: nowrap; }
.c-inline-steps li[data-state='current'] .pct { color: var(--ink); }
@media (min-width: 700px) {
  .c-inline-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.c-inline-note { margin-top: 10px; color: var(--graphite); font-size: 13px; }

.c-ledger-foot {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}
.c-ledger-foot p { color: var(--graphite); font-size: 14px; }

/* the slide-over: opened by #nouveau, closed by #dossiers, no JS */
.c-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(440px, 100%);
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}
.c-overlay:target { visibility: visible; pointer-events: auto; }
.c-backdrop {
  display: block;
  background: rgba(20, 23, 26, 0.42);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.c-overlay:target .c-backdrop { opacity: 1; }
.c-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  overflow-y: auto;
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
  background: var(--paper-2);
  border-left: 1px solid var(--hairline);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}
.c-overlay:target .c-panel { transform: translateX(0); }
.c-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.c-panel-head h2 { font-size: 26px; line-height: 1.1; letter-spacing: -0.025em; }
.c-close {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  flex: 0 0 44px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.c-close:hover { border-color: var(--ink); }
.c-close svg { width: 18px; height: 18px; }
.c-panel-lede { color: var(--graphite); font-size: 15px; line-height: 1.55; }
.c-panel .btn { width: 100%; }
.c-panel-note { color: var(--graphite-2); font-size: 13px; }
.c-panel .legal { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--hairline-2); }

@media (max-width: 759px) {
  .c-row { padding-left: 14px; }
}
@media (max-width: 720px) {
  .c-panel {
    grid-column: 1 / -1;
    width: 100%;
    border-left: 0;
  }
  .c-backdrop { display: none; }
}
@media (min-width: 760px) {
  .c-main { padding-top: 52px; }
  .c-book { padding-left: 0; }
  .c-book::before {
    content: '';
    position: absolute;
    left: 0; top: -1px; bottom: -1px;
    width: 1px;
    background: var(--hairline);
  }
  .c-row {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    grid-template-areas: 'date body act';
    gap: 8px 28px;
    padding: 24px 0 24px 28px;
    border-top: 0;
  }
  .c-row::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: var(--hairline);
  }
  .c-row:last-of-type { border-bottom: 0; }
  .c-row:last-of-type::before {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--hairline);
  }
  .c-date { flex-direction: column; gap: 0; padding-top: 4px; }
  .c-date .year { font-size: 11px; }
  .c-act { grid-row: auto; align-self: start; padding-top: 2px; }
  .c-open-mark { left: 0; width: 3px; }
}
@media (max-width: 420px) {
  .c-new span { display: none; }
  .c-new { width: 44px; padding: 0; justify-content: center; }
  .c-row h2 { font-size: 21px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
