:root {
  /* Theme C « Atelier »: teal and coral, flat colour blocks, rounded surfaces. */
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #eaf0ed;
  --text: #10201d;
  --muted: #5b6b67;
  --border: #e1e8e5;
  --accent: #0e5e57;
  --accent-strong: #08423d;
  --accent-text: #ffffff;
  --accent-soft: #d4f3e6;
  --on-accent-soft: #0b3d36;
  --coral: #ff7a59;
  --coral-strong: #e0502c;
  --coral-soft: #ffe2d8;
  --on-coral: #2a0f06;
  --sun: #ffd166;
  --sun-soft: #fff0c2;
  --lilac-soft: #e8e2ff;
  --on-lilac: #3b2a96;
  --sky-soft: #d9f0fb;
  --on-sky: #0f5a78;
  --warn: #7a5600;
  --warn-soft: #fff0c2;
  --danger: #b4321a;
  --danger-soft: #ffe2d8;
  --ok: #1d7044;
  --ok-soft: #d4f3e6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16,32,29,.04), 0 6px 18px rgba(16,32,29,.05);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Outfit", "DM Sans", -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1715; --surface: #16211f; --surface-2: #1d2a27; --text: #e6efec; --muted: #9db0ab; --border: #26342f;
    --accent: #3fb6a3; --accent-strong: #6fd0c0; --accent-text: #05211d; --accent-soft: #163a34; --on-accent-soft: #bdeee2;
    --coral: #ff8a6b; --coral-strong: #ffa489; --coral-soft: #3f2219; --on-coral: #2a0f06;
    --sun: #ffd166; --sun-soft: #3a3016; --lilac-soft: #2a2546; --on-lilac: #d3caff; --sky-soft: #15303c; --on-sky: #b6e3f5;
    --warn: #ffcf6a; --warn-soft: #3a3016; --danger: #ff9a80; --danger-soft: #3f2219; --ok: #6fd39c; --ok-soft: #163a34;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
svg.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Layout */
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
header.top .brand { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: var(--text); }
header.top .brand .logo { width: 30px; height: 30px; border-radius: 8px; display: block; }
header.top .back { font-size: 1.4rem; padding: 0 6px 0 0; color: var(--text); }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
@media (min-width: 1000px) { main { padding: 20px 32px; } }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); padding: 4px 0; border-radius: 10px; }
nav.tabs a svg { width: 24px; height: 24px; }
nav.tabs a.active { color: var(--accent); font-weight: 600; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list > a, .list > .row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); min-height: 52px; }
.list > :last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .chev { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 24px 16px; }

.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .9rem; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.quick a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 14px; color: var(--text); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.quick a.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; font-weight: 600; font-size: 1.05rem; }
.quick a svg { width: 26px; height: 26px; }
.quick a span.sub { font-size: .8rem; opacity: .75; font-weight: 400; }

/* Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
label .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; padding: 11px 16px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { flex: 1 1 auto; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0; }
.photos .ph { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; cursor: pointer; }
.photos .add { aspect-ratio: 3/4; border-radius: 10px; border: 2px dashed var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: .8rem; cursor: pointer; background: transparent; font: inherit; }
.photos .add svg { width: 28px; height: 28px; }
input[type=file].hidden { display: none; }

/* Correction */
.score-big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.crit { border-top: 1px solid var(--border); padding: 12px 0; }
.crit:first-child { border-top: 0; padding-top: 4px; }
.crit .head { display: flex; gap: 8px; align-items: center; }
.crit .head .name { flex: 1; font-weight: 600; }
.crit .head input { width: 64px; text-align: center; padding: 6px; }
.crit .head .max { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.crit .head.letter { flex-wrap: wrap; row-gap: 6px; }
.crit .head.letter .name { flex-basis: 100%; }
.lv { display: flex; gap: 5px; }
.lv button { width: 40px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.lv button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.lv button:disabled { cursor: default; opacity: .7; }
.lv button.on:disabled { opacity: 1; }
.crit .pts { color: var(--muted); font-size: .88rem; margin-left: 4px; }
.flash-input { background: var(--accent-soft) !important; transition: background .3s; }
.crit textarea { min-height: 54px; margin-top: 6px; font-size: .92rem; }
.transcript { font-size: .92rem; }
.transcript .item { padding: 8px 0; border-top: 1px dashed var(--border); }
.transcript .item:first-child { border-top: 0; }
.transcript .q { font-weight: 600; font-size: .82rem; color: var(--muted); }
.transcript .a { white-space: pre-wrap; font-family: ui-rounded, "Comic Sans MS", var(--font); }
.callout { border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .92rem; }
.callout.warn { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); }
.callout.danger { background: var(--danger-soft); border-left: 4px solid var(--danger); }
.callout.info { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.callout ul { margin: 4px 0; padding-left: 18px; }
.pill-list { margin: 4px 0; padding-left: 18px; }

details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; color: var(--muted); }
details.card[open] > summary::after { content: '▴'; }

.seg { display: flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 3px; margin: 8px 0; }
.seg button { flex: 1; border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; padding: 8px 6px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Rendered Markdown */
.md { font-size: .95rem; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-size: 1rem; margin: .9rem 0 .3rem; }
.md ul, .md ol { padding-left: 20px; margin: .3rem 0; }
.md p { margin: .35rem 0; }
.md table { border-collapse: collapse; font-size: .88rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 4px 8px; }
.md > :first-child { margin-top: 0; }

/* Chat */
.chat-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - 190px); }
.chat-msgs { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
/* Confirmation box of a sensitive assistant action */
.act-box { margin-top: 10px; padding: 12px; border: 2px solid var(--warn); border-radius: 12px; background: var(--warn-soft); color: var(--text); }
.act-head { display: flex; gap: 8px; align-items: flex-start; }
.act-head svg { width: 20px; height: 20px; flex: none; color: var(--warn); }
.act-box ul { margin: 8px 0 6px; padding-left: 22px; overflow-wrap: anywhere; }
.act-warn { margin: 8px 0 10px; }
.act-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.act-box:not(.pending) { border-width: 1px; border-color: var(--border); background: var(--surface-2); }
.act-box.confirmed .act-state { color: var(--ok); }
.act-box.failed .act-state { color: var(--danger); }
.act-state { margin-top: 8px; }
.msg img { max-width: 160px; border-radius: 8px; display: block; margin-bottom: 6px; }
.chat-input { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0; display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { min-height: 44px; max-height: 160px; border-radius: 22px; padding: 11px 16px; }
.chat-input .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: none; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.suggest button { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 8px 12px; cursor: pointer; text-align: left; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 4px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Misc */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); color: #fff; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 40; display: flex; align-items: center; justify-content: center; overflow: auto; touch-action: pinch-zoom; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox .close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; background: rgba(255,255,255,.15); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.page-head .grow { flex: 1; min-width: 0; }
.row-flex { display: flex; gap: 8px; align-items: center; }
.privacy { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; }
.privacy svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 1.3rem; }
.stats div > span { font-size: .75rem; color: var(--muted); }

/* Scanning */
.scan .strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; min-height: 120px; align-items: center; }
.scan .strip .ph { position: relative; flex: none; width: 78px; aspect-ratio: 3/4; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.scan .strip .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan .strip .ph button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.scan .strip .pnum { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 5px; }
.strip-empty { padding: 8px 2px; }
.btn.big { min-height: 64px; font-size: 1.1rem; border-radius: 14px; }
.btn.big svg { width: 26px; height: 26px; }
select.compact { width: auto; max-width: 55%; padding: 6px 10px; font-size: 14px; }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); padding: 2px 4px; }
.warn-text { color: var(--warn); font-weight: 600; }
.list .thumb { width: 40px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--border); display: block; }
.list a.dim { opacity: .55; }
.list b.grades { font-size: .85rem; letter-spacing: .02em; white-space: nowrap; }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

input.inline-date { width: auto; padding: 2px 6px; font-size: .85rem; border-color: transparent; background: transparent; color: var(--muted); }
input.inline-date:hover, input.inline-date:focus { border-color: var(--border); background: var(--surface); }

/* Correction documents */
.docs { display: flex; flex-direction: column; gap: 8px; }
.doc { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); position: relative; }
.doc-thumb { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; background: var(--surface-2); }
.doc-thumb.pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--danger); font-size: .7rem; font-weight: 700; gap: 2px; }
.doc-thumb.pdf svg { width: 24px; height: 24px; }
.doc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-body textarea { min-height: 52px; font-size: .9rem; padding: 8px 10px; }
.doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 24px; }
.doc-rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; }

/* Annotated copy */
.anno { position: relative; margin: 8px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); cursor: zoom-in; line-height: 0; }
.anno img { width: 100%; display: block; user-select: none; }
.abox { position: absolute; border: 2px solid #e03131; border-radius: 5px; background: rgba(224, 49, 49, .06); cursor: pointer; line-height: 1; }
/* Box drawn a little outside the word and number outside its top-left corner (in the gap between lines), so the
   first letter and accents stay visible. */
.abox b { position: absolute; bottom: calc(100% - 3px); right: calc(100% - 3px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e03131; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.abox.off { border: 2px dashed #868e96; background: rgba(134, 142, 150, .08); }
.abox.off b { background: #868e96; }
.abox.pulse { animation: pulse 0.45s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.25); } }
.anno-lb { display: block; overflow: hidden; }
.anno-scroll { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.anno-wrap { width: 100%; margin: 0 auto; max-width: none; }
.anno-tools .fit-btn { width: auto; padding: 0 14px; border-radius: 21px; font-size: 14px; font-weight: 600; }
.anno-lb .anno { border: 0; border-radius: 0; margin: 0; cursor: default; }
.anno-tools { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; z-index: 2; }
.anno-tools button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 20px; }


/* Transcription with corrections */
.transcript-view { background: var(--surface); border-radius: 10px; padding: 14px 16px; font-size: 1rem; line-height: 1.9; }
.transcript-view .titem { padding: 6px 0; border-top: 1px dashed var(--border); }
.transcript-view .titem:first-child { border-top: 0; }
.transcript-view .q { font-weight: 600; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.ttext { white-space: pre-wrap; font-family: ui-rounded, "Comic Sans MS", var(--font); }
.tmark { cursor: pointer; border-radius: 4px; padding: 0 2px; background: rgba(224, 49, 49, .08); white-space: nowrap; }
.tmark sup { color: #fff; background: #e03131; border-radius: 8px; padding: 0 4px; font-size: .62rem; font-family: var(--font); font-weight: 700; margin-right: 2px; }
.tmark s { color: #e03131; text-decoration-thickness: 2px; }
.tmark ins { text-decoration: none; color: var(--ok); font-weight: 700; font-family: var(--font); }
.tmark.off { background: rgba(134, 142, 150, .08); }
.tmark.off sup { background: #868e96; }
.tmark.off s { color: #868e96; }
.tmark.off ins { color: var(--muted); }
.tmark.pulse { animation: pulse 0.45s ease-in-out 3; display: inline-block; }

/* Mistake list */
.err { display: flex; gap: 10px; padding: 10px 6px; margin: 0 -6px; border-radius: 8px; border-top: 1px dashed var(--border); transition: background .3s; cursor: pointer; }
.err:hover { background: var(--surface-2); }
.err:first-child { border-top: 0; }
.err.off .err-body > div:first-child { opacity: .6; }
.err.flash { background: var(--warn-soft); }
.err-num { flex: none; width: 24px; height: 24px; border-radius: 12px; background: #e03131; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 2px; }
.err.off .err-num { background: #868e96; }
.err-body { flex: 1; min-width: 0; }
.err-body .a { font-family: ui-rounded, "Comic Sans MS", var(--font); text-decoration: line-through; text-decoration-color: #e03131; }
.err.off .err-body .a { text-decoration-color: #868e96; }
.err-q { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.seg.mini { margin: 0; padding: 2px; }
.seg.mini button { padding: 4px 14px; font-size: .82rem; }
.seg.mini button[data-dec="count"].on { background: var(--ok); color: #fff; }
.seg.mini button[data-dec="ignore"].on { background: #868e96; color: #fff; }

/* Spelling rules */
.rules { margin-top: 8px; }
.rule { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--border); }
.rule:first-child { border-top: 0; }
.rule .grow { flex: 1; min-width: 0; }

/* Review: navigation between copies, desktop layout */
.copy-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.copy-nav:empty { display: none; }
.review-pages { display: none; }
@media (min-width: 1100px) {
  main.wide { max-width: none; padding: 12px 20px; }
  .review-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(400px, 1fr); gap: 20px; align-items: start; }
  .review-pages { display: flex; flex-direction: column; position: sticky; top: 66px; height: calc(100vh - 82px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .pager-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .pager-bar .btn { min-height: 32px; }
  .pager-view { flex: 1; overflow: auto; background: var(--surface-2); padding: 10px; }
  .pager-zoom { margin: 0 auto; max-width: none; }
  .pager-view .anno { margin: 0; cursor: grab; }
  .pager-view.panning, .pager-view.panning * { cursor: grabbing !important; user-select: none; }
  .pager-thumbs { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); overflow-x: auto; }
  .pager-thumbs:empty { display: none; }
  .pager-thumbs img { height: 64px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; opacity: .7; }
  .pager-thumbs img.on { border-color: var(--accent); opacity: 1; }
  .review-panels .copy-card { display: none; }
  .review-panels { min-width: 0; }
}

/* Suspended rules */
.rule.disabled .grow b { color: var(--muted); text-decoration: line-through; }
.rule input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* Feedback sheets (on-screen preview + print)
   Letter 8.5 × 11 in with 0.35 in margins: each sheet is 7.8 × 10.25 in (safety margin included)
   and never overflows onto the next page. */
.sheets-toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.sheet-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; margin: 0; }
.sheets-wrap { overflow-x: auto; padding-bottom: 20px; }
.psheet { width: 7.6in; height: 10.1in; overflow: hidden; margin: 0 auto 18px; background: #fff; color: #000; padding: 0.2in 0.25in; box-shadow: 0 2px 12px rgba(0,0,0,.15);
  display: flex; flex-direction: column; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 12pt; line-height: 1.35;
  break-after: page; page-break-after: always; break-inside: avoid; }
.psheet.blank { box-shadow: 0 2px 12px rgba(0,0,0,.06); background: repeating-linear-gradient(45deg, #fff, #fff 12px, #f6f6f6 12px, #f6f6f6 24px); }
.sh-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2.5px solid #000; padding-bottom: 6px; margin-bottom: 10px; gap: 12px; }
.sh-name { font-size: 24pt; font-weight: 800; letter-spacing: -.01em; }
.sh-eval { text-align: right; }
.sh-small { font-size: 9.5pt; color: #333; }
.sh-grades { border-collapse: collapse; margin: 4px 0 8px; }
.sh-grades th, .sh-grades td { border: 1.5px solid #000; padding: 3px 12px; text-align: center; }
.sh-grades th { font-size: 9pt; font-weight: 600; }
.sh-grades td { font-size: 16pt; font-weight: 800; }
.sh-comment { font-size: 12.5pt; font-style: italic; margin: 4px 0 8px; padding: 6px 10px; border-left: 4px solid #000; }
.sh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.psheet h3 { font-size: 11.5pt; margin: 8px 0 3px; }
.psheet ul { margin: 0; padding-left: 18px; font-size: 10.5pt; }
.sh-words { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11pt; }
.sh-words b { display: inline-flex; width: 18px; height: 18px; border-radius: 9px; background: #000; color: #fff; font-size: 8.5pt; align-items: center; justify-content: center; }
.sh-words s { text-decoration-thickness: 1.5px; }
.sh-words .nc { color: #555; }
.sh-words .nc b { background: #777; }
.sh-copy { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin-top: 6px; }
.sh-copy img { max-width: 100%; max-height: 100%; object-fit: contain; }
.psheet.compact .sh-copy img { border: 1px solid #999; }
.sh-loading { color: #777; font-size: 10pt; }
.sh-mini { font-size: 9pt; color: #333; border-bottom: 1px solid #000; padding-bottom: 3px; flex: none; }
.sh-pagewords { flex: none; border-top: 1.5px solid #000; margin-top: 6px; padding-top: 4px; }
.sh-pagewords h3 { margin: 0 0 3px; font-size: 10.5pt; }
.sh-pagewords .sh-words { font-size: 10.5pt; gap: 3px 14px; }
.sh-sig { margin-top: auto; padding-top: 10px; font-size: 10.5pt; }
.psheet.compact .sh-sig { margin-top: 8px; padding-top: 0; }
/* « Moderne » theme: warm but understated, printable in black and white */
.psheet.fun { font-family: Andika, "Helvetica Neue", Arial, sans-serif; border: 1.5px solid #888; border-radius: 14px; padding: 0.3in 0.35in; }
.psheet.fun.copy-only { border-color: #aaa; padding: 0.2in 0.25in; }
.fun-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #000; }
.fun-hello { grid-column: 1; grid-row: 1; font-size: 9.5pt; color: #333; letter-spacing: .04em; text-transform: uppercase; }
.fun-name { grid-column: 1; grid-row: 2; font-family: Fredoka, Arial, sans-serif; font-size: 26pt; font-weight: 600; line-height: 1.05; }
.fun-eval { grid-column: 2; grid-row: 1 / 3; text-align: right; font-size: 10.5pt; }
.fun-eval b { font-family: Fredoka, Arial, sans-serif; font-weight: 600; font-size: 13pt; }
.fun-grades { display: flex; gap: 8px; justify-content: space-between; margin: 2px 0 14px; }
.fun-grade { flex: 1; border: 1.5px solid #000; border-radius: 10px; padding: 7px 4px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fun-gicon { height: 22px; opacity: .8; }
.fun-glabel { font-weight: 700; font-size: 10.5pt; line-height: 1.1; min-height: 2.2em; display: flex; align-items: center; }
.fun-circle { width: 46px; height: 46px; border: 2px solid #000; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: Fredoka, Arial, sans-serif; font-weight: 500; font-size: 24pt; line-height: 1; }
.fun-gword { font-size: 9pt; line-height: 1.15; color: #222; min-height: 2.3em; }
.fun-quote { position: relative; border-left: 4px solid #000; background: #f4f4f4; border-radius: 0 10px 10px 0; padding: 10px 14px 10px 34px; font-size: 12pt; line-height: 1.45; margin: 0 0 12px; }
.fun-qmark { position: absolute; left: 9px; top: 0; font-family: Fredoka, Georgia, serif; font-size: 34pt; line-height: 1; color: #555; }
.fun-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fun-box { border: 1.5px solid #000; border-radius: 10px; padding: 6px 10px 8px; }
.psheet.fun h3, .fun-h { font-family: Fredoka, Arial, sans-serif; font-weight: 600; font-size: 11.5pt; margin: 2px 0 4px; display: flex; align-items: center; gap: 6px; }
.fun-h { margin-top: 12px; }
.psheet.fun ul { font-size: 10.5pt; padding-left: 16px; }
.psheet.fun li { margin: 2px 0; }
.fun-note { font-size: 10.5pt; margin: 10px 0 0; }
.psheet.fun .sh-words { font-family: Andika, sans-serif; font-size: 11pt; }
.psheet.fun .sh-mini { font-family: Fredoka, Arial, sans-serif; font-size: 10pt; }
.psheet.fun .sh-sig { font-size: 10.5pt; }

/* « Couleur » printing: the same sheets with soft colour (light fills, coloured lines and accents; never red for a grade) */
.psheet.color { --c-teal: #0f8a7e; --c-sky: #2f7fc8; --c-lilac: #7657c2; --c-sun: #d98a00; --c-coral: #e0603a; --c-green: #2b9348; }
.psheet.color .fun-head { border-bottom: 0; background: linear-gradient(90deg, var(--c-teal), var(--c-sky), var(--c-lilac), var(--c-coral), var(--c-sun)) bottom / 100% 4px no-repeat; padding-bottom: 10px; }
.psheet.color .fun-name, .psheet.color .sh-name { color: var(--c-teal); }
.psheet.color .fun-hello { color: var(--c-teal); }
.psheet.color .fun-eval b { color: #1d3d5c; }
.psheet.color.fun { border-color: #b9d9d4; }
.psheet.color .fun-grade { --hue: var(--c-teal); border-color: color-mix(in srgb, var(--hue) 55%, #fff); background: color-mix(in srgb, var(--hue) 7%, #fff); }
.psheet.color .fun-grade.hue-1 { --hue: var(--c-sky); } .psheet.color .fun-grade.hue-2 { --hue: var(--c-lilac); }
.psheet.color .fun-grade.hue-3 { --hue: var(--c-sun); } .psheet.color .fun-grade.hue-4 { --hue: var(--c-coral); }
.psheet.color .fun-gicon { color: var(--hue); opacity: 1; }
.psheet.color .fun-gicon svg, .psheet.color .fun-box h3 svg, .psheet.color .fun-h svg { stroke: currentColor; }
.psheet.color .fun-gicon svg [fill="#000"] { fill: currentColor; }
.psheet.color .fun-glabel { color: color-mix(in srgb, var(--hue) 70%, #000); }
.psheet.color .lv-A { --lv: var(--c-green); } .psheet.color .lv-B { --lv: var(--c-teal); } .psheet.color .lv-C { --lv: var(--c-sky); }
.psheet.color .lv-D { --lv: var(--c-sun); } .psheet.color .lv-E { --lv: var(--c-lilac); } .psheet.color .lv-x { --lv: #666; }
.psheet.color .fun-circle { border-color: var(--lv); color: var(--lv); background: #fff; border-width: 2.5px; font-weight: 600; }
.psheet.color .fun-gword { color: var(--lv); font-weight: 700; }
.psheet.color .fun-quote { background: #fff6dc; border-left-color: var(--c-sun); }
.psheet.color .fun-qmark { color: var(--c-sun); }
.psheet.color .fun-box.fun-ok { border-color: #9fd3ae; background: #f1faf3; } .psheet.color .fun-box.fun-ok h3 { color: var(--c-green); }
.psheet.color .fun-box.fun-next { border-color: #a9cbea; background: #f0f6fc; } .psheet.color .fun-box.fun-next h3 { color: var(--c-sky); }
.psheet.color .fun-h, .psheet.color .sh-pagewords h3, .psheet.color h3 { color: #1d3d5c; }
.psheet.color .sh-words b { background: var(--c-coral); }
.psheet.color .sh-words s { color: var(--c-coral); text-decoration-color: var(--c-coral); }
.psheet.color .sh-words span { color: #1f2d2a; }
.psheet.color .sh-words .nc b { background: #9aa3a1; } .psheet.color .sh-words .nc s { color: #8a9391; }
.psheet.color .sh-mini { color: var(--c-teal); border-bottom-color: color-mix(in srgb, var(--c-teal) 45%, #fff); }
.psheet.color .sh-pagewords { border-top-color: color-mix(in srgb, var(--c-teal) 45%, #fff); }
/* Sober theme in colour: restrained accents */
.psheet.color .sh-head { border-bottom-color: var(--c-teal); }
.psheet.color .sh-grades th { background: #e8f4f2; border-color: var(--c-teal); color: #0b5e56; }
.psheet.color .sh-grades td { border-color: var(--c-teal); color: var(--lv); }
.psheet.color .sh-comment { border-left-color: var(--c-sun); background: #fff8e6; }
/* Exercises in colour */
.psheet.color .ex-h { color: var(--c-teal); }
.psheet.color .ex { border-color: color-mix(in srgb, var(--c-teal) 45%, #fff); }
.psheet.color .ex:nth-of-type(5n+2) { border-color: color-mix(in srgb, var(--c-sky) 45%, #fff); } .psheet.color .ex:nth-of-type(5n+3) { border-color: color-mix(in srgb, var(--c-lilac) 45%, #fff); }
.psheet.color .ex:nth-of-type(5n+4) { border-color: color-mix(in srgb, var(--c-sun) 50%, #fff); } .psheet.color .ex:nth-of-type(5n) { border-color: color-mix(in srgb, var(--c-coral) 45%, #fff); }
.psheet.color .ex-num { background: var(--c-teal); }
.psheet.color .ex-title { color: #1d3d5c; }
.psheet.color .ex-line { border-bottom-color: #9bb8b4; }

/* Review exercises */
.ex-opts { border-top: 1px dashed var(--border); padding-top: 10px; }
.ex-h { font-family: Fredoka, Arial, sans-serif; font-weight: 600; font-size: 17pt; margin: 8px 0 6px; }
.ex { border: 1.5px solid #000; border-radius: 10px; padding: 8px 12px 6px; margin-bottom: 10px; break-inside: avoid; }
.ex-title { font-family: Fredoka, Arial, sans-serif; font-weight: 600; font-size: 12.5pt; display: flex; align-items: center; gap: 8px; }
.ex-num { display: inline-flex; width: 22px; height: 22px; border-radius: 11px; background: #000; color: #fff; font-size: 10.5pt; align-items: center; justify-content: center; flex: none; font-family: Fredoka, Arial, sans-serif; }
.ex-ins { font-size: 11pt; margin: 3px 0 4px; font-style: italic; }
.ex-items { margin: 0; padding-left: 22px; font-size: 12pt; line-height: 1.9; }
.ex-blank { display: inline-block; min-width: 1.1in; border-bottom: 1.5px solid #000; margin: 0 3px; transform: translateY(-3px); }
.ex-line { border-bottom: 1.5px dotted #000; height: 0.38in; margin-right: 6px; }
.key-page { font-size: 10pt; }
.key-st { border-bottom: 1px solid #ccc; padding: 5px 0; }
.key-ex { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin: 2px 0 0 4px; }
.key-ex .ex-num { width: 17px; height: 17px; font-size: 8.5pt; }

@media print {
  @page { size: letter; margin: 0.35in; }
  html, body.printing-sheets { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  body.printing-sheets #app { max-width: none; width: auto; }
  body.printing-sheets #chat-fab, body.printing-sheets #chat-drawer { display: none !important; }
  body.printing-sheets header.top, body.printing-sheets nav.tabs, body.printing-sheets .no-print, body.printing-sheets .toast { display: none !important; }
  body.printing-sheets main { padding: 0; margin: 0 !important; max-width: none; }
  body.printing-sheets .sheets-wrap { overflow: visible; padding: 0; }
  body.printing-sheets .psheet { margin: 0 auto; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-sheets .psheet.blank { background: #fff; }
  body.printing-sheets .psheet.fun { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-sheets .fun-quote, body.printing-sheets .psheet.color * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Subject instructions */
.ilist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.iitem { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.iitem.opt { background: var(--surface-2); }
.iitem textarea { flex: 1; min-height: 0; border: 0; padding: 2px 4px; background: transparent; resize: none; font-size: .92rem; }
.iitem textarea:focus { outline: 2px solid var(--accent); }
.iitem .chk { flex: none; margin-top: 3px; }
.chk-line { cursor: pointer; font-weight: 400; margin: 0; font-size: .92rem; }
.chk-line input { margin-top: 3px; accent-color: var(--accent); flex: none; width: 17px; height: 17px; }
.chk-line.off span { color: var(--muted); text-decoration: line-through; }
.promote { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.pline { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .9rem; }
.pline span { flex: 1; }

/* A copy's pages */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pg-item { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.pg-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.pg-item .pnum { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 0 6px; }
.pg-tools { display: flex; justify-content: space-between; padding: 4px; background: var(--surface); }
.pg-tools button { width: 28px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.pg-tools button:disabled { opacity: .35; cursor: default; }
.pg-add { aspect-ratio: 3/4.5; border: 2px dashed var(--border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: .8rem; cursor: pointer; margin: 0; font-weight: 600; }
.pg-add svg { width: 26px; height: 26px; }

/* Floating assistant */
#chat-fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 28px; padding: 12px 16px; font: inherit; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); cursor: pointer; }
#chat-fab[hidden] { display: none; }
#chat-fab svg { width: 22px; height: 22px; }
#chat-fab span { display: none; }
#chat-drawer { position: fixed; z-index: 35; background: var(--bg); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; height: 82dvh; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
#chat-drawer[hidden] { display: none; }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dr-ctx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.dr-head .btn { min-height: 34px; padding: 6px 10px; }
.dr-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.dr-msgs .msg { max-width: 92%; }
.dr-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); align-items: flex-end; }
.dr-input textarea { min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; }
.dr-input .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: none; }
@media (min-width: 900px) {
  #chat-fab { bottom: 24px; right: 24px; }
  #chat-fab span { display: inline; }
  #chat-drawer { left: auto; top: 0; height: 100dvh; width: 420px; border-radius: 0; border-left: 1px solid var(--border); box-shadow: -6px 0 30px rgba(0,0,0,.12); }
  body.drawer-open main { margin-right: 420px; }
  body.drawer-open header.top { padding-right: 436px; }
  body.drawer-open nav.tabs { right: 436px; }
  body.drawer-open .review-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr); }
}
@media print { #chat-fab, #chat-drawer { display: none !important; } }

/* School */
.class-chip { margin-left: 8px; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.org-card { display: block; color: var(--text); }
.org-level { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.list .row.org-active { background: var(--accent-soft); }

/* Report: diverging grade scale (validated: blue A–B, grey C, red D–E), one hue per side */
:root { --gA: #256abf; --gB: #86b6ef; --gC: #e4e2dd; --gD: #ee8f89; --gE: #c93636; --gA-t: #fff; --gB-t: #0b0b0b; --gC-t: #0b0b0b; --gD-t: #0b0b0b; --gE-t: #fff; --viz-1: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gA: #5598e7; --gB: #184f95; --gC: #4a4844; --gD: #a33232; --gE: #e66767; --gA-t: #0b0b0b; --gB-t: #fff; --gC-t: #fff; --gD-t: #fff; --gE-t: #0b0b0b; --viz-1: #3987e5; } }
:root[data-theme="dark"] { --gA: #5598e7; --gB: #184f95; --gC: #4a4844; --gD: #a33232; --gE: #e66767; --gA-t: #0b0b0b; --gB-t: #fff; --gC-t: #fff; --gD-t: #fff; --gE-t: #0b0b0b; --viz-1: #3987e5; }
.g-A { background: var(--gA); color: var(--gA-t); } .g-B { background: var(--gB); color: var(--gB-t); } .g-C { background: var(--gC); color: var(--gC-t); }
.g-D { background: var(--gD); color: var(--gD-t); } .g-E { background: var(--gE); color: var(--gE-t); }
.g { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; border-radius: 6px; font-weight: 700; font-size: .85rem; padding: 0 5px; }
.g-none { color: var(--muted); background: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 4px 0 12px; }
.filters select.compact { max-width: 100%; }
.stats4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .stats4 { grid-template-columns: repeat(2, 1fr); } }
.sw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .sw-grid { grid-template-columns: 1fr; } }
.viz-title { font-size: 1rem; margin: 0 0 10px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.viz-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dist { display: flex; flex-direction: column; gap: 8px; }
.dist-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 10px; align-items: center; }
.dist-label { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { display: flex; gap: 2px; height: 22px; }
.dist-bar .dseg { display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; min-width: 3px; }
.dist-bar .dseg:first-child { border-radius: 4px 0 0 4px; } .dist-bar .dseg:last-child { border-radius: 0 4px 4px 0; } .dist-bar .dseg:only-child { border-radius: 4px; }
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar-val { font-size: .82rem; white-space: nowrap; }
svg.trend { width: 100%; height: auto; display: block; }
svg.trend .grid { stroke: var(--border); stroke-width: 1; }
svg.trend .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.trend .line { fill: none; stroke: var(--viz-1); stroke-width: 2; }
svg.trend .dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; }
svg.trend .hit { fill: transparent; cursor: pointer; }
table.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: .86rem; }
table.heat th { font-size: .72rem; color: var(--muted); font-weight: 600; padding: 2px; vertical-align: bottom; }
table.heat th span { display: inline-block; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.heat td { text-align: center; padding: 1px; }
table.heat td.name, table.heat th.name { text-align: left; white-space: nowrap; padding-right: 8px; }
table.heat td.num { color: var(--muted); font-size: .75rem; }
table.heat tr[data-href] { cursor: pointer; }
table.heat tr[data-href]:hover td.name { text-decoration: underline; }
.trend-cell .up { color: var(--gA); } .trend-cell .down { color: var(--gE); }
#viz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.35; padding: 7px 10px; border-radius: 8px; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.analysis { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.group-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.activity { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.activity ol { margin: 4px 0; padding-left: 18px; }

/* Report cards */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); border-radius: 99px; padding: 5px 12px; background: var(--surface); }
.bstud .bcom { margin-top: 10px; }
.bcom textarea { margin-top: 4px; min-height: 64px; font-size: .92rem; }
.bcom.ok textarea { border-color: var(--ok); background: var(--ok-soft); }
.count.over { color: var(--danger); font-weight: 700; }

/* Bilingual reports and meeting sheets */
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
@media (max-width: 640px) { .bilingual { grid-template-columns: 1fr; } }
.bilingual > div { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.rsheet .rmd { font-size: 10.5pt; line-height: 1.4; }
.rsheet .rmd h3 { font-size: 11pt; margin: 8px 0 2px; }
.rsheet .rmd ul { margin: 0 0 4px; }
.rnotes { margin-top: auto; border-top: 1.5px solid #000; padding-top: 4px; min-height: 1.6in; font-size: 10pt;
  background: repeating-linear-gradient(transparent, transparent 0.32in, #bbb 0.32in, #bbb calc(0.32in + 1px)); }

/* AI-created assessments (printable student sheets) */
.eval-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: end; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.eval-name { font-family: Fredoka, Arial, sans-serif; font-size: 15pt; margin-top: 4px; display: flex; align-items: flex-end; gap: 6px; white-space: nowrap; }
.name-line { flex: 1; min-width: 1.6in; border-bottom: 1.5px solid #000; height: 1.1em; }
.eval-total { font-family: Fredoka, Arial, sans-serif; font-size: 12pt; margin-top: 4px; }
.vmark { font-size: 14pt; }
.eval-sec { margin: 10px 0 4px; }
.eval-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12pt; line-height: 1.8; margin: 2px 0; }
.eval-q { font-weight: 700; min-width: 22px; }
.eval-body { flex: 1; white-space: pre-line; }
.eval-pts { font-size: 9.5pt; color: #444; white-space: nowrap; padding-top: 4px; }
.key-sec { font-weight: 700; margin: 8px 0 2px; font-size: 10.5pt; }
.key-item { font-size: 10pt; margin: 2px 0; }
.key-ans { font-weight: 700; }

/* Choice (re-correction) */
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* Results sheet */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.results { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.results th, table.results td { border: 1px solid var(--border); padding: 5px 6px; text-align: center; }
table.results th { font-weight: 600; font-size: .78rem; color: var(--muted); vertical-align: bottom; }
table.results .name { text-align: left; white-space: nowrap; }
table.results td.num { color: var(--muted); font-size: .8rem; width: 26px; }
table.results td { font-weight: 600; min-width: 34px; }
table.results td.proposed { font-style: italic; font-weight: 400; color: var(--muted); }
table.results a { color: var(--text); }

.print-title { display: none; }
@media print {
  body.print-results header.top, body.print-results nav.tabs { display: none !important; }
  body.print-results main > *:not(.results-card):not([data-evpane="resultats"]) { display: none !important; }
  body.print-results [data-evpane="resultats"] { display: block !important; }
  body.print-results [data-evpane="resultats"] > :not(.results-card) { display: none !important; }
  body.print-results .results-card > :not(.table-wrap):not(.print-title) { display: none !important; }
  body.print-results .print-title { display: block; font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
  body.print-results { background: #fff; padding: 0; }
  body.print-results .results-card { border: 0; box-shadow: none; }
  body.print-results table.results td.proposed { color: #000; }
}

/* Modal sheet (bottom of screen) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--border); margin: 4px auto 12px; }
.sheet-thumb { width: 84px; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); flex: none; }
.sheet-list { margin-top: 8px; max-height: 40dvh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; } }

@media (min-width: 900px) {
  nav.tabs { top: 0; bottom: auto; left: auto; right: 16px; border: 0; background: transparent; justify-content: flex-end; gap: 4px; padding-top: calc(8px + env(safe-area-inset-top)); z-index: 6; }
  nav.tabs a { flex: none; flex-direction: row; font-size: .88rem; padding: 8px 12px; }
  nav.tabs a svg { width: 18px; height: 18px; }
  nav.tabs a.active { background: var(--accent-soft); }
  body { padding-bottom: 24px; }
  .chat-input { bottom: 0; }
  .toast { bottom: 24px; }
}

/* AI transparency notice at the foot of printed documents */
.psheet { position: relative; }
.sh-ai { position: absolute; left: 0; right: 0; bottom: .07in; text-align: center; font: 400 8pt/1.2 system-ui, sans-serif; color: #666; letter-spacing: .01em; }
.sh-ai svg { vertical-align: -1px; margin-right: 4px; }
.ai-note { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 8px; }

/* AI reliability */
table.rel { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.rel th, table.rel td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.rel th { font-size: .75rem; color: var(--muted); font-weight: 600; }
table.rel .num { text-align: right; font-variant-numeric: tabular-nums; }
.rel-bar { width: 90px; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; flex: none; }
.rel-bar span { display: block; height: 100%; background: #2a78d6; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .rel-bar span { background: #3987e5; } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
dialog.report-dlg { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); padding: 16px; }
dialog.report-dlg::backdrop { background: rgba(0,0,0,.35); }
dialog.report-dlg textarea { min-height: 90px; }

/* AI information sheet */
.info-sheet { font-size: 11pt; line-height: 1.4; }
.info-sheet h1 { font-size: 20pt; margin: 0 0 2px; }
.info-sheet .info-sub { color: #555; margin: 0 0 10px; border-bottom: 2px solid #000; padding-bottom: 6px; }
.info-sheet h2 { font-size: 12.5pt; margin: 12px 0 3px; }
.info-sheet ul { margin: 2px 0; padding-left: 20px; }
.info-sheet li { margin: 2px 0; }
.info-sheet p { margin: 4px 0; }
.info-sheet .info-sign { margin-top: auto; }
.info-sheet[contenteditable]:focus { outline: none; }

/* Accounts */
.auth-card { max-width: 400px; width: 100%; box-sizing: border-box; margin: 32px auto; }
.auth-card h1 { margin-top: 0; }
.code-input { font-size: 2rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

.auth-mode header.top, .auth-mode nav.tabs { display: none; }
.auth-wrap { max-width: 400px; margin: 0 auto; padding: 28px 0 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 8px 4px 18px; }
.auth-brand { color: inherit; text-decoration: none; }
.auth-brand .logo { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.auth-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.auth-tag { font-size: .9rem; color: var(--muted); }
.auth-wrap .auth-card { margin: 0; padding: 22px 20px; }
.auth-card h1 { font-size: 1.3rem; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 16px; }

/* ---------- Public landing page ---------- */
.landing-mode header.top, .landing-mode nav.tabs { display: none; }
.landing-mode main { max-width: none; padding: 0; }
.lp { --lp-max: 1120px; --coral: #ff7a59; --sun: #ffd166; overflow-x: hidden; }
.lp > * { max-width: var(--lp-max); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.lp-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.lp-logo img { width: 36px; height: 36px; }
.lp-links { display: flex; align-items: center; gap: 20px; }
.lp-links a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; }
.lp-links a:not(.btn):hover { color: var(--text); }
.lp-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 72px; position: relative; }
.lp-hero::before { content: ""; position: absolute; inset: -80px -200px auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); z-index: -1; }
.lp-eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.lp-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 18px; }
.lp-hero h1 span { color: var(--accent); }
.lp-lead { font-size: 1.15rem; line-height: 1.55; color: var(--muted); margin: 0 0 26px; max-width: 34em; }
.lp-lead b { color: var(--text); }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 13px; }
.lp-note { font-size: .85rem; color: var(--muted); margin-top: 14px; }
.lp-hero-art { position: relative; min-height: 360px; }
.lp-sheet { position: absolute; left: 0; top: 10px; width: 74%; background: #fffdf8; color: #2a2a2a; border-radius: 14px; padding: 26px 26px 34px;
  box-shadow: 0 24px 60px rgba(30,40,35,.18); transform: rotate(-3deg); font-family: "Andika", "Comic Sans MS", cursive; font-size: 1.12rem; line-height: 2.1;
  background-image: repeating-linear-gradient(transparent 0 37px, #d6e4ee 37px 38px); background-position: 0 46px; }
.lp-sheet p { margin: 0; }
.lp-sheet-title { font-weight: 700; text-align: center; margin-bottom: 10px; }
.lp-err { position: relative; outline: 2.5px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
.lp-err::after { content: attr(data-fix); position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font); font-size: .7rem; line-height: 1.5; font-weight: 700; color: #fff; background: var(--coral); padding: 0 6px; border-radius: 5px; }
.lp-panel { position: absolute; right: 0; bottom: -24px; width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  box-shadow: 0 18px 40px rgba(30,40,35,.16); transform: rotate(2deg); }
.lp-panel-h { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 10px; color: var(--accent); }
.lp-crit { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.lp-crit b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; }
.lp-valid { margin-top: 12px; font-size: .82rem; font-weight: 600; color: var(--ok); display: flex; align-items: center; gap: 6px; }
.lp-section { padding-top: 64px; padding-bottom: 64px; }
.lp-section h2, .lp-final h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -.02em; margin: 0 0 10px; text-align: center; }
.lp-sub { text-align: center; color: var(--muted); max-width: 40em; margin: 0 auto 36px; font-size: 1.05rem; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-grid-4 { grid-template-columns: repeat(4, 1fr); }
.lp-feat { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; transition: transform .15s, box-shadow .15s; }
.lp-feat:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(30,40,35,.08); }
.lp-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.lp-ic svg.ic { width: 22px; height: 22px; }
.lp-feat h3 { font-size: 1.05rem; margin: 0 0 6px; }
.lp-feat p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .95rem; }
.lp-steps ol { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 24px 0 0; }
.lp-steps li { counter-increment: s; position: relative; padding-top: 58px; }
.lp-steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.lp-steps li b { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.lp-steps li span { color: var(--muted); line-height: 1.5; }
.lp-ethics { background: var(--surface-2); border-radius: 28px; max-width: calc(var(--lp-max) - 48px) !important; padding: 56px 32px !important; }
.lp-ethics .lp-feat { background: var(--surface); }
.lp-final { text-align: center; padding-top: 72px; padding-bottom: 72px; }
.lp-final h2 { margin-bottom: 22px; }
.lp-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.lp-foot img { width: 18px; height: 18px; vertical-align: -4px; }
.lp-foot a { color: inherit; }

/* ---------- Public compliance page ---------- */
.cf-hero { padding-top: 36px; padding-bottom: 12px; max-width: 860px !important; }
.cf-hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; }
.cf-section { padding-top: 36px; padding-bottom: 12px; max-width: 860px !important; }
.cf-section h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); letter-spacing: -.01em; margin: 0 0 14px; }
.cf-section .lp-sub { text-align: left; margin: 0 0 16px; font-size: .98rem; }
.cf-list { display: grid; gap: 12px; }
.cf-item { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.cf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.cf-head h3 { font-size: 1.02rem; margin: 0; }
.cf-head .badge { flex: none; }
.cf-item p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .95rem; }
.cf-note p { line-height: 1.6; }
.cf .lp-foot { max-width: 860px; margin-top: 40px; }
@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 24px; gap: 36px; }
  .lp-hero-art { min-height: 330px; }
  .lp-grid, .lp-grid-4 { grid-template-columns: 1fr 1fr; }
  .lp-steps ol { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lp > * { padding-left: 16px; padding-right: 16px; }
  .lp-links a:not(.btn) { display: none; }
  .lp-grid, .lp-grid-4 { grid-template-columns: 1fr; }
  .lp-sheet { width: 92%; font-size: 1rem; }
  .lp-panel { width: 190px; }
  .lp-ethics { border-radius: 0; padding: 40px 16px !important; }
}

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.plan { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); }
.plan.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
dialog.report-dlg input, dialog.report-dlg select { margin-bottom: 4px; }

/* Admin console */
.adm-head h1 { margin-bottom: 8px; }
.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.adm-tabs a { padding: 9px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.adm-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.kpi-v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: .85rem; color: var(--text); margin-top: 2px; }
.kpi-s { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.adm-grid .card { margin: 0; }
svg.bars { width: 100%; height: auto; margin-top: 8px; }
svg.bars rect { fill: #2a78d6; }
svg.bars g:hover rect { fill: #1f5fae; }
svg.bars text { font-size: 10px; fill: var(--muted); }
svg.bars .axis { stroke: var(--border); }
@media (prefers-color-scheme: dark) { svg.bars rect { fill: #3987e5; } svg.bars g:hover rect { fill: #5a9df0; } }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.adm-table td { vertical-align: top; }

/* App dialog boxes */
dialog.ui-dlg { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.ui-dlg::backdrop { background: rgba(20,20,18,.45); backdrop-filter: blur(2px); }
dialog.ui-dlg h2 { margin: 0 0 6px; font-size: 1.15rem; }
dialog.ui-dlg .ui-text { color: var(--muted); font-size: .92rem; margin: 0 0 6px; line-height: 1.45; }
dialog.ui-dlg label { margin-top: 12px; }
dialog.ui-dlg .ui-field { display: flex; gap: 8px; align-items: center; }
dialog.ui-dlg .ui-field input[readonly] { background: var(--surface-2); font-size: .85rem; }
dialog.ui-dlg .ui-err { color: var(--danger); font-size: .88rem; margin: 8px 0 0; }
dialog.ui-dlg .actions { justify-content: flex-end; margin-top: 18px; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Read-only (shared class) */
.ro-banner.support { background: var(--accent-soft) !important; color: var(--accent) !important; }
.ro-banner { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 860px; margin: 10px auto 0; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--text); font-size: .9rem; box-sizing: border-box; }
.ro-banner svg.ic { flex: none; }
.ro-banner a { margin-left: auto; font-weight: 600; }
body.readonly textarea:disabled, body.readonly input:disabled { background: var(--surface-2); color: var(--text); opacity: 1; }
.ro-banner span { flex: 1; min-width: 200px; }

/* Built-in scanner */
body.scanning { overflow: hidden; }
body.scanning #chat-fab { display: none !important; }
.scanner { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-guide { position: absolute; left: 7%; right: 7%; top: 13%; bottom: 27%; border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; transition: border-color .15s; }
.sc-guide.ready { border: 3px solid #6ee7a8; }
.sc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sc-flash.on { animation: scflash .35s ease-out; }
@keyframes scflash { 0% { opacity: .75; } 100% { opacity: 0; } }
.sc-top { position: relative; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.sc-title { flex: 1; font-size: .95rem; }
.sc-sub { font-size: .78rem; opacity: .8; }
.sc-ic { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 18px; }
.sc-hint { position: relative; margin: 0 auto; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.5); font-size: .85rem; text-align: center; max-width: 90%; }
.sc-bottom { position: relative; margin-top: auto; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.75) 35%); }
.sc-strip { display: flex; gap: 8px; overflow-x: auto; min-height: 66px; padding: 4px 0 8px; }
.sc-th { position: relative; flex: none; width: 46px; height: 60px; border-radius: 6px; overflow: hidden; border: 2px solid rgba(255,255,255,.8); }
.sc-th img { width: 100%; height: 100%; object-fit: cover; }
.sc-th span { position: absolute; left: 2px; bottom: 1px; font-size: 10px; font-weight: 700; text-shadow: 0 0 3px #000; }
.sc-th button { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 0; }
.sc-opts { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .85rem; margin-bottom: 10px; }
.sc-opts label { display: flex; align-items: center; gap: 5px; margin: 0; color: #fff; font-weight: 500; }
.sc-opts select { width: auto; max-width: 160px; padding: 6px 8px; font-size: .85rem; background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.4); }
.sc-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.sc-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 0; display: grid; place-items: center; }
.sc-shutter span { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: transform .1s; }
.sc-shutter:active span { transform: scale(.88); }
.sc-done, .sc-next { justify-self: center; border: 0; border-radius: 14px; padding: 10px 14px; font: inherit; font-weight: 700; font-size: .9rem; line-height: 1.15; }
.sc-done { background: rgba(255,255,255,.18); color: #fff; justify-self: start; }
.sc-next { background: var(--accent); color: #fff; justify-self: end; }
.sc-next:disabled { opacity: .4; }

/* Show / hide password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }

/* Penalized-mistake tally per criterion */
.err-tally { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.crit-count { color: var(--danger); font-weight: 600; margin: 2px 0 4px; }


/* ======================================================================
   Theme C « Atelier » — component layer (overrides the base rules above)
   ====================================================================== */
body { font-family: var(--font); }
h1, h2, h3, .score-big, .stats b, .kpi b { font-family: var(--font-display); letter-spacing: -.015em; }
h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 700; }

/* Teal top bar */
header.top { background: var(--accent); color: var(--accent-text); border-bottom: 0; backdrop-filter: none; }
header.top .brand, header.top .back { color: var(--accent-text); font-family: var(--font-display); }
header.top .brand { font-size: 1.15rem; font-weight: 800; }
header.top .brand .logo { background: #fff; padding: 2px; border-radius: 10px; }
.class-chip { background: rgba(255,255,255,.16); color: var(--accent-text); padding: 5px 11px; font-size: .8rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) header.top { background: #0b3b36; color: #fff; } :root:not([data-theme="light"]) header.top .brand, :root:not([data-theme="light"]) header.top .back, :root:not([data-theme="light"]) .class-chip { color: #fff; } }

/* Home hero: the top bar continues into a rounded teal band */
/* Full-bleed band: extends to both edges of the window whatever the width of main. */
html { overflow-x: clip; }
.hero { --band: var(--accent); background: var(--band); color: #fff; margin: -16px calc(50% - 50vw) 0; padding: 4px calc(50vw - 50% + 20px) 64px; border-radius: 0 0 32px 32px; }
.hero .date { margin: 0; font-size: .9rem; color: #bfe6dd; }
.hero h1 { color: #fff; font-size: 2rem; margin: 2px 0 0; }
.hero .summary { margin: 6px 0 0; color: #d9f2ec; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { --band: #0b3b36; } }
@media (min-width: 900px) { .hero { border-radius: 0; padding-top: 18px; } .hero h1 { font-size: 2.3rem; } }
.cta { display: flex; align-items: center; gap: 14px; margin: -42px 4px 0; background: var(--coral); color: var(--on-coral); border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--coral) 35%, transparent); text-decoration: none; position: relative; }
.cta .ic-wrap { width: 48px; height: 48px; border-radius: 16px; background: #fff; display: grid; place-items: center; flex: none; color: var(--coral-strong); }
.cta .ic-wrap svg { width: 24px; height: 24px; }
.cta b { font-family: var(--font-display); font-size: 1.12rem; display: block; }
.cta span.sub { font-size: .85rem; color: #4a1d10; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 4px; }
.tile { border-radius: 20px; padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; background: var(--accent-soft); color: var(--on-accent-soft); }
.tile .t-name { font-size: .82rem; font-weight: 700; }
.tile .t-num { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.tile .t-num small { font-family: var(--font); font-size: .82rem; font-weight: 600; }
.tile.tone-1 { background: var(--lilac-soft); color: var(--on-lilac); }
.tile.tone-2 { background: var(--sun-soft); color: var(--warn); }
.tile.tone-3 { background: var(--sky-soft); color: var(--on-sky); }
.tile.tone-4 { background: var(--coral-soft); color: var(--danger); }
.tile.plain { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tile.plain svg { width: 24px; height: 24px; color: var(--accent); }

/* Bottom tabs: white sheet, active item in a teal pill */
nav.tabs { border-top: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 20px rgba(16,32,29,.06); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
nav.tabs a { font-size: .68rem; font-weight: 600; padding: 6px 0; border-radius: 16px; }
nav.tabs a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
/* Desktop: the tabs sit in the teal top bar, in white */
@media (min-width: 900px) {
  nav.tabs { background: transparent; box-shadow: none; border-radius: 0; padding: calc(8px + env(safe-area-inset-top)) 0 0; }
  nav.tabs a { color: color-mix(in srgb, #fff 78%, transparent); font-size: .9rem; padding: 8px 12px; border-radius: 12px; }
  nav.tabs a:hover { color: #fff; background: rgba(255,255,255,.08); }
  nav.tabs a.active { background: rgba(255,255,255,.18); color: #fff; }
}

/* Surfaces */
.card, .list, .quick a, .stats div, .sheets-toolbar, .group-card, .doc, .iitem, .choice { border: 0; box-shadow: var(--shadow); }
.card { border-radius: var(--radius); padding: 16px 18px; }
.list { border-radius: var(--radius); }
.list > a, .list > .row { border-bottom-color: var(--border); padding: 12px 14px; }
.list > a:hover { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.list .title { font-weight: 700; }
.avatar { border-radius: 14px; font-family: var(--font-display); background: var(--accent-soft); color: var(--on-accent-soft); }
.avatar.t1 { background: var(--coral-soft); color: var(--danger); }
.avatar.t2 { background: var(--sun-soft); color: var(--warn); }
.avatar.t3 { background: var(--lilac-soft); color: var(--on-lilac); }
.avatar.t4 { background: var(--sky-soft); color: var(--on-sky); }
.quick a { border-radius: 20px; }
.quick a svg { color: var(--accent); }
.quick a.primary { background: var(--coral); color: var(--on-coral); }
.quick a.primary svg { color: var(--on-coral); }
.stats div { border-radius: 16px; }
.stats b { color: var(--accent); }

/* Buttons and controls */
.btn { border-radius: 14px; border: 0; background: var(--surface-2); font-weight: 700; }
.btn:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--border)); }
.btn.primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { border-radius: 11px; }
.btn.big { border-radius: 18px; }
input[type=text], input[type=password], input[type=email], input:not([type]), select, textarea { border-radius: 12px; border-color: var(--border); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
.seg { background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg button { border-radius: 11px; font-weight: 700; }
.seg button.on { background: var(--surface); color: var(--accent); }
.badge { border-radius: 9px; padding: 3px 9px; font-weight: 700; }
.callout { border-radius: 14px; border-left: 0 !important; }
.callout.info { color: var(--on-accent-soft); }
.chip { border: 0; background: var(--surface-2); font-weight: 600; }

/* A–E grades: big rounded keys */
.lv { gap: 6px; }
.lv button { width: 44px; height: 44px; border-radius: 13px; border: 0; background: var(--surface-2); color: var(--muted); font-family: var(--font-display); font-size: 1.1rem; }
.lv button.on { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 28%, transparent); }
.crit { border-top-color: var(--border); }

/* Mistakes: coral */
.err-num, .tmark sup, .abox b { background: var(--coral-strong); }
.abox { border-color: var(--coral-strong); background: color-mix(in srgb, var(--coral) 7%, transparent); }
.tmark { background: color-mix(in srgb, var(--coral) 14%, transparent); }
.tmark s, .err-body .a { color: var(--danger); text-decoration-color: var(--coral-strong); }
.seg.mini button[data-dec="count"].on { background: var(--coral-strong); color: #fff; }

/* Floating assistant: coral */
#chat-fab { background: var(--coral); color: var(--on-coral); box-shadow: 0 10px 24px color-mix(in srgb, var(--coral) 40%, transparent); }
.msg.user { background: var(--accent); }
.msg.assistant { border: 0; box-shadow: var(--shadow); }

/* Read-only and support banners */
.ro-banner { border-radius: 16px; }

/* Voice dictation button (floats at the corner of the field being edited) */
.dict-btn { position: fixed; z-index: 45; display: flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 9px; border: 0; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(16,32,29,.12); font: inherit; font-size: .82rem; font-weight: 700; }
.dict-btn svg { width: 18px; height: 18px; }
.dict-btn span:empty { display: none; }
.dict-btn:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }
.dict-btn.rec { background: var(--coral-strong); color: #fff; animation: dict-pulse 1.4s ease-in-out infinite; }
.dict-btn.busy { opacity: .7; pointer-events: none; }
.dict-btn.busy svg { animation: spin .9s linear infinite; }
@keyframes dict-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--coral) 25%, transparent); } }
@media print { .dict-btn { display: none !important; } }

/* Tabs: on phones the assistant opens from its floating button, which keeps the bottom bar at six items */
@media (max-width: 899px) { nav.tabs a.tab-chat { display: none; } }
/* Medium screens: labels only, tighter, so the brand, the class chip and every tab fit on one line */
@media (min-width: 900px) and (max-width: 1439px) {
  nav.tabs { right: 8px; gap: 2px; }
  nav.tabs a { padding: 8px 9px; font-size: .85rem; }
  nav.tabs a svg { display: none; }
  .class-chip { max-width: 180px; }
}

/* Inline competency picker in the evaluation header */
select.inline-select { width: auto; min-height: 0; display: inline-block; padding: 2px 26px 2px 8px; font-size: .85rem; font-weight: 600; border-color: transparent; background-color: var(--accent-soft); color: var(--accent); border-radius: 10px; }

/* Report card results per competency */
.bres-card { padding: 14px 10px 10px; }
.bres-card h2 { font-size: 1.05rem; padding-left: 6px; }
.bres-scroll { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
table.bres { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.bres th { font-size: .7rem; line-height: 1.2; color: var(--muted); font-weight: 700; text-align: center; vertical-align: bottom; padding: 4px 3px 6px; min-width: 64px; }
table.bres th span { display: block; font-weight: 600; opacity: .8; margin-top: 2px; }
table.bres th:first-child, table.bres td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 92px; padding-left: 6px; }
table.bres td { border-top: 1px solid var(--border); padding: 6px 3px; vertical-align: middle; }
table.bres tr.bres-detail td { border-top: 0; padding: 0 6px 8px; background: var(--surface-2); position: static; }
table.bres tr.bres-detail td div { margin-top: 4px; }
td.bres-c { text-align: center; }
td.bres-c input { width: 58px; height: 38px; min-height: 0; padding: 4px; text-align: center; font-weight: 700; font-size: .95rem; border-radius: 10px; -moz-appearance: textfield; }
td.bres-c input::-webkit-outer-spin-button, td.bres-c input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
td.bres-c input::placeholder { color: var(--muted); font-weight: 600; font-style: italic; opacity: .8; }
.bres-n { display: block; font-size: .64rem; color: var(--muted); white-space: nowrap; margin-top: 2px; min-height: .8rem; }
td.bres-m { text-align: right; white-space: nowrap; padding-right: 6px; }
td.bres-m .small { display: block; font-size: .64rem; }
.bres-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); text-align: left; cursor: pointer; line-height: 1.25; }
.bres-name:hover { color: var(--accent); }
@media (max-width: 480px) { td.bres-c input { width: 50px; } table.bres th { min-width: 54px; } table.bres th:first-child, table.bres td:first-child { min-width: 80px; } }
.head-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.activity-line { margin-top: 4px; display: flex; gap: 6px; align-items: flex-start; }
.activity-line svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--coral-strong); }
.group-card details { margin-top: 4px; }

/* Progress per discipline */
.pcard h3 { font-size: 1.05rem; }
.pavg { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.ptrend { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 9px; white-space: nowrap; }
.ptrend.up { background: var(--accent-soft); color: var(--accent); }
.ptrend.down { background: var(--coral-soft); color: var(--danger); }
.ptrend.steady, .ptrend.none { background: var(--surface-2); color: var(--muted); }
.pmovers .ptrend { padding: 1px 6px; margin-right: 4px; }
.pmovers div { margin-top: 4px; }
.pterms { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.pterm { font-size: .8rem; padding: 3px 9px; border-radius: 9px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.pterm b { color: var(--muted); margin-right: 3px; }
.pterm.empty { color: var(--muted); }
svg.pchart { margin: 6px 0 2px; }
svg.trend .pass { stroke: var(--coral-strong); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
svg.trend .line.ref { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.5; }
svg.trend .dot.ref { fill: var(--muted); }
.viz-legend .sw-line { height: 3px; border-radius: 2px; background: var(--viz-1); }
.viz-legend .sw-ref { height: 0; border-radius: 0; border-top: 2px dashed var(--muted); background: none; }
.pweak { margin-top: 12px; }
.pweak > b { display: block; margin-bottom: 8px; }
.pweak .small { margin-top: 6px; }
.pcard > .small { margin-top: 8px; }
.pcard .hbar-label { white-space: normal; line-height: 1.2; }
.viz-legend .sw-pass { height: 0; border-radius: 0; border-top: 2px dashed var(--coral-strong); background: none; }

/* AI creation: sheet editor and recipient list */
dialog.ui-dlg.wide { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
.sed { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.sed-sec { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.sed-sec > input { font-weight: 700; }
.sed-item { display: flex; gap: 6px; align-items: flex-start; }
.sed-n { font-weight: 700; min-width: 20px; padding-top: 10px; }
.sed-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sed-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sed-row > input { flex: 1; min-width: 140px; }
.sed-row label { margin: 0; display: inline-flex; gap: 4px; align-items: center; }
.sed-row label input { width: 58px; padding: 6px; }
.sed-row .doc-rm { position: static; }
.gen-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; margin-top: 6px; border-radius: 12px; background: var(--surface); }
.gen-row { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.gen-row:last-child { border-bottom: 0; }
.gen-row .chk { margin: 0; min-width: 120px; }
.gen-row .grow { flex: 1; min-width: 0; }
.gen-row select.compact { width: auto; }
.inline-chk { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-size: .85rem; }
/* Number and date fields styled like the other inputs (inline header dates keep their own look) */
input[type=number]:not([class]), input[type=date]:not(.inline-date) { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 10px 12px; font: inherit; min-height: 44px; }
dialog.ui-dlg .sed input, dialog.ui-dlg .sed textarea { min-height: 0; padding: 8px 10px; font-size: .92rem; border-radius: 10px; }
dialog.ui-dlg .sed-row { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 10px; align-items: center; }
dialog.ui-dlg .sed-row > input { grid-column: 1 / -1; }
dialog.ui-dlg .sed-row label input { width: 56px; }
dialog.ui-dlg .sed-row .doc-rm { justify-self: end; }
dialog.ui-dlg .sed-item { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
dialog.ui-dlg .sed-n { padding-top: 8px; }
@media (min-width: 640px) { dialog.ui-dlg .sed-row { grid-template-columns: 1fr auto auto auto; } dialog.ui-dlg .sed-row > input { grid-column: auto; } }

/* « Pénalise : » choices — a soft, distinct colour per criterion; « Non » stays grey */
.seg.mini.pen-seg button.pen-a.on { background: var(--sky-soft); color: var(--on-sky); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-sky) 35%, transparent); }
.seg.mini.pen-seg button.pen-b.on { background: var(--lilac-soft); color: var(--on-lilac); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-lilac) 35%, transparent); }
.seg.mini.pen-seg button.pen-c.on { background: var(--sun-soft); color: var(--warn); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 35%, transparent); }
.seg.mini.pen-seg button[data-dec="ignore"].on { background: #868e96; color: #fff; box-shadow: none; }

/* Mistake rows: hover and selection use a light teal tint, distinct from the grey of the penalty buttons */
.err:hover { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.err.flash { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.err:hover .seg.mini, .err.flash .seg.mini { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }

/* Copy status: « À réviser » in sun yellow, clearly apart from the green « Validée » */
.badge.todo { background: var(--sun-soft); color: var(--warn); }

/* Adding a mistake by hand: every word of the page view is a target, revealed on hover */
.wbox { position: absolute; border-radius: 4px; cursor: copy; border: 1.5px solid transparent; transition: background .12s, border-color .12s; }
.wbox:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.err { position: relative; }
.pg-hint { text-align: center; margin: 8px 0 0; line-height: 1.3; }
.err-rm { position: absolute; top: 8px; right: 4px; }

/* « Photo + texte » review mode: photo on 3/4 of the panel, the copy's text on the bottom quarter, kept in sync */
.pager-text { display: none; }
@media (min-width: 1100px) {
  .review-pages.split .pager-view { flex: 3 1 0; min-height: 0; }
  .review-pages.split .pager-text { display: block; flex: 1 1 0; min-height: 90px; overflow: auto; border-top: 1px solid var(--border); padding: 10px 16px; font-size: 1rem; line-height: 1.9; }
  .pager-text .transcript-view { padding: 0; background: none; }
  .tp-page { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 0; line-height: 1.6; }
  .tw { border-radius: 4px; padding: 1px 1px; cursor: copy; transition: background .12s; }
  .tw:hover, .tw.lit { background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: 0 0 0 1.5px var(--accent); }
  .tw.terr { cursor: pointer; background: color-mix(in srgb, var(--coral) 14%, transparent); white-space: nowrap; }
  .tw.terr sup { color: #fff; background: var(--coral-strong); border-radius: 8px; padding: 0 4px; font-size: .62rem; font-weight: 700; margin-right: 2px; }
  .tw.terr s { color: var(--danger); text-decoration-color: var(--coral-strong); text-decoration-thickness: 2px; }
  .tw.terr ins { text-decoration: none; color: var(--ok); font-weight: 700; }
  .tw.terr.off { background: color-mix(in srgb, var(--muted) 10%, transparent); }
  .tw.terr.off sup { background: #868e96; } .tw.terr.off s { color: #868e96; } .tw.terr.off ins { color: var(--muted); }
  .tw.terr:hover, .tw.terr.lit { box-shadow: 0 0 0 1.5px var(--coral-strong); }
  .tw.pulse { animation: pulse 0.45s ease-in-out 3; display: inline-block; }
  .wbox.lit { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
  .abox.lit { box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 45%, transparent); }
  .review-pages.split .pg-hint { display: none; }
  .pager-bar .seg.mini button { white-space: nowrap; padding: 4px 11px; }
  .pager-bar { flex-wrap: wrap; row-gap: 6px; }
  .pager-bar .pg-zoom, .pager-bar .pg-pages { display: inline-flex; gap: 4px; align-items: center; flex: none; white-space: nowrap; }
}

/* Support access chip in the header */
.support-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; min-width: 0; padding: 3px 4px 3px 9px; border-radius: 99px; background: #ffd166; color: #3b2a00; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.support-chip svg.ic { width: 14px; height: 14px; flex: none; }
.support-chip .sc-who { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.support-chip a { background: #3b2a00; color: #fff; border-radius: 99px; padding: 3px 10px; text-decoration: none; }
.support-chip { flex: none; }
.support-chip .sc-short { display: none; }
@media (max-width: 700px) {
  .support-chip .sc-who, .support-chip .sc-long { display: none; }
  .support-chip .sc-short { display: inline; }
  header.top .class-chip { min-width: 0; flex-shrink: 1; }
}

/* Automatic grading scales and per-mistake doubts (review) */
.scale-line { margin: 4px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scale-auto { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 1px 6px; }
.words-count { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.words-count input { width: 72px; padding: 4px 8px; text-align: center; }
.err.doubt { box-shadow: inset 3px 0 0 var(--warn); }
.err-doubt { margin-top: 3px; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 3px 8px; }
.err-doubt svg { width: 13px; height: 13px; vertical-align: -2px; }
.abox.doubt { border-style: dashed; border-color: #d98a00; }
.abox.doubt b { background: #d98a00; }
.other-checks { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.other-checks ul { margin: 4px 0 0; padding-left: 18px; }
.scale-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.scale-row:first-of-type { border-top: 0; }

/* Exercises placed under the summary when they fit (student sheets) */
.ex-slot:empty { display: none; }
.ex-h-in { font-size: 13pt; margin: 10px 0 6px; }

/* Student sheet formats: three cards, each with a tiny printed page */
.sheet-formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.sheet-formats button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.sheet-formats button:hover { border-color: var(--accent); }
.sheet-formats button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.fmt-pic { flex: none; line-height: 0; }
.fmt-txt { display: flex; flex-direction: column; gap: 2px; }
.fmt-txt span { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.fp-page { fill: #fff; stroke: #9aa5a1; stroke-width: 1; }
.fp-ink { fill: #4a5a56; } .fp-soft { fill: #d6dfdc; } .fp-line { fill: #b8c4c0; }
.fp-ex { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.fp-hand { fill: none; stroke: #8a9692; stroke-width: 1; stroke-linecap: round; }
.fp-mark { fill: none; stroke: #e03131; stroke-width: 1; }
.sheet-group-h { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; }
.sheet-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.sheet-group { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 10px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-group legend { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px; }
.sheet-group .chk { margin: 0; }
.sg-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.sg-act { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sg-act input[type=number] { width: 56px; padding: 4px 6px; }
.sg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#o-exone[hidden], #o-exmany[hidden], #o-exctl[hidden], #o-contrast-row[hidden] { display: none; }
#o-exmany { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
/* « Une page »: printed 8 % smaller rather than spilling onto a second page (same paper size) */
.psheet.tight { zoom: .92; width: calc(7.6in / .92); height: calc(10.1in / .92); }
.sheet-group .seg button { white-space: nowrap; }

/* Help: tutorial and user manual */
.help-link { margin-left: 10px; display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; font-size: .85rem; font-weight: 600;
  padding: 5px 10px; border-radius: 99px; background: rgba(255,255,255,.14); }
.help-link svg { width: 17px; height: 17px; }
.help-link:hover { background: rgba(255,255,255,.24); }
/* On phones the tabs move to the bottom: the link goes to the right of the header; on desktop it sits next to the class. */
@media (max-width: 899px) { .help-link { margin-left: auto; } }
@media (max-width: 600px) { .help-link span { display: none; } .help-link { padding: 5px 7px; } }
.help-home { max-width: 760px; margin: 0 auto; }
.help-start { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; border: 1.5px solid var(--accent); }
.help-start-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.help-start .chev { margin-left: auto; }
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; max-width: 1180px; margin: 0 auto; align-items: start; }
.help-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; font-size: .9rem; }
.help-group { margin-bottom: 14px; }
.help-gh { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 4px 10px; }
.help-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.3; }
.help-nav a:hover { background: var(--surface-2); }
.help-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.help-page { max-width: 780px; font-size: 1.02rem; line-height: 1.6; }
.help-page h1 { margin: 0 0 .5em; font-size: 1.9rem; line-height: 1.2; }
.help-page h2 { font-size: 1.35rem; }
.help-page h3 { font-size: 1.1rem; }
.help-page p, .help-page li { font-size: 1rem; }
.help-page h2 { margin-top: 1.8em; padding-top: .4em; border-top: 1px solid var(--border); }
.help-page h3 { margin-top: 1.4em; }
.help-page img { display: block; max-width: 100%; height: auto; margin: 12px 0 6px; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); cursor: zoom-in; }
.help-page img + em { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.help-page blockquote { margin: 14px 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent); }
.help-page blockquote p { margin: .2em 0; }
.help-page ol li, .help-page ul li { margin: 4px 0; }
.help-page table { display: table; width: 100%; }
.help-page kbd { font: 600 .85em system-ui, sans-serif; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.help-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 2.2em; padding-top: 1em; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-nav { display: none; } }

/* ---- Feedback: problems, ideas, questions */
.help-link { position: relative; }
.help-link .dot, .list .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.help-link .dot { position: absolute; top: 2px; right: 2px; }
.help-ask { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.fb-card { margin-top: 22px; }
.fb-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kind { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; }
.fb-kind svg { width: 14px; height: 14px; }
.fb-bug { color: var(--danger); } .fb-idea { color: var(--accent); } .fb-question { color: var(--muted); }
.fb-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fb-kindopt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; }
.fb-kindopt input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kindopt svg { width: 20px; height: 20px; color: var(--muted); }
.fb-kindopt.on { border-color: var(--accent); background: var(--accent-soft); }
.fb-kindopt.on svg { color: var(--accent); }
.fb-kindopt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .fb-kinds { grid-template-columns: 1fr; } .fb-kindopt { flex-direction: row; align-items: center; gap: 8px; } .fb-kindopt .small { margin-left: auto; } }
.fb-tech { margin: 4px 0 0 26px; } .fb-tech ul { margin: 4px 0; padding-left: 18px; }
.fb-thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 16px; }
.fb-msg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; max-width: 760px; }
.fb-msg.team { background: var(--accent-soft); border-color: transparent; margin-left: 24px; }
.fb-body { white-space: pre-wrap; margin-top: 4px; line-height: 1.45; }
.fb-ai { margin-top: 4px; color: var(--text); } .fb-ai svg { width: 13px; height: 13px; color: var(--accent); vertical-align: -2px; }
.fb-toolbar .seg { margin: 0; } .fb-toolbar .seg a { padding: 6px 10px; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.fb-toolbar .seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.fb-admin { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.fb-admin aside .card { margin-bottom: 12px; }
.fb-review details .fb-body { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.fb-errors { margin: 4px 0 0; padding-left: 16px; } .fb-errors code { word-break: break-word; }
@media (max-width: 899px) { .fb-admin { grid-template-columns: 1fr; } }

/* ---- Usage-based billing */
.bill-big { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; margin-top: 10px; }
.bill-rows { margin: 6px 0 0; padding: 0; list-style: none; } .bill-rows li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.bill-offer ul { margin: 8px 0; padding-left: 20px; } .bill-offer li { margin: 3px 0; }
.meter.hot span { background: var(--warn); } .meter.full span { background: var(--danger); }

/* ---- Pilot project mentions, public manual */
.pilot-pill { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, .18); text-decoration: none; }
.pilot-pill:hover { background: rgba(255, 255, 255, .3); }
.pilot-note { display: flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; }
.pilot-note svg { width: 18px; height: 18px; flex: none; }
.pilot-line { display: flex; gap: 6px; align-items: center; color: var(--muted); } .pilot-line svg { width: 15px; height: 15px; flex: none; }
.help-pub-body { max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px; }
.help-public .help-home { max-width: 760px; margin: 0 auto; }
.about-id { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.about-id h3 { font-size: 1.05rem; margin: 0 0 2px; }
.about-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }

/* Tools (#/outils) and « Questions en rafale » */
.tool-tiles { display: grid; gap: 10px; margin-top: 14px; }
.tool-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin: 0; }
.tool-tile.soon { box-shadow: none; background: transparent; border: 1px dashed var(--border); }
.tool-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--sun-soft); color: var(--warn); }
.tool-ic svg { width: 24px; height: 24px; }
.tool-tile .chev { margin-left: auto; color: var(--muted); font-size: 1.4rem; }
.rf-topics { display: grid; gap: 6px; margin-top: 10px; }
.rf-topic { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.rf-topic.on { border-color: var(--accent); background: var(--accent-soft); color: var(--on-accent-soft); }
.rf-topic.on .muted { color: inherit; opacity: .8; }
.rf-topic:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rf-topic .grow { flex: 1; min-width: 0; }
.rf-limits button { white-space: nowrap; min-width: 44px; min-height: 40px; }
.rf-sugg { display: flex; flex-wrap: wrap; gap: 6px; }

body.rafale-open { overflow: hidden; }
.rafale { position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--text); display: flex; flex-direction: column; overflow: auto; }
.rafale:fullscreen { background: var(--bg); }
.rf-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.rf-subject { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-clock { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1; padding: 4px 14px; border-radius: 12px; }
.rf-clock.warm { background: var(--sun-soft); color: var(--warn); }
.rf-clock.hot { background: var(--danger-soft); color: var(--danger); animation: rf-pulse 1s ease-in-out infinite; }
@keyframes rf-pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .rf-clock.hot { animation: none; } }
.rf-tools { display: flex; gap: 6px; flex: 1; justify-content: flex-end; }
.rf-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; padding: 24px 16px 40px; text-align: center; }
.rf-progress { display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.5rem); }
.rf-score { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; }
.rf-score svg { width: 1.1em; height: 1.1em; }
.rf-q { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, min(9vw, 16vh), 7.5rem); line-height: 1.1; max-width: 18ch; overflow-wrap: anywhere; }
.rf-q.long { font-size: clamp(1.8rem, min(5.5vw, 9vh), 4.6rem); max-width: 24ch; }
.rf-q.xlong { font-size: clamp(1.5rem, min(4vw, 7vh), 3.4rem); max-width: 30ch; }
.rf-a { min-height: 1.2em; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 7vw, 5.5rem); line-height: 1.1; color: var(--accent); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.rf-a.on { opacity: 1; transform: none; }
.rf-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.rf-actions .btn, .rf-go { font-size: clamp(1rem, 2vw, 1.35rem); padding: 14px 26px; border-radius: 14px; }
.rf-hit { background: var(--ok); border-color: var(--ok); color: #fff; }
.rf-miss { border-color: var(--danger); color: var(--danger); }
.rf-ready { display: flex; flex-direction: column; align-items: center; gap: 2.4vh; }
.rf-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 9vw, 6.5rem); line-height: 1; }
.rf-sub { font-size: clamp(1.1rem, 2.6vw, 2rem); color: var(--muted); }
.rf-sub b { color: var(--text); }
.rf-go { font-size: clamp(1.4rem, 3vw, 2.2rem) !important; padding: 16px 48px !important; }
.rf-keys { font-size: .85rem; color: var(--muted); }
.rf-review { width: min(720px, 100%); display: grid; gap: 4px; text-align: left; margin-top: 8px; }
.rf-row { display: grid; grid-template-columns: 1fr auto 80px; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.rf-row.hit { border-color: var(--ok); } .rf-row.miss { border-color: var(--danger); }
.rf-row .small { color: var(--muted); text-align: right; }
@media (max-width: 560px) { .rf-tools .btn { padding: 6px 8px; } .rf-subject { display: none; } }

/* Evaluations shared with a team level */
.team-badge { display: inline-flex; align-items: center; gap: 3px; vertical-align: 2px; font-size: .72rem; background: var(--sky-soft); color: var(--on-sky); }
.team-badge svg { width: 12px; height: 12px; }
.team-note { display: flex; gap: 8px; align-items: flex-start; }
.team-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* Evaluation screen: header, ⋯ menu, sticky tabs, settings rows */
.ev-head { display: flex; align-items: flex-start; gap: 10px; }
.ev-head h1 { margin-bottom: 2px; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.btn.icon-only { width: 38px; padding: 0; flex: none; }
.ev-tabs { position: sticky; top: var(--top-h, 56px); z-index: 5; margin: 6px 0 12px; box-shadow: 0 6px 10px -8px rgba(0,0,0,.25); }
.ev-tabs button { font-size: .85rem; padding: 9px 2px; white-space: nowrap; }
.ev-tabs .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px; border-radius: 99px; background: var(--accent, #e8704f); color: #fff; font-size: .7rem; vertical-align: 1px; }
.ev-line { margin: 0 0 10px; }
.settings-card { padding: 4px 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0; font-weight: 600; font-size: .92rem; }
.set-row:last-child { border-bottom: 0; }
.set-row > span:first-child { display: flex; flex-direction: column; }
.set-hint { font-weight: 400; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.action-sheet { padding-top: 8px; }
.as-item { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 14px 4px; font: inherit; font-size: .98rem; color: var(--text); text-align: left; cursor: pointer; }
.as-item svg { width: 20px; height: 20px; color: var(--muted); }
.as-item.danger-text, .as-item.danger-text svg { color: var(--danger); }
/* Date as a readable chip; the native picker (transparent, on top) opens on tap */
.date-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .9rem; cursor: pointer; }
.date-chip svg { width: 16px; height: 16px; color: var(--muted); }
.date-chip input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; min-height: 0; }
.date-chip input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
/* On/off switch for settings rows */
.set-row input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background .15s; }
.set-row input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.set-row input[type=checkbox]:checked { background: var(--ok); border-color: var(--ok); }
.set-row input[type=checkbox]:checked::after { transform: translateX(18px); }
.set-row input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.criteria-view { background: var(--surface-2); border-radius: 10px; padding: 8px 14px; margin: 6px 0 4px; }
.criteria-view table td, .criteria-view table th { border: 1px solid var(--border); padding: 4px 8px; }
.ev-actions { margin: 0 0 12px; }
.ev-actions .btn { flex: 1 1 auto; margin: 0; white-space: nowrap; }
.criteria-view.clamped { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
#criteria-more { margin: 0 0 6px 2px; }
/* Consolidated grading instructions: one per line, evaluation ones (✕, ↑ Matière) then the subject's (checkbox) */
.cons-list { margin: 8px 0; }
.cons-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0; }
.cons-row:last-child { border-bottom: 0; }
.cons-row .cons-text { flex: 1; font-size: .92rem; font-weight: 400; }
.cons-row.off .cons-text { color: var(--muted); text-decoration: line-through; }
.cons-row input[type=checkbox] { flex: none; width: 20px; height: 20px; margin: 0 2px; }
.cons-add { display: flex; gap: 6px; margin-top: 6px; }
.cons-add input { flex: 1; }
.cons-list { gap: 0; }
.cons-list .iitem { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 8px 2px; align-items: center; }
.cons-list .iitem:last-child { border-bottom: 0; }
.cons-list .iitem { box-shadow: none; }
.cons-del { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .8rem; cursor: pointer; padding: 0; }
.cons-del:hover { background: var(--danger-soft); color: var(--danger); }
.cons-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
@media (max-width: 720px) { .cons-cols { grid-template-columns: 1fr; } }
.cons-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 700; color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 4px; }
.cons-head svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.cons-head a { font-weight: 600; }
#consignes > .cons-add { margin: 10px 0 14px; }
.cons-empty { margin: 6px 0; }
.cons-move { flex: none; gap: 4px; }
.cons-move svg { width: 14px; height: 14px; }
.set-title { display: block; padding: 10px 0 2px; }
.doc-acts { display: flex; flex-direction: column; gap: 6px; flex: none; }
.doc-act { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; padding: 0; font-size: .85rem; }
.doc-act svg { width: 16px; height: 16px; }
.doc-act[data-docread]:hover { color: var(--accent); }
.doc-act[data-docdel]:hover { background: var(--danger-soft); color: var(--danger); }
.criteria-line { margin: 10px 0 14px; }
.cons-edit { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.cons-edit svg { width: 15px; height: 15px; }
.cons-edit:hover { background: var(--surface-2); color: var(--text); }
#aug-scope { flex: none; width: auto; max-width: 46%; }
@media (max-width: 720px) { #aug-form { flex-wrap: wrap; } #aug-form input { flex-basis: 100%; } #aug-scope { flex: 1; max-width: none; } }
.cons-others { margin-top: 6px; }
.cons-others summary { cursor: pointer; padding: 4px 0; }
.iitem .grow { flex: 1; min-width: 0; }
.iitem .grow textarea { width: 100%; }
.ins-period { padding: 0 4px; }
.iitem.retired { opacity: .6; }
.cons-cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 0; }
.cons-row[title] { cursor: default; }
/* Admin › user: actions grouped by kind; access card */
.adm-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.adm-actions > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-actions > div > .small.muted { width: 70px; flex: none; }
.access-card { border-left: 4px solid var(--ok); }
