/* =========================================================================
 * Cahier Éclair — feuille de style
 * Un cahier d'écolier (Seyès) : l'imprimé, c'est le puzzle ; le manuscrit,
 * c'est toi. Thème clair « cahier », thème sombre « ardoise ».
 * ========================================================================= */

:root {
  color-scheme: light;
  --paper: #f6f6fa;
  --paper-raised: #ffffff;
  --seyes-thin: #ebe8f5;
  --seyes-bold: #d8d1ec;
  --margin: #e8808c;
  --ink: #1b1a2e;
  --ink-2: #57546f;
  --ink-3: #8c89a3;
  --grid: #bdb8d2;
  --grid-strong: #1b1a2e;
  --cell: #ffffff;
  --cell-given: #ece9f5;
  --pen: #2442b5;
  --on-pen: #ffffff;
  --pen-wash: rgba(36, 66, 181, 0.08);
  --pen-wash-2: rgba(36, 66, 181, 0.16);
  --red: #d3263a;
  --green: #17804f;
  --highlight: #ffe45c;
  --highlight-wash: rgba(255, 222, 64, 0.5);
  --shade: #26243a;
  --on-shade: #f6f6fa;
  --r1: #f8d5cf; --r2: #d3e4f6; --r3: #d9edcc; --r4: #f7e6ae; --r5: #e3d6f3;
  --r6: #f6d8bc; --r7: #c9eae4; --r8: #ebd5de; --r9: #dedde6;
  --m-bronze: #b0672c; --m-bronze-bg: #f3dcc6;
  --m-silver: #7b869c; --m-silver-bg: #e4e8ef;
  --m-gold: #c08c08; --m-gold-bg: #fbe9a6;
  --m-diamond: #1b8fb2; --m-diamond-bg: #cfeef7;
  --shadow: 0 1px 2px rgba(27, 26, 46, 0.06), 0 14px 36px -18px rgba(27, 26, 46, 0.4);
  --scrim: rgba(246, 246, 250, 0.72);

  --font-print: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-pen: 'Kalam', 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.3125rem;
  --fs-xl: clamp(1.9rem, 5vw, 2.5rem);
  --fs-xxl: clamp(2.9rem, 8vw, 4.75rem);
  --sy: 8px;
  --radius: 4px;
  --margin-x: max(10px, calc(50vw - 610px));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #18211e;
    --paper-raised: #1e2925;
    --seyes-thin: rgba(226, 236, 228, 0.03);
    --seyes-bold: rgba(226, 236, 228, 0.07);
    --margin: rgba(255, 141, 151, 0.4);
    --ink: #e9eee5;
    --ink-2: #a6b2ab;
    --ink-3: #6e7c75;
    --grid: #3a4943;
    --grid-strong: #c9d3cb;
    --cell: #1e2925;
    --cell-given: #2a3732;
    --pen: #93b6ff;
    --on-pen: #10172a;
    --pen-wash: rgba(147, 182, 255, 0.1);
    --pen-wash-2: rgba(147, 182, 255, 0.2);
    --red: #ff8d97;
    --green: #86dbaa;
    --highlight: #f2d86c;
    --highlight-wash: rgba(242, 216, 108, 0.22);
    --shade: #cad4cc;
    --on-shade: #18211e;
    --r1: #4c2f33; --r2: #2b3a52; --r3: #2f4630; --r4: #4a4a22; --r5: #3d2f52;
    --r6: #5a3320; --r7: #1f4743; --r8: #4f2a45; --r9: #3b3e2c;
    --m-bronze: #d9925a; --m-bronze-bg: #4d3323;
    --m-silver: #b3bccb; --m-silver-bg: #363d49;
    --m-gold: #e8bd42; --m-gold-bg: #4f4216;
    --m-diamond: #63c8e6; --m-diamond-bg: #173f4b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -20px rgba(0, 0, 0, 0.75);
    --scrim: rgba(24, 33, 30, 0.72);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #18211e;
  --paper-raised: #1e2925;
  --seyes-thin: rgba(226, 236, 228, 0.03);
  --seyes-bold: rgba(226, 236, 228, 0.07);
  --margin: rgba(255, 141, 151, 0.4);
  --ink: #e9eee5;
  --ink-2: #a6b2ab;
  --ink-3: #6e7c75;
  --grid: #3a4943;
  --grid-strong: #c9d3cb;
  --cell: #1e2925;
  --cell-given: #2a3732;
  --pen: #93b6ff;
  --on-pen: #10172a;
  --pen-wash: rgba(147, 182, 255, 0.1);
  --pen-wash-2: rgba(147, 182, 255, 0.2);
  --red: #ff8d97;
  --green: #86dbaa;
  --highlight: #f2d86c;
  --highlight-wash: rgba(242, 216, 108, 0.22);
  --shade: #cad4cc;
  --on-shade: #18211e;
  --r1: #4c2f33; --r2: #2b3a52; --r3: #2f4630; --r4: #4a4a22; --r5: #3d2f52;
  --r6: #5a3320; --r7: #1f4743; --r8: #4f2a45; --r9: #3b3e2c;
  --m-bronze: #d9925a; --m-bronze-bg: #4d3323;
  --m-silver: #b3bccb; --m-silver-bg: #363d49;
  --m-gold: #e8bd42; --m-gold-bg: #4f4216;
  --m-diamond: #63c8e6; --m-diamond-bg: #173f4b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -20px rgba(0, 0, 0, 0.75);
  --scrim: rgba(24, 33, 30, 0.72);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 var(--fs-md)/1.55 var(--font-print);
  color: var(--ink);
  background-color: var(--paper);
  /* réglure Seyès : interlignes fins, grands carreaux */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--sy) * 4 - 1px), var(--seyes-bold) calc(var(--sy) * 4 - 1px) calc(var(--sy) * 4)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--sy) * 4 - 1px), var(--seyes-bold) calc(var(--sy) * 4 - 1px) calc(var(--sy) * 4)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--sy) - 1px), var(--seyes-thin) calc(var(--sy) - 1px) var(--sy));
}
/* la marge rouge */
body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--margin-x);
  width: 2px;
  background: var(--margin);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 16px 72px calc(16px + 14px);
}
@media (min-width: 1240px) { .page { padding-left: 40px; } }

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 2.5px solid var(--pen); outline-offset: 2px; }

.eyebrow {
  font: 700 var(--fs-xs)/1.3 var(--font-print);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- boutons ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 40px;
  font: 700 var(--fs-sm)/1 var(--font-print);
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.62em 1em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--pen-wash-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: default; transform: none; background: var(--paper-raised); }
.btn-primary { background: var(--pen); border-color: var(--pen); color: var(--on-pen); }
.btn-primary:hover { background: var(--pen); filter: brightness(1.1); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { background: var(--pen-wash); color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--pen-wash-2); border-color: var(--pen); color: var(--pen); }

/* ---------- sommaire ---------- */

/* En-tête : l'étiquette de couverture du cahier. */
.hub-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 4px 0 38px; }
.cover { position: relative; min-width: 0; }
.cover-label {
  position: relative;
  max-width: 30rem;
  padding: 16px 18px 20px;
  background: var(--paper-raised);
  border: 2px solid var(--pen);
  border-radius: 14px;
  box-shadow: inset 0 0 0 4px var(--paper-raised), inset 0 0 0 5.5px var(--pen);
  transform: rotate(-0.6deg);
}
.hub-title {
  font: 700 clamp(2.1rem, 9.5vw, 3rem)/1 var(--font-print);
  letter-spacing: -0.02em;
  margin: 0 44px 0 0;
  white-space: nowrap;
}
.hub-title-pen {
  display: inline-block;
  font-family: var(--font-pen);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--pen);
  transform: rotate(-5deg) translateY(0.05em);
  margin-left: 0.08em;
}
.hub-settings {
  appearance: none; position: absolute; right: 8px; top: 8px;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--ink-2); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.hub-settings:hover { color: var(--ink); background: var(--pen-wash); }
.hub-settings-icon { width: 24px; height: 24px; }
.hub-settings-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* la ligne du prénom : on la touche pour écrire son prénom ou changer de joueur */
.name-tag {
  appearance: none; display: flex; align-items: flex-end; gap: 10px;
  width: 100%; margin: 12px 0 0; padding: 2px 0 0;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: var(--radius);
}
.name-tag .avatar { width: 2.25rem; height: 2.25rem; transition: transform 0.18s cubic-bezier(0.2, 1.6, 0.4, 1); }
.name-tag:hover .avatar { transform: scale(1.1) rotate(-6deg); }
.name-tag-name {
  flex: 1; min-width: 0; padding: 0 3px 1px;
  font: 700 1.6rem/1.25 var(--font-pen); color: var(--pen);
  border-bottom: 2px dotted var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-tag:hover .name-tag-name { border-bottom-color: var(--pen); }
.name-tag.is-blank .name-tag-name { font-size: 1.3rem; line-height: 1.5; opacity: 0.75; }
.name-tag.is-blank:hover .name-tag-name { opacity: 1; }

/* les médailles gagnées, collées en gommettes sur le bord de l'étiquette */
.cover-stickers { position: absolute; right: 14px; bottom: -26px; display: flex; gap: 2px; }
.medal.mini { padding: 0 1px; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.medal.mini .medal-disc { width: 36px; }
.medal.mini .medal-num { font-size: 0.9375rem; }
.medal.mini .medal-num.is-long { font-size: 0.6875rem; }
.cover-stickers .mini:nth-child(odd) { transform: rotate(-8deg); }
.cover-stickers .mini:nth-child(even) { transform: rotate(6deg); }
/* quand un classement ou la bulle suit, les gommettes ne doivent pas être recouvertes */
.cover-label:has(.cover-stickers) + .rank-line { margin-top: 30px; }
/* le classement sur une ligne, que l'on déplie en tableau */
.rank-line { max-width: 30rem; margin-top: 8px; }
.rank-sum {
  display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 5px 2px;
  font-size: var(--fs-xs); color: var(--ink-2); cursor: pointer; list-style: none; border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.rank-sum::-webkit-details-marker { display: none; }
.rank-sum-icon { flex: none; align-self: center; width: 18px; height: 18px; color: var(--ink-3); }
.rank-sum-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rank-sum-list { flex: 1; display: flex; align-items: baseline; gap: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.rank-chip { flex: 0 1 auto; display: inline-flex; align-items: baseline; gap: 4px; min-width: 3rem; }
.rank-chip-pos { font: 700 0.6875rem/1 var(--font-mono); color: var(--ink-3); }
.rank-chip-name { font: 700 1rem/1.2 var(--font-pen); color: var(--ink-2); max-width: 6.5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rank-chip.is-me .rank-chip-name { color: var(--pen); }
.rank-chip .who-name.is-blank { width: 2.4rem; height: 0.9rem; }
.rank-sum-arrow { flex: none; width: 7px; height: 7px; margin: 0 4px 2px 0; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.15s; }
.rank-line[open] .rank-sum-arrow { transform: translateY(3px) rotate(-135deg); }
.rank-sum:hover .rank-sum-icon, .rank-sum:hover .rank-chip-name { color: var(--ink); }
.rank-line .rank-scroll { margin-top: 4px; }
.rank-note { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.lede { font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); max-width: 36ch; }
.lede-wide { display: none; }
@media (max-width: 380px) {
  .cover-stickers .medal-disc { width: 30px; }
  .cover-stickers .medal-num { font-size: 0.8125rem; }
  .cover-stickers { bottom: -22px; }
}

/* Tablette et ordinateur : l'étiquette à gauche, la phrase à droite, sur les colonnes du sommaire. */
@media (min-width: 900px) {
  .hub-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px; align-items: start; margin-bottom: 48px; }
  .cover-label { padding: 20px 24px 24px; }
  .hub-title { font-size: 3.25rem; }
  .lede, .lede-wide { display: block; font-size: 1.1875rem; max-width: 30ch; margin-top: 3.2rem; }  /* à hauteur du prénom ; ne bouge pas quand le classement se déplie */
  .hub-install { grid-column: 1 / -1; }
}

/* boutons à pictogramme (fermer, modifier) : pas de texte superflu */
.icon-btn, .sheet-close {
  appearance: none; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  color: var(--ink-2); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover, .sheet-close:hover { color: var(--ink); background: var(--pen-wash); }
.icon-btn svg, .sheet-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sheet-close { position: absolute; top: 6px; right: 6px; z-index: 2; }
.sheet > .win-title, .sheet > .eyebrow { padding-right: 30px; }
.hub-install { position: relative; padding-right: 46px; }
.hub-install-later { position: absolute; top: 4px; right: 4px; }

/* accueil « Qui joue ? » : un cahier par joueur */
.chooser-head { margin: 4px 0 30px; }
.chooser-ask { margin: 10px 0 0; font: 700 1.6rem/1.25 var(--font-pen); color: var(--pen); }
.chooser-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr)); gap: 18px 16px; max-width: 46rem; }
.chooser-item { position: relative; min-width: 0; }
.chooser-card {
  appearance: none; width: 100%; min-height: 10rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 10px 12px; font: inherit; color: inherit; cursor: pointer;
  background: var(--paper-raised); border: 1.5px solid var(--ink); border-radius: 10px;
  box-shadow: 2px 3px 0 var(--pen-wash-2);
  transition: transform 0.14s cubic-bezier(0.2, 1.6, 0.4, 1);
  -webkit-tap-highlight-color: transparent;
}
.chooser-card:hover { transform: translateY(-2px) rotate(-1deg); }
.chooser-card:active { transform: scale(0.97); }
.chooser-card.is-current { border-color: var(--pen); box-shadow: inset 0 0 0 1.5px var(--pen), 2px 3px 0 var(--pen-wash-2); }
.chooser-card .avatar { width: 4rem; height: 4rem; }
.chooser-name { max-width: 100%; font: 700 1.5rem/1.15 var(--font-pen); color: var(--pen); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chooser-medals { display: flex; justify-content: center; gap: 1px; min-height: 34px; }
.chooser-medals .medal-disc { width: 28px; }
.chooser-medals .medal-num { font-size: 0.75rem; }
.chooser-card.is-new { background: transparent; border-style: dashed; border-color: var(--ink-3); box-shadow: none; }
.chooser-plus { font: 400 2.75rem/1 var(--font-pen); color: var(--ink-3); }
.chooser-card.is-new .chooser-name { font-size: 1.2rem; color: var(--ink-2); }
.chooser-edit { position: absolute; top: 2px; right: 2px; color: var(--ink-3); }
.win-owner.is-blank { justify-content: flex-start; }
.win-owner.is-blank .win-owner-btn { margin-left: 0; color: var(--pen); font: 700 1.125rem/1 var(--font-pen); }

/* fiche « bulletin » */
.sheet-bulletin .win-title { margin: 0 0 10px; }
.bul-who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bul-who .who .avatar { width: 2.25rem; height: 2.25rem; }
.bul-who .who-name { font-size: 1.5rem; }
.sheet-bulletin .medal-row { max-width: none; }
.sheet-bulletin .rank-col { width: 2.6rem; }
.sheet-bulletin .th-long { display: none; }
.sheet-bulletin .th-short { display: inline; }
.sheet-bulletin .rank-table .avatar { display: none; }
.sheet-bulletin .rank-table thead th:first-child { width: 1.3rem; }
.sheet-bulletin .rank-table th, .sheet-bulletin .rank-table td { padding-left: 4px; padding-right: 4px; }

/* Médailles : ce qui est acquis, palier par palier. */
.medals { position: relative; min-width: 0; }
.medal-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 4px; max-width: 21rem; }
.medal {
  --tier: var(--ink-3); --tier-bg: transparent;
  appearance: none; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center;
  padding: 6px 2px 4px; font: inherit; color: inherit; background: transparent; border: 0; border-radius: var(--radius); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* pas de case qui s'allume : c'est la médaille elle-même qui réagit */
.medal-disc { transition: transform 0.18s cubic-bezier(0.2, 1.6, 0.4, 1); }
.medal:hover .medal-disc, .medal.is-shown .medal-disc { transform: scale(1.14) rotate(-5deg); }
.medal:active .medal-disc { transform: scale(0.94); }
.medal-disc { position: relative; display: block; width: 40px; aspect-ratio: 48 / 58; }
.medal-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.medal-ribbon { fill: var(--tier); stroke: var(--tier); stroke-width: 1.5; stroke-linejoin: round; }
.medal-ring { fill: var(--tier-bg); stroke: var(--tier); stroke-width: 2.4; }
.medal-inner { fill: none; stroke: var(--tier); stroke-width: 1; opacity: 0.55; }
.medal-num { position: absolute; left: 0; right: 0; top: 0; height: 72.4%; display: grid; place-items: center; font: 700 1.0625rem/1 var(--font-pen); color: var(--ink); }
.medal-num.is-long { font-size: 0.8125rem; }
.medal-label { margin-top: 2px; font: 700 0.6875rem/1.3 var(--font-print); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.medal-tier { min-height: 1rem; font: 700 0.875rem/1.1 var(--font-pen); color: var(--tier); }
/* pas encore de médaille : un simple rond au crayon, sans ruban */
.m-none .medal-ribbon, .m-none .medal-inner { display: none; }
.m-none .medal-ring { stroke-width: 1.5; stroke-dasharray: 3 3.5; }
.m-none .medal-label { color: var(--ink-3); }
/* la première médaille : en papier, blanche, au trait */
.m-paper { --tier: var(--ink-2); --tier-bg: var(--paper-raised); }
.m-paper .medal-ribbon { fill: var(--paper-raised); }
.m-paper .medal-num { color: var(--pen); }
.m-bronze { --tier: var(--m-bronze); --tier-bg: var(--m-bronze-bg); }
.m-silver { --tier: var(--m-silver); --tier-bg: var(--m-silver-bg); }
.m-gold { --tier: var(--m-gold); --tier-bg: var(--m-gold-bg); }
.m-diamond { --tier: var(--m-diamond); --tier-bg: var(--m-diamond-bg); }
.m-bolt { --tier: var(--pen); --tier-bg: var(--highlight); }
.m-bolt .medal-num { color: #1b1a2e; }
/* le mot qui sort de la médaille touchée, puis s'efface doucement */
.medal-bubble {
  position: absolute; z-index: 5; margin: 0; padding: 8px 12px 9px;
  font: 700 1.0625rem/1.3 var(--font-pen); color: var(--ink); text-align: left;
  background: var(--paper-raised); border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: var(--shadow);
  pointer-events: none; visibility: hidden; opacity: 0;
  transform: translateY(-10px) scale(0.5); transform-origin: var(--ax, 50%) -8px;
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0s 0.7s;
}
.medal-bubble::before {
  content: ""; position: absolute; left: var(--ax, 50%); top: -7px; width: 11px; height: 11px;
  background: var(--paper-raised); border: solid var(--ink); border-width: 1.5px 0 0 1.5px;
  transform: translateX(-50%) rotate(45deg);
}
.medal-bubble.is-on {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 0.14s ease-out, transform 0.22s cubic-bezier(0.2, 1.5, 0.4, 1), visibility 0s;
}

/* gommettes : l'image d'un joueur */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--r2); color: var(--pen);
}
.avatar svg { width: 76%; height: 76%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.avatar.is-blank { background: transparent; box-shadow: inset 0 0 0 1.5px var(--grid); border: 0; outline: 1.5px dashed var(--ink-3); outline-offset: -1.5px; box-shadow: none; }
.av-1 { background: var(--r1); } .av-2 { background: var(--r2); } .av-3 { background: var(--r3); }
.av-4 { background: var(--r4); } .av-5 { background: var(--r5); } .av-6 { background: var(--r6); }
.av-7 { background: var(--r7); } .av-8 { background: var(--r8); } .av-9 { background: var(--r9); }
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.who .avatar { width: 1.75rem; height: 1.75rem; }
.who-name { font: 700 1.125rem/1.2 var(--font-pen); color: var(--pen); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* le cahier sans nom : des pointillés, comme une étiquette pas encore remplie */
.who-name.is-blank { width: 5.5rem; height: 1.1rem; border-bottom: 2px dotted var(--ink-3); }

/* classement de l'appareil */
.rank-scroll { overflow-x: auto; }
.rank-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-sm); }
.rank-table thead th:first-child { width: 1.9rem; }
.rank-col { width: 5rem; }
.th-short { display: none; text-decoration: none; }
.rank-table .who { display: flex; max-width: 100%; }
@media (max-width: 560px) {
  .rank-col { width: 2.9rem; }
  .th-long { display: none; }
  .th-short { display: inline; }
  .rank-table th, .rank-table td { padding-left: 4px; padding-right: 4px; }
}
/* très petits écrans : le prénom d'abord, sans la gommette */
@media (max-width: 380px) {
  .rank-col { width: 2.5rem; }
  .rank-table thead th:first-child { width: 1.3rem; }
  .rank-table .avatar { display: none; }
}
.rank-table th, .rank-table td { padding: 7px 8px; text-align: left; border-bottom: 1px dashed var(--grid); }
.rank-table thead th { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); border-bottom: 0; white-space: nowrap; }
.rank-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table tbody th { font-weight: 400; overflow: hidden; }
.rank-pos { width: 1.5rem; font: 700 var(--fs-sm) var(--font-mono); color: var(--ink-3); }
.rank-table tr.is-current > *, .game-rank li.is-current { background: var(--highlight-wash); }
.game-rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.game-rank li { counter-increment: rank; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 4px; border-bottom: 1px dashed var(--grid); }
.game-rank li::before { content: counter(rank); width: 1.2rem; font: 700 var(--fs-sm) var(--font-mono); color: var(--ink-3); }
.game-rank .who { flex: 1; }
.rec-size { display: block; font: 400 0.6875rem/1.3 var(--font-mono); color: var(--ink-3); }

/* trois cases par jeu : Facile, Moyen, Difficile */
.ticks { display: inline-flex; gap: 3px; }
/* la coche déborde de sa case, comme au stylo (sans position absolue : mal peinte dans les colonnes) */
.tick { display: grid; place-items: center; width: 11px; height: 11px; border: 1.5px solid var(--ink-3); border-radius: 2px; }
.tick.is-done { border-color: var(--ink-2); }
.tick svg { width: 14px; height: 14px; margin: -3px; transform: translate(1.5px, -2px); fill: none; stroke: var(--pen); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

.toc { columns: 2 25rem; column-gap: 64px; }
.chapter { break-inside: avoid; margin: 0 0 40px; }
.chapter-title {
  font: 700 var(--fs-lg)/1.2 var(--font-print);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.chapter-note { font-size: var(--fs-sm); color: var(--ink-2); margin: 8px 0 6px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li + li { border-top: 1px dashed var(--grid); }

.toc-entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.toc-entry:hover { background: var(--pen-wash); }
.toc-entry:hover .toc-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.toc-glyph { grid-row: 1 / span 2; width: 48px; height: 48px; color: var(--ink); }
.toc-glyph svg { display: block; width: 100%; height: 100%; overflow: visible; }
.toc-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.toc-name { font: 700 1.1875rem/1.2 var(--font-print); white-space: nowrap; }
/* Pointillés + record restent ensemble : si le nom est trop long pour eux,
   ils passent d’un bloc sur la ligne suivante, qu’ils remplissent. */
.toc-tail { flex: 1 1 auto; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.toc-leader { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--ink-3); transform: translateY(-0.28em); }
.toc-best { font: 700 1.3rem/1 var(--font-pen); color: var(--pen); white-space: nowrap; }
.toc-best.is-empty { font: 400 var(--fs-sm)/1 var(--font-print); color: var(--ink-3); }
/* La mention (« 6×6 », « Moyen », « 16 pays · 1 résolue ») est toujours au même
   endroit : en haut à droite du résumé, qui coule autour d’elle. */
.toc-sub { display: block; min-width: 0; font-size: var(--fs-sm); line-height: 1.4; }
.toc-sub::after { content: ""; display: block; clear: both; }
.toc-pitch { color: var(--ink-2); }
.toc-meta { display: flex; align-items: center; gap: 8px; float: right; margin: 4px 0 0 14px; font: 400 var(--fs-xs)/1.2 var(--font-mono); color: var(--ink-3); white-space: nowrap; }  /* moins haute qu’une ligne du résumé : une seule ligne coule à côté */

/* classes des pictogrammes du sommaire */
.gl-ink { fill: var(--ink); }
.gl-pen { fill: var(--pen); }
.gl-soft { fill: var(--cell-given); }
.gl-hl { fill: var(--highlight); }
.gl-paper { fill: var(--cell); }
.gl-ink-s { stroke: var(--ink); }
.gl-pen-s { stroke: var(--pen); }
.gl-line-s { stroke: var(--grid); }
.gl-red-s { stroke: var(--red); }
/* sans remplissage par défaut, mais une classe de remplissage sur le même élément l'emporte */
:where(.gl-ink-s, .gl-pen-s, .gl-line-s, .gl-red-s) { fill: none; }

.hub-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

/* ---------- page de jeu ---------- */

.game-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}
.back:hover { color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }

.chrono { display: flex; flex-direction: column; align-items: flex-end; }
.chrono-label { font: 700 var(--fs-xs)/1 var(--font-print); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.chrono-time {
  font: 700 clamp(1.9rem, 6vw, 2.6rem)/1.05 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.chrono.is-done .chrono-time { color: var(--green); }
.chrono.is-failed .chrono-time { color: var(--red); }

.game-head { padding: 8px 0 14px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.game-title { font: 700 var(--fs-xl)/1.05 var(--font-print); letter-spacing: -0.015em; margin-top: 6px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 22px;
}
.toolbar-actions { display: flex; gap: 8px; }

.levels { display: inline-flex; gap: 6px; }
.level {
  position: relative;
  min-height: 40px;
  font: 700 var(--fs-sm)/1 var(--font-mono);
  padding: 0.6em 0.75em;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--radius);
}
.level { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.level-name { font-family: var(--font-print); }
.level-size { font-size: 0.6875rem; font-weight: 400; color: var(--ink-3); }
.level[aria-checked="true"] .level-size { color: inherit; }
.level:hover { color: var(--ink); background: var(--pen-wash); }
.level[aria-checked="true"] { color: var(--pen); }
/* la taille choisie est entourée au stylo */
.level[aria-checked="true"]::after {
  content: "";
  position: absolute;
  inset: 1px -3px;
  border: 2px solid var(--pen);
  border-radius: 48% 52% 45% 55% / 55% 45% 52% 48%;
  transform: rotate(-3deg);
  pointer-events: none;
}

.game-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  align-items: start;
}
@media (max-width: 900px) {
  .game-body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
.play { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.board-wrap {
  container-type: inline-size;
  width: min(100%, var(--board-max, 520px));
  margin: 0 auto;
}
.board-loading, .board-error {
  display: grid;
  place-items: center;
  gap: 12px;
  aspect-ratio: 1;
  border: 2px dashed var(--grid);
  color: var(--ink-2);
  text-align: center;
  padding: 16px;
}
.board.is-solved { pointer-events: none; }

.solved-note {
  text-align: center;
  font: 700 1.35rem/1.2 var(--font-pen);
  color: var(--green);
  transform: rotate(-1.5deg);
}
.controls-hint { text-align: center; font-size: var(--fs-sm); color: var(--ink-2); max-width: 56ch; margin: 0 auto; }

.side { display: grid; gap: 30px; }

.consigne { background: var(--paper-raised); border: 1.5px solid var(--ink); padding: 16px 18px; }
.consigne h2, .consigne summary {
  font: 700 var(--fs-sm)/1.3 var(--font-print);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.consigne h2 { margin-bottom: 10px; }
.consigne summary { cursor: pointer; list-style-position: inside; }
.consigne[open] summary { margin-bottom: 10px; }
.consigne ul { margin: 0; padding-left: 1.15em; font-size: var(--fs-sm); line-height: 1.5; }
.consigne li + li { margin-top: 6px; }
.consigne-mobile { display: none; }
@media (max-width: 900px) {
  .consigne-mobile { display: block; }
  .consigne-desk { display: none; }
}

.records h2 { font: 700 var(--fs-xs)/1.3 var(--font-print); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.records h3 { font: 700 var(--fs-xs)/1.3 var(--font-print); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 20px 0 6px; }
.rec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rec-table th, .rec-table td { padding: 7px 6px; text-align: left; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
.rec-table thead th { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); }
.rec-table tbody th { font: 700 var(--fs-sm) var(--font-mono); }
.rec-table .num { text-align: right; }
/* la ligne de la taille en cours est passée au surligneur */
.rec-table tr.is-current > * {
  background-image: linear-gradient(transparent 16%, var(--highlight-wash) 16%, var(--highlight-wash) 88%, transparent 88%);
}
.rec-pen { font: 700 1.125rem/1 var(--font-pen); color: var(--pen); }
.rec-wait { font-size: var(--fs-sm); color: var(--ink-3); }
.rec-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 0; }
.rec-facts dt { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.rec-facts dd { margin: 2px 0 0; }
.rec-rule { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 10px; }
.history { list-style: none; margin: 0; padding: 0; font: 400 var(--fs-sm) var(--font-mono); }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--grid); }
.h-time { font-weight: 700; }
.h-time.is-abandon { color: var(--red); font-weight: 400; }
.h-date { color: var(--ink-3); }
.history-empty { font-size: var(--fs-sm); color: var(--ink-3); }

/* ---------- grille imprimée (commune à tous les jeux) ---------- */

.pgrid {
  --cols: 6;
  --rows: 6;
  --grid-w: 100cqi;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
  aspect-ratio: var(--cols) / var(--rows);
  width: 100%;
  background: var(--cell);
  border: 2.5px solid var(--grid-strong);
  font-size: calc(var(--grid-w) / var(--cols) * 0.52);
  line-height: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.pcell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  cursor: pointer;
  transition: background-color 0.12s, box-shadow 0.12s;
}
.pcell.thick-r { border-right: 2.5px solid var(--grid-strong); }
.pcell.thick-b { border-bottom: 2.5px solid var(--grid-strong); }
.pcell.last-c { border-right: 0; }
.pcell.last-r { border-bottom: 0; }
/* survol, sélection et surligneur sont des calques : la teinte de la case
   (région, case imprimée) reste visible dessous */
@media (hover: hover) {
  :where(.pcell:not(.is-given)):hover { box-shadow: inset 0 0 0 100vmax var(--pen-wash); }
}
.pcell.is-given { background-color: var(--cell-given); cursor: default; }
.pcell.is-peer { box-shadow: inset 0 0 0 100vmax var(--pen-wash); }
.pcell.is-sel { box-shadow: inset 0 0 0 100vmax var(--pen-wash-2); }
.pcell.is-lit { background-image: linear-gradient(var(--highlight-wash), var(--highlight-wash)); }
.pcell.is-shaded { background-color: var(--shade); }
/* l'erreur est entourée au stylo rouge */
.pcell.is-error::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px solid var(--red);
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  transform: rotate(-8deg);
  pointer-events: none;
}
/* sur une case noircie, le cercle rouge garde un liseré papier pour rester lisible */
.pcell.is-shaded.is-error::after { box-shadow: 0 0 0 2px var(--cell), inset 0 0 0 2px var(--cell); }

.v-print { font: 700 1em/1 var(--font-print); color: var(--ink); }
.v-pen {
  display: inline-block;
  font: 700 1.12em/1 var(--font-pen);
  color: var(--pen);
  transform: rotate(var(--tilt, 0deg)) translateY(0.06em);
}
.pcell.is-shaded .v-print { color: var(--on-shade); }
.mark-dot { width: 16%; aspect-ratio: 1; border-radius: 50%; background: var(--ink-3); }

.clue { display: grid; place-items: center; font: 700 1em/1 var(--font-print); color: var(--ink); }
.clue.is-done { color: var(--ink-3); }
.clue.is-error { color: var(--red); }

/* ---------- fenêtre de victoire ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.sheet {
  position: relative;
  width: min(100%, 430px);
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 26px 26px 22px 46px;
  animation: sheet-in 0.24s ease-out;
}
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background: var(--margin);
}
.sheet { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.win-title { font: 700 var(--fs-lg)/1.2 var(--font-print); margin-top: 6px; }
.win-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -6px 0 20px; padding-top: 12px; border-top: 1px dashed var(--grid); font-size: var(--fs-sm); color: var(--ink-2); }
.win-owner .avatar { width: 1.75rem; height: 1.75rem; }
.win-owner b { font: 700 1.125rem/1 var(--font-pen); color: var(--pen); }
.win-owner-btn { min-height: 32px; padding: 0.3em 0.5em; margin-left: auto; }

/* « Qui joue ? », fiche d'un joueur, réglages */
.sheet-who .win-title, .sheet-settings .win-title { margin: 0 0 14px; }
.who-list { list-style: none; margin: 0 0 18px; padding: 0; }
.who-list li { display: flex; align-items: center; gap: 6px; border-bottom: 1px dashed var(--grid); }
.who-btn {
  appearance: none; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 52px;
  padding: 6px 8px; margin: 0 -8px; font: inherit; color: inherit; text-align: left;
  background: transparent; border: 0; border-radius: var(--radius); cursor: pointer;
}
.who-btn:hover { background: var(--pen-wash); }
.who-btn.is-current { background: var(--highlight-wash); }
.who-btn .who .avatar { width: 2.25rem; height: 2.25rem; }
.who-btn .who-name { font-size: 1.375rem; }
.who-note { font-size: var(--fs-xs); color: var(--ink-3); }
.who-edit { margin-right: -6px; }
.field-label { display: block; margin: 12px 0 6px; font: 700 var(--fs-xs)/1.3 var(--font-print); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.field {
  display: block; width: 100%; min-height: 46px; padding: 4px 4px 2px;
  font: 700 1.5rem/1.2 var(--font-pen); color: var(--pen);
  background: transparent; border: 0; border-bottom: 2px dotted var(--ink-2); border-radius: 0;
}
.field:focus { outline: none; border-bottom: 2px solid var(--pen); }
.code-field { width: 7.5rem; letter-spacing: 0.4em; font-family: var(--font-mono); -webkit-text-security: disc; }
.form-error { margin-top: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--red); }
.form-error[hidden] { display: none; }
.avatar-choices { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 20px; }
.avatar-choice { appearance: none; display: grid; place-items: center; aspect-ratio: 1; padding: 0; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.avatar-choice .avatar { width: 84%; height: 84%; }
.avatar-choice[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--pen); }
.avatar-choice:hover { background: var(--pen-wash); }
.set-block { margin: 0 0 20px; padding-top: 12px; border-top: 1.5px solid var(--ink); }
.set-block h3 { font: 700 var(--fs-xs)/1.3 var(--font-print); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.set-note { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 10px; }
.set-note.is-small { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 12px; }
.set-list { list-style: none; margin: 0 0 12px; padding: 0; }
.set-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-bottom: 1px dashed var(--grid); }
.set-row-actions { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: auto; }
.set-row-actions .btn { min-height: 36px; padding: 0.4em 0.6em; font-size: var(--fs-xs); }
.btn.is-armed { color: var(--red); border-color: var(--red); text-decoration: none; }
.win-time { font: 700 3.25rem/1 var(--font-mono); font-variant-numeric: tabular-nums; margin: 10px 0 14px; }
.win-notes { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 6px; }
.win-note { font: 700 1.25rem/1.25 var(--font-pen); transform: rotate(-1.2deg); transform-origin: left center; }
.win-note:nth-child(even) { transform: rotate(0.8deg); }
.win-note.is-good { color: var(--green); }
.win-note.is-info { color: var(--pen); }
.win-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(10px) rotate(-0.6deg); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 520px) {
  .toolbar { justify-content: center; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .levels { width: 100%; justify-content: center; }
  .toc-sub { font-size: var(--fs-xs); }
  .toc-meta { margin-top: 2px; }
}

/* ---------- application installée (PWA) ---------- */

/* encart « Installe le cahier », sous les chiffres du sommaire (rempli par js/pwa.js) */
.hub-install {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 12px 14px 12px 16px;
  border: 1.5px dashed var(--pen);
  border-radius: var(--radius);
  background: var(--pen-wash);
}
.hub-install[hidden], .hub-foot-install[hidden] { display: none; }
.hub-install-text { flex: 1 1 17rem; margin: 0; font-size: var(--fs-sm); line-height: 1.45; }
.hub-install-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-install-steps { flex-basis: 100%; margin: 2px 0 4px; padding-left: 1.4em; font-size: var(--fs-sm); line-height: 1.6; }
.hub-foot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* marges pour l'encoche et la barre système quand le cahier est installé */
.page {
  padding-top: max(28px, calc(env(safe-area-inset-top) + 12px));
  padding-bottom: max(72px, calc(env(safe-area-inset-bottom) + 24px));
}

.update-toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px;
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
}
