/* Light client only: boot screen, sign-in page. The rest comes from teacher-space.css. */
html, body { margin: 0; padding: 0; background: #F5F6FB; }
.ts-boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #4B4A72; font-size: 14px; }
.ts-boot img { height: 34px; }
.ts-boot-bar { width: 180px; height: 4px; border-radius: 2px; background: #E6E6F4; overflow: hidden; }
.ts-boot-bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, #5351FB, #FF5D25); animation: ts-boot 1.2s ease-in-out infinite; }
@keyframes ts-boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.ts-boot-error { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #FDECEC; color: #C42435; font-family: system-ui, sans-serif; z-index: 3000; }
.ts-boot-error a { color: #C42435; font-weight: 700; margin-left: 8px; }

.ts-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
    radial-gradient(1200px 500px at 0% 0%, #EEEDFF 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 100%, #FFF1E8 0%, transparent 55%), #F5F6FB; }
.ts-login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #E6E6F4; border-radius: 20px; padding: 32px 28px; box-shadow: 0 18px 48px rgba(22, 21, 74, .08); position: relative; overflow: hidden; }
.ts-login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #342484 0%, #5351FB 55%, #FF5D25 85%, #FFA800 100%); }
.ts-login-card img { height: 30px; display: block; }
.ts-login-card h1 { margin: 22px 0 6px; font-size: 24px; font-weight: 800; color: #342484; }
.ts-login-card p { margin: 0 0 22px; color: #4B4A72; font-size: 14px; }
.ts-login-card form { display: flex; flex-direction: column; gap: 14px; }
.ts-login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #16154A; }
.ts-login-card .ts-input { height: 44px; font-size: 15px; }
.ts-login-card .ts-btn { height: 46px; font-size: 15px; justify-content: center; }
.ts-login-foot { margin-top: 18px; font-size: 12px; color: #6B6A8E; text-align: center; }
.ts-pwd { position: relative; }
.ts-pwd .ts-input { width: 100%; padding-right: 76px; }
.ts-pwd button { position: absolute; right: 6px; top: 6px; height: 32px; border: 0; background: transparent; color: #5351FB; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ts-signout { background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
@media (max-width: 760px) { .ts-signout { display: none; } }
.ts-nav-button { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ts-linklike { border: 0; background: none; padding: 0; color: var(--ts-brand); font: inherit; cursor: pointer; text-align: left; } .ts-linklike:hover { color: var(--ts-brand-2); text-decoration: underline; }

/* ============================================================================
   Brand recall: the logo colours (indigo #342484, violet #5351FB, orange #FF5D25,
   amber #FFA800) echoed with restraint. Violet carries the actions, indigo the
   titles, orange only small accents. Loaded after teacher-space.css.
   ========================================================================== */
.ts-root {
    --ts-brand-ink: #2E2A8F;
    --ts-accent-ink: #C2410C;      /* orange readable on white (text) */
    --ts-accent-soft: #FFF1E8;
    --ts-shadow: 0 1px 2px rgba(52, 36, 132, .05), 0 6px 20px rgba(52, 36, 132, .05);
    background:
        radial-gradient(1100px 420px at 100% -10%, #EEEDFF 0%, transparent 60%),
        radial-gradient(800px 380px at -10% 110%, #FFF4EC 0%, transparent 55%),
        var(--ts-bg);
    background-attachment: fixed;
}

/* Top bar */
.ts-top { padding-top: 15px; box-shadow: 0 1px 0 var(--ts-line), 0 4px 18px rgba(52, 36, 132, .04); border-bottom: 0; }
.ts-top::before { height: 4px; }
.ts-brand-sub { color: var(--ts-brand-2); font-weight: 600; }
.ts-brand-sep { background: var(--ts-line-2); }
.ts-bell:hover, .ts-link-classic:hover { border-color: #C9C6FF; background: var(--ts-brand-soft); color: var(--ts-brand-2) !important; }
.ts-user { background: #FBFBFF; }
.ts-avatar { background: linear-gradient(135deg, #342484, #5351FB); color: #fff; }
.ts-bell-count { background: var(--ts-accent); }

/* Menu */
.ts-nav-title { color: var(--ts-brand-2); opacity: .7; }
.ts-nav-link svg { color: #8B89B8; transition: color .15s; }
.ts-nav-link:hover svg { color: var(--ts-brand); }
.ts-nav-link.ts-on { background: linear-gradient(90deg, #EEEDFF 0%, #F5F4FF 100%); }
.ts-nav-link.ts-on svg { color: var(--ts-brand); }

/* Headings */
.ts-eyebrow { color: var(--ts-brand); font-weight: 700; }
.ts-h2 { color: var(--ts-brand-2); }
.ts-card-head .ts-h3 { color: var(--ts-brand-2); }
.ts-card-head { background: linear-gradient(180deg, #FCFCFF, #FFFFFF); }

/* Cards */
.ts-card { box-shadow: var(--ts-shadow); border-color: #E9E8F7; }
.ts-card-featured { position: relative; overflow: hidden; border-color: #DCDAFB;
    background: radial-gradient(520px 200px at 100% 0%, #F1F0FF 0%, transparent 70%), #fff; }
.ts-card-featured::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, #342484 0%, #5351FB 55%, #FF5D25 85%, #FFA800 100%); }

/* Buttons */
.ts-btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.ts-btn:not(.ts-btn-primary):not(.ts-btn-locked):not(.ts-btn-ghost):hover { background: var(--ts-brand-soft); border-color: #C9C6FF; color: var(--ts-brand-2) !important; }
.ts-btn-primary { background: linear-gradient(135deg, #5351FB 0%, #4338E0 100%); border-color: #4A44F0; box-shadow: 0 4px 12px rgba(83, 81, 251, .25); }
.ts-btn-primary:hover { background: linear-gradient(135deg, #4A44F0 0%, #342484 100%); box-shadow: 0 6px 16px rgba(52, 36, 132, .28); }
.ts-head .ts-btn:not(.ts-btn-primary) { color: var(--ts-brand-2) !important; border-color: #D9D7F5; }
.ts-btn-locked { background: #F4F3FC; border-color: #E6E5F5; color: #6F6D96 !important; }
.ts-btn-locked svg { color: var(--ts-accent); }

/* Chips, dots, progress */
.ts-chip-next { border-color: #D9D7F5; color: var(--ts-brand-2); background: #fff; }
.ts-dot-ring { border-color: var(--ts-accent); }
.ts-dot-live { background: var(--ts-accent); box-shadow: 0 0 0 3px rgba(255, 93, 37, .18); }
.ts-progress > div { background: linear-gradient(90deg, #5351FB 0%, #FF5D25 100%); }

/* Lists */
.ts-time strong { color: var(--ts-brand-2); }
.ts-row-link:hover, .ts-notif:hover { background: #F8F7FF; }
.ts-datebox-brand { background: linear-gradient(135deg, #342484, #5351FB); }
.ts-datebox-brand span, .ts-datebox-brand strong { color: #fff; }
.ts-datebox-brand span { opacity: .8; }
.ts-icon-box { background: var(--ts-brand-soft); color: var(--ts-brand); }

/* Figures */
.ts-stat { background: #F7F7FD; border: 1px solid #EEEDF8; }
.ts-stat strong { color: var(--ts-brand-2); }
.ts-stat-wait { background: var(--ts-accent-soft); border-color: #FFDCC7; }
.ts-stat-wait strong, .ts-stat-wait span { color: var(--ts-accent-ink); }

/* Tables (grades) */
.ts-table thead th { background: #F6F5FE; color: var(--ts-brand-2); }

/* Focus */
.ts-root :focus-visible { outline-color: #8E88FF; }

@media (prefers-reduced-motion: reduce) { .ts-btn, .ts-nav-link svg { transition: none; } }

/* ── Roll-call sheet: compact, the list starts high and two columns on wide screens ── */
.ts-sheet { gap: 12px; max-width: 1240px; padding-bottom: 0; }
.ts-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ts-sheet-head .ts-back { margin-bottom: 2px; font-size: 13px; }
.ts-sheet-title { font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; color: var(--ts-brand-2); }
.ts-sheet-sub { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--ts-ink-2); }
.ts-sheet-sub strong { color: var(--ts-brand); font-weight: 700; }
.ts-sheet .ts-notice { margin-top: 0; padding: 9px 14px; }

.ts-sheet-card { overflow: visible; }
.ts-sheet-tools { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 10px 14px;
    background: #FCFCFF; border-bottom: 1px solid var(--ts-line); border-radius: 16px 16px 0 0; }
.ts-sheet-tools .ts-input { flex: 1 1 220px; height: 36px; }
.ts-tally { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-tally-btn { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ts-line-2); background: #fff; color: var(--ts-ink-2);
    font: 500 13px 'Plus Jakarta Sans', system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.ts-tally-btn strong { font-weight: 800; margin-right: 2px; color: var(--ts-ink); }
.ts-tally-btn:hover { border-color: #C9C6FF; }
.ts-tally-ok strong { color: var(--ts-ok); }
.ts-tally-bad strong { color: var(--ts-bad); }
.ts-tally-wait strong { color: var(--ts-warn); }
.ts-tally-on { background: var(--ts-brand-soft); border-color: var(--ts-brand); color: var(--ts-brand-2); font-weight: 700; }

/* Dense rows: about 44 px each */
.ts-sheet-list .ts-student { gap: 10px; padding: 6px 14px; min-height: 46px; flex-wrap: nowrap; }
.ts-sheet-list .ts-row-title { font-size: 13.5px; }
.ts-sheet-list .ts-row-sub { font-size: 12px; }
.ts-sheet-num { width: 24px; flex: none; text-align: right; font-size: 12px; font-weight: 600; color: #9A99BA; font-variant-numeric: tabular-nums; }
.ts-sheet-list .ts-seg-btn { height: 32px; min-width: 66px; padding: 0 10px; font-size: 12.5px; }
.ts-sheet-list .ts-input-min { width: 58px; height: 32px; }
.ts-sheet-list .ts-late { font-size: 12px; }
.ts-sheet-list .ts-chip { height: 26px; font-size: 12px; }

/* Wide screens: two columns, read top to bottom then the second column */
@media (min-width: 1380px) {
    .ts-sheet-list { columns: 2; column-gap: 0; column-rule: 1px solid var(--ts-line); }
    .ts-sheet-list .ts-student { break-inside: avoid; }
    .ts-sheet-list > .ts-empty { column-span: all; }
}

.ts-sheet-bar { margin-top: 0; padding: 10px 14px; border-radius: 14px; }
.ts-sheet-bar .ts-btn { min-height: 40px; }

@media (max-width: 760px) {
    .ts-sheet-list .ts-student { flex-wrap: wrap; }
    .ts-sheet-list .ts-seg { width: 100%; }
    .ts-sheet-list .ts-seg-btn { flex: 1; min-width: 0; }
    .ts-tally { width: 100%; }
}

/* ── Toasts: feedback visible whatever the scroll position ─────────── */
.ts-toasts { position: fixed; top: 84px; right: 20px; z-index: 3100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.ts-toast { --ts-toast-c: var(--ts-brand); --ts-toast-soft: var(--ts-brand-soft);
    position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px 14px 14px;
    background: #fff; border: 1px solid #E6E5F5; border-radius: 14px; box-shadow: 0 12px 32px rgba(22, 21, 74, .16), 0 2px 6px rgba(22, 21, 74, .06);
    animation: ts-toast-in .28s cubic-bezier(.2, .9, .3, 1.2); }
.ts-toast-success { --ts-toast-c: #15803D; --ts-toast-soft: #E7F6EC; }
.ts-toast-error   { --ts-toast-c: #C42435; --ts-toast-soft: #FDECEC; }
.ts-toast-warning { --ts-toast-c: #C2410C; --ts-toast-soft: #FFF1E8; }
.ts-toast-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ts-toast-soft); color: var(--ts-toast-c); }
.ts-toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ts-ink-2); line-height: 1.4; }
.ts-toast-body strong { font-size: 14px; font-weight: 700; color: var(--ts-ink); }
.ts-toast-close { flex: none; width: 28px; height: 28px; margin: -4px -2px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--ts-ink-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ts-toast-close:hover { background: var(--ts-sunk); color: var(--ts-ink); }
.ts-toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--ts-toast-c); opacity: .35; transform-origin: left; animation: ts-toast-timer var(--ts-toast-ms, 4000ms) linear forwards; }
@keyframes ts-toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ts-toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 760px) { .ts-toasts { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; } }

/* ── Confirmation window ──────────────────────────────────────────── */
.ts-dialog-backdrop { position: fixed; inset: 0; z-index: 3200; display: grid; place-items: center; padding: 16px; background: rgba(22, 21, 74, .38); backdrop-filter: blur(3px); animation: ts-fade .18s ease-out; }
.ts-dialog { width: min(440px, 100%); background: #fff; border-radius: 18px; padding: 24px 24px 20px; box-shadow: 0 24px 64px rgba(22, 21, 74, .28); animation: ts-dialog-in .22s cubic-bezier(.2, .9, .3, 1.15); }
.ts-dialog-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--ts-brand-soft); color: var(--ts-brand); }
.ts-dialog-icon-danger { background: #FDECEC; color: #C42435; }
.ts-dialog h2 { margin: 14px 0 6px !important; font-size: 18px; font-weight: 800; color: var(--ts-brand-2); }
.ts-dialog p { margin: 0 !important; font-size: 14px; line-height: 1.5; color: var(--ts-ink-2); }
.ts-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.ts-dialog .ts-btn-danger { background: #C42435; border-color: #C42435; color: #fff !important; }
.ts-dialog .ts-btn-danger:hover { background: #A51D2C; }
@keyframes ts-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ts-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .ts-dialog-actions .ts-btn { flex: 1; } }

/* ── Field errors ─────────────────────────────────────────────────── */
.ts-input-invalid { border-color: #C42435 !important; box-shadow: 0 0 0 3px rgba(196, 36, 53, .12); }
.ts-field-error { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #C42435; }
.ts-field-error::before { content: "!"; width: 16px; height: 16px; border-radius: 50%; background: #C42435; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) { .ts-toast, .ts-dialog, .ts-dialog-backdrop { animation: none; } .ts-toast-timer { display: none; } }

/* ── Collective absence ───────────────────────────────────────────── */
.ts-sheet-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ts-chip-collective { background: #FDECEC; color: #A51D2C; border: 1px solid #F6CFD4; }
.ts-btn-collective { color: #A51D2C !important; border-color: #F3D7DB; }
.ts-btn-collective:hover { background: #FDECEC !important; border-color: #EBB8BF !important; color: #8E1724 !important; }

/* ── Grade inputs: room for "15.50", no spinner arrows eating the digits ── */
.ts-note { width: 100px; padding: 0 12px; font-variant-numeric: tabular-nums; }
.ts-defense-note { width: 96px; height: 40px; }
.ts-note::-webkit-outer-spin-button, .ts-note::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ts-note[type=number] { -moz-appearance: textfield; appearance: textfield; }
.ts-grade { gap: 4px; }
.ts-grade > span { padding-right: 2px; }
.ts-defense { gap: 12px; }

/* Defense grades: input and mention in fixed columns, aligned from one row to the next */
.ts-defense .ts-grade { flex: none; }
.ts-mention-slot { flex: none; width: 112px; display: flex; justify-content: flex-start; }
.ts-mention-slot .ts-chip { max-width: 100%; }
@media (max-width: 760px) { .ts-mention-slot { width: auto; } }

/* ── Home: "your day" strip ───────────────────────────────────────── */
.ts-day { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--ts-line-2); }
.ts-day-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ts-ink-3); }
.ts-day-head span:last-child { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ts-brand-2); }
.ts-day-track { position: relative; height: 14px; margin-top: 10px; border-radius: 7px; background: #F1F0FA; }
.ts-day-seg { position: absolute; top: 0; bottom: 0; border-radius: 7px; box-shadow: 0 0 0 2px #fff; }
/* Logo palette only: indigo = done, violet = in progress, lavender = to come, amber = roll call late; orange = now. */
.ts-day-done { background: #342484; }
.ts-day-todo { background: #FFA800; }
.ts-day-live { background: #5351FB; animation: ts-day-pulse 2s ease-in-out infinite; }
.ts-day-next { background: #DCDAFB; }
.ts-day-off { background: repeating-linear-gradient(45deg, #E3E2EE 0 4px, #F4F3FA 4px 8px); }
.ts-day-now { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ts-accent); border-radius: 1px; }
.ts-day-now::before { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ts-accent); box-shadow: 0 0 0 3px rgba(255, 93, 37, .2); }
.ts-day-scale { position: relative; height: 16px; margin-top: 6px; font-size: 11px; color: var(--ts-ink-3); font-variant-numeric: tabular-nums; }
.ts-day-scale span { position: absolute; transform: translateX(-2px); white-space: nowrap; }
@keyframes ts-day-pulse { 50% { opacity: .75; } }
@media (max-width: 760px) { .ts-day-scale span:nth-child(even) { display: none; } }

/* Not-yet-open roll call in lists: quiet text instead of a disabled button */
.ts-lock-text { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ts-ink-3); white-space: nowrap; }
.ts-lock-text svg { color: var(--ts-accent); }

/* To-do: "À prévoir" level */
.ts-mark-info { border: 2px solid var(--ts-brand); }
.ts-level-info { color: var(--ts-brand); }
.ts-next-step { margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--ts-brand-soft); color: var(--ts-brand-2); font-size: 12.5px; font-weight: 600; }
.ts-col-side .ts-empty { padding: 14px 20px; font-size: 13px; }

/* ── Phones: bottom tab bar instead of the side menu ─────────────────── */
.ts-tabbar, .ts-more, .ts-more-backdrop { display: none; }
@media (max-width: 760px) {
    .ts-nav { display: none; }
    .ts-main { flex-basis: 100%; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
    .ts-top { padding: 12px 16px 10px; gap: 12px; }
    .ts-top-right { gap: 8px; }
    .ts-user { padding: 0 6px; height: 40px; border: 0; background: transparent; }
    .ts-bell { width: 40px; height: 40px; }
    .ts-signout { display: none; }

    .ts-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--ts-line); box-shadow: 0 -6px 20px rgba(22, 21, 74, .06); }
    .ts-tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
        font: 600 11px 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ts-ink-3) !important; cursor: pointer; border-radius: 12px; }
    .ts-tab-icon { position: relative; display: inline-flex; padding: 3px 14px; border-radius: 999px; }
    .ts-tab.ts-on { color: var(--ts-brand-2) !important; }
    .ts-tab.ts-on .ts-tab-icon { background: var(--ts-brand-soft); color: var(--ts-brand); }
    .ts-tab-badge { position: absolute; top: -4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; border: 2px solid #fff;
        background: var(--ts-bad); color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
    .ts-tab-badge-wait { background: var(--ts-accent); }

    .ts-more-backdrop { display: block; position: fixed; inset: 0; z-index: 2400; background: rgba(22, 21, 74, .32); animation: ts-fade .15s ease-out; }
    .ts-more { display: flex; flex-direction: column; gap: 2px; position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 2450;
        padding: 10px 8px 8px; background: #fff; border-radius: 20px; box-shadow: 0 18px 48px rgba(22, 21, 74, .25); animation: ts-dialog-in .2s ease-out; }
    .ts-more-grip { align-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--ts-line-2); margin-bottom: 6px; }

    /* Page headers: actions on one scrollable line instead of stacked full-width buttons */
    .ts-head { align-items: flex-start; gap: 12px; }
    .ts-head > .ts-row-gap { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
    .ts-head > .ts-row-gap .ts-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
    .ts-h1 { font-size: 24px; }
    .ts-card { padding: 18px 16px; border-radius: 14px; }
    .ts-card-list { padding: 0; }
    .ts-card-head, .ts-row, .ts-todo { padding-left: 16px; padding-right: 16px; }
    .ts-cols { gap: 16px; }

    /* Sticky bars and toasts sit above the tab bar */
    .ts-sheet-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
    .ts-toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
    /* Session rows: status and button wrap under the subject, aligned with it (not under the time) */
    .ts-row:has(> .ts-time) { gap: 8px 14px; padding-top: 12px; padding-bottom: 12px; }
    .ts-row > .ts-time { width: 58px; }
    .ts-row > .ts-time + .ts-grow + * { margin-left: 72px; }
    .ts-row > .ts-time ~ .ts-btn, .ts-row > .ts-time ~ .ts-chip { min-height: 32px; height: 32px; }
}

/* Shared components (Educated.Web.Ui) */
.ss-clip { display: inline-block; vertical-align: -2px; flex: none; }

/* Light / dark logos and the theme button of the top bar (both portals) */
.ss-logo-dark { display: none; }
html[data-theme="dark"] .ss-logo-light { display: none; }
html[data-theme="dark"] .ss-logo-dark { display: inline-block; }
.ts-brand-logo.ss-logo-dark { display: none; }
html[data-theme="dark"] .ts-brand-logo.ss-logo-light { display: none; }
html[data-theme="dark"] .ts-brand-logo.ss-logo-dark { display: block; }
.ss-theme-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--ts-line); background: var(--ts-card); color: var(--ts-ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ss-theme-btn:hover { background: var(--ts-brand-soft); color: var(--ts-brand-2); }
@media (max-width: 760px) { .ss-theme-btn { width: 38px; height: 38px; } }

/* Institution identity: name and logo in the top bar and the menu (both portals) */
.ss-school { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ss-school-logo { height: 34px; max-width: 120px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px 4px; border: 1px solid var(--ts-line); }
.ss-school-name { font-size: 13px; font-weight: 700; color: var(--ts-ink-2); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-brand .ss-school .ts-brand-sub { line-height: 1.2; }
/* Phones: the top bar keeps the Educated logo only (the institution logo was squeezed next to it) */
@media (max-width: 760px) { .ts-brand .ss-school-logo { display: none; } }
.ss-school-sub { display: block; }
@media (max-width: 760px) { .ss-school-sub { display: none; } }
.ss-nav-school { display: flex; flex-direction: column; gap: 2px; margin: 0 4px 14px; padding: 12px 14px; border-radius: 12px; background: var(--ts-brand-soft); }
.ss-nav-school strong { font-size: 14px; font-weight: 800; color: var(--ts-brand-2); }
.ss-nav-school span { font-size: 12px; color: var(--ts-ink-2); }
@media (max-width: 760px) { .ss-nav-school { display: none; } }

/* ── Sign-in page (two panels), both portals; .ss-login-teacher differentiates the teacher space ─────────────────────── */
.ss-login { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--ts-bg); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.ss-login-brand { flex: 1 1 420px; position: relative; overflow: hidden; box-sizing: border-box; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; color: #fff; background: linear-gradient(150deg, #241A63 0%, #342484 35%, #4F46E5 85%); }
.ss-login-glow { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 168, 0, .40), rgba(255, 93, 37, 0) 70%); pointer-events: none; }
.ss-login-logo { display: block; width: 200px; height: auto; position: relative; }
.ss-login-pitch { position: relative; max-width: 460px; }
.ss-login-school { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; opacity: .92; }
.ss-login-school img { height: 34px; max-width: 110px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px 5px; }
.ss-login-pitch h1 { margin: 14px 0 0; font-size: 38px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.ss-login-pitch ul { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.ss-login-pitch li { display: flex; gap: 10px; align-items: center; }
.ss-login-pitch li::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #FFA800; }
.ss-login-copy { position: relative; font-size: 12.5px; opacity: .75; }
.ss-login-side { flex: 1 1 420px; box-sizing: border-box; padding: 32px 48px; display: flex; flex-direction: column; background: var(--ts-bg); }
.ss-login-tools { display: flex; justify-content: flex-end; }
.ss-login-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.ss-login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.ss-login-form h2 { margin: 0; font-size: 28px; font-weight: 800; color: var(--ts-brand-2); }
.ss-login-form p { margin: 6px 0 0; font-size: 15px; color: var(--ts-ink-2); }
.ss-login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ts-ink); }
.ss-login-input { height: 48px; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--ts-line-2); padding: 0 14px; font: 500 15px 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ts-ink); background: var(--ts-card); }
.ss-login-input:focus-within { border-color: var(--ts-brand); box-shadow: 0 0 0 3px var(--ts-brand-soft); outline: none; }
.ss-login-pwd { display: flex; align-items: center; padding: 0 6px 0 14px; }
.ss-login-pwd input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; outline: none; }
.ss-login-pwd button { width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ts-ink-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ss-login-pwd button:hover { color: var(--ts-brand); background: var(--ts-brand-soft); }
.ss-login-error { padding: 12px 14px; border-radius: 12px; background: var(--ts-bad-soft); color: var(--ts-bad); font-size: 14px; font-weight: 600; }
.ss-login-submit { min-height: 48px; border-radius: 12px; font-size: 15px; font-weight: 800; margin-top: 4px; width: 100%; }
.ss-login-form p.ss-login-foot { margin: 0; font-size: 13.5px; text-align: center; }
@media (max-width: 860px) {
    .ss-login-brand { flex-basis: 100%; padding: 28px 24px; gap: 18px; }
    .ss-login-pitch h1 { font-size: 26px; }
    .ss-login-pitch ul, .ss-login-copy { display: none; }
    .ss-login-side { padding: 20px 24px 40px; }
}
.ss-login-teacher .ss-login-brand { background: linear-gradient(150deg, #0E2A2F 0%, #134E4A 40%, #0F766E 90%); }
.ss-login-teacher .ss-login-glow { left: -140px; right: auto; top: -140px; bottom: auto; background: radial-gradient(circle, rgba(255, 168, 0, .32), rgba(255, 93, 37, 0) 70%); }
.ss-login-teacher .ss-login-pitch li::before { background: #5EEAD4; }
.ss-login-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ss-login-teacher .ss-login-form h2 { color: #0F766E; }
html[data-theme="dark"] .ss-login-teacher .ss-login-form h2 { color: #5EEAD4; }

/* ── Chat: photos in the avatars, pictures inline (as the mobile apps), and the image viewer — both portals ── */
.ts-avatar { position: relative; overflow: hidden; }
.ss-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ss-avatar-xs { width: 22px; height: 22px; font-size: 9px; flex: none; }
.ss-bubble-from { display: flex; align-items: center; gap: 6px; }
.ss-chat-img { display: block; padding: 0; margin: 4px 0 2px; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; max-width: 100%; }
.ss-chat-img img { display: block; max-width: min(280px, 100%); max-height: 280px; object-fit: cover; border-radius: 12px; }
.ss-chat-img-sk { display: block; width: 220px; height: 160px; border-radius: 12px; }
.ss-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 8, 30, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; cursor: zoom-out; }
.ss-viewer img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 10px; cursor: default; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.ss-viewer-bar { display: flex; align-items: center; gap: 10px; max-width: 100%; color: #fff; cursor: default; }
.ss-viewer-bar .ts-ellipsis { max-width: 50vw; font-size: 13px; opacity: .85; }

/* Chat: reactions, unsent bubble, "Nouveaux messages", details panel (members, rename, add, leave) — both portals */
.ss-pre { white-space: pre-line; }
.ss-reactions { display: flex; gap: 4px; margin-top: 4px; }
.ss-reaction { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--ts-line); background: var(--ts-card); color: var(--ts-ink-2); }
.ss-bubble-failed { border-color: var(--ts-bad) !important; background: var(--ts-bad-soft) !important; }
.ss-new-sep { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--ts-accent); font-size: 12px; font-weight: 800; }
.ss-new-sep::before, .ss-new-sep::after { content: ""; flex: 1; height: 1px; background: var(--ts-accent); }
.ss-chat-details { border-bottom: 1px solid var(--ts-line); padding: 12px 0 16px; margin-bottom: 8px; max-height: 55vh; overflow: auto; }
.ss-chat-identity { display: flex; align-items: center; gap: 14px; padding: 4px 0 8px; }
.ss-avatar-lg { width: 52px; height: 52px; font-size: 18px; flex: none; }
.ss-chat-rename { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; }
.ss-chat-rename .ts-input { flex: 1 1 220px; min-width: 0; }
.ss-chat-add .ts-row-title { color: var(--ts-brand); }
.ss-avatar-add { background: var(--ts-surface-2) !important; color: var(--ts-brand) !important; font-size: 20px; }
.ss-chat-details .ts-btn-danger { color: var(--ts-bad); border-color: color-mix(in srgb, var(--ts-bad) 35%, transparent); }
.ss-chat-details .ts-btn-danger:hover { background: color-mix(in srgb, var(--ts-bad) 10%, transparent); }
.ss-sub-brand { color: var(--ts-brand) !important; }

/* Phones: page tabs (Supports / Programmes, Reçus / Envoyés…) stay on one line — the bottom tab bar styles .ts-tab
   as icon-over-label, which must not apply to them — and search fields take the full width. */
@media (max-width: 760px) {
    .ts-tabs { overflow-x: auto; scrollbar-width: none; }
    .ts-tabs .ts-tab { flex: 0 0 auto; flex-direction: row; gap: 8px; height: 42px; padding: 0 12px; border-radius: 0; background: transparent;
        font: 600 13.5px 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ts-ink-2) !important; white-space: nowrap; }
    .ts-tabs .ts-tab-on { color: var(--ts-brand-2) !important; }
    .ts-main input[type=search].ts-input { max-width: none !important; flex: 1 1 100%; width: 100%; box-sizing: border-box; }
}
