/* app.css */
/* Bird — system fonts only, no external resource.
   Logical properties throughout (inline/block), so the layout mirrors correctly in RTL. */

/* Brand: navy ink + one blue accent, on calm paper. Blue is for interaction (links, focus, active states);
   the restrained green is kept ONLY as the semantic colour of the footprint (leaf, receipt, eco charts). */
:root {
  --scroll-shade: rgba(11, 27, 63, 0.18);
  --bg: #f6f5f0;
  --surface: #fdfcf9;
  --surface-2: #eceae2;
  --side: #f0eee7;
  --ink: #121a2e;
  --ink-2: #39435c;
  --muted: #586078;
  --line: #dddbd1;
  --line-strong: #bcbab0;
  --control-line: #80848f; /* resting borders of form controls: 3:1 against the page */
  --brand: #0b1b3f;
  --brand-sub: #1e5bd8;
  --accent: #1e5bd8;
  --accent-strong: #174bb5;
  --accent-ink: #ffffff;
  --accent-soft: #e2e9f8;
  --link: #1a50c4;
  --primary: #0b1b3f;
  --primary-hover: #17306b;
  --primary-ink: #ffffff;
  --user-bg: #e6e9f1;
  --eco: #2c6a4f;
  --eco-soft: #dde9dc;
  --warn-ink: #734700;
  --warn-bg: #f8ecc8;
  --warn-line: #e0cb8c;
  --danger-ink: #962b1f;
  --danger-bg: #f9e4de;
  --danger-line: #e6b9af;
  --series-in: #c4953f;
  --series-out: #12764a;
  /* chart series, fixed order (validated with the dataviz palette script on --surface); 7-8: neutral, pie only */
  --series-1: #1e5bd8;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #6250d6;
  --series-7: #8a8f9c;
  --series-8: #b9bcc4;
  /* weather glyphs and strip (widgets.js wxIcon, hourlyStrip) */
  --wx-sun: #e29a00;
  --wx-moon: #8d97ab;
  --wx-cloud: #c3c9d4;
  --wx-cloud-rain: #9aa4b5;
  --wx-rain: #1e5bd8;
  --wx-bar: #9fbbf0;
  --wx-snow: #5c9be0;
  --wx-line: #eb6834;
  --wx-area: rgb(235 104 52 / 0.1);
  --ck-office: #cfe0d4;
  --ck-part: #e6efe8;
  --ck-night: #e3e3ea;
  --ck-band: #12764a;
  --shadow: 0 1px 2px rgb(18 26 46 / 0.05), 0 8px 24px -12px rgb(18 26 46 / 0.18);
  --shadow-lg: 0 2px 6px rgb(18 26 46 / 0.06), 0 24px 48px -20px rgb(18 26 46 / 0.3);
  --backdrop: rgb(11 27 63 / 0.4);

  --sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
    Arial, sans-serif;
  --serif:
    "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia,
    "Times New Roman", serif;
  --mono:
    ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --radius: 14px;
  --radius-s: 9px;
  --col: 46rem;
  --gutter: 20px;
  --side-w: 17.5rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --scroll-shade: rgba(0, 0, 0, 0.6);
    --bg: #0b1220;
    --surface: #111a2c;
    --surface-2: #1b2640;
    --side: #080e1a;
    --ink: #e9edf5;
    --ink-2: #c5cddd;
    --muted: #9ba6bc;
    --line: #202b43;
    --line-strong: #3a4763;
    --control-line: #64739a;
    --brand: #f2f4f8;
    --brand-sub: #8fb3ff;
    --accent: #8fb3ff;
    --accent-strong: #b0c9ff;
    --accent-ink: #0b1220;
    --accent-soft: #17274b;
    --link: #8fb3ff;
    --primary: #e9edf5;
    --primary-hover: #ffffff;
    --primary-ink: #0b1220;
    --user-bg: #1a2540;
    --eco: #8fd0a9;
    --eco-soft: #173226;
    --warn-ink: #f0c56d;
    --warn-bg: #2d2510;
    --warn-line: #57471c;
    --danger-ink: #f3a497;
    --danger-bg: #331915;
    --danger-line: #6b332a;
    --series-in: #bb8c36;
    --series-out: #1a8256;
    --series-1: #5b8def;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #9085e9;
    --series-7: #7b8496;
    --series-8: #555e70;
    --wx-sun: #f0b43c;
    --wx-moon: #cfd3dc;
    --wx-cloud: #7b8598;
    --wx-cloud-rain: #5e687b;
    --wx-rain: #79a3ff;
    --wx-bar: #34528f;
    --wx-snow: #a8cbf5;
    --wx-line: #f08a5d;
    --wx-area: rgb(240 138 93 / 0.12);
    --ck-office: #1f4a38;
    --ck-part: #193628;
    --ck-night: #141c2e;
    --ck-band: #5fd3a0;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -12px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.4), 0 28px 56px -20px rgb(0 0 0 / 0.8);
    --backdrop: rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --scroll-shade: rgba(0, 0, 0, 0.6);
  --bg: #0b1220;
  --surface: #111a2c;
  --surface-2: #1b2640;
  --side: #080e1a;
  --ink: #e9edf5;
  --ink-2: #c5cddd;
  --muted: #9ba6bc;
  --line: #202b43;
  --line-strong: #3a4763;
  --control-line: #64739a;
  --brand: #f2f4f8;
  --brand-sub: #8fb3ff;
  --accent: #8fb3ff;
  --accent-strong: #b0c9ff;
  --accent-ink: #0b1220;
  --accent-soft: #17274b;
  --link: #8fb3ff;
  --primary: #e9edf5;
  --primary-hover: #ffffff;
  --primary-ink: #0b1220;
  --user-bg: #1a2540;
  --eco: #8fd0a9;
  --eco-soft: #173226;
  --warn-ink: #f0c56d;
  --warn-bg: #2d2510;
  --warn-line: #57471c;
  --danger-ink: #f3a497;
  --danger-bg: #331915;
  --danger-line: #6b332a;
  --series-in: #bb8c36;
  --series-out: #1a8256;
  --series-1: #5b8def;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #9085e9;
  --series-7: #7b8496;
  --series-8: #555e70;
  --wx-sun: #f0b43c;
  --wx-moon: #cfd3dc;
  --wx-cloud: #7b8598;
  --wx-cloud-rain: #5e687b;
  --wx-rain: #79a3ff;
  --wx-bar: #34528f;
  --wx-snow: #a8cbf5;
  --wx-line: #f08a5d;
  --wx-area: rgb(240 138 93 / 0.12);
  --ck-office: #1f4a38;
  --ck-part: #193628;
  --ck-night: #141c2e;
  --ck-band: #5fd3a0;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -12px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.4), 0 28px 56px -20px rgb(0 0 0 / 0.8);
  --backdrop: rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  block-size: 100%;
}
body {
  margin: 0;
  block-size: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  overflow: hidden;
  overflow-wrap: break-word;
}
h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
fieldset {
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
button,
textarea,
input,
select {
  font: inherit;
  color: inherit;
}
a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: -4rem;
  z-index: 60;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-s);
}
.skip:focus {
  inset-block-start: 12px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font: 600 0.72rem/1.4 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* icons */
.icon {
  inline-size: 1.15em;
  block-size: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon .fill {
  fill: currentColor;
  stroke: none;
}
.mark {
  inline-size: 32px;
  block-size: 28px;
  flex: none;
}
.mark {
  fill: var(--brand);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-block-size: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-weight: 550;
  font-size: 0.92rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-quiet {
  color: var(--ink-2);
}
.btn-quiet:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-quiet.is-on {
  background: var(--accent-soft);
  color: var(--link);
}
.btn-icon {
  inline-size: 40px;
  padding: 0;
  flex: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-primary:disabled {
  background: var(--surface-2);
  color: var(--muted);
  opacity: 1;
}
.btn-outline {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--ink-2);
}
.btn-danger:hover:not(:disabled) {
  border-color: var(--danger-ink);
  color: var(--danger-ink);
}
.btn-small {
  min-block-size: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}
.btn-small.btn-icon {
  inline-size: 34px;
  padding: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 0.7rem/1.5 var(--sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-demo {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-transform: uppercase;
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid var(--warn-line);
}
.tag {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 600 0.66rem/1.7 var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag-measured {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--link);
}
.tag-estimated {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.tag-unavailable,
.tag-scripted {
  border-style: dashed;
}

/* ------------------------------------------------------------ app shell */
.app {
  display: flex;
  block-size: 100dvh;
  block-size: var(--vvh, 100dvh);
}
.side {
  display: flex;
  flex-direction: column;
  inline-size: var(--side-w);
  flex: none;
  padding: 10px 10px calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
  background: var(--side);
  border-inline-end: 1px solid var(--line);
  transition:
    margin 0.2s ease,
    visibility 0.2s;
}
/* desktop: open unless the user closed it (the html attribute is set before first paint: no layout shift) */
.side-closed .side,
html[data-side="closed"] body:not(.side-open) .side {
  margin-inline-start: calc(-1 * var(--side-w));
  visibility: hidden;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 10px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wordmark {
  font: 800 1.4rem/1 var(--sans);
  letter-spacing: -0.035em;
  color: var(--brand);
}
.wordmark-sub {
  margin-inline-start: 2px;
  font: 800 0.8rem/1 var(--sans);
  letter-spacing: 0.01em;
  color: var(--brand-sub);
}
.side-close {
  display: none;
}
.btn-new {
  justify-content: flex-start;
  inline-size: 100%;
  border-color: var(--line-strong);
  background: var(--surface);
  border-radius: 12px;
}
.btn-new:hover {
  border-color: var(--accent);
}
.side-search {
  position: relative;
  margin-block: 10px 6px;
  color: var(--muted);
}
.side-search .icon {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 11px;
  pointer-events: none;
}
.side-search input {
  inline-size: 100%;
  min-block-size: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  font-size: 0.9rem;
  color: var(--ink);
}
.side-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.conv-list {
  flex: 1;
  min-block-size: 0;
  overflow-y: auto;
  margin-inline: -4px;
  padding: 4px;
}
.conv-list section + section {
  margin-block-start: 14px;
}
.conv-list .eyebrow {
  padding: 4px 8px;
}
.side-empty {
  padding: 12px 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.conv {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-radius: 10px;
}
.conv:hover,
.conv.is-current {
  background: var(--surface-2);
}
.conv.is-current .conv-title {
  font-weight: 600;
  color: var(--ink);
}
.conv-open {
  flex: 1;
  min-inline-size: 0;
  min-block-size: 38px;
  padding: 6px 4px 6px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: start;
  cursor: pointer;
}
.conv-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.conv-more {
  opacity: 0;
}
.conv:hover .conv-more,
.conv-more:focus-visible,
.conv-more[aria-expanded="true"],
.conv.is-current .conv-more {
  opacity: 1;
}
.conv-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  inline-size: 100%;
  padding: 0 4px 6px;
}
.conv-menu .btn {
  padding: 0 9px;
  font-size: 0.8rem;
  min-block-size: 32px;
}
.rename {
  inline-size: 100%;
  min-block-size: 38px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9rem;
}
.side-foot {
  padding-block-start: 8px;
  border-block-start: 1px solid var(--line);
}
.side-clear {
  margin-inline-start: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.side-note {
  padding: 2px 8px 6px;
  font-size: 0.74rem;
  color: var(--muted);
}
.btn-nav {
  justify-content: flex-start;
  inline-size: 100%;
  min-block-size: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.88rem;
}
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--backdrop);
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-inline-size: 0;
}
.top {
  display: flex;
  align-items: center;
  gap: 4px;
  min-block-size: 56px;
  padding: 8px calc(12px + var(--safe-r)) 8px 12px;
  border-block-end: 1px solid var(--line);
}
.top-title {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-inline: 6px;
  font: 600 1.02rem/1.3 var(--serif);
}
.btn-chip {
  min-block-size: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink-2);
  max-inline-size: 13rem;
}
.btn-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.btn-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-dot {
  inline-size: 8px;
  block-size: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.btn-chip.is-demo {
  border-style: dashed;
  border-color: var(--line-strong);
}
.btn-chip.is-demo .chip-dot {
  background: none;
  border: 1.5px solid var(--muted);
}
/* Bird local (local.js): a calm badge, distinct from the hosted model (blue dot) and the demo (dashed) */
.btn-chip.is-local {
  border-color: color-mix(in srgb, var(--eco) 45%, var(--line));
  background: var(--eco-soft);
  color: var(--ink);
}
.btn-chip.is-local .chip-dot {
  background: var(--eco);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--eco) 22%, transparent);
}
.btn-footprint .icon {
  color: var(--eco);
}
.banner {
  margin: 12px var(--gutter) 0;
  padding: 10px 14px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-s);
  background: var(--danger-bg);
  color: var(--danger-ink);
  font-size: 0.92rem;
}
.scroll {
  flex: 1;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  outline: none;
}
.column {
  inline-size: 100%;
  max-inline-size: calc(var(--col) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
/* the canvas opens: the columns glide to their new place (app.js glide, FLIP: transform only, no layout shift) */
.main.is-gliding,
.column.is-gliding {
  transform: translateX(var(--glide, 0));
}
.main.is-gliding.glide-go,
.column.is-gliding.glide-go {
  transform: none;
  transition: transform 0.24s cubic-bezier(0.2, 0, 0, 1);
}
.side-instant .side {
  transition: none;
}
.view {
  padding-block: 28px 24px;
}

/* ------------------------------------------------------------ empty state (hero: see « first impression ») */
.demo-note {
  display: inline-block;
  margin-block-start: 14px;
  padding: 5px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  font-size: 0.84rem;
  color: var(--muted);
}
.examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block-start: 12px;
}
.chip {
  display: flex;
  gap: 12px;
  inline-size: 100%;
  block-size: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.chip-icon,
.card-icon,
.sheet-icon {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--link);
}
.chip-text {
  display: grid;
  align-content: start;
  gap: 2px;
  min-inline-size: 0;
}
.chip-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.chip-prompt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 520px) {
  .empty .examples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .empty .chip {
    align-items: center;
    gap: 8px;
    min-block-size: 48px;
    padding: 8px 10px;
  }
  .empty .chip-icon {
    inline-size: 28px;
    block-size: 28px;
    border-radius: 8px;
  }
  .empty .chip-prompt {
    display: none;
  }
  .empty .chip-title {
    font-size: 0.9rem;
    line-height: 1.25;
  }
}

/* ------------------------------------------------------------ turns */
.conversation {
  display: grid;
  gap: 30px;
  padding-block-end: 44px; /* the last line can always scroll clear of « Aller à la fin » */
}
.turn-user {
  display: flex;
  justify-content: flex-end;
}
.bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  max-inline-size: min(88%, 36rem);
}
.bubble-edit {
  opacity: 0;
}
.turn-user:hover .bubble-edit,
.bubble-edit:focus-visible {
  opacity: 1;
}
.bubble {
  min-inline-size: 0;
  padding: 10px 16px;
  border-radius: 18px;
  border-end-end-radius: 5px;
  background: var(--user-bg);
}
.bubble-text {
  white-space: pre-wrap;
}
.bubble-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-start: 8px;
}
.chip-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.turn-bird {
  display: grid;
  gap: 14px;
  min-inline-size: 0;
}
.turn-bird > * {
  min-inline-size: 0;
}
.byline {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* the bird mark next to « Bird »; its wings beat gently while an answer is being prepared */
.byline-mark {
  inline-size: 22px;
  block-size: 19px;
  flex: none;
  fill: var(--ink);
  overflow: visible;
}
.byline-mark .mark-wing-back,
.byline-mark .mark-wing-front {
  transform-box: view-box;
  transform-origin: 42px 31px;
}
.byline.is-flying .byline-mark {
  fill: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .byline.is-flying .byline-mark {
    animation: bird-glide 1.6s ease-in-out infinite;
  }
  .byline.is-flying .mark-wing-back {
    animation: bird-wing-back 0.8s ease-in-out infinite;
  }
  .byline.is-flying .mark-wing-front {
    animation: bird-wing-front 0.8s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .byline.is-flying .byline-mark {
    animation: bird-breathe 1.8s ease-in-out infinite;
  }
}
@keyframes bird-glide {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes bird-wing-back {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  50% { transform: rotate(18deg) scaleY(0.55); }
}
@keyframes bird-wing-front {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  50% { transform: rotate(-16deg) scaleY(0.6); }
}
@keyframes bird-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.byline-name {
  font: 600 1.02rem/1.2 var(--serif);
}
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
.chev {
  inline-size: 0.95em;
  block-size: 0.95em;
  color: var(--muted);
  transition: transform 0.15s;
}
details[open] > summary > .chev {
  transform: rotate(90deg);
}

/* live status: what Bird is doing right now */
.live {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.94rem;
  color: var(--ink-2);
}
/* the model waking up: the same quiet line as any wait (no box, no alert), a hovering bird and a thin bar */
.live-calm {
  align-items: flex-start;
}

.live-body {
  min-inline-size: 0;
}
.wake-bar {
  inline-size: min(240px, 100%);
  block-size: 3px;
  margin-block-start: 10px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.wake-bar > span {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: inline-size 1s linear;
}
.live-sub {
  font-size: 0.84rem;
  color: var(--muted);
}
.spinner {
  inline-size: 14px;
  block-size: 14px;
  flex: none;
  border: 2px solid var(--line-strong);
  border-block-start-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* steps */
.steps {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.steps[open] > summary > .badge {
  display: none;
}
.steps-count {
  font-weight: 600;
  white-space: nowrap;
}
.steps-names {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.steps-time {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.timeline {
  padding: 0 8px 8px;
}
.step {
  position: relative;
}
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 20px;
  inset-block: 38px -6px;
  inline-size: 1px;
  background: var(--line-strong);
}
.step-box > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  padding: 6px;
  border-radius: 10px;
}
.step-box > summary:hover {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.step-icon {
  display: grid;
  place-items: center;
  inline-size: 29px;
  block-size: 29px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.86rem;
  z-index: 1;
}
.step-flagged .step-icon {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.step-title {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-inline-size: 0;
}
.step-label {
  font-weight: 600;
  font-size: 0.92rem;
}
/* on a phone the step's name keeps its line: the « contenu suspect » badge shrinks to its icon (the warning
   inside the step says it in full) */
@media (max-width: 640px) {
  .badge-flag {
    padding-inline: 5px;
  }
  .badge-flag-text {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.step-target {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  color: var(--muted);
}
.step-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.status-done {
  color: var(--eco);
}
.status-error,
.status-denied {
  color: var(--danger-ink);
}
.status-awaiting,
.step-await-text {
  color: var(--warn-ink);
}
.step-await-text {
  font-weight: 600;
}
.step-awaiting .step-icon {
  border-color: var(--warn-line, var(--line-strong));
}
.badge-await {
  color: var(--warn-ink);
}
.ignored {
  display: grid;
  gap: 4px;
  margin: 0;
}
.ignored-text {
  margin: 0;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--warn-line);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--warn-bg);
  color: var(--ink);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.sheet-ignored {
  margin-block-start: 8px;
}
.sheet-ignored > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-block-size: 36px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--warn-ink);
  cursor: pointer;
  list-style: none;
}
.sheet-ignored > summary::-webkit-details-marker {
  display: none;
}
.sheet-ignored[open] > summary .chev {
  transform: rotate(90deg);
}
.sheet-ignored .ignored figcaption {
  display: none;
}
.send-why {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 0 18px 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.send-why .link {
  font-weight: 600;
}
.step-body {
  display: grid;
  gap: 6px;
  margin: 2px 6px 10px 45px;
}
.step-summary,
.step-preview {
  font-size: 0.88rem;
  color: var(--ink-2);
}
.step-preview {
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--line-strong);
  color: var(--muted);
  font-style: italic;
}
.step-warning {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-s);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.86rem;
  line-height: 1.45;
}
.step-warning .icon {
  margin-block-start: 2px;
}
.kv > div {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 10px;
  padding: 2px 0;
  font-size: 0.9rem;
}
.kv dt {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}
.kv dd {
  overflow-wrap: anywhere;
}
.kv-long {
  white-space: pre-wrap;
}
.kv-box {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  max-block-size: 15rem;
  overflow-y: auto;
}

/* reasoning */
.reasoning > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 0;
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--muted);
  border-radius: 6px;
}
.reasoning-body {
  margin-block-start: 6px;
  padding: 2px 0 2px 14px;
  border-inline-start: 2px solid var(--line-strong);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-2);
  white-space: pre-wrap;
}

/* confirmation sheet */
.sheet {
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.25s ease-out;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.sheet-head h3 {
  font: 600 1.12rem/1.25 var(--serif);
}
.sheet-icon {
  background: none;
  border: 1px solid var(--warn-line);
  color: inherit;
}
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 16px;
}
.sheet-grid .eyebrow {
  margin-block-end: 6px;
}
.sheet-grid .eyebrow:not(:first-child) {
  margin-block-start: 14px;
}
.sheet-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 8px;
  font-weight: 600;
}
.sheet-why {
  font-size: 0.92rem;
  line-height: 1.5;
}
.sheet-then {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.sheet-then li {
  display: flex;
  gap: 8px;
}
.sheet-then .icon {
  margin-block-start: 3px;
  color: var(--muted);
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-block-start: 1px solid var(--line);
  background: var(--bg);
}
.sheet-actions .btn {
  min-inline-size: 7.5rem;
}
.confirm-done {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* markdown answer */
.md {
  font-size: 1.02rem;
  line-height: 1.68;
}
.md > * + * {
  margin-block-start: 0.8em;
}
.md h3,
.md h4,
.md h5 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin-block-start: 1.4em;
}
.md > :first-child {
  margin-block-start: 0;
}
.md h3 {
  font-size: 1.35rem;
}
.md h4 {
  font-size: 1.12rem;
}
.md h5 {
  font-size: 1rem;
}
.md ul,
.md ol {
  padding-inline-start: 1.35em;
}
.md ul {
  list-style: disc;
}
.md ol {
  list-style: decimal;
}
.md li + li,
.md li > ul,
.md li > ol {
  margin-block-start: 0.3em;
}
.md li::marker {
  color: var(--muted);
}
.md code {
  padding: 0.12em 0.36em;
  border-radius: 5px;
  background: var(--surface-2);
  font: 0.88em var(--mono);
}
.md pre {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  /* scroll shadows: an edge darkens while more code hides beyond it */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100%
      no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100%
      no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent)
      left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent)
      right / 12px 100% no-repeat scroll,
    var(--surface);
  overflow-x: auto;
  line-height: 1.5;
}
.code-block {
  margin-block: 0;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 2px 14px;
  border: 1px solid var(--line);
  border-block-end: 0;
  border-radius: var(--radius-s) var(--radius-s) 0 0;
  background: var(--surface-2);
  font-size: 0.78rem;
  color: var(--muted);
}
.code-lang {
  font-family: var(--mono, ui-monospace, monospace);
}
.code-copy {
  min-block-size: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font: 600 0.78rem var(--sans);
  cursor: pointer;
}
.code-copy:hover {
  background: var(--surface);
  color: var(--ink);
}
.code-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (pointer: coarse) {
  .code-copy {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
}
.md .code-block pre {
  margin-block-start: 0;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}
.md pre code {
  padding: 0;
  background: none;
  font-size: 0.86rem;
}
.md blockquote {
  margin: 0;
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--line-strong);
  color: var(--ink-2);
}
.md hr {
  border: 0;
  border-block-start: 1px solid var(--line);
  margin-block: 1.4em;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  /* scroll shadows: an edge darkens while columns hide beyond it */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100%
      no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100%
      no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent)
      left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent)
      right / 12px 100% no-repeat scroll,
    var(--surface);
}
.table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.md table,
.sheet-preview {
  inline-size: max-content; /* columns keep their words whole; the wrap scrolls instead */
  min-inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  background: transparent;
}
.md table th,
.md table td,
.sheet-preview th,
.sheet-preview td {
  min-inline-size: 9ch;
  background: transparent;
}
.md th,
.md td,
.sheet-preview th,
.sheet-preview td {
  padding: 8px 12px;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--line);
}
.md tbody tr:last-child td,
.sheet-preview tbody tr:last-child td {
  border-block-end: 0;
}
.md th,
.sheet-preview th {
  font: 600 0.74rem/1.5 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.al-right {
  text-align: end !important;
}
.al-center {
  text-align: center !important;
}
/* the caret that follows the stream */
.md.streaming > :last-child::after {
  content: "";
  display: inline-block;
  inline-size: 0.5em;
  block-size: 1.05em;
  margin-inline-start: 2px;
  vertical-align: -0.18em;
  border-radius: 2px;
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
.md.streaming > .table-wrap:last-child::after,
.md.streaming > pre:last-child::after {
  display: none;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.cite {
  font-size: 0.72em;
  line-height: 0;
  margin-inline-start: 1px;
}
.cite a {
  display: inline-block;
  min-inline-size: 1.5em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.cite a:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* sources */
.sources {
  padding-block-start: 12px;
  border-block-start: 1px solid var(--line);
}
.source-list {
  display: grid;
  gap: 6px;
  margin-block-start: 8px;
}
.source-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 0.92rem;
  border-radius: 6px;
}
.source-list li:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.source-n {
  flex: none;
  min-inline-size: 1.5em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.6;
  text-align: center;
}
.source-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  min-inline-size: 0;
}
.source-host {
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--muted);
}

/* result cards */
.cards {
  display: grid;
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.card-title {
  flex: 1;
  min-inline-size: 0;
}
.card-name {
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
/* a file card leads with the file, not its name: two lines of title at most (the whole title on hover), one
   line of meta; on a phone the download button is an icon (the deck bar has its own) */
.file-card .card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}
.file-card .card-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .file-card .card-head {
    gap: 10px;
    padding: 10px 12px;
  }
  .file-card .card-dl {
    flex: none;
    inline-size: 40px;
    padding: 0;
  }
  .file-card .card-dl .btn-label {
    display: none;
  }
}
.card-preview {
  border-block-start: 1px solid var(--line);
}
.card-preview > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--muted);
}
.card-preview > :not(summary) {
  margin: 0 14px 14px;
}
.outline {
  display: grid;
  gap: 8px;
}
.outline > li {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
}
.outline-n {
  flex: none;
  inline-size: 1.6em;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--muted);
}
.outline-title {
  font-weight: 600;
  font-size: 0.94rem;
}
.outline ul {
  padding-inline-start: 1.1em;
  list-style: disc;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.doc-preview {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.sheet-preview {
  font-size: 0.86rem;
}
/* a long cell stays on one line with an ellipsis (its whole text is in the title): the preview never looks cut */
.sheet-preview td {
  max-inline-size: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-body {
  margin: 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  white-space: pre-wrap;
  font-size: 0.96rem;
}
/* the recipient line: what is known, then a quiet dashed hint for what is still to add. Plain inline text, so
   « À » stays at the head of the first line and long addresses wrap after it instead of dropping below it */
.email-to {
  line-height: 1.7;
  overflow-wrap: anywhere;
}
/* a name and its hint move to the next line together, never the hint alone */
.email-name {
  display: inline-block;
  max-inline-size: 100%;
}
.email-missing {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: 2px;
  line-height: 1.4;
  white-space: nowrap;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.76rem;
}
.email-missing .icon {
  inline-size: 0.85em;
  block-size: 0.85em;
}
/* a blank the user fills in (« [Prénom] »): highlighted softly, never sent unnoticed */
.email-fill {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: inherit;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}
.card-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 14px;
  border-block-start: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--ink-2);
}
.card-note .icon {
  margin-block-start: 3px;
}

/* charts (chart.js): marks wear series classes, text wears ink tokens, grid and axes stay recessive */
.series-1 {
  fill: var(--series-1);
}
.series-2 {
  fill: var(--series-2);
}
.series-3 {
  fill: var(--series-3);
}
.series-4 {
  fill: var(--series-4);
}
.series-5 {
  fill: var(--series-5);
}
.series-6 {
  fill: var(--series-6);
}
.series-7 {
  fill: var(--series-7);
}
.series-8 {
  fill: var(--series-8);
}
.stroke-1 {
  stroke: var(--series-1);
}
.stroke-2 {
  stroke: var(--series-2);
}
.stroke-3 {
  stroke: var(--series-3);
}
.stroke-4 {
  stroke: var(--series-4);
}
.stroke-5 {
  stroke: var(--series-5);
}
.stroke-6 {
  stroke: var(--series-6);
}
.series-bg-1 {
  background: var(--series-1);
}
.series-bg-2 {
  background: var(--series-2);
}
.series-bg-3 {
  background: var(--series-3);
}
.series-bg-4 {
  background: var(--series-4);
}
.series-bg-5 {
  background: var(--series-5);
}
.series-bg-6 {
  background: var(--series-6);
}
.series-bg-7 {
  background: var(--series-7);
}
.series-bg-8 {
  background: var(--series-8);
}
.chart-card {
  margin: 0;
}
.chart-head {
  padding: 12px 14px 0;
}
.chart-head .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.chart-plot {
  position: relative;
  margin: 8px 6px 0;
  border-radius: var(--radius-s);
}
.chart-plot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chart-svg {
  display: block;
  inline-size: 100%;
  block-size: auto; /* drawn at its real size: no cap, a long horizontal bar chart makes a taller card */
  overflow: visible;
  font-family: var(--sans);
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.chart-tick,
.chart-label,
.chart-value,
.chart-direct {
  font-size: 12px;
  fill: var(--muted);
}
.chart-label {
  fill: var(--ink-2);
}
.chart-value,
.chart-direct {
  fill: var(--ink);
  font-weight: 600;
}
.chart-mark {
  stroke: var(--surface);
  stroke-width: 2;
  transition: opacity 0.15s;
}
.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-point-hidden {
  opacity: 0;
}
.chart-hit {
  fill: transparent;
}
.chart-plot.has-active .chart-mark:not(.is-active) {
  opacity: 0.55;
}
.chart-mark.is-active {
  stroke: var(--ink);
  stroke-width: 2;
  opacity: 1;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  inline-size: max-content;
  max-inline-size: min(260px, calc(100% - 8px));
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
}
.chart-tip.is-shown {
  opacity: 1;
}
.chart-tip-head {
  font-weight: 600;
}
.chart-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 8px 14px 0;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.chart-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-swatch {
  flex: none;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 3px;
}
.chart-swatch.is-line {
  block-size: 3px;
  inline-size: 14px;
  border-radius: 2px;
}
.chart-note {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 8px 14px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.chart-data {
  margin: 8px 14px 0;
  font-size: 0.84rem;
}
.chart-data > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
}
.chart-data[open] > summary .chev {
  transform: rotate(90deg);
}
.chart-table-wrap {
  overflow-x: auto;
  margin-block-start: 6px;
}
.chart-data table {
  border-collapse: collapse;
  min-inline-size: 100%;
}
.chart-data th,
.chart-data td {
  padding: 4px 10px 4px 0;
  border-block-end: 1px solid var(--line);
  text-align: start;
}
.chart-data td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 12px;
}
@media (prefers-reduced-motion: reduce) {
  .chart-mark {
    transition: none;
  }
}
@media (forced-colors: active) {
  .chart-mark,
  .chart-swatch {
    fill: CanvasText;
    background: CanvasText;
    forced-color-adjust: none;
  }
  .chart-line {
    stroke: CanvasText;
  }
}

/* web images: a fixed 4:3 frame, laid out before the image loads (no layout shift) */
.web-images {
  padding-block-start: 12px;
  border-block-start: 1px solid var(--line);
}
.web-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 8px;
}
.web-image-list > li {
  inline-size: 168px;
  max-inline-size: calc(50% - 5px);
}
/* phones: one row of smaller tiles that scrolls sideways (no orphan tile, about a third of the height) */
@media (max-width: 560px) {
  .web-image-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-block-end: 4px;
  }
  .web-image-list > li {
    flex: 0 0 128px;
    max-inline-size: none;
    scroll-snap-align: start;
  }
}
.web-image {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-s);
}
.web-image:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.web-image-frame {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.web-image-frame img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.web-image-cap {
  display: grid;
  font-size: 0.78rem;
  line-height: 1.3;
}
.web-image-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 550;
}
.web-image:hover .web-image-title {
  text-decoration: underline;
}
/* the credit a free licence asks for, shown whole (author, licence, bank): on a 128 px phone tile one line with
   an ellipsis kept only the author */
.web-image-credit {
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.web-image-host {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.web-image-n {
  padding: 0 0.35em;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 650;
}
.web-image-badge {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  max-inline-size: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface);
}
.web-image-note {
  margin-block-start: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* notices */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.92rem;
}
.notice > .icon {
  margin-block-start: 3px;
}
.notice-text {
  flex: 1;
  min-inline-size: 12rem;
}
.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.notice-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-ink);
}
.notice-error .btn {
  color: var(--ink);
}
.notice-calm > .icon {
  color: var(--accent);
}
.stopped {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 0.88rem;
  color: var(--muted);
}
.stopped > span {
  font-style: italic;
}
.status-stopped {
  color: var(--muted);
}
.actions-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-block: -6px;
  margin-inline-start: -8px;
}
.menu-wrap {
  position: relative;
  display: inline-flex;
}
.menu {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline-start: 0;
  z-index: 20;
  display: grid;
  min-inline-size: 15rem;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.menu.menu-up {
  inset-block: auto calc(100% + 4px);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.menu-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}
@media (max-width: 640px) {
  .menu {
    inset-inline: auto 0;
  }
}
/* a phone: the « ⋯ » menu is a sheet at the bottom of the screen, its entries well apart (TURN-13) */
@media (max-width: 480px) {
  .menu,
  .menu.menu-up {
    position: fixed;
    inset: auto 8px calc(8px + var(--safe-b));
    z-index: 70;
    gap: 4px;
    min-inline-size: 0;
    padding: 8px;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
  }
  .menu-item {
    min-block-size: 44px;
    font-size: 1rem;
  }
}
@media (pointer: coarse) {
  .actions-row {
    gap: 4px;
  }
  .actions-row .btn-small.btn-icon {
    inline-size: 44px;
    min-block-size: 44px;
  }
  .menu-item {
    min-block-size: 44px;
  }
}
.actions-sep {
  inline-size: 1px;
  block-size: 18px;
  margin-inline: 6px;
  background: var(--line-strong);
}

/* ------------------------------------------------------------ the receipt (signature) */
.receipt-fold {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  justify-items: start;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.receipt-fold > div {
  justify-self: stretch;
}
.receipt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 28px;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin-inline-start: -6px;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.receipt-chip > .icon,
.receipt-chip > .tag {
  flex: none;
}
.receipt-chip .icon:first-child {
  color: var(--eco);
}
.receipt-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receipt-chip .chev {
  transition: transform 0.15s;
}
.receipt-chip[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}
.receipt-chip:hover {
  background: var(--surface);
  color: var(--ink-2);
}
.receipt-chip .icon {
  inline-size: 14px;
  block-size: 14px;
}
.receipt-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  .receipt-chip {
    min-block-size: 44px;
  }
}
.receipt {
  position: relative;
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 4px 4px var(--radius) var(--radius);
  background: var(--surface);
}
.receipt::before {
  content: "";
  position: absolute;
  inset-inline: 10px;
  inset-block-start: -1px;
  border-block-start: 2px dashed var(--bg);
}
.receipt-main {
  display: flex;
  gap: 14px;
}
.receipt-mark {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--eco-soft);
  color: var(--eco);
}
.figs {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px 28px;
  min-inline-size: 0;
}
.fig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  align-content: start;
}
.fig-value {
  font: 600 1.18rem/1.3 var(--sans);
  letter-spacing: -0.01em;
}
.fig-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.fig-sub {
  flex-basis: 100%;
  font-size: 0.76rem;
  color: var(--muted);
}
.fig-none .fig-value {
  font-size: 0.95rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-2);
}
.receipt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-block-start: 10px;
  padding-block-start: 8px;
  border-block-start: 1px dashed var(--line-strong);
  font: 0.76rem/1.6 var(--mono);
  color: var(--muted);
}
.receipt-chips span:not(:last-child)::after {
  content: "·";
  margin-inline: 0.6em;
  color: var(--line-strong);
}
.receipt-detail > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 6px;
  padding-block: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  border-radius: 6px;
}
.receipt-detail > summary:hover {
  color: var(--ink);
}
.receipt-more {
  margin-block: 8px 4px;
  font-size: 0.84rem;
}
.meter-table {
  inline-size: 100%;
  margin-block-start: 8px;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.meter-table th,
.meter-table td {
  padding: 8px 10px 8px 0;
  border-block-start: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}
.meter-table th {
  inline-size: 9.5rem;
  font-weight: 550;
  color: var(--ink-2);
}
.meter-value {
  inline-size: 13rem;
}
.meter-value .num {
  font-weight: 600;
  margin-inline-end: 8px;
}
.kind-unavailable .meter-value .num {
  font-weight: 400;
  font-style: italic;
  color: var(--ink-2);
}
.meter-why {
  color: var(--muted);
  line-height: 1.45;
}

/* ------------------------------------------------------------ composer */
.dock {
  position: relative;
  background: var(--bg);
}
.dock-inner {
  padding: 0 0 calc(8px + var(--safe-b));
  overflow-y: auto; /* same scrollbar gutter as the conversation above, so both columns line up */
  scrollbar-gutter: stable;
}
/* « Aller à la fin »: a small round arrow at the end edge of the column (its words in the title and for screen
   readers), opaque, so it never sits on the middle of an answer; the conversation keeps room for it below (TURN-10) */
.btn-jump {
  position: absolute;
  inset-block-end: calc(100% + 10px);
  inset-inline-end: max(12px, calc((100% - var(--col)) / 2 - 12px));
  inline-size: 32px;
  min-block-size: 32px;
  padding: 0;
  justify-content: center;
  border-color: var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 4;
}
/* a phone: the arrow sits at the end side, so it never covers a card's « Ouvrir » or its download */
@media (max-width: 640px) {
  .btn-jump {
    inset-inline-start: auto;
    inset-inline-end: calc(16px + var(--safe-r));
    transform: none;
  }
}
.composer {
  border: 1px solid var(--control-line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.composer:focus-within {
  border-color: var(--accent);
}
.composer.is-waiting {
  opacity: 0.55; /* a question is edited in place above: this box waits (inert) */
}
.composer textarea {
  display: block;
  inline-size: 100%;
  min-block-size: 44px;
  max-block-size: min(240px, 28dvh);
  padding: 12px 18px 2px;
  border: 0;
  background: none;
  resize: none;
  line-height: 1.5;
  outline: none;
}
.composer textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 8px;
}
.editing {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 0;
  font-size: 0.82rem;
  color: var(--warn-ink);
}
.attachments {
  padding: 12px 14px 0;
}
.att-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.84rem;
}
.att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.att-size {
  font-size: 0.74rem;
  color: var(--muted);
}
.att-remove {
  display: grid;
  place-items: center;
  inline-size: 26px;
  block-size: 26px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.att-remove:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.att-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
}
.switch-track {
  position: relative;
  inline-size: 34px;
  block-size: 20px;
  border-radius: 999px;
  background: var(--control-line);
  transition: background-color 0.15s;
}
.switch-thumb {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}
.switch[aria-checked="true"] {
  color: var(--ink);
}
.switch[aria-checked="true"] .switch-track {
  background: var(--accent);
}
.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(14px);
}
[dir="rtl"] .switch[aria-checked="true"] .switch-thumb {
  transform: translateX(-14px);
}
.thinking-hint {
  flex: 1;
  min-inline-size: 0;
  font-size: 0.8rem;
}
.composer-count {
  font-size: 0.74rem;
  color: var(--muted);
  text-align: end;
}
.composer-count.is-long {
  color: var(--warn-ink);
}
.btn-send {
  inline-size: 40px;
  padding: 0;
  flex: none;
  font-size: 1.05rem;
}
.btn-stop {
  flex: none;
  border-color: var(--line-strong);
  background: var(--surface);
}
.btn-stop:hover {
  border-color: var(--danger-ink);
  color: var(--danger-ink);
}
.dock-note {
  padding: 6px 6px 0;
  font-size: 0.74rem;
  text-align: center;
  color: var(--muted);
}
.dock-keys::before {
  content: " · ";
}
/* while typing on a narrow screen, the notes give their room to the conversation; keyed to the whole dock (tapping
   Send does not bring them back mid-tap) and set in app.js (trackTyping), not :focus-within, so a tap in the
   conversation does not bring them back mid-tap either: the dock would grow and the click land on it */
@media (max-width: 640px) {
  .dock.is-typing .dock-note,
  .dock.is-typing .att-note {
    display: none;
  }
  /* a long message shows its count: the switch keeps its accessible name, the visible label steps aside */
  .composer-row:has(.composer-count:not([hidden])) .switch-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .composer-count {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: end;
  }
  .composer-count[hidden] {
    display: none;
  }
}
/* very short visible height (keyboard open in landscape, or a small phone): a slimmer header */
@media (max-height: 480px) {
  .top {
    min-block-size: 46px;
    padding-block: 3px;
  }
  .composer-row {
    padding-block: 2px 4px;
  }
  .dock-inner {
    padding-block-end: calc(4px + var(--safe-b));
  }
  /* the hints give their room to the conversation (a landscape phone kept 130 px of it, 0 with the keyboard) */
  .thinking-hint,
  .dock-note {
    display: none;
  }
}
/* keyboard up on a landscape phone (about 160 px left): no header, and the message box sits beside its buttons, so
   the running team (its chip and current lane) stays in view while typing */
@media (max-height: 300px) {
  .top {
    display: none;
  }
}
@media (max-height: 300px) and (min-width: 560px) {
  .composer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .composer > * {
    flex: 1 1 100%;
  }
  .composer > textarea {
    flex: 1 1 12rem;
    inline-size: auto;
    min-inline-size: 0;
  }
  .composer > .composer-row {
    flex: none;
  }
}
.slash {
  margin-block-end: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.slash .eyebrow {
  padding: 0 6px 6px;
}
.slash li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;
}
.slash li.is-active,
.slash li:hover {
  background: var(--surface-2);
}
.slash .chip-icon {
  inline-size: 30px;
  block-size: 30px;
}
.slash-name {
  font: 0.84rem var(--mono);
  color: var(--muted);
  min-inline-size: 4.2rem;
}
.slash-title {
  font-weight: 600;
  font-size: 0.92rem;
}
.slash-hint {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ pages (footprint, settings, about) */
.column-page {
  max-inline-size: calc(42rem + 2 * var(--gutter));
}
.page-title {
  font: 500 clamp(1.7rem, 5vw, 2.2rem) / 1.15 var(--serif);
  letter-spacing: -0.015em;
  outline: none;
}
.page-lead {
  margin-block-start: 6px;
  color: var(--ink-2);
}
.page-body {
  display: grid;
  gap: 16px;
  margin-block-start: 22px;
  justify-items: stretch;
}
.page-body > .btn {
  justify-self: start;
}
.panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel h3:not(.eyebrow) {
  font: 600 1.12rem/1.3 var(--serif);
}
.panel-accent {
  border-color: transparent;
  background: var(--eco-soft);
}
.panel-empty {
  color: var(--ink-2);
}
.segs {
  display: inline-flex;
  justify-self: start;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.seg {
  min-block-size: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
}
.seg.is-on {
  background: var(--primary);
  color: var(--primary-ink);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.stat {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
}
.stat-hero {
  grid-column: 1 / -1;
  padding-block: 16px;
}
.stat-wide {
  grid-column: span 2;
}
.stat dt {
  font-size: 0.8rem;
  color: var(--muted);
}
.stat dd {
  display: grid;
  gap: 1px;
}
.stat-value {
  font: 600 1.25rem/1.25 var(--sans);
  letter-spacing: -0.01em;
}
.stat-hero .stat-value {
  font: 500 2.6rem/1.1 var(--serif);
  letter-spacing: -0.02em;
}
.stat-none .stat-value {
  font-size: 0.98rem;
  font-weight: 550;
  font-style: italic;
}
.stat-sub {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.chart-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 3px;
}
.swatch-in,
.series-in {
  background: var(--series-in);
  fill: var(--series-in);
}
.swatch-out,
.series-out {
  background: var(--series-out);
  fill: var(--series-out);
}
.swatch-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.chart-dot {
  fill: var(--ink);
}
.chart-scroll {
  overflow-x: auto;
  padding: 2px;
}
.chart {
  display: block;
}
.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chart-scale {
  fill: var(--muted);
  font: 0.7rem var(--sans);
}
.chart-hit {
  fill: transparent;
}
.chart-bar {
  outline: none;
}
.chart-bar:hover .chart-hit,
.chart-bar:focus-visible .chart-hit {
  fill: var(--surface-2);
}
.chart-bar:focus-visible .chart-hit {
  stroke: var(--accent);
  stroke-width: 1.5;
}
.chart-readout {
  min-block-size: 1.5em;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.chart-table > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
  border-radius: 6px;
}
.chart-table table {
  inline-size: 100%;
  margin-block-start: 8px;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.chart-table th,
.chart-table td {
  padding: 5px 8px;
  border-block-end: 1px solid var(--line);
  text-align: end;
  font-weight: 400;
}
.chart-table thead th {
  color: var(--muted);
  font-size: 0.76rem;
}
.chart-table th:first-child {
  text-align: start;
}
.split-title {
  margin-block-start: 4px;
  font-size: 0.86rem;
  font-weight: 600;
}
.split-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}
.split-label {
  color: var(--ink-2);
}
.split-bar {
  block-size: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.split-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: var(--series-out);
}
.split-value {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.how {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.how li {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.how .tag {
  justify-self: start;
}

/* settings */
.field {
  display: grid;
  gap: 5px;
}
.field label,
.check-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0 12px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--bg);
}
.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--accent);
}
.input-row {
  display: flex;
  gap: 8px;
}
.input-row .btn {
  min-block-size: 42px;
  border-radius: 10px;
}
.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mode {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.mode.is-on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--surface);
}
.mode.is-off {
  color: var(--muted);
  border-style: dashed;
  cursor: not-allowed;
}
.mode input {
  inline-size: 18px;
  block-size: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.mode-text {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}
.mode-title {
  font-weight: 600;
}
.mode-hint {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.endpoint {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.endpoint:disabled {
  color: var(--muted);
}
.tradeoff {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.tradeoff .icon {
  margin-block-start: 3px;
}
.test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.test-result {
  display: flex;
  flex: 1;
  gap: 8px;
  min-inline-size: 12rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.test-result .icon {
  margin-block-start: 3px;
}
.test-result.is-ok {
  color: var(--link);
}
.test-result.is-bad {
  color: var(--danger-ink);
}
.check {
  display: flex;
  gap: 10px;
  cursor: pointer;
}
.check input {
  inline-size: 18px;
  block-size: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.check > span {
  display: grid;
  gap: 2px;
}
.data-list {
  display: grid;
  gap: 8px;
}
.data-list li {
  display: flex;
  gap: 10px;
}
.data-list .icon {
  margin-block-start: 4px;
  color: var(--link);
}

/* ------------------------------------------------------------ dialogs and toasts */
dialog {
  color: var(--ink);
}
dialog::backdrop {
  background: var(--backdrop);
}
.modal {
  inline-size: min(30rem, calc(100vw - 24px));
  max-block-size: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.modal[open] {
  animation: rise 0.2s ease-out;
}
.modal-body {
  display: grid;
  gap: 14px;
  padding: 24px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal h2 {
  font: 600 1.45rem/1.2 var(--serif);
  letter-spacing: -0.01em;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-block-start: 4px;
}
/* the shortcuts dialog's list only: a bare .keys once also matched the dock hint and broke it over lines */
#shortcuts-body .keys {
  display: grid;
  gap: 2px;
}
#shortcuts-body .keys > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-block-end: 1px solid var(--line);
  font-size: 0.92rem;
}
#shortcuts-body .keys dt {
  display: flex;
  gap: 4px;
  order: 2;
}
kbd {
  min-inline-size: 1.9em;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-block-end-width: 2px;
  border-radius: 6px;
  background: var(--bg);
  font: 0.78rem var(--mono);
  text-align: center;
}
.toasts {
  position: fixed;
  inset-block-start: 66px;
  inset-inline: 0;
  z-index: 70;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast.has-action {
  pointer-events: auto;
  padding-inline-end: 6px;
}
.toast-action {
  min-block-size: 36px;
  margin-inline-start: 4px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  color: var(--bg);
  font: 700 0.86rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.toast-action:focus-visible {
  outline: 2px solid var(--bg);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  .toast-action {
    min-block-size: 44px;
  }
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-inline-size: min(28rem, calc(100vw - 32px));
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s ease-out;
  transition: opacity 0.2s;
}
.toast-error {
  border-radius: 14px;
}
.toast-out {
  opacity: 0;
}

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .side,
  .side-closed .side,
  html[data-side="closed"] body:not(.side-open) .side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 40;
    inline-size: min(20rem, 86vw);
    margin-inline-start: 0;
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition:
      transform 0.22s ease,
      visibility 0s linear 0.22s;
  }
  [dir="rtl"] .side {
    transform: translateX(102%);
  }
  .side-open .side {
    transform: none;
    visibility: visible;
    transition:
      transform 0.22s ease,
      visibility 0s;
  }
  .side-close {
    display: inline-flex;
  }
  .conv-more {
    opacity: 1;
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
  .view {
    padding-block: 18px 20px;
  }
  .examples,
  .sheet-grid,
  .modes {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-wide {
    grid-column: 1 / -1;
  }
  /* phone top bar: menu, title, then two plain icons like the pencil. The model chip (a bare dot on a phone,
     it only opened Settings, which the menu already has) is left out; the footprint is a quiet leaf. */
  #btn-model {
    display: none;
  }
  #btn-model.is-local {
    display: inline-flex; /* on the user's own machine: the calm badge says so (docs/LOCAL.md) */
  }
  #footprint-total {
    display: none;
  }
  #btn-footprint {
    inline-size: 40px;
    padding: 0;
    border-color: transparent;
    background: none;
  }
  .dock-note .dock-keys {
    display: none;
  }
  .thinking-hint {
    display: none;
  }
  .composer-row {
    justify-content: flex-start;
  }
  .composer-count {
    flex: 1;
  }
  .btn-send,
  .btn-stop {
    margin-inline-start: auto;
  }
  .composer-count + .sr-only + .btn-stop,
  .composer-count:not([hidden]) ~ .btn-send {
    margin-inline-start: 0;
  }
  .bubble-edit {
    opacity: 1;
  }
  .sheet-actions {
    flex-wrap: wrap;
  }
  .sheet-actions .btn {
    flex: 1;
  }
  .sheet-actions [data-confirm-refine] {
    order: 3;
    flex-basis: 100%;
  }
  .step-body {
    margin-inline-start: 12px;
  }
  .split-row {
    grid-template-columns: 7rem minmax(0, 1fr);
  }
  .split-value {
    grid-column: 1 / -1;
  }
  .how li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .meter-table,
  .meter-table tbody,
  .meter-table tr,
  .meter-table th,
  .meter-table td {
    display: block;
    inline-size: auto;
  }
  .meter-table tr {
    padding-block: 8px;
    border-block-start: 1px solid var(--line);
  }
  .meter-table th,
  .meter-table td {
    padding: 0;
    border: 0;
  }
  .meter-table th {
    font-size: 0.78rem;
    color: var(--muted);
  }
  .modal-actions .btn {
    flex: 1;
  }
}
@media (min-width: 641px) {
  .thinking-hint + .composer-count:not([hidden]) {
    margin-inline-start: auto;
  }
}

@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;
  }
  .md.streaming > :last-child::after {
    animation: none;
  }
}
@media (forced-colors: active) {
  .switch-track,
  .step-icon,
  .chip,
  .composer,
  .receipt {
    border: 1px solid CanvasText;
  }
  .series-in {
    fill: GrayText;
  }
  .series-out,
  .split-fill {
    fill: Highlight;
    background: Highlight;
  }
}

/* ------------------------------------------------------------ print: the conversation only */
@media print {
  body {
    overflow: visible;
    block-size: auto;
    background: #fff;
    color: #000;
  }
  .side,
  .backdrop,
  .top,
  .dock,
  .toasts,
  .actions-row,
  .bubble-edit,
  .skip,
  #empty,
  .receipt-detail,
  dialog {
    display: none !important;
  }
  .app,
  .main,
  .scroll {
    display: block;
    block-size: auto;
    overflow: visible;
  }
  .view {
    padding: 0;
  }
  .column {
    max-inline-size: none;
    padding: 0;
  }
  .turn,
  .card,
  .receipt,
  .steps {
    break-inside: avoid;
  }
  details.steps > .timeline,
  details.card-preview > * {
    display: block;
  }
  a {
    color: inherit;
  }
  .conversation::after {
    content: "Bird";
    display: block;
    margin-block-start: 24px;
    font: 0.8rem var(--serif);
    color: #555;
  }
}

/* brand lockups */
.lockup {
  display: block;
  block-size: 132px;
  inline-size: auto;
}
.only-dark {
  display: none;
}
:root[data-theme="dark"] .only-dark {
  display: block;
}
:root[data-theme="dark"] .only-light {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark {
    display: block;
  }
  :root:not([data-theme="light"]) .only-light {
    display: none;
  }
}
.about-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}
.about-brand .lockup {
  block-size: 112px;
}

/* ============================================================ attachments: composer tray, cards, drop zone */
.composer {
  position: relative;
}
.att-tray {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 10px 4px 2px; /* room for the remove buttons that sit on the card corners */
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.att-in {
  flex: none;
  scroll-snap-align: start;
}
.att-new {
  animation: att-in 0.22s ease-out;
}
@keyframes att-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}
.att-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
  max-inline-size: 17rem;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  text-align: start;
  position: relative;
}
.att-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.att-card {
  cursor: zoom-in;
}
.att-card.is-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}
.att-badge {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 40px;
  block-size: 46px;
  border-radius: 8px 14px 8px 8px;
  background: var(--k, var(--muted));
  color: #fff;
  font: 700 0.66rem/1 var(--sans);
  letter-spacing: 0.04em;
}
.k-pdf {
  --k: #b4372b;
}
.k-word {
  --k: #2b5cb8;
}
.k-excel {
  --k: #1d7a49;
}
.k-ppt {
  --k: #c4561d;
}
.k-sheet {
  --k: #1d7a49;
}
.k-text {
  --k: #586078;
}
.k-image {
  --k: #6b4fb3;
}
.att-meta {
  display: grid;
  min-inline-size: 0;
  gap: 2px;
}
.att-card .att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
}
.att-sub {
  min-inline-size: 0;
  font-size: 0.74rem;
  color: var(--muted);
}
.att-sub .att-status {
  display: inline-block; /* wraps under the size on narrow cards instead of running out of the card */
}
.att-status {
  margin-inline-start: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.att-status::before {
  content: "· ";
}
.st-ok {
  color: var(--eco);
}
.st-busy {
  color: var(--accent);
}
.st-err {
  color: var(--danger-ink);
  white-space: normal;
}
/* phones: the tray wraps instead of scrolling sideways, and errors come first, in full */
@media (max-width: 640px) {
  .att-tray {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .att-in {
    flex: 0 1 auto;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
  .att-in:has(.is-error) {
    order: -1;
    flex-basis: 100%;
  }
  .att-in .att-wrap {
    max-inline-size: 100%;
  }
  .att-card.is-error {
    max-inline-size: 100%;
  }
  .att-card.is-error .att-meta {
    flex: 1;
  }
  .att-card.is-error .att-sub {
    display: flex;
    flex-wrap: wrap;
  }
  .att-card.is-error .st-err {
    flex-basis: 100%;
    margin-inline-start: 0;
    padding-inline: 0;
  }
  .att-card.is-error .st-err::before {
    content: none;
  }
}
/* keyboard open (little height left): one scrolling row again, so the conversation keeps its room */
@media (max-width: 640px) and (max-height: 520px) {
  .att-tray {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .att-in,
  .att-in:has(.is-error) {
    flex: none;
  }
}
.att-thumb {
  flex: none;
  inline-size: 64px;
  block-size: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}
.att-ghost {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
}
.att-ghost .icon {
  inline-size: 26px;
  block-size: 26px;
}
.att-wrap {
  position: relative;
}
.att-x {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 28px;
  block-size: 28px;
  margin-inline-start: auto;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.att-wrap > .att-x {
  position: absolute;
  inset-block-start: -8px;
  inset-inline-end: -8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.att-x:hover,
.att-x:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
}
.att-excerpt {
  flex-basis: 100%;
  font-size: 0.8rem;
}
.att-excerpt summary {
  cursor: pointer;
  color: var(--link);
}
.att-excerpt pre {
  max-block-size: 14rem;
  overflow: auto;
  margin-block-start: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  white-space: pre-wrap;
  font: 0.76rem/1.45 var(--mono);
}
.att-card.is-compact {
  flex-wrap: wrap;
  padding: 5px 8px 5px 5px;
  background: var(--surface);
}
.att-card.is-compact .att-badge {
  inline-size: 32px;
  block-size: 38px;
}
.drop-hint {
  display: none;
}
.composer.is-drop {
  border-color: var(--accent);
  border-style: dashed;
  background: var(--accent-soft);
}
.composer.is-drop .drop-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-soft) 92%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.btn-photo {
  display: none;
}
#btn-attach,
#btn-photo {
  position: relative;
}
#btn-attach[data-count]:not([data-count=""])::after,
#btn-photo[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 0;
  min-inline-size: 17px;
  block-size: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 0.66rem/17px var(--sans);
  text-align: center;
}
.photo-menu {
  /* a bottom sheet in the thumb zone. Fixed, because the dock scrolls (overflow) and would clip a popover:
     the first version was hidden behind the conversation and a tap went to the example below it */
  position: fixed;
  inset-inline: max(12px, var(--safe-l));
  inset-block-end: calc(12px + var(--safe-b));
  z-index: 60;
  display: grid;
  gap: 2px;
  max-inline-size: 26rem;
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 -8px 40px rgb(11 27 63 / 0.28);
  animation: rise 0.16s ease-out;
}
.notice-details {
  margin-block-start: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.notice-details summary {
  cursor: pointer;
}
.notice-details pre {
  margin-block-start: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.76rem/1.4 var(--mono);
}
.notice-steps {
  font-size: 0.86rem;
  color: var(--muted);
}
.photo-scrim {
  position: fixed;
  inset: 0;
  z-index: 59; /* just under the sheet: a tap outside closes it and goes nowhere else */
  background: var(--backdrop);
}
.photo-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: 550 0.96rem var(--sans);
  text-align: start;
  cursor: pointer;
}
.photo-opt:hover,
.photo-opt:focus-visible {
  background: var(--surface-2);
}
.photo-opt .icon {
  inline-size: 22px;
  block-size: 22px;
  color: var(--accent);
}
.photo-note {
  padding: 6px 12px 8px;
  font-size: 0.76rem;
  color: var(--muted);
}
@media (max-width: 900px), (pointer: coarse) {
  .btn-photo {
    display: inline-grid;
  }
  .composer-row .btn-icon {
    min-inline-size: 44px;
    min-block-size: 44px;
  }
}

/* sent message: gallery and document cards */
.bubble-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-block-end: 8px;
}
.bubble-gallery .att-card {
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: none;
}
.bubble-gallery .att-thumb {
  inline-size: 112px;
  block-size: 112px;
  border-radius: 12px;
}
.bubble-gallery .att-ghost {
  inline-size: auto;
  min-inline-size: 112px;
  block-size: 64px;
  padding: 0 12px;
  gap: 6px;
  display: flex;
  align-items: center;
  font-size: 0.78rem;
}
.bubble .bubble-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-start: 10px;
}

/* lightbox */
.lightbox {
  inline-size: 100vw;
  block-size: 100dvh;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(6 10 20 / 0.92);
  color: #fff;
}
.lightbox::backdrop {
  background: transparent;
}
.lightbox-fig {
  display: grid;
  place-items: center;
  gap: 10px;
  block-size: 100%;
  padding: 56px 16px 24px;
}
.lightbox-fig img {
  max-inline-size: 100%;
  max-block-size: calc(100dvh - 120px);
  border-radius: 8px;
  background: #fff;
}
.lightbox-fig figcaption {
  font-size: 0.86rem;
  opacity: 0.85;
}
.lightbox .btn-icon {
  position: absolute;
  color: #fff;
  background: rgb(255 255 255 / 0.12);
  min-inline-size: 44px;
  min-block-size: 44px;
}
.lightbox-close {
  inset-block-start: 12px;
  inset-inline-end: 12px;
}
.lb-prev,
.lb-next {
  inset-block-start: 50%;
}
.lb-prev {
  inset-inline-start: 12px;
}
.lb-next {
  inset-inline-end: 12px;
}

/* "D'après : facture.pdf" */
.based-on {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.based-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 6px;
  border: 1px solid var(--line-strong);
  border-inline-start: 3px solid var(--k, var(--muted));
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: 550 0.8rem var(--sans);
  cursor: pointer;
}
.conv-att {
  display: inline-grid;
  place-items: center;
  margin-inline-start: auto;
  color: var(--muted);
}
.conv-att .icon {
  inline-size: 14px;
  block-size: 14px;
}
.conv-open {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================ steps, live line, retry, export */
.badge-src {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.step-repairs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--eco);
}
.notice-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.notice-warn .btn-outline {
  color: var(--ink);
}
.live-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.live-time {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.btn-export {
  min-inline-size: 0;
  padding-inline: 8px;
  font: 650 0.76rem var(--sans);
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.btn-export .icon {
  color: #2b5cb8;
}

/* slides as a strip of rendered cards (same outline as the .pptx) */
.slide-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  counter-reset: none;
}
.slide {
  position: relative;
  flex: none;
  inline-size: 15.5rem;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #121a2e;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.slide::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  block-size: 4px;
  background: #0b1b3f;
}
.slide-inner {
  display: grid;
  align-content: start;
  gap: 6px;
  block-size: 100%;
  padding: 12px 14px 18px;
}
.slide-title {
  font: 700 0.8rem/1.2 var(--sans);
  color: #0b1b3f;
}
.slide-title::after {
  content: "";
  display: block;
  inline-size: 18px;
  block-size: 2px;
  margin-block-start: 5px;
  background: #1e5bd8;
}
.slide ul {
  display: grid;
  gap: 2px;
  font-size: 0.62rem;
  line-height: 1.3;
}
.slide li {
  position: relative;
  padding-inline-start: 9px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.slide li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 0;
  color: #1e5bd8;
}
.slide li.sub {
  margin-inline-start: 9px;
  color: #39435c;
}
.slide li.sub::before {
  content: "–";
  color: #586078;
}
.slide li.more {
  color: #586078;
  font-style: italic;
}
.slide li.more::before {
  content: "";
}
.slide-num {
  position: absolute;
  inset-block-end: 5px;
  inset-inline-end: 8px;
  font-size: 0.56rem;
  color: #586078;
}
.slide-cover {
  background: #0b1b3f;
  color: #fff;
}
.slide-cover .slide-inner {
  align-content: center;
}
.slide-cover .slide-title {
  color: #fff;
  font-size: 0.98rem;
}
.slide-cover .slide-sub {
  font-size: 0.64rem;
  color: #c9d3ea;
}
.slide-cover .slide-num {
  color: #c9d3ea;
}
.slide-section {
  background: #e2e9f8;
  border-inline-start: 6px solid #1e5bd8;
}
.slide-section .slide-inner {
  align-content: center;
}
.slide-section .slide-title {
  font-size: 0.95rem;
}
.doc-page {
  max-block-size: 22rem;
  overflow: auto;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #121a2e;
  box-shadow: var(--shadow);
}
.doc-title {
  font: 700 1.1rem/1.2 var(--sans);
  color: #0b1b3f;
}
.doc-h {
  margin-block: 12px 4px;
  font: 700 0.9rem var(--sans);
  color: #0b1b3f;
}
.md-small {
  font-size: 0.82rem;
  color: #121a2e;
}
.md-small table {
  font-size: 0.78rem;
}
/* Carlito (SIL OFL, fonts/OFL.txt): Calibri's metric twin, served from this site so a slide, a page or a sheet
   breaks its lines where the file does on every device, with or without Office installed */
@font-face {
  font-family: Carlito;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Carlito"), local("Carlito-Regular"), url("fonts/carlito-regular.woff2") format("woff2");
}
@font-face {
  font-family: Carlito;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Carlito Bold"), local("Carlito-Bold"), url("fonts/carlito-bold.woff2") format("woff2");
}
/* Previews drawn from the written file. The slide, the page and the sheet keep the file's own colours (white,
   navy, blue) in both themes: they are the document; only the frame around them follows the theme. */
.file-card.file-slides .card-preview > :not(summary),
.file-card.file-document .card-preview > :not(summary) {
  margin: 0 10px 12px;
}
/* a deck gets the room of a real slide: up to 860 px, wider than the text column when the window allows */
/* ...and no taller than the window: header, stage, controls and filmstrip fit between the top bar and the
   composer (about 270 px of chrome around the stage, plus the bars of the page) */
.file-card.file-slides {
  --deck-w: min(860px, max(20rem, (100dvh - 470px) * 16 / 9));
}
/* a phone in portrait keeps the full column width: the slide is small enough there */
@media (max-width: 640px) and (orientation: portrait) {
  .file-card.file-slides {
    --deck-w: 100%;
  }
}
@media (min-width: 1180px) {
  .file-card.file-slides {
    margin-inline: min(0px, calc((100% - var(--deck-w) - 20px) / 2));
  }
}
.deck {
  display: grid;
  gap: 8px;
}
.file-card .deck {
  inline-size: min(100%, var(--deck-w));
  margin-inline: auto;
}
.deck-stage {
  border-radius: 6px;
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow);
  overflow: hidden;
}
.deck-stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.slide-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: #fff;
  overflow: hidden;
}
.slide-canvas {
  --px: calc(100cqw / 1280);
  --pt: calc(var(--px) * 1.3333);
  position: absolute;
  inset: 0;
  font-family: Carlito, Calibri, var(--sans);
  color: #121a2e;
  text-align: start;
  user-select: text;
}
.sh {
  position: absolute;
  display: flex;
  flex-direction: column;
}
.sh-o {
  border-radius: 50%;
}
.sh-am {
  justify-content: center;
}
.sh-ab {
  justify-content: flex-end;
}
.sh-p {
  margin: 0;
  font: inherit;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.sh-bu {
  display: inline-block;
  text-indent: 0;
  font-family: Arial, sans-serif;
}
.deck-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.deck-prev .icon {
  transform: scaleX(-1);
}
.deck-count {
  min-inline-size: 4.5em;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.deck-gap {
  flex: 1;
}
.deck-film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 3px 6px;
  scrollbar-width: thin;
}
.deck-film > li {
  flex: none;
}
.deck-thumb {
  position: relative;
  display: block;
  inline-size: 6rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
  cursor: pointer;
}
.deck-thumb:hover {
  box-shadow: 0 0 0 1px var(--line-strong);
}
.deck-thumb[aria-current="true"] {
  box-shadow: 0 0 0 2px var(--accent);
}
.deck-thumb .slide-canvas {
  pointer-events: none;
}
.deck-thumb-n {
  position: absolute;
  inset-block-end: 2px;
  inset-inline-start: 3px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgb(11 27 63 / 0.7);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1.4;
}
/* past the preview cap: an end card and a last filmstrip tile say how many slides the file still holds */
.deck-end {
  display: grid;
  place-items: center;
  background: #0b1b3f;
  color: #fff;
  text-align: center;
}
.deck-end-in {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
}
.deck-end .btn-primary {
  background: #fff;
  color: #0b1b3f;
}
.deck-end-n {
  font-size: 1.3rem;
  font-weight: 700;
}
.deck-thumb-more .slide-frame {
  display: grid;
  place-items: center;
  background: #0b1b3f;
}
.deck-more-n {
  padding: 4px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.2;
}
.a4-cut {
  margin-block-start: 1.5em;
  padding-block-start: 0.8em;
  border-block-start: 1px dashed #b8c0d0;
  color: #586078;
  font-style: italic;
}
.deck-dialog {
  inline-size: min(100vw - 32px, (100dvh - 190px) * 16 / 9, 1600px);
  max-inline-size: none;
  max-block-size: none;
  margin: auto;
  padding: 44px 16px 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.deck-dialog::backdrop {
  background: rgb(5 10 25 / 0.78);
}
.deck-close {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 8px;
}
.deck-stage {
  touch-action: pan-y pinch-zoom; /* swipe to change slide, pinch to read closer */
}
.deck-rotate {
  display: none;
}
/* phone or short window: the full-screen view takes the whole screen, edge to edge, on black; the slide is as
   wide as the screen allows (never smaller than in the chat) */
@media (max-width: 700px), (max-height: 500px) {
  .deck-dialog {
    position: fixed;
    inset: 0;
    inline-size: 100dvw;
    block-size: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: #000;
    color: #fff;
    box-shadow: none;
    overflow: hidden;
  }
  .deck-dialog::backdrop {
    background: #000;
  }
  .deck-dialog .btn {
    color: #fff;
  }
  .deck-dialog .btn:disabled {
    opacity: 0.35;
  }
  .deck-dialog .deck-count {
    color: rgb(255 255 255 / 0.8);
  }
  .deck-dialog .deck-full {
    block-size: 100%;
    align-content: center;
    gap: 4px;
  }
  .deck-dialog .deck-stage {
    justify-self: center;
    inline-size: min(100dvw, (100dvh - 132px) * 16 / 9);
    border-radius: 0;
    box-shadow: none;
  }
  .deck-dialog .deck-bar {
    padding-inline: 8px;
  }
  .deck-dialog .deck-film {
    display: none;
  }
  .deck-dialog .deck-close {
    z-index: 1;
    inset-block-start: max(6px, env(safe-area-inset-top));
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .deck-dialog .deck-rotate {
    display: block;
    position: absolute;
    inset: auto 16px max(20px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.85rem;
    color: rgb(255 255 255 / 0.7);
  }
}
/* landscape phone: the slide takes the full height, the controls stand in a column beside it */
@media (max-height: 500px) and (orientation: landscape) {
  .deck-dialog .deck-full {
    grid-template-columns: 1fr 56px;
    align-items: center;
    gap: 0;
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
  .deck-dialog .deck-stage {
    inline-size: min(100dvw - 56px - env(safe-area-inset-left) - env(safe-area-inset-right), 100dvh * 16 / 9);
  }
  .deck-dialog .deck-bar {
    flex-direction: column;
    padding: 56px 0 8px;
  }
  .deck-dialog .deck-count {
    min-inline-size: 0;
    font-size: 0.75rem;
  }
  .deck-dialog .deck-prev .icon {
    transform: scaleX(-1);
  }
}
@media (max-width: 640px) {
  .file-card.file-slides .card-preview > :not(summary) {
    margin-inline: 0;
  }
  .file-card.file-slides .deck-stage {
    border-radius: 0;
  }
  .file-card.file-slides .deck-bar,
  .file-card.file-slides .deck-film {
    padding-inline: 8px;
  }
  .deck-thumb {
    inline-size: 5.5rem;
  }
}

/* document: an A4 page (21 cm wide; 2.4 cm margins), sizes in points of that page */
.a4-wrap {
  position: relative;
  border-radius: 6px;
  background: var(--surface-2);
}
.a4-scroll {
  max-block-size: 34rem;
  overflow: auto;
  padding: 14px;
  container-type: inline-size;
}
.a4-wrap:not(.is-clipped) .a4-scroll {
  max-block-size: none;
}
.a4-wrap.is-clipped::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  block-size: 6rem;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(transparent, var(--surface-2) 85%);
  pointer-events: none;
}
.a4-more {
  position: absolute;
  z-index: 1;
  inset-block-end: 10px;
  inset-inline-start: 50%;
  translate: -50% 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.a4-wrap:not(.is-clipped) .a4-more,
.a4-wrap.is-clipped .a4-bar {
  display: none;
}
.file-card {
  overflow: clip; /* clips like hidden, but leaves the page as the scroller of the sticky bar below */
  min-inline-size: 0; /* not a scroll container any more: a wide sheet must not widen the card */
}
.a4-bar {
  position: sticky;
  z-index: 1;
  inset-block-end: 10px;
  display: flex;
  justify-content: flex-end; /* clear of the centred 'Go to the end' pill */
  gap: 8px;
  padding: 0 12px 10px;
  pointer-events: none;
}
.a4-bar > .btn {
  pointer-events: auto;
  box-shadow: var(--shadow);
}
.a4-bar > .btn-ghost {
  background: var(--surface);
}
.a4-less .icon {
  transform: rotate(180deg);
}
@media (max-width: 640px) {
  .a4-less {
    inline-size: 34px;
    padding: 0;
  }
  .a4-less .btn-label {
    display: none;
  }
}
.a4 {
  --cm: calc(min(100cqw, 794px) / 21);
  --pt: calc(var(--cm) * 2.54 / 72);
  max-inline-size: 794px;
  min-block-size: calc(var(--cm) * 18);
  margin-inline: auto;
  padding: max(18px, calc(var(--cm) * 2.6)) max(16px, calc(var(--cm) * 2.4))
    max(18px, calc(var(--cm) * 2.4));
  background: #fff;
  color: #121a2e;
  box-shadow:
    0 1px 3px rgb(11 27 63 / 0.12),
    0 10px 30px -12px rgb(11 27 63 / 0.3);
  font-family: Carlito, Calibri, var(--sans);
  font-size: max(12px, calc(var(--pt) * 10.5));
  line-height: 1.38;
  overflow-wrap: break-word;
}
.a4 > * {
  margin: 0 0 0.57em;
}
.a4 strong {
  font-weight: 700;
}
.a4 code {
  font: 0.9em var(--mono);
  background: var(--o-tint, #f4f6fb);
}
/* the 4.5 pt blue bar in the margin runs down the title and the subtitle, as one bar (lengths in body em) */
.a4-title {
  margin: 0 0 0 -0.556em;
  padding-inline-start: 0.383em;
  border-inline-start: 0.173em solid var(--o-blue, #1e5bd8);
  font-size: 2.48em;
  font-weight: 700;
  line-height: 1.1;
  color: var(--o-navy, #0b1b3f);
}
.a4-sub {
  margin: 0 0 2.6em -1.314em;
  padding: 0.35em 0 0 0.905em;
  border-inline-start: 0.41em solid var(--o-blue, #1e5bd8);
  color: #586078;
  font-size: 1.05em;
}
.a4-h1,
.a4-h2,
.a4-h3 {
  font-weight: 700;
  line-height: 1.15;
}
.a4-h1 {
  margin: 1.7em 0 0.55em;
  font-size: 1.43em;
  color: var(--o-navy, #0b1b3f);
}
.a4-h2 {
  margin: 1.3em 0 0.33em;
  font-size: 1.14em;
  color: var(--o-blue, #1e5bd8);
}
.a4-h3 {
  margin: 1.1em 0 0.2em;
  font-size: 1em;
}
.a4-list {
  padding: 0;
  list-style: none;
}
.a4-list > li {
  position: relative;
  margin-block-end: 0.27em;
  padding-inline-start: 1.71em;
}
.a4-list > li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 0.85em;
  font-family: Arial, sans-serif;
  color: var(--o-blue, #1e5bd8);
}
.a4-list > li.a4-l1 {
  margin-inline-start: 1.71em;
}
.a4-list > li.a4-l2 {
  margin-inline-start: 3.42em;
}
.a4-list > li.a4-l1::before,
.a4-list > li.a4-l2::before {
  content: "–";
  color: #586078;
}
ol.a4-list > li::before {
  content: attr(data-n);
  inset-inline-start: 0.5em;
  font-family: inherit;
  font-weight: 700;
  color: var(--o-navy, #0b1b3f);
}
.a4-callout + .a4-callout {
  margin-block-start: -0.57em; /* consecutive decisions form one tinted block, as in Word */
}
.a4-callout,
.a4-quote {
  margin: 0 0 0.57em;
  margin-inline-start: 1.35em;
  padding: 0.38em 0.76em;
  border-inline-start: 0.29em solid var(--o-blue, #1e5bd8);
  background: var(--o-tint, #f4f6fb);
}
.a4-decision {
  border-color: var(--o-pos, #5bd69b);
  background: #eefaf3;
}
.a4-quote {
  margin-block: 0.57em 0.95em;
}
.a4-code {
  margin-inline-start: 1.35em;
  padding: 0.5em 0.76em;
  border-inline-start: 0.29em solid #f3f4f6;
  background: #f3f4f6;
  font: 0.86em/1.3 var(--mono);
  white-space: pre-wrap;
}
.a4-rule {
  border: 0;
  border-block-end: 1px solid #d9dee8;
}
.a4-table-wrap {
  overflow-x: auto;
  margin-block-end: 0.76em;
}
.a4-table {
  inline-size: 100%;
  border-collapse: collapse;
  border-block-end: 1px solid var(--o-navy, #0b1b3f);
  font-size: 0.905em;
  line-height: 1.2;
}
.a4-table th,
.a4-table td {
  padding: 0.38em 0.6em;
  text-align: start;
  vertical-align: middle;
}
.a4-table th {
  background: var(--o-navy, #0b1b3f);
  color: #fff;
  font-weight: 700;
}
.a4-table td {
  border-block-start: 0.5px solid #d9dee8;
}
.a4-table .num {
  text-align: end;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.a4-table .is-zebra td {
  background: var(--o-tint, #f4f6fb);
}
.a4-table .is-total td {
  background: var(--o-soft, #e2e9f8);
  font-weight: 700;
}
.a4-hint {
  color: #586078;
  font-size: 0.86em;
}

/* sheet: the styled table of the .xlsx (navy header, zebra, figures right, totals) */
.xl-scroll {
  max-block-size: 26rem;
  overflow: auto;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line);
  background: #fff;
}
.xl-table {
  min-inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #121a2e;
  font-family: Carlito, Calibri, var(--sans);
  font-size: 0.84rem;
}
.xl-table th,
.xl-table td {
  padding: 0 0.7em;
  block-size: 1.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
  border-block-end: 1px solid #d9dee8;
}
.xl-table th {
  position: sticky;
  z-index: 1;
  inset-block-start: 0;
  block-size: 2.4rem;
  background: var(--o-navy, #0b1b3f);
  color: #fff;
  font-weight: 700;
  border: 0;
}
/* the first column (usually the identifier) stays in view when a wide sheet scrolls sideways */
.xl-table :is(th, td):first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
}
.xl-table th:first-child {
  z-index: 2;
}
.xl-table td:first-child {
  background: #fff;
}
.xl-scroll.is-x :is(th, td):first-child {
  box-shadow: 6px 0 6px -4px rgb(11 27 63 / 0.28);
}
.xl-table .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.xl-table .date {
  text-align: center;
}
.xl-table .is-zebra td {
  background: var(--o-tint, #f4f6fb);
}
.xl-table .is-total td {
  font-weight: 700;
}
.xl-table .is-total:not(.is-total + .is-total) td {
  border-block-start: 1px solid var(--o-navy, #0b1b3f);
}
.xl-table .is-grand td {
  background: #e2e9f8;
  color: #0b1b3f;
  font-weight: 700;
  border-block-start: 2px solid #0b1b3f;
  border-block-end-color: #0b1b3f;
}
.xl-table .is-gap td {
  text-align: center;
  color: #586078;
  background: #fff;
}

/* tools panel */
.tools-list {
  display: grid;
  gap: 8px;
}
.tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tool-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-inline-size: 0;
}
.tool-name {
  font-weight: 600;
}
.tool-why {
  font-size: 0.82rem;
  color: var(--muted);
}
.tool-off {
  color: var(--muted);
}
.tag-tool-on {
  border-color: var(--eco-soft);
  background: var(--eco-soft);
  color: var(--eco);
}
.tag-tool-attach {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* savings report */
.panel-save {
  display: grid;
  gap: 16px;
}
.save-head {
  font: 600 1.2rem/1.2 var(--serif);
}
.save-block {
  display: grid;
  gap: 8px;
}
.save-title {
  font-weight: 650;
}
.sbar {
  display: grid;
  grid-template-columns: minmax(8rem, 15rem) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
}
.sbar-track {
  block-size: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.sbar-fill {
  display: block;
  inline-size: var(--w, 0%);
  block-size: 100%;
  border-radius: inherit;
  background: var(--line-strong);
}
.sbar-bird .sbar-fill {
  background: var(--eco);
}
.sbar-bird .sbar-label {
  font-weight: 650;
  color: var(--eco);
}
.save-line {
  font-size: 0.92rem;
}
.save-candid {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.88rem;
  color: var(--ink-2);
}
.save-candid .icon {
  flex: none;
  margin-block-start: 2px;
}
.levers {
  display: grid;
  gap: 6px;
  padding-inline-start: 1.1rem;
  list-style: disc;
  font-size: 0.9rem;
}
@media (max-width: 640px) {
  .sbar {
    grid-template-columns: 1fr auto;
  }
  .sbar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .att-new,
  .photo-menu {
    animation: none;
  }
}

#btn-photo[aria-disabled="true"] {
  opacity: 0.45;
}
.about-intro {
  margin-block: 4px 0;
}
.stat .tag,
.fig .tag {
  justify-self: start;
  align-self: center;
  inline-size: max-content;
}
.mode-title .tag {
  margin-inline-start: 6px;
  vertical-align: 1px;
}
.mode.is-off .mode-hint {
  color: var(--muted);
}
.tools-panel > summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.tools-panel > summary::-webkit-details-marker {
  display: none;
}
.tools-panel > summary .chev {
  margin-block-start: 3px;
  transition: transform 0.15s;
}
.tools-panel[open] > summary .chev {
  transform: rotate(90deg);
}
.tools-sum {
  display: grid;
  gap: 2px;
}
.tools-sum-title {
  font-weight: 650;
}
.tools-panel[open] > summary {
  margin-block-end: 10px;
}

/* ============================================================ touch screens: 44 px targets, 16 px fields
   One block for the frequent controls (WCAG 2.5.5 / Apple HIG). Pointer: fine (mouse) layouts are untouched; the
   per-message receipt chip keeps its own size rule above. A 16 px field font stops iOS from zooming on focus. */
@media (pointer: coarse) {
  .btn-chip,
  .btn-small,
  .seg,
  .btn-icon,
  .btn-nav,
  .btn-new,
  .btn-send,
  .switch,
  .conv-open {
    min-block-size: 44px;
  }
  .btn-icon,
  .btn-send,
  .btn-chip {
    min-inline-size: 44px;
  }
  .btn-jump::before {
    content: ""; /* 32 px drawn, 44 px to the finger */
    position: absolute;
    inset: -6px;
  }
  .att-remove {
    position: relative;
  }
  .att-remove::before {
    content: "";
    position: absolute;
    inset: -9px; /* 26 px button, 44 px hit area */
  }
  #send-why,
  .side-clear,
  button.link {
    padding-block: 12px;
  }
  .side-search input,
  .rename {
    font-size: max(16px, 1rem);
  }
}
@container (max-width: 520px) {
  .a4-title {
    margin-inline-start: -0.746em;
    padding-inline-start: 0.514em;
    border-inline-start-width: 0.232em;
    font-size: 1.85em;
  }
  .a4-sub {
    margin-block-end: 1.6em;
  }
}
/* ================================================================== rich answer text (markdown.js, richcode.js) */
/* namespaced md-*, code-*, tk-*; tokens first, light then dark */
:root {
  --code-bg: #f7f6f1;
  --code-head: #efede6;
  --tk-kw: #1d4fbf;
  --tk-str: #0b6e52;
  --tk-num: #9a4f00;
  --tk-com: #5d6577;
  --tk-fn: #0b1b3f;
  --tk-var: #a3285b;
  --tk-prop: #1f4c86;
  --tk-attr: #85540a;
  --step-badge: #0b1b3f;
  --step-badge-ink: #ffffff;
  --pro-ink: #1f6b48;
  --con-ink: #a2321f;
  --best-bg: #e5edfb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --code-bg: #0c1424;
    --code-head: #121c31;
    --tk-kw: #94b8ff;
    --tk-str: #7fd3b0;
    --tk-num: #f2c46e;
    --tk-com: #8f9ab0;
    --tk-fn: #f2f5fb;
    --tk-var: #f59bc3;
    --tk-prop: #a9c8ff;
    --tk-attr: #e9bb73;
    --step-badge: #e9edf5;
    --step-badge-ink: #0b1220;
    --pro-ink: #8fd0a9;
    --con-ink: #f3a497;
    --best-bg: #1a2c52;
  }
}
:root[data-theme="dark"] {
  --code-bg: #0c1424;
  --code-head: #121c31;
  --tk-kw: #94b8ff;
  --tk-str: #7fd3b0;
  --tk-num: #f2c46e;
  --tk-com: #8f9ab0;
  --tk-fn: #f2f5fb;
  --tk-var: #f59bc3;
  --tk-prop: #a9c8ff;
  --tk-attr: #e9bb73;
  --step-badge: #e9edf5;
  --step-badge-ink: #0b1220;
  --pro-ink: #8fd0a9;
  --con-ink: #f3a497;
  --best-bg: #1a2c52;
}

/* rhythm: a heading sits closer to what it introduces than to what precedes it */
.md :is(h3, h4, h5) {
  text-wrap: balance;
  scroll-margin-block-start: 80px;
}
.md > :is(h3, h4, h5) + * {
  margin-block-start: 0.45em;
}
.md h4.md-ph {
  margin-block-start: 1.5em;
  font-size: 1.1rem;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.md > .md-ph:first-child {
  margin-block-start: 0;
}
/* "1. Prix" over a nested list: numbered sections with the same heading, the number kept but quiet */
.md-sections > .md-sec + .md-sec {
  margin-block-start: 0.2em;
}
.md > .md-sections:first-child > .md-sec:first-child > .md-ph {
  margin-block-start: 0;
}
.md .md-sec > .md-ph {
  margin-block-end: 0.35em;
}
.md .md-ph-n {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 500;
}
.md .md-sec > :is(ul, ol) {
  margin-block-start: 0;
}
.md hr {
  margin-block: 1.8em;
  border-block-start-color: var(--line);
}
.md sup.md-ord {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: 0.42em;
  margin-inline-start: 0.04em;
}
.md li::marker {
  font-size: 0.92em;
}
.md li > ul,
.md li > ol {
  margin-block-start: 0.3em;
}
.md ul.md-airy > li + li,
.md ol.md-airy > li + li {
  margin-block-start: 0.6em;
}
.md .md-li-k {
  font-weight: 620;
  color: var(--ink);
}
.md code.md-long {
  overflow-wrap: anywhere;
}
.md code.md-file {
  color: var(--ink);
  background: var(--accent-soft);
}

/* step lists: number badges joined by a thin line */
.md ol.md-steps {
  list-style: none;
  padding-inline-start: 0;
}
.md ol.md-steps > li {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 14px;
  padding-block-end: 0.35em;
}
.md ol.md-steps > li + li {
  margin-block-start: 0.55em;
}
.md ol.md-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: 12.5px;
  inset-block: 30px -0.5em;
  inline-size: 1px;
  background: var(--line-strong);
}
.md-step-n {
  display: grid;
  place-items: center;
  inline-size: 26px;
  block-size: 26px;
  margin-block-start: 0.12em;
  border-radius: 50%;
  background: var(--step-badge);
  color: var(--step-badge-ink);
  font: 650 0.78rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.md-step-c {
  min-inline-size: 0;
}
.md-step-t {
  display: block;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.45;
  margin-block-start: 0.15em;
}
.md-step-b {
  display: block;
  color: var(--ink-2);
}
.md-step-c > :is(ul, ol) {
  margin-block-start: 0.35em;
}

/* callouts: a tinted card with an icon; the model's own keyword is the label */
.md-callout {
  --co-bg: var(--surface-2);
  --co-line: var(--line);
  --co-ink: var(--ink-2);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 11px;
  padding: 12px 16px 12px 13px;
  border: 1px solid var(--co-line);
  border-radius: 12px;
  background: var(--co-bg);
}
.md-callout--warn {
  --co-bg: var(--warn-bg);
  --co-line: var(--warn-line);
  --co-ink: var(--warn-ink);
}
.md-callout--tip {
  --co-bg: var(--eco-soft);
  --co-line: color-mix(in srgb, var(--eco) 30%, transparent);
  --co-ink: var(--eco);
}
.md-callout--important,
.md-callout--key {
  --co-bg: var(--accent-soft);
  --co-line: color-mix(in srgb, var(--accent) 28%, transparent);
  --co-ink: var(--accent-strong);
}
.md-callout--decision {
  --co-bg: var(--surface);
  --co-line: var(--line-strong);
  --co-ink: var(--eco);
  box-shadow: var(--shadow);
}
.md-callout-ico {
  display: grid;
  place-items: start center;
  padding-block-start: 0.2em;
  color: var(--co-ink);
}
.md-callout-ico .icon {
  inline-size: 18px;
  block-size: 18px;
  stroke-width: 1.8;
}
.md-callout-body > * + * {
  margin-block-start: 0.5em;
}
.md-callout-label,
.md-callout-title {
  font-weight: 650;
  color: var(--co-ink);
}

/* label / value rows ("Décision : …", "Actions : …") */
.md dl.md-pairs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
}
.md-pairs > div {
  display: contents;
}
.md-pairs dt {
  padding-block-start: 0.28em;
  font: 650 0.72rem/1.5 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.md-pairs dd {
  margin: 0;
}
@media (max-width: 560px) {
  .md dl.md-pairs {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  .md-pairs dd + dt {
    margin-block-start: 8px;
  }
}

/* key numbers (text fallback; a structured widget replaces it, see options.suppress) */
.md figure.md-kpis {
  margin-inline: 0;
  margin-block-end: 0;
}
.md-kpis figcaption {
  margin-block-end: 8px;
  font: 650 0.74rem/1.4 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.md-kpis dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr));
  gap: 10px;
  margin: 0;
}
.md-kpi {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(18 26 46 / 0.04);
}
.md-kpi dt {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}
.md-kpi dd {
  margin: 0;
}
.md-kpi-v {
  font: 600 1.5rem/1.15 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  white-space: nowrap;
}
.md-kpi small {
  font-size: 0.78rem;
  color: var(--muted);
}
@media (max-width: 480px) {
  .md-kpis dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md-kpi-v {
    font-size: 1.3rem;
  }
  .md-kpi:last-child:nth-child(odd) {
    grid-column: span 2; /* no orphan tile */
  }
}

/* pros / cons in two columns */
.md-proscons {
  display: grid;
  gap: 10px;
}
@media (min-width: 640px) {
  .md-proscons {
    grid-template-columns: 1fr 1fr;
  }
}
.md-pc {
  padding: 12px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
/* one heading family in answers: the column titles read like the other in-answer headings, tinted by a mark */
.md .md-pc-t {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
}
.md .md-pc-t::before {
  content: var(--pc-mark);
  flex: none;
  inline-size: 1.1em;
  font: 700 1rem/1 var(--sans);
  text-align: center;
  color: var(--pc-ink);
}
.md-pc--pro {
  --pc-ink: var(--pro-ink);
  --pc-mark: "+";
}
.md-pc--con {
  --pc-ink: var(--con-ink);
  --pc-mark: "−";
}
.md .md-pc ul {
  list-style: none;
  padding-inline-start: 1.35em;
}
.md .md-pc ul > li {
  position: relative;
}
.md .md-pc ul > li::before {
  content: var(--pc-mark);
  position: absolute;
  inset-inline-start: -1.25em;
  inline-size: 1em;
  font-weight: 700;
  text-align: center;
  color: var(--pc-ink);
}

/* a formula alone on its line, quotes with a source */
.md .md-formula {
  display: block;
  margin-block: 0.55em;
  text-align: start; /* a formula on two lines must not read as two centred formulas */
}
.md .md-formula code {
  display: inline-block;
  max-inline-size: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  padding: 8px 14px 8px calc(14px + 1.5em);
  text-indent: -1.5em; /* a continuation line hangs under the first */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  font-size: 0.92em;
  white-space: normal;
}
.md .md-fseg {
  white-space: pre; /* pieces stay whole: the formula breaks only after an operator */
}
.md .md-formula-p {
  /* the sentence's "." after a formula: kept for copy and screen readers, not drawn alone under the box */
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.md figure.md-quote {
  position: relative;
  margin-inline: 0;
  margin-block-end: 0;
  padding-inline-start: 2.1em;
}
.md figure.md-quote::before {
  content: "“";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: -0.15em;
  font: 3rem/1 var(--serif);
  color: var(--line-strong);
}
.md .md-quote blockquote {
  padding: 0;
  border: 0;
  font: italic 1.05rem/1.6 var(--serif);
  color: var(--ink);
}
.md .md-quote figcaption {
  margin-block-start: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}
.md .md-quote cite {
  font-style: normal;
}
.md .md-quote figcaption::before {
  content: "— ";
}

/* long lists fold after 8 items */
.md-fold > :is(ul, ol) {
  margin: 0;
}
.md-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 8px;
  min-block-size: 32px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: 600 0.82rem var(--sans);
  cursor: pointer;
}
.md-more:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* inline formula chips with a copy button */
.md .md-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-inline-size: 100%;
  margin-block: 3px;
  padding: 1px 2px 1px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  vertical-align: middle;
}
.md .md-chip code {
  padding: 0;
  background: none;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.md-chip-copy {
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.md-chip-copy:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* tables: cells wrap, the first column stays in view, numbers align */
.md table.md-table {
  inline-size: 100%;
}
.md .md-table td {
  min-inline-size: 8ch;
}
.md .md-table--wide th,
.md .md-table--wide td {
  min-inline-size: 15ch;
  white-space: normal;
}
.md .md-table--wide th {
  white-space: normal;
}
.md .md-table :is(th, td):first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--surface);
}
.md .md-table--wide td:first-child {
  min-inline-size: 11ch;
  font-weight: 600;
  color: var(--ink);
  box-shadow: inset -1px 0 0 var(--line);
}
.md .md-table td.md-num,
.md .md-table th.md-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.md .md-table .md-best {
  background: var(--best-bg);
  font-weight: 600;
}
/* a wide table that scrolls: its right edge fades while columns hide beyond it (the first column stays put) */
.md .table-wrap.md-ovf-r {
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), rgb(0 0 0 / 0.15));
}
@media (max-width: 560px) {
  .md .md-table--wide th,
  .md .md-table--wide td {
    min-inline-size: 9rem; /* fewer, longer lines per cell: the table scrolls instead of stacking words */
    padding: 8px 10px;
  }
  .md .md-table--wide :is(th, td):first-child {
    min-inline-size: 7.5rem;
  }
  .md table.md-table--wide {
    font-size: 0.88rem;
  }
}

/* ------------------------------------------------------------------ code blocks */
.md figure.code-block {
  margin-inline: 0;
  margin-block-end: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
  overflow: clip;
}
.md .code-block .code-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  gap: 10px;
  min-block-size: 40px;
  padding: 4px 6px 4px 14px;
  border: 0;
  border-block-end: 1px solid var(--line);
  border-radius: 0;
  background: var(--code-head);
}
.code-lang {
  font: 650 0.7rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.code-file {
  min-inline-size: 0;
  overflow: hidden;
  font: 0.8rem var(--mono);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-lang + .code-file::before {
  content: "·";
  margin-inline-end: 10px;
  color: var(--line-strong);
}
.code-check {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font: 600 0.72rem/1.4 var(--sans);
  white-space: nowrap;
}
.code-check .icon {
  inline-size: 13px;
  block-size: 13px;
  stroke-width: 2.2;
}
.code-check--ok {
  background: var(--eco-soft);
  color: var(--eco);
}
.code-check--err {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.code-check--excerpt {
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.code-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-inline-start: auto;
}
.code-btn,
.md .code-block .code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font: 600 0.76rem var(--sans);
  cursor: pointer;
}
.code-btn .icon,
.code-block .code-copy .icon {
  inline-size: 15px;
  block-size: 15px;
}
.code-btn--icon {
  padding: 0 7px;
}
.code-btn:hover,
.md .code-block .code-copy:hover {
  background: var(--surface);
  color: var(--ink);
}
.code-btn:focus-visible,
.code-more:focus-visible,
.md-more:focus-visible,
.md-chip-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.code-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
@media (max-width: 560px) {
  .code-btn-t {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* one row for every block on phones: language, check mark, file name (ellipsed) on the left, icon tools on the
     right. The check sits right after the language it qualifies, as an icon chip (its words stay for screen
     readers and in the tooltip). */
  .md .code-block .code-head {
    flex-wrap: nowrap;
    padding-inline-start: 12px;
    gap: 6px;
  }
  .md .code-block .code-lang {
    order: 0;
    flex: none;
  }
  .md .code-block .code-check {
    order: 1;
  }
  .md .code-block .code-file {
    order: 2;
    flex: 0 1 auto;
  }
  .md .code-block .code-tools {
    order: 3;
  }
  .code-check:is(.code-check--ok, .code-check--err) {
    padding: 3px;
  }
  .code-check:is(.code-check--ok, .code-check--err) > span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (pointer: coarse) {
  .code-btn,
  .md .code-block .code-copy,
  .md-chip-copy,
  .md-more,
  .code-more {
    min-block-size: 44px;
    min-inline-size: 44px;
    justify-content: center;
  }
}
.md .code-block pre.code-pre {
  margin: 0;
  padding: 12px 16px 14px 0;
  border: 0;
  border-radius: 0;
  background: var(--code-bg);
  font: 0.85rem/1.6 var(--mono);
  tab-size: 4;
}
.md .code-block pre.code-pre code {
  font-size: inherit;
  line-height: inherit;
}
/* Every block has the same small gutter, numbered once it is long: the text never moves when numbers appear
   (while streaming, or between a short and a long block stacked one under another). */
.code-block {
  --ln-gut: 26px;
}
.code-block[data-long="3"] {
  --ln-gut: 34px;
}
.code-pre code {
  counter-reset: ln;
}
.code-pre .ln {
  position: relative;
  display: block;
  min-block-size: 1.6em;
  padding-inline-start: var(--ln-gut);
  counter-increment: ln;
}
.md-copying .code-pre .ln {
  display: inline;
  padding: 0;
}
.code-block[data-long] .code-pre .ln::before {
  content: counter(ln);
  position: absolute;
  inset-inline-start: 0;
  inline-size: calc(var(--ln-gut) - 8px);
  font-size: 0.74em;
  line-height: calc(1.6em / 0.74);
  text-align: end;
  color: color-mix(in srgb, var(--tk-com) 70%, transparent);
  font-variant-numeric: tabular-nums;
  font-style: normal;
}
.code-pre .ln--err {
  margin-inline-end: -16px;
  padding-inline-end: 16px;
  box-shadow: inset 3px 0 0 var(--warn-line);
  background: color-mix(in srgb, var(--warn-bg) 85%, transparent);
}
.code-block.is-wrapped pre.code-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code-block.is-wrapped .code-pre .ln {
  padding-inline-start: calc(var(--ln-gut) + 2ch); /* a wrapped line hangs, so the next real line still reads as new */
  text-indent: -2ch;
}
.code-btn:disabled {
  opacity: 0.4;
  cursor: default;
  background: none;
}
.code-block[data-collapsed] pre.code-pre {
  max-block-size: calc(18 * 1.6em + 12px);
  overflow-y: hidden;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
}
/* lines that go on beyond the edge: that edge fades (marked by richcode.js), so a phone never shows a cut line */
.code-pre {
  --fade-l: #000;
  --fade-r: #000;
  --fade-x: linear-gradient(to right, var(--fade-l), #000 24px, #000 calc(100% - 40px), var(--fade-r));
}
.code-pre.md-ovf-l {
  --fade-l: transparent;
}
.code-pre.md-ovf-r {
  --fade-r: transparent;
}
.md .code-block pre.code-pre:is(.md-ovf-l, .md-ovf-r) {
  mask-image: var(--fade-x);
}
.md .code-block[data-collapsed] pre.code-pre:is(.md-ovf-l, .md-ovf-r) {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent), var(--fade-x);
  mask-composite: intersect;
}
.code-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  inline-size: 100%;
  min-block-size: 38px;
  border: 0;
  border-block-start: 1px solid var(--line);
  background: var(--code-head);
  color: var(--ink-2);
  font: 600 0.8rem var(--sans);
  cursor: pointer;
}
.code-more:hover {
  color: var(--ink);
}
.code-more[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
.tk-kw {
  color: var(--tk-kw);
}
.tk-bi {
  color: var(--tk-kw);
  font-style: italic;
}
.tk-str {
  color: var(--tk-str);
}
.tk-num {
  color: var(--tk-num);
}
.tk-com {
  color: var(--tk-com);
  font-style: italic;
}
.tk-fn {
  color: var(--tk-fn);
  font-weight: 650;
}
.tk-var,
.tk-ref {
  color: var(--tk-var);
}
.tk-prop {
  color: var(--tk-prop);
}
.tk-attr {
  color: var(--tk-attr);
}
.tk-tag {
  color: var(--tk-kw);
}
.tk-op {
  color: var(--muted);
}
.md.streaming > figure.code-block:last-child::after {
  display: none;
}

/* the blocks that wait for the whole answer arrive with a short fade */
.md-kpis,
.md-proscons {
  animation: md-up 150ms ease-out;
}
@keyframes md-up {
  from {
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .md-kpis,
  .md-proscons {
    animation: none;
  }
}
@media print {
  .code-block[data-collapsed] pre.code-pre {
    max-block-size: none;
    mask-image: none;
  }
  .md-fold li[hidden] {
    display: list-item;
  }
  .code-tools,
  .code-more,
  .md-more,
  .md-chip-copy {
    display: none;
  }
}
/* widgets (birds/web/static/widgets.js): places + map, company, currency, weather, world clock, event */
.widgets {
  display: grid;
  gap: 14px;
  margin-block: 14px 4px;
}
.widget {
  display: grid;
  gap: 10px;
  min-inline-size: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.widget-title {
  margin: 0;
}
.widget-head-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin-block-start: -6px;
  font-size: 0.86rem;
}
.widget-link {
  display: inline; /* the external icon follows the last word when the label wraps */
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.widget-link .icon.ext,
.btn .icon.ext {
  inline-size: 0.9em;
  block-size: 0.9em;
}
.widget-link .icon.ext {
  display: inline-block;
  vertical-align: -0.1em;
  margin-inline-start: 0.25em;
}
.widget-source {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  padding-block-start: 8px;
  border-block-start: 1px solid var(--line);
}
.widget-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.widget .muted {
  color: var(--muted);
}

/* static map: one same-origin image, pins overlaid by the client (positions through CSSOM --x/--y) */
.map-frame {
  position: relative;
  aspect-ratio: 16 / 9; /* the image's own ratio: pins and the burnt-in attribution stay valid (never cropped) */
  inline-size: 100%;
  max-inline-size: 640px; /* the 1x image's natural width: never upscaled */
  overflow: hidden;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: #e5e3df;
}
.map-img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.map-unavailable {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  margin: 0;
  color: #3a3f4a;
  font-size: 0.9rem;
}
.map-frame.is-broken .map-unavailable {
  display: grid;
}
.map-frame.is-broken .map-pins {
  display: none;
}
.map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* the pin is a rounded label with a centred tail below it: the tail's tip is the coordinate (--x, --y) */
.map-pin {
  --pin-bg: #0b1b3f;
  --tail: 7px;
  position: absolute;
  inset-inline-start: var(--x, 50%);
  inset-block-start: var(--y, 50%);
  transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% - var(--tail) + var(--dy, 0px)));
  transform-origin: 50% calc(100% + var(--tail));
  display: grid;
  place-items: center;
  min-inline-size: 26px;
  block-size: 26px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 13px;
  background: var(--pin-bg);
  color: #fff;
  font: 700 0.75rem/1 var(--sans);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.map-pin::after {
  content: "";
  position: absolute;
  inset-block-start: calc(100% + 2px);
  inset-inline-start: 50%;
  translate: -50% 0;
  border-inline: 5px solid transparent;
  border-block-start: var(--tail) solid var(--pin-bg);
  pointer-events: none;
}
/* an invisible 44 px touch target around the 26 px label */
.map-pin::before {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
}
.map-pin.is-moved::after {
  display: none;
}
.map-pin[hidden],
.map-leader[hidden],
.map-center[hidden] {
  display: none;
}
.map-pin.is-active,
.map-pin:hover {
  --pin-bg: #1e5bd8;
  transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% - var(--tail) + var(--dy, 0px))) scale(1.18);
  z-index: 2;
}
/* a moved pin: a thin leader from its true point (with a dot) to the label */
.map-leader {
  position: absolute;
  inset-inline-start: var(--x, 50%);
  inset-block-start: var(--y, 50%);
  inline-size: var(--len, 0px);
  block-size: 2px;
  margin-block-start: -1px;
  background: #0b1b3f;
  transform: rotate(var(--angle, 0rad));
  transform-origin: 0 50%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.85);
}
.map-leader::before {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  inset-block-start: -3px;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: #0b1b3f;
  border: 1.5px solid #fff;
  box-sizing: border-box;
}
/* the centre of a "near" search: an orange ring under the numbered pins */
.map-center {
  position: absolute;
  inset-inline-start: var(--x, 50%);
  inset-block-start: var(--y, 50%);
  inline-size: 18px;
  block-size: 18px;
  translate: -50% -50%;
  border: 4px solid #c2410c;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.85);
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgb(0 0 0 / 0.35);
  box-sizing: border-box;
}
.map-attr {
  position: absolute;
  inset-inline-start: 6px;
  inset-block-end: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgb(255 255 255 / 0.88);
  color: #222;
  font-size: 0.68rem;
  text-decoration: none;
}
.map-attr:hover,
.map-attr:focus-visible {
  text-decoration: underline;
}
.map-zoom {
  position: absolute;
  inset-inline-end: 6px;
  inset-block-start: 6px;
  display: grid;
  gap: 4px;
}
.map-zoom .btn {
  inline-size: 34px;
  block-size: 34px;
  padding: 0;
  background: rgb(255 255 255 / 0.92);
  color: #121a2e;
  border: 1px solid #bcbab0;
}

.place-more.is-open .icon {
  rotate: 180deg;
}

.map-frame.is-loading .map-img {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.map-frame.is-loading::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: 28px;
  block-size: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgb(255 255 255 / 0.9);
  border-block-start-color: #1e5bd8;
  border-radius: 50%;
  animation: map-spin 0.8s linear infinite;
}
@keyframes map-spin {
  to {
    rotate: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .map-frame.is-loading::after {
    animation: none;
  }
}
@media (pointer: coarse) {
  .map-zoom .btn {
    inline-size: 44px;
    block-size: 44px;
  }
}

/* place cards */
.place-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.place-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-s);
  transition: background 0.2s ease;
}
.place-card[hidden] {
  display: none;
}
.place-card:hover,
.place-card:focus-within,
.place-card.is-cited {
  background: var(--accent-soft);
}
.place-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.place-n {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-ink);
  font: 700 0.75rem/1 var(--sans);
}
.place-body {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}
.place-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
}
.place-meta,
.place-address,
.place-hours {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.place-hours p {
  margin: 0;
}
.place-hours-all summary {
  cursor: pointer;
  color: var(--link);
  inline-size: fit-content;
}
.place-hours-all ul {
  margin: 2px 0 0;
  padding-inline-start: 1.1em;
}
.place-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 2px 0 0;
  font-size: 0.86rem;
}
.place-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
}
.place-more {
  justify-self: start;
}

/* company */
.company-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.company-name {
  margin: 0;
  font-size: 1.05rem;
}
.company-kv > div {
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: baseline;
}
.num-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
/* the copy button must not set the row's height (label and value on one baseline) */
.num-row .btn {
  align-self: center;
  margin-block: -8px;
}
.company-candidates li.is-current {
  color: var(--ink-2);
}
.company-candidates li.is-current .pill {
  margin-inline-start: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.pill-active {
  background: var(--eco-soft);
  color: var(--eco);
}
.pill-closed {
  background: var(--danger-bg);
  color: var(--danger-ink);
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 8px;
}
.kpi {
  display: grid;
  grid-template-rows: 1fr auto; /* tiles of a row share a height: the values sit on one line */
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
}
.company-candidates ul {
  margin: 4px 0 0;
  padding-inline-start: 1.2em;
  font-size: 0.86rem;
}

/* currency */
.fx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.fx-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-amount {
  inline-size: 9rem;
  max-inline-size: 100%;
  padding: 6px 8px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: 600 1.1rem/1.2 var(--sans);
}
.fx-cur {
  font-weight: 600;
}
.fx-eq {
  color: var(--muted);
}
.fx-result {
  font-size: 1.5rem;
  font-weight: 700;
}
.fx-inverse {
  margin: 0;
  font-size: 0.84rem;
}
/* touch screens: card actions become pills of at least 40 px, other links get taller hit areas */
@media (pointer: coarse) {
  .place-actions {
    gap: 8px;
  }
  .place-actions a.widget-link {
    display: inline-flex;
    align-items: center;
    min-block-size: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
  }
  .place-actions .btn {
    min-block-size: 40px;
  }
  .widget-head-links a,
  .widget-source a,
  .company-candidates a,
  .place-hours-all summary {
    display: inline-block;
    padding-block: 10px;
  }
  .map-attr {
    padding: 5px 8px;
  }
}
/* narrow: the amount and its currency on one row, the result alone and large below (no dangling "=") */
@media (max-width: 420px) {
  .fx-eq {
    display: none;
  }
  .fx-result {
    flex-basis: 100%;
  }
}

/* weather (MET Norway): head, facts, hourly strip (inline SVG), 7-day tiles */
.wx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
}
.wx-place {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}
.wx-name {
  font-size: 1.1rem;
}
.wx-region {
  font-size: 0.84rem;
}
.wx-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-block-start: 4px;
  font-size: 0.84rem;
}
.wx-day .muted::first-letter,
.wx-dow::first-letter,
.ck-dow::first-letter {
  text-transform: uppercase;
}
.wx-pill,
.ck-you {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.wx-now {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wx-now-text {
  display: grid;
  gap: 1px;
}
.wx-temp {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.wx-sky {
  font-weight: 600;
}
.wx-when {
  font-size: 0.78rem;
}
.wx-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.wx-fact {
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 7px 10px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.wx-fact dt {
  font-size: 0.76rem;
  color: var(--muted);
}
.wx-fact dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}
.wx-date {
  font-weight: 600;
  color: var(--ink-2);
}
.wx-block,
.ck-board {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
}
.wx-block-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
}
.wx-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 400;
}
.wx-key,
.ck-key {
  display: inline-block;
  border-radius: 2px;
}
.wx-key-line {
  inline-size: 14px;
  block-size: 3px;
  background: var(--wx-line);
}
.wx-key-bar {
  inline-size: 8px;
  block-size: 10px;
  margin-inline-start: 6px;
  background: var(--wx-bar);
}
.wx-strip-box {
  inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
}
.wx-strip {
  display: block;
  inline-size: 100%;
  block-size: auto;
}
.wx-strip .wx-t {
  font: 600 12px/1 var(--sans);
  fill: var(--ink);
}
.wx-strip .wx-h {
  font: 11px/1 var(--sans);
  fill: var(--muted);
}
.wx-strip .wx-r {
  font: 600 11px/1 var(--sans);
  fill: var(--wx-rain);
}
.wx-line {
  fill: none;
  stroke: var(--wx-line);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.wx-area {
  fill: var(--wx-area);
}
.wx-dot {
  fill: var(--surface);
  stroke: var(--wx-line);
  stroke-width: 2;
}
.wx-bar {
  fill: var(--wx-bar);
}
.wx-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.wx-icon {
  flex: none;
  overflow: visible;
}
.wx-sun,
.wx-bolt {
  fill: var(--wx-sun);
}
.wx-ray {
  stroke: var(--wx-sun);
  stroke-width: 2;
  stroke-linecap: round;
}
.wx-moon {
  fill: var(--wx-moon);
}
.wx-cloud {
  fill: var(--wx-cloud);
}
.wx-cloud.wx-cloud-rain {
  fill: var(--wx-cloud-rain);
}
.wx-drop {
  stroke: var(--wx-rain);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.wx-flake {
  fill: var(--wx-snow);
}
.wx-unknown {
  fill: none;
  stroke: var(--wx-cloud-rain);
  stroke-width: 2;
  stroke-dasharray: 3 2.5;
  stroke-linecap: round;
}
.wx-fog {
  stroke: var(--wx-cloud-rain);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.wx-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wx-tile {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 2px 7px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 0.8rem;
  line-height: 1.15;
}
.wx-tile.is-current {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.wx-dow {
  font-weight: 600;
  color: var(--ink-2);
}
.wx-hi {
  font-weight: 700;
}
.wx-lo {
  color: var(--muted);
}
.wx-mm {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--wx-rain);
}
.wx-mm.is-dry {
  font-weight: 400;
  color: var(--muted);
}
.wx-unit {
  margin: 0;
  font-size: 0.74rem;
  text-align: end;
}
.ev-weather {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* world clock: live local times, 24-hour board of office hours, common slot */
.ck-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 9px;
  border-block-end: 1px solid var(--line);
}
.ck-row:first-child {
  padding-block-start: 0;
}
.ck-row:last-child {
  border-block-end: 0;
}
.ck-city {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-inline-size: 0;
}
.ck-you {
  padding: 1px 8px;
  font-size: 0.72rem;
}
.ck-meta {
  flex-basis: 100%;
  font-size: 0.8rem;
}
.ck-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
}
.ck-time {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.ck-dow {
  font-size: 0.8rem;
  color: var(--muted);
}
.ck-key {
  inline-size: 12px;
  block-size: 10px;
  background: var(--ck-office);
}
.ck-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(4.5rem, 7.5rem) repeat(24, minmax(0, 1fr));
  align-items: center;
  column-gap: 1px;
  row-gap: 5px;
}
.ck-hour {
  justify-self: start;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}
.ck-label {
  overflow: hidden;
  padding-inline-end: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ck-label.is-user {
  color: var(--accent-strong);
}
.ck-cell {
  position: relative;
  block-size: 24px;
  border-radius: 2px;
  background: var(--surface-2);
}
.ck-cell.is-night {
  background: var(--ck-night);
}
.ck-cell.is-part {
  background: var(--ck-part);
}
.ck-cell.is-office {
  background: var(--ck-office);
}
.ck-cell[data-h]::after {
  content: attr(data-h);
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 1; /* above the next cells: a two-digit hour is wider than a cell on a phone */
  display: grid;
  place-items: center start;
  padding-inline-start: 2px;
  white-space: nowrap;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.ck-band {
  z-index: 1;
  align-self: stretch;
  margin-block: -3px;
  border: 2px solid var(--ck-band);
  border-radius: 6px;
  pointer-events: none;
}
.ck-band.is-wide {
  border-style: dashed;
  border-color: var(--warn-ink);
}
.ck-now {
  z-index: 2;
  justify-self: start;
  align-self: stretch;
  inline-size: 2px;
  margin-block: -6px;
  margin-inline-start: calc(var(--at, 0) * 100%);
  border-radius: 1px;
  background: var(--danger-ink);
}
.ck-slot {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-inline-start: 3px solid var(--ck-band);
  border-radius: var(--radius-s);
  background: var(--eco-soft);
}
.ck-slot.is-wide {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}
.ck-slot-title {
  font-size: 0.9rem;
  font-weight: 700;
}
.ck-slot.is-wide .ck-slot-title {
  color: var(--warn-ink);
}
.ck-slot .muted {
  font-size: 0.82rem;
}
.ck-slot-list {
  display: grid;
  gap: 4px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.ck-slot-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
}
.ck-slot-list strong {
  font-size: 1.1rem;
}
.ck-slot-others {
  flex-basis: 100%;
  font-size: 0.82rem;
  color: var(--ink-2);
}
@media (max-width: 480px) {
  .wx-temp {
    font-size: 2.1rem;
  }
  .wx-tile {
    padding-inline: 0;
    font-size: 0.74rem;
  }
  .ck-time {
    font-size: 1.4rem;
  }
  .ck-grid {
    grid-template-columns: minmax(3.6rem, 4.8rem) repeat(24, minmax(0, 1fr));
  }
  .ck-cell[data-h]::after {
    font-size: 0.6rem;
  }
  .ck-cell[data-h]:not(.is-major)::after {
    display: none; /* every 6 h on a phone: no hour runs into the next one */
  }
}
/* event */
.ev-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.ev-leaf {
  display: grid;
  justify-items: center;
  inline-size: 4.6rem;
  padding-block-end: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--bg);
}
.ev-month {
  justify-self: stretch;
  padding: 2px 0;
  background: #b03a0a;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.ev-day {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
}
.ev-weekday {
  font-size: 0.7rem;
  color: var(--muted);
}
.ev-fields {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
}
.ev-when {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.ev-field {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}
.ev-label {
  font-size: 0.76rem;
  color: var(--muted);
}
.ev-field input {
  inline-size: 100%;
  min-inline-size: 0;
  padding: 6px 8px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  color-scheme: light dark;
}
.ev-matched {
  margin: 0;
  font-size: 0.8rem;
}
.ev-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.78rem;
}
.ev-chip-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* steps: started by the harness from the user's words, not by the model */
.badge-auto {
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

/* sources as link previews */
.source-list li.source-card {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.source-card .source-body {
  display: grid;
  gap: 2px;
}
.source-card .source-body > a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.source-card .source-host {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.source-icon {
  inline-size: 16px;
  block-size: 16px;
  border-radius: 3px;
}
.source-mono {
  display: inline-grid;
  place-items: center;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 4px;
  color: #fff;
  font: 700 0.62rem/1 var(--sans);
}
.source-mono[hidden] {
  display: none;
}
.mono-0 {
  background: #1e5bd8;
}
.mono-1 {
  background: #12764a;
}
.mono-2 {
  background: #9a3412;
}
.mono-3 {
  background: #6d28d9;
}
.mono-4 {
  background: #0e7490;
}
.mono-5 {
  background: #a16207;
}
.mono-6 {
  background: #be123c;
}
.mono-7 {
  background: #475569;
}
.badge-gov {
  background: var(--eco-soft);
  color: var(--eco);
}
.source-snippet {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .widget {
    padding: 12px;
  }
  .ev-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ev-leaf {
    display: none;
  }
  .ev-when {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .ev-when .ev-date {
    grid-column: 1 / -1;
  }
  .company-kv > div {
    grid-template-columns: 6.6rem minmax(0, 1fr);
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .map-pin,
  .place-card {
    transition: none;
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-img {
    filter: brightness(0.85) contrast(1.05);
  }
}
:root[data-theme="dark"] .map-img {
  filter: brightness(0.85) contrast(1.05);
}
/* ==================================================================== open data (static/opendata.js) ===
   calendar, entity, tenders, papers, commune cards and the source line of a statistics chart. Colours come from
   the theme tokens only, so light and dark follow the rest of the app. */
.od-head {
  display: grid;
  gap: 2px;
}
.od-main {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.od-main::first-letter {
  text-transform: uppercase;
}
.od-sub {
  margin: 0;
  font-size: 0.86rem;
}
.od-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  font-size: 0.86rem;
}
.od-pill-hol,
.od-pill-soon {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.od-pill-we {
  background: var(--surface-2);
  color: var(--ink-2);
}
.od-kpis .kpi {
  grid-template-rows: auto auto auto;
}
.od-kpi-hint {
  font-size: 0.74rem;
}
.od-kv > div {
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: baseline;
}
.od-date {
  font-size: 0.8rem;
}
.od-source a {
  overflow-wrap: anywhere;
}
/* month grid: seven columns, Monday first; holidays and the date asked marked by colour AND by shape */
.od-month {
  inline-size: 100%;
  max-inline-size: 23rem;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  font-size: 0.86rem;
}
.od-month-cap {
  caption-side: top;
  padding-block-end: 4px;
  text-align: start;
  font-weight: 600;
  color: var(--ink-2);
}
.od-month-cap::first-letter {
  text-transform: uppercase;
}
.od-month th {
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
}
.od-day {
  position: relative;
  block-size: 2.1rem;
  text-align: center;
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
}
.od-day.is-empty {
  background: none;
}
.od-day.is-weekend {
  background: var(--surface-2);
  color: var(--muted);
}
.od-day.is-holiday {
  background: var(--warn-bg);
  color: var(--warn-ink);
  box-shadow: inset 0 0 0 1px var(--warn-line);
  font-weight: 700;
}
.od-day.is-regional {
  box-shadow: inset 0 0 0 1px var(--warn-line);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 4px,
    var(--warn-bg) 4px 7px
  );
}
.od-day.is-target {
  box-shadow: inset 0 0 0 2px var(--accent);
  font-weight: 700;
}
.od-day.is-target.is-holiday {
  box-shadow:
    inset 0 0 0 2px var(--accent),
    inset 0 0 0 3px var(--warn-line);
}
.od-day.is-start {
  box-shadow: inset 0 0 0 1px var(--accent);
  border: 0;
  outline: 1px dashed var(--accent);
  outline-offset: -4px;
}
.od-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: -4px 0 0;
  font-size: 0.76rem;
}
.od-swatch {
  display: inline-block;
  inline-size: 0.85rem;
  block-size: 0.85rem;
  border-radius: 3px;
}
.od-swatch + .od-swatch,
.od-legend .od-swatch:not(:first-child) {
  margin-inline-start: 8px;
}
.od-swatch.is-holiday {
  background: var(--warn-bg);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}
.od-swatch.is-target {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.od-hol-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.od-hol-list li {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-block-start: 1px solid var(--line);
}
.od-hol-list li:first-child {
  border-block-start: 0;
}
.od-hol-date {
  color: var(--ink-2);
}
.od-hol-list .is-regional .od-hol-name {
  color: var(--ink-2);
}
/* entity: picture beside the text on a wide card, above it on a phone */
.od-ent {
  display: grid;
  gap: 12px;
}
.od-ent.has-pic {
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: start;
}
.od-ent-pic {
  margin: 0;
}
.od-ent-pic img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 9rem;
  object-fit: cover;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.od-ent-text {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
}

/* ============================================================ first impression (fi-app)
   The empty chat (animated mark, tagline, promise, starter cards, signature), the welcome dialog, and the shell
   polish: titles in the brand's heavy sans (like the site and the logo), clearer composer toggles, calmer pages.
   Tokens only, so light and dark follow; every motion stops under prefers-reduced-motion. */

/* type: one heavy sans for titles; the serif italic is kept for the accent word only */
.top-title {
  font: 650 0.98rem/1.3 var(--sans);
  letter-spacing: -0.01em;
}
.page-title {
  font: 800 clamp(1.75rem, 4.6vw, 2.35rem) / 1.08 var(--sans);
  letter-spacing: -0.04em;
  color: var(--brand);
}
.page-lead {
  font-size: 1.04rem;
}
.panel h3:not(.eyebrow),
.modal h2,
.byline-name {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.015em;
}
.panel {
  border-radius: 18px;
}
.stat-hero .stat-value {
  font: 800 2.6rem/1.05 var(--sans);
  letter-spacing: -0.045em;
  color: var(--brand);
}

/* empty chat */
.empty-title em,
.w-title em {
  font: italic 500 1.04em/1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--accent);
}
.empty {
  position: relative;
  isolation: isolate;
  padding-block-start: clamp(4px, 5vh, 56px);
  text-align: center;
}
.empty::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -60px 0 auto;
  block-size: 460px;
  background: radial-gradient(
    circle min(240px, 46vw) at 50% 150px,
    color-mix(in srgb, var(--accent) 13%, transparent),
    transparent
  );
  pointer-events: none;
}
.fi-mark {
  display: block;
  inline-size: 64px;
  block-size: 56px;
  margin-inline: auto;
  fill: var(--brand);
  overflow: visible;
}
.fi-mark path {
  transform-box: view-box;
  transform-origin: 42px 31px;
}
.empty-title {
  max-inline-size: 15em;
  margin: 18px auto 0;
  font: 800 clamp(2rem, 5.2vw, 3.05rem) / 1.04 var(--sans);
  letter-spacing: -0.045em;
  color: var(--brand);
  text-wrap: balance;
}
.empty-lead {
  max-inline-size: 35rem;
  margin: 14px auto 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
/* eco chip: opens « Empreinte » */
.fi-eco {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-inline-size: 100%;
  min-block-size: 36px;
  margin-block-start: 16px;
  padding: 6px 14px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--eco) 30%, transparent);
  border-radius: 999px;
  background: var(--eco-soft);
  color: var(--eco);
  font: 650 0.88rem/1.3 var(--sans);
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.2s;
}
.fi-eco:hover {
  border-color: var(--eco);
  transform: translateY(-1px);
}
.fi-eco .icon {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
}
.empty .demo-note {
  margin-block-start: 16px;
}
.fi-try {
  margin-block: 32px 12px;
}
.starters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: start;
}
.starter {
  --c: var(--series-1);
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.2s,
    transform 0.2s;
}
.starter:hover {
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.starter:active {
  transform: scale(0.98);
}
.starter-deck {
  --c: var(--series-2);
}
.starter-search {
  --c: var(--series-6);
}
.starter-map {
  --c: var(--series-3);
}
.starter-chart {
  --c: var(--series-5);
}
.starter-weather {
  --c: var(--wx-sun);
}
.starter-icon {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: color-mix(in srgb, var(--c) 78%, var(--ink));
  transition: transform 0.2s;
}
.starter:hover .starter-icon {
  transform: scale(1.06) rotate(-4deg);
}
.starter-icon .icon {
  inline-size: 20px;
  block-size: 20px;
}
.starter-text {
  display: grid;
  gap: 1px;
  min-inline-size: 0;
}
.starter-title {
  overflow-wrap: anywhere;
  hyphens: auto;
}
.starter-title {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
}
.starter-desc {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}
/* with a document attached, the document actions (app.js) replace the starters */
.empty:has(#examples [data-example^="doc."]) :is(.fi-try, .starters),
.empty:not(:has(#examples [data-example^="doc."]))
  :is(#examples, #examples-title) {
  display: none;
}
#examples-title {
  margin-block-start: 28px;
}
.fi-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-block-start: 22px;
  font: 600 0.72rem/1.4 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.fi-sign .icon {
  color: var(--eco);
}
@media (prefers-reduced-motion: no-preference) {
  .fi-mark {
    animation:
      fi-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both,
      fi-float 6s ease-in-out 0.7s infinite;
  }
  .fi-mark :is(.mark-wing-back, .mark-wing-front) {
    --wr: 18deg;
    --ws: 0.55;
    animation: fi-wing 6s ease-in-out 0.5s infinite;
  }
  .fi-mark .mark-wing-front {
    --wr: -16deg;
    --ws: 0.6;
  }
  .empty-title,
  .fi-eco,
  .empty-lead,
  .starters li,
  .fi-sign {
    animation: fi-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .empty-title {
    animation-delay: 0.06s;
  }
  .fi-eco {
    animation-delay: 0.09s;
  }
  .empty-lead {
    animation-delay: 0.12s;
  }
  .starters li {
    animation-delay: calc(0.18s + var(--i, 0) * 0.04s);
  }
  .fi-sign {
    animation-delay: 0.45s;
  }
}
@keyframes fi-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes fi-float {
  50% {
    transform: translateY(-4px);
  }
}
/* two wing beats, then a glide */
@keyframes fi-wing {
  0%,
  7%,
  14%,
  100% {
    transform: none;
  }
  3.5%,
  10.5% {
    transform: rotate(var(--wr)) scaleY(var(--ws));
  }
}
/* short screens (phones, small laptops): a small mark, the title, the cards */
@media (max-height: 700px) {
  .empty {
    padding-block-start: 0;
  }
  .fi-mark {
    inline-size: 42px;
    block-size: 37px;
  }
  .empty-title {
    margin-block-start: 10px;
    font-size: clamp(1.55rem, 6.6vw, 2.2rem);
  }
  /* the eco chip stays */
  .empty-lead {
    display: none;
  }
  .fi-eco {
    margin-block-start: 12px;
  }
  .fi-try {
    margin-block: 18px 8px;
  }
  .fi-sign {
    margin-block-start: 14px;
  }
}
@media (max-width: 640px) {
  .empty-lead {
    font-size: 1rem;
  }
  .starters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .starter {
    gap: 10px;
    min-block-size: 54px;
    padding: 8px 10px;
    border-radius: 14px;
  }
  .starter-icon {
    inline-size: 34px;
    block-size: 34px;
    border-radius: 10px;
  }
  .starter-desc {
    display: none;
  }
}
@media (max-width: 380px) {
  .starter {
    gap: 8px;
    padding-inline: 8px;
  }
  .starter-icon {
    inline-size: 30px;
    block-size: 30px;
  }
  .starter-title {
    font-size: 0.88rem;
  }
  .fi-eco {
    font-size: 0.82rem;
  }
}

/* shell: safe areas, sidebar, header */
.top {
  padding-block-start: calc(8px + env(safe-area-inset-top, 0px));
}
.side {
  padding-block-start: calc(10px + env(safe-area-inset-top, 0px));
}
.btn-new {
  min-block-size: 44px;
  border-color: var(--line);
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(18 26 46 / 0.05);
}
.btn-new .icon {
  color: var(--accent);
}
.btn-new:hover {
  box-shadow: var(--shadow);
}
.conv.is-current {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--side));
}
.btn-nav .icon {
  color: var(--muted);
}
.btn-nav:hover .icon,
.btn-nav.is-on .icon {
  color: var(--accent);
}
.btn-footprint {
  background: color-mix(in srgb, var(--eco-soft) 55%, var(--surface));
}
.btn-footprint[hidden] {
  display: none;
}
.top-title.is-empty {
  visibility: hidden; /* keeps the row's layout; an empty chat has no title (HOME-06) */
}
/* the pencil only where the sidebar's « Nouvelle conversation » is out of sight (as ChatGPT) */
@media (min-width: 901px) {
  body.side-open #btn-new-top {
    display: none;
  }
}

/* composer: a calmer box, a visible focus halo, and two toggles that read as controls */
.composer {
  border-radius: 24px;
  transition:
    border-color 0.15s,
    box-shadow 0.2s;
}
.composer:focus-within {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    var(--shadow);
}
.switch {
  position: relative;
  isolation: isolate;
  padding-inline: 8px 12px;
}
.switch::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(50% - 17px) 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.switch:hover::before {
  background: var(--surface-2);
}
.switch[aria-checked="true"]::before {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
.switch-track {
  inline-size: 30px;
  block-size: 18px;
}
.switch-thumb {
  inline-size: 14px;
  block-size: 14px;
}
.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(12px);
}
[dir="rtl"] .switch[aria-checked="true"] .switch-thumb {
  transform: translateX(-12px);
}
@media (max-width: 389px) {
  .switch {
    padding-inline: 8px;
  }
}
.switch:focus-visible {
  outline-offset: 0;
  border-radius: 999px;
}
@media (min-width: 641px) {
  .agent-pill {
    min-block-size: 34px;
    transition:
      background-color 0.15s,
      border-color 0.15s;
  }
  .agent-pill:hover {
    background: var(--surface-2);
  }
}
.thinking-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}
.btn-send:not(:disabled) {
  box-shadow: 0 4px 12px -4px
    color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn-send:not(:disabled):active {
  transform: scale(0.94);
}
.dock-note {
  font-size: 0.72rem;
}

/* welcome dialog */
.welcome {
  inline-size: min(36rem, calc(100vw - 20px));
  max-block-size: calc(100dvh - 20px);
  border: 0;
  border-radius: 24px;
}
.welcome[open] {
  animation: fi-rise 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.w-step {
  display: grid;
  gap: 14px;
  padding: 22px 26px 24px;
  background: radial-gradient(
    110% 55% at 100% 0%,
    color-mix(in srgb, var(--accent) 12%, transparent),
    transparent 65%
  );
}
.w-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.w-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.w-brand b {
  font: 800 1.35rem/1 var(--sans);
  letter-spacing: -0.03em;
  color: var(--brand);
}
.w-brand span {
  font: 750 0.95rem/1 var(--sans);
  color: var(--brand-sub);
}
.w-mark {
  inline-size: 34px;
  block-size: 30px;
  fill: var(--brand);
}
.w-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.w-lang {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.w-lang-opt {
  min-inline-size: 44px;
  min-block-size: 44px;
  padding-inline: 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: 700 0.8rem/1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}
.w-lang-opt[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-ink);
}
.welcome .w-close {
  inline-size: 44px;
  block-size: 44px;
}
.w-kicker {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 4px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font: 600 0.8rem/1.4 var(--sans);
  color: var(--ink-2);
}
.w-kicker i {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--eco);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--eco) 22%, transparent);
}
.welcome .w-title {
  font: 850 clamp(1.85rem, 6.4vw, 2.6rem) / 1.04 var(--sans);
  letter-spacing: -0.045em;
  color: var(--brand);
  text-wrap: balance;
}
.w-lead {
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.w-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.w-value {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.w-vicon {
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 30px;
  margin-block-end: 6px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--link);
}
.w-value:first-child .w-vicon {
  background: var(--eco-soft);
  color: var(--eco);
}
.w-value b {
  font-size: 0.95rem;
  font-weight: 750;
}
.w-value span:last-child {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.w-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--ink-2);
}
.w-caps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.w-caps .icon {
  color: var(--link);
}
.w-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
}
.w-foot {
  display: grid;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.w-more {
  justify-self: start;
  font-weight: 600;
}
.welcome .btn-cta {
  flex: none;
  min-block-size: 46px;
  padding-inline: 26px;
  font-size: 1rem;
  box-shadow: 0 6px 16px -6px
    color-mix(in srgb, var(--primary) 60%, transparent);
}
@media (max-width: 520px) {
  .w-step {
    gap: 11px;
    padding: 14px 16px 16px;
  }
  .w-lead {
    font-size: 0.94rem;
  }
  .w-values {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .w-value {
    grid-template-columns: 30px 1fr;
    column-gap: 10px;
    align-items: center;
    padding: 8px 10px;
  }
  .w-vicon {
    grid-row: span 2;
    margin: 0;
  }
}
@media (max-height: 700px) {
  /* « Léger » keeps its line */
  .w-caps,
  .w-value:not(:first-child) span:last-child {
    display: none;
  }
  .w-value {
    padding-block: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .welcome[open] {
    animation: none;
  }
}
/* ==================================================================== footprint.js (begin)
   The answer's impact inside the receipt, the Empreinte page's totals, comparison and « why small models » story.
   Owned by footprint.js; colours come from the tokens above (the green stays the footprint's semantic colour). */
:root {
  --fp-fr-blue: #1f4fbf;
  --fp-fr-red: #d6403a;
  --fp-fr-white: #ffffff;
  --fp-muted-bar: #b7bcc8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fp-fr-blue: #6d93ea;
    --fp-fr-red: #ef7a72;
    --fp-fr-white: #e9ecf2;
    --fp-muted-bar: #4a5570;
  }
}
:root[data-theme="dark"] {
  --fp-fr-blue: #6d93ea;
  --fp-fr-red: #ef7a72;
  --fp-fr-white: #e9ecf2;
  --fp-muted-bar: #4a5570;
}
.fp-answer {
  display: grid;
  gap: 12px;
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--line-strong);
}
.fp-eyebrow {
  font: 600 0.7rem/1.4 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.fp-figs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}
.fp-answer .fp-figs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fp-fig {
  display: grid;
  align-content: start;
  gap: 1px;
  min-inline-size: 0;
}
.fp-fig-label {
  font-size: 0.76rem;
  color: var(--muted);
}
.fp-fig-value {
  font: 600 1.05rem/1.3 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.fp-fig-sub {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
}
.fp-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.fp-grid-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.fp-segs {
  padding: 2px;
}
.fp-segs .seg {
  min-block-size: 28px;
  padding: 0 11px;
  font-size: 0.8rem;
}
@media (pointer: coarse) {
  .fp-segs .seg {
    min-block-size: 40px;
  }
}
.fp-note {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}
.fp-src {
  margin-inline-start: auto;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.fp-src:hover {
  color: var(--link);
}
.fp-gpu {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--eco-soft);
}
.fp-gpu-line {
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
}
.fp-gpu-what > summary {
  inline-size: fit-content;
  font-size: 0.8rem;
  color: var(--eco);
  cursor: pointer;
}
.fp-gpu-what > p {
  margin-block-start: 6px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.fp-eq {
  display: grid;
  gap: 6px;
}
.fp-eq-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fp-eq-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 30px;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.fp-eq-icon {
  inline-size: 18px;
  block-size: 18px;
  flex: none;
  fill: none;
  stroke: var(--eco);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fp-eq-text {
  min-inline-size: 0;
}
.fp-conv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.fp-spark {
  fill: var(--fp-muted-bar);
}
.fp-spark .is-current {
  fill: var(--eco);
}
.fp-more {
  justify-self: start;
  font-size: 0.84rem;
}
.fp-hero {
  gap: 14px;
}
.fp-hero-main {
  display: grid;
  gap: 2px;
}
.fp-hero-value {
  font: 500 2.6rem/1.1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.fp-hero-sub {
  font-size: 0.82rem;
  color: var(--muted);
}
.fp-chart figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}
.fp-chart-svg {
  inline-size: 100%;
  block-size: 150px;
  overflow: visible;
}
.fp-bar rect {
  fill: var(--eco);
}
.fp-whisker {
  stroke: var(--eco);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.35;
}
.fp-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.fp-ref line {
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.fp-chart-legend {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 0.76rem;
  color: var(--muted);
}
.fp-legend-bird {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 3px;
  background: var(--eco);
}
.fp-legend-ref {
  inline-size: 18px;
  margin-inline-start: 6px;
  border-block-start: 2px dashed var(--ink-2);
}
.fp-h {
  font: 600 1.12rem/1.3 var(--serif);
}
.fp-vs-rows {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fp-vs-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}
.fp-vs-label {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.fp-vs-label .fp-src {
  margin: 0;
}
.fp-vs-track {
  position: relative;
  block-size: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}
.fp-vs-fill,
.fp-vs-range {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: 999px;
}
.fp-vs-fill {
  background: var(--fp-muted-bar);
}
.fp-vs-range {
  background: var(--eco-soft);
  outline: 1px solid var(--eco);
  outline-offset: -1px;
  opacity: 0.8;
}
.is-bird .fp-vs-fill {
  background: var(--eco);
}
.fp-vs-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.fp-vs-times {
  font: 500 1.5rem/1.2 var(--serif);
  color: var(--eco);
}
.fp-vs-times-range {
  margin-block-start: -0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.fp-vs-saved {
  font-size: 0.9rem;
  color: var(--ink);
}
.fp-story {
  display: grid;
  gap: 18px;
  margin-block-start: 12px;
}
/* FP-03: the app's one display style (.page-title), not a lone serif heading; a fold under the figures */
.fp-story-title {
  display: inline;
  font: 800 1.3rem/1.2 var(--sans);
  letter-spacing: -0.03em;
  color: var(--brand);
}
.fp-story > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
  cursor: pointer;
  list-style: none;
}
.fp-story > summary::-webkit-details-marker {
  display: none;
}
.fp-story > summary::after {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  margin-inline-start: auto;
  border-inline-end: 2px solid var(--muted);
  border-block-end: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.fp-story[open] > summary::after {
  transform: rotate(-135deg);
}
.fp-story:not([open]) {
  gap: 0;
}
.fp-story-lead {
  margin-block-start: -8px;
  color: var(--ink-2);
}
.fp-story-item {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 18px 26px;
  align-items: center;
  padding-block: 18px;
  border-block-start: 1px solid var(--line);
}
.fp-h4 {
  font: 600 1.02rem/1.35 var(--sans);
  color: var(--ink);
}
.fp-story-text {
  display: grid;
  gap: 6px;
}
.fp-story-text p,
.fp-story-fr p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.fp-art {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.fp-art-svg {
  inline-size: 100%;
  max-block-size: 140px;
  overflow: visible;
}
.fp-art-label {
  font: 500 13px var(--sans); /* FP-02: at least 11 px once the drawing is scaled down to its column */
  fill: var(--muted);
}
.fp-art-value {
  font: 600 13px var(--sans);
  fill: var(--ink);
}
.fp-art-core {
  font: 700 13px var(--sans);
  fill: var(--surface);
}
.fp-sq-bird,
.fp-bar-eco {
  fill: var(--eco);
}
.fp-sq-big,
.fp-bar-muted {
  fill: var(--fp-muted-bar);
}
.fp-sleep-line {
  fill: none;
  stroke: var(--eco);
  stroke-width: 2;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}
.fp-link {
  stroke: var(--line-strong);
  stroke-width: 1.5;
}
.fp-node {
  fill: var(--eco-soft);
  stroke: var(--eco);
  stroke-width: 1.2;
}
.fp-story-fr {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.fp-art-fr {
  inline-size: 42px;
  flex: none;
  border-radius: 4px;
  outline: 1px solid var(--line);
}
.fp-fr-blue {
  fill: var(--fp-fr-blue);
}
.fp-fr-white {
  fill: var(--fp-fr-white);
}
.fp-fr-red {
  fill: var(--fp-fr-red);
}
.fp-all > summary,
.fp-method > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.fp-all-body {
  margin-block-start: 12px;
}
.fp-table-wrap {
  max-inline-size: 100%;
  overflow-x: auto;
}
/* grid items of the page: never wider than the column (the sources table scrolls inside its own box) */
.fp-hero,
.fp-chart,
.fp-vs,
.fp-story,
.fp-story-item > *,
.fp-all,
.fp-method {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.fp-table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.fp-table th,
.fp-table td {
  padding: 7px 10px 7px 0;
  border-block-start: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}
.fp-table thead th {
  border-block-start: 0;
  font-weight: 600;
  color: var(--muted);
}
.fp-reset {
  justify-self: start;
}
.fp-art-bars {
  display: grid;
  gap: 10px;
  inline-size: 100%;
}
.fp-art-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
}
.fp-art-rlabel {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  color: var(--muted);
}
.fp-art-track {
  block-size: 8px;
  border-radius: 999px;
  background: var(--surface-2);
}
.fp-art-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
}
.fp-art-fill.fp-bar-eco {
  background: var(--eco);
}
.fp-art-fill.fp-bar-muted {
  background: var(--fp-muted-bar);
}
.fp-art-rvalue {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 640px) {
  .fp-figs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fp-story-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .fp-hero-value {
    font-size: 2.1rem;
  }
}
/* narrow screens: each source row becomes a small card (item, value, source, licence), no sideways scroll */
@media (max-width: 480px) {
  .fp-table,
  .fp-table tbody,
  .fp-table tr,
  .fp-table th,
  .fp-table td {
    display: block;
  }
  .fp-table thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .fp-table tr {
    padding-block: 8px;
    border-block-start: 1px solid var(--line);
  }
  .fp-table th,
  .fp-table td {
    padding: 0;
    border: 0;
  }
  .fp-table td:last-child {
    color: var(--muted);
    font-size: 0.74rem;
  }
}
.fp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
/* ==================================================================== footprint.js (end) */
/* ------------------------------------------------------------------ task plan (plan.js, w1-harness) */
.tplan-wrap {
  display: grid;
  gap: 6px;
}
.tplan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.tplan > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  cursor: pointer;
}
.tplan-title {
  font-weight: 600;
}
.tplan-count {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.tplan-head-icon {
  color: var(--eco);
}
.tplan-partial .tplan-head-icon {
  color: var(--warn-ink);
}
.tplan-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
  counter-reset: tplan;
}
.tplan-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 30px;
  max-inline-size: 100%;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--ink-2);
  counter-increment: tplan;
}
.tplan-label {
  overflow-wrap: anywhere;
}
.tplan-label::before {
  content: counter(tplan) ". ";
  color: var(--muted);
}
.tplan-mark {
  display: inline-grid;
  place-items: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--control-line);
  flex: none;
}
.tplan-mark .icon {
  inline-size: 14px;
  block-size: 14px;
}
.tplan-item.is-done .tplan-mark {
  border-color: var(--eco);
  background: var(--eco-soft);
  color: var(--eco);
}
.tplan-item.is-failed {
  border-color: var(--danger-line);
}
.tplan-item.is-failed .tplan-mark {
  border-color: var(--danger-ink);
  background: var(--danger-bg);
  color: var(--danger-ink);
}
.tplan-item.is-unavailable {
  color: var(--muted);
}
.tplan-item.is-todo .tplan-mark {
  border-style: dashed;
}
.tplan.tplan-partial {
  border-color: var(--warn-line);
}
.tplan-missing {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.86rem;
}
.tplan-missing .icon {
  flex: none;
  margin-block-start: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .tplan-item.is-done .tplan-mark {
    transition:
      background-color 0.2s,
      border-color 0.2s;
  }
}

/* ---------------------------------------------------------------- maps, wave 2 (lists, groups, full screen) */

/* an answer written by the harness from the results, when the model could not write one */
.answer-note {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* a group of close pins on a dense map: a round count, a tap zooms in */
.map-clusters {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-cluster {
  position: absolute;
  inset-inline-start: var(--x, 50%);
  inset-block-start: var(--y, 50%);
  translate: -50% -50%;
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  padding: 0;
  border: 3px solid rgb(255 255 255 / 0.95);
  border-radius: 50%;
  background: #0b1b3f;
  color: #fff;
  font: 700 0.8rem/1 var(--sans);
  box-shadow:
    0 0 0 4px rgb(11 27 63 / 0.22),
    0 1px 4px rgb(0 0 0 / 0.35);
  cursor: pointer;
  pointer-events: auto;
}
.map-cluster::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
}
.map-cluster:hover {
  background: #1e5bd8;
}

/* the list of places of a list: one block under the map (and the bottom sheet of the full-screen view) */
.place-sheet {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
}
.od-extract {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.od-more {
  margin: 0;
  font-size: 0.86rem;
}
/* lists of notices and works */
.od-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: od;
}
.od-item {
  display: grid;
  gap: 3px;
  padding: 9px 0 9px 1.9rem;
  border-block-start: 1px solid var(--line);
  position: relative;
  counter-increment: od;
}
.od-item:first-child {
  border-block-start: 0;
  padding-block-start: 2px;
}
.od-item::before {
  content: counter(od);
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 10px;
  inline-size: 1.35rem;
  block-size: 1.35rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--link);
  font: 700 0.74rem/1.35rem var(--sans);
  text-align: center;
}
.od-item:first-child::before {
  inset-block-start: 3px;
}
.od-item-title {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}
.od-item-title .widget-link {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}
.od-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 0;
  font-size: 0.82rem;
}
.od-doi {
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.od-oa {
  font-weight: 600;
}
/* commune and address */
.od-address {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  font-style: normal;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.45;
}
.od-table-wrap {
  overflow-x: auto;
}
.od-table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.od-table th,
.od-table td {
  padding: 6px 8px 6px 0;
  border-block-end: 1px solid var(--line);
  text-align: start;
  vertical-align: baseline;
}
.od-table thead th {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
.od-table tbody th {
  font-weight: 500;
}
/* a statistics chart's source (chart.js) */
.od-chart-src a {
  color: var(--link);
}
@media (max-width: 520px) {
  .od-ent.has-pic {
    grid-template-columns: minmax(0, 1fr);
  }
  .od-ent-pic img {
    max-block-size: 11rem;
    inline-size: 100%;
  }
  .od-hol-list li {
    grid-template-columns: 5.8rem minmax(0, 1fr) auto;
  }
  .od-kv > div {
    grid-template-columns: 6.6rem minmax(0, 1fr);
    gap: 8px;
  }
  .od-day {
    block-size: 1.9rem;
  }
}
/* next asks under a card (« Pour continuer »): quiet pills, one tap sends the ask */
.od-next {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
}
.od-next-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  min-block-size: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.od-next-chip span {
  overflow-wrap: anywhere;
}
.od-next-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* ==================================================================== end open data ===================== */
.place-copy {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
.place-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.place-plan-line {
  flex: 1 1 260px;
  margin: 0;
  font-size: 0.9rem;
}
.place-plan-seq {
  font-variant-numeric: tabular-nums;
}
.place-matrix {
  flex-basis: 100%;
  font-size: 0.86rem;
}
.place-matrix summary {
  cursor: pointer;
  color: var(--link);
  inline-size: fit-content;
}
.place-matrix-scroll {
  overflow-x: auto;
  margin-block-start: 6px;
}
.place-matrix table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.place-matrix th,
.place-matrix td {
  padding: 4px 8px;
  border: 1px solid var(--line);
  text-align: end;
  white-space: nowrap;
}
.place-matrix th {
  color: var(--muted);
  font-weight: 600;
}
.place-missing {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-s);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.place-missing .icon {
  flex: none;
  margin-block-start: 1px;
}

/* full screen: map on top, the list beside it (desktop) or as a bottom sheet under it (phone) */
.map-full-close {
  display: none;
}
:root.has-map-full {
  overflow: hidden;
}
.widget-places.is-full {
  position: fixed;
  inset: 0;
  z-index: 60;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  /* title, then up to four optional lines (links, route, visit order, missing addresses), the list, the source:
     the list alone takes the free height, whatever lines are drawn (no gap: empty rows take no room) */
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 0 18px;
  padding: 16px 20px;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
}
.widget-places.is-full > * {
  grid-column: 2;
  margin-block: 0 10px;
}
.widget-places.is-full > .place-sheet {
  grid-row: 6;
}
.widget-places.is-full > .widget-source {
  grid-row: 7;
}
.widget-places.is-full > .widget-title {
  grid-column: 1 / -1;
  padding-inline-end: 52px;
  font-size: 0.9rem;
  /* as tall as the close button beside it: the button never covers the map */
  display: flex;
  align-items: center;
  min-block-size: 40px;
  margin: 0 0 10px;
}
.widget-places.is-full > .map-frame {
  grid-column: 1;
  grid-row: 2 / -1;
  align-self: center;
  justify-self: center;
  max-inline-size: min(100%, calc((100dvh - 80px) * 16 / 9));
}
.widget-places.is-full > .place-sheet {
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}
.widget-places.is-full .place-more {
  display: none;
}
.widget-places.is-full > .map-full-close {
  display: inline-grid;
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  inline-size: 40px;
  block-size: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.widget-places.is-full .map-full {
  display: none;
}
@media (max-width: 760px) {
  .widget-places.is-full {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    gap: 0;
    padding: 12px 16px 0;
  }
  .widget-places.is-full > *,
  .widget-places.is-full > .map-frame {
    grid-column: 1;
    grid-row: auto;
    margin-block-end: 8px;
  }
  .widget-places.is-full > .map-frame {
    grid-row: 2;
  }
  .widget-places.is-full > .place-sheet {
    grid-row: 6;
    margin-block-end: 0;
  }
  .widget-places.is-full > .map-frame {
    max-inline-size: 100%;
  }
  .widget-places.is-full > .widget-source,
  .widget-places.is-full > .widget-head-links {
    display: none;
  }
  /* the bottom sheet: rounded top, a grab bar, scrolls on its own */
  .widget-places.is-full > .place-sheet {
    margin-inline: -16px;
    padding: 14px 16px 24px;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: 0 -6px 20px -12px rgb(18 26 46 / 0.35);
  }
  .widget-places.is-full > .place-sheet::before {
    content: "";
    justify-self: center;
    inline-size: 36px;
    block-size: 4px;
    border-radius: 2px;
    background: var(--line-strong);
  }
}
@media (pointer: coarse) {
  .place-actions .place-copy {
    display: inline-flex;
    align-items: center;
    min-block-size: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--link);
    text-decoration: none;
  }
  .map-cluster {
    inline-size: 38px;
    block-size: 38px;
  }
}

/* ------------------------------------------------------------------ office engine: pictures, charts, tables,
   themes and the editor (birds/harness/office_deck.py, office_doc.py; static/previews.js, editor.js) */
.sh-img {
  object-fit: cover;
  display: block;
}
.sh-chart {
  overflow: visible;
}
.sh-chart text {
  font-family: Carlito, Calibri, var(--sans);
}
.sh-table {
  display: grid;
  overflow: hidden;
}
.sh-cell {
  display: flex;
  align-items: center;
  padding: 0 calc(var(--px) * 9.6);
  overflow: hidden;
  line-height: 1.1;
}
.sh-cell.is-r {
  justify-content: flex-end;
  text-align: end;
}
.a4[data-office="modern"] {
  --o-navy: #111827;
  --o-blue: #0d9488;
  --o-tint: #f1f5f9;
  --o-soft: #ccfbf1;
  --o-pos: #5eead4;
}
.a4[data-office="warm"] {
  --o-navy: #3b1f14;
  --o-blue: #c2410c;
  --o-tint: #f8eee4;
  --o-soft: #fde7d7;
  --o-pos: #f2b25c;
}
.a4-warn {
  border-color: #e8a33d;
  background: #fff4e0;
}
.a4-fig {
  margin: 0.8em auto 0.2em;
  text-align: center;
}
.a4-fig img {
  display: block;
  margin-inline: auto;
  max-inline-size: 100%;
  block-size: auto;
}
.a4-cap {
  margin-block-end: 1em;
  text-align: center;
  font-size: 0.82em;
  color: #586078;
}
.a4-toch {
  margin-block: 0.4em 0.8em;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--o-navy, #0b1b3f);
}
.a4-toc {
  margin: 0 0 0.35em;
}
.a4-toc.is-l2 {
  padding-inline-start: 1.2em;
  color: #586078;
}
.a4-src {
  font-size: 0.9em;
}
.a4-pb {
  margin: 1.4em calc(-1 * max(16px, var(--cm) * 2.4));
  border: 0;
  border-block-start: 1px dashed #c9ced9;
}
.office-edit-btn {
  white-space: nowrap;
}
.editor {
  inline-size: min(56rem, calc(100vw - 24px));
  max-block-size: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.editor-body {
  display: grid;
  gap: 14px;
  padding: 20px 20px 16px;
}
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.editor-head h2 {
  font: 600 1.3rem/1.2 var(--serif);
}
.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 10px 14px;
}
.editor label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.editor input[type="text"],
.editor select,
.editor textarea {
  inline-size: 100%;
  min-inline-size: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.editor textarea {
  min-block-size: 6.5em;
  resize: vertical;
  line-height: 1.4;
}
.editor-items {
  display: grid;
  gap: 10px;
  max-block-size: 52dvh;
  overflow: auto;
  padding-inline-end: 4px;
}
.editor-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.editor-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-item-head .editor-n {
  min-inline-size: 2em;
  font-weight: 600;
  color: var(--ink-2);
}
.editor-item-head input {
  flex: 1;
}
.editor-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.editor-media img {
  inline-size: 72px;
  block-size: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.editor-status {
  margin-inline-end: auto;
  align-self: center;
  font-size: 0.85rem;
  color: var(--ink-2);
}
@media (max-width: 600px) {
  .editor-body {
    padding: 14px 12px 12px;
  }
}
.editor-up .icon {
  transform: rotate(-90deg);
}
.editor-down .icon {
  transform: rotate(90deg);
}
/* ==================================================================== data analysis (datakit.js, charts2.js)
   Section owned by the data-analysis module: richer charts (spec v2) and the data card. Tokens only. */
.c2-card {
  container-type: inline-size;
}
.c2-head {
  display: grid;
  gap: 2px;
}
.c2-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.c2-title-row .card-name {
  margin: 0;
}
.c2-tag-ok {
  flex: none;
  border-color: color-mix(in srgb, var(--eco) 35%, var(--line));
  background: var(--eco-soft);
  color: var(--eco);
}
.c2-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 0;
}
.c2-types {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.c2-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.c2-type:hover {
  color: var(--ink);
}
.c2-type.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
  font-weight: 600;
}
.c2-type:focus-visible,
.c2-leg:focus-visible,
.dk-chip:focus-visible,
.dk-col:focus-visible,
.dk-sort:focus-visible,
.dk-ref:focus-visible,
.dk-rowref:focus-visible,
.dk-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.c2-glyph {
  inline-size: 16px;
  block-size: 16px;
}
@container (max-width: 520px) {
  .c2-type-name {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .c2-type {
    padding: 0 7px;
  }
}
.c2-svg .c2-mark {
  transition: opacity 0.15s ease;
}
.c2-plot.has-active .c2-mark:not(.is-active) {
  opacity: 0.45;
}
.c2-svg .c2-mark,
.c2-svg .c2-hit {
  cursor: pointer;
}
.c2-hit {
  fill: transparent;
}
.c2-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.c2-line.is-y2 {
  stroke-dasharray: 6 4;
}
.c2-area {
  fill-opacity: 0.16;
}
.c2-dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}
.c2-annot rect {
  fill: var(--surface);
  stroke: var(--line-strong);
}
.c2-annot text,
.c2-ref-text,
.c2-axis-name {
  font-size: 11px;
  fill: var(--ink-2);
  font-weight: 600;
}
.c2-ref {
  stroke: var(--danger-ink);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.c2-trend {
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.c2-pt {
  fill-opacity: 0.75;
  stroke: var(--surface);
  stroke-width: 1;
}
.c2-pt.is-bubble {
  fill-opacity: 0.5;
}
.c2-slice {
  stroke: var(--surface);
  stroke-width: 2;
}
.c2-slice-text,
.c2-on-mark {
  font-size: 12px;
  font-weight: 650;
  fill: #ffffff;
}
.c2-donut-total {
  font-size: 20px;
  font-weight: 700;
  fill: var(--ink);
}
.c2-donut-label {
  font-size: 11px;
  fill: var(--muted);
}
.c2-whisker,
.c2-connector {
  stroke: var(--ink-2);
  stroke-width: 1.5;
}
.c2-connector {
  stroke-dasharray: 2 3;
}
.c2-box {
  fill-opacity: 0.25;
  stroke: var(--series-1);
  stroke-width: 1.5;
}
.c2-median {
  stroke: var(--series-1);
  stroke-width: 3;
}
.c2-mean {
  fill: var(--series-2);
}
.c2-outlier {
  fill: none;
  stroke: var(--series-2);
  stroke-width: 1.5;
}
.c2-heat {
  stroke: none;
}
.c2-heat.is-empty {
  fill: var(--line);
}
.c2-heat-text {
  font-size: 11px;
  fill: var(--ink);
}
.c2-heat-text.is-dark {
  fill: #ffffff;
}
.c2-kpi-value {
  font-size: 34px;
  font-weight: 700;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}
.c2-kpi-label {
  font-size: 13px;
  fill: var(--muted);
}
.c2-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 14px 0;
}
.c2-legend:empty {
  display: none;
}
.c2-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.c2-leg.is-off {
  opacity: 0.5;
  text-decoration: line-through;
}
.c2-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 14px 0;
  color: var(--ink-2);
  font-size: 0.84rem;
}
.c2-menu {
  position: relative;
}
.c2-menu > summary {
  list-style: none;
  display: inline-flex;
}
.c2-menu > summary::-webkit-details-marker {
  display: none;
}
.c2-menu-list {
  position: absolute;
  z-index: 5;
  inset-block-end: calc(100% + 4px);
  inset-inline-start: 0;
  display: grid;
  min-inline-size: 170px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.c2-menu-list .btn {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.c2-menu-list .btn:hover {
  background: var(--surface-2);
}

/* ---- the data card */
.dk-card {
  gap: 0;
  padding: 0;
}
.dk-top {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-block-end: 1px solid var(--line);
}
.dk-head-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.dk-badge {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 38px;
  block-size: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.dk-badge .dk-glyph {
  inline-size: 20px;
  block-size: 20px;
}
.dk-title {
  flex: 1;
  min-inline-size: 0;
}
.dk-name {
  margin: 0;
  overflow-wrap: anywhere;
}
.dk-title .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 2px 0 0;
}
.dk-complete {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--eco-soft);
  color: var(--eco);
  font-size: 0.76rem;
  font-weight: 600;
}
.dk-complete.is-low {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.dk-notes {
  color: var(--muted);
  font-size: 0.8rem;
}
.dk-cols {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.dk-cols > li {
  flex: none;
  scroll-snap-align: start;
}
.dk-col {
  display: grid;
  gap: 6px;
  inline-size: 168px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.dk-col:hover {
  border-color: var(--accent);
}
.dk-col-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
  font-size: 0.84rem;
  font-weight: 600;
}
.dk-col-name {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-glyph {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  color: var(--accent);
}
.dk-col.is-date .dk-glyph {
  color: var(--series-2);
}
.dk-col.is-category .dk-glyph,
.dk-col.is-bool .dk-glyph {
  color: var(--series-3);
}
.dk-col.is-text .dk-glyph,
.dk-col.is-id .dk-glyph {
  color: var(--muted);
}
.dk-miss {
  flex: none;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.7rem;
  font-weight: 600;
}
.dk-col-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.dk-mini {
  flex: none;
  inline-size: 64px;
  block-size: 22px;
}
.dk-spark {
  fill: none;
  stroke-width: 1.8;
}
.dk-col-stat {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.dk-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-block-end: 1px solid var(--line);
}
.dk-h {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.dk-chip:hover {
  border-color: var(--accent);
}
.dk-chip.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.dk-chip.is-asked .icon {
  color: var(--accent);
}
.dk-chip .icon {
  inline-size: 16px;
  block-size: 16px;
}
.dk-stage:empty {
  display: none;
}
.dk-analysis {
  display: grid;
  gap: 10px;
}
.dk-analysis .c2-card {
  border-radius: 12px;
}
.dk-result-wrap {
  overflow-x: auto;
}
.dk-result {
  border-collapse: collapse;
  min-inline-size: 100%;
  font-size: 0.84rem;
}
.dk-result th,
.dk-result td {
  padding: 5px 10px 5px 0;
  border-block-end: 1px solid var(--line);
  text-align: start;
  white-space: nowrap;
}
.dk-result thead th {
  color: var(--muted);
  font-weight: 600;
}
.dk-result .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.dk-more {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.dk-table {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
}
.dk-tools,
.dk-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dk-filter[hidden] {
  display: none;
}
.dk-search,
.dk-select {
  min-block-size: 34px;
  padding: 0 10px;
  border: 1px solid var(--control-line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}
.dk-tools .dk-search {
  flex: 1 1 180px;
  min-inline-size: 0;
}
.dk-fval {
  flex: 1 1 120px;
  min-inline-size: 0;
}
.dk-select {
  max-inline-size: 46%;
}
.dk-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.dk-scroll {
  position: relative;
  max-block-size: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.84rem;
  overscroll-behavior: contain;
}
.dk-row {
  display: grid;
  grid-template-columns: var(--dk-cols);
  inline-size: var(--dk-w, 100%);
  block-size: 34px;
}
.dk-head,
.dk-foot {
  position: sticky;
  z-index: 2;
  background: var(--surface-2);
}
.dk-head {
  inset-block-start: 0;
  border-block-end: 1px solid var(--line-strong);
}
.dk-foot {
  inset-block-end: 0;
  border-block-start: 1px solid var(--line-strong);
  font-weight: 650;
}
.dk-body {
  position: relative;
  inline-size: var(--dk-w, 100%);
  block-size: var(--dk-h, 0px);
}
.dk-body > .dk-row {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  transform: translateY(var(--dk-y, 0px));
  border-block-end: 1px solid var(--line);
}
.dk-body > .dk-row:hover {
  background: var(--accent-soft);
}
.dk-cell {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dk-body .dk-cell[data-ref] {
  cursor: pointer;
}
.dk-cell.dk-num {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.dk-cell.is-empty::after {
  content: "—";
  color: var(--line-strong);
}
.dk-n {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  justify-content: flex-end;
  background: inherit;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dk-body .dk-n {
  background: var(--surface);
}
.dk-th {
  gap: 2px;
  padding: 0 4px 0 8px;
}
.dk-sort {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 5px;
  min-inline-size: 0;
  block-size: 30px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.dk-th.dk-num .dk-sort {
  justify-content: flex-end;
}
.dk-th-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-arrow {
  color: var(--accent);
}
.dk-ref,
.dk-rowref {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.dk-ref {
  flex: none;
  inline-size: 26px;
  block-size: 26px;
  opacity: 0.6;
}
.dk-ref .icon {
  inline-size: 14px;
  block-size: 14px;
}
.dk-th:hover .dk-ref,
.dk-ref:focus-visible {
  opacity: 1;
}
.dk-rowref {
  padding: 2px 4px;
}
.dk-rowref:hover,
.dk-ref:hover,
.dk-sort:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.dk-none {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}
.dk-load {
  justify-self: start;
}
.dk-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 14px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}
.dk-table.is-full {
  position: fixed;
  z-index: 60;
  inset: 0;
  align-content: start;
  grid-template-rows: auto auto 1fr auto;
  padding: 16px;
  background: var(--bg);
}
.dk-table.is-full .dk-scroll {
  max-block-size: none;
  block-size: 100%;
}
:root.dk-has-full {
  overflow: hidden;
}
@media (max-width: 560px) {
  .dk-top,
  .dk-section {
    padding: 12px;
  }
  .dk-col {
    inline-size: 150px;
  }
  .dk-scroll {
    max-block-size: 340px;
  }
  .dk-table.is-full {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .c2-svg .c2-mark {
    transition: none;
  }
}
@media (forced-colors: active) {
  .c2-mark,
  .dk-mini rect {
    fill: CanvasText;
    forced-color-adjust: none;
  }
  .c2-line,
  .dk-spark {
    stroke: CanvasText;
  }
  .dk-chip.is-on,
  .c2-type.is-on {
    outline: 2px solid Highlight;
  }
}
/* ==================================================================== end of data analysis section */
/* ==================================================================== data analysis: « Modifier le graphique »
   The 2-3 edits under the asked chart, the version badge and the compact card of a follow-up. Tokens only. */
.dk-next {
  display: grid;
  gap: 8px;
  padding-block: 4px 2px;
}
.dk-next-h {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
}
.dk-next-h .icon {
  inline-size: 14px;
  block-size: 14px;
}
.dk-next-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dk-next-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 36px;
  max-inline-size: 100%;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  text-align: start;
  cursor: pointer;
}
.dk-next-chip .icon {
  inline-size: 14px;
  block-size: 14px;
  color: var(--ink-2);
  transform: rotate(90deg);
}
.dk-next-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dk-next-chip:hover .icon {
  color: var(--accent);
}
.dk-next-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dk-version {
  margin-inline-start: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
}
.dk-fold-sum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 32px;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.dk-fold-sum::-webkit-details-marker {
  display: none;
}
.dk-fold-sum .icon {
  inline-size: 14px;
  block-size: 14px;
  transition: transform 0.15s ease;
}
.dk-fold[open] .dk-fold-sum .icon {
  transform: rotate(90deg);
}
.dk-fold-body {
  padding-block-start: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .dk-fold-sum .icon {
    transition: none;
  }
}
/* ==================================================================== end of « Modifier le graphique » */
/* ==================================================================== lot 1 (28/11/2026): home, model state, errors
   One promise under the title, the presentation and the site first among the starters (quick-actions.js), « + Outils » in the message
   box, the model's real state on the pill and above the message box, its anchored menu, the welcome as a bottom
   sheet on phones. Tokens only. */

/* ---- home: one title, one promise (HOME-03); the starters' heading carries what Bird makes */
.empty-promise {
  max-inline-size: 35rem;
  margin: 14px auto 0;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: balance;
}
.fi-try {
  max-inline-size: 34rem;
  margin: 30px auto 12px;
  font: 600 0.92rem/1.45 var(--sans);
  color: var(--muted);
  text-wrap: balance;
}
.starters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* Présentation and Site & mini-app lead, side by side: two wide cards (two columns, two rows) with their drawing;
   the quick actions follow on one row */
.starters > li.is-featured {
  grid-column: span 2;
  grid-row: span 2;
}
.starter.is-featured {
  --c: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  column-gap: 12px;
  row-gap: 8px;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background:
    radial-gradient(
      120% 90% at 100% 100%,
      color-mix(in srgb, var(--accent) 9%, transparent),
      transparent 70%
    ),
    var(--surface);
}
.starter.is-featured .starter-title {
  font-size: 1.02rem;
}
.starter-thumb {
  grid-column: 1 / -1;
  justify-self: end;
  align-self: end;
  inline-size: min(100%, 210px);
  block-size: auto;
  overflow: visible;
}
.starter-thumb .st-win,
.starter-thumb .st-phone {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}
.starter-thumb .st-bar {
  stroke: var(--line);
  stroke-width: 1.2;
}
.starter-thumb .st-dot {
  fill: var(--line-strong);
}
.starter-thumb .st-hero {
  fill: color-mix(in srgb, var(--accent) 22%, var(--surface));
}
.starter-thumb .st-line {
  fill: var(--surface-2);
}
.starter-thumb .st-btn {
  fill: var(--accent);
}
.starter:hover .starter-thumb {
  transform: translateY(-2px);
}
.starter-thumb {
  transition: transform 0.25s;
}
.starter-doc {
  --c: var(--series-3);
}
.starter-mail {
  --c: var(--series-1);
}
.starters-more {
  margin-block-start: 10px;
  color: var(--ink-2);
}
.starters-more .icon {
  color: var(--accent);
}
.empty:has(#examples [data-example^="doc."]) .starters-more {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .empty-promise {
    animation: fi-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
  }
}
@media (prefers-reduced-motion: reduce) {
  .starter-thumb,
  .starter:hover .starter-thumb {
    transition: none;
    transform: none;
  }
}

/* laptops (800 px tall): the hero gets smaller so the three rows of starters sit above the message box */
@media (min-width: 521px) and (max-height: 920px) {
  .empty {
    padding-block-start: 0;
  }
  .fi-mark {
    inline-size: 46px;
    block-size: 40px;
  }
  .empty-title {
    margin-block-start: 10px;
    font-size: clamp(2rem, 4.2vw, 2.55rem);
  }
  .empty-promise {
    margin-block-start: 8px;
  }
  .empty .demo-note {
    margin-block-start: 10px;
  }
  .fi-try {
    margin-block: 18px 10px;
  }
  .starter {
    min-block-size: 60px;
    padding-block: 9px;
  }
  .starter-thumb {
    inline-size: min(100%, 150px);
  }
}
/* the « Plus d'outils » tile fills the last cell on a phone; elsewhere the link under the cards */
.starters > li.more-tile {
  display: none;
}
.starters > li.local-tile {
  display: none;
}
.starter-local {
  --c: var(--eco);
}
.starter-local.is-on {
  border-color: color-mix(in srgb, var(--eco) 45%, var(--line));
}
.starter-more {
  --c: var(--muted);
  border-style: dashed;
}

/* ---- phones (HOME-02): a smaller mark, the promise on one line, six compact 44 px starters above the message box */
@media (max-width: 520px) {
  .empty {
    display: flex;
    flex-direction: column;
    min-block-size: calc(var(--vvh, 100dvh) - 250px);
    padding-block-start: 4px;
  }
  .fi-mark {
    inline-size: 40px;
    block-size: 35px;
  }
  .empty-title {
    margin-block-start: 10px;
    font-size: clamp(1.6rem, 7.4vw, 2.1rem);
  }
  .empty-promise {
    margin-block-start: 8px;
    font-size: 0.92rem;
  }
  .empty .demo-note {
    margin-block-start: 10px;
  }
  .fi-try {
    margin-block: auto 8px;
    padding-block-start: 16px;
    font-size: 0.82rem;
  }
  .starters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  /* the two leading cards side by side (site, then presentation): one row less, so the whole grid — « Plus
     d'outils » and Bird local included — stays above the message box at 360 × 740 */
  .starters > li.is-featured {
    grid-column: auto;
    grid-row: auto;
  }
  .starter,
  .starter.is-featured {
    display: flex;
    gap: 8px;
    min-block-size: 44px;
    padding: 6px 8px;
    border-radius: 14px;
  }
  .starter-icon {
    inline-size: 28px;
    block-size: 28px;
    border-radius: 9px;
  }
  /* « Site & mini-app » on one line, like the other titles */
  .starter-title {
    white-space: nowrap;
  }
  .starter-icon .icon {
    inline-size: 18px;
    block-size: 18px;
  }
  .starter-title,
  .starter.is-featured .starter-title {
    font-size: 0.88rem;
    line-height: 1.2;
  }
  /* the description stays, on one line */
  .starter-desc {
    display: block;
    overflow: hidden;
    font-size: 0.74rem;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .starter-thumb {
    display: none;
  }
  .starters > li.more-tile {
    display: block;
  }
  .starters-more {
    display: none;
  }
  /* Bird local takes the free cell beside « Plus d'outils »; the line under the cards is for wider screens */
  .starters > li.local-tile {
    display: block;
  }
}

/* ---- the model pill: a solid border, a dot that tells the truth (TURN-07, HOME-07) */
.btn-chip.is-demo {
  border-style: solid;
  border-color: var(--line);
}
.btn-chip.is-demo .chip-dot {
  border: 0;
  background: var(--muted);
}
#btn-model.is-ready:not(.is-demo, .is-local) .chip-dot {
  background: var(--eco);
}
#btn-model.is-waking .chip-dot {
  background: var(--wx-sun);
}
#btn-model.is-asleep .chip-dot,
#btn-model.is-setup .chip-dot {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  #btn-model.is-waking .chip-dot {
    animation: model-breathe 1.6s ease-in-out infinite;
  }
}
@keyframes model-breathe {
  50% {
    opacity: 0.35;
  }
}
.model-menu {
  position: absolute;
  z-index: 40;
  inset-block-start: calc(100% - 4px);
  inset-inline-end: var(--mm-end, 12px); /* under the pill (app.js sets it from the pill's place) */
  inline-size: min(20rem, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.top {
  position: relative;
}
.mm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  min-block-size: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.mm-item:hover,
.mm-item:focus-visible {
  background: var(--surface-2);
}
.mm-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.mm-text {
  display: grid;
  flex: 1;
  min-inline-size: 0;
}
.mm-title {
  font-weight: 650;
  font-size: 0.92rem;
}
.mm-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.mm-check {
  color: var(--accent);
}
.mm-sep {
  margin: 4px 6px;
  border: 0;
  border-block-start: 1px solid var(--line);
}
.mm-more {
  min-block-size: 40px;
  font-size: 0.88rem;
  color: var(--link);
}
/* on a phone the pill is hidden: the dot sits on the menu button */
@media (max-width: 640px) {
  #btn-menu {
    position: relative;
  }
  #btn-menu::after {
    content: "";
    position: absolute;
    inset-block-start: 9px;
    inset-inline-end: 8px;
    inline-size: 8px;
    block-size: 8px;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--eco);
  }
  #btn-menu.is-waking::after {
    background: var(--wx-sun);
  }
  #btn-menu.is-asleep::after,
  #btn-menu.is-setup::after {
    background: var(--muted);
  }
}

/* ---- the calm line above the message box (waking, paused) */
.model-status {
  /* text flow, not flex: on a phone the sentence wraps beside its dot instead of leaving the dot alone on a line */
  display: block;
  margin: 0 4px 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.model-status[hidden] {
  display: none;
}
.model-status-dot {
  display: inline-block;
  inline-size: 8px;
  block-size: 8px;
  margin-inline-end: 8px;
  vertical-align: 0.05em;
  border-radius: 50%;
  background: var(--wx-sun);
}
.model-status.is-asleep .model-status-dot {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--muted);
}
.model-status .link {
  min-block-size: 32px;
  margin-inline-start: 8px;
  font-weight: 600;
}

/* ---- « + Outils » in the message box (HOME-11) */
.btn-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-block-size: 36px;
  padding-inline: 8px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}
.btn-tools[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-tools .icon {
  color: var(--accent);
}
@media (max-width: 330px) {
  .btn-tools-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
@media (pointer: coarse) {
  .btn-tools {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
}
.slash {
  max-block-size: min(52vh, 420px);
  overflow-y: auto;
}
.slash li.is-featured .chip-icon {
  color: var(--accent);
}

/* ---- error card: the wait line, the countdown */
.notice-wait {
  margin-block-start: 4px;
  font-size: 0.86rem;
  color: var(--muted);
}
.notice-actions .btn-primary {
  order: -1;
}

/* ---- the welcome: real buttons, a bottom sheet on phones (HOME-04) */
.w-try {
  font: 600 0.8rem/1.3 var(--sans);
  color: var(--muted);
}
.w-caps {
  gap: 6px;
}
.w-caps li {
  display: block;
}
.w-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 36px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.84rem/1.2 var(--sans);
  cursor: pointer;
}
.w-cap:hover {
  border-color: var(--accent);
}
.w-cap.is-featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
@media (pointer: coarse) {
  .w-cap {
    min-block-size: 44px;
  }
}
@media (max-width: 520px) {
  .welcome {
    inline-size: 100vw;
    max-inline-size: 100vw;
    max-block-size: 75vh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
  /* the sheet holds without scrolling: a shorter title, the values on one line each, the actions in a row */
  .welcome .w-title {
    font-size: 1.6rem;
  }
  .welcome .w-step {
    gap: 9px;
  }
  .w-value {
    padding-block: 5px;
  }
  .w-value span:last-child {
    font-size: 0.8rem;
  }
  .w-caps {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .w-caps li {
    flex: none;
    scroll-snap-align: start;
  }
  /* « Commencer » never below the fold: the actions hold the bottom of the sheet while the rest scrolls (it was
     28 px under the screen at 360 × 740, « En savoir plus » cut in half) */
  .w-actions {
    position: sticky;
    inset-block-end: 0;
    z-index: 1;
    margin-inline: -16px;
    margin-block-end: -16px;
    padding: 10px 16px calc(12px + var(--safe-b));
    background: var(--surface);
  }
  /* the buttons say it: « Commencer par » stays for screen readers */
  .w-try {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .w-lead {
    font-size: 0.9rem;
  }
}
@media (max-height: 700px) {
  .w-caps,
  .w-try {
    display: flex;
  }
  .w-try {
    display: block;
  }
}
/* ==================================================================== end of lot 1 */

/* ---- UX lot 3: a touch screen without a keyboard has no use for the keyboard shortcuts entry of the menu */
@media (hover: none) and (pointer: coarse) {
  #nav-shortcuts {
    display: none;
  }
}
/* a phone with the « Bird fait une pause » line above the message box: the question over the cards gives its room,
   so the whole grid stays above the box (production, 29/11: the last row went under the line) */
@media (max-width: 520px) {
  body:has(#model-status:not([hidden])) .empty .fi-try {
    display: none;
  }
}
/* the last controls under 44 px on a phone (audit script, 360 px): the conversation search and the welcome's
   « En savoir plus » (« Voir la réflexion complète »: reflexion.css; « Demander à Bird »: canvas.css) */
@media (pointer: coarse) {
  .side-search input {
    min-block-size: 44px;
  }
  .w-more {
    display: inline-flex;
    align-items: center;
    min-block-size: 44px;
  }
}

/* ---- Bird local on the home screen: one quiet line under the starters, never a banner */
.local-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.local-strip[hidden] {
  display: none;
}
.local-strip > .icon {
  inline-size: 16px;
  block-size: 16px;
  color: var(--eco);
}
.local-strip.is-on .ls-text {
  color: var(--eco);
  font-weight: 600;
}
.local-strip .ls-act {
  min-block-size: 32px;
}
@media (pointer: coarse) {
  .local-strip .ls-act {
    min-block-size: 44px;
  }
}
@media (max-width: 520px) {
  .local-strip {
    display: none;
  }
}
/* ------------------------------------------------------------ Réglages, lot 3 (docs/UX.md) */
/* model cards: as many columns as fit, no hole in the grid; the title and hint sit at the top (SET-03) */
.modes {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.mode-text {
  align-content: start;
}
/* the hosted model's live state, in its card (SET-07): no « Tester » button for a server nobody configures */
.mode-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 4px;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.mode-state.is-ready .chip-dot {
  background: var(--eco);
}
.mode-state.is-waking .chip-dot {
  background: var(--wx-sun);
}
.mode-state.is-asleep .chip-dot {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .mode-state.is-waking .chip-dot {
    animation: model-breathe 1.6s ease-in-out infinite;
  }
}
/* « Avancé »: one's own server, folded (SET-06) */
.advanced > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 36px;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.advanced > summary::-webkit-details-marker {
  display: none;
}
.advanced > summary .chev {
  transition: transform 0.15s;
}
.advanced[open] > summary .chev {
  transform: rotate(90deg);
}
.advanced[open] {
  display: grid;
  gap: 10px;
}
/* « Enregistré ✓ » beside the control just changed (SYS-12) */
.saved-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 8px;
  color: var(--eco);
  font-size: 0.8rem;
  font-weight: 600;
}
.saved-mark .icon {
  inline-size: 14px;
  block-size: 14px;
}
@media (prefers-reduced-motion: no-preference) {
  .saved-mark {
    animation: saved-in 0.2s ease-out;
  }
}
@keyframes saved-in {
  from {
    opacity: 0;
  }
}
/* Données: export, import, then the reset at its natural width and in the danger colour at rest (SET-05) */
.data-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-natural {
  justify-self: start;
  max-inline-size: 100%;
  white-space: normal;
  text-align: start;
}
.btn-outline.btn-danger {
  border-color: var(--danger-line);
  color: var(--danger-ink);
}
.keys-entry {
  margin: 0;
}
/* keyboard shortcuts mean nothing on a touch screen (KEY-01) */
@media (hover: none) and (pointer: coarse) {
  .keys-entry {
    display: none;
  }
}
/* FP-03: the two scope segments stay on one line each at 360 px */
.seg {
  white-space: nowrap;
}
@media (max-width: 400px) {
  .seg {
    padding-inline: 10px;
    font-size: 0.82rem;
  }
}
/* SYS-12: toasts at the bottom, above the composer when it is there: never over the control just changed */
.toasts {
  inset-block: auto calc(20px + var(--safe-b));
}
body:has(#dock:not([hidden])) .toasts {
  inset-block-end: calc(150px + var(--safe-b));
}
/* HOME-06: the first screen keeps few controls. « + Outils » in the composer opens the whole catalogue: no second
   « Plus d'outils » under the cards (a phone keeps its tile in the grid) */
.starters-more {
  display: none;
}
.side-search[hidden],
#btn-new[hidden] {
  display: none;
}
/* lot 3 review: the folds of the footprint and the « À propos » buttons keep 44 px targets on a touch screen */
@media (pointer: coarse) {
  .fp-all > summary,
  .fp-method > summary {
    padding-block: 10px; /* 26 px of text: 44 px or more to tap */
  }
  .about-intro .btn {
    min-block-size: 44px;
  }
}

/* agents.css */
/* Mode Agent: « l'équipe au travail ». Colours come from app.css tokens (light and dark). */

/* phones: the composer row stays tight so the Send button never leaves it (the Mode Agent is in Settings) */
@media (max-width: 640px) {
  .composer-row {
    gap: 4px;
  }
}

/* ---------------------------------------------------------------- the team at work */

.crew {
  margin-block: 4px 12px;
}
.crew-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-block-end: 8px;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.crew-mark {
  color: var(--accent);
  font-weight: 700;
}
.crew-title {
  font-weight: 650;
  color: var(--ink);
}
.crew-why {
  font-size: 0.8rem;
  color: var(--muted);
}
.crew-chip.is-note .crew-mark {
  color: var(--muted);
}
.crew-out {
  margin-inline-start: auto;
  font-size: 0.8rem;
}
.crew-board {
  display: grid;
  gap: 8px;
}
.crew-phase {
  display: grid;
  gap: 4px;
}
.crew-phase.is-skipped {
  opacity: 0.55;
}
.crew-phase-name {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.crew-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* phones: two lanes of 180 px broke their lines word by word; side by side only where each has room */
@media (max-width: 480px) {
  .crew-lanes {
    grid-template-columns: 1fr;
  }
}
.crew-lane {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px;
  min-inline-size: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  transition: border-color 0.2s;
}
.crew-lane.is-running {
  border-color: var(--accent);
}
.crew-lane.is-chosen {
  border-color: var(--eco);
  box-shadow: inset 0 0 0 1px var(--eco);
}
.crew-lane.is-skipped,
.crew-lane.is-cancelled,
.crew-lane.is-queued {
  color: var(--muted);
  background: transparent;
}
.crew-lane.is-error {
  border-color: var(--danger-line);
}
.crew-ic {
  display: grid;
  place-items: center;
  inline-size: 26px;
  block-size: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}
.crew-lane.is-running .crew-ic {
  background: var(--accent-soft);
  color: var(--accent);
}
.crew-ic .icon {
  inline-size: 15px;
  block-size: 15px;
}
.crew-body {
  min-inline-size: 0;
}
.crew-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}
.crew-lane.is-skipped .crew-label,
.crew-lane.is-cancelled .crew-label,
.crew-lane.is-queued .crew-label {
  color: var(--muted);
  font-weight: 550;
}
.crew-kept {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--eco-soft);
  color: var(--eco);
  font-size: 0.7rem;
  font-weight: 650;
}
.crew-kept.is-part {
  background: none;
  box-shadow: inset 0 0 0 1px var(--eco);
}
.crew-detail,
.crew-tools {
  margin: 2px 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.crew-tools {
  font-size: 0.72rem;
}
.crew-bar {
  display: block;
  block-size: 3px;
  margin-block-start: 6px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.crew-bar-fill {
  display: block;
  block-size: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: inline-size 0.4s ease-out;
}
.crew-state {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--muted);
}
.crew-dot {
  display: grid;
  place-items: center;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}
.crew-lane.is-queued .crew-dot {
  border: 1.5px solid var(--line-strong);
}
.crew-lane.is-running .crew-dot {
  inline-size: 10px;
  block-size: 10px;
  margin: 3px;
  background: var(--accent);
  animation: crew-pulse 1.2s ease-in-out infinite;
}
.crew-lane.is-done .crew-dot {
  background: var(--eco-soft);
  color: var(--eco);
}
.crew-lane.is-stopped {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}
.crew-lane.is-stopped .crew-dot {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.5rem;
}
.crew-lane.is-error .crew-dot {
  background: var(--danger-bg);
  color: var(--danger-ink);
}
@keyframes crew-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}
.crew-fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-block-size: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius); /* as the steps fold just above other answers */
  background: var(--surface);
  font-size: 0.84rem;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}
.crew-fold > summary::-webkit-details-marker {
  display: none;
}
.crew-fold > summary::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
[dir="rtl"] .crew-fold > summary::before {
  transform: rotate(135deg);
}
.crew-fold[open] > summary::before {
  transform: rotate(45deg);
}
.crew-fold[open] > summary {
  margin-block-end: 8px;
}
/* the long team line wraps beside its chevron (a phone showed the chevron alone on a line above it) */
.crew-fold > summary::before {
  flex: none;
}
.crew-sum-text {
  flex: 1 1 12rem;
  min-inline-size: 0;
  font-weight: 600;
  color: var(--ink);
}
.crew-sum-hint {
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .crew-lane,
  .crew-bar-fill,
  .crew-fold > summary::before {
    transition: none;
  }
  .crew-lane.is-running .crew-dot {
    animation: none;
  }
}
/* below 390 px the composer row cannot hold « Réflexion », the Agent pill and Send: the switch keeps its
   accessible name, its visible label steps aside (the pill never shrinks into an ellipsis) */
@media (max-width: 389px) {
  .composer-row .switch-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
.crew-lane.is-queued,
.crew-lane.is-cancelled,
.crew-lane.is-skipped {
  padding-block: 5px;
}
@media (max-width: 420px) {
  /* with the Agent control, Stop shows its icon only (its label stays for screen readers) */
  .composer-row .btn-stop {
    inline-size: 40px;
    flex: none;
    padding: 0;
    justify-content: center;
  }
  .composer-row .btn-stop span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
/* touch screens: 44 px targets, like the frequent controls of the app.css coarse-pointer block */
@media (pointer: coarse) {
  .crew-fold > summary,
  .composer-row .btn-stop {
    min-block-size: 44px;
  }
}
@media (pointer: coarse) and (max-width: 420px) {
  .composer-row .btn-stop {
    inline-size: 44px;
  }
}
/* ---------------------------------------------------------------- wave 2: the plan card */

.crew-plan {
  margin-block: 4px 14px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin-block-end: 10px;
}
.plan-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}
.crew-steps {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.crew-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 30px;
  padding: 3px 8px 3px 4px;
  border-radius: var(--radius-s);
  font-size: 0.86rem;
  color: var(--ink-2);
}
.crew-step-mark {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.crew-step-mark .icon {
  inline-size: 13px;
  block-size: 13px;
  stroke-width: 2.2;
}
.crew-step.is-done {
  color: var(--muted);
}
.crew-step.is-done .crew-step-mark {
  border-color: transparent;
  background: var(--eco-soft);
  color: var(--eco);
}
.crew-step.is-current {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.crew-step.is-current .crew-step-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.crew-steps.is-plan .crew-step {
  color: var(--ink);
}
.plan-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.plan-fact {
  display: grid;
  gap: 1px;
  min-inline-size: 0;
  padding: 7px 10px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.plan-fact-k {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-fact-v {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.plan-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
}
.plan-foot .btn .icon {
  inline-size: 15px;
  block-size: 15px;
}
.plan-simple {
  margin-inline-start: auto;
  font-size: 0.82rem;
}
.plan-count-down {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
/* the countdown ring empties over the plan's delay (--plan-s, set through CSSOM) */
.plan-ring {
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--p, 1) * 360deg),
    var(--surface-2) 0
  );
  animation: plan-ring var(--plan-s, 5s) linear forwards;
}
@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}
@keyframes plan-ring {
  to {
    --p: 0;
  }
}
.plan-editor {
  display: grid;
  gap: 12px;
  margin-block-end: 12px;
}
.plan-field {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.plan-field legend,
.plan-label {
  padding: 0;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  justify-self: start;
}
.plan-seg-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
  padding-inline: 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
}
.plan-seg-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.plan-seg-opt.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
.plan-seg-opt:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.plan-count {
  grid-template-columns: auto auto 2.4rem auto;
  align-items: center;
  justify-content: start;
  column-gap: 8px;
}
.plan-count .plan-label {
  margin-inline-end: 6px;
}
.plan-count-n {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}
.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plan-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-inline-size: 100%;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.82rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.plan-tag-x {
  display: grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.plan-tag-x:hover {
  background: var(--surface);
}
.plan-tag-x .icon {
  inline-size: 12px;
  block-size: 12px;
}
.plan-add {
  display: flex;
  gap: 6px;
}
.crew-input {
  min-inline-size: 0;
  flex: 1 1 auto;
  min-block-size: 36px;
  padding: 6px 10px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--surface);
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}
.crew-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- wave 2: the team at work, in one line */

.crew-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-block-size: 40px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  margin-block-end: 8px;
}
.crew-pulse {
  flex: none;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: crew-ring 1.6s ease-out infinite;
}
.crew-pulse.is-idle {
  background: var(--muted);
  animation: none;
}
@keyframes crew-ring {
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.crew-now-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.crew-now-time {
  font-size: 0.82rem;
  color: var(--muted);
}
.crew-now-time::before {
  content: "· ";
}
.crew-now-acts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: auto;
}
.crew-act .icon {
  inline-size: 15px;
  block-size: 15px;
}
.crew-act-short {
  display: none;
}
.crew-toggle .icon {
  transition: transform 0.15s;
}
.crew-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
.crew-notify {
  display: inline-block;
  margin: -2px 0 8px 2px;
  font-size: 0.8rem;
}
.crew-sub {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.crew-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.crew-questions {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  padding: 0 0 0 14px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.crew-sources {
  margin-block-end: 10px;
}
.crew-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crew-chip-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  animation: crew-in 0.25s ease-out;
}
.crew-chip-site::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--eco);
}
.crew-chip-site.is-running::before {
  background: var(--accent);
  animation: crew-pulse 1.2s ease-in-out infinite;
}
.crew-chip-site.is-error {
  color: var(--muted);
  text-decoration: line-through;
}
.crew-chip-site.is-error::before {
  background: var(--line-strong);
}
@keyframes crew-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}
.crew-notes {
  margin-block: 10px 4px;
}
.crew-note-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crew-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 0.84rem;
  color: var(--ink);
}
.crew-note .icon {
  inline-size: 15px;
  block-size: 15px;
  color: var(--accent);
}
.crew-note-state {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-2);
}
.crew-note.is-applied .crew-note-state {
  background: var(--eco-soft);
  color: var(--eco);
}
.crew-note.is-late .crew-note-state {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.crew-note-form {
  margin-block-end: 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface));
}
.crew-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crew-note-row select.crew-input {
  flex: 0 1 12rem;
}
.crew-note-row input.crew-input {
  flex: 1 1 10rem;
}
.crew-did {
  margin-block-start: 2px;
}
.crew-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-block-start: 8px;
}
.crew-resume .crew-hint {
  margin: 0;
}

/* ---------------------------------------------------------------- wave 2: « Vérifications faites » */

.vc {
  margin-block: 14px 6px;
  border: 1px solid color-mix(in srgb, var(--eco) 32%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--eco-soft) 55%, var(--surface)) 0,
    var(--surface) 64px
  );
  overflow: hidden;
}
.vc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 56px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.vc-head::-webkit-details-marker {
  display: none;
}
.vc-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius);
}
.vc-badge {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 50%;
  background: var(--eco);
  color: var(--surface);
}
.vc-badge .icon {
  inline-size: 19px;
  block-size: 19px;
  stroke-width: 1.8;
}
.vc-title-wrap {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
  flex: 1;
}
.vc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.vc-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.vc-count b {
  font-weight: 750;
}
.vc-count.is-verified b {
  color: var(--eco);
}
.vc-count.is-review b {
  color: var(--warn-ink);
}
.vc-count + .vc-count::before {
  content: "·";
  margin-inline-end: 12px;
  color: var(--muted);
}
.vc-chev .icon {
  inline-size: 18px;
  block-size: 18px;
  color: var(--muted);
  transition: transform 0.15s;
}
.vc[open] .vc-chev .icon {
  transform: rotate(180deg);
}
.vc-body-wrap {
  padding: 2px 14px 12px;
  border-block-start: 1px solid var(--line);
}
.vc-group-title {
  margin: 12px 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.vc-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.vc-item {
  display: grid;
  grid-template-columns: minmax(3.6rem, auto) minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 9px 0;
  border-block-start: 1px solid var(--line);
}
.vc-list > .vc-item:first-child {
  border-block-start: 0;
}
.vc-value {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--eco-soft);
  font-size: 0.86rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--eco);
  white-space: nowrap;
}
.vc-item.is-removed .vc-value {
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: line-through;
}
.vc-item.is-review .vc-value {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.vc-body {
  min-inline-size: 0;
}
.vc-sentence {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.vc-item.is-removed .vc-sentence {
  color: var(--muted);
}
.vc-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 6px;
  margin: 6px 0 0;
  padding: 6px 10px;
  border-inline-start: 3px solid color-mix(in srgb, var(--eco) 55%, var(--line));
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.vc-line .icon {
  inline-size: 13px;
  block-size: 13px;
  margin-block-start: 2px;
  color: var(--muted);
}
.vc-src {
  grid-column: 2;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 650;
  color: var(--muted);
}
.vc-why {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.vc-state {
  display: grid;
  place-items: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: var(--eco-soft);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--eco);
}
.vc-item.is-removed .vc-state {
  background: var(--surface-2);
  color: var(--muted);
}
.vc-item.is-review .vc-state {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.vc-foot {
  margin: 12px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- wave 2: « Livrables » */

.btn-deliverables .icon {
  color: var(--accent);
}
.deliv-n {
  min-inline-size: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
}
.modal.deliverables {
  inline-size: min(36rem, calc(100vw - 24px));
}
.deliv-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.deliv-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
  border-block-start: 1px solid var(--line);
}
.deliv-item:first-child {
  border-block-start: 0;
}
.deliv-ic {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.deliv-ic.is-slides {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.deliv-ic.is-document {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.deliv-ic.is-sheet {
  background: var(--eco-soft);
  color: var(--eco);
}
.deliv-text {
  min-inline-size: 0;
}
.deliv-name {
  margin: 0;
  font-weight: 650;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.deliv-meta {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.deliv-acts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (min-width: 560px) {
  .deliv-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .deliv-acts {
    grid-column: auto;
  }
}
@media (max-width: 640px) {
  .btn-deliverables {
    padding-inline: 8px;
  }
  .btn-deliverables .deliv-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .crew-plan {
    padding: 12px;
  }
  .plan-simple {
    margin-inline-start: 0;
  }
  .crew-now-acts {
    margin-inline-start: 0;
    inline-size: 100%;
    justify-content: flex-start;
  }
  .crew-now-acts .crew-toggle {
    margin-inline-start: auto;
  }
  .vc-count + .vc-count::before {
    content: none;
  }
  .crew-act .crew-act-long {
    display: none;
  }
  .crew-act .crew-act-short {
    display: inline;
  }
  .vc-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .vc-value {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .vc-item .vc-body {
    grid-row: 2;
  }
  .vc-item .vc-state {
    grid-row: 1;
    grid-column: 2;
  }
}
@media (pointer: coarse) {
  .crew-act,
  .crew-toggle,
  .plan-seg-opt,
  .plan-tag-x {
    min-block-size: 44px;
  }
  .plan-tag-x {
    min-inline-size: 44px;
  }
  .vc-head {
    min-block-size: 60px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .plan-ring,
  .crew-pulse,
  .crew-chip-site,
  .crew-chip-site.is-running::before,
  .crew-toggle .icon,
  .vc-chev .icon {
    animation: none;
    transition: none;
  }
}
.crew-now-time:empty::before {
  content: none;
}

/* modules.css */
/* Small modules (modules.js, followups.js): research card, relation graph, timeline, matrix, calculator, checklist,
   follow-up chips and answer enhancements. Tokens of app.css only, so light and dark follow the theme. */

:root {
  --gr-organisation: var(--series-1);
  --gr-personne: var(--series-2);
  --gr-lieu: var(--series-3);
  --gr-produit: var(--series-6);
  --gr-texte: var(--series-4);
  --gr-concept: var(--series-7);
  --mod-best: color-mix(in srgb, var(--eco) 14%, transparent);
  --mod-verdict: color-mix(in srgb, var(--accent) 10%, transparent);
}

.mod-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}
.mod-title .icon {
  color: var(--link);
  inline-size: 18px;
  block-size: 18px;
}
.mod-block {
  display: grid;
  gap: 6px;
}
.mod-block > .mod-eyebrow {
  margin: 0;
}
.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mod-cite {
  font-size: 0.78em;
  color: var(--link);
  text-decoration: none;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.mod-cite:hover,
.mod-cite:focus-visible {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- research card */
.rs-topic {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
}
.rs-plan {
  margin: 0;
  list-style: decimal;
  padding-inline-start: 1.3em;
  display: grid;
  gap: 4px;
  color: var(--ink-2);
}
.rs-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.rs-source {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--surface-2) 35%, var(--surface));
  min-inline-size: 0;
}
.rs-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  min-inline-size: 0;
}
.rs-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.rs-count {
  margin-inline-start: auto;
  white-space: nowrap;
}
.rs-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
a.rs-link {
  color: var(--link);
}
.rs-quote {
  margin: 0;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--accent-soft);
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.45;
}

/* ---------------------------------------------------------------- relation graph */
.gr-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background:
    radial-gradient(
        circle at 1px 1px,
        color-mix(in srgb, var(--line-strong) 45%, transparent) 1px,
        transparent 0
      )
      0 0 / 18px 18px,
    var(--surface);
  overflow: hidden;
}
.gr-svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 16 / 10;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.gr-svg:active {
  cursor: grabbing;
}
.gr-tools {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 6px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
}
.gr-edge {
  stroke: var(--line-strong);
  stroke-width: 1.4;
}
.gr-edge.is-on {
  stroke: var(--accent);
  stroke-width: 2.2;
}
.gr-arrowhead {
  fill: var(--line-strong);
}
.gr-elabel {
  font-size: 10px;
  fill: var(--muted);
  opacity: 0;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}
.gr-elabel.is-on {
  opacity: 1;
  fill: var(--ink);
}
.gr-svg:not(.has-pick) .gr-elabel {
  opacity: 0.85;
}
.gr-node {
  cursor: pointer;
  outline: none;
}
.gr-node circle {
  fill: var(--gr-concept);
  stroke: var(--surface);
  stroke-width: 2;
  transition: r 0.15s;
}
.gr-label {
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3.5px;
  pointer-events: none;
}
.gr-node:focus-visible circle,
.gr-node.is-on circle {
  stroke: var(--accent);
  stroke-width: 3.5;
}
.gr-node.is-dim,
.gr-edge.is-hidden,
.gr-elabel.is-hidden {
  opacity: 0.18;
}
.gr-node.is-hidden {
  display: none;
}
.gr-edge.is-hidden {
  opacity: 0;
}
.gr-t-organisation circle,
.gr-dot.gr-t-organisation {
  fill: var(--gr-organisation);
  background: var(--gr-organisation);
}
.gr-t-personne circle,
.gr-dot.gr-t-personne {
  fill: var(--gr-personne);
  background: var(--gr-personne);
}
.gr-t-lieu circle,
.gr-dot.gr-t-lieu {
  fill: var(--gr-lieu);
  background: var(--gr-lieu);
}
.gr-t-produit circle,
.gr-dot.gr-t-produit {
  fill: var(--gr-produit);
  background: var(--gr-produit);
}
.gr-t-texte circle,
.gr-dot.gr-t-texte {
  fill: var(--gr-texte);
  background: var(--gr-texte);
}
.gr-t-concept circle,
.gr-dot.gr-t-concept {
  fill: var(--gr-concept);
  background: var(--gr-concept);
}
.gr-dot {
  display: inline-block;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  flex: none;
}
.gr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gr-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--surface-2) 40%, var(--surface));
  font-size: 0.9rem;
}
.gr-panel > p {
  margin: 0;
}
.gr-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.98rem;
}
.gr-links,
.gr-claims,
.gr-list ul {
  margin: 0;
  padding-inline-start: 1.2em;
  display: grid;
  gap: 4px;
}
.gr-rel {
  color: var(--muted);
  font-style: italic;
}
.gr-list summary {
  cursor: pointer;
  color: var(--link);
  font-size: 0.9rem;
}
.gr-list[open] summary {
  margin-block-end: 6px;
}

/* ---------------------------------------------------------------- timeline */
.tl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  position: relative;
}
.tl-item {
  display: grid;
  grid-template-columns: minmax(64px, max-content) 18px 1fr;
  gap: 0 10px;
  align-items: start;
  padding-block: 6px;
  position: relative;
}
.tl-date {
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--link);
  text-align: end;
  white-space: nowrap;
}
.tl-dot {
  position: relative;
  align-self: stretch;
  margin-block: -6px;
  background: linear-gradient(var(--line), var(--line)) center / 2px 100% no-repeat;
}
.tl-item:first-child .tl-dot {
  background-position: center 14px;
}
.tl-item:last-child .tl-dot {
  background-size: 2px 14px;
  background-position: center top;
}
.tl-dot::before {
  content: "";
  position: absolute;
  inset-block-start: 11px;
  inset-inline-start: 50%;
  translate: -50% 0;
  inline-size: 11px;
  block-size: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-sizing: border-box;
}
.tl-label {
  font-size: 0.93rem;
  line-height: 1.45;
}

/* ---------------------------------------------------------------- matrix */
.mx-table th,
.mx-table td {
  white-space: nowrap;
}
.mx-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: start;
}
.mx-sort:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.mx-arrow::after {
  content: "↕";
  opacity: 0.4;
  font-size: 0.85em;
}
[aria-sort="ascending"] .mx-arrow::after {
  content: "↑";
  opacity: 1;
}
[aria-sort="descending"] .mx-arrow::after {
  content: "↓";
  opacity: 1;
}
.mx-table .is-best {
  background: var(--mod-best);
  font-weight: 650;
}
.mx-table .is-best > span:first-child::before {
  content: "★ ";
  color: var(--eco);
}
.mx-table tr.is-verdict > * {
  background: var(--mod-verdict);
}
.mx-table tr.is-verdict > .is-best {
  background: color-mix(in srgb, var(--eco) 18%, var(--mod-verdict));
}
.mx-verdict {
  margin-inline-start: 8px;
  font-size: 0.72rem;
}

/* ---------------------------------------------------------------- calculator */
.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
}
.calc-field {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.calc-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding-inline-end: 10px;
}
.calc-box:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.calc-in {
  inline-size: 100%;
  min-inline-size: 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
}
.calc-unit {
  color: var(--muted);
  font-size: 0.9rem;
}
.calc-rows {
  margin: 0;
  display: grid;
  gap: 2px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-block: 6px;
  border-block-end: 1px dashed var(--line);
}
.calc-row:last-child {
  border-block-end: 0;
}
.calc-row dt {
  color: var(--ink-2);
  font-size: 0.92rem;
}
.calc-row dd {
  margin: 0;
  font-weight: 600;
  text-align: end;
}
.calc-row.is-main dd {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--brand);
}
.calc-formula {
  margin: 0;
  font-size: 0.8rem;
}
.calc-formula code {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- checklist */
.ck-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ck-progress {
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}
.ck-bar {
  flex: 1;
  block-size: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.ck-bar-fill {
  display: block;
  block-size: 100%;
  inline-size: var(--p, 0%);
  background: var(--eco);
  transition: inline-size 0.2s;
}
.chk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.chk-item {
  display: grid;
  gap: 2px;
  padding-block: 7px;
  border-block-end: 1px solid var(--line);
}
.chk-item:last-child {
  border-block-end: 0;
}
.chk-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.chk-box,
.md-task-box {
  inline-size: 18px;
  block-size: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--eco);
  cursor: pointer;
}
.chk-item.is-done .chk-text,
.md-task.is-done {
  text-decoration: line-through;
  color: var(--muted);
}
.chk-meta {
  padding-inline-start: 28px;
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------- answer enhancements */
.md-tasks {
  list-style: none;
  padding-inline-start: 0.2em;
}
.md-task {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.md-task-box {
  margin-block-start: 0.25em;
}
.md-gloss {
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 3px;
  cursor: help;
}
.md-gloss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- chips (follow-ups, filters) */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 4px 2px;
}
.mchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.mchip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mchip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mchip-research::before {
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--accent);
}
/* the next steps under an answer: quiet, like ChatGPT's; long labels wrap inside the chip at 360 px. The outline
   keeps 3:1 against the page (WCAG 1.4.11): on a phone a chip must read as a button, not as loose text */
:root {
  --chip-line: #8e8c84; /* 3.09:1 on --bg */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chip-line: #5b6884; /* 3.35:1 on --bg */
  }
}
:root[data-theme="dark"] {
  --chip-line: #5b6884;
}
.chips-row .mchip {
  max-inline-size: 100%;
  border-color: var(--chip-line);
  border-radius: 18px;
  background: transparent;
  color: var(--ink-2);
  line-height: 1.3;
  text-align: start;
  white-space: normal;
}
.chips-row .mchip:hover {
  border-color: var(--muted);
  background: var(--surface-2);
  color: var(--ink);
}
.mchip-arrow {
  flex: none;
  color: var(--muted);
  font-size: 0.95em;
  line-height: 1;
}
.chips-row .mchip-research::before {
  display: none;
}
/* the next steps still on their way (followups.js chipsWaiting): two quiet placeholders hold the row's height, so
   the chips land in place instead of pushing the receipt down */
.chips-ghost {
  pointer-events: none;
}
.chips-row .mchip-ghost {
  inline-size: 9.5rem;
  border-color: var(--line);
  background: var(--surface-2);
  cursor: default;
  animation: chip-ghost 1.4s ease-in-out infinite alternate;
}
.chips-row .mchip-ghost + .mchip-ghost {
  inline-size: 7rem;
}
@keyframes chip-ghost {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 0.9;
  }
}
.gr-filter[aria-pressed="false"] {
  opacity: 0.55;
  text-decoration: line-through;
}

/* ---------------------------------------------------------------- team board: research plan and domains */
.crew-items {
  margin: 4px 0 0;
  padding-inline-start: 1.2em;
  display: grid;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--ink-2);
}
/* ---------------------------------------------------------------- pros and cons */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}
.pc-col {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.pc-col.is-pro {
  border-block-start: 3px solid var(--eco);
}
.pc-col.is-con {
  border-block-start: 3px solid var(--danger-ink);
}
.pc-h {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.pc-mark {
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--surface);
}
.is-pro .pc-mark {
  background: var(--eco);
}
.is-con .pc-mark {
  background: var(--danger-ink);
}
.pc-list {
  margin: 0;
  padding-inline-start: 1.1em;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- key figures */
.fg-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 8px;
}
.fg-tile {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.fg-v {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.fg-l {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- glossary */
.gl-filter {
  inline-size: 100%;
  padding: 7px 10px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.gl-list {
  margin: 0;
  display: grid;
  gap: 0;
}
.gl-row {
  display: grid;
  grid-template-columns: minmax(80px, max-content) 1fr;
  gap: 4px 14px;
  padding: 8px 0;
  border-block-end: 1px solid var(--line);
}
.gl-row:last-child {
  border-block-end: 0;
}
.gl-row dt {
  font-weight: 650;
}
.gl-row dd {
  margin: 0;
  color: var(--ink-2);
}
.gl-none {
  margin: 0;
}

/* ---------------------------------------------------------------- source cards */
.sc-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}
.sc-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  min-inline-size: 0;
}
.sc-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.sc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-2);
  min-inline-size: 0;
}
.sc-d {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-t {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--link);
  overflow-wrap: anywhere;
}
.sc-snip {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.45;
}
.sc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
}
@media (max-width: 520px) {
  .gl-row {
    grid-template-columns: 1fr;
  }
}

/* the graph while the research runs (liveGraph): no controls, the new nodes fade in */
.gr-live {
  display: grid;
  gap: 6px;
}
.gr-svg.is-live {
  aspect-ratio: 56 / 30;
  cursor: default;
  touch-action: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.gr-node.is-new {
  animation: gr-in 0.5s ease-out;
}
@keyframes gr-in {
  from {
    opacity: 0;
  }
}
.rs-plan .rs-plan-done::marker {
  color: var(--eco);
}
.rs-plan-mark {
  display: inline-flex;
  margin-inline-start: 6px;
  vertical-align: -0.15em;
  color: var(--eco);
}
.rs-plan-mark .icon {
  inline-size: 14px;
  block-size: 14px;
}

@media (max-width: 520px) {
  .gr-svg {
    aspect-ratio: 1 / 1;
  }
  .calc-row.is-main dd {
    font-size: 1.25rem;
  }
  .tl-item {
    grid-template-columns: minmax(48px, max-content) 14px 1fr;
    gap: 0 8px;
  }
}
@media print {
  .gr-tools,
  .gr-filters {
    display: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mchip,
  .ck-bar-fill,
  .gr-node.is-new,
  .gr-node circle {
    transition: none;
  }
  .chips-row .mchip-ghost {
    animation: none;
  }
}

/* research.css */
/* Deep research (research.js): the live board, the report card and the full-screen report. Tokens of app.css only,
   so light and dark follow the theme; positions through CSSOM custom properties (no style attribute, CSP). */

:root {
  --rs-high: var(--eco);
  --rs-medium: var(--accent);
  --rs-low: var(--warn-ink);
}

/* ---------------------------------------------------------------- live board */
.rsb {
  display: grid;
  gap: 14px;
  margin-block-start: 10px;
}
.rsb-phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.78rem;
  color: var(--muted);
}
.rsb-phase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rsb-phase::before {
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}
.rsb-phase.is-done {
  color: var(--ink-2);
}
.rsb-phase.is-done::before {
  background: var(--eco);
  border-color: var(--eco);
}
.rsb-phase.is-current {
  color: var(--ink);
  font-weight: 600;
}
.rsb-phase.is-current::before {
  border-color: var(--accent);
  background: var(--accent);
  animation: rsb-pulse 1.4s ease-in-out infinite;
}
@keyframes rsb-pulse {
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  }
}
.rsb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.rsb-stat {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.rsb-stat-n {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.1;
}
.rsb-stat-l {
  font-size: 0.76rem;
  color: var(--muted);
}
.rsb-block {
  display: grid;
  gap: 6px;
}
.rsb-h {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.rsb-questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.rsb-q {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
}
.rsb-q-mark {
  inline-size: 18px;
  block-size: 18px;
  margin-block-start: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
}
.rsb-q-mark .icon {
  inline-size: 12px;
  block-size: 12px;
}
.rsb-q.is-resolved .rsb-q-mark {
  border-color: var(--eco);
  background: var(--eco);
  color: var(--surface);
}
.rsb-q.is-thin .rsb-q-mark {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.rsb-q-body {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}
.rsb-q-text {
  font-size: 0.92rem;
  color: var(--ink);
}
.rsb-q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.76rem;
  color: var(--muted);
}
.rsb-query {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.rsb-query .icon {
  inline-size: 12px;
  block-size: 12px;
  flex: none;
}
.rsb-q.is-resolved .rsb-q-status {
  color: var(--eco);
}
.rsb-q.is-thin .rsb-q-status {
  color: var(--warn-ink);
}
.rsb-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rsb-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: 0.78rem;
  animation: rsb-in 0.25s ease-out;
}
@keyframes rsb-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}
.rsb-src-n {
  min-inline-size: 18px;
  block-size: 18px;
  padding: 0 4px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--link);
  font-size: 0.7rem;
  font-weight: 650;
}
.rsb-src-d {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.rsb-src-s {
  color: var(--muted);
  white-space: nowrap;
}
.rsb-src:not(:has(.rsb-src-n)) {
  padding-inline-start: 10px;
}
.rsb-src.is-reading {
  border-color: var(--accent);
}
.rsb-src.is-reading .rsb-src-s {
  color: var(--link);
}
.rsb-src.is-kept {
  border-color: color-mix(in srgb, var(--eco) 45%, var(--line));
}
.rsb-src.is-error,
.rsb-src.is-thin,
.rsb-src.is-flagged {
  opacity: 0.72;
  border-style: dashed;
}
.rsb-contra {
  padding: 8px 12px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-s);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.rsb-contra .rsb-h {
  color: var(--warn-ink);
}
.rsb-contra ul {
  margin: 0;
  padding-inline-start: 1.1em;
  font-size: 0.86rem;
}

/* ---------------------------------------------------------------- report card */
.rp-card-title {
  margin: 0;
  font-weight: 650;
  font-size: 1.04rem;
}
.rp-card-meta {
  margin: 0;
  font-size: 0.82rem;
}
.rp-card-toc {
  margin: 0;
  list-style: decimal;
  padding-inline-start: 1.3em;
  display: grid;
  gap: 2px;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.rp-actions {
  margin-block-start: 4px;
}

/* key figures */
.rp-figs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}
.rp-fig {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--rs-medium);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.rp-fig.is-high {
  border-inline-start-color: var(--rs-high);
}
.rp-fig.is-low {
  border-inline-start-color: var(--rs-low);
}
.rp-fig-v {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.rp-fig-l {
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.4;
}
.rp-fig-s {
  font-size: 0.74rem;
}
.rp-figs.is-mini .rp-fig {
  padding: 8px 10px;
}
.rp-figs.is-mini .rp-fig-v {
  font-size: 1.1rem;
}
.rp-figs.is-mini .rp-fig-l {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------- full-screen report */
dialog.rp {
  inline-size: 100vw;
  max-inline-size: 100vw;
  block-size: 100dvh;
  max-block-size: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
dialog.rp:not([open]) {
  display: none;
}
body.rp-open {
  overflow: hidden;
}
.rp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-block-end: 1px solid var(--line);
  background: var(--surface);
}
.rp-bar-title {
  flex: 1;
  min-inline-size: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-bar-acts {
  display: flex;
  gap: 6px;
}
.rp-scroll {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
}
.rp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-inline-size: 1280px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}
.rp-toc-h,
.rp-side-h {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.rp-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}
.rp-toc a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
}
.rp-toc a:hover {
  background: var(--surface-2);
}
.rp-toc a[aria-current] {
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 600;
}
.rp-main {
  min-inline-size: 0;
  display: grid;
  gap: 28px;
  align-content: start;
}
.rp-eyebrow {
  margin: 0 0 -20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--link);
}
.rp-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.rp-counts {
  margin: -16px 0 0;
  font-size: 0.86rem;
}
.rp-sec {
  display: grid;
  gap: 12px;
  scroll-margin-block-start: 12px;
}
.rp-sec > h2 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.3;
}
.rp-sec > h2:focus {
  outline: none;
}
.rp-p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  max-inline-size: 72ch;
}
.rp-cite {
  appearance: none;
  border: 0;
  padding: 0 2px;
  margin: 0;
  background: none;
  font: inherit;
  font-size: 0.78em;
  vertical-align: 0.15em;
  color: var(--link);
  cursor: pointer;
  border-radius: 4px;
}
.rp-cite:hover,
.rp-cite[aria-expanded="true"] {
  background: var(--accent-soft);
}
.rp-cite:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rp-bubble {
  position: absolute;
  inset-inline-start: var(--rp-x, 16px);
  inset-block-start: var(--rp-y, 16px);
  z-index: 5;
  inline-size: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  animation: rsb-in 0.15s ease-out;
}
.rp-bubble p {
  margin: 0;
}
.rp-bubble-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}
.rp-bubble-t {
  font-weight: 600;
  color: var(--ink);
}
.rp-bubble-q {
  margin: 0;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--accent-soft);
  color: var(--ink-2);
  line-height: 1.45;
}
.rp-bubble-link {
  color: var(--link);
  font-weight: 600;
}
.rp-conf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  inline-size: fit-content;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--rs-medium);
  background: color-mix(in srgb, var(--rs-medium) 10%, transparent);
}
.rp-conf-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: currentColor;
}
.rp-conf.is-high {
  color: var(--rs-high);
  background: color-mix(in srgb, var(--rs-high) 12%, transparent);
}
.rp-conf.is-low {
  color: var(--rs-low);
  background: var(--warn-bg);
}
.rp-claims {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.rp-claim {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.rp-claim p {
  margin: 0;
}
.rp-claim-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.rp-claim-t {
  line-height: 1.5;
}
.rp-claim-x {
  font-size: 0.82rem;
}
.rp-claim-x.is-against {
  color: var(--warn-ink);
}
.rp-claim-q summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}
.rp-claim-q blockquote {
  margin: 6px 0 0;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--accent-soft);
  color: var(--ink-2);
  font-size: 0.88rem;
}
.rp-contra {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.rp-contra > li {
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-s);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.rp-contra-v {
  font-weight: 700;
}
.rp-contra-t {
  margin: 4px 0 0;
  font-size: 0.84rem;
}
.rp-side {
  min-inline-size: 0;
  align-self: start;
}
.rp-tabs {
  display: flex;
  gap: 4px;
  margin-block-end: 10px;
  border-block-end: 1px solid var(--line);
}
.rp-tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 6px 10px;
  color: var(--muted);
  border-block-end: 2px solid transparent;
  margin-block-end: -1px;
  cursor: pointer;
}
.rp-tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  border-block-end-color: var(--accent);
}
.rp-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.rp-srcs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.rp-src {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  min-inline-size: 0;
}
.rp-src-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-2);
  min-inline-size: 0;
}
.rp-src-d {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-src-why {
  margin-inline-start: auto;
  white-space: nowrap;
}
.rp-src-t {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
  overflow-wrap: anywhere;
}
span.rp-src-t {
  color: var(--ink);
}
.rp-src-c {
  font-size: 0.78rem;
}
.rp-note {
  margin: 0;
}
.rp-sec > section {
  margin: 0;
}

@media (min-width: 900px) {
  .rp-grid {
    grid-template-columns: 200px minmax(0, 1fr) 300px;
    gap: 36px;
    padding: 32px 24px 80px;
  }
  .rp-toc,
  .rp-side {
    position: sticky;
    inset-block-start: 24px;
    max-block-size: calc(100dvh - 120px);
    overflow: auto;
  }
}
@media (max-width: 899px) {
  .rp-toc ol {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-block-end: 4px;
  }
  .rp-toc a {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 0.84rem;
  }
}
@media (max-width: 560px) {
  /* a phone shows the current phase only, and the counts on two compact rows */
  .rsb-phase:not(.is-current) {
    display: none;
  }
  .rsb-stats {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .rsb-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 8px;
  }
  .rsb-stat-n {
    font-size: 1.02rem;
  }
  .rsb-stat-l {
    font-size: 0.72rem;
    line-height: 1.2;
  }
  .rp-figs.is-mini {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .rp-figs.is-mini .rp-fig {
    padding: 6px 8px;
  }
  .rp-figs.is-mini .rp-fig-v {
    font-size: 0.95rem;
  }
  .rp-figs.is-mini .rp-fig-l {
    display: none;
  }
  .rp-bar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  .rp-bar-title {
    flex-basis: calc(100% - 52px);
  }
  .rp-bar-acts {
    order: 3;
    inline-size: 100%;
  }
  .rp-bar-acts .btn {
    flex: 1;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rsb-phase.is-current::before,
  .rsb-src,
  .rp-bubble {
    animation: none;
  }
}

/* PDF: the browser prints the report alone */
@media print {
  body.rp-open > :not(dialog.rp) {
    display: none !important;
  }
  dialog.rp {
    position: static;
    display: block !important; /* app.css hides every dialog in print: the report is the page */
    block-size: auto;
    max-block-size: none;
    overflow: visible;
    background: #fff;
    color: #000;
  }
  dialog.rp::backdrop {
    display: none;
  }
  .rp-bar,
  .rp-toc,
  .rp-tabs,
  .rp-bubble,
  .rp-claim-q summary {
    display: none !important;
  }
  .rp-scroll {
    overflow: visible;
  }
  .rp-grid {
    display: block;
    padding: 0;
  }
  .rp-side {
    break-before: page;
  }
  .rp-srcs[hidden] {
    display: grid !important;
  }
  .rp-claim-q[open] blockquote,
  .rp-claim-q blockquote {
    display: block;
  }
  .rp-fig,
  .rp-claim,
  .rp-src {
    break-inside: avoid;
  }
}

/* reflexion.css */
/* Mode Réflexion: the composer's bird picker and the answer's flight header (reflexion.js). Colours come from the
   app.css tokens, plus one tint per bird defined here for light and dark. Motion only with no-preference. */

:root {
  --rf-colibri: #12764a;
  --rf-hirondelle: #1e5bd8;
  --rf-faucon: #b2541c;
  --rf-chouette: #6250d6;
  --rf-albatros: #0e6f86;
  --rf-auto: #0b1b3f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rf-colibri: #5fd3a0;
    --rf-hirondelle: #8fb3ff;
    --rf-faucon: #f2a46e;
    --rf-chouette: #b8adff;
    --rf-albatros: #6fd0e6;
    --rf-auto: #e9edf5;
  }
}
:root[data-theme="dark"] {
  --rf-colibri: #5fd3a0;
  --rf-hirondelle: #8fb3ff;
  --rf-faucon: #f2a46e;
  --rf-chouette: #b8adff;
  --rf-albatros: #6fd0e6;
  --rf-auto: #e9edf5;
}

/* the drawings: one silhouette, a stroked beak for the hummingbird, the eye in the page colour */
.rf-bird {
  inline-size: 18px;
  block-size: 18px;
  flex: none;
  overflow: visible;
}
.rf-bird path:not(.rf-fill) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.rf-bird .rf-fill {
  fill: currentColor;
}
.rf-bird .rf-eye {
  fill: var(--surface);
}
[data-level="colibri"] { --rf-tint: var(--rf-colibri); }
[data-level="hirondelle"] { --rf-tint: var(--rf-hirondelle); }
[data-level="faucon"] { --rf-tint: var(--rf-faucon); }
[data-level="chouette"] { --rf-tint: var(--rf-chouette); }
[data-level="albatros"] { --rf-tint: var(--rf-albatros); }
[data-level="auto"] { --rf-tint: var(--rf-auto); }

/* ---- the picker: a pill like the model menu of a chat app */
.rf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 34px;
  padding: 0 6px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: 550 0.85rem var(--sans);
  flex: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
/* the last control before the counter and Send: Send stays at the end of the row (the Agent pill used to push it) */
.composer-row .rf-pill {
  margin-inline-end: auto;
}
.rf-pill .rf-bird {
  color: var(--rf-tint);
}
.rf-pill:hover {
  background: var(--surface-2);
}
.rf-pill[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
  color: var(--ink);
}
.rf-pill-caret .icon {
  inline-size: 12px;
  block-size: 12px;
  transform: rotate(90deg);
  color: var(--muted);
  transition: transform 0.15s;
}
.rf-pill[aria-expanded="true"] .rf-pill-caret .icon {
  transform: rotate(-90deg);
}
#agent-pill {
  margin-inline-end: auto; /* the free space of the row sits before the send button */
}
@media (max-width: 400px) {
  .rf-pill {
    gap: 3px;
    padding-inline: 7px 4px;
  }
  .rf-pill-caret {
    display: none; /* a phone keeps the bird and its short name (« Auto »): the caret is the one to go */
  }
  .composer-row:has(#composer-count:not([hidden])) .rf-pill .rf-pill-name {
    /* a long message shows its count: the bird alone keeps the row inside the box (the name is in the label) */
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.rf-menu {
  position: fixed; /* placed above the pill by reflexion.js */
  z-index: 60;
  display: grid;
  gap: 2px;
  inline-size: min(22rem, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rf-rise 0.14s ease-out;
}
.rf-menu[hidden] {
  display: none;
}
.rf-menu-head {
  display: grid;
  gap: 8px;
}
.rf-menu-title {
  margin: 0;
  padding: 6px 8px 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
/* « Auto »: one row, a switch at the end, as a settings line */
.rf-auto {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 48px;
  padding: 6px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.rf-auto:hover {
  background: var(--surface-2);
}
.rf-auto-text {
  display: grid;
  flex: 1;
  gap: 1px;
  font-size: 0.92rem;
}
.rf-auto-text b {
  font-weight: 650;
}
.rf-auto-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.rf-switch {
  appearance: none;
  flex: none;
  position: relative;
  inline-size: 38px;
  block-size: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong, var(--line));
  cursor: pointer;
  transition: background 0.15s;
}
.rf-switch::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}
.rf-switch:checked {
  background: var(--accent);
}
.rf-switch:checked::after {
  transform: translateX(16px);
}
[dir="rtl"] .rf-switch:checked::after {
  transform: translateX(-16px);
}
.rf-menu:focus {
  outline: none; /* focused on open by a tap: the sheet, not a control */
}
.rf-switch:focus-visible,
.rf-range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* the bird under the thumb: drawing, name · label, what it is for */
.rf-now {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  margin-block-start: 4px;
  padding: 8px;
  border-top: 1px solid var(--line);
}
.rf-opt-icon {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rf-tint) 14%, transparent);
  color: var(--rf-tint);
}
.rf-opt-icon .rf-bird {
  inline-size: 20px;
  block-size: 20px;
}
.rf-opt-text {
  display: grid;
  gap: 1px;
  min-inline-size: 0;
}
.rf-opt-name {
  font-size: 0.92rem;
}
.rf-opt-name b {
  font-weight: 650;
}
.rf-opt-label {
  color: var(--ink-2);
}
.rf-opt-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
/* the slider: a native range (keyboard, screen readers, touch), its track filled up to the bird chosen */
.rf-slider {
  --rf-pos: 50%;
  display: grid;
  gap: 2px;
  padding: 4px 8px 8px;
}
.rf-now[hidden] {
  display: none;
}
.rf-slider.is-auto {
  border-top: 1px solid var(--line);
  padding-block-start: 10px;
}
.rf-range {
  appearance: none;
  border-radius: 999px;
  inline-size: 100%;
  block-size: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.rf-range::-webkit-slider-runnable-track {
  block-size: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--rf-tint) var(--rf-pos), var(--surface-2) var(--rf-pos));
}
.rf-range::-moz-range-track {
  block-size: 6px;
  border-radius: 999px;
  background: var(--surface-2);
}
.rf-range::-moz-range-progress {
  block-size: 6px;
  border-radius: 999px;
  background: var(--rf-tint);
}
.rf-range::-webkit-slider-thumb {
  appearance: none;
  inline-size: 22px;
  block-size: 22px;
  margin-block-start: -8px;
  border: 3px solid var(--rf-tint);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
}
.rf-range::-moz-range-thumb {
  inline-size: 16px;
  block-size: 16px;
  border: 3px solid var(--rf-tint);
  border-radius: 50%;
  background: var(--surface);
}
[dir="rtl"] .rf-range::-webkit-slider-runnable-track {
  background: linear-gradient(to left, var(--rf-tint) var(--rf-pos), var(--surface-2) var(--rf-pos));
}
/* « Auto »: the track rests grey, the thumb stays movable (moving it gives the choice back to you) */
.rf-slider.is-auto {
  --rf-tint: var(--muted);
}
.rf-ticks {
  display: flex;
  justify-content: space-between;
  /* the ticks sit under the thumb's centre: half a thumb in from each end */
  margin-inline: -2px;
}
.rf-tick {
  display: grid;
  place-items: center;
  inline-size: 26px;
  block-size: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.rf-tick:hover {
  color: var(--rf-tint);
  background: var(--surface-2);
}
.rf-tick.is-on {
  color: var(--rf-tint);
  background: color-mix(in srgb, var(--rf-tint) 14%, transparent);
}
.rf-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}
.rf-scale > span {
  white-space: nowrap;
}
.rf-scale > :first-child {
  text-align: start;
}
.rf-scale > :last-child {
  text-align: end;
}
.rf-scale > .is-on {
  color: var(--text);
  font-weight: 650;
}
.rf-slider.is-auto .rf-ticks,
.rf-slider.is-auto .rf-scale {
  opacity: 0.55;
}
.rf-scrim {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: var(--backdrop);
}
@media (max-width: 640px) {
  .rf-menu {
    /* a bottom sheet in the thumb zone, as the photo menu: the dock scrolls and would clip a popover */
    position: fixed;
    inset-inline: max(12px, var(--safe-l, 0px));
    inset-block-end: calc(12px + var(--safe-b, 0px));
    inline-size: auto;
    max-inline-size: 26rem;
    margin-inline: auto;
    border-radius: 20px;
  }
}

/* ---- the answer: « Bird a pris son vol en Faucon » */
.rf-flight > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-inline-size: 100%;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.rf-flight > summary:hover {
  background: var(--surface-2);
}
.rf-badge {
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 30px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rf-tint) 14%, transparent);
  color: var(--rf-tint);
}
.rf-badge .rf-bird {
  inline-size: 19px;
  block-size: 19px;
}
.rf-sumtext {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-inline-size: 0;
}
.rf-line {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.rf-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.rf-body {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px 18px;
  padding: 4px 0 4px 22px;
  border-inline-start: 2px solid color-mix(in srgb, var(--rf-tint, var(--line-strong)) 35%, var(--line));
}
.rf-h {
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.rf-sum,
.rf-facts {
  display: grid;
  gap: 4px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.rf-sum li {
  position: relative;
  padding-inline-start: 14px;
  overflow-wrap: anywhere;
}
.rf-sum li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  inset-block-start: 0.6em;
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}
.rf-facts li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rf-facts .icon {
  inline-size: 16px;
  block-size: 16px;
  flex: none;
  margin-block-start: 1px;
}
.rf-facts [data-kind="ok"] .icon,
.rf-facts [data-kind="fixed"] .icon {
  color: var(--eco);
}
.rf-facts [data-kind="warn"] {
  color: var(--warn-ink);
}
.rf-facts [data-kind="info"] .icon {
  color: var(--muted);
}
.rf-full > summary {
  padding-inline-start: 0;
}
@media (pointer: coarse) {
  .rf-full > summary {
    display: flex;
    align-items: center;
    min-block-size: 44px;
  }
}

/* ---- motion: the bird glides in when the answer lands, and flaps while Bird reasons */
@keyframes rf-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .rf-arrive .rf-badge .rf-bird {
    animation: rf-glide 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .rf-arrive .rf-badge .rf-wing {
    transform-box: fill-box;
    transform-origin: 50% 40%;
    animation: rf-beat 0.3s ease-in-out 2 alternate;
  }
  .rf-flap .rf-wing {
    transform-box: fill-box;
    transform-origin: 50% 40%;
    animation: rf-beat 0.45s ease-in-out infinite alternate;
  }
  .rf-flap {
    animation: rf-hover 1.8s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rf-menu {
    animation: none;
  }
}
@keyframes rf-glide {
  from {
    opacity: 0;
    transform: translate(-14px, 6px) rotate(-12deg);
  }
  60% {
    opacity: 1;
    transform: translate(2px, -2px) rotate(4deg);
  }
  to {
    transform: none;
  }
}
@keyframes rf-beat {
  to {
    transform: scaleY(0.55);
  }
}
@keyframes rf-hover {
  50% {
    transform: translateY(-2px);
  }
}
/* the model waking up (turns.js liveLine): a resting bird, slower wings than the one that reasons */
.live-wake-bird {
  margin-block-start: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .rf-flap.live-wake-bird {
    animation-duration: 3.2s;
  }
  .live-wake-bird .rf-wing {
    animation-duration: 1.1s;
  }
}
.rf-bird.rf-flap {
  inline-size: 18px;
  block-size: 18px;
  color: var(--accent);
}
/* touch screens: the pill is a 44 px target, as the other frequent controls of the composer */
@media (pointer: coarse) {
  .rf-pill {
    min-block-size: 44px;
  }
}

/* the bird riding the thumb: a badge in the bird's tint over the thumb, a little flight at each new choice */
.rf-track {
  position: relative;
  padding-block: 4px; /* the badge (34 px) overflows the range (28 px) by 3 px above and below */
}
.rf-flyer {
  position: absolute;
  inset-block-start: 1px; /* centred on the track: 4 px padding + 14 px (half the range) - 17 px (half the badge) */
  /* the thumb's centre: half a thumb in from each end of the range */
  inset-inline-start: calc(11px + (100% - 22px) * var(--rf-pos-n, 0.5));
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  margin-inline-start: -17px;
  border-radius: 50%;
  background: var(--rf-tint);
  color: var(--surface);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--rf-tint) 40%, transparent);
  pointer-events: none;
  transition:
    inset-inline-start 0.22s cubic-bezier(0.3, 1.4, 0.5, 1),
    background 0.2s;
}
.rf-flyer .rf-bird {
  inline-size: 22px;
  block-size: 22px;
}
.rf-flyer .rf-eye {
  fill: var(--rf-tint);
}
.rf-flyer[data-level="auto"] {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}
/* the thumb under the badge: only its ring shows, the badge is the handle the eye follows */
.rf-track .rf-range::-webkit-slider-thumb {
  opacity: 0;
}
.rf-track .rf-range::-moz-range-thumb {
  opacity: 0;
}
.rf-track .rf-range:focus-visible + .rf-flyer {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rf-track .rf-range:focus-visible {
  outline: none;
}
@media (prefers-reduced-motion: no-preference) {
  .rf-flyer .rf-wing {
    transform-box: fill-box;
    transform-origin: 50% 45%;
  }
  .rf-flyer.rf-in-flight {
    animation: rf-hop 0.55s cubic-bezier(0.3, 1.5, 0.5, 1);
  }
  .rf-flyer.rf-in-flight .rf-wing {
    animation: rf-beat 0.14s ease-in-out 4 alternate;
  }
  /* at rest the chosen bird hovers gently, as a hummingbird would */
  .rf-flyer:not([data-level="auto"]) .rf-bird {
    animation: rf-hover 2.4s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rf-flyer {
    transition: none;
  }
}
@keyframes rf-hop {
  0% {
    translate: 0 0;
    scale: 0.85;
  }
  45% {
    translate: 0 -9px;
    scale: 1.15;
  }
  100% {
    translate: 0 0;
    scale: 1;
  }
}
@media (max-width: 400px) {
  .rf-scale {
    column-gap: 4px;
    font-size: 0.64rem;
  }
}

/* answers.css */
/* Answer content (answers.js, cluster C2 of the chat audit): typeset math,
   citation bubbles and the sources pill, the thumbs-down panel, the work line. Colours come from the app.css
   tokens (light and dark follow them); nothing here is loaded from a third party. */

/* ---------------------------------------------------------------- math (KaTeX, self-hosted) */
/* until KaTeX is there (first formula, offline), the source shows as written, quietly */
.md-math-src {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.md-math[data-typeset="1"] > .md-math-src {
  display: none;
}
.md-math .katex {
  font-size: 1.08em;
  color: var(--ink);
}
.md-math--block {
  position: relative;
  margin: 0.9rem 0;
  padding: 0.55rem 2.5rem 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
/* a long formula scrolls inside its box, never under the copy button and never the page */
.md-math--block > .md-math-out {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 600px) {
  .md-math--block .katex {
    font-size: 1em;
  }
}
.md-math--block > .md-math-src {
  display: block;
  white-space: pre-wrap;
}
.md-math--block .katex-display {
  margin: 0.15rem 0;
}
.md-math-copy {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.md-math-copy:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.md-math-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.md-math-copy .icon {
  width: 1rem;
  height: 1rem;
}
@media (pointer: coarse) {
  .md-math-copy {
    width: 2.75rem;
    height: 2.75rem;
    top: 0;
    right: 0;
  }
  .md-math--block {
    padding-right: 3rem;
  }
}
.md-copy-box {
  position: fixed;
  left: -10000px;
  top: 0;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- citations: « N sources » pill, panel, bubble */
.sources {
  padding-block-start: 10px;
}
.src-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 36px;
  padding: 3px 12px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.src-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.src-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.src-pill .src-pill-chev {
  width: 0.9rem;
  height: 0.9rem;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}
.src-pill[aria-expanded="true"] .src-pill-chev {
  transform: rotate(-90deg);
}
.src-pill-marks {
  display: inline-flex;
}
.src-pill-mark {
  inline-size: 22px;
  block-size: 22px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 18px;
}
.src-pill-mark + .src-pill-mark {
  margin-inline-start: -7px;
}
.src-panel {
  margin-block-start: 10px;
}
@media (pointer: coarse) {
  .src-pill {
    min-block-size: 44px;
  }
  /* the [n] mark keeps its size, its tap area grows to 44 px */
  .cite a {
    position: relative;
  }
  .cite a::after {
    content: "";
    position: absolute;
    inset: -14px -10px;
  }
}
.cite a[aria-expanded="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.cite-bubble {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  line-height: 1.4;
}
.cite-bubble-host {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.cite-bubble-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}
a.cite-bubble-title {
  color: var(--link);
}
.cite-bubble-snippet {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  color: var(--ink-2);
}
.cite-bubble-all {
  justify-self: start;
  margin-block-start: 4px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.cite-bubble-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .src-pill .src-pill-chev {
    transition: none;
  }
}

/* ---------------------------------------------------------------- thumbs down: reasons, comment, thank-you */
.fb-panel {
  display: grid;
  gap: 10px;
  margin-block: 4px 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.fb-title {
  font-weight: 650;
  font-size: 0.92rem;
}
.fb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fb-chip {
  min-block-size: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.fb-chip:hover {
  border-color: var(--control-line);
  color: var(--ink);
}
.fb-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.fb-chip:focus-visible,
.fb-comment:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fb-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.fb-comment {
  inline-size: 100%;
  min-block-size: 3.2em;
  padding: 8px 10px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.fb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.fb-note {
  flex: 1 1 12rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.fb-thanks {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-block: 2px 8px;
  font-size: 0.85rem;
  color: var(--eco);
}
@media (pointer: coarse) {
  .fb-chip {
    min-block-size: 44px;
  }
}

/* ---------------------------------------------------------------- one work line before the answer (R25) */
.worklog > summary .rf-badge {
  inline-size: 24px;
  block-size: 24px;
}
.worklog > summary .rf-badge .rf-bird {
  inline-size: 15px;
  block-size: 15px;
}
.work-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a long step or tool detail ends in « … », never past the box (360 px) */
  gap: 6px;
  padding: 0 14px 12px;
}
.work-body > * {
  min-inline-size: 0;
}
.work-h {
  margin-block-start: 6px;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.work-body > .timeline {
  padding: 0;
}
.work-body > .rf-body {
  margin-inline-start: 4px;
}

/* ---------------------------------------------------------------- the « … » menu: Réécrire and its rewrites */
.menu-parent .menu-sub-chev {
  margin-inline-start: auto;
  inline-size: 0.9rem;
  block-size: 0.9rem;
  color: var(--muted);
}
.menu-back {
  color: var(--muted);
}

/* local.css */
/* Bird local (local.js): the header badge, the settings choice and its connect flow, the « ne répond pas » card.
   Only the app's tokens (app.css), so light and dark follow; the calm green is the colour of « on your machine ». */

/* settings: the third choice (three cards side by side on a desk, one column on a phone: app.css .modes) */
.mode-local.is-on {
  border-color: var(--eco);
  box-shadow: inset 0 0 0 1px var(--eco);
}
.mode-local input {
  accent-color: var(--eco);
}

.local-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.local-panel:empty {
  display: none;
}
.local-searching {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
}
.local-form {
  display: grid;
  gap: 14px;
}
.local-found,
.local-ok {
  display: flex;
  gap: 10px;
  margin: 0;
  align-items: flex-start;
}
.local-found {
  color: var(--eco);
  font-weight: 600;
  font-size: 0.92rem;
}
.local-found .icon {
  margin-block-start: 2px;
  flex: none;
}
.local-ok strong {
  display: block;
  font-size: 1rem;
}
.local-ok p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.local-ok-mark {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 30px;
  block-size: 30px;
  border-radius: 50%;
  background: var(--eco-soft);
  color: var(--eco);
}
#local-code,
#local-pair-code {
  max-inline-size: 15rem;
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.local-err {
  margin: 0;
  color: var(--danger-ink);
  font-size: 0.88rem;
  line-height: 1.45;
}
.local-err:empty {
  display: none;
}
.local-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* « Bird local ne répond pas »: three numbered steps with their commands */
.local-down {
  display: grid;
  gap: 12px;
}
.local-down.local-compact {
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.local-tok {
  white-space: nowrap;
}
.local-down-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.local-down-head > .icon {
  flex: none;
  inline-size: 22px;
  block-size: 22px;
  margin-block-start: 1px;
  color: var(--eco);
}
.local-down-head strong {
  display: block;
  font-size: 1rem;
}
.local-down-head p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
}
.local-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.local-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.local-step-n {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: var(--eco-soft);
  color: var(--eco);
  font-size: 0.8rem;
  font-weight: 700;
}
.local-step-body {
  display: grid;
  gap: 6px;
  min-inline-size: 0;
  flex: 1;
  font-size: 0.92rem;
}
.local-cmd {
  display: flex;
  align-items: center;
  gap: 4px;
  min-inline-size: 0;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
}
.local-cmd code {
  flex: 1;
  min-inline-size: 0;
  overflow-wrap: anywhere; /* the whole command stays visible at 360 px, wrapped between its words */
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
}
.local-perm {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* the page served by Bird local, opened without its code */
.local-dialog {
  inline-size: min(26rem, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.local-dialog::backdrop {
  background: var(--scroll-shade);
}

/* footprint: energy on the user's machine */
.local-fp {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--eco-soft);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}
.local-fp .icon {
  flex: none;
  margin-block-start: 3px;
  color: var(--eco);
}

/* one command for the visitor's system; the developer steps fold away */
.local-install {
  display: grid;
  gap: 8px;
}
.local-oses {
  display: inline-flex;
  justify-self: start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.local-os {
  min-block-size: 32px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.local-os[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px var(--line-strong);
}
.local-os:focus-visible {
  outline: 2px solid var(--eco);
  outline-offset: 1px;
}
@media (pointer: coarse) {
  .local-os {
    min-block-size: 44px;
  }
}
.local-install .local-cmd code {
  font-size: 0.9rem;
}
.local-where {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.5;
}
.local-note {
  color: var(--muted);
}
.local-waiting {
  margin: 0;
}
.local-manual > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
}
.local-manual[open] > summary {
  margin-block-end: 10px;
}
.local-manual .local-steps {
  margin-block-end: 8px;
}
.local-ready {
  display: grid;
  gap: 12px;
}
.local-manual > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.local-manual > summary::-webkit-details-marker {
  display: none;
}
.local-manual > summary::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.local-manual[open] > summary::before {
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .local-manual > summary::before {
    transition: none;
  }
}
/* the install URL is one long word: at 360 px it may break inside, never widen the settings */
.local-install,
.local-down,
.local-ready {
  min-inline-size: 0;
}
.local-install .local-tok {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* « Mon ordinateur · bêta » (folders.js): the allowed folders in Réglages, the chip above the message box */
.lf-panel h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.lf-panel h3:focus {
  outline: none;
}
.lf-panel h3:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.lf-beta {
  border-color: transparent;
  background: var(--eco-soft);
  color: var(--eco);
}
.lf-list {
  display: grid;
  gap: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.lf-item,
.lf-suggest {
  display: flex;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
  padding: 10px 8px 10px 14px;
}
.lf-item + .lf-item {
  border-block-start: 1px solid var(--line);
}
.lf-icon {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 9px;
  background: var(--eco-soft);
  color: var(--eco);
}
.lf-text {
  display: grid;
  flex: 1;
  min-inline-size: 0;
  gap: 2px;
}
.lf-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.lf-path {
  font: 0.8rem/1.4 var(--mono, ui-monospace, monospace);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.lf-item.is-missing .lf-icon {
  background: var(--surface-2);
  color: var(--muted);
}
.lf-remove {
  flex: none;
  min-block-size: 40px;
}
.lf-none,
.lf-down {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 0.92rem;
}
.lf-suggest {
  margin-block-start: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.lf-suggest .lf-icon {
  background: var(--surface);
}
.lf-suggest .btn {
  flex: none;
}
.lf-add {
  margin-block-start: 14px;
}
.lf-add-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.lf-input {
  flex: 1;
  min-inline-size: 0;
}
.lf-add .local-err:empty {
  display: none;
}
.lf-never {
  margin-block-start: 14px;
}
@media (max-width: 480px) {
  .lf-item,
  .lf-suggest {
    flex-wrap: wrap;
    padding-inline-end: 10px;
  }
  .lf-suggest .lf-text {
    flex-basis: calc(100% - 46px);
  }
  .lf-suggest .btn {
    margin-inline-start: 46px;
  }
  .lf-remove .btn-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .lf-item {
    flex-wrap: nowrap;
  }
}

.lf-chip-row {
  display: flex;
  margin: 0 4px 8px;
}
.lf-chip-row[hidden] {
  display: none;
}
.lf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 0.82rem/1 var(--sans);
  cursor: pointer;
}
.lf-chip .icon {
  color: var(--eco);
}
.lf-chip:hover {
  border-color: var(--eco);
  color: var(--ink);
}
.lf-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* conversation.css */
/* Conversation engine (conversation.js): documents in context, version pager, inline edit, dialogs, sidebar extras.
   Uses the app's tokens only (app.css :root, light and dark), so both themes follow. */

/* ------------------------------------------------------------ « 2 documents en contexte » */
.cx-ctx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 2px 0;
}
.cx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 32px;
  max-inline-size: 100%;
  padding: 0 10px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font: 500 0.8rem/1.2 var(--sans);
  cursor: pointer;
}
.cx-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.cx-pill .icon {
  inline-size: 15px;
  block-size: 15px;
  flex: none;
}
.cx-pill .cx-chev {
  transform: rotate(90deg);
  transition: transform 0.15s;
  opacity: 0.7;
}
.cx-pill[aria-expanded="true"] .cx-chev {
  transform: rotate(-90deg);
}
.cx-pill[aria-expanded="true"] {
  border-color: var(--line-strong);
  color: var(--ink);
}
.cx-pill.is-lost {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-ink);
}
/* opens in place, inside the composer (never clipped by it, never over the conversation) */
.cx-ctx-pop {
  flex-basis: 100%;
  padding: 8px 8px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.cx-ctx-pop[hidden] {
  display: none;
}
.cx-ctx-title {
  margin: 0 0 6px;
  font: 600 0.84rem/1.3 var(--sans);
  color: var(--ink);
}
.cx-ctx-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cx-ctx-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cx-ctx-name {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  min-block-size: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font: 0.86rem/1.2 var(--sans);
  text-align: start;
  cursor: pointer;
}
.cx-ctx-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-ctx-name:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.cx-ctx-name:disabled {
  cursor: default;
  color: var(--danger-ink);
}
.cx-ctx-name .icon {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
}
.cx-ctx-note {
  margin: 8px 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
}
.cx-ctx-row.is-lost + .cx-ctx-row:not(.is-lost) {
  margin-block-start: 4px;
  border-block-start: 1px solid var(--line);
  padding-block-start: 4px;
}
.cx-openable {
  cursor: pointer;
}
.cx-openable:hover {
  border-color: var(--line-strong);
}

/* ------------------------------------------------------------ « ‹ 1/2 › » */
.cx-pager {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.cx-pager > .btn {
  inline-size: 30px;
  min-block-size: 30px;
}
.cx-pager .btn:disabled {
  opacity: 0.35;
}
.cx-pager-n {
  min-inline-size: 2.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cx-flip {
  transform: scaleX(-1);
}

/* ------------------------------------------------------------ the question's own actions, and its inline editor */
.cx-user-acts {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  margin-block-start: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.cx-has-acts:hover .cx-user-acts,
.cx-has-acts:focus-within .cx-user-acts,
.cx-user-acts:has(.cx-pager) {
  opacity: 1;
}
@media (hover: none) {
  .cx-user-acts {
    opacity: 1;
  }
}
.cx-has-acts {
  flex-direction: column;
  align-items: flex-end;
}
.cx-edit {
  display: grid;
  gap: 8px;
  inline-size: min(100%, 36rem);
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
}
.cx-edit-input {
  inline-size: 100%;
  min-block-size: 3.2em;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  resize: none;
}
.cx-edit-input:focus {
  outline: none;
}
.cx-edit:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cx-edit-note {
  margin: 0;
  padding-inline: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}
.cx-edit-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ------------------------------------------------------------ dialogs (confirm, preview) */
.cx-dialog {
  inline-size: min(28rem, calc(100vw - 32px));
  max-block-size: calc(100dvh - 32px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.cx-dialog[open] {
  animation: rise 0.18s ease-out;
}
.cx-dialog::backdrop {
  background: var(--backdrop);
}
.cx-dialog-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cx-dialog-title {
  flex: 1;
  min-inline-size: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font: 700 1.1rem/1.3 var(--sans);
  letter-spacing: -0.01em;
}
.cx-dialog-text {
  margin: 10px 0 0;
  color: var(--ink-2);
  line-height: 1.5;
}
.cx-dialog-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.cx-dialog-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-block-start: 20px;
}
.btn-danger-solid {
  border-color: var(--danger-ink);
  background: var(--danger-ink);
  color: var(--surface);
}
.btn-danger-solid:hover:not(:disabled) {
  filter: brightness(1.08);
}
.cx-preview {
  inline-size: min(40rem, calc(100vw - 32px));
}
.cx-preview-text {
  max-block-size: min(60dvh, 32rem);
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font: 0.8rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ sidebar: live answer, menu, search snippet */
.cx-live {
  flex: none;
  inline-size: 12px;
  block-size: 12px;
  margin-inline: 4px 2px;
  border: 2px solid var(--line-strong);
  border-block-start-color: var(--accent);
  border-radius: 50%;
  animation: cx-spin 0.9s linear infinite;
}
@keyframes cx-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-live {
    animation: none;
    border-color: var(--accent);
  }
}
.cx-hit .cx-snippet {
  display: block;
  overflow: hidden;
  margin-block-start: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--muted);
}
.cx-snippet mark {
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--ink);
}
.cx-menu {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 2px 4px 6px;
}
.cx-menu > .btn {
  justify-content: flex-start;
  min-block-size: 36px;
  border-radius: 8px;
}
.cx-menu > .btn:focus-visible {
  background: var(--surface-2);
}
.cx-hit {
  display: block;
  flex: 1;
  min-inline-size: 0;
}

/* ------------------------------------------------------------ « Livrables »: mails drafted in the chat */
.cx-deliv-mail {
  background: var(--accent-soft);
  color: var(--link);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------ attachment tray: every card in sight */
/* the tray wraps on every screen (4 documents and 3 images at most): no card hides past the edge */
.cx-tray {
  flex-wrap: wrap;
  overflow-x: visible;
  max-block-size: 40dvh;
  overflow-y: auto;
}
.cx-tray > li {
  flex: 0 1 auto;
  min-inline-size: 0;
  max-inline-size: 100%;
}
/* keyboard open on a phone (little height left): one scrolling row again, so the conversation keeps its room */
@media (max-width: 640px) and (max-height: 520px) {
  .cx-tray {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
  }
  .cx-tray > li {
    flex: none;
  }
}

