:root {
  font-family: Arial, Helvetica, sans-serif;
  --bg: #f7f4eb;
  --ink: #193e3b;
  --primary: #245b50;
  --muted: #667b70;
  --border: #dedfd4;
  --panel: #fffef9;
  --soft: #e4eee1;
  --peach: #f5dfce;
  --lilac: #e5e1f0;
  --accent: #c85b43;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.file-action {
  cursor: pointer;
}
button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 15px;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--reverse, #fff);
}
button.secondary {
  background: var(--soft);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  color: var(--ink);
  background: var(--panel);
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 1rem;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
label {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 20px 0;
}
legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
}
small {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
}
h1 {
  font-size: clamp(2rem, 3vw, 2.85rem);
  line-height: 1.13;
  margin: 12px 0 15px;
  font-weight: 500;
}
h2 {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 500;
}
h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 12px 0;
}
p {
  line-height: 1.6;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.multiline {
  white-space: pre-line;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip {
  position: fixed;
  top: -100px;
  left: 10px;
  padding: 10px;
  background: var(--panel);
  z-index: 99;
}
.skip:focus {
  top: 10px;
}
.brand {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 58px;
}
.brand:hover {
  background: transparent;
}
.ox-logo {
  width: 174px;
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 25px 20px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  z-index: 30;
}
.sidebar > .eyebrow {
  margin: 20px 8px 35px;
  font-size: 0.68rem;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 13px;
}
.sidebar nav button span {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}
.sidebar nav button.active {
  background: var(--primary);
  color: var(--reverse, #fff);
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}
.sidebar-bottom button {
  align-self: flex-start;
  border: 0;
  padding: 5px;
}
.workspace {
  min-width: 0;
}
.topbar {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background: var(--panel);
}
.class-pick select {
  font-size: 0.9rem;
  font-weight: 700;
  max-width: 280px;
}
.top-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--muted);
}
.badge {
  border-radius: 100px;
  padding: 6px 11px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.76rem;
  white-space: nowrap;
}
.badge.good {
  background: #d3ecdc;
  color: #245c41;
}
.badge.warm {
  background: #f3dcbd;
  color: #7c4b22;
}
main#content {
  padding: 35px 40px 50px;
  max-width: 1600px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  margin-bottom: 28px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 640px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.metric {
  padding: 23px;
  border-radius: 20px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.metric > span {
  font-size: 0.86rem;
  font-weight: 600;
}
.metric strong {
  font-family: Georgia, serif;
  font-size: 2.3rem;
  font-weight: 500;
}
.metric.peach {
  background: var(--peach);
}
.metric.lilac {
  background: var(--lilac);
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 30px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}
.section-title h2 {
  margin: 0;
}
.section-title button {
  border: 0;
  background: transparent;
  font-size: 0.8rem;
}
.lesson {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  overflow: hidden;
}
.lesson-time {
  background: var(--soft);
  padding: 23px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lesson-time strong {
  font-size: 1.05rem;
}
.lesson-time span {
  font-size: 0.78rem;
  color: var(--muted);
}
.lesson.math .lesson-time {
  background: var(--peach);
}
.lesson-main {
  padding: 22px;
  min-width: 0;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.subject {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}
.lesson-main h3 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 16px 0;
}
.lesson-main p {
  font-size: 0.94rem;
}
.lesson-main .material {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 20px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.lesson .actions {
  justify-content: flex-start;
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: 20px;
}
.actions button {
  font-size: 0.8rem;
}
.next-panel {
  background: var(--primary);
  color: var(--reverse, #fff);
  border-radius: 20px;
  padding: 28px;
  align-self: start;
}
.next-panel h2 {
  font-size: 2.1rem;
  margin: 15px 0 25px;
}
.next-panel .eyebrow {
  color: inherit;
  opacity: 0.75;
}
.next-panel button {
  width: 100%;
  display: flex;
  text-align: left;
  gap: 17px;
  background: transparent;
  color: inherit;
  border: 0;
  border-top: 1px solid #ffffff30;
  border-radius: 0;
  padding: 17px 0;
}
.next-panel button b {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.6;
}
.next-panel button span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.next-panel small {
  color: inherit;
  opacity: 0.8;
  font-size: 0.76rem;
  font-weight: 400;
}
.next-panel .soft-note {
  background: #ffffff14;
  color: inherit;
  border: 0;
  font-size: 0.8rem;
  margin: 20px 0 0;
  padding: 15px;
}
.soft-note {
  padding: 16px 20px;
  background: var(--soft);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 24px;
}
.toolbar label {
  max-width: 220px;
}
.toolbar .actions {
  align-items: center;
}
.empty {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 20px;
  background: var(--panel);
  grid-column: 1/-1;
}
.empty > span {
  font-size: 2rem;
  color: var(--accent);
}
.empty h3 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
}
.empty p {
  color: var(--muted);
}
.bilan {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--peach);
  padding: 25px;
  margin-top: 25px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.prep-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary);
  padding: 25px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.prep-card.math {
  border-top-color: var(--accent);
}
.prep-card h2 {
  margin: 15px 0;
}
.prep-card .actions {
  margin-top: auto;
  padding-top: 25px;
}
.period-grid,
.timetable-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.period {
  border: 1px solid var(--border);
  background: var(--soft);
  padding: 16px;
  border-radius: 16px;
  min-width: 0;
}
.period h2 {
  font-size: 1.15rem;
  margin: 0 0 20px;
}
.period article {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 14px;
}
.period small {
  display: block;
  margin-bottom: 15px;
}
.period button {
  padding: 6px 10px;
  font-size: 0.8rem;
}
.period p {
  font-size: 0.82rem;
}
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
th,
td {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
thead th {
  background: var(--soft);
  font-size: 0.84rem;
}
th small {
  display: block;
  margin-top: 7px;
}
td select {
  min-width: 155px;
  font-size: 0.84rem;
}
tbody th {
  font-weight: 500;
  min-width: 190px;
}
.avatar {
  background: var(--soft);
  border-radius: 50%;
  padding: 10px;
  margin-right: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}
.stats-line {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 25px 0;
  font-size: 0.82rem;
}
.legend span {
  padding: 8px 12px;
  border-radius: 8px;
}
.result-a {
  background: #d4efdd;
  color: #215739;
}
.result-ec {
  background: #fff0c4;
  color: #695321;
}
.result-na {
  background: #f8d8d1;
  color: #743a2e;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.panel {
  padding: 25px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.panel h2 {
  margin-top: 0;
}
.panel p {
  font-size: 0.9rem;
}
.panel small {
  display: block;
  margin-top: 20px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.theme-grid button {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}
.theme-grid button[aria-pressed="true"] {
  outline: 2px solid var(--primary);
}
.theme-grid img {
  height: 40px;
  width: 40px;
  object-fit: contain;
}
.conflicts {
  grid-column: 1/-1;
}
.file-action {
  display: inline-flex;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 44px;
  align-items: center;
  font-size: 0.8rem;
}
.file-action:hover {
  background: var(--soft);
}
.workspace-footer {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  gap: 20px;
  border-top: 1px solid var(--border);
}
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 70px;
  padding: 7vw;
  max-width: 1700px;
  margin: auto;
}
.gate-copy .brand {
  display: block;
  margin-bottom: 55px;
}
.gate-copy h1 {
  font-size: clamp(2.7rem, 4.6vw, 4.6rem);
  margin: 25px 0;
}
.gate-copy h1 em {
  color: var(--accent);
  font-weight: 400;
}
.gate-copy > p {
  font-size: 1.1rem;
  max-width: 530px;
  color: var(--muted);
}
.gate-steps {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 40px;
  font-size: 0.78rem;
  font-weight: 700;
}
.gate-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 35px;
  border-radius: 24px;
  box-shadow: 0 20px 70px #173e3b0a;
}
.gate-panel h2 {
  font-size: 2rem;
}
.gate-panel > p {
  color: var(--muted);
  font-size: 0.94rem;
}
.gate-panel form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}
.checkline {
  flex-direction: row;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.5;
}
.checkline input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0;
}
.gate-foot {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 25px;
  font-size: 0.76rem;
}
.gate-panel > small {
  display: block;
}
.editor {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  color: var(--ink);
  width: min(600px, calc(100vw - 30px));
  max-height: 90vh;
  padding: 28px;
}
.editor::backdrop {
  background: #153c356b;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-head button {
  font-size: 1.6rem;
  min-width: 44px;
  padding: 0;
}
.editor form > label {
  margin-bottom: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.chips {
  display: flex;
  gap: 20px;
}
.form-error {
  color: #a33321;
  font-size: 0.9rem;
}
.editor footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
.editor p {
  font-size: 0.9rem;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(600px, 90vw);
  padding: 16px 22px;
  background: var(--ink);
  color: var(--panel);
  border-radius: 15px;
  box-shadow: 0 8px 30px #0002;
  z-index: 100;
  display: none;
  font-size: 0.9rem;
  line-height: 1.5;
}
#toast.show {
  display: block;
}
.mobile-nav,
#mobile-menu {
  display: none;
}
body[data-theme="argile"] {
  --primary: #93441a;
  --ink: #553722;
  --soft: #f3e2cf;
  --bg: #faf3e8;
  --accent: #c06540;
}
body[data-theme="classe"] {
  --primary: #255fbd;
  --ink: #173b7d;
  --bg: #f7f9ff;
  --soft: #e8f1ff;
  --border: #d3e2f6;
  --accent: #eb5d53;
}
body[data-theme="soleil"] {
  --primary: #a23b69;
  --ink: #69304c;
  --bg: #fff9ec;
  --soft: #ffedc9;
  --peach: #f3d9e1;
  --accent: #e85a43;
}
body[data-theme="jardin"] {
  --primary: #168675;
  --ink: #174840;
  --soft: #d8eee2;
  --accent: #bd5739;
}
body[data-theme="corail"] {
  --primary: #397781;
  --ink: #2c5960;
  --soft: #e4f0ef;
  --peach: #fbd9ce;
  --accent: #b44637;
}
body[data-theme="lagune"] {
  --primary: #00353f;
  --ink: #123f4b;
  --bg: #f1f7f5;
  --soft: #d8ecea;
  --accent: #a75c35;
}
body[data-theme="nuit"] {
  --primary: #8dd8b8;
  --ink: #e3eee7;
  --muted: #b4c9bd;
  --bg: #112b27;
  --panel: #183a32;
  --soft: #274a3f;
  --border: #446259;
  --peach: #594436;
  --lilac: #3d4050;
  --accent: #f3b08c;
  --reverse: #102d24;
}
body[data-theme="nuit"] .next-panel {
  background: #244b3e;
  color: #e3eee7;
}
body[data-theme="nuit"] .empty {
  background: var(--panel);
}
@media (min-width: 1600px) {
  main#content {
    padding: 50px 65px;
  }
  .topbar {
    padding-inline: 65px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding: 20px 12px;
  }
  .sidebar nav button {
    font-size: 0.83rem;
  }
  .ox-logo {
    width: 155px;
  }
  main#content {
    padding: 28px 25px;
  }
  .topbar {
    padding: 18px 25px;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .next-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .next-panel > h2 {
    grid-column: 1/-1;
  }
  .next-panel > .soft-note {
    grid-column: 1/-1;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .period-grid,
  .timetable-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gate {
    gap: 35px;
    padding: 5vw;
  }
  .top-status #save-status {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 250px;
    transition: left 0.25s;
    box-shadow: 10px 0 40px #0002;
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar .brand {
    margin-left: 0;
  }
  .workspace {
    padding-bottom: 75px;
  }
  #mobile-menu {
    display: block;
    flex: none;
    font-size: 1.2rem;
  }
  .topbar {
    padding: 13px 16px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .class-pick {
    flex: 1;
    min-width: 0;
  }
  .class-pick select {
    font-size: 0.8rem;
  }
  .top-status {
    gap: 0;
  }
  .top-status .badge {
    font-size: 0.68rem;
    padding: 7px;
  }
  .top-status > button {
    display: none;
  }
  main#content {
    padding: 25px 16px;
  }
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .page-heading h1 {
    font-size: 2rem;
  }
  .page-heading > button {
    width: 100%;
  }
  .page-heading p {
    font-size: 0.9rem;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 18px;
    gap: 8px;
  }
  .metric > span {
    font-size: 0.78rem;
  }
  .metric strong {
    font-size: 2rem;
  }
  .metric small {
    font-size: 0.75rem;
  }
  .lesson {
    grid-template-columns: 65px minmax(0, 1fr);
  }
  .lesson-time {
    padding: 20px 9px;
  }
  .lesson-time strong {
    font-size: 0.9rem;
  }
  .lesson-time span {
    font-size: 0.7rem;
  }
  .lesson-main {
    padding: 18px 14px;
  }
  .lesson-main h3 {
    font-size: 1.3rem;
  }
  .lesson-main .row {
    align-items: flex-start;
  }
  .subject {
    font-size: 0.72rem;
  }
  .badge {
    font-size: 0.68rem;
    padding: 5px 8px;
  }
  .lesson-main p {
    font-size: 0.9rem;
  }
  .actions button {
    padding: 10px;
    font-size: 0.75rem;
  }
  .card-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .period-grid,
  .timetable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .period {
    padding: 12px;
  }
  .period article {
    padding: 12px;
  }
  .period h3 {
    font-size: 0.93rem;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar label {
    max-width: none;
  }
  .toolbar .actions {
    justify-content: flex-start;
  }
  .workspace-footer {
    padding: 18px;
    flex-direction: column;
    gap: 10px;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--border);
    justify-content: space-around;
  }
  .mobile-nav button {
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    font-size: 0.7rem;
    min-width: 70px;
    padding: 5px;
  }
  .mobile-nav button span {
    font-size: 1.3rem;
  }
  .mobile-nav button[aria-current] {
    color: var(--primary);
    background: var(--soft);
  }
  .gate {
    grid-template-columns: 1fr;
    padding: 28px 18px;
    gap: 30px;
  }
  .gate-copy .brand {
    margin-bottom: 25px;
  }
  .gate-copy h1 {
    font-size: 2.8rem;
  }
  .gate-copy > p {
    font-size: 0.95rem;
  }
  .gate-steps {
    margin-top: 25px;
    font-size: 0.7rem;
    gap: 10px;
  }
  .gate-panel {
    padding: 25px 20px;
  }
  .gate-panel h2 {
    font-size: 1.6rem;
  }
  .gate-copy > .eyebrow {
    font-size: 0.68rem;
  }
  .next-panel {
    padding: 22px;
  }
  .next-panel h2 {
    font-size: 1.8rem;
  }
  .next-panel button {
    font-size: 0.85rem;
  }
  .editor {
    padding: 22px 18px;
  }
  #toast {
    bottom: 90px;
  }
  .theme-grid {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .workspace-footer,
  .page-heading > button,
  .actions,
  .toolbar,
  #toast,
  .skip {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .workspace {
    padding: 0;
  }
  main#content {
    padding: 0;
    max-width: none;
  }
  .lesson,
  .prep-card,
  .bilan {
    break-inside: avoid;
    box-shadow: none;
  }
  body {
    background: white;
    color: #111;
  }
  .home-grid {
    display: block;
  }
  .next-panel {
    display: none;
  }
  button {
    display: none;
  }
  h1 {
    font-size: 24pt;
  }
  textarea,
  input,
  select {
    border: 0;
  }
  table {
    font-size: 10pt;
  }
  td,
  th {
    padding: 10px;
  }
  .period-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .metric {
    background: #eee !important;
    color: #111;
  }
  .subject {
    color: #333;
  }
}
:root .demo-strip {
  background: #f7ddaa;
  color: #694519;
  padding: 9px 20px;
  text-align: center;
  font-size: 0.8rem;
}
.demo-visit {
  margin-top: 22px;
  width: 100%;
}

@media (min-width: 761px) and (max-width: 900px) {
  .card-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .period-grid,
  .timetable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.progress-filters {
  justify-content: flex-start;
}
.progress-filters label {
  flex: 1;
  max-width: 360px;
  min-width: 0;
}
.progress-overview {
  margin-bottom: 24px;
}
.progress-stack {
  display: flex;
  min-height: 32px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--soft);
  margin: 18px 0 12px;
}
.progress-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-weight: 600;
  font-size: 0.82rem;
}
.progress-a {
  background: #d4efdd;
  color: #215739;
}
.progress-ec {
  background: #fff0c4;
  color: #695321;
}
.progress-na {
  background: #f8d8d1;
  color: #743a2e;
}
.progress-missing {
  background: var(--soft);
  color: var(--ink);
}
.progress-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  font-size: 0.88rem;
}
.progress-counts strong {
  margin-left: 6px;
}
.progress-pupils {
  margin-bottom: 28px;
}
.progress-pupils h3 {
  margin-top: 0;
}
.progress-pupils p {
  font-size: 0.82rem;
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .progress-filters label {
    max-width: none;
    width: 100%;
  }
  .progress-counts {
    gap: 12px;
  }
  .progress-pupils {
    gap: 12px;
  }
}

.phase-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 16px;
  margin-bottom: 16px;
}
.phase-editor textarea {
  min-height: 80px;
}
.phase-summary {
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.phase-summary li {
  margin-bottom: 12px;
}
.phase-summary p {
  margin: 4px 0;
}
.phase-summary small {
  display: block;
}
.phase-duration-note {
  font-size: 0.86rem;
  color: var(--muted);
}
.sequence-preps {
  padding-left: 20px;
}
.sequence-preps li {
  margin: 18px 0;
}
.sequence-preps small {
  display: block;
  margin: 6px 0;
}
.sequence-card .actions {
  margin-top: 14px;
}

.phase-editor label {
  min-width: 0;
}
@media (max-width: 760px) {
  .phase-editor .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.sidebar nav {
  overflow: auto;
  min-height: 0;
}
.sidebar-bottom {
  flex-shrink: 0;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.member-grid input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}
.station-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
  margin-bottom: 15px;
}
.rotation-card {
  margin-bottom: 20px;
}
.group-blue {
  border-top: 4px solid var(--primary);
}
.group-coral {
  border-top: 4px solid var(--accent);
}
.group-green {
  border-top: 4px solid #168675;
}
.classroom-stage > h2 {
  font-size: 2.6rem;
}
.classroom-stage > p {
  font-size: 1.15rem;
}
.timer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 24px 0;
}
.timer strong {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
.rotation-preview {
  margin: 20px 0;
}
.rotation-preview td {
  min-width: 130px;
}
@media (max-width: 760px) {
  .member-grid {
    grid-template-columns: 1fr;
  }
  .classroom-stage > h2 {
    font-size: 2rem;
  }
}

.welcome-guide {
  margin: 1.5rem 0;
}
.welcome-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.welcome-steps li {
  border: 1px solid var(--line, #ddd);
  border-radius: 16px;
  padding: 1rem;
}
.welcome-steps h3 {
  margin: 0.7rem 0;
}
.welcome-steps p {
  font-size: 0.9rem;
}
.welcome-guide > .row {
  flex-wrap: wrap;
}

.result-not-evaluable,
.progress-notevaluable {
  background: #e5e7ef;
  color: #374151;
}
.observation-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  list-style: none;
}
.observation-timeline li {
  border-left: 3px solid #8e95a5;
  padding: 0.75rem;
  max-width: 100%;
}
.observation-timeline time,
.observation-timeline small {
  display: block;
  margin: 0.3rem 0;
}

.budget-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}
.budget-summary strong {
  color: var(--primary);
}

.pupil-photo {
  width: 96px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
}
.work-content meter {
  max-width: 100%;
  width: 180px;
  margin-left: 0.5rem;
}
dialog pre {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

[data-slot-drag][draggable="true"] {
  cursor: grab;
}
[data-timetable-day] {
  min-height: 180px;
}
.constraint-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.excerpt-preview {
  max-width: 900px;
  overflow-wrap: anywhere;
}
.excerpt-preview article,
.excerpt-preview section {
  padding: 16px;
  border: 1px solid var(--line, #d8dfeb);
  border-radius: 12px;
  margin: 12px 0;
}
.excerpt-preview .text {
  white-space: pre-wrap;
}

.recovery-code {
  overflow-wrap: anywhere;
  padding: 1rem;
  border: 1px solid currentColor;
  border-radius: 0.6rem;
  font-size: 1.05rem;
  line-height: 1.8;
  user-select: all;
}
