
    @media screen {
      /* 1. BLEU OCÉAN (Défaut — Ardoise fraîche & Bleu royal, sidebar albâtre pâle) */
      html.design-studio,
      html.design-studio[data-palette="ocean"] {
        --ink: #0f172a;
        --muted: #64748b;
        --line: #e2e8f0;
        --paper: #f1f5f9;
        --surface: #fff;
        --brand: #1d4ed8;
        --brand-deep: #1e3a8a;
        --brand-soft: #eff6ff;
        --accent: #0284c7;
        --mist-a: #38bdf8;
        --mist-b: #818cf8;
        --studio-bg: #f1f5f9;
        --studio-surface: #fff;
        --studio-surface-soft: #f8fafc;
        --studio-border: #e2e8f0;
        --studio-border-strong: #cbd5e1;
        --studio-text: #0f172a;
        --studio-text-muted: #475569;
        --studio-accent: #1d4ed8;
        --studio-accent-deep: #1e3a8a;
        --studio-accent-soft: #eff6ff;
        --studio-shadow-sm: 0 2px 8px -2px rgba(29, 78, 216, .08), 0 1px 2px rgba(15, 23, 42, .04);
        --studio-shadow-md: 0 14px 32px -12px rgba(29, 78, 216, .14), 0 4px 12px -4px rgba(15, 23, 42, .05);
        --sidebar-bg-top: #f8f9fb;
        --sidebar-bg-bottom: #f1f4f8;
        --sidebar-border: #dde3ec;
        --sidebar-brand-border: #e2e7f0;
      }

      /* 1b. VERT FORÊT (Sauge douce, ardoise naturelle & vert sapin professionnel) */
      html.design-studio[data-palette="foret"] {
        --ink: #16221b;
        --muted: #5a6d62;
        --line: #dce5df;
        --paper: #f4f7f5;
        --surface: #ffffff;
        --brand: #2f6b4f;
        --brand-deep: #1b4632;
        --brand-soft: #e6f2eb;
        --accent: #1f7a68;
        --mist-a: #34d399;
        --mist-b: #38bdf8;
        --studio-bg: #f4f7f5;
        --studio-surface: #ffffff;
        --studio-surface-soft: #f7faf8;
        --studio-border: #dce5df;
        --studio-border-strong: #c2d1c8;
        --studio-text: #16221b;
        --studio-text-muted: #4d5f54;
        --studio-accent: #2f6b4f;
        --studio-accent-deep: #1b4632;
        --studio-accent-soft: #e6f2eb;
        --sidebar-bg-top: #eff8f2;
        --sidebar-bg-bottom: #e4f0e9;
        --sidebar-border: #d8e2dc;
        --sidebar-brand-border: #dde7e0;
      }

      /* 2. INDIGO BORÉAL (Calme académique, lavande ardoise & indigo profond) */
      html.design-studio[data-palette="boreal"] {
        --ink: #131629;
        --muted: #636682;
        --line: #e2e4ef;
        --paper: #f3f4f8;
        --surface: #ffffff;
        --brand: #4338ca;
        --brand-deep: #312e81;
        --brand-soft: #eef2ff;
        --accent: #6366f1;
        --mist-a: #818cf8;
        --mist-b: #c084fc;
        --studio-bg: #f3f4f8;
        --studio-surface: #ffffff;
        --studio-surface-soft: #f8f9fc;
        --studio-border: #e2e4ef;
        --studio-border-strong: #c9cde0;
        --studio-text: #131629;
        --studio-text-muted: #4b4e6d;
        --studio-accent: #4338ca;
        --studio-accent-deep: #312e81;
        --studio-accent-soft: #eef2ff;
        --sidebar-bg-top: #f3f1fc;
        --sidebar-bg-bottom: #e9e7f7;
        --sidebar-border: #e1dfeb;
        --sidebar-brand-border: #e6e4f0;
      }

      /* 3. AZUR NORDIQUE (Cristal aérien, bleu fjord & brume polaire) */
      html.design-studio[data-palette="azur"] {
        --ink: #0c1924;
        --muted: #586f82;
        --line: #dce6ee;
        --paper: #eff4f8;
        --surface: #ffffff;
        --brand: #0369a1;
        --brand-deep: #0c4a6e;
        --brand-soft: #edf7fc;
        --accent: #0284c7;
        --mist-a: #38bdf8;
        --mist-b: #2dd4bf;
        --studio-bg: #eff4f8;
        --studio-surface: #ffffff;
        --studio-surface-soft: #f7fafc;
        --studio-border: #dce6ee;
        --studio-border-strong: #c2d3e0;
        --studio-text: #0c1924;
        --studio-text-muted: #3f5668;
        --studio-accent: #0369a1;
        --studio-accent-deep: #0c4a6e;
        --studio-accent-soft: #edf7fc;
        --sidebar-bg-top: #f7fafc;
        --sidebar-bg-bottom: #edf3f7;
        --sidebar-border: #d9e3eb;
        --sidebar-brand-border: #dfe8ef;
      }

      /* 4. ARGILE & TERRACOTTA (Chaleureux, terre cuite feutrée & pierre rosée) */
      html.design-studio[data-palette="terracotta"] {
        --ink: #231917;
        --muted: #786661;
        --line: #e8dfdc;
        --paper: #f6f3f1;
        --surface: #ffffff;
        --brand: #b84a39;
        --brand-deep: #7f2d20;
        --brand-soft: #fdf2f0;
        --accent: #d96b43;
        --mist-a: #f59e0b;
        --mist-b: #f472b6;
        --studio-bg: #f6f3f1;
        --studio-surface: #ffffff;
        --studio-surface-soft: #fbf9f8;
        --studio-border: #e8dfdc;
        --studio-border-strong: #d5c7c2;
        --studio-text: #231917;
        --studio-text-muted: #5c4b47;
        --studio-accent: #b84a39;
        --studio-accent-deep: #7f2d20;
        --studio-accent-soft: #fdf2f0;
        --sidebar-bg-top: #fdf2ef;
        --sidebar-bg-bottom: #f7e7e1;
        --sidebar-border: #e4dad4;
        --sidebar-brand-border: #e9e0db;
      }

      /* 5. PRUNE ÉDITORIALE (Littéraire, aubergine veloutée & brume mauve douce) */
      html.design-studio[data-palette="prune"] {
        --ink: #1f1624;
        --muted: #6e6075;
        --line: #e6e0ea;
        --paper: #f5f2f7;
        --surface: #ffffff;
        --brand: #6b2f7a;
        --brand-deep: #4a1d56;
        --brand-soft: #f8f0fa;
        --accent: #8b3d9e;
        --mist-a: #c084fc;
        --mist-b: #f472b6;
        --studio-bg: #f5f2f7;
        --studio-surface: #ffffff;
        --studio-surface-soft: #faf8fb;
        --studio-border: #e6e0ea;
        --studio-border-strong: #d1c7d8;
        --studio-text: #1f1624;
        --studio-text-muted: #54465c;
        --studio-accent: #6b2f7a;
        --studio-accent-deep: #4a1d56;
        --studio-accent-soft: #f8f0fa;
        --sidebar-bg-top: #f9f0fa;
        --sidebar-bg-bottom: #f1e4f3;
        --sidebar-border: #e2dae7;
        --sidebar-brand-border: #e7e0ec;
      }

      /* 6. OCRE & AMBRE (Lumineux, bronze doré & papier ivoire léger) */
      html.design-studio[data-palette="ambre"] {
        --ink: #211a12;
        --muted: #756756;
        --line: #e8e1d7;
        --paper: #f6f3ee;
        --surface: #ffffff;
        --brand: #b45309;
        --brand-deep: #78350f;
        --brand-soft: #fef7ec;
        --accent: #d97706;
        --mist-a: #fbbf24;
        --mist-b: #fb923c;
        --studio-bg: #f6f3ee;
        --studio-surface: #ffffff;
        --studio-surface-soft: #fbf9f5;
        --studio-border: #e8e1d7;
        --studio-border-strong: #d6cbbd;
        --studio-text: #211a12;
        --studio-text-muted: #594d3f;
        --studio-accent: #b45309;
        --studio-accent-deep: #78350f;
        --studio-accent-soft: #fef7ec;
        --sidebar-bg-top: #fdf7e9;
        --sidebar-bg-bottom: #f7ecd5;
        --sidebar-border: #e4ddd1;
        --sidebar-brand-border: #e9e3d8;
      }

      /* 7. GRAPHITE & ENCRE (Monochrome minimaliste type Notion / iA Writer) */
      html.design-studio[data-palette="graphite"] {
        --ink: #18181b;
        --muted: #64656d;
        --line: #e4e4e7;
        --paper: #f3f4f6;
        --surface: #ffffff;
        --brand: #334155;
        --brand-deep: #0f172a;
        --brand-soft: #f1f5f9;
        --accent: #475569;
        --mist-a: #94a3b8;
        --mist-b: #cbd5e1;
        --studio-bg: #f3f4f6;
        --studio-surface: #ffffff;
        --studio-surface-soft: #f9fafb;
        --studio-border: #e4e4e7;
        --studio-border-strong: #cfd0d6;
        --studio-text: #18181b;
        --studio-text-muted: #4b4c53;
        --studio-accent: #334155;
        --studio-accent-deep: #0f172a;
        --studio-accent-soft: #f1f5f9;
        --sidebar-bg-top: #f8f8f9;
        --sidebar-bg-bottom: #f0f1f3;
        --sidebar-border: #e0e1e5;
        --sidebar-brand-border: #e5e6ea;
      }

      html.design-studio.theme-dark,
      html.design-studio.theme-dark[data-palette="ocean"] {
        color-scheme: dark;
        --ink: #e3e3e3;
        --muted: #c4c7c5;
        --line: #444746;
        --paper: #131314;
        --surface: #1e1f20;
        --brand: #3b82f6;
        --brand-deep: #a8c7fa;
        --brand-soft: #26364d;
        --mist-a: #38bdf8;
        --mist-b: #818cf8;
        --studio-bg: #131314;
        --studio-surface: #1e1f20;
        --studio-surface-soft: #292a2d;
        --studio-border: #444746;
        --studio-border-strong: #5f6368;
        --studio-text: #e3e3e3;
        --studio-text-muted: #c4c7c5;
        --studio-accent: #3b82f6;
        --studio-accent-deep: #a8c7fa;
        --studio-accent-soft: #26364d;
        --sidebar-bg-top: #1a1c1e;
        --sidebar-bg-bottom: #141618;
        --sidebar-border: #2e3134;
        --sidebar-brand-border: #2e3134;
      }
      html.design-studio.theme-dark[data-palette="foret"] {
        --brand: #3ea379;
        --brand-deep: #a7e3c8;
        --brand-soft: #1b362b;
        --mist-a: #34d399;
        --mist-b: #22d3ee;
        --studio-accent: #3ea379;
        --studio-accent-deep: #a7e3c8;
        --studio-accent-soft: #1b362b;
      }
      html.design-studio.theme-dark[data-palette="boreal"] {
        --brand: #6366f1;
        --brand-deep: #a5b4fc;
        --brand-soft: #25274d;
        --mist-a: #818cf8;
        --mist-b: #c084fc;
        --studio-accent: #6366f1;
        --studio-accent-deep: #a5b4fc;
        --studio-accent-soft: #25274d;
      }
      html.design-studio.theme-dark[data-palette="azur"] {
        --brand: #0284c7;
        --brand-deep: #7dd3fc;
        --brand-soft: #163247;
        --mist-a: #38bdf8;
        --mist-b: #2dd4bf;
        --studio-accent: #0284c7;
        --studio-accent-deep: #7dd3fc;
        --studio-accent-soft: #163247;
      }
      html.design-studio.theme-dark[data-palette="terracotta"] {
        --brand: #e06d53;
        --brand-deep: #f5b0a1;
        --brand-soft: #3d241f;
        --mist-a: #f97316;
        --mist-b: #f472b6;
        --studio-accent: #e06d53;
        --studio-accent-deep: #f5b0a1;
        --studio-accent-soft: #3d241f;
      }
      html.design-studio.theme-dark[data-palette="prune"] {
        --brand: #a855f7;
        --brand-deep: #d8b4fe;
        --brand-soft: #362147;
        --mist-a: #c084fc;
        --mist-b: #f472b6;
        --studio-accent: #a855f7;
        --studio-accent-deep: #d8b4fe;
        --studio-accent-soft: #362147;
      }
      html.design-studio.theme-dark[data-palette="ambre"] {
        --brand: #d97706;
        --brand-deep: #fcd34d;
        --brand-soft: #3b2a14;
        --mist-a: #f59e0b;
        --mist-b: #fb923c;
        --studio-accent: #d97706;
        --studio-accent-deep: #fcd34d;
        --studio-accent-soft: #3b2a14;
      }
      html.design-studio.theme-dark[data-palette="graphite"] {
        --brand: #64748b;
        --brand-deep: #cbd5e1;
        --brand-soft: #272c35;
        --mist-a: #64748b;
        --mist-b: #94a3b8;
        --studio-accent: #64748b;
        --studio-accent-deep: #cbd5e1;
        --studio-accent-soft: #272c35;
      }
      html.design-studio body {
        padding: 0 !important;
        background-color: var(--studio-bg) !important;
        background-image:
          radial-gradient(ellipse 68% 48% at 14% -6%, color-mix(in srgb, var(--mist-a, var(--accent)) 14%, transparent), transparent 68%),
          radial-gradient(ellipse 62% 46% at 88% 4%, color-mix(in srgb, var(--mist-b, var(--brand)) 11%, transparent), transparent 66%),
          linear-gradient(165deg, color-mix(in srgb, var(--mist-a, var(--brand)) 5%, var(--studio-bg)) 0%, var(--studio-bg) 52%, color-mix(in srgb, var(--mist-b, var(--brand)) 6%, var(--studio-bg)) 100%) !important;
        background-attachment: fixed !important;
        color: var(--studio-text) !important;
      }
      html.design-studio.theme-dark body {
        background-image:
          radial-gradient(ellipse 65% 48% at 16% -6%, color-mix(in srgb, var(--mist-a, var(--brand)) 14%, transparent), transparent 68%),
          radial-gradient(ellipse 58% 46% at 88% 4%, color-mix(in srgb, var(--mist-b, var(--brand)) 11%, transparent), transparent 68%),
          linear-gradient(165deg, color-mix(in srgb, var(--mist-a, var(--brand)) 4%, var(--studio-bg)) 0%, var(--studio-bg) 56%, color-mix(in srgb, var(--mist-b, var(--brand)) 5%, var(--studio-bg)) 100%) !important;
      }
      #printMeta { display: none; }
      html.design-studio body, html.design-studio button, html.design-studio input, html.design-studio select, html.design-studio textarea { font-family: "Segoe UI", system-ui, sans-serif; }
      :is(.test-sidebar-brand h1, .test-sidebar-brand .brand-heading, .brand-title, #viewHome h1, #viewHome h2, #viewHome h3) {
        font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
        letter-spacing: -.025em;
      }
      html.design-studio :is(main h2, main h3, main h4, .test-sidebar-brand h1, .test-sidebar-brand .brand-heading) { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; }
      .test-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 31;
        display: flex;
        flex-direction: column;
        gap: .9rem;
        width: 246px;
        padding: 1rem .85rem;
        overflow-y: auto;
        background: linear-gradient(180deg, var(--sidebar-bg-top, #f8f9fb) 0%, var(--sidebar-bg-bottom, #f1f4f8) 100%);
        border-right: 1px solid var(--sidebar-border, #dde3ec);
        box-shadow: none;
      }
      .test-sidebar-brand {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .42rem;
        width: 100%;
        padding: .85rem .55rem .8rem 1.05rem;
        margin-bottom: .2rem;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 10px;
        box-shadow: none;
        text-align: left;
        cursor: pointer;
        transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
      }
      .test-sidebar-brand:hover {
        background: color-mix(in srgb, var(--brand) 7%, transparent);
      }
      .test-sidebar-brand:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 2px;
      }
      .test-sidebar-brand::before {
        content: none;
      }
      html.design-studio.theme-dark .test-sidebar-brand {
        background: transparent;
        box-shadow: none;
      }
      html.design-studio.theme-dark .test-sidebar-brand:hover {
        background: color-mix(in srgb, var(--brand) 16%, transparent);
      }
      .test-sidebar-brand :is(h1, .brand-heading) { font-family: "Segoe UI", system-ui, sans-serif; font-size: 1.32rem; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; color: var(--studio-text); margin: 0; transition: color .15s ease; }
      .test-sidebar-brand:hover :is(h1, .brand-heading) { color: var(--brand-deep); }
      html.design-studio.theme-dark .test-sidebar-brand :is(h1, .brand-heading) { color: var(--ink); }
      html.design-studio.theme-dark .test-sidebar-brand:hover :is(h1, .brand-heading) { color: #ffffff; }
      .test-sidebar-brand :is(span:not(.brand-heading), .brand-year) { align-self: flex-end; padding: .16rem .52rem; border: 1px solid var(--studio-border-strong); border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
      .test-sidebar-sections { display: flex; flex-direction: column; gap: .75rem; }
      .test-sidebar-section { min-width: 0; padding-bottom: .7rem; border-bottom: 1px solid rgba(148, 163, 184, 0.28); }
      .test-sidebar-label { padding: 0 .55rem; margin: 0 0 .35rem; color: var(--studio-text-muted); font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
      .test-sidebar-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; margin-bottom: .35rem; }
      .test-sidebar-heading .test-sidebar-label { flex: 0 0 100%; margin-bottom: 0; padding: 0 .55rem; font-size: .72rem; }
      .test-single-group, .test-sidebar #headerGroupSelect { min-width: 0; flex: 1 1 auto; font-size: .75rem; font-weight: 600; color: var(--studio-text); }
      .test-single-group {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        background: transparent;
        border: 1px solid transparent;
        padding: .16rem .35rem;
        border-radius: 7px;
        text-align: left;
        cursor: default;
      }
      .test-single-group.is-create-trigger {
        color: var(--brand-deep);
        background: var(--brand-soft);
        border-color: var(--studio-border-strong);
        font-size: .72rem;
        font-weight: 700;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease;
      }
      .test-single-group.is-create-trigger:hover {
        border-color: var(--brand);
      }
      html.design-studio.theme-dark .test-single-group.is-create-trigger {
        color: #f1f5f9;
        background: rgba(99, 102, 241, 0.16);
        border-color: rgba(129, 140, 248, 0.42);
      }
      html.design-studio.theme-dark .test-single-group.is-create-trigger:hover {
        background: rgba(99, 102, 241, 0.26);
      }
      .test-sidebar #headerGroupSelect { width: 0; min-height: 2.35rem; padding: .5rem .65rem; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--studio-text-muted); font-size: .81rem; font-weight: 600; cursor: pointer; }
      .test-sidebar #headerGroupSelect:hover { background: var(--studio-surface-soft); }
      .test-sidebar #headerGroupSelect:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      .test-group-actions { position: relative; flex: 0 0 auto; }
      .test-group-actions.hidden, .test-single-group.hidden, .test-sidebar #headerGroupSelect.hidden { display: none; }
      #btnSidebarGroupMenu { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--studio-text-muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
      #btnSidebarGroupMenu:hover, #btnSidebarGroupMenu[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand-deep); }
      .test-group-menu { position: absolute; z-index: 20; top: calc(100% + .25rem); right: 0; min-width: 180px; padding: .3rem; border: 1px solid var(--studio-border); border-radius: 10px; background: var(--studio-surface); box-shadow: 0 8px 24px rgba(15, 23, 42, .16); }
      .test-group-menu.hidden { display: none; }
      .test-group-menu button { display: block; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 7px; background: transparent; color: var(--studio-text); font-size: .82rem; font-weight: 600; text-align: left; cursor: pointer; }
      .test-group-menu button:hover { background: var(--studio-surface-soft); }
      .test-sidebar-nav { display: flex; flex-direction: column; gap: .2rem; }
      .test-sidebar-section > .test-sidebar-nav + .test-sidebar-nav { margin-top: .4rem; }
      .sidebar-legacy-group { display: none; }
      .sidebar-active-group { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--studio-text-muted); font-size: .73rem; }
      .sidebar-choice-menu { position: fixed; z-index: 100; width: min(220px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: .3rem; border: 1px solid var(--studio-border); border-radius: 10px; background: var(--studio-surface); box-shadow: 0 8px 24px rgba(15, 23, 42, .2); }
      .sidebar-choice-menu.hidden { display: none; }
      .sidebar-choice-menu button { display: block; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 7px; background: transparent; color: var(--studio-text); font-size: .82rem; text-align: left; cursor: pointer; }
      .sidebar-choice-menu button:hover, .sidebar-choice-menu button:focus-visible { background: var(--brand-soft); color: var(--brand-deep); }
      .sidebar-choice-menu button[aria-checked="true"] { font-weight: 800; color: var(--brand-deep); }
      .sidebar-choice-menu button[aria-checked="true"]::after { content: ' \2713'; }
      #settingsPanel .sp-swatch[data-palette-val="azur"] { display: none; }
      .test-sidebar-nav > :is(button, a),
      html.design-studio #subjectTabsContainer > button {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        width: 100% !important;
        min-height: 2.35rem !important;
        padding: .5rem .65rem !important;
        border: 1px solid transparent !important;
        border-radius: 8px !important;
        background: transparent !important;
        color: var(--studio-text-muted) !important;
        box-shadow: none !important;
        font-size: .81rem !important;
        font-weight: 600 !important;
        text-align: left !important;
        transform: none !important;
      }
      html.design-studio .test-sidebar-nav > :is(button, a),
      html.design-studio #subjectTabsContainer > button {
        transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
      }
      .test-sidebar-nav > :is(button, a):hover,
      html.design-studio #subjectTabsContainer > button:hover { background: rgba(255, 255, 255, 0.78) !important; color: var(--studio-text) !important; }
      html.design-studio.theme-dark .test-sidebar-nav > :is(button, a):hover,
      html.design-studio.theme-dark #subjectTabsContainer > button:hover { background: var(--studio-surface-soft) !important; }
      html.design-studio .test-sidebar-nav > :is(button, a):hover,
      html.design-studio #subjectTabsContainer > button:hover { transform: translateX(2px) !important; }
      .test-sidebar-nav > button.bg-indigo-500,
      .test-sidebar-nav > button.bg-indigo-600,
      .test-sidebar-nav > button.bg-amber-400,
      html.design-studio #subjectTabsContainer > button[aria-pressed="true"],
      html.design-studio .test-sidebar-nav > button[aria-pressed="true"] {
        background: #ffffff !important;
        color: var(--brand-deep) !important;
        border-color: #d0d7e2 !important;
        box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06), inset 3px 0 0 var(--brand) !important;
        font-weight: 800 !important;
      }
      html.design-studio.theme-dark .test-sidebar-nav > button.bg-indigo-500,
      html.design-studio.theme-dark .test-sidebar-nav > button.bg-indigo-600,
      html.design-studio.theme-dark .test-sidebar-nav > button.bg-amber-400,
      html.design-studio.theme-dark #subjectTabsContainer > button[aria-pressed="true"],
      html.design-studio.theme-dark .test-sidebar-nav > button[aria-pressed="true"] {
        background: var(--brand-soft) !important;
        border-color: transparent !important;
      }
      html.design-studio #subjectTabsContainer > button[aria-expanded="true"]:not([aria-pressed="true"]) { background: var(--studio-surface-soft) !important; color: var(--studio-text) !important; }
      html.design-studio .test-sidebar button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      #headerStudentCount { margin-left: auto; background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      .test-sidebar .subject-icon { flex: 0 0 1rem; width: 1rem; height: 1rem; color: var(--brand); }
      html.design-studio .test-sidebar-nav > :is(button, a) { gap: .5rem !important; }
      html.design-studio .test-sidebar-nav > :is(button, a) > svg { flex: 0 0 auto; color: var(--brand) !important; }
      .test-sidebar #subjectTabsContainer { display: flex !important; flex-direction: column; align-items: stretch !important; gap: .2rem !important; }
      .test-subject-empty { width: 100%; padding: .25rem .55rem; color: #94a3b8; font-size: .81rem; font-weight: 400; text-align: center; }
      .test-subject-empty.hidden, .test-sidebar-nav.is-unavailable { display: none; }
      html.design-studio.theme-dark .test-subject-empty { color: #9aa2ad; }
      .test-sidebar #subjectTabsContainer button span { white-space: normal; }
      .test-sidebar #subjectTabsContainer > button[data-subject-id="ccq_global"] span { white-space: nowrap; }
      html.design-studio .test-sidebar #subjectSubTabsContainer {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: .2rem;
        margin: .15rem 0 .45rem .85rem !important;
        padding: .2rem .2rem .2rem .3rem !important;
        border: 0 !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
      }
      html.design-studio .test-sidebar #subjectSubTabsContainer.hidden { display: none !important; }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button {
        display: flex;
        align-items: center;
        gap: .45rem;
        width: 100%;
        justify-content: flex-start;
        min-height: 1.75rem !important;
        padding: .3rem .45rem !important;
        border: 1px solid transparent !important;
        border-radius: 6px !important;
        background: transparent !important;
        color: var(--studio-text-muted) !important;
        font-size: .82rem !important;
        text-align: left;
      }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button::before { content: ""; flex: 0 0 .25rem; width: .25rem; height: .25rem; border-radius: 50%; background: currentColor; opacity: .5; }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button[data-subject-id="art_dram_c1c2"] { white-space: nowrap; font-size: .76rem !important; }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button[aria-pressed="true"]::before { opacity: 1; }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button:hover { background: var(--studio-surface-soft) !important; color: var(--studio-text) !important; }
      html.design-studio .test-sidebar #subjectSubTabsContainer > button[aria-pressed="true"] { background: var(--brand-soft) !important; color: var(--brand-deep) !important; border-color: transparent !important; font-weight: 800; }
      .test-sidebar #subjectSubTabsContainer:not(.hidden) { animation: sidebarIndexIn .2s ease-out both; }
      .test-sidebar #subjectSubTabsContainer > button { transition: background-color .15s ease, color .15s ease, transform .15s ease; }
      .test-sidebar #subjectSubTabsContainer > button:hover { transform: translateX(2px); }
      .test-sidebar #subjectSubTabsContainer > button:nth-of-type(2) { animation-delay: .025s; }
      .test-sidebar #subjectSubTabsContainer > button:nth-of-type(3) { animation-delay: .05s; }
      .test-sidebar #subjectSubTabsContainer > button:nth-of-type(4) { animation-delay: .075s; }
      .test-sidebar-footer { margin-top: auto; }
      .test-sidebar-footer :is(button, a) { gap: .5rem; }
      .test-sidebar-footer .sidebar-privacy-link { margin-top: .25rem; padding-top: .45rem; border-top: 1px solid var(--studio-sidebar-line); font-size: .68rem; opacity: .72; }
      .test-sidebar-footer .sidebar-privacy-link:hover { opacity: 1; }
      .backup-save-options { display: grid; gap: .65rem; margin: 1rem 0; }
      .backup-save-option { display: grid; gap: .25rem; padding: .9rem 1rem; border: 1px solid var(--studio-border-strong); border-radius: 12px; background: var(--studio-surface-soft); color: var(--studio-text); text-align: left; cursor: pointer; }
      .backup-save-option:hover { border-color: var(--brand); background: var(--brand-soft); }
      .backup-save-option strong { font-size: .95rem; }
      .backup-save-option span { color: var(--studio-text-muted); font-size: .8rem; line-height: 1.45; }
      .privacy-policy-dialog { width: min(900px, calc(100vw - 2rem)); height: min(780px, calc(100dvh - 2rem)); padding: 0; overflow: hidden; border: 1px solid var(--studio-border); border-radius: 16px; background: var(--studio-surface); color: var(--studio-text); box-shadow: var(--studio-shadow-md); }
      .privacy-policy-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 58px; padding: 0 1rem; border-bottom: 1px solid var(--studio-border); }
      .privacy-policy-heading h2 { font-size: 1rem; font-weight: 800; }
      .privacy-policy-dialog iframe { width: 100%; height: calc(100% - 58px); border: 0; background: #fff; }
      html.design-studio header.test-topbar {
        width: calc(100% - 246px);
        margin-left: 246px;
        background: var(--sidebar-bg-top, #f8f9fb) !important;
        color: var(--studio-text) !important;
        border-bottom: 1px solid var(--sidebar-border, #dde3ec) !important;
        box-shadow: none !important;
        z-index: 32 !important;
      }
      /* Masque la bordure droite de la barre latérale à côté de la barre du haut pour former un seul encadré. */
      html.design-studio header.test-topbar::before {
        content: "";
        position: absolute;
        top: 0;
        left: -1px;
        width: 1px;
        height: 100%;
        background: var(--sidebar-bg-top, #f8f9fb);
        pointer-events: none;
      }
      html.design-studio header.test-topbar > div:first-child {
        max-width: none;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: .55rem 1rem !important;
        padding: .65rem 1.25rem !important;
      }
      .test-topbar > div:first-child > div:first-child { flex: 0 0 auto; }
      .test-topbar > div:first-child > div:nth-child(2) { flex: 1 1 auto; flex-wrap: nowrap !important; min-width: 0; border: 0 !important; padding: 0 !important; gap: .4rem; }
      .test-topbar > div:first-child > div:nth-child(2) > div { flex: 0 0 auto; flex-wrap: nowrap !important; }
      .test-topbar > div:first-child > div:first-child > div { margin-right: 0; gap: .4rem; }
      .test-topbar .term-btn { min-height: 2rem; }
      .test-topbar .term-btn.bg-indigo-600 { background: var(--brand) !important; color: #fff !important; }
      .test-topbar .term-btn:not(.bg-indigo-600) { color: var(--studio-text-muted) !important; }
      .test-sidebar .term-btn { justify-content: flex-start !important; }
      .test-sidebar #btnNavGlobalReport.bg-amber-400 { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio #studentSearchPopover { position: relative; top: auto; left: auto; z-index: 65; display: flex; align-items: center; width: clamp(195px, 19vw, 245px); padding: 0 .45rem; border: 1px solid var(--studio-border-strong); border-radius: 8px; background: var(--studio-surface); color: var(--studio-text); box-shadow: none; }
      html.design-studio #studentSearchPopover:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
      html.design-studio #studentSearchPopover #btnStudentSearch { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--studio-text-muted); cursor: pointer; }
      #btnStudentSearch svg { width: 17px; height: 17px; }
      html.design-studio #studentSearchPopover input { min-width: 0; width: 100%; padding: .4rem .1rem; border: 0; outline: 0; background: transparent; color: var(--studio-text); font-size: .8rem; }
      #headerStudentSearch::placeholder { color: var(--studio-text-muted); opacity: .8; }
      html.design-studio .student-search-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        width: min(320px, calc(100vw - 24px));
        max-height: 300px;
        overflow-y: auto;
        z-index: 95;
        padding: 4px;
        border: 1px solid var(--studio-border);
        border-radius: 12px;
        background: var(--studio-surface);
        box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
      }
      html.design-studio .student-search-dropdown.hidden { display: none; }
      html.design-studio .student-search-option {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .6rem;
        width: 100%;
        padding: .48rem .65rem;
        border: 0;
        border-radius: 8px;
        background: transparent;
        text-align: left;
        cursor: pointer;
        transition: background-color .12s ease;
      }
      html.design-studio .student-search-option:hover,
      html.design-studio .student-search-option.is-active {
        background: var(--brand-soft);
      }
      html.design-studio .student-search-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 600;
        color: var(--studio-text);
      }
      html.design-studio .student-search-option:hover .student-search-name,
      html.design-studio .student-search-option.is-active .student-search-name {
        color: var(--brand-deep);
      }
      html.design-studio .student-search-group {
        flex: 0 1 auto;
        max-width: 48%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
        font-weight: 500;
        color: var(--studio-text-muted);
      }
      html.design-studio .student-search-empty {
        padding: .55rem .7rem;
        font-size: 12px;
        color: var(--studio-text-muted);
      }
      html.design-studio.theme-dark .student-search-dropdown {
        background: var(--surface);
        border-color: var(--line);
        box-shadow: 0 14px 34px rgba(0, 0, 0, .42);
      }
      html.design-studio.theme-dark .student-search-name { color: var(--ink); }
      html.design-studio.theme-dark .student-search-option.is-active .student-search-name,
      html.design-studio.theme-dark .student-search-option:hover .student-search-name { color: var(--brand-deep); }
      html.design-studio #studentSearchMessage:not(:empty) { position: absolute; z-index: 80; top: calc(100% + .35rem); left: 0; width: max-content; max-width: min(250px, 80vw); margin: 0; padding: .55rem .7rem; border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-surface); color: var(--studio-text-muted); box-shadow: var(--studio-shadow-sm); }
      #studentSearchMessage:empty { display: none; }
      html.design-studio .test-topbar .hdr-icobtn,
      html.design-studio .test-topbar #btnPrintView,
      html.design-studio .test-topbar #btnFullscreen,
      html.design-studio .test-topbar #btnOpenJSONDirect,
      html.design-studio .test-topbar #btnExportJSON,
      html.design-studio .test-topbar #btnExportExcel,
      html.design-studio .test-topbar #btnCloseCarnet:not(:disabled) {
        background: var(--studio-surface) !important;
        color: var(--studio-text-muted) !important;
        border: 1px solid var(--studio-border-strong) !important;
        box-shadow: none !important;
      }
      .file-sync-status { max-width: 150px; color: var(--studio-text-muted); font-size: .68rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
      .file-sync-status[data-status="error"] { color: #b91c1c; }
      html.design-studio.theme-dark .file-sync-status[data-status="error"] { color: #f2b8b5; }
      .backup-dialog { width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.3rem; border: 1px solid var(--studio-border); border-radius: 16px; background: var(--studio-surface); color: var(--studio-text); box-shadow: 0 16px 48px rgba(15, 23, 42, .25); font-size: .9rem; line-height: 1.55; }
      .backup-dialog::backdrop { background: rgba(15, 23, 42, .6); }
      .backup-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; }
      .backup-dialog-heading h2 { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
      .backup-dialog-close { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--studio-text-muted); font-size: 1.3rem; cursor: pointer; }
      .backup-dialog-close:hover { background: var(--studio-surface-soft); }
      .backup-help-content { display: grid; gap: .68rem; font-size: .86rem; line-height: 1.55; color: var(--studio-text-muted); }
      .backup-help-content p { margin: 0; }
      .backup-help-content strong { color: var(--studio-text); }
      .backup-help-content h4 { margin: .5rem 0 -.15rem; font-size: .88rem; font-weight: 800; color: var(--studio-text); }
      .backup-help-content ol { display: grid; gap: .5rem; padding-left: 1.35rem; list-style: decimal; margin: 0; }
      .backup-help-content ul { display: grid; gap: .4rem; padding-left: 1.25rem; list-style: disc; margin: 0; }
      .backup-help-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; padding: .08em .32em; border-radius: 5px; background: var(--studio-surface-soft); color: var(--studio-text); }
      .backup-help-tip { padding: .55rem .75rem; border-left: 3px solid var(--brand); border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: .81rem; font-weight: 600; }
      .backup-help-content details { margin-top: .15rem; padding: .58rem .78rem; border: 1px solid var(--studio-border); border-radius: 10px; background: var(--studio-surface-soft); }
      .backup-help-content details summary { cursor: pointer; color: var(--studio-text); }
      .backup-help-content details p { margin-top: .5rem; font-size: .82rem; }
      .backup-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
      .backup-dialog-actions button { padding: .55rem .85rem; border-radius: 8px; font-size: .85rem; font-weight: 700; cursor: pointer; }
      .backup-dialog-primary { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
      .backup-dialog-secondary { border: 1px solid var(--studio-border-strong); background: var(--studio-surface); color: var(--studio-text); }
      .backup-dialog button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      .privacy-entry-note {
        display: flex;
        align-items: flex-start;
        gap: .55rem;
        margin: 0 0 .75rem;
        padding: .65rem .75rem;
        border: 1px solid var(--studio-border);
        border-radius: 8px;
        background: var(--studio-surface-soft);
        color: var(--studio-text-muted);
        font-size: .78rem;
        line-height: 1.45;
      }
      .privacy-entry-note svg {
        width: 1.05rem;
        height: 1.05rem;
        flex: 0 0 auto;
        margin-top: .08rem;
        color: var(--brand);
      }
      #backupPasswordMatch { min-height: 1.55em; margin-top: .35rem; font-size: .8rem; font-weight: 650; color: var(--studio-text-muted); }
      #backupPasswordMatch[data-state="match"] { color: var(--brand-deep); }
      #backupPasswordConfirm[aria-invalid="true"], #backupPasswordError { color: #b91c1c; }
      #backupPasswordConfirm[aria-invalid="true"] { border-color: #b91c1c; }
      html.theme-dark :is(#backupPasswordError, #backupPasswordConfirm[aria-invalid="true"]) { color: #f2b8b5; }
      #btnConfirmBackupPassword:disabled { opacity: .5; cursor: not-allowed; }
      html.design-studio #modalUnsavedObservation { z-index: 120; background-color: rgba(15, 23, 42, .6) !important; }
      html.design-studio #modalUnsavedObservation > div { background: var(--studio-surface) !important; color: var(--studio-text) !important; border-color: var(--studio-border) !important; box-shadow: 0 16px 48px rgba(15, 23, 42, .25) !important; }
      html.design-studio #modalUnsavedObservation #unsavedObservationTitle { color: var(--studio-text) !important; }
      html.design-studio #modalUnsavedObservation #unsavedObservationMessage { color: var(--studio-text-muted) !important; }
      html.design-studio #modalUnsavedObservation [aria-hidden="true"] { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio #modalUnsavedObservation #btnStayOnObservation { background: var(--studio-surface) !important; color: var(--studio-text) !important; border-color: var(--studio-border-strong) !important; }
      html.design-studio #modalUnsavedObservation #btnStayOnObservation:hover { background: var(--studio-surface-soft) !important; }
      html.design-studio #modalUnsavedObservation #btnLeaveObservation { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
      html.design-studio #modalUnsavedObservation #btnLeaveObservation:hover { background: var(--brand-deep) !important; }
      html.design-studio #modalUnsavedObservation button:focus-visible { outline: 2px solid var(--brand) !important; outline-offset: 2px; }
      html.design-studio .test-topbar :is(button, label, a):hover:not(:disabled) { border-color: var(--brand) !important; }
      .feedback-link { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; }
      html.design-studio .test-topbar #btnExportExcel svg { color: var(--brand); }
      html.design-studio .test-topbar .test-old-subject-bar { display: none; }
      html.design-studio main.site-layout {
        width: calc(100% - 246px);
        max-width: none;
        margin: 0 0 0 246px;
        padding: 1.75rem 1.5rem 3rem !important;
      }
      html.design-studio main #subjectSubTabsContainer {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .4rem;
        margin: 0 0 1rem !important;
        padding: .5rem .7rem !important;
        border-radius: 12px !important;
        background: var(--studio-surface) !important;
        border: 1px solid var(--studio-border) !important;
      }
      html.design-studio main #subjectSubTabsContainer.hidden { display: none; }
      html.design-studio main #subjectSubTabsContainer > button { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; border: 1px solid var(--studio-border-strong) !important; }
      html.design-studio main #subjectSubTabsContainer > button[aria-pressed="true"] { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
      html.design-studio :is(.gradebook-toolbar, .global-report-toolbar, .student-manager-card, .studio-hero-card, #emptyRosterNotice:not(.hidden)) {
        background: var(--studio-surface) !important;
        border-color: var(--studio-border) !important;
        border-radius: 16px !important;
        box-shadow: var(--studio-shadow-sm) !important;
      }
      html.design-studio .gradebook-toolbar { position: relative !important; z-index: 25 !important; padding: 1.15rem 1.25rem !important; grid-template-rows: auto auto; overflow: visible !important; }
      html.design-studio .gradebook-toolbar:has(#newEvaluationChoices:not(.hidden)) { z-index: 35 !important; }
      #studentListTools[hidden] { display: none !important; }
      .no-group-notice:not(.hidden) { padding: .7rem .8rem; border-radius: 8px; background: var(--studio-surface-soft); color: var(--studio-text-muted); font-size: .85rem; line-height: 1.45; }
      html.design-studio .gradebook-toolbar h2 { white-space: normal; overflow: visible; }
      html.design-studio .gradebook-toolbar > div:nth-of-type(2) { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible !important; }
      .new-eval-popover-wrap { position: relative; display: inline-flex; align-items: center; }
      html.design-studio #btnNewEvaluation {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        background: var(--brand-soft);
        color: var(--brand-deep);
        border: 1px solid var(--studio-border-strong);
      }
      html.design-studio #btnNewEvaluation:hover {
        background: var(--studio-surface-soft);
        color: var(--studio-text);
      }
      html.design-studio .new-evaluation-choices:not(.hidden) {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 85;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        min-width: 245px;
        padding: .4rem;
        background: var(--studio-surface);
        border: 1px solid var(--studio-border-strong);
        border-radius: 12px;
        box-shadow: 0 12px 32px -4px rgba(15, 23, 42, .18), 0 4px 12px -2px rgba(15, 23, 42, .08);
        animation: pickerIn .14s ease-out both;
      }
      html.design-studio #newEvaluationChoices > button {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        padding: .5rem .75rem;
        border: 1px solid var(--studio-border);
        border-radius: 8px;
        background: var(--studio-surface-soft) !important;
        color: var(--studio-text) !important;
        box-shadow: none !important;
        font-size: .78rem;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
      }
      html.design-studio #newEvaluationChoices > button:hover { background: var(--brand-soft) !important; color: var(--brand-deep) !important; border-color: var(--brand); }
      html.design-studio.theme-dark #newEvaluationChoices > button:hover { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio #newEvaluationChoices > button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      html.design-studio :is(#groupBar > button.bg-indigo-600, #btnAddStudent) { border: 1px solid var(--studio-border-strong); background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio :is(#groupBar > button.bg-indigo-600, #btnAddStudent):hover { background: var(--brand-soft) !important; border-color: var(--brand); }
      html.design-studio.theme-dark :is(#groupBar > button.bg-indigo-600, #btnAddStudent):hover { background: var(--brand-soft) !important; }
      html.design-studio :is(#groupBar > button.bg-indigo-600, #btnAddStudent):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      html.design-studio #btnCommitObsSessionToGradebook { background: var(--brand); color: #fff; }
      html.design-studio #btnCommitObsSessionToGradebook:hover { background: var(--brand-deep); }
      html.design-studio #viewQuickObs > div { border-color: var(--studio-border); box-shadow: var(--studio-shadow-sm); }
      html.design-studio #viewQuickObs :is(.test-trace-save-bar, #qoLinkedPartsBox, #observationPrintGrid > div:first-child, #qoQuickTags) {
        background: var(--studio-surface-soft) !important;
        border-color: var(--studio-border) !important;
      }
      html.design-studio #viewQuickObs :is(.test-trace-save-bar > div:first-child label, #qoEvaluatedCounter, #observationPrintGrid > div:first-child .text-indigo-300, #sgMajorityExplanation) { color: var(--studio-text-muted) !important; }
      html.design-studio #viewQuickObs #sgCurrentStudentName { color: var(--studio-text) !important; }
      html.design-studio #viewQuickObs #qoEvaluatedCounter { background: var(--studio-surface) !important; border-color: var(--studio-border) !important; }
      html.design-studio #viewQuickObs :is(#btnPrintSubjectGrid, #btnClearCurrentStudentObs) { background: var(--studio-surface) !important; color: var(--studio-text-muted) !important; border-color: var(--studio-border-strong) !important; }
      html.design-studio #viewQuickObs :is(#btnPrintSubjectGrid, #btnClearCurrentStudentObs):hover { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio #qoCategoryTabs button.bg-slate-900 { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio #qoCategoryTabs button:not(.bg-slate-900) { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      html.design-studio #viewQuickObs .rubric-matrix-table thead th { color: var(--studio-text-muted) !important; }
      html.design-studio #viewQuickObs .rubric-matrix-table thead th:not(:nth-child(2)) { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      html.design-studio #viewQuickObs .rubric-matrix-table thead th:not(:nth-child(2)) .font-extrabold { color: var(--studio-text-muted) !important; }
      html.design-studio #viewQuickObs .rubric-stmt-btn[aria-pressed="true"] { background: var(--brand-soft) !important; color: var(--brand-deep) !important; border-color: var(--studio-border-strong) !important; box-shadow: none !important; }
      html.design-studio #viewQuickObs .rubric-stmt-btn[aria-pressed="true"] .rubric-stmt-check { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
      html.design-studio #viewQuickObs .grade-pill-selected { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft), var(--studio-shadow-sm); }
      html.design-studio #viewQuickObs :is(input:not([type="checkbox"]), textarea):focus { border-color: var(--brand) !important; --tw-ring-color: var(--brand-soft) !important; }
      html.design-studio #viewQuickObs .ring-indigo-500 { --tw-ring-color: var(--brand) !important; }
      html.design-studio :is(#kpiClassAverage, #btnWeightMode) { color: var(--brand-deep) !important; }
      html.design-studio #btnWeightMode { padding: .25rem .5rem; border: 1px solid var(--studio-border-strong); border-radius: 7px; background: var(--studio-surface-soft); font-size: .7rem; font-weight: 600; text-decoration: none; cursor: pointer; }
      html.design-studio #btnWeightMode[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
      html.design-studio #btnWeightMode.is-weight-error { background: #fee2e2 !important; color: #991b1b !important; border-color: #ef4444 !important; box-shadow: 0 0 0 1px rgba(239, 68, 68, .3); }
      html.design-studio #btnWeightMode:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      html.design-studio #weightWarningBanner { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
      html.design-studio #gradebookScrollContainer thead th { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      html.design-studio #gradebookScrollContainer thead button:not(.weight-lock) { background: var(--studio-surface-soft) !important; border-color: var(--studio-border-strong) !important; color: var(--brand-deep) !important; }
      html.design-studio #gradebookScrollContainer thead button.weight-lock.is-pinned { background: #fef3c7 !important; border-color: #f59e0b !important; color: #92400e !important; box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25); }
      html.design-studio #gradebookScrollContainer thead button.weight-lock:not(.is-pinned) { background: #ffffff !important; border-color: #cbd5e1 !important; color: #475569 !important; }
      html.design-studio #gradebookScrollContainer thead button.weight-lock:hover { border-color: var(--brand) !important; }
      html.design-studio #gradebookScrollContainer thead .gb-level-seg button.is-active { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
      html.design-studio :is(#btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents, #btnResetEqualWeights, #btnUnlockAllWeights) { background: var(--studio-surface-soft) !important; color: var(--studio-text) !important; border-color: var(--studio-border-strong) !important; }
      html.design-studio :is(#btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents, #btnResetEqualWeights, #btnUnlockAllWeights):hover { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      .student-page-heading { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
      .student-page-heading h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.25; font-weight: 800; color: var(--studio-text); }
      html.design-studio #btnBackToGradebookFromStudents { padding: .5rem .75rem; border-color: var(--studio-border-strong) !important; color: var(--brand-deep) !important; box-shadow: var(--studio-shadow-sm); }
      #btnBackToGradebookFromStudents.hidden { display: none; }
      html.design-studio .bar-track-wrap { background: var(--studio-border); border-color: var(--studio-border-strong); }
      html.design-studio .bar-fill-inner { background: var(--brand); opacity: 0.78; }
      html.design-studio .bar-threshold-60 { background: var(--studio-text-muted); }
      html.design-studio main .text-indigo-950 { color: var(--brand-deep) !important; }
      html.design-studio main :is(.text-slate-700, .text-slate-600) { color: var(--studio-text-muted) !important; }
      html.design-studio main .border-indigo-200 { border-color: var(--studio-border-strong) !important; }
      html.design-studio #competencyPositioning :is(.comp-tab.is-active, .comp-card.is-level, .comp-chip.is-set, .comp-meq-legend li.is-level) { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--studio-border-strong); }
      html.design-studio #competencyPositioning > summary,
      html.design-studio #viewGlobalReport .gr-results-heading { background-color: var(--studio-surface-soft) !important; border-color: var(--studio-border) !important; }
      html.design-studio #competencyPositioning :is(.comp-subtab.is-active, .comp-termtab.is-active, .comp-meter-cell.is-level, .comp-meq-btn.is-level, .comp-badge) {
        background: var(--brand-soft);
        color: var(--brand-deep);
        border-color: var(--brand);
      }
      html.design-studio #competencyPositioning .comp-subtab.is-active { box-shadow: inset 0 -2px 0 var(--brand); }
      html.design-studio #competencyPositioning .comp-subtab.is-active b { color: inherit; }
      html.design-studio #competencyPositioning :is(.comp-result, .comp-meq-btn.is-suggested:not(.is-level)) { border-color: var(--studio-border-strong); }
      html.design-studio #competencyPositioning :is(.comp-reset, .comp-meq-auto, .comp-meq-name, .comp-refs a, .comp-meq-note a) { color: var(--brand-deep); }
      html.design-studio #competencyPositioning :is(.comp-sentence:hover, .comp-sentence.is-sibling, .comp-meter-cell.in-range, .comp-meq-btn:hover) { background: var(--brand-soft); color: var(--brand-deep); }
      html.design-studio #competencyPositioning .comp-sentence.is-picked { background: var(--brand-soft); color: var(--brand-deep); box-shadow: inset 0 -2px 0 var(--brand); }
      html.design-studio #gradebookScrollContainer { --gradebook-student-width: 216px; border-radius: 12px !important; }
      html.design-studio #gradebookScrollContainer table { table-layout: fixed; }
      #gradebookScrollContainer .comment-cell-wrap,
      #gradebookScrollContainer .comment-cell-wrap input { min-width: 0; }
      .gb-subject-icon { width: 1.25rem; height: 1.25rem; flex: none; color: var(--brand); }
      html.design-studio #gradebookScrollContainer .weight-input { width: 2.5rem; }
      html.design-studio #gradebookScrollContainer .weight-tools { flex-wrap: wrap; justify-content: center; }
      .gradebook-top-scroll { display: none; overflow-x: auto; overflow-y: hidden; height: 14px; background: var(--studio-surface-soft); border-bottom: 1px solid var(--studio-border); }
      .gradebook-top-scroll.is-visible { display: block; }
      .gradebook-top-scroll > div { height: 1px; }
      #gradebookFrame { width: fit-content; max-width: 100%; }
      #settingsPanel .sp-text-size { display: grid; grid-template-columns: 1fr auto; }
      #settingsPanel .sp-text-size input { grid-column: 1 / -1; grid-row: 2; width: 100%; accent-color: var(--brand); }
      #settingsPanel .sp-text-size output { color: var(--studio-text-muted); }
      #settingsPanel #btnUnlinkJSON:disabled { background: var(--studio-surface-soft); color: var(--studio-text-muted); opacity: .7; cursor: not-allowed; }
      html.design-studio #gradebookHeaderRow > th:first-child { z-index: 20; }
      html.design-studio #gradebookBody tr > td:first-child { background: var(--studio-surface) !important; }
      html.design-studio #gradebookBody tr:nth-child(even) > td:first-child { background: var(--studio-surface-soft) !important; }
      html.design-studio #gradebookBody tr:hover > td:first-child { background: var(--brand-soft) !important; }
      html.design-studio .linked-grade-warning { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fef3c7; color: #92400e; font-weight: 800; }
      html.design-studio .gr-weight-label { color: var(--studio-text); font-size: .75rem; font-weight: 700; }
      html.design-studio .comp-recap-print { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border: 1px solid var(--studio-border); border-radius: 7px; background: var(--studio-surface); color: var(--brand-deep); cursor: pointer; }
      html.design-studio .comp-recap-print:hover { background: var(--brand-soft); border-color: var(--brand); }
      html.design-studio .comp-recap-print svg { width: .9rem; height: .9rem; }
      html.design-studio #competencyPositioning .comp-card-summary::-webkit-details-marker { display: none; }
      html.design-studio #competencyPositioning[open] .comp-toggle-label-closed,
      html.design-studio #competencyPositioning:not([open]) .comp-toggle-label-open { display: none; }
      html.design-studio #competencyPositioning .comp-summary-strip {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .4rem;
        width: 100%;
        padding-top: .55rem;
        border-top: 1px solid var(--studio-border);
      }
      html.design-studio #competencyPositioning .comp-chip {
        display: inline-flex;
        align-items: center;
        gap: .28rem;
        padding: .2rem .58rem;
        border-radius: 999px;
        font-size: .74rem;
        background: var(--brand-soft);
        color: var(--brand-deep);
        border: 1px solid var(--studio-border-strong);
      }
      html.design-studio #competencyPositioning .comp-chip b { font-weight: 800; }
      html.design-studio #competencyPositioning .comp-chip-meq { color: inherit; opacity: .9; }
      html.design-studio #competencyPositioning .comp-summary-empty { font-size: .75rem; color: var(--studio-text-muted); font-weight: 500; }
      html.design-studio .gr-identity-main { display: flex; flex: 1 1 220px; flex-direction: column; gap: .45rem; }
      html.design-studio .gr-identity-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
      html.design-studio .gr-grade-meta { font-size: .8rem; color: var(--studio-text-muted); }
      html.design-studio .gr-grade-meta strong { color: var(--studio-text); }
      html.design-studio .gr-adaptations-row { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; }
      html.design-studio .gr-adapt-pill {
        display: inline-flex;
        align-items: center;
        padding: .16rem .56rem;
        border-radius: 999px;
        font-size: .72rem;
        font-weight: 600;
        background: var(--brand-soft);
        color: var(--brand-deep);
        border: 1px solid var(--studio-border-strong);
      }
      html.design-studio .gr-mod-pill {
        display: inline-flex;
        align-items: center;
        padding: .2rem .58rem;
        border-radius: 10px;
        font-size: .72rem;
        line-height: 1.35;
        font-weight: 600;
        background: #fbf4df;
        color: #765315;
        border: 1px solid #dfcd9a;
      }
      html.design-studio .gr-mod-pill--compact { flex-shrink: 0; margin-left: .35rem; padding: .12rem .4rem; border-radius: 6px; font-size: .65rem; font-weight: 700; }
      html.design-studio .gr-adapt-empty { font-size: .75rem; color: var(--studio-text-muted); font-style: italic; }
      html.design-studio .student-options-bar { margin-top: .22rem; }
      html.design-studio .student-option-btn {
        display: inline-flex;
        align-items: center;
        gap: .38rem;
        padding: .28rem .65rem;
        border-radius: 8px;
        border: 1px solid var(--studio-border-strong);
        background: var(--studio-surface-soft);
        color: var(--studio-text-muted);
        font-size: .74rem;
        font-weight: 600;
        cursor: pointer;
        transition: background .14s ease, border-color .14s ease, color .14s ease;
      }
      html.design-studio .student-option-btn:hover { border-color: var(--brand); color: var(--studio-text); }
      html.design-studio .student-option-btn.is-open { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
      html.design-studio .student-option-btn.btn-student-adapt.is-active {
        background: var(--brand-soft);
        border-color: var(--brand);
        color: var(--brand-deep);
        font-weight: 700;
      }
      html.design-studio .student-option-btn.btn-student-mod.is-active {
        background: #fef3c7;
        border-color: #d97706;
        color: #92400e;
        font-weight: 700;
      }
      html.design-studio .student-option-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.12rem;
        height: 1.12rem;
        padding: 0 .3rem;
        border-radius: 999px;
        background: var(--brand);
        color: #fff;
        font-size: .66rem;
        font-weight: 800;
        line-height: 1;
      }
      html.design-studio .student-option-btn.btn-student-mod.is-active .student-option-count {
        background: #b45309;
      }
      html.design-studio .student-adapt-drawer {
        margin-top: .28rem;
        padding: .48rem .6rem;
        border-radius: 10px;
        background: var(--studio-surface-soft);
        border: 1px solid var(--studio-border-strong);
        box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
      }
      html.design-studio .student-adapt-pill {
        padding: .24rem .58rem;
        border-radius: 999px;
        font-size: .73rem;
        font-weight: 600;
        border: 1px solid var(--studio-border);
        background: var(--studio-surface);
        color: var(--studio-text-muted);
        cursor: pointer;
        transition: all .12s ease;
      }
      html.design-studio .student-adapt-pill:hover { border-color: var(--brand); color: var(--studio-text); }
      html.design-studio .student-adapt-pill.is-active {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
        font-weight: 700;
      }
      html.design-studio .student-adapt-custom {
        width: 10.5rem;
        padding: .24rem .55rem;
        border-radius: 8px;
        font-size: .74rem;
      }
      html.design-studio .gr-results-scroll { overflow-x: auto; }
      html.design-studio .gr-results-scroll table { min-width: 650px; }
      html.design-studio #viewGlobalReport .gr-results-scroll thead th { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      html.design-studio #viewGlobalReport .trend-badge { background: var(--studio-surface-soft); color: var(--studio-text-muted); border-color: var(--studio-border); }
      html.design-studio .gr-average-row { color: var(--studio-text-muted); background: var(--studio-surface-soft); font-size: .68rem; }
      html.design-studio .gr-average-row :is(th, td) { padding: .55rem .5rem; border-top: 1px solid var(--studio-border); }
      html.design-studio .gr-average-row td { text-align: center; }
      html.design-studio .gr-teacher-comment { display: block; width: 100%; min-height: 7rem; resize: vertical; padding: .65rem; border: 1px solid var(--studio-border-strong); border-radius: 9px; background: var(--studio-surface); color: var(--studio-text); line-height: 1.5; }
      html.design-studio .gr-teacher-comment:focus { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: none; }
      #modalAddAssignment > div { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; }
      html.design-studio #competencyPositioning :is(.comp-recap-title, .comp-refs-title, .comp-card-head, .comp-card-text, .comp-result-label, .comp-result-note, .comp-end, .comp-meq-label, .comp-meq-body, .comp-meq-why, .comp-meq-quote, .comp-meq-note) { color: var(--studio-text-muted); }
      html.design-studio #competencyPositioning :is(.comp-tab:not(.is-active), .comp-subtab:not(.is-active), .comp-sentence:not(.is-picked):not(.is-sibling)) { color: var(--studio-text); }
      html.design-studio #competencyPositioning .comp-scale.has-picks .comp-sentence:not(.is-picked):not(.is-locked):not(.is-sibling):not(:hover) { color: #53647a; }
      html.design-studio #competencyPositioning .comp-scale.has-picks .comp-sentence.is-locked:not(.is-picked) { background: #f1f5f9; color: #5b6b80; box-shadow: none; }
      .gr-teacher-comment-print { display: none; }
      html.design-studio .custom-scrollbar { scrollbar-color: #64748b #e2e8f0; scrollbar-width: auto; }
      html.design-studio .custom-scrollbar::-webkit-scrollbar { height: 13px; width: 10px; }
      html.design-studio .custom-scrollbar::-webkit-scrollbar-track { background: #e2e8f0; border: 1px solid #cbd5e1; border-radius: 999px; }
      html.design-studio .custom-scrollbar::-webkit-scrollbar-thumb { min-width: 46px; background: #64748b; border: 2px solid #e2e8f0; border-radius: 999px; }
      html.design-studio .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--brand); }
      html.design-studio.theme-dark .custom-scrollbar { scrollbar-color: #8b9bb3 #292a2d; }
      html.design-studio.theme-dark .custom-scrollbar::-webkit-scrollbar-track { background: #292a2d; border-color: #444746; }
      html.design-studio.theme-dark .custom-scrollbar::-webkit-scrollbar-thumb { background: #8b9bb3; border-color: #292a2d; }
      html.design-studio.theme-dark .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--brand); }
      html.design-studio #viewQuickObs .rubric-matrix-table { min-width: 720px; }
      html.design-studio #viewQuickObs:not(.hidden) { grid-template-columns: minmax(0, 1fr); }
      html.design-studio #viewQuickObs .rubric-matrix-table th,
      html.design-studio #viewQuickObs .rubric-matrix-table td { padding: 0.28rem; }
      html.design-studio #viewQuickObs .rubric-stmt-btn { padding: 0.35rem 0.4rem; font-size: 11px; line-height: 1.35; }
      html.design-studio #viewQuickObs .rubric-stmt-text { overflow-wrap: break-word; word-break: normal; hyphens: none; line-height: 1.36; }
      html.design-studio #qoTargetLevelsBox .qo-target-wrap { background: var(--studio-surface) !important; border-color: var(--studio-border) !important; }
      html.design-studio #qoTargetLevelsBox .qo-target-btn:not(.is-active) { background: var(--studio-surface-soft) !important; border-color: var(--studio-border) !important; color: var(--studio-text-muted) !important; }
      html.design-studio #qoTargetLevelsBox .qo-target-btn.is-active { background: var(--brand) !important; border-color: var(--brand) !important; color: #ffffff !important; }
      html.design-studio #qoModeSegment button[aria-pressed="true"],
      html.design-studio #qoWeightPresetBar button[aria-pressed="true"],
      html.design-studio #qoQuickTags button.bg-indigo-600 { background: var(--brand) !important; border-color: var(--brand) !important; color: #ffffff !important; }
      html.design-studio #qoSidePanel #qoBottomStudentName { color: var(--brand-deep) !important; }
      html.design-studio #qoSidePanel #btnQoResetOverride { color: var(--brand-deep) !important; }
      html.design-studio .qo-trace-linked-row { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--studio-border); }
      html.design-studio .qo-trace-linked-row.hidden { display: none; }
      html.design-studio .qo-rubric-toolbar { overflow: hidden; border: 1px solid var(--studio-border); border-radius: 11px; background: var(--studio-surface-soft); }
      html.design-studio .qo-rubric-toolbar .qo-rubric-summary { border-radius: 0; }
      html.design-studio .qo-rubric-toolbar #qoToolModeBar { border: 0 !important; border-top: 1px solid var(--studio-border) !important; border-radius: 0; }
      html.design-studio .qo-help-note { margin: 0; color: var(--studio-text-muted) !important; font-size: .68rem; font-style: italic; line-height: 1.45; opacity: .84; }
      html.design-studio .qo-selected-tag-count { color: var(--brand-deep); font-size: .72rem; font-weight: 700; }
      .qo-observations { display: grid; gap: .75rem; }
      .qo-observations-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; color: var(--studio-text-muted); font-size: .75rem; }
      .qo-observations-intro span { color: var(--brand-deep); font-weight: 700; }
      .qo-category-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
      .qo-category { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-surface-soft); color: var(--studio-text-muted); font-size: .74rem; font-weight: 650; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
      .qo-category:hover, .qo-category[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
      .qo-category:focus-visible, .qo-choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
      .qo-category-count { padding: .05rem .35rem; border-radius: 99px; background: var(--brand); color: #fff; font-size: .65rem; }
      .qo-observation-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
      .qo-choice-column { min-width: 0; display: grid; align-content: start; gap: .35rem; padding: .65rem; border: 1px solid var(--studio-border); border-radius: 10px; background: var(--studio-surface-soft); }
      .qo-choice-column legend { padding: 0 .25rem; color: var(--brand-deep); font-size: .78rem; font-weight: 800; }
      .qo-choice { display: flex; align-items: flex-start; gap: .55rem; padding: .45rem .55rem; border: 1px solid transparent; border-radius: 7px; color: var(--studio-text); font-size: .76rem; line-height: 1.4; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
      .qo-choice:hover, .qo-choice:has(input:checked) { border-color: var(--studio-border-strong); background: var(--brand-soft); }
      .qo-choice input { flex: 0 0 auto; margin-top: .16rem; accent-color: var(--brand); }
      .qo-selected-observations { display: grid; gap: .35rem; color: var(--studio-text-muted); font-size: .7rem; }
      .qo-selected-chip { display: inline-flex; align-items: center; gap: .35rem; margin: .15rem .25rem .15rem 0; padding: .2rem .4rem; border: 1px solid var(--studio-border); border-radius: 6px; background: var(--studio-surface-soft); color: var(--studio-text); }
      .qo-selected-chip button { color: var(--brand-deep); font-size: .9rem; font-weight: 700; cursor: pointer; }
      .qo-observation-source { color: var(--studio-text-muted); font-size: .68rem; line-height: 1.45; }
      .qo-observation-source a { color: var(--brand-deep); text-decoration: underline; }
      .qo-previous-written { color: var(--studio-text-muted); font-size: .75rem; }
      .qo-previous-written summary { cursor: pointer; font-weight: 700; }
      .qo-previous-written label { display: block; margin-top: .5rem; font-weight: 700; }
      .qo-previous-written textarea { display: block; width: 100%; padding: .5rem; border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-surface); color: var(--studio-text); }
      @media (max-width: 600px) { .qo-observation-choices { grid-template-columns: 1fr; } }
      .cb-dialog { display: flex; flex-direction: column; gap: 1rem; width: min(1080px, 100%); height: min(740px, calc(100dvh - 2rem)); min-height: 0; padding: 1.25rem; overflow: hidden; border: 1px solid var(--studio-border); border-radius: 16px; background: var(--studio-surface); color: var(--studio-text); box-shadow: var(--studio-shadow-md); }
      .cb-heading, .cb-footer, .cb-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: .75rem; }
      .cb-heading { align-items: flex-start; padding-bottom: .75rem; border-bottom: 1px solid var(--studio-border); }
      .cb-toolbar { flex-wrap: wrap; padding: .65rem; border: 1px solid var(--studio-border); border-radius: 10px; background: var(--studio-surface-soft); }
      .cb-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; flex: 1 1 0; min-height: 0; }
      .cb-bank, .cb-editor { display: flex; flex-direction: column; gap: .65rem; min-width: 0; min-height: 0; }
      .cb-section-heading { flex: 0 0 auto; }
      .cb-section-heading h4 { font-size: .82rem; font-weight: 800; }
      .cb-section-heading p { margin-top: .2rem; font-size: .72rem; color: var(--studio-text-muted); }
      .cb-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: .65rem; min-height: 0; overflow-y: auto; padding: .2rem .4rem .3rem .1rem; scrollbar-gutter: stable; }
      #cbTextarea { display: block; flex: 1 1 0; width: 100%; min-height: 0; padding: .8rem; resize: none; overflow-y: auto; border: 1px solid var(--studio-border-strong); border-radius: 10px; background: var(--studio-surface); color: var(--studio-text); font-size: .82rem; line-height: 1.7; }
      .cb-editor-meta { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: .5rem; color: var(--studio-text-muted); font-size: .7rem; }
      .cb-footer { flex-wrap: wrap; padding-top: .75rem; border-top: 1px solid var(--studio-border); }
      #modalCommentBank .cb-action { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .7rem; border: 1px solid var(--studio-border-strong); border-radius: 8px; background: var(--studio-surface-soft); color: var(--studio-text); font-size: .75rem; font-weight: 700; cursor: pointer; }
      #modalCommentBank .cb-action-primary { background: var(--brand-soft); color: var(--brand-deep); }
      #modalCommentBank .cb-action:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
      #modalCommentBank :is(h3, label) { color: var(--studio-text); }
      #modalCommentBank :is(#cbModalSubtitle, .cb-toolbar label) { color: var(--studio-text-muted); }
      #modalCommentBank select { min-width: 0; max-width: 100%; background: var(--studio-surface); color: var(--studio-text); border-color: var(--studio-border-strong); }
      #modalCommentBank :is(button, textarea, select):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
      html:has(#modalCommentBank:not(.hidden)), html:has(#modalCommentBank:not(.hidden)) body { overflow: hidden !important; }
      #modalCommentBank, #modalCommentBank :is(.cb-bank, #cbPhraseList, #cbTextarea) { overscroll-behavior: contain; }
      @media (max-width: 760px) {
        .cb-dialog { padding: .85rem; gap: .7rem; }
        .cb-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr); gap: .75rem; }
        .cb-toolbar > div { min-width: 0; }
        .cb-footer { gap: .4rem; }
        #modalCommentBank .cb-action { padding: .45rem .55rem; font-size: .7rem; }
      }
      @media (max-width: 480px) { .cb-choices { grid-template-columns: minmax(0, 1fr); } }
      @media (max-height: 700px) { .cb-dialog { overflow-y: auto; } .cb-body { flex: 0 0 400px; } }
      html.design-studio .modified-expectations { width: fit-content; max-width: 100%; }
      html.design-studio .modified-expectations[open] { width: min(100%, 900px); }
      html.design-studio .modified-expectations summary { white-space: nowrap; }
      html.design-studio .modified-expectations[open] summary { white-space: normal; }
      @media (max-width: 640px) {
        html.design-studio .modified-expectations summary { white-space: normal; }
      }
      html.design-studio :is([class*="bg-emerald-"], [class*="bg-green-"]) { background-color: var(--brand-soft) !important; }
      html.design-studio :is([class~="bg-emerald-500"], [class~="bg-emerald-600"], [class~="bg-green-500"], [class~="bg-green-600"]) { background-color: var(--brand) !important; }
      html.design-studio :is([class*="text-emerald-"], [class*="text-green-"]) { color: var(--brand-deep) !important; }
      html.design-studio :is([class*="border-emerald-"], [class*="border-green-"]) { border-color: var(--studio-border-strong) !important; }
      html.design-studio :is([class*="ring-emerald-"], [class*="ring-green-"]) { --tw-ring-color: var(--brand) !important; }
      html.design-studio :is([class*="accent-emerald-"], [class*="accent-green-"]) { accent-color: var(--brand) !important; }
      html.design-studio main .bg-emerald-100.text-emerald-800.border-emerald-300 { background: var(--brand-soft) !important; color: var(--brand-deep) !important; border-color: var(--studio-border-strong) !important; }
      html.design-studio #viewQuickObs .bg-emerald-400 { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
      html.design-studio .stmt-checked-A { background: var(--brand-soft) !important; border-color: var(--studio-border-strong) !important; color: var(--brand-deep) !important; box-shadow: none !important; }
      html.design-studio #toastNotification {
        background: var(--studio-surface) !important;
        border: 1px solid var(--studio-border-strong) !important;
        border-left: 4px solid var(--brand) !important;
        color: var(--studio-text) !important;
        box-shadow: var(--studio-shadow-md) !important;
      }
      html.design-studio #toastNotification.toast-entering { animation: toastIn .18s ease-out both; }
      html.design-studio #toastNotification.toast-leaving { animation: toastOut .16s ease-in both; }
      @keyframes sidebarIndexIn {
        from { opacity: 0; transform: translateY(-3px); }
        to { opacity: 1; transform: translateY(0); }
      }
      @keyframes toastIn {
        from { opacity: 0; transform: translateY(7px); }
        to { opacity: 1; transform: translateY(0); }
      }
      @keyframes toastOut {
        from { opacity: 1; transform: translateY(0); }
        to { opacity: 0; transform: translateY(4px); }
      }
      html.design-studio.theme-dark :is(#settingsPanel, #studentSearchPopover) { background: var(--surface); color: var(--ink); }
      html.design-studio.theme-dark #subjectTabsContainer > button[aria-pressed="true"] { background: var(--brand-soft) !important; color: var(--brand-deep) !important; border-color: transparent !important; }
      html.design-studio.theme-dark main #subjectSubTabsContainer { background: var(--studio-surface) !important; border-color: var(--studio-border) !important; }
      html.design-studio.theme-dark main #subjectSubTabsContainer > button { background: var(--studio-surface-soft) !important; color: var(--studio-text-muted) !important; }
      html.design-studio.theme-dark main #subjectSubTabsContainer > button[aria-pressed="true"] { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
      html.design-studio.theme-dark .test-topbar .bg-slate-800 { background: var(--studio-surface-soft) !important; }
      html.design-studio.theme-dark header.test-topbar #headerStudentCount { background: var(--brand) !important; color: #fff !important; }
      html.design-studio.theme-dark .gradebook-toolbar > div:nth-of-type(2) { background: transparent !important; }
      html.design-studio.theme-dark :is(.grade-picker-auto, .sort-btn) { background: var(--studio-surface-soft); color: var(--studio-text-muted); border-color: var(--line); }
      html.design-studio.theme-dark [id^="modal"] :is(.bg-slate-50, .bg-slate-100) { background: var(--studio-surface-soft) !important; }
      html.design-studio.theme-dark :is(main, [id^="modal"]) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { background: var(--paper) !important; color: var(--ink) !important; border-color: var(--line) !important; }
      html.design-studio.theme-dark :is(main, [id^="modal"]) :is(input, textarea)::placeholder { color: #a7aaa9; opacity: 1; }
      html.design-studio.theme-dark #gradebookBody tr:nth-child(even) { background: var(--studio-surface-soft); }
      html.design-studio.theme-dark .gb-level-seg { background: var(--studio-surface-soft); border-color: var(--line); }
      html.design-studio.theme-dark main table thead button { background: var(--studio-surface-soft) !important; color: var(--ink) !important; border-color: var(--line) !important; }
      html.design-studio.theme-dark main table thead .gb-level-seg button { background: var(--studio-surface-soft) !important; color: var(--ink) !important; }
      html.design-studio.theme-dark main table thead .gb-level-seg button.is-active { background: var(--brand) !important; color: #fff !important; }
      html.design-studio.theme-dark main table thead th { background: var(--studio-surface-soft) !important; }
      html.design-studio.theme-dark #gradebookBody tr:hover td { background: var(--brand-soft) !important; }
      html.design-studio.theme-dark #btnAddVisualTraceFromGb { border-color: var(--studio-border-strong); }
      html.design-studio.theme-dark :is(.test-trace-save-bar, #observationPrintGrid > div:first-child) { background: var(--studio-surface-soft) !important; color: var(--ink) !important; border-color: var(--line) !important; }
      html.design-studio.theme-dark :is(.test-trace-save-bar label, #qoEvaluatedCounter, #observationPrintGrid > div:first-child .qo-banner-heading, #sgCurrentStudentName, #sgMajorityExplanation) { color: var(--ink) !important; }
      html.design-studio.theme-dark #qoEvaluatedCounter { background: var(--paper) !important; border-color: var(--line) !important; }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th:not([class*="rubric-col-"]) { background: var(--studio-surface-soft) !important; color: var(--ink) !important; }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th:not([class*="rubric-col-"]) :is(.font-extrabold, .mt-1) { color: var(--ink) !important; }
      html.design-studio.theme-dark #competencyPositioning :is(summary, .comp-tab, .comp-subtab, .comp-card, .comp-result, .comp-reset, .comp-meq-auto, .comp-meq-detail, .comp-termtabs, .comp-printbtn, .comp-recap-print) {
        background: var(--studio-surface-soft);
        color: var(--ink);
        border-color: var(--line);
      }
      html.design-studio.theme-dark #competencyPositioning .comp-summary-strip { border-top-color: var(--dark-hairline); }
      html.design-studio.theme-dark #competencyPositioning .comp-chip.is-set {
        background: var(--brand-soft);
        color: var(--brand-deep);
        border-color: var(--brand);
      }
      html.design-studio.theme-dark #competencyPositioning .comp-summary-empty { color: var(--studio-text-muted); }
      html.design-studio.theme-dark #competencyPositioning .comp-comment { background: var(--studio-surface-soft); border-color: var(--line); }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-card-head, .comp-card-text, .comp-result-label, .comp-result-note, .comp-end, .comp-meq-label, .comp-meq-name, .comp-meq-body, .comp-meq-why, .comp-meq-quote, .comp-meq-note, .comp-refs-title, .comp-termtab) { color: var(--studio-text-muted); }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-tab.is-active, .comp-card.is-level) { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand); }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-subtab.is-active, .comp-termtab.is-active, .comp-meter-cell.is-level, .comp-meq-btn.is-level) { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand); }
      html.design-studio.theme-dark #competencyPositioning .comp-sentence:hover,
      html.design-studio.theme-dark #competencyPositioning .comp-sentence.is-sibling { background: var(--brand-soft); color: var(--ink); }
      html.design-studio.theme-dark #competencyPositioning .comp-sentence.is-locked { color: #a7afad; }
      html.design-studio.theme-dark #competencyPositioning .comp-sentence.is-picked { background: var(--brand-soft); color: var(--brand-deep); box-shadow: inset 0 -2px 0 var(--brand); }
      html.design-studio.theme-dark #competencyPositioning .comp-scale.has-picks .comp-sentence:not(.is-picked):not(.is-locked):not(.is-sibling):not(:hover) { color: #a7afbc; }
      html.design-studio.theme-dark #competencyPositioning .comp-scale.has-picks .comp-sentence.is-locked:not(.is-picked) { background: #29313c; color: #b1bdcb; box-shadow: none; }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-meter-cell, .comp-meq-btn) { background: #3c4043; color: var(--ink); }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-meter-cell.is-level, .comp-meq-btn.is-level) { background: var(--brand-soft); color: var(--brand-deep); }
      html.design-studio.theme-dark #competencyPositioning :is(.comp-refs a, .comp-meq-note a) { color: var(--brand-deep); }
      html.design-studio.theme-dark #toastNotification {
        background: var(--studio-surface-soft) !important;
        border: 1px solid var(--studio-border-strong) !important;
        border-left: 4px solid var(--brand) !important;
        color: var(--ink) !important;
      }
      html.design-studio #grStudentBand button, html.design-studio #grStudentBand button span:first-child { white-space: normal; overflow-wrap: anywhere; }
      html.design-studio.reduce-motion *,
      html.design-studio.reduce-motion *::before,
      html.design-studio.reduce-motion *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
      }
      @media (max-width: 900px) {
        .test-sidebar { position: static; width: 100%; padding: .7rem 1rem; gap: .6rem; overflow: visible; border-right: 0; border-bottom: 1px solid var(--sidebar-border, #dde3ec); }
        .test-sidebar-brand { flex-direction: row; align-items: center; justify-content: space-between; padding: .6rem 0 .6rem .95rem; margin-bottom: .15rem; }
        .test-sidebar-sections { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem 1rem; }
        .test-sidebar-footer { margin-top: 0; }
        .test-sidebar-section { min-width: 0; flex: 1 1 280px; }
        .test-sidebar-label { margin-bottom: .15rem; padding: 0; }
        .test-sidebar-nav { flex-direction: row; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: thin; }
        html.design-studio .test-sidebar #subjectTabsContainer { flex-direction: row; flex-wrap: wrap !important; overflow: visible; }
        .test-sidebar-nav > :is(button, a), html.design-studio #subjectTabsContainer > button { flex: 0 0 auto !important; width: auto !important; white-space: nowrap; }
        html.design-studio .test-sidebar #subjectSubTabsContainer { flex: 0 0 calc(100% - 1rem); max-width: calc(100% - 1rem); flex-direction: row; flex-wrap: wrap; overflow: visible; }
        html.design-studio .test-sidebar #subjectSubTabsContainer > button { flex: 0 0 auto; width: auto; white-space: nowrap; }
        html.design-studio .test-sidebar #subjectTabsContainer button span { white-space: nowrap; }
        html.design-studio header.test-topbar, html.design-studio main.site-layout { width: 100%; margin-left: 0; }
        html.design-studio header.test-topbar { position: relative; }
        html.design-studio header.test-topbar::before { display: none; }
        html.design-studio main.site-layout { padding: 1rem !important; }
        html.design-studio #viewQuickObs .rubric-matrix-table :is(thead th:first-child, tbody td:first-child) { position: sticky; left: 0; z-index: 2; background: var(--studio-surface) !important; }
        html.design-studio #viewQuickObs .rubric-matrix-table thead th:first-child { z-index: 3; background: var(--studio-surface-soft) !important; }
      }
      @media (min-width: 901px) and (max-width: 1100px) {
        html.design-studio header.test-topbar > div:first-child { flex-wrap: wrap; }
        html.design-studio .test-topbar > div:first-child > div:nth-child(2) { flex-basis: 100%; }
      }
      @media (min-width: 601px) and (max-width: 900px) {
        html.design-studio header.test-topbar > div:first-child { flex-wrap: wrap; }
        html.design-studio .test-topbar > div:first-child > div:nth-child(2) { flex: 1 1 100%; }
      }
      @media (min-width: 601px) and (max-width: 640px) {
        .test-topbar > div:first-child > div:nth-child(2) { flex-wrap: wrap !important; }
      }
      @media (max-width: 1500px) {
        .test-topbar :is(#btnExportExcel, #btnExportJSON, #btnOpenJSONDirect, #btnPrintView, #btnFullscreen, #btnCloseCarnet) > span { display: none; }
        .test-topbar :is(#btnExportExcel, #btnExportJSON, #btnOpenJSONDirect, #btnPrintView, #btnFullscreen, #btnCloseCarnet) { min-width: 34px; min-height: 34px; justify-content: center; }
      }
      @media (max-width: 600px) {
        html.design-studio header.test-topbar > div:first-child { position: relative; flex-wrap: wrap; }
        .test-settings-anchor { position: static; }
        #settingsPanel { right: 1rem; width: min(270px, calc(100vw - 2rem)); }
        .test-topbar > div:first-child > div:nth-child(2) { flex: 1 1 100%; flex-wrap: wrap !important; }
        .test-topbar > div:first-child > div:nth-child(2) { justify-content: flex-start; }
        .test-topbar > div:first-child > div:nth-child(2) > div:first-child { max-width: 100%; flex-wrap: wrap !important; }
        .test-topbar :is(#btnExportExcel, #btnPrintView, #btnFullscreen, #btnCloseCarnet) > span { display: none; }
        .test-topbar :is(#btnExportExcel, #btnPrintView, #btnFullscreen, #btnCloseCarnet) { min-width: 34px; min-height: 34px; justify-content: center; }
        html.design-studio header.test-topbar > div:first-child { padding: .65rem 1rem !important; }
        html.design-studio .gradebook-toolbar, html.design-studio .studio-hero-card, html.design-studio .global-report-toolbar { padding: 1rem !important; }
        html.design-studio #gradebookHeaderRow > th:first-child,
        html.design-studio #gradebookBody tr > td:first-child { width: 120px; min-width: 120px; max-width: 120px; overflow-wrap: anywhere; }
        html.design-studio #gbLevelFilterBar { display: flex; max-width: 100%; }
      }

      html.design-studio #emptyRosterNotice:not(.hidden) { padding-right: 1.5rem; }
      html.theme-dark #referencesDialog { background: var(--surface); color: var(--ink); border-color: var(--line); }
      html.theme-dark #referencesDialog details.bg-white { background: var(--surface) !important; color: var(--ink); border-color: var(--line); }
      html.theme-dark #referencesDialog :is(details.bg-slate-50, #btnCloseReferences) { background: var(--studio-surface-soft) !important; color: var(--ink); }
      html.theme-dark #referencesDialog :is(.text-slate-800, .text-slate-700) { color: var(--ink) !important; }
      html.theme-dark #referencesDialog a { color: var(--brand-deep) !important; }

      /* Fiche individuelle d'élève masquée à l'écran */
      #studentIndividualPrintSheet {
        display: none;
      }

      /* Sélecteur de palettes dans le menu d'options (#settingsPanel) */
      #settingsPanel .sp-row.sp-row-palette {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        padding: 7px 0 9px;
      }
      #settingsPanel .sp-palette-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
      }
      .sp-palette-active-name {
        font-size: 11px;
        font-weight: 700;
        color: var(--brand);
      }
      .sp-palette-swatches {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 5px;
        padding: 2px 1px;
      }
      .sp-swatch {
        position: relative;
        width: 22px;
        height: 22px;
        border-radius: 999px;
        border: 2px solid var(--sw-soft, #e2e8f0);
        background: var(--sw-brand, #1d4ed8);
        cursor: pointer;
        padding: 0;
        transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
      }
      .sp-swatch:hover {
        transform: translateY(-1px) scale(1.06);
      }
      .sp-swatch.is-active {
        border-color: var(--studio-surface);
        box-shadow: 0 0 0 2px var(--sw-brand, var(--brand)), 0 2px 6px rgba(15, 23, 42, .18);
        transform: scale(1.08);
      }
      .sp-swatch.is-active::after {
        content: "";
        position: absolute;
        inset: 5px;
        border-radius: 999px;
        background: #ffffff;
        opacity: .92;
      }

      /* Tâche 2 : Espacement net entre les boutons Sauvegarde JSON dans l'engrenage */
      #settingsPanel .sp-backup-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 6px;
      }
      #settingsPanel .sp-backup-actions > button {
        margin: 0 !important;
      }
      #settingsPanel .sp-backup-notice { margin-top: 8px; color: var(--studio-text-muted); font-size: 11px; line-height: 1.4; }

      /* Tâche 3 : Pop-up "+ Nouvelle évaluation" toujours au-dessus de la banderole et des en-têtes du tableau */
      html.design-studio #newEvaluationChoices {
        z-index: 60 !important;
      }

      /* Tâche 7 : Largeur normale pour la modale Niveaux visés et Confirmation de suppression liée */
      html.design-studio #modalTargetLevels > div,
      html.design-studio #modalDeleteLinked > div {
        max-width: 400px !important;
        width: 100%;
      }

      /* Tâche 8 : Page Élèves contenue et structurée sans étirement excessif */
      html.design-studio #viewStudents > div {
        max-width: 920px;
        margin-inline: 0 auto;
      }
      html.design-studio #viewStudents .student-add-row {
        max-width: 680px;
      }
      html.design-studio #viewStudents .student-add-row :is(#newStudentFirst, #newStudentLast) {
        flex: 0 1 200px;
        max-width: 220px;
        min-width: 130px;
      }
      html.design-studio #studentManagerList .student-name-field {
        flex: 0 1 185px;
        max-width: 215px;
        min-width: 125px;
      }
      @media (max-width: 600px) {
        html.design-studio #viewStudents .student-add-row :is(#newStudentFirst, #newStudentLast),
        html.design-studio #studentManagerList .student-name-field {
          flex: 1 1 100%;
          max-width: none;
        }
      }

      /* État 1 : Masquer les vues de travail tant qu'aucun groupe n'est chargé ou créé */
      html.no-active-group main.site-layout > section:not(#viewHome) {
        display: none !important;
      }

      /* Tâche 10 : Échelle de cotes harmonisée Vert → Rouge (Carnet, Barème, Traces, Bulletin) */
      html.design-studio .grade-badge {
        border-width: 1px;
        border-style: solid;
        white-space: nowrap;
      }
      html.design-studio .grade-badge.grade-badge-A {
        background-color: #dcfce7 !important;
        color: #14532d !important;
        border-color: #86efac !important;
      }
      html.design-studio .grade-badge.grade-badge-B {
        background-color: #ecfccb !important;
        color: #365314 !important;
        border-color: #bef264 !important;
      }
      html.design-studio .grade-badge.grade-badge-C {
        background-color: #fef3c7 !important;
        color: #78350f !important;
        border-color: #fcd34d !important;
      }
      html.design-studio .grade-badge.grade-badge-D {
        background-color: #ffedd5 !important;
        color: #9a3412 !important;
        border-color: #fdba74 !important;
      }
      html.design-studio .grade-badge.grade-badge-E {
        background-color: #fee2e2 !important;
        color: #991b1b !important;
        border-color: #fca5a5 !important;
      }
      html.design-studio .grade-badge.grade-badge-neutral {
        background-color: #f1f5f9 !important;
        color: #475569 !important;
        border-color: #cbd5e1 !important;
      }

      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-A {
        background: #dcfce7 !important;
        color: #14532d !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-A :is(.font-extrabold, .mt-1) {
        color: #14532d !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-B {
        background: #ecfccb !important;
        color: #365314 !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-B :is(.font-extrabold, .mt-1) {
        color: #365314 !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-C {
        background: #fef3c7 !important;
        color: #78350f !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-C :is(.font-extrabold, .mt-1) {
        color: #78350f !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-D {
        background: #ffedd5 !important;
        color: #9a3412 !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-D :is(.font-extrabold, .mt-1) {
        color: #9a3412 !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-E {
        background: #fee2e2 !important;
        color: #991b1b !important;
      }
      html.design-studio :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-E :is(.font-extrabold, .mt-1) {
        color: #991b1b !important;
      }

      /* Barre de choix du format d'outil (#viewQuickObs) */
      html.design-studio #qoToolModeBar,
      html.design-studio #qoWeightPresetBar {
        background: var(--studio-surface-soft) !important;
        border-color: var(--studio-border) !important;
      }
      html.design-studio #qoModeSegment {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
      }
      html.design-studio .qo-weight-total.is-valid,
      html.design-studio .qo-weight-total.is-ok {
        background: #dcfce7 !important;
        color: #166534 !important;
        border-color: #86efac !important;
      }
      html.design-studio .qo-weight-total.is-invalid,
      html.design-studio .qo-weight-total.is-warn {
        background: #fee2e2 !important;
        color: #991b1b !important;
        border-color: #fca5a5 !important;
      }
      html.design-studio .qo-formative-row {
        background: #fffbeb;
      }
      html.design-studio .qo-formative-title {
        color: #92400e;
      }
      html.design-studio .qo-crit-title {
        color: var(--studio-text);
      }
      html.design-studio .qo-badge-formative {
        background: #fef3c7;
        color: #92400e;
        border: 1px solid #fcd34d;
      }
      html.design-studio .qo-badge-scored {
        background: var(--brand-soft);
        color: var(--brand-deep);
        border: 1px solid var(--studio-border-strong);
      }
      html.design-studio .qo-unavailable-cell {
        color: var(--studio-text-muted);
        background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(148, 163, 184, .12) 4px, rgba(148, 163, 184, .12) 8px);
      }

      /* Tâche 4 & 10 : Mode sombre propre (adoucissement des lignes blanches, surfaces & pastilles Vert → Rouge) */
      html.design-studio.theme-dark {
        --dark-hairline: #2a2d31;
      }
      html.design-studio.theme-dark :is(main, [id^="modal"]) :is(.border-slate-100, .border-slate-200, .border-slate-300, .border-slate-800) {
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark :is(main, [id^="modal"]) :is(.divide-slate-100, .divide-slate-200) > :not([hidden]) ~ :not([hidden]) {
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark #gradebookTable th,
      html.design-studio.theme-dark #gradebookTable td,
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs, #viewGlobalReport) table :is(th, td) {
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark #gradebookBody tr:nth-child(odd) {
        background: var(--studio-surface) !important;
      }
      html.design-studio.theme-dark #gradebookBody tr:nth-child(even) {
        background: #232528 !important;
      }
      html.design-studio.theme-dark #gradebookBody tr:hover td {
        background: var(--brand-soft) !important;
      }
      html.design-studio.theme-dark #gradebookScrollContainer thead button.weight-lock:not(.is-pinned) {
        background: var(--studio-surface-soft) !important;
        border-color: var(--studio-border-strong) !important;
        color: var(--studio-text-muted) !important;
      }
      html.design-studio.theme-dark #btnWeightMode.is-weight-error {
        background: rgba(239, 68, 68, .2) !important;
        color: #fca5a5 !important;
        border-color: rgba(248, 113, 113, .55) !important;
      }
      html.design-studio.theme-dark #weightWarningBanner {
        background: rgba(239, 68, 68, .18) !important;
        color: #fca5a5 !important;
        border-color: rgba(248, 113, 113, .45) !important;
      }
      html.design-studio.theme-dark #gradebookScrollContainer thead button.weight-lock.is-pinned {
        background: rgba(245, 158, 11, .2) !important;
        border-color: rgba(251, 191, 36, .55) !important;
        color: #fcd34d !important;
      }
      html.design-studio.theme-dark :is(#btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents, #btnResetEqualWeights, #btnUnlockAllWeights, #btnPrintSubjectGrid, #btnQoSavePersoPreset) {
        background: var(--studio-surface-soft) !important;
        color: var(--ink) !important;
        border-color: var(--line) !important;
      }
      html.design-studio.theme-dark #newEvaluationChoices {
        background: var(--studio-surface) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark #newEvaluationChoices button {
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark #newEvaluationChoices button:hover {
        background: var(--brand-soft) !important;
        color: var(--brand-deep) !important;
      }
      html.design-studio.theme-dark #studentManagerList .student-remove {
        background: rgba(239, 68, 68, .15) !important;
        border-color: rgba(248, 113, 113, .38) !important;
        color: #fca5a5 !important;
      }
      html.design-studio.theme-dark #studentManagerList .student-remove:hover {
        background: rgba(239, 68, 68, .28) !important;
        color: #fecaca !important;
      }
      html.design-studio.theme-dark .student-option-btn {
        background: rgba(255, 255, 255, .04);
        border-color: var(--dark-hairline);
        color: #cbd5e1;
      }
      html.design-studio.theme-dark .student-option-btn:hover {
        border-color: var(--brand);
        color: var(--ink);
      }
      html.design-studio.theme-dark .student-option-btn.btn-student-adapt.is-active {
        background: var(--brand-soft);
        border-color: var(--brand);
        color: var(--brand-deep);
      }
      html.design-studio.theme-dark .student-option-btn.btn-student-mod.is-active {
        background: rgba(245, 158, 11, .18);
        border-color: rgba(251, 191, 36, .48);
        color: #fcd34d;
      }
      html.design-studio.theme-dark .student-option-btn.btn-student-mod.is-active .student-option-count {
        background: #d97706;
        color: #fff;
      }
      html.design-studio.theme-dark .student-adapt-drawer {
        background: #1f2226;
        border-color: var(--dark-hairline);
        box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
      }
      html.design-studio.theme-dark .student-adapt-pill {
        background: var(--studio-surface);
        border-color: var(--dark-hairline);
        color: #cbd5e1;
      }
      html.design-studio.theme-dark .student-adapt-pill:hover { border-color: var(--brand); color: var(--ink); }
      html.design-studio.theme-dark .student-adapt-pill.is-active {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
      }
      html.design-studio.theme-dark .modified-expectations {
        background: #1f2226 !important;
        border-color: var(--dark-hairline) !important;
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark .modified-expectations summary {
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark .mod-expectation-item {
        background: var(--studio-surface-soft) !important;
        border-color: var(--dark-hairline) !important;
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark .mod-expectation-item.is-modified {
        background: rgba(245, 158, 11, .16) !important;
        border-color: rgba(251, 191, 36, .35) !important;
        color: #fde68a !important;
      }
      html.design-studio.theme-dark #modalTargetLevelsList label {
        background: var(--studio-surface-soft) !important;
        border-color: var(--dark-hairline) !important;
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark #modalTargetLevelsList label:has(input:checked) {
        background: var(--brand-soft) !important;
        border-color: var(--brand) !important;
        color: var(--brand-deep) !important;
        --tw-ring-color: var(--brand) !important;
      }
      html.design-studio.theme-dark .qo-formative-row,
      html.design-studio.theme-dark .qo-formative-row td {
        background-color: #241e15 !important;
      }
      html.design-studio.theme-dark .qo-formative-title {
        background-color: #2c2317 !important;
        color: #fcd34d !important;
        border-color: rgba(251, 191, 36, .35) !important;
      }
      html.design-studio.theme-dark .qo-crit-title {
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark .qo-badge-formative {
        background: rgba(245, 158, 11, .18) !important;
        color: #fcd34d !important;
        border-color: rgba(251, 191, 36, .38) !important;
      }
      html.design-studio.theme-dark .qo-badge-scored {
        background: var(--brand-soft) !important;
        color: var(--brand-deep) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark .qo-unavailable-cell {
        color: #94a3b8 !important;
        background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(148, 163, 184, .08) 4px, rgba(148, 163, 184, .08) 8px) !important;
      }
      html.design-studio.theme-dark #qoWeightPresetBar input[type="number"] {
        background: var(--studio-surface) !important;
        color: var(--studio-text) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark #qoWeightPresetBar .qo-crit-weight-item {
        background: var(--studio-surface) !important;
        color: var(--ink) !important;
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark #qoWeightPresetBar button:not(#btnQoSavePersoPreset):not([aria-pressed="true"]) {
        background: var(--studio-surface) !important;
        color: var(--ink) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark #qoQuickTags button:not(.bg-indigo-600) {
        background: var(--studio-surface) !important;
        color: var(--ink) !important;
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark #qoQuickTags button:not(.bg-indigo-600):hover {
        background: var(--brand-soft) !important;
        color: var(--brand-deep) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark #qoActiveStudentTagsStrip > span {
        background: var(--brand-soft) !important;
        color: var(--brand-deep) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark #qoSidePanel .qo-side-kicker {
        color: var(--studio-text-muted) !important;
      }
      html.design-studio.theme-dark .qo-weight-total.is-valid,
      html.design-studio.theme-dark .qo-weight-total.is-ok {
        background: rgba(22, 163, 74, .2) !important;
        color: #86efac !important;
        border-color: rgba(74, 222, 128, .4) !important;
      }
      html.design-studio.theme-dark .qo-weight-total.is-invalid,
      html.design-studio.theme-dark .qo-weight-total.is-warn {
        background: rgba(239, 68, 68, .2) !important;
        color: #fca5a5 !important;
        border-color: rgba(248, 113, 113, .45) !important;
      }
      html.design-studio.theme-dark :is(#baremeStudentPills, #qoStudentGrid) button:not([aria-pressed="true"]) {
        background: var(--studio-surface-soft) !important;
        color: var(--ink) !important;
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark :is(#baremeStudentPills, #qoStudentGrid) button[aria-pressed="true"] {
        background: var(--brand) !important;
        color: #fff !important;
        border-color: var(--brand) !important;
      }

      /* Mode sombre : pastilles Vert → Rouge & en-têtes A–E lisibles */
      html.design-studio.theme-dark .grade-badge.grade-badge-A {
        background-color: rgba(22, 163, 74, .24) !important;
        color: #86efac !important;
        border-color: rgba(74, 222, 128, .45) !important;
      }
      html.design-studio.theme-dark .grade-badge.grade-badge-B {
        background-color: rgba(132, 204, 22, .22) !important;
        color: #bef264 !important;
        border-color: rgba(163, 230, 53, .42) !important;
      }
      html.design-studio.theme-dark .grade-badge.grade-badge-C {
        background-color: rgba(245, 158, 11, .22) !important;
        color: #fcd34d !important;
        border-color: rgba(251, 191, 36, .42) !important;
      }
      html.design-studio.theme-dark .grade-badge.grade-badge-D {
        background-color: rgba(249, 115, 22, .24) !important;
        color: #fdba74 !important;
        border-color: rgba(251, 146, 60, .45) !important;
      }
      html.design-studio.theme-dark .grade-badge.grade-badge-E {
        background-color: rgba(239, 68, 68, .24) !important;
        color: #fca5a5 !important;
        border-color: rgba(248, 113, 113, .46) !important;
      }
      html.design-studio.theme-dark .grade-badge.grade-badge-neutral {
        background-color: rgba(148, 163, 184, .16) !important;
        color: #cbd5e1 !important;
        border-color: rgba(148, 163, 184, .34) !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-A {
        background: rgba(22, 163, 74, .18) !important;
        color: #86efac !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-A :is(.font-extrabold, .mt-1) {
        color: #86efac !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-B {
        background: rgba(132, 204, 22, .16) !important;
        color: #bef264 !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-B :is(.font-extrabold, .mt-1) {
        color: #bef264 !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-C {
        background: rgba(245, 158, 11, .16) !important;
        color: #fcd34d !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-C :is(.font-extrabold, .mt-1) {
        color: #fcd34d !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-D {
        background: rgba(249, 115, 22, .18) !important;
        color: #fdba74 !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-D :is(.font-extrabold, .mt-1) {
        color: #fdba74 !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-E {
        background: rgba(239, 68, 68, .18) !important;
        color: #fca5a5 !important;
      }
      html.design-studio.theme-dark :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th.rubric-col-E :is(.font-extrabold, .mt-1) {
        color: #fca5a5 !important;
      }
      html.design-studio.theme-dark main :is([class*="bg-slate-50/"], [class*="bg-indigo-50/"], .bg-indigo-50) {
        background-color: var(--studio-surface-soft) !important;
      }
      html.design-studio.theme-dark main :is([class*="bg-amber-50/"], .bg-amber-50) {
        background-color: #292217 !important;
        border-color: rgba(251, 191, 36, .35) !important;
        color: #fcd34d !important;
      }
      html.design-studio.theme-dark :is(#viewQuickObs, #viewBareme) .rubric-matrix-table tbody td.qo-formative-title {
        background: #2c2317 !important;
        color: #fcd34d !important;
        border-color: rgba(251, 191, 36, .35) !important;
      }
      html.design-studio.theme-dark main :is(.text-indigo-950, .text-indigo-900) {
        color: var(--ink) !important;
      }
      html.design-studio.theme-dark main .border-indigo-200 {
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark #viewGlobalReport tbody tr:nth-child(odd) {
        background: var(--studio-surface) !important;
      }
      html.design-studio.theme-dark #viewGlobalReport tbody tr:nth-child(even) {
        background: #232528 !important;
      }
      html.design-studio.theme-dark #viewGlobalReport .gr-grade-meta strong { color: var(--ink); }
      html.design-studio.theme-dark #viewGlobalReport .gr-mod-pill {
        background: #3a3020;
        color: #e8cf93;
        border-color: #79683f;
      }
      html.design-studio.theme-dark #viewGlobalReport :is([class*="bg-slate-200"], .bg-white.border-indigo-200) {
        background-color: var(--studio-surface) !important;
        color: var(--ink) !important;
        border-color: var(--dark-hairline) !important;
      }
      html.design-studio.theme-dark .cell-flag-chip {
        background: var(--studio-surface-soft) !important;
        color: var(--ink) !important;
        border-color: var(--studio-border-strong) !important;
      }
      html.design-studio.theme-dark :is(#gradebookBody .bg-amber-100, #viewGlobalReport .bg-amber-100, #qoStudentGrid .bg-amber-100, #baremeStudentPills .bg-amber-100, #qoEditModeBadge) {
        background-color: rgba(245, 158, 11, .18) !important;
        color: #fcd34d !important;
        border-color: rgba(251, 191, 36, .42) !important;
      }
      html.design-studio.theme-dark :is(#qoStudentGrid .bg-indigo-100, #baremeStudentPills .bg-indigo-100) {
        background-color: var(--brand-soft) !important;
        color: var(--brand-deep) !important;
      }
      html.design-studio.theme-dark :is(#qoStudentGrid .bg-slate-200, #baremeStudentPills .bg-slate-200) {
        background-color: rgba(148, 163, 184, .18) !important;
        color: #cbd5e1 !important;
      }
      html.design-studio.theme-dark :is(#gradebookScrollContainer, #viewQuickObs, #viewBareme, .gr-results-scroll) {
        scrollbar-color: #4b5563 #1e1f20;
      }
    }

    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th[class*="rubric-col-"] {
      background: color-mix(in srgb, var(--brand) 10%, var(--studio-surface)) !important;
      color: var(--studio-text) !important;
      border-color: var(--studio-border) !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th[class*="rubric-col-"] :is(.font-extrabold, .mt-1) {
      color: var(--studio-text) !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) .rubric-stmt-btn[aria-pressed="true"] {
      background: var(--brand-soft) !important;
      color: var(--brand-deep) !important;
      border-color: var(--studio-border-strong) !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tbody td:first-child,
    html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewQuickObs .rubric-matrix-table tr.qo-formative-row {
      background: var(--studio-surface-soft) !important;
      color: var(--studio-text) !important;
      border-color: var(--studio-border) !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewQuickObs .qo-badge-formative {
      background: var(--brand-soft) !important;
      color: var(--brand-deep) !important;
      border-color: var(--studio-border-strong) !important;
    }

    #addStudentDialog label { display: block; margin-top: .75rem; font-weight: 700; }
    #addStudentDialog input { width: 100%; padding: .5rem .65rem; border: 1px solid var(--studio-border-strong); border-radius: 8px; background: var(--studio-surface); color: var(--studio-text); }
    #addStudentDialog input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#groupBar > button[aria-pressed="true"], #btnOpenAddStudent, #btnNewEvaluation, #btnOpenAddAssignment, #btnAddVisualTraceFromGb, #btnConfirmAddAssignment, #btnCommitObsSessionToGradebook, #btnAddStudent, #btnOpenStudentsFromEmpty, #btnConfirmTargetLevels, #btnGroupSave, #btnDoneBackupHelp, #btnConfirmBackupPassword, #btnConfirmBackupLoad, #btnApplyCustomRubric, .print-dialog-primary, .backup-dialog-primary, .studio-pale-primary) {
      background: var(--brand-soft) !important;
      color: var(--brand-deep) !important;
      border: 1px solid var(--studio-border-strong) !important;
      box-shadow: none !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#groupBar > button[aria-pressed="true"], #btnOpenAddStudent, #btnNewEvaluation, #btnOpenAddAssignment, #btnAddVisualTraceFromGb, #btnConfirmAddAssignment, #btnCommitObsSessionToGradebook, #btnAddStudent, #btnOpenStudentsFromEmpty, #btnConfirmTargetLevels, #btnGroupSave, #btnDoneBackupHelp, #btnConfirmBackupPassword, #btnConfirmBackupLoad, #btnApplyCustomRubric, .print-dialog-primary, .backup-dialog-primary, .studio-pale-primary):hover:not(:disabled) {
      border-color: var(--brand) !important;
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#btnOpenAddStudent, #btnNewEvaluation, #btnOpenAddAssignment, #btnAddVisualTraceFromGb, #btnConfirmAddAssignment, #btnCommitObsSessionToGradebook, #btnAddStudent, #btnOpenStudentsFromEmpty, #btnConfirmTargetLevels, #btnGroupSave, #btnDoneBackupHelp, #btnConfirmBackupPassword, #btnConfirmBackupLoad, #btnApplyCustomRubric, .print-dialog-primary, .backup-dialog-primary, .studio-pale-primary):focus-visible {
      outline: 2px solid var(--brand);
      outline-offset: 2px;
    }
    #btnOpenAddStudent:disabled { opacity: .5; cursor: not-allowed; }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents) {
      padding: .6rem .9rem;
      background: var(--brand-soft) !important;
      color: var(--brand-deep) !important;
      border: 1px solid var(--brand) !important;
      font-size: .85rem;
      box-shadow: var(--studio-shadow-sm);
    }
    html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents):hover {
      background: var(--studio-surface-soft) !important;
    }

    @media screen {
      :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tr > :nth-child(2) { --rubric-color: #3b8067; }
      :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tr > :nth-child(3) { --rubric-color: #3e8090; }
      :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tr > :nth-child(4) { --rubric-color: #687fa0; }
      :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tr > :nth-child(5) { --rubric-color: #a47b40; }
      :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tr > :nth-child(6) { --rubric-color: #a76b72; }
      html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) table.rubric-matrix-table thead th[class*="rubric-col-"] {
        background: color-mix(in srgb, var(--rubric-color) 12%, var(--studio-surface)) !important;
      }
      html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) .rubric-matrix-table tbody td:not(:first-child) {
        background: color-mix(in srgb, var(--rubric-color) 4%, var(--studio-surface)) !important;
      }
      html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) .rubric-stmt-btn[aria-pressed="true"] {
        background: color-mix(in srgb, var(--rubric-color) 18%, var(--studio-surface)) !important;
        color: var(--studio-text) !important;
        border-color: color-mix(in srgb, var(--rubric-color) 45%, var(--studio-border)) !important;
      }
      html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#viewBareme, #viewQuickObs) .rubric-stmt-btn[aria-pressed="true"] .rubric-stmt-check {
        background: color-mix(in srgb, var(--rubric-color) 85%, black) !important;
        border-color: color-mix(in srgb, var(--rubric-color) 85%, black) !important;
        color: #fff !important;
      }
    }

    @media print {
      .gr-teacher-comment-print { display: block; white-space: pre-wrap; }
      html.design-studio .bar-fill-inner { background-color: var(--brand) !important; opacity: 0.78 !important; }

      /* Tâche 4 : Impression du carnet rempli ultra-compacte et nette */
      body.print-gradebook {
        background: #fff !important;
        color: #111827 !important;
        font-size: 8.5px !important;
      }
      body.print-gradebook .test-sidebar,
      body.print-gradebook header.test-topbar,
      body.print-gradebook #viewGradebook > .grid:first-of-type,
      body.print-gradebook .gradebook-toolbar .no-print,
      body.print-gradebook .new-eval-popover-wrap,
      body.print-gradebook #gbLevelFilterBar,
      body.print-gradebook .cell-flag-trigger,
      body.print-gradebook .weight-tools,
      body.print-gradebook .gb-sort-btn {
        display: none !important;
      }
      body.print-gradebook main.site-layout {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
      }
      body.print-gradebook .gradebook-toolbar {
        padding: 0 0 4px 0 !important;
        margin: 0 0 4px 0 !important;
        border: 0 !important;
        border-bottom: 1.5px solid #1e293b !important;
        border-radius: 0 !important;
        box-shadow: none !important;
      }
      body.print-gradebook .gradebook-toolbar > div:nth-of-type(2) {
        background: #fff !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
      }
      body.print-gradebook #gbSubjectTitle {
        font-size: 12px !important;
        line-height: 1.2 !important;
      }
      body.print-gradebook #gbActiveSubjectInfo {
        font-size: 8.5px !important;
      }
      body.print-gradebook #gradebookScrollContainer {
        border: 1px solid #94a3b8 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
      }
      body.print-gradebook #gradebookScrollContainer table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border-collapse: collapse !important;
        font-size: 8px !important;
        line-height: 1.15 !important;
      }
      body.print-gradebook #gradebookHeaderRow th {
        padding: 3px 3px !important;
        min-width: 0 !important;
        max-width: 72px !important;
        font-size: 7.5px !important;
        line-height: 1.15 !important;
        border-bottom: 1.5px solid #334155 !important;
        border-right: 1px solid #cbd5e1 !important;
        vertical-align: bottom !important;
        overflow-wrap: break-word !important;
        width: auto !important;
      }
      body.print-gradebook #gradebookHeaderRow th:first-child {
        max-width: 130px !important;
        width: 115px !important;
        text-align: left !important;
      }
      body.print-gradebook #gradebookBody td {
        padding: 2px 3px !important;
        min-width: 0 !important;
        font-size: 8px !important;
        line-height: 1.15 !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-right: 1px solid #e2e8f0 !important;
      }
      body.print-gradebook #gradebookBody td:first-child {
        max-width: 130px !important;
        padding: 2px 4px !important;
      }
      body.print-gradebook #gradebookBody td:first-child .font-bold {
        font-size: 8.5px !important;
        line-height: 1.15 !important;
      }
      body.print-gradebook #gradebookBody td:first-child .text-\[10px\] {
        font-size: 7px !important;
        margin-top: 0 !important;
      }
      body.print-gradebook #gradebookBody input[data-score-asg] {
        width: 34px !important;
        height: 14px !important;
        padding: 0 !important;
        font-size: 8px !important;
        font-weight: 700 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
      }
      body.print-gradebook #gradebookBody .asg-pct {
        font-size: 7.5px !important;
        min-width: 0 !important;
      }
      body.print-gradebook #gradebookBody button {
        padding: 1px 3px !important;
        font-size: 7.5px !important;
        line-height: 1.1 !important;
        border-radius: 3px !important;
        min-height: 0 !important;
      }
      body.print-gradebook .cell-flag-chip {
        font-size: 6.5px !important;
        padding: 0 2px !important;
      }
      body.print-gradebook .final-grade-trigger {
        padding: 1px 4px !important;
        font-size: 8px !important;
      }

      /* Tâche 6 : Impression épurée d'une fiche individuelle d'élève (sans boîte de signature) */
      body.print-student-sheet .test-sidebar,
      body.print-student-sheet header.test-topbar,
      body.print-student-sheet main.site-layout,
      body.print-student-sheet #toastNotification,
      body.print-student-sheet dialog {
        display: none !important;
      }
      body.print-student-sheet #studentIndividualPrintSheet {
        display: block !important;
        font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
        color: #0f172a;
        background: #ffffff;
        font-size: 9.5px;
        line-height: 1.35;
        padding: 0;
      }
      #studentIndividualPrintSheet .sis-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 2px solid #0f172a;
      }
      #studentIndividualPrintSheet .sis-eyebrow {
        font-size: 8px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #475569;
      }
      #studentIndividualPrintSheet .sis-student-name {
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -.02em;
        margin: 1px 0 2px;
        color: #0f172a;
      }
      #studentIndividualPrintSheet .sis-meta-line {
        font-size: 9px;
        color: #334155;
      }
      #studentIndividualPrintSheet .sis-overall-box {
        text-align: right;
        padding: 5px 10px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        background: #f8fafc;
      }
      #studentIndividualPrintSheet .sis-overall-label {
        font-size: 7.5px;
        font-weight: 700;
        text-transform: uppercase;
        color: #475569;
      }
      #studentIndividualPrintSheet .sis-overall-val {
        font-size: 14px;
        font-weight: 800;
        color: #0f172a;
      }
      #studentIndividualPrintSheet .sis-supports-row {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
        padding: 5px 8px;
        margin-bottom: 7px;
        border: 1px solid #cbd5e1;
        border-radius: 5px;
        background: #f8fafc;
        font-size: 8.5px;
      }
      #studentIndividualPrintSheet .sis-alert-box {
        padding: 5px 8px;
        margin-bottom: 7px;
        border: 1px solid #f59e0b;
        border-radius: 5px;
        background: #fffbeb;
        color: #78350f;
        font-size: 8.5px;
      }
      #studentIndividualPrintSheet .sis-ps-list {
        display: grid;
        gap: 5px;
        margin-bottom: 7px;
      }
      #studentIndividualPrintSheet .sis-ps-domain {
        padding: 5px 7px;
        border: 1px solid #cbd5e1;
        border-radius: 5px;
        break-inside: avoid;
      }
      #studentIndividualPrintSheet .sis-ps-domain-head {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 2px 7px;
        margin-bottom: 4px;
        color: #334155;
      }
      #studentIndividualPrintSheet .sis-ps-domain-head strong { font-size: 9px; }
      #studentIndividualPrintSheet .sis-ps-domain-head span { font-size: 8px; }
      #studentIndividualPrintSheet .sis-ps-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
      }
      #studentIndividualPrintSheet .sis-ps-step {
        padding: 3px 4px;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        background: #f8fafc;
        font-size: 7.5px;
        color: #475569;
      }
      #studentIndividualPrintSheet .sis-ps-step strong {
        display: block;
        margin-top: 1px;
        color: #0f172a;
        font-size: 8px;
      }
      #studentIndividualPrintSheet .sis-ps-domain p {
        margin: 4px 0 0;
        font-size: 8px;
      }
      #studentIndividualPrintSheet .sis-section-title {
        font-size: 9px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #1e293b;
        margin: 8px 0 4px;
        padding-bottom: 2px;
        border-bottom: 1px solid #cbd5e1;
      }
      #studentIndividualPrintSheet .sis-summary-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 8px;
        font-size: 8.5px;
      }
      #studentIndividualPrintSheet .sis-summary-table th,
      #studentIndividualPrintSheet .sis-summary-table td {
        padding: 3px 5px;
        border: 1px solid #cbd5e1;
        text-align: left;
      }
      #studentIndividualPrintSheet .sis-summary-table th {
        background: #f1f5f9;
        font-weight: 700;
        color: #334155;
      }
      #studentIndividualPrintSheet .sis-summary-table .sis-num {
        text-align: center;
        font-variant-numeric: tabular-nums;
      }
      #studentIndividualPrintSheet .sis-summary-table .sis-annual {
        background: #f8fafc;
        font-weight: 700;
      }
      #studentIndividualPrintSheet .sis-subcode {
        font-size: 8px;
        color: #475569;
      }
      #studentIndividualPrintSheet .sis-mod-pill {
        display: inline-block;
        padding: 0 4px;
        border: 1px solid #d97706;
        border-radius: 3px;
        font-size: 7.5px;
        font-weight: 800;
        color: #92400e;
        background: #fef3c7;
      }
      #studentIndividualPrintSheet .sis-details-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 8px;
      }
      #studentIndividualPrintSheet .sis-subject-card {
        border: 1px solid #cbd5e1;
        border-radius: 5px;
        padding: 4px 6px;
        break-inside: avoid;
      }
      #studentIndividualPrintSheet .sis-subject-card-head {
        font-size: 8.5px;
        font-weight: 800;
        color: #0f172a;
        padding-bottom: 2px;
        margin-bottom: 2px;
        border-bottom: 1px solid #e2e8f0;
      }
      #studentIndividualPrintSheet .sis-eval-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8px;
      }
      #studentIndividualPrintSheet .sis-eval-table td {
        padding: 1.5px 2px;
        border-bottom: 1px dotted #e2e8f0;
        vertical-align: baseline;
      }
      #studentIndividualPrintSheet .sis-eval-table tr:last-child td {
        border-bottom: 0;
      }
      #studentIndividualPrintSheet .sis-eval-term {
        width: 28px;
        color: #64748b;
        font-weight: 600;
        white-space: nowrap;
      }
      #studentIndividualPrintSheet .sis-eval-weight {
        color: #64748b;
        white-space: nowrap;
        text-align: right;
        padding-right: 4px !important;
      }
      #studentIndividualPrintSheet .sis-eval-res {
        font-weight: 700;
        text-align: right;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
      }
      #studentIndividualPrintSheet .sis-obs-tag {
        font-size: 7px;
        padding: 0 3px;
        border: 1px solid #94a3b8;
        border-radius: 3px;
        color: #475569;
      }
      #studentIndividualPrintSheet .sis-flags {
        font-size: 7.5px;
        color: #475569;
        font-weight: 600;
      }
      #studentIndividualPrintSheet .sis-comments-list {
        display: grid;
        gap: 3px;
        font-size: 8.5px;
      }
      #studentIndividualPrintSheet .sis-comment-item {
        padding: 3px 6px;
        border-left: 2px solid #64748b;
        background: #f8fafc;
        break-inside: avoid;
      }
      #studentIndividualPrintSheet .sis-comment-meta {
        font-weight: 700;
        color: #334155;
      }
      .grade-badge {
        border-width: 1px;
        border-style: solid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      .grade-badge.grade-badge-A { background-color: #dcfce7 !important; color: #14532d !important; border-color: #86efac !important; }
      .grade-badge.grade-badge-B { background-color: #ecfccb !important; color: #365314 !important; border-color: #bef264 !important; }
      .grade-badge.grade-badge-C { background-color: #fef3c7 !important; color: #78350f !important; border-color: #fcd34d !important; }
      .grade-badge.grade-badge-D { background-color: #ffedd5 !important; color: #9a3412 !important; border-color: #fdba74 !important; }
      .grade-badge.grade-badge-E { background-color: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
      .grade-badge.grade-badge-neutral { background-color: #f1f5f9 !important; color: #475569 !important; border-color: #cbd5e1 !important; }
      #studentIndividualPrintSheet :is(.sis-overall-box, .sis-summary-table th, .sis-summary-table .sis-annual, .sis-supports-row, .sis-alert-box, .sis-mod-pill, .sis-ps-domain, .sis-ps-step),
      :is(#observablePrintSheet, #baremeBatchPrintSheet) :is(.observable-print-check, .is-selected, thead th, tbody th) {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
    }
    /* Carnet : noms d'élèves plus lisibles */
    @media screen {
      html.design-studio #gradebookBody .gb-student-name { font-size: 15px; line-height: 1.3; }
      html.design-studio #gradebookBody .gb-student-meta { font-size: 11.5px; }
    }
    @media screen and (min-width: 601px) {
      html.design-studio #gradebookHeaderRow > th:first-child,
      html.design-studio #gradebookBody tr > td:first-child {
        padding-left: 16px !important;
        padding-right: 24px !important;
      }
      html.design-studio #gradebookBody .gb-student-name {
        overflow-wrap: break-word;
      }
    }

    /* Synthese prescolaire : portrait doux, une ligne par domaine */
    .ps-section { --ps-surface: var(--studio-surface, #fff); --ps-ink: var(--ink, #0f172a); --ps-muted: var(--studio-text-muted, #64748b); --ps-line: var(--line, #e2e8f0); }
    [data-domain="presco_c1"] { --ps-hue: #4f9a78; }
    [data-domain="presco_c2"] { --ps-hue: #d0708a; }
    [data-domain="presco_c3"] { --ps-hue: #d98b4c; }
    [data-domain="presco_c4"] { --ps-hue: #4f8fcf; }
    [data-domain="presco_c5"] { --ps-hue: #8f74cc; }
    .ps-k0 { --ps-fill: 0; }
    .ps-k1 { --ps-fill: 25%; }
    .ps-k2 { --ps-fill: 45%; }
    .ps-k3 { --ps-fill: 70%; }
    .ps-k4 { --ps-fill: 100%; }
    .ps-list { display: flex; flex-direction: column; gap: .6rem; }
    .ps-row { border-radius: 18px; background: color-mix(in srgb, var(--ps-hue) 7%, var(--ps-surface)); color: var(--ps-ink); padding: .85rem 1rem; }
    .ps-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(150px, 210px); align-items: center; gap: .5rem 1rem; }
    .ps-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; color: var(--ps-hue); background: var(--ps-surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ps-hue) 18%, transparent); }
    .ps-icon svg { width: 21px; height: 21px; }
    .ps-title { min-width: 0; display: flex; flex-direction: column; }
    .ps-title strong { font-size: 16px; font-weight: 700; line-height: 1.25; }
    .ps-title small { font-size: 13px; color: var(--ps-muted); line-height: 1.35; }
    .ps-path { display: flex; gap: .55rem; margin: 0; padding: 0; list-style: none; }
    .ps-path li { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
    .ps-path li span { font-size: 11px; font-weight: 600; color: var(--ps-muted); }
    .ps-path i, .ps-legend i { display: block; width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ps-hue, #64748b) 55%, transparent); background: color-mix(in srgb, var(--ps-hue, #64748b) var(--ps-fill), transparent); }
    .ps-path .ps-k0 i { border-style: dashed; }
    .ps-now { justify-self: start; display: inline-flex; flex-direction: column; padding: .35rem .8rem; border-radius: 999px; background: var(--ps-surface); font-size: 14px; font-weight: 600; line-height: 1.3; color: color-mix(in srgb, var(--ps-hue) 55%, var(--ps-ink)); }
    .ps-now small { font-size: 11.5px; font-weight: 600; color: var(--ps-muted); }
    .ps-now.ps-k0 { color: var(--ps-muted); font-style: italic; }
    .ps-row-detail { margin: .65rem 0 0 calc(42px + 1rem); display: flex; flex-direction: column; gap: .35rem; }
    .ps-quote { margin: 0; font-size: 14px; line-height: 1.55; color: color-mix(in srgb, var(--ps-ink) 82%, var(--ps-surface)); }
    .ps-quote cite { font-size: 12px; font-style: normal; color: var(--ps-muted); white-space: nowrap; }
    .ps-tags { margin: 0; font-size: 13.5px; color: var(--ps-muted); }
    .ps-tags b { font-weight: 600; color: color-mix(in srgb, var(--ps-hue) 60%, var(--ps-ink)); }
    .ps-more summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--ps-hue) 70%, var(--ps-ink)); }
    .ps-more-term { margin-top: .55rem; }
    .ps-more-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--ps-surface); color: var(--ps-muted); }
    .ps-more ul { margin: .35rem 0 0; padding-left: 1rem; list-style: disc; display: flex; flex-direction: column; gap: .35rem; }
    .ps-more li { font-size: 13.5px; line-height: 1.45; }
    .ps-more li b { display: block; font-size: 12px; font-weight: 600; color: var(--ps-muted); }
    .ps-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding-top: .35rem; }
    .ps-legend span { display: inline-flex; align-items: center; gap: .4rem; font-size: 12.5px; color: var(--ps-muted); }
    .ps-legend i { width: 12px; height: 12px; }
    .ps-note { margin: 0; font-size: 12px; color: var(--ps-muted); line-height: 1.45; }
    @media (max-width: 720px) {
      .ps-row-main { grid-template-columns: auto minmax(0, 1fr); }
      .ps-path, .ps-now { grid-column: 2; }
      .ps-row-detail { margin-left: 0; }
    }
/* Synthèse : bloc pleine largeur (la classe Tailwind lg:col-span-12 n’est pas compilée). */
.gr-span-full { grid-column: 1 / -1; min-width: 0; }

/* Style « pastille » unifié : fond pâle, contour et texte foncés de la palette, soulignement intérieur. */
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(
  #gradebookScrollContainer thead .gb-level-seg button.is-active,
  main table thead .gb-level-seg button.is-active,
  #grStudentBand button[aria-pressed="true"],
  #qoStudentGrid button.bg-indigo-600,
  #qoModeSegment button[aria-pressed="true"],
  #qoWeightPresetBar button[aria-pressed="true"],
  #qoTargetLevelsBox .qo-target-btn.is-active,
  #qoQuickTags button.bg-indigo-600,
  #competencyPositioning .comp-tab.is-active,
  .test-sidebar-nav > button[aria-pressed="true"],
  .test-sidebar-nav > button.bg-indigo-500,
  .test-sidebar-nav > button.bg-indigo-600,
  .test-sidebar-nav > button.bg-amber-400,
  .test-sidebar #subjectTabsContainer > button[aria-pressed="true"],
  .test-sidebar #subjectSubTabsContainer > button[aria-pressed="true"],
  #btnNewEvaluation, #btnOpenAddAssignment, #btnAddVisualTraceFromGb, #btnCommitObsSessionToGradebook,
  #btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents
) {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface, #fff)) !important;
  color: var(--brand-deep) !important;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 45%, transparent) !important;
  font-weight: 600 !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#grStudentBand button[aria-pressed="true"], #qoStudentGrid button.bg-indigo-600) :is(span, b) { color: inherit; }
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(
  #btnNewEvaluation, #btnOpenAddAssignment, #btnAddVisualTraceFromGb, #btnCommitObsSessionToGradebook,
  #btnBackToGradebookFromBareme, #btnBackToGradebookFromTrace, #btnBackToGradebookFromStudents
):hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand) 10%, var(--studio-surface)) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(
  .test-sidebar-nav > :is(button, a),
  .test-sidebar #subjectTabsContainer > button,
  .test-sidebar #subjectSubTabsContainer > button,
  #competencyPositioning .comp-tab,
  #grStudentBand button,
  #qoStudentGrid button,
  #qoModeSegment button,
  #qoWeightPresetBar button[aria-pressed],
  .gb-level-seg button
) { border-radius: 999px !important; }
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(#qoModeSegment, .gb-level-seg) { border-radius: 999px !important; }
html.design-studio #qoModeSegment .qo-weight-badge,
html.design-studio #viewQuickObs .qo-weight-badge {
  background: var(--brand-soft) !important;
  color: var(--brand-deep) !important;
  border-color: color-mix(in srgb, var(--brand) 28%, transparent) !important;
}

html.design-studio header.test-topbar button:not(:disabled) {
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease !important;
}
html.design-studio header.test-topbar button:not(:disabled):hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .13) !important;
}
html.design-studio header.test-topbar button:not(:disabled):active {
  transform: translateY(0) scale(.97) !important;
}
html.design-studio .test-topbar .term-btn[aria-pressed="true"] {
  background: var(--brand-soft) !important;
  color: var(--brand-deep) !important;
  border: 1px solid var(--studio-border-strong);
  box-shadow: none;
}

html.design-studio #weightControls {
  overflow: hidden;
}
html.design-studio #weightControls button {
  border-radius: 8px !important;
  border-color: var(--studio-border-strong) !important;
  background: var(--studio-surface-soft) !important;
  color: var(--brand-deep) !important;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand) 25%, transparent);
}
html.design-studio #weightControls button:hover {
  background: var(--brand-soft) !important;
  border-color: var(--brand) !important;
}

html.design-studio #viewQuickObs :is(.qo-category, .qo-choice, .qo-selected-chip, .qo-selected-chip button) {
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

html.design-studio #competencyPositioning .comp-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: .4rem;
}
html.design-studio #competencyPositioning .comp-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand) 16%, transparent);
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}
html.design-studio #competencyPositioning .comp-tab:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.gradebook-toolbar .gb-sort-btn:focus-visible,
.gradebook-toolbar .column-color-trigger:focus-visible,
.print-menu button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
html.design-studio #competencyPositioning .comp-tab.is-active {
  box-shadow: inset 0 -2px 0 var(--brand), 0 3px 10px color-mix(in srgb, var(--brand) 14%, transparent);
}
html.design-studio #competencyPositioning .comp-subtabs {
  justify-content: flex-start;
}
html.design-studio #competencyPositioning .comp-subtab {
  min-width: 130px;
  text-align: center;
  border-radius: 999px;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand) 16%, transparent);
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
html.design-studio #competencyPositioning .comp-subtab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
}

html.design-studio #competencyPositioning .comp-card-text { color: #26333d; }
html.design-studio #competencyPositioning .comp-sentence:not(.is-picked):not(.is-sibling) {
  background: #fff;
  border-color: #d5dce3;
  color: #26333d;
}
html.design-studio #competencyPositioning .comp-sentence.is-locked:not(.is-picked) {
  background: #f8fafc;
  border-color: #d8dee5;
  color: #52606f;
}
html.design-studio #competencyPositioning .comp-end {
  border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 800;
}
html.design-studio #competencyPositioning .comp-refs,
html.design-studio #competencyPositioning .comp-refs-title,
html.design-studio #competencyPositioning .comp-refs a {
  color: #7b8590 !important;
  font-size: 10px !important;
  font-style: italic;
  font-weight: 400 !important;
}
html.design-studio #competencyPositioning .comp-refs a {
  text-decoration-color: #c2c8ce;
}
html.design-studio.theme-dark #competencyPositioning .comp-card-text { color: #e2e8f0; }
html.design-studio.theme-dark #competencyPositioning .comp-sentence:not(.is-picked):not(.is-sibling) {
  background: var(--studio-surface);
  border-color: var(--line);
  color: #e2e8f0;
}
html.design-studio.theme-dark #competencyPositioning .comp-sentence.is-locked:not(.is-picked) {
  background: #29313c;
  color: #cbd5e1;
}
html.design-studio.theme-dark #competencyPositioning .comp-refs,
html.design-studio.theme-dark #competencyPositioning .comp-refs-title,
html.design-studio.theme-dark #competencyPositioning .comp-refs a {
  color: #9aa3ad !important;
}

html.design-studio .test-topbar :is(
  .hdr-icobtn,
  #btnPrintView,
  #btnExportExcel,
  #btnExportJSON,
  #btnOpenJSONDirect,
  #btnFullscreen,
  #btnCloseCarnet
):hover:not(:disabled) {
  border-color: var(--brand) !important;
  background: var(--brand-soft) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent) !important;
}
html.design-studio #gradebookScrollContainer thead th.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 9%, var(--studio-surface-soft)) !important;
}
html.design-studio #gradebookScrollContainer tbody td.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 7%, var(--studio-surface)) !important;
}
html.design-studio #gradebookScrollContainer tbody tr:hover td.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 12%, var(--studio-surface)) !important;
}
html.design-studio.theme-dark #gradebookScrollContainer thead th.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 16%, var(--studio-surface-soft)) !important;
}
html.design-studio.theme-dark #gradebookScrollContainer tbody td.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 13%, var(--studio-surface)) !important;
}
html.design-studio.theme-dark #gradebookScrollContainer tbody tr:hover td.gb-colored-column {
  background: color-mix(in srgb, var(--assignment-column-color) 19%, var(--studio-surface)) !important;
}
    /* Impressions : aucun décor d'écran, fond blanc, une seule fiche à la fois */
    @media print {
      html, html.design-studio, html body, html.design-studio body, html.design-studio body main.site-layout { background: #fff !important; background-image: none !important; }
      html body #gbSubjectIcon { display: none !important; }
      body:not(.print-student-sheet) #studentIndividualPrintSheet,
      body:not(.print-students) #studentPrintSheet,
      body:not(.print-comp) #compPrintSheet { display: none !important; }
      body.print-observation-grid #observationPrintGrid { zoom: var(--print-fit, 1); border: 0 !important; box-shadow: none !important; padding: 0 !important; }
      body.print-observation-grid main.site-layout { padding: 0 !important; margin: 0 !important; max-width: none !important; min-height: 0 !important; }
      body.print-observation-grid #observationPrintGrid tr,
      body.print-observation-grid #observationPrintGrid .qo-checklist-card { break-inside: avoid; }
    }

/* Choix « Déjà réalisée / Observable » : pastilles flottantes, sans boîte, à la largeur du texte */
html.design-studio .new-evaluation-choices:not(.hidden) {
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  gap: .35rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html.design-studio #newEvaluationChoices > button {
  width: auto;
  white-space: nowrap;
  padding: .35rem .9rem;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, .12));
}

/* « Nouvelle évaluation » : les choix glissent de gauche à droite sur la même ligne et poussent le reste */
html.design-studio .new-eval-popover-wrap { gap: .35rem; }
html.design-studio .new-evaluation-choices:not(.hidden) {
  position: static;
  flex-direction: row;
  align-items: center;
  gap: .35rem;
  overflow: hidden;
  animation: newEvalSlide .28s ease-out both;
}
html.design-studio #newEvaluationChoices > button { filter: none; }
@keyframes newEvalSlide {
  from { max-width: 0; opacity: 0; transform: translateX(-10px); }
  to { max-width: 360px; opacity: 1; transform: none; }
}
html.design-studio.reduce-motion .new-evaluation-choices:not(.hidden),
html.design-studio.reduce-motion .new-evaluation-choices.is-closing { animation: none; }
html.design-studio .new-evaluation-choices.is-closing { animation: newEvalSlideOut .22s ease-in both; pointer-events: none; }
@keyframes newEvalSlideOut {
  from { max-width: 360px; opacity: 1; transform: none; }
  to { max-width: 0; opacity: 0; transform: translateX(-10px); }
}

/* Barres des résultats annuels : plus pâles */
html.design-studio .bar-fill-inner { background: color-mix(in srgb, var(--brand) 38%, var(--studio-surface, #fff)) !important; opacity: 1 !important; }

/* Popups et boutons principaux restants : même pastille pâle */
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(
  #modalUnsavedObservation #btnLeaveObservation, #btnDoneBackupHelp, #btnConfirmBackupPassword, #btnConfirmBackupLoad,
  #btnConfirmTargetLevels, #btnGroupSave, #btnOpenStudentsFromEmpty, #settingsPanel button.is-on
) {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface, #fff)) !important;
  color: var(--brand-deep) !important;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 45%, transparent) !important;
  font-weight: 600 !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) :is(
  #modalUnsavedObservation #btnLeaveObservation, #btnDoneBackupHelp, #btnConfirmBackupPassword, #btnConfirmBackupLoad,
  #btnConfirmTargetLevels, #btnGroupSave, #btnOpenStudentsFromEmpty
):hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand) 10%, var(--studio-surface, #fff)) !important;
}

/* Options d’affichage : boutons Clair / Sombre sans fond encadré */
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-seg {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-seg button {
  padding: .28rem .75rem !important;
  border-radius: 999px !important;
  font-size: .76rem !important;
  font-weight: 600;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-seg button:not(.is-on) {
  background: var(--studio-surface-soft, #f8fafc) !important;
  color: var(--studio-text-muted, #475569) !important;
  border: 1px solid var(--studio-border-strong, #cbd5e1) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-seg button:not(.is-on):hover {
  background: color-mix(in srgb, var(--brand) 10%, var(--studio-surface, #fff)) !important;
  border-color: color-mix(in srgb, var(--brand) 38%, transparent) !important;
  color: var(--brand-deep) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-row {
  padding: .35rem 0;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-color-columns-toggle {
  background: transparent !important;
  border: 0 !important;
  margin: 0 !important;
  padding: .4rem 0 !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-color-columns-toggle .sp-toggle-label {
  color: var(--ink) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-color-columns-toggle small {
  color: var(--studio-text-muted, #64748b) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-switch-track {
  background: var(--studio-surface-soft, #f8fafc) !important;
  border: 1px solid var(--studio-border-strong, #cbd5e1) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #settingsPanel .sp-switch input:checked + .sp-switch-track {
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--studio-surface, #fff)) !important;
  border-color: color-mix(in srgb, var(--brand) 55%, transparent) !important;
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 40%, transparent) !important;
}

/* Carnets multiniveaux : filtre de niveau sans fond, plus lisible et centré */
html.design-studio:is(.theme-dark, :not(.theme-dark)) #gradebookScrollContainer thead .gb-level-seg {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  gap: .25rem .35rem;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #gradebookScrollContainer thead .gb-level-seg button {
  font-size: 12px !important;
  padding: .22rem .55rem !important;
  text-transform: none;
  letter-spacing: 0;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #gradebookScrollContainer thead .gb-level-seg button:not(.is-active) {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--studio-text-muted, #475569) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #gradebookScrollContainer thead .gb-level-seg button:not(.is-active):hover {
  background: color-mix(in srgb, var(--brand) 8%, transparent) !important;
  color: var(--brand-deep) !important;
}

/* Carnet : défilement horizontal (barre fixée au bas de l’écran, dégradés et flèches par évaluation) */
@media screen {
  html.design-studio #gradebookFrame { position: relative; overflow: clip !important; }
  html.design-studio #gradebookScrollContainer { scrollbar-width: none; }
  html.design-studio #gradebookScrollContainer::-webkit-scrollbar { display: none; }
  html.design-studio .gradebook-top-scroll {
    position: sticky;
    bottom: 0;
    z-index: 25;
    height: auto;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--studio-surface, #fff) 90%, transparent);
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--studio-border, #e2e8f0);
    border-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brand) 38%, var(--studio-surface, #fff)) transparent;
  }
  html.design-studio .gradebook-top-scroll:hover { scrollbar-color: color-mix(in srgb, var(--brand) 62%, var(--studio-surface, #fff)) transparent; }
  html.design-studio .gradebook-top-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
  html.design-studio .gb-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 15;
    width: 36px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
  }
  html.design-studio .gb-fade.is-left { left: var(--gb-sticky-w, 0px); background: linear-gradient(to right, color-mix(in srgb, var(--ink, #0f172a) 9%, transparent), transparent); }
  html.design-studio .gb-fade.is-right { right: 0; background: linear-gradient(to left, color-mix(in srgb, var(--ink, #0f172a) 9%, transparent), transparent); }
  html.design-studio #gradebookFrame.gb-can-left .gb-fade.is-left,
  html.design-studio #gradebookFrame.gb-can-right .gb-fade.is-right { opacity: 1; }
  html.design-studio .gb-scroll-arrow {
    position: absolute;
    top: var(--gb-arrow-y, 50%);
    z-index: 30;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent);
    background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface, #fff));
    color: var(--brand-deep);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .14), inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 45%, transparent);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.85);
    transition: opacity .18s ease, transform .18s ease, background-color .15s ease;
  }
  html.design-studio .gb-scroll-arrow svg { width: 18px; height: 18px; }
  html.design-studio .gb-scroll-arrow.is-prev { left: calc(var(--gb-sticky-w, 0px) + 8px); }
  html.design-studio .gb-scroll-arrow.is-next { right: 8px; }
  html.design-studio #gradebookFrame.gb-can-left .gb-scroll-arrow.is-prev,
  html.design-studio #gradebookFrame.gb-can-right .gb-scroll-arrow.is-next { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
  html.design-studio .gb-scroll-arrow:hover { background: color-mix(in srgb, var(--brand) 14%, var(--studio-surface, #fff)); }
  html.design-studio .gb-scroll-arrow:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
}
@media print { .gb-fade, .gb-scroll-arrow, .gradebook-top-scroll { display: none !important; } }
/* Marqueurs d'adaptation : statut de remise en rangée compacte */
html.design-studio .flag-picker { background: var(--studio-surface, #fff); }
html.design-studio .flag-picker-status-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line);
}
html.design-studio .flag-picker-status-label { font-size: 10px; font-weight: 700; color: var(--muted); margin-right: 4px; }
html.design-studio .flag-picker-status {
  font-size: 10.5px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--studio-border-strong, var(--line)); background: transparent; color: var(--muted);
}
html.design-studio .flag-picker-status:hover { background: var(--studio-surface-soft, #f8fafc); color: var(--ink); }
html.design-studio .flag-picker-status.is-active {
  background: color-mix(in srgb, var(--brand) 12%, var(--studio-surface, #fff));
  border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-deep);
}
html.design-studio .flag-picker-code { min-width: 44px; white-space: nowrap; }
html.design-studio .flag-picker-status-label { flex-basis: 100%; margin: 0 0 2px; }
html.design-studio .flag-picker-item.is-active {
  background: color-mix(in srgb, var(--brand) 7%, var(--studio-surface, #fff));
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
}
html.design-studio .flag-picker-item.is-active .flag-picker-code {
  background: color-mix(in srgb, var(--brand) 12%, var(--studio-surface, #fff));
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  color: var(--brand-deep);
}
html.design-studio:not(.theme-dark) .cell-flag-chip {
  background: color-mix(in srgb, var(--brand) 7%, #fff);
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand-deep);
}
html.design-studio .cell-flag-chip { text-transform: none; }
html.design-studio.theme-dark .flag-picker-item.is-active .flag-picker-code { color: var(--ink); }

/* Utilitaires absents de la feuille Tailwind générée : styles sémantiques des éléments dynamiques. */
html.design-studio .modified-expectations > .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--studio-border, var(--line));
}
html.design-studio .modified-expectations .mod-expectation-item {
  min-width: 0;
}
html.design-studio .modified-expectations .mod-expectation-item > span {
  min-width: 0;
}
html.design-studio .modified-expectations .mod-expectation-item > select {
  min-width: 0;
  max-width: 9.5rem;
}
@media screen and (min-width: 640px) {
  html.design-studio .modified-expectations > .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (min-width: 1024px) {
  html.design-studio .modified-expectations > .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

html.design-studio #qoWeightPresetBar .qo-save-perso-btn {
  display: inline-flex;
  flex: 0 0 2rem;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
}
html.design-studio #btnGroupDelete {
  margin-right: auto;
  padding: .5rem .75rem;
  border: 1px solid #f3c7c7;
  border-radius: 8px;
  background: #fff1f2;
  color: #9f1239;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}
html.design-studio #btnGroupDelete:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #881337;
}
html.design-studio.theme-dark #btnGroupDelete {
  background: rgba(244, 63, 94, .16);
  border-color: rgba(251, 113, 133, .4);
  color: #fecdd3;
}
html.design-studio.theme-dark #btnGroupDelete:hover {
  background: rgba(244, 63, 94, .28);
  border-color: rgba(251, 113, 133, .58);
  color: #fff1f2;
}

html.design-studio #gradebookBody :is(button, input).bg-blue-50.text-blue-800 {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1e40af !important;
}
html.design-studio #gradebookBody :is(button, input).bg-blue-50.text-blue-800:hover {
  background: #dbeafe !important;
}
html.design-studio #gradebookBody :is(button, input)[class~="bg-purple-50"] {
  background: #faf5ff !important;
  border-color: #e9d5ff !important;
  color: #6b21a8 !important;
}
html.design-studio #gradebookBody :is(button, input)[class~="bg-purple-50"]:hover {
  background: #f3e8ff !important;
}
html.design-studio.theme-dark #gradebookBody :is(button, input).bg-blue-50.text-blue-800 {
  background: rgba(37, 99, 235, .2) !important;
  border-color: rgba(96, 165, 250, .45) !important;
  color: #bfdbfe !important;
}
html.design-studio.theme-dark #gradebookBody :is(button, input)[class~="bg-purple-50"] {
  background: rgba(126, 34, 206, .22) !important;
  border-color: rgba(192, 132, 252, .45) !important;
  color: #e9d5ff !important;
}

[class~="py-0.2"] {
  padding-top: .05rem;
  padding-bottom: .05rem;
}

html.design-studio #viewGlobalReport .trend-badge.trend-up {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--studio-border, var(--line)));
  color: var(--brand-deep);
}
html.design-studio #viewGlobalReport .trend-badge.trend-down {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
html.design-studio.theme-dark #viewGlobalReport .trend-badge.trend-up {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
html.design-studio.theme-dark #viewGlobalReport .trend-badge.trend-down {
  background: rgba(239, 68, 68, .2);
  border-color: rgba(248, 113, 113, .42);
  color: #fecaca;
}

@media screen and (max-width: 600px) {
  html.design-studio #gradebookScrollContainer {
    --gradebook-student-width: clamp(104px, 28vw, 120px);
  }
  html.design-studio #gradebookHeaderRow > th:first-child,
  html.design-studio #gradebookBody tr > td:first-child {
    width: var(--gradebook-student-width) !important;
    min-width: var(--gradebook-student-width) !important;
    max-width: var(--gradebook-student-width) !important;
  }
  html.design-studio .gradebook-top-scroll {
    margin-inline: 4px;
    bottom: max(4px, env(safe-area-inset-bottom));
    border-radius: 8px;
    border: 1px solid var(--studio-border, var(--line));
    box-shadow: var(--studio-shadow-sm);
  }
}
@media screen and (pointer: coarse), screen and (hover: none) {
  html.design-studio .cell-flag-trigger {
    width: 26px;
    height: 26px;
    opacity: 1;
  }
}

/* Synthèse : lien direct cliquable vers une compétence du Carnet */
html.design-studio .gr-subject-jump {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px 2px 2px;
  margin-left: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}
html.design-studio .gr-bar-subject-wrap .gr-subject-jump {
  color: var(--studio-text);
  font-size: .84rem;
  font-weight: 750;
}
html.design-studio .gr-evaluation-count {
  flex: 0 0 auto;
  margin-left: .18rem;
  color: var(--studio-text-muted);
  font-size: .67rem;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
}
html.design-studio .ps-title .gr-subject-jump--presco {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
html.design-studio .gr-subject-jump-label {
  min-width: 0;
  transition: transform .16s ease;
}
html.design-studio .gr-bar-subject-wrap .gr-subject-jump-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.design-studio .gr-subject-jump-arrow {
  display: inline-block;
  flex: 0 0 auto;
  font-size: .9em;
  line-height: 1;
  color: var(--brand);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
html.design-studio .gr-subject-jump:hover,
html.design-studio .gr-subject-jump:focus-visible {
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  color: var(--brand-deep);
}
html.design-studio .gr-subject-jump:hover .gr-subject-jump-label,
html.design-studio .gr-subject-jump:focus-visible .gr-subject-jump-label {
  transform: translateX(2px);
  text-decoration: underline;
  text-underline-offset: 2px;
}
html.design-studio .gr-subject-jump:hover .gr-subject-jump-arrow,
html.design-studio .gr-subject-jump:focus-visible .gr-subject-jump-arrow {
  opacity: 1;
  transform: translateX(1px);
}
html.design-studio .gr-subject-jump:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

html.design-studio .gr-student-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: .16rem;
  border: 1px solid var(--studio-border);
  border-radius: 9px;
  background: var(--studio-surface-soft);
}
html.design-studio .gr-student-view-toggle button {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.7rem;
  padding: .2rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--studio-text-muted);
  cursor: pointer;
}
html.design-studio .gr-student-view-toggle button svg {
  width: 1rem;
  height: 1rem;
}
html.design-studio .gr-student-view-toggle button:hover,
html.design-studio .gr-student-view-toggle button.is-active {
  background: var(--studio-surface);
  color: var(--brand-deep);
  box-shadow: var(--studio-shadow-sm);
}
html.design-studio .gr-student-sort-toggle {
  display: inline-flex;
  align-items: center;
  padding: .16rem;
  border: 1px solid var(--studio-border);
  border-radius: 9px;
  background: var(--studio-surface-soft);
}
html.design-studio .gr-student-sort-toggle button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 1.7rem;
  padding: 0 .58rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--studio-text-muted);
  font-size: .74rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
html.design-studio .gr-student-sort-toggle .sort-icon {
  width: .78rem;
  height: .78rem;
  flex: 0 0 auto;
  opacity: .72;
}
html.design-studio .gr-student-sort-toggle button.is-active .sort-icon {
  opacity: 1;
}
html.design-studio .gr-student-sort-toggle button:hover,
html.design-studio .gr-student-sort-toggle button.is-active {
  background: var(--studio-surface);
  color: var(--brand-deep);
  box-shadow: var(--studio-shadow-sm);
}
html.design-studio #grStudentBand.is-select {
  display: block;
  width: 100%;
}
html.design-studio .gr-student-select {
  width: min(100%, 34rem);
  min-height: 2.35rem;
  padding: .45rem 2.2rem .45rem .75rem;
  border: 1px solid var(--studio-border-strong);
  border-radius: 9px;
  background: var(--studio-surface);
  color: var(--studio-text);
  font-size: .84rem;
  font-weight: 650;
  cursor: pointer;
}
html.design-studio.theme-dark .gr-subject-jump:hover,
html.design-studio.theme-dark .gr-subject-jump:focus-visible {
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  color: #ffffff;
}
@media print {
  html.design-studio .gr-subject-jump {
    display: inline;
    padding: 0;
    margin: 0;
    background: transparent !important;
  }
  html.design-studio .gr-subject-jump-arrow {
    display: none !important;
  }
}

/* Carnet : clignotement 3x d'une rangée élève ciblée depuis la Synthèse */
@keyframes gbStudentRowFlash {
  0%, 100% {
    box-shadow: none;
  }
  45% {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, var(--brand) 65%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--brand) 65%, transparent),
      inset 0 0 0 9999px color-mix(in srgb, var(--brand) 20%, transparent);
  }
}
@keyframes gbStudentRowFlashDark {
  0%, 100% {
    box-shadow: none;
  }
  45% {
    box-shadow:
      inset 0 2px 0 color-mix(in srgb, var(--brand) 85%, transparent),
      inset 0 -2px 0 color-mix(in srgb, var(--brand) 85%, transparent),
      inset 0 0 0 9999px color-mix(in srgb, var(--brand) 30%, transparent);
  }
}
html.design-studio #gradebookBody tr.gb-row-flash > td {
  animation: gbStudentRowFlash .55s ease-in-out 3 !important;
}
html.design-studio.theme-dark #gradebookBody tr.gb-row-flash > td {
  animation: gbStudentRowFlashDark .55s ease-in-out 3 !important;
}
html.design-studio.reduce-motion #gradebookBody tr.gb-row-flash > td,
html.design-studio.theme-dark.reduce-motion #gradebookBody tr.gb-row-flash > td {
  animation: none !important;
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--brand) 16%, transparent);
}

/* ==========================================================================
   ACCUEIL PORTAIL (ÉTAT 1) & TABLEAU DE BORD DE SESSION (ÉTAT 2)
   ========================================================================== */
@keyframes homeFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dashPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 32%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 0%, transparent); }
}

/* Sidebar : marque active lorsque le tableau de bord est affiché */
html.design-studio .test-sidebar-brand.is-active {
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--studio-surface, #fff));
  border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 10%, transparent);
}
html.design-studio .test-sidebar-brand.is-active :is(h1, .brand-heading) {
  color: var(--brand-deep);
}
html.design-studio.theme-dark .test-sidebar-brand.is-active {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}
html.design-studio.theme-dark .test-sidebar-brand.is-active :is(h1, .brand-heading) {
  color: #ffffff;
}

#viewHome .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mode Portail (aucun groupe actif) : masquer sidebar & topbar, centrer le portail */
html.design-studio.no-active-group aside.test-sidebar,
html.design-studio.no-active-group header.test-topbar {
  display: none !important;
}
html.design-studio.no-active-group body {
  background-image:
    radial-gradient(ellipse 64% 52% at 18% 8%, color-mix(in srgb, var(--mist-a, var(--accent)) 18%, transparent), transparent 68%),
    radial-gradient(ellipse 58% 50% at 86% 14%, color-mix(in srgb, var(--mist-b, var(--brand)) 15%, transparent), transparent 68%),
    radial-gradient(ellipse 52% 40% at 50% 96%, color-mix(in srgb, var(--mist-a, var(--brand)) 9%, transparent), transparent 72%),
    linear-gradient(155deg, color-mix(in srgb, var(--mist-a, var(--brand)) 6%, var(--studio-bg)) 0%, var(--studio-bg) 48%, color-mix(in srgb, var(--mist-b, var(--brand)) 8%, var(--studio-bg)) 100%) !important;
  background-attachment: fixed !important;
}
html.design-studio.no-active-group main.site-layout {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 !important;
}
html.design-studio.no-active-group #viewHome {
  position: relative;
  isolation: isolate;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: homeInterfaceReveal .35s ease-out both;
}
#viewHome::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 32%, color-mix(in srgb, var(--brand) 16%, transparent) 0 1.5px, transparent 4px),
    radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--brand) 12%, transparent) 0 2px, transparent 5px),
    radial-gradient(circle at 58% 68%, color-mix(in srgb, var(--brand) 14%, transparent) 0 1.5px, transparent 5px),
    radial-gradient(circle at 35% 78%, color-mix(in srgb, var(--brand) 10%, transparent) 0 2px, transparent 6px),
    radial-gradient(ellipse at center, color-mix(in srgb, var(--studio-surface) 92%, transparent), transparent 68%);
  background-size: 110px 110px, 150px 150px, 130px 130px, 170px 170px, 100% 100%;
  filter: blur(5px);
  opacity: 0;
  animation: homeMistReform .35s ease-out both;
}
#viewHome > * {
  position: relative;
  z-index: 1;
}
@keyframes homeInterfaceReveal {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: scale(.995);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}
@keyframes homeMistReform {
  0% {
    opacity: .75;
    filter: blur(11px);
    background-position: -18px 12px, 22px -8px, -12px 16px, 18px -14px, center;
  }
  55% {
    opacity: .38;
  }
  100% {
    opacity: 0;
    filter: blur(5px);
    background-position: 0 0, 0 0, 0 0, 0 0, center;
  }
}

#viewHome.hidden,
#homePortal[hidden],
#homeDashboard[hidden],
#homeLegacyBrowserNotice.hidden,
#dashSaveNotice.hidden {
  display: none !important;
}

/* Boutons pastilles unifiés (alignés sur le reste du site) */
#viewHome .home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  min-height: 2.38rem;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.22, .68, .32, 1), background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .18s ease;
}
#viewHome .home-btn svg {
  width: .98rem;
  height: .98rem;
  flex: 0 0 auto;
}
#viewHome .home-btn-sm {
  min-height: 2.08rem;
  padding: .38rem .88rem;
  font-size: .78rem;
}
#viewHome .home-btn-primary {
  background: color-mix(in srgb, var(--brand-soft) 68%, var(--studio-surface, #fff));
  color: var(--brand-deep);
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 42%, transparent);
}
#viewHome .home-btn-primary:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 55%, transparent), 0 4px 12px color-mix(in srgb, var(--brand) 14%, transparent);
}
#viewHome .home-btn-primary:active {
  transform: translateY(0) scale(.985);
}
#viewHome .home-btn-secondary {
  background: var(--studio-surface);
  color: var(--studio-text);
  border-color: var(--studio-border-strong);
  box-shadow: var(--studio-shadow-sm);
}
#viewHome .home-btn-secondary:hover {
  background: var(--studio-surface-soft);
  color: var(--brand-deep);
  border-color: var(--brand);
  transform: translateY(-1px);
}
#viewHome .home-btn-secondary:active {
  transform: translateY(0) scale(.985);
}
#viewHome .home-actions-grid .home-btn {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 42%, transparent);
}
#viewHome .home-actions-grid .home-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: var(--brand);
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand) 55%, transparent), 0 4px 12px color-mix(in srgb, var(--brand) 14%, transparent);
}
#viewHome .home-actions-grid .home-btn:active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
#viewHome :is(.home-btn, .dash-inline-link, .dash-subject-card, .dash-followup-item, .dash-group-open, .dash-group-edit):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
#viewHome .home-arrow {
  display: inline-block;
  transition: transform .18s cubic-bezier(.22, .68, .32, 1);
}
#viewHome :is(.home-btn, .dash-inline-link, .dash-subject-card, .dash-followup-item, .dash-group-open):hover .home-arrow,
#viewHome :is(.home-btn, .dash-inline-link, .dash-subject-card, .dash-followup-item, .dash-group-open):focus-visible .home-arrow {
  transform: translateX(3px);
}
#viewHome .home-chevron {
  display: inline-block;
  font-size: .92rem;
  line-height: 1;
  opacity: .75;
  transition: transform .24s cubic-bezier(.22, .68, .32, 1);
}
#viewHome [aria-expanded="true"] .home-chevron {
  transform: rotate(180deg);
}

/* Badges de disponibilité */
#viewHome .home-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .54rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
#viewHome .home-status-badge svg {
  width: .72rem;
  height: .72rem;
  flex: 0 0 auto;
}
#viewHome .home-status-badge.is-available {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
#viewHome .home-status-badge.is-soon {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
html.design-studio.theme-dark #viewHome .home-status-badge.is-available {
  background: rgba(34, 197, 94, .16);
  color: #86efac;
  border-color: rgba(34, 197, 94, .3);
}
html.design-studio.theme-dark #viewHome .home-status-badge.is-soon {
  background: rgba(245, 158, 11, .14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .28);
}

/* ÉTAT 1 — PORTAIL D'ACCUEIL UNIFIÉ (UNE SEULE BOÎTE HARMONIEUSE) */
.home-portal {
  width: min(100%, 840px);
  margin: 0 auto;
}
.home-portal-shell {
  padding: clamp(1.6rem, 3.5vw, 2.35rem) clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 22px;
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  box-shadow: var(--studio-shadow-md);
  display: grid;
  gap: 1.35rem;
  animation: homeFadeUp .32s cubic-bezier(.22, .68, .32, 1) both;
}
.home-portal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--studio-border);
}
.home-portal-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
}
.home-edition {
  align-self: flex-end;
  margin: 0 0 .08rem -.25rem;
  color: var(--studio-text-muted);
  font-size: .78rem;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
}
.home-portal-brand h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  font-weight: 800;
  color: var(--studio-text);
  line-height: 1.1;
}
.home-year-pill {
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--studio-border));
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.home-portal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .85rem;
}
.home-portal-links :is(button, a) {
  padding: .3rem .55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--studio-text-muted);
  font-size: .79rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.home-portal-links :is(button, a):hover {
  color: var(--brand-deep);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.home-portal-links :is(button, a):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.home-legacy-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, .42);
  background: #fffbeb;
  color: #78350f;
}
.home-legacy-banner p {
  margin: 0;
  font-size: .81rem;
  font-weight: 600;
  line-height: 1.4;
}
.home-legacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
html.design-studio.theme-dark .home-legacy-banner {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(251, 191, 36, .35);
  color: #fde68a;
}

/* Zone Reprendre un carnet intégrée avec glisser-déposer */
.home-resume-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.4rem;
  padding: 1.2rem 1.4rem;
  border-radius: 15px;
  border: 1.5px dashed var(--studio-border-strong);
  background: var(--studio-surface-soft);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.home-resume-band.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
  transform: scale(1.005);
}
.home-resume-copy {
  display: flex;
  align-items: center;
  gap: .95rem;
  min-width: 0;
  flex: 1 1 280px;
}
.home-resume-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.home-resume-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}
.home-resume-band.is-dragover .home-resume-icon {
  transform: scale(1.08);
  background: var(--brand);
  color: #fff;
}
.home-resume-copy h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--studio-text);
}
.home-resume-copy p {
  margin: .22rem 0 0;
  font-size: .81rem;
  color: var(--studio-text-muted);
  line-height: 1.45;
}

/* Grille 2 boîtes égales (largeur et hauteur strictement identiques) */
.home-levels-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.15rem;
}
.home-level-card {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.4rem 1.45rem;
  border-radius: 16px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface-soft);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.home-level-card.is-primary {
  position: relative;
  overflow: hidden;
  background: var(--studio-surface);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--studio-border));
  box-shadow: var(--studio-shadow-sm);
}
.home-level-card.is-primary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand);
  pointer-events: none;
}
.home-level-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.home-level-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.home-level-icon svg {
  width: 1.18rem;
  height: 1.18rem;
}
.home-level-card.is-coming-soon .home-level-icon {
  background: color-mix(in srgb, var(--studio-text-muted) 11%, transparent);
  color: var(--studio-text-muted);
}
.home-level-title-wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  flex: 1 1 auto;
}
.home-level-title-wrap h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--studio-text);
  line-height: 1.25;
  white-space: nowrap;
}
.home-level-desc {
  margin: 0;
  font-size: .82rem;
  color: var(--studio-text-muted);
  line-height: 1.5;
}
.home-level-actions {
  margin-top: auto;
  padding-top: .45rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

/* Accordéon pleine largeur sous les deux boîtes */
.home-demo-collapse {
  display: block;
  overflow: hidden;
  height: 0;
  opacity: 0;
  margin-top: -1rem;
  pointer-events: none;
  will-change: height, opacity;
  transition: height .28s cubic-bezier(.22, .68, .32, 1), opacity .22s ease, margin-top .28s cubic-bezier(.22, .68, .32, 1);
}
.home-demo-collapse.is-open {
  opacity: 1;
  margin-top: 0;
  pointer-events: auto;
}
.home-demo-collapse-inner {
  min-height: 0;
}
.home-demo-collapse .home-demo-box {
  transform: translateY(-6px);
  transition: transform .28s cubic-bezier(.22, .68, .32, 1);
}
.home-demo-collapse.is-open .home-demo-box {
  transform: translateY(0);
}
.home-demo-box {
  padding: 1.2rem 1.3rem;
  border-radius: 15px;
  background: var(--studio-surface-soft);
  border: 1px solid var(--studio-border);
}
.home-demo-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.home-demo-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  min-height: 2.65rem;
  padding: .62rem .8rem;
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  background: var(--studio-surface);
  color: var(--studio-text);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.home-demo-option:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface));
}
.home-demo-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}
#viewHome .home-demo-option input[type="radio"] {
  flex: 0 0 auto;
  width: .92rem;
  height: .92rem;
  margin: 0;
  border: 0 !important;
  border-radius: 999px !important;
  background-color: transparent !important;
  accent-color: var(--brand);
  cursor: pointer;
}
.home-demo-option span {
  min-width: 0;
}
.studio-pale-primary {
  color: var(--brand-deep);
  border: 1px solid var(--studio-border-strong);
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface, #fff));
  box-shadow: none;
}
.studio-pale-primary:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--studio-surface, #fff));
}
#btnLeaveObservation {
  color: #9f1239 !important;
  border: 1px solid #fecdd3;
  background: #fff1f2 !important;
  box-shadow: none;
}
#btnLeaveObservation:hover {
  border-color: #fb7185;
  background: #ffe4e6 !important;
}
.ilss-summary-section,
.ilss-summary-grid > section,
.ilss-summary-term {
  background: var(--studio-surface, #fff) !important;
}
.ilss-summary-term {
  border: 1px solid var(--studio-border, #e2e8f0);
}
.gb-grade-group-start > td {
  border-top: 2px solid #c7d2fe;
}
.gb-grade-group-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 3px;
  padding: 0 5px;
  border: 1px solid var(--studio-border, #e2e8f0);
  border-radius: 4px;
  color: var(--brand, #4f46e5);
  background: var(--brand-soft, #eef2ff);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: .01em;
  white-space: nowrap;
}
.home-demo-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .85rem;
  padding: 0 2px .15rem;
}
.home-demo-note {
  font-size: .74rem;
  color: var(--studio-text-muted);
}

.home-portal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--studio-border);
  color: var(--studio-text-muted);
  font-size: .77rem;
  text-align: center;
}
.home-portal-footer svg {
  width: .95rem;
  height: .95rem;
  flex: 0 0 auto;
  color: var(--brand);
}
.home-portal-footer p {
  margin: 0;
  line-height: 1.4;
}

/* Accueil — mêmes surfaces et boutons que le reste de l’application */
.home-portal {
  width: 100%;
  max-width: none;
  margin: 0;
}
html.no-active-group #homePortal {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.home-portal-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.home-portal-header {
  width: 100%;
  padding: 1.05rem clamp(1.25rem, 2.4vw, 2rem);
  border-bottom: 0;
}
html:not(.no-active-group) .home-portal-header {
  padding: .15rem 0 .75rem;
}
.home-portal-main {
  flex: 1 1 auto;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 1.5rem) clamp(2.5rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
html:not(.no-active-group) .home-portal-main {
  justify-content: flex-start;
  padding: 1rem 0 2rem;
}
.home-welcome {
  padding: 0;
}
.home-welcome h2 {
  margin: 0;
  color: var(--studio-text);
  font-size: clamp(1.25rem, 2.2vw, 1.48rem);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.home-welcome p {
  margin: .2rem 0 0;
  color: var(--studio-text-muted);
  font-size: .82rem;
}
.home-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1rem;
}
.home-action-card {
  display: flex;
  min-width: 0;
  min-height: 13.5rem;
  flex-direction: column;
  align-items: flex-start;
  gap: .7rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--studio-surface) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--studio-shadow-sm);
  transition: transform .18s cubic-bezier(.22, .68, .32, 1), border-color .16s ease, box-shadow .18s ease, background-color .16s ease;
}
.home-action-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--studio-border));
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--brand) 18%, rgba(15, 23, 42, .12));
}
.home-action-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.home-action-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.home-action-copy,
.home-action-copy.home-resume-copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}
.home-action-copy h2 {
  margin: 0;
  color: var(--studio-text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}
.home-action-copy p {
  margin: .28rem 0 0;
  color: var(--studio-text-muted);
  font-size: .78rem;
  line-height: 1.5;
}
.home-action-card .home-btn {
  margin-top: .1rem;
}
.home-resume-band {
  justify-content: flex-start;
  border-style: solid;
  background: color-mix(in srgb, var(--studio-surface) 90%, transparent);
}
.home-resume-band.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.home-resume-band .home-resume-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9px;
}
.home-coming-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .45rem .85rem;
  width: fit-content;
  max-width: 100%;
  margin: .65rem auto 0;
  padding: .58rem 1.05rem;
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--studio-surface) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--studio-shadow-sm);
  color: var(--studio-text-muted);
  font-size: .76rem;
}
.home-coming-soon-label {
  padding: .18rem .45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--studio-text-muted) 10%, transparent);
  color: var(--studio-text-muted);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.home-coming-soon p {
  flex: 0 1 auto;
  margin: 0;
  line-height: 1.45;
}
.home-coming-soon p strong {
  color: var(--studio-text);
}
.home-coming-soon a {
  color: var(--brand-deep);
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  margin-left: .2rem;
}
.home-coming-soon a:hover {
  text-decoration: underline;
}
.home-portal-footer {
  padding-top: .85rem;
}

/* Pastille du bilan dans la barre latérale */
.sidebar-dash-badge {
  margin-left: auto;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .38rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1;
}
.sidebar-dash-badge.hidden {
  display: none !important;
}

/* ÉTAT 2 — BILAN DE CLASSE / TABLEAU DE BORD */
.home-dashboard {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
  animation: dashFadeIn .22s ease-out;
}
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
}
.dash-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.dash-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 800;
  color: var(--studio-text);
}
.dash-subtitle {
  margin: .18rem 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--studio-text-muted);
}
.dash-term-picker {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .22rem;
  border: 1px solid var(--studio-border);
  border-radius: 9px;
  background: var(--studio-surface-soft);
}
.dash-term-picker button {
  min-height: 2.2rem;
  padding: .42rem .68rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--studio-text-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.dash-term-picker button:hover {
  color: var(--brand-deep);
  background: var(--studio-surface);
}
.dash-term-picker button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--studio-border));
  background: var(--brand-soft);
  color: var(--brand-deep);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand) 28%, transparent);
}
.dash-term-picker button:focus-visible,
.dash-privacy-btn:focus-visible,
.dash-tabs button:focus-visible,
.dash-mini-seg button:focus-visible,
.dash-action-row:focus-visible,
.dash-comp-open:focus-visible,
.dash-radar-filter-pill:focus-visible,
.dash-radar-name:focus-visible,
.dash-subj-pill:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.dash-privacy-btn {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 2.2rem;
  padding: .42rem .82rem;
  border: 1px solid var(--studio-border-strong);
  border-radius: 999px;
  background: var(--studio-surface-soft);
  color: var(--studio-text-muted);
  font-size: .76rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.dash-privacy-btn svg {
  width: .95rem;
  height: .95rem;
  flex: 0 0 auto;
}
.dash-privacy-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--studio-border-strong));
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.dash-privacy-btn[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--brand) 48%, transparent);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* Bandeau d'avertissement sauvegarde (texte seul, sans bouton) */
.dash-save-notice {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(217, 119, 6, .34);
  background: #fffbeb;
  color: #78350f;
  font-size: .81rem;
  font-weight: 600;
  line-height: 1.4;
}
.dash-save-notice svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: #d97706;
}
.dash-save-notice p {
  margin: 0;
}
.dash-save-notice[data-status="error"] {
  border-color: rgba(220, 38, 38, .36);
  background: #fef2f2;
  color: #7f1d1d;
}
.dash-save-notice[data-status="error"] svg {
  color: #dc2626;
}
html.design-studio.theme-dark .dash-save-notice {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(251, 191, 36, .32);
  color: #fde68a;
}
html.design-studio.theme-dark .dash-save-notice svg {
  color: #fbbf24;
}
html.design-studio.theme-dark .dash-save-notice[data-status="error"] {
  background: rgba(239, 68, 68, .13);
  border-color: rgba(248, 113, 113, .34);
  color: #fecaca;
}
html.design-studio.theme-dark .dash-save-notice[data-status="error"] svg {
  color: #f87171;
}

/* Panneau principal du bilan de classe */
.dash-panel {
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  box-shadow: var(--studio-shadow-sm);
  display: grid;
  gap: 1.2rem;
}
.dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.dash-panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--studio-text);
}
.dash-panel-sub {
  margin: .18rem 0 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--studio-text-muted);
}

/* Onglets À faire / Vigie élèves */
.dash-tabs {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  background: var(--studio-surface-soft);
}
.dash-tabs.hidden {
  display: none !important;
}
.dash-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.15rem;
  padding: .35rem .85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--studio-text-muted);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dash-tabs button:hover {
  color: var(--brand-deep);
}
.dash-tabs button[aria-selected="true"] {
  background: var(--studio-surface);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--studio-border));
  color: var(--brand-deep);
  box-shadow: var(--studio-shadow-sm);
}
.dash-tab-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .7rem;
  font-weight: 800;
}

.dash-tab-panel {
  display: grid;
  gap: 1.25rem;
}
.dash-tab-panel.hidden {
  display: none !important;
}

.dash-empty-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px dashed var(--studio-border-strong);
  background: var(--studio-surface-soft);
}
.dash-empty-state.hidden {
  display: none !important;
}
.dash-empty-copy {
  flex: 1 1 320px;
  display: grid;
  gap: .45rem;
}
.dash-empty-copy h4 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: var(--studio-text);
}
.dash-empty-copy ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: .28rem;
  font-size: .82rem;
  color: var(--studio-text-muted);
  line-height: 1.45;
}

.dash-subblock {
  display: grid;
  gap: .65rem;
}
.dash-subblock.hidden {
  display: none !important;
}
.dash-subblock-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.dash-subblock-title {
  margin: 0;
  font-size: .77rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--studio-text-muted);
}

.dash-mini-seg {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  padding: .18rem;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  background: var(--studio-surface-soft);
}
.dash-mini-seg.hidden {
  display: none !important;
}
.dash-mini-seg button {
  padding: .24rem .62rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--studio-text-muted);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.dash-mini-seg button[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* Listes d'actions (À débloquer, En cours, Reprises, Commentaires prioritaires) */
.dash-action-list {
  display: grid;
  gap: .48rem;
}
.dash-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
  width: 100%;
  padding: .68rem .92rem;
  border-radius: 12px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface-soft);
  color: var(--studio-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dash-action-row:hover {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--studio-border));
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--studio-surface));
}
.dash-action-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .42rem .68rem;
  min-width: 0;
  flex: 1 1 280px;
}
.dash-action-copy {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.dash-action-copy strong {
  font-size: .84rem;
  font-weight: 800;
  color: var(--studio-text);
}
.dash-action-copy small {
  font-size: .75rem;
  color: var(--studio-text-muted);
  line-height: 1.35;
}
.dash-action-cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-left: auto;
  font-size: .77rem;
  font-weight: 700;
  color: var(--brand-deep);
  white-space: nowrap;
}
.dash-badge {
  flex: 0 0 auto;
  padding: .16rem .52rem;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 800;
  line-height: 1.25;
}
.dash-badge.is-brand {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
}
.dash-badge.is-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.dash-badge.is-neutral {
  background: var(--studio-surface);
  color: var(--studio-text-muted);
  border: 1px solid var(--studio-border-strong);
}
html.design-studio.theme-dark .dash-badge.is-warn {
  background: rgba(245, 158, 11, .14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .28);
}

.dash-calm-card {
  margin: 0;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface-soft);
  color: var(--studio-text-muted);
  font-size: .82rem;
  display: grid;
  gap: .55rem;
}
.dash-calm-card p {
  margin: 0;
}
.dash-more-note,
.dash-justified-note {
  margin: .15rem 0 0;
  font-size: .75rem;
  color: var(--studio-text-muted);
}
.dash-justified-note.hidden {
  display: none !important;
}

/* Couverture par compétence officielle (non fusionnée) */
.dash-comp-list {
  display: grid;
  gap: .6rem;
}
.dash-comp-list.is-presco {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dash-dist-help {
  grid-column: 1 / -1;
  margin: 0 0 .1rem;
  color: var(--studio-text-muted);
  font-size: .76rem;
  line-height: 1.4;
}
.dash-subject-group {
  min-width: 0;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  background: var(--studio-surface-soft);
}
.dash-subject-group summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .72rem .85rem;
  color: var(--studio-text);
  font-size: .84rem;
  cursor: pointer;
  list-style: none;
}
.dash-subject-group summary::-webkit-details-marker { display: none; }
.dash-subject-group summary::after {
  content: '›';
  color: var(--brand-deep);
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(90deg);
}
.dash-subject-group[open] summary::after { transform: rotate(-90deg); }
.dash-subject-group summary:hover { color: var(--brand-deep); }
.dash-subject-group summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 12px;
}
.dash-subject-count {
  margin-left: auto;
  color: var(--studio-text-muted);
  font-size: .73rem;
  white-space: nowrap;
}
.dash-subject-competencies {
  display: grid;
  gap: .5rem;
  padding: 0 .6rem .6rem;
}
.dash-comp-row {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface-soft);
  overflow: hidden;
  transition: border-color .15s ease, background-color .15s ease;
}
.dash-comp-row:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--studio-border));
  background: var(--studio-surface);
}
.dash-comp-open {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: .36rem;
  padding: .72rem .85rem;
  border: 0;
  background: transparent;
  color: var(--studio-text);
  text-align: left;
  cursor: pointer;
}
.dash-comp-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.dash-subject-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--brand);
}
.dash-comp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .83rem;
  font-weight: 800;
  color: var(--studio-text);
}
.dash-comp-weight {
  flex: 0 0 auto;
  margin-left: auto;
  padding: .08rem .42rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .69rem;
  font-weight: 800;
}
.dash-comp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .65rem;
  font-size: .73rem;
  color: var(--studio-text-muted);
}
.dash-comp-meta .is-muted {
  opacity: .8;
}
.dash-comp-wstate {
  font-weight: 700;
}
.dash-comp-wstate.is-ok { color: #15803d; }
.dash-comp-wstate.is-warn { color: #b45309; }
html.design-studio.theme-dark .dash-comp-wstate.is-ok { color: #86efac; }
html.design-studio.theme-dark .dash-comp-wstate.is-warn { color: #fbbf24; }

.dash-dist-bar {
  display: flex;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  gap: 1.5px;
  background: color-mix(in srgb, var(--studio-border-strong) 45%, transparent);
}
.dash-dist-seg {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.dash-dist-seg.is-k-A,
.dash-dist-seg.is-k-4 { background: #16a34a; }
.dash-dist-seg.is-k-B,
.dash-dist-seg.is-k-3 { background: #2563eb; }
.dash-dist-seg.is-k-C,
.dash-dist-seg.is-k-2 { background: #d97706; }
.dash-dist-seg.is-k-D,
.dash-dist-seg.is-k-1 { background: #ea580c; }
.dash-dist-seg.is-k-E { background: #dc2626; }
.dash-dist-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .65rem;
  font-size: .7rem;
  line-height: 1.4;
  color: var(--studio-text-muted);
}
.dash-dist-key {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.dash-dist-key::before {
  content: '';
  width: .5rem;
  height: .5rem;
  flex: 0 0 auto;
  border-radius: 50%;
}
.dash-dist-key.is-k-A::before,
.dash-dist-key.is-k-4::before { background: #16a34a; }
.dash-dist-key.is-k-B::before,
.dash-dist-key.is-k-3::before { background: #2563eb; }
.dash-dist-key.is-k-C::before,
.dash-dist-key.is-k-2::before { background: #d97706; }
.dash-dist-key.is-k-D::before,
.dash-dist-key.is-k-1::before { background: #ea580c; }
.dash-dist-key.is-k-E::before { background: #dc2626; }


/* Vigie élèves */
.dash-radar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.dash-radar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}
.dash-radar-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .34rem .72rem;
  border-radius: 999px;
  border: 1px solid var(--studio-border-strong);
  background: var(--studio-surface-soft);
  color: var(--studio-text-muted);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dash-radar-filter-pill:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--studio-border-strong));
  color: var(--brand-deep);
}
.dash-radar-filter-pill[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.dash-filter-count {
  padding: .05rem .38rem;
  border-radius: 999px;
  background: var(--studio-surface);
  font-size: .68rem;
  font-weight: 800;
}
.dash-radar-list {
  display: grid;
  gap: .65rem;
}
.dash-radar-row {
  display: grid;
  gap: .5rem;
  padding: .85rem .95rem;
  border-radius: 13px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface-soft);
}
.dash-radar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem .8rem;
}
.dash-radar-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.dash-radar-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--studio-text);
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}
.dash-radar-name:hover {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dash-chip.is-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
html.design-studio.theme-dark .dash-chip.is-warn {
  background: rgba(245, 158, 11, .14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .28);
}
.dash-radar-signals,
.dash-radar-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .36rem;
}
.dash-signal-chip {
  padding: .16rem .52rem;
  border-radius: 999px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface);
  color: var(--studio-text-muted);
  font-size: .71rem;
  font-weight: 700;
}
button.dash-signal-chip {
  cursor: pointer;
}
button.dash-signal-chip:hover {
  border-color: var(--brand);
}
.dash-signal-chip.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.dash-signal-chip.is-brand {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand-deep);
}
html.design-studio.theme-dark .dash-signal-chip.is-warn {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .28);
  color: #fde68a;
}
.dash-subj-pill {
  padding: .18rem .5rem;
  border-radius: 7px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface);
  color: var(--studio-text-muted);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
}
.dash-subj-pill:hover {
  border-color: var(--brand);
}
.dash-subj-pill.is-ok {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(22, 163, 74, .09);
  color: #166534;
}
.dash-subj-pill.is-mid {
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.dash-subj-pill.is-warn,
.dash-subj-pill.is-alert {
  border-color: rgba(217, 119, 6, .34);
  background: #fffbeb;
  color: #92400e;
}
html.design-studio.theme-dark .dash-subj-pill.is-ok {
  background: rgba(34, 197, 94, .14);
  border-color: rgba(134, 239, 172, .28);
  color: #86efac;
}
html.design-studio.theme-dark .dash-subj-pill.is-warn,
html.design-studio.theme-dark .dash-subj-pill.is-alert {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(251, 191, 36, .3);
  color: #fde68a;
}

/* Grille des groupes du carnet */
.dash-groups-section {
  display: grid;
  gap: .75rem;
}
.dash-groups-section[hidden] {
  display: none !important;
}
.dash-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.dash-section-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.dash-section-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--studio-text);
}
.dash-count-pill {
  padding: .1rem .48rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .72rem;
  font-weight: 800;
}
.dash-inline-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .68rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-deep);
  font-size: .79rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}
.dash-inline-link:hover {
  background: var(--brand-soft);
}
.dash-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: .85rem;
}
.dash-group-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  border: 1px solid var(--studio-border);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow-sm);
  overflow: hidden;
  transition: transform .18s cubic-bezier(.22, .68, .32, 1), border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.dash-group-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--studio-border));
  box-shadow: var(--studio-shadow-md);
}
.dash-group-card.is-active {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--studio-border));
  box-shadow: var(--studio-shadow-sm);
}
.dash-group-card.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3.5px;
  background: var(--brand);
  pointer-events: none;
  z-index: 1;
}
.dash-group-card.is-active:hover {
  box-shadow: var(--studio-shadow-md);
}
.dash-group-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .42rem;
  width: 100%;
  height: 100%;
  padding: 1.15rem 2.8rem 1.05rem 1.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-group-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  width: 100%;
}
.dash-group-name {
  font-size: .95rem;
  font-weight: 800;
  color: var(--studio-text);
  overflow-wrap: anywhere;
}
.dash-group-badges {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.dash-chip {
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 800;
  line-height: 1.25;
}
.dash-chip.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.dash-chip.is-demo {
  background: var(--studio-surface-soft);
  color: var(--studio-text-muted);
  border: 1px solid var(--studio-border);
}
.dash-group-meta {
  font-size: .79rem;
  font-weight: 650;
  color: var(--studio-text-muted);
}
.dash-group-stats {
  font-size: .75rem;
  color: var(--studio-text-muted);
  opacity: .9;
}
.dash-group-foot {
  margin-top: auto;
  padding-top: .35rem;
}
.dash-group-open-label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .77rem;
  font-weight: 700;
  color: var(--brand-deep);
}
.dash-group-edit {
  position: absolute;
  top: .7rem;
  right: .7rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--studio-text-muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.dash-group-edit:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
}
.dash-group-edit svg {
  width: .92rem;
  height: .92rem;
}
.dash-group-card--add {
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 8.5rem;
  padding: 1.15rem;
  border: 1.5px dashed var(--studio-border-strong);
  background: var(--studio-surface-soft);
  box-shadow: none;
  text-align: center;
  cursor: pointer;
  color: var(--studio-text);
}
.dash-group-card--add:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.dash-add-plus {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--brand);
}
.dash-group-card--add strong {
  font-size: .88rem;
  font-weight: 800;
}
.dash-group-card--add span:last-child {
  font-size: .74rem;
  color: var(--studio-text-muted);
}

/* Fusion courte lors du changement de carnet, de matière ou d'étape */
#appWorkspace {
  view-transition-name: carnet-workspace;
}
#appWorkspace.is-carnet-merging {
  animation: carnetViewMergeFallback .16s cubic-bezier(.22, .68, .32, 1) both;
}
@keyframes carnetViewMergeFallback {
  from {
    opacity: .7;
    filter: blur(2px);
    transform: translateY(2px) scale(.997);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}
::view-transition-old(carnet-workspace) {
  animation: carnetMergeOut .16s cubic-bezier(.4, 0, .6, 1) both;
}
::view-transition-new(carnet-workspace) {
  animation: carnetMergeIn .16s cubic-bezier(.22, .68, .32, 1) both;
}
@keyframes carnetMergeOut {
  to {
    opacity: 0;
    filter: blur(2px);
    transform: scale(.997);
  }
}
@keyframes carnetMergeIn {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(2px) scale(1.003);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

/* Responsive (tablette, mobile, cadres étroits) */
@media (max-width: 820px) {
  .dash-comp-list.is-presco {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .home-demo-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-action-card.is-primary {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .home-demo-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-portal-shell {
    padding: 0;
  }
  .home-actions-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-action-card.is-primary {
    grid-column: auto;
  }
  .home-action-card {
    min-height: 0;
  }
  .home-resume-band,
  .dash-panel {
    padding: 1rem 1.05rem;
  }
  .dash-header-controls {
    width: 100%;
  }
}
@media (max-width: 380px) {
  .home-demo-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
html.reduce-motion .home-portal-shell,
html.reduce-motion .home-dashboard,
html.reduce-motion #viewHome,
html.reduce-motion #viewHome::before,
html.reduce-motion #appWorkspace.is-carnet-merging,
html.reduce-motion::view-transition-old(carnet-workspace),
html.reduce-motion::view-transition-new(carnet-workspace) {
  animation: none !important;
}
html.reduce-motion #viewHome .home-btn,
html.reduce-motion #viewHome .home-arrow,
html.reduce-motion #viewHome .home-chevron,
html.reduce-motion .home-action-card,
html.reduce-motion .home-demo-collapse,
html.reduce-motion .home-demo-collapse .home-demo-box,
html.reduce-motion .dash-comp-row,
html.reduce-motion .dash-action-row,
html.reduce-motion .dash-group-card {
  transition-duration: .01ms !important;
}
html.reduce-motion .home-action-card:hover {
  transform: none;
}
@media print {
  #viewHome {
    display: none !important;
  }
}
/* Boutons du carnet alignés sur la barre des tâches : rectangle arrondi, surbrillance au survol, contour marine une fois actif. */
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode, #btnResetEqualWeights, #btnUnlockAllWeights):not(.hidden) {
  display: inline-flex !important;
  align-items: center;
  gap: .3rem;
  min-height: 34px;
  padding: .36rem .7rem !important;
  border: 1px solid var(--studio-border-strong) !important;
  border-radius: 10px !important;
  background: var(--studio-surface, #fff) !important;
  color: var(--brand-deep) !important;
  box-shadow: none !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode, #btnResetEqualWeights, #btnUnlockAllWeights):hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--brand) !important;
  background: var(--brand-soft) !important;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .13) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode, #btnResetEqualWeights, #btnUnlockAllWeights):active:not(:disabled) {
  transform: translateY(0) scale(.97);
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode)[aria-expanded="true"],
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnResetEqualWeights, #btnUnlockAllWeights):is(:active, :focus-visible) {
  border-color: var(--brand-deep) !important;
  background: var(--brand-soft) !important;
  box-shadow: 0 0 0 1px var(--brand-deep) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar #btnWeightMode.is-weight-error {
  border-color: #ef4444 !important;
  background: #fee2e2 !important;
  color: #991b1b !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .3) !important;
}
html.design-studio:is(.theme-dark, :not(.theme-dark)) #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode, #btnResetEqualWeights, #btnUnlockAllWeights):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
html.reduce-motion #viewGradebook .gradebook-toolbar :is(#btnNewEvaluation, #btnWeightMode, #btnResetEqualWeights, #btnUnlockAllWeights) { transform: none !important; }
#viewGradebook .gradebook-toolbar :is(.gradebook-metric, #btnWeightMode).hidden { display: none !important; }

/* Grille ILSS : les paliers décrivent une progression linguistique, pas une qualité; dégradé de bleus neutres, sans beige. */
@media screen {
  #viewQuickObs .rubric-matrix-table.ilss-rubric tr > :nth-child(2) { --rubric-color: #8aa4c8; }
  #viewQuickObs .rubric-matrix-table.ilss-rubric tr > :nth-child(3) { --rubric-color: #6f8fbf; }
  #viewQuickObs .rubric-matrix-table.ilss-rubric tr > :nth-child(4) { --rubric-color: #5577b0; }
  #viewQuickObs .rubric-matrix-table.ilss-rubric tr > :nth-child(5) { --rubric-color: #3e60a0; }
  #viewQuickObs .rubric-matrix-table.ilss-rubric tr > :nth-child(6) { --rubric-color: #2c4a8a; }
}
#viewQuickObs .qo-ilss-guidance { display: block; margin-top: .3rem; color: var(--studio-text-muted, #475569); font-size: .72rem; }
#qoIlssResultBox { padding-bottom: .75rem; border-bottom: 1px solid var(--studio-border, #e2e8f0); }
#qoIlssResultBox .qo-ilss-label { margin-bottom: .3rem; color: var(--brand-deep); font-size: .78rem; font-weight: 800; }
#qoIlssResultBox .qo-category { min-width: 2.4rem; justify-content: center; }
#qoIlssResultBox .qo-category:disabled { opacity: .5; cursor: not-allowed; }
.ilss-cell-note { display: inline-flex; align-items: center; justify-content: center; min-width: 1.05rem; height: 1.05rem; padding: 0 .2rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: .6rem; font-weight: 800; }
.grade-picker.ilss-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(236px, calc(100vw - 16px)); background: var(--surface, #fff); }
.grade-picker.ilss-picker .ilss-picker-label { grid-column: 1 / -1; padding: 2px 2px 0; color: var(--studio-text-muted, #64748b); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.grade-picker.ilss-picker .ilss-picker-palier { border: 1px solid var(--studio-border-strong, #cbd5e1); background: var(--studio-surface-soft, #f8fafc); color: var(--brand-deep); }
.grade-picker.ilss-picker .ilss-picker-palier.is-current { background: var(--brand-soft); border-color: var(--brand); }
.grade-picker.ilss-picker .grade-picker-auto { grid-column: 1 / -1; }
.mouse-bar.ilss-comment-bank { flex-direction: column; align-items: stretch; width: min(420px, calc(100vw - 16px)); }
.mouse-bar.ilss-comment-bank button { white-space: normal; text-align: left; line-height: 1.35; font-weight: 600; }
