/*
 * Tâches — feuille de style unique (application et connexion).
 * Direction : un bureau quadrillé de carnet, des fiches papier marquées à la couleur de leur projet.
 * Aucune police externe : piles système choisies ; couleurs dynamiques passées par --project (CSSOM).
 */

/* ---------- Jetons ---------- */

:root {
    color-scheme: light;
    --desk: #e6ebf2;
    --grid: #c8d1df;
    --sheet: #ffffff;
    --sheet-2: #f4f6fa;
    --ink: #17223a;
    --ink-2: #56627a;
    --ink-3: #8691a6;
    --rule: #d5dce7;
    --pen: #2542c9;
    --pen-soft: #dfe5fb;
    --late: #d3302a;
    --late-soft: #fde7e5;
    --doing: #c98a00;
    --done: #2a8a5c;
    --shadow: 0 1px 0 rgb(23 34 58 / 0.06), 0 2px 6px -2px rgb(23 34 58 / 0.12);
    --shadow-lift: 0 2px 0 rgb(23 34 58 / 0.05), 0 14px 28px -10px rgb(23 34 58 / 0.35);
    --font-ui: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", sans-serif;
    --font-display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", "Noto Sans", system-ui, sans-serif;
    --radius-card: 10px;
    --radius-ctl: 8px;
    --bar-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --desk: #0f141d;
        --grid: #222b3a;
        --sheet: #1a2130;
        --sheet-2: #151b27;
        --ink: #e5eaf3;
        --ink-2: #a3aec2;
        --ink-3: #6f7b91;
        --rule: #2b3548;
        --pen: #8ea4ff;
        --pen-soft: #26315a;
        --late: #ff6f61;
        --late-soft: #3a1d1f;
        --doing: #f2b53a;
        --done: #4cc38a;
        --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 2px 8px -2px rgb(0 0 0 / 0.5);
        --shadow-lift: 0 2px 0 rgb(0 0 0 / 0.3), 0 18px 34px -10px rgb(0 0 0 / 0.75);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --desk: #0f141d;
    --grid: #222b3a;
    --sheet: #1a2130;
    --sheet-2: #151b27;
    --ink: #e5eaf3;
    --ink-2: #a3aec2;
    --ink-3: #6f7b91;
    --rule: #2b3548;
    --pen: #8ea4ff;
    --pen-soft: #26315a;
    --late: #ff6f61;
    --late-soft: #3a1d1f;
    --doing: #f2b53a;
    --done: #4cc38a;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 2px 8px -2px rgb(0 0 0 / 0.5);
    --shadow-lift: 0 2px 0 rgb(0 0 0 / 0.3), 0 18px 34px -10px rgb(0 0 0 / 0.75);
}

/* ---------- Base ---------- */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
    background-color: var(--desk);
    /* Quadrillage pointé du carnet : de simples dégradés, aucune image. */
    background-image: radial-gradient(circle at 1px 1px, var(--grid) 1px, transparent 1.4px);
    background-size: 22px 22px;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

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

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-ctl);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 15px;
}

.icon-button:hover {
    background: var(--sheet-2);
    border-color: var(--rule);
    color: var(--ink);
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Barre fixe ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--desk) 86%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.topbar__row {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    text-decoration: none;
    flex: none;
}

.brand__mark {
    width: 26px;
    height: 26px;
    fill: var(--pen);
    stroke: none;
}

.brand__mark path {
    fill: none;
    stroke: var(--sheet);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
}

/* La saisie éclair : une ligne de carnet, le geste principal de l'outil. */
.quick {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 760px;
    margin: 0 auto;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.quick:focus-within {
    border-color: var(--pen);
    box-shadow: 0 0 0 4px var(--pen-soft), var(--shadow);
}

.quick__plus {
    display: grid;
    place-items: center;
    width: 44px;
    flex: none;
    color: var(--pen);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
}

.quick__input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 8px 0 0;
    border: 0;
    background: transparent;
    font-size: 17px;
    caret-color: var(--pen);
}

.quick__input:focus {
    outline: none;
}

.quick__input::placeholder {
    color: var(--ink-3);
}

.quick__key {
    flex: none;
    margin-right: 12px;
    padding: 1px 7px;
    border: 1px solid var(--rule);
    border-bottom-width: 2px;
    border-radius: 5px;
    color: var(--ink-3);
    font-family: var(--font-ui);
    font-size: 12px;
}

.quick:focus-within .quick__key {
    visibility: hidden;
}

.quick.is-busy {
    border-color: var(--pen);
}

.quick.is-busy .quick__plus {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.logout {
    margin: 0;
}

.icon--sun {
    display: none;
}

#theme-toggle[aria-pressed="true"] .icon--sun {
    display: block;
}

#theme-toggle[aria-pressed="true"] .icon--moon {
    display: none;
}

.tabs {
    display: flex;
    gap: 4px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 18px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs a {
    position: relative;
    padding: 8px 10px 10px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.tabs a:hover {
    color: var(--ink);
}

.tabs a[aria-current="page"] {
    color: var(--ink);
}

.tabs a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--pen);
}

/* ---------- Vues ---------- */

.views {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 24px 64px;
}

.view__empty {
    max-width: 46ch;
    margin: 64px auto;
    padding: 28px 32px;
    background: var(--sheet);
    border: 1px dashed var(--rule);
    border-radius: var(--radius-card);
    color: var(--ink-2);
    text-align: center;
}

/* ---------- Filtre par projet ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.chip {
    --project: var(--ink-2);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    height: 32px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--sheet);
    color: var(--ink);
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.12s, border-color 0.12s;
}

.chip:hover {
    border-color: var(--project);
}

.chip__dot {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
    background: var(--project);
}

.chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip__count {
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--sheet-2);
    color: var(--ink-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.chip[aria-pressed="true"] {
    border-color: var(--project);
    background: color-mix(in srgb, var(--project) 16%, var(--sheet));
    box-shadow: inset 0 0 0 1px var(--project);
}

.chip[aria-pressed="true"] .chip__count {
    background: var(--project);
    color: #fff;
}

/* ---------- Tableau ---------- */

.board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.column {
    --status: var(--ink-2);
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 4px 10px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--sheet-2) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}

.column--doing {
    --status: var(--doing);
}

.column--done {
    --status: var(--done);
}

.column__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 12px;
    border-bottom: 2px solid var(--status);
    margin-bottom: 12px;
}

.column__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.column__count {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    color: var(--status);
    font-variant-numeric: tabular-nums;
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 80px;
}

.cards__empty {
    margin: 4px 0 0;
    padding: 18px 14px;
    border: 1px dashed var(--rule);
    border-radius: var(--radius-card);
    color: var(--ink-3);
    font-size: 14px;
    text-align: center;
}

.cards:has(.card) .cards__empty {
    display: none;
}

/* ---------- Cartes ---------- */

.card {
    --project: var(--ink-3);
    position: relative;
    padding: 11px 14px 11px 18px;
    border-radius: var(--radius-card);
    background: var(--sheet);
    box-shadow: var(--shadow);
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
}

/* Onglet de couleur du projet, comme le marque-page d'une fiche. */
.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--project);
}

.card:hover {
    box-shadow: var(--shadow-lift);
}

.card:focus-visible {
    outline-offset: 1px;
}

.card__project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin-bottom: 6px;
    padding: 1px 8px 1px 6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--project) 14%, var(--sheet));
    color: color-mix(in srgb, var(--project) 70%, var(--ink));
    font-size: 12.5px;
    font-weight: 600;
}

.card__project span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--project);
}

.card__title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-top: 8px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.card__age {
    margin-left: auto;
    color: var(--ink-3);
}

.card__notes {
    color: var(--ink-3);
}

.card.is-overdue {
    box-shadow: inset 0 0 0 1.5px var(--late), var(--shadow);
}

.card.is-overdue::before {
    background: repeating-linear-gradient(180deg, var(--late) 0 6px, var(--project) 6px 12px);
}

.card.is-overdue .card__due {
    padding: 0 6px;
    border-radius: 4px;
    background: var(--late-soft);
    color: var(--late);
    font-weight: 600;
}

.card.is-done {
    background: color-mix(in srgb, var(--sheet) 72%, transparent);
    box-shadow: none;
    border: 1px solid var(--rule);
}

.card.is-done .card__title {
    color: var(--ink-2);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--done) 70%, transparent);
    text-decoration-thickness: 2px;
}

.card.is-done::before {
    opacity: 0.45;
}

.card.is-dragging {
    opacity: 0.35;
    box-shadow: none;
    outline: 2px dashed var(--pen);
    outline-offset: -2px;
}

.card.is-saving {
    opacity: 0.6;
}

/* Unique animation d'arrivée : la carte que l'on vient de noter se pose sur le tableau. */
.card.is-new {
    animation: drop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes drop-in {
    from {
        transform: translateY(-14px) rotate(-1.5deg);
        box-shadow: var(--shadow-lift);
        opacity: 0;
    }
}

/* ---------- Fiche (panneau latéral) ---------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(15 20 29 / 0.38);
    animation: fade 0.18s ease-out;
}

@keyframes fade {
    from { opacity: 0; }
}

.panel {
    --project: var(--ink-3);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 31;
    display: flex;
    flex-direction: column;
    width: min(480px, 100vw);
    background: var(--sheet);
    border-left: 6px solid var(--project);
    box-shadow: -20px 0 50px -20px rgb(0 0 0 / 0.45);
    animation: slide-in 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes slide-in {
    from { transform: translateX(40px); opacity: 0; }
}

.panel__loading {
    margin: 40px 28px;
    color: var(--ink-2);
}

.panel__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 24px;
    border-bottom: 1px solid var(--rule);
}

.panel__project {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: color-mix(in srgb, var(--project) 75%, var(--ink));
    font-weight: 600;
    font-size: 14px;
}

.panel__project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel__saved {
    margin-left: auto;
    color: var(--ink-3);
    font-size: 13px;
    white-space: nowrap;
}

.panel__saved.is-ok {
    color: var(--done);
}

.panel__saved.is-error {
    color: var(--late);
}

.panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px 32px;
    overscroll-behavior: contain;
}

.panel__title {
    display: block;
    width: 100%;
    min-height: 2.6em;
    max-height: 40vh;
    margin: 0 0 18px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-ctl);
    background: transparent;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    resize: none;
    field-sizing: content;
    overflow-wrap: anywhere;
}

.panel__title:hover {
    border-color: var(--rule);
}

.panel__title:focus {
    outline: none;
    border-color: var(--pen);
    background: var(--sheet-2);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    min-width: 0;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
}

.field__label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.field__inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.field__inline input {
    flex: 1 1 120px;
}

.field__hint {
    margin: 0;
    color: var(--ink-3);
    font-size: 13px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-ctl);
    background: var(--sheet-2);
}

.field__inline input {
    width: auto;
}

.field textarea {
    resize: vertical;
    line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--pen);
    box-shadow: 0 0 0 3px var(--pen-soft);
}

.field input:disabled {
    opacity: 0.45;
}

.link-button {
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--late);
}

/* Statut : trois cases, la seule façon de changer de colonne sur écran tactile. */
.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    border-radius: 10px;
    background: var(--sheet-2);
    border: 1px solid var(--rule);
}

.segmented__option {
    --status: var(--ink-2);
    position: relative;
    display: grid;
    place-items: center;
    min-height: 38px;
    border-radius: 7px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.segmented__option--doing {
    --status: var(--doing);
}

.segmented__option--done {
    --status: var(--done);
}

.segmented__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented__option:has(input:checked) {
    background: var(--sheet);
    color: var(--ink);
    box-shadow: var(--shadow), inset 0 -3px 0 var(--status);
}

.segmented__option:has(input:focus-visible) {
    outline: 2px solid var(--pen);
    outline-offset: -2px;
}

.panel__history h3 {
    margin: 26px 0 10px;
    font-family: var(--font-display);
    font-size: 15px;
}

.timeline {
    margin: 0;
    padding: 0 0 0 14px;
    list-style: none;
    border-left: 2px solid var(--rule);
}

.timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 10px;
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--ink-2);
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 11px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sheet);
    border: 2px solid var(--ink-3);
}

.timeline__item--created::before {
    border-color: var(--pen);
    background: var(--pen);
}

.timeline__item--status::before {
    border-color: var(--doing);
}

.timeline__item--reminder_sent::before,
.timeline__item--snoozed::before {
    border-color: var(--done);
}

.timeline__item time {
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.timeline__text {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.panel__danger {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
}

.confirm p {
    margin: 0 0 10px;
    color: var(--ink-2);
    font-size: 14px;
}

.confirm__actions {
    display: flex;
    gap: 8px;
}

.button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-ctl);
    background: var(--sheet);
    font-weight: 600;
    cursor: pointer;
}

.button:hover {
    background: var(--sheet-2);
}

.button--danger {
    border-color: var(--late);
    background: var(--late);
    color: #fff;
}

.button--danger:hover {
    background: color-mix(in srgb, var(--late) 85%, #000);
}

.button--ghost-danger {
    border-color: transparent;
    background: transparent;
    color: var(--late);
    padding: 0 10px;
}

.button--ghost-danger:hover {
    background: var(--late-soft);
}

/* ---------- Messages ---------- */

.toasts {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(520px, calc(100vw - 32px));
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--sheet);
    box-shadow: var(--shadow-lift);
    font-size: 14px;
    overflow-wrap: anywhere;
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.toast--error {
    background: var(--late);
    color: #fff;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

/* ---------- Page de connexion ---------- */

.login {
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.login main {
    width: min(380px, 100%);
    padding: 34px 30px 30px;
    border-radius: 16px;
    background: var(--sheet);
    box-shadow: inset 0 6px 0 var(--pen), var(--shadow-lift);
}

.login h1 {
    margin: 0 0 22px;
    font-family: var(--font-display);
    font-size: 28px;
    letter-spacing: -0.02em;
}

.login form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.login input[type="password"] {
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-ctl);
    background: var(--sheet-2);
    font-size: 16px;
}

.login input[type="password"]:focus {
    outline: none;
    border-color: var(--pen);
    box-shadow: 0 0 0 3px var(--pen-soft);
}

.login button {
    min-height: 46px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--radius-ctl);
    background: var(--pen);
    color: var(--sheet);
    font-weight: 700;
    cursor: pointer;
}

.login button:hover {
    filter: brightness(1.08);
}

.login .error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: var(--radius-ctl);
    background: var(--late-soft);
    color: var(--late);
    font-size: 14px;
}

/* ---------- Commun aux vues 8 : boutons, feuilles, chargement ---------- */

body.has-panel {
    overflow: hidden;
}

.button--pen {
    border-color: var(--pen);
    background: var(--pen);
    color: var(--sheet);
}

.button--pen:hover {
    background: color-mix(in srgb, var(--pen) 86%, var(--ink));
}

.button--small {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13.5px;
}

.button:disabled {
    opacity: 0.55;
    cursor: default;
}

.views.is-loading::before {
    content: "Chargement…";
    display: block;
    margin: 64px auto;
    color: var(--ink-3);
    text-align: center;
}

.load-error {
    max-width: 460px;
    margin: 64px auto;
    padding: 28px 30px;
    border-radius: 16px;
    background: var(--sheet);
    box-shadow: inset 0 6px 0 var(--late), var(--shadow-lift);
}

.load-error__title {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 21px;
    letter-spacing: -0.01em;
}

.load-error__text {
    margin: 0 0 8px;
    color: var(--ink-2);
}

.load-error .button {
    margin-top: 12px;
}

.sheet {
    padding: 20px 24px 22px;
    border-radius: 14px;
    background: var(--sheet);
    box-shadow: var(--shadow);
}

.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sheet__title {
    display: block;
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sheet__subtitle {
    margin: 0 0 2px;
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--ink-2);
}

.sheet__text {
    display: block;
    margin: 6px 0 14px;
    color: var(--ink-2);
    font-size: 14px;
}

/* ---------- Calendrier : une page de carnet par mois ---------- */

.cal__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0 16px;
}

.cal__title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    font-family: var(--font-display);
    line-height: 1;
}

.cal__month {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.cal__year {
    font-size: 40px;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--pen);
    font-variant-numeric: tabular-nums;
}

.cal__summary {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: 14px;
}

.cal__late {
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--late-soft);
    color: var(--late);
    font-weight: 600;
    font-size: 13px;
}

.cal__error {
    color: var(--late);
}

.cal__nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.cal__arrow {
    border-color: var(--rule);
    background: var(--sheet);
}

.cal__sheet {
    overflow: hidden;
    border-radius: 14px;
    background: var(--sheet);
    box-shadow: var(--shadow);
    transition: opacity 0.15s;
}

.cal__sheet.is-loading {
    opacity: 0.7;
}

.cal__weekdays,
.cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal__weekdays {
    border-bottom: 2px solid var(--ink);
}

.cal__weekdays span {
    padding: 10px 12px 8px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.cal__weekdays .is-weekend {
    color: var(--ink-3);
}

.cal__day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 124px;
    padding: 6px 6px 8px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    cursor: cell;
}

.cal__day:nth-child(7n) {
    border-right: 0;
}

.cal__day:nth-last-child(-n + 7) {
    border-bottom: 0;
}

.cal__day.is-weekend {
    background: color-mix(in srgb, var(--sheet-2) 70%, var(--sheet));
}

/* Jours d'un autre mois : hachures légères, comme une page hors carnet. */
.cal__day.is-other {
    background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--rule) 45%, transparent) 7px 8px), var(--sheet-2);
}

.cal__day.is-other .cal__num,
.cal__day.is-other .cal-chip {
    opacity: 0.6;
}

.cal__day:hover {
    background-color: color-mix(in srgb, var(--pen-soft) 35%, var(--sheet));
}

.cal__day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    padding-left: 4px;
}

.cal__num {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cal__day.is-past:not(.is-other) .cal__num {
    color: var(--ink-3);
}

.cal__day.is-today {
    box-shadow: inset 0 3px 0 var(--pen);
}

.cal__day.is-today .cal__num {
    background: var(--pen);
    color: var(--sheet);
}

.cal__add {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px dashed var(--rule);
    border-radius: 7px;
    background: var(--sheet);
    color: var(--pen);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s;
}

.cal__day:hover .cal__add,
.cal__add:focus-visible {
    opacity: 1;
}

.cal__add:hover {
    border-style: solid;
    border-color: var(--pen);
}

.cal__chips {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Pastille : une mini-fiche avec l'onglet de couleur du projet, comme les cartes du tableau. */
.cal-chip {
    --project: var(--ink-3);
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 5px;
    width: 100%;
    min-height: 24px;
    padding: 3px 7px 3px 10px;
    border: 0;
    border-radius: 6px;
    background: color-mix(in srgb, var(--project) 15%, var(--sheet));
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.cal-chip::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--project);
}

.cal-chip:hover {
    background: color-mix(in srgb, var(--project) 26%, var(--sheet));
}

.cal-chip__time {
    flex: none;
    color: color-mix(in srgb, var(--project) 55%, var(--ink));
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cal-chip__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-chip.is-done {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--rule);
    color: var(--ink-3);
}

.cal-chip.is-done::before {
    opacity: 0.45;
}

.cal-chip.is-done .cal-chip__title {
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--done) 75%, transparent);
    text-decoration-thickness: 2px;
}

.cal-chip.is-late {
    box-shadow: inset 0 0 0 1.5px var(--late);
}

.cal-chip.is-late::before {
    background: repeating-linear-gradient(180deg, var(--late) 0 4px, var(--project) 4px 8px);
}

.cal-chip.is-dragging {
    opacity: 0.35;
}

.cal-chip.is-saving {
    opacity: 0.6;
}

.cal-chip.is-new,
.agenda__item.is-new {
    animation: drop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.cal__more {
    align-self: flex-start;
    margin-top: 1px;
    padding: 1px 8px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--sheet);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.cal__more:hover {
    border-color: var(--pen);
    color: var(--pen);
}

/* Cible du glisser-déposer. */
.cal.is-dragging .cal__day {
    cursor: copy;
}

.cal__day.is-target {
    background: var(--pen-soft);
    box-shadow: inset 0 0 0 2px var(--pen);
}

.cal__new {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal__new-input {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--pen);
    border-radius: 6px;
    background: var(--sheet);
    box-shadow: 0 0 0 3px var(--pen-soft);
    font-size: 13px;
}

.cal__new-input:focus {
    outline: none;
}

.cal__new-hint {
    padding-left: 2px;
    color: var(--ink-3);
    font-size: 11px;
}

.cal__new.is-busy {
    opacity: 0.6;
}

.agenda {
    display: none;
}

/* ---------- Historique : une frise, une feuille par jour ---------- */

.hist {
    max-width: 820px;
    margin: 0 auto;
}

.hist__head {
    margin: 6px 0 14px;
}

.hist__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.hist__lede {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: 14px;
}

.hist__day {
    margin-bottom: 18px;
}

.hist__date {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0 0 8px;
    padding-left: 4px;
    font-family: var(--font-display);
}

.hist__date-main {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hist__date-sub {
    color: var(--ink-3);
    font-size: 14px;
    font-weight: 500;
}

.hist__list {
    position: relative;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    border-radius: 14px;
    background: var(--sheet);
    box-shadow: var(--shadow);
}

/* Le rail de la frise, aligné sur les pastilles. */
.hist__list::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: calc(16px + 3.4em + 14px + 5px);
    width: 2px;
    background: var(--rule);
}

.hist__event {
    --project: var(--ink-3);
    position: relative;
    display: grid;
    grid-template-columns: 3.4em 12px minmax(0, 1fr);
    gap: 0 14px;
    align-items: start;
    padding: 7px 18px 7px 16px;
}

.hist__time {
    padding-top: 2px;
    color: var(--ink-3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.hist__node {
    position: relative;
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--project);
    box-shadow: 0 0 0 3px var(--sheet);
}

.hist__event--created .hist__node {
    width: 14px;
    height: 14px;
    margin: 4px 0 0 -1px;
    box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px color-mix(in srgb, var(--project) 35%, transparent);
}

.hist__event--updated .hist__node,
.hist__event--snoozed .hist__node {
    background: var(--sheet);
    border: 2.5px solid var(--project);
}

.hist__event--deleted .hist__node {
    background: var(--sheet);
    border: 2.5px solid var(--late);
}

.hist__body {
    min-width: 0;
}

.hist__task {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.hist__task:hover {
    text-decoration: underline;
    text-decoration-color: var(--project);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.hist__task.is-gone {
    color: var(--ink-3);
    cursor: default;
}

.hist__what {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 2px 0 0;
    color: var(--ink-2);
    font-size: 13.5px;
}

.hist__project {
    flex: none;
    max-width: 14em;
    padding: 0 7px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--project) 14%, var(--sheet));
    color: color-mix(in srgb, var(--project) 70%, var(--ink));
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hist__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.hist__event--deleted .hist__text {
    color: var(--late);
    font-weight: 600;
}

.hist__status {
    --status: var(--ink-2);
    padding: 0 6px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--status) 16%, var(--sheet));
    color: color-mix(in srgb, var(--status) 60%, var(--ink));
    font-weight: 600;
}

.hist__status--doing {
    --status: var(--doing);
}

.hist__status--done {
    --status: var(--done);
}

.hist__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 0;
}

.hist__end {
    margin: 0;
    color: var(--ink-3);
    font-size: 13.5px;
}

.hist__error {
    margin: 0;
    color: var(--late);
}

/* ---------- Réglages ---------- */

.settings {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    max-width: 1120px;
    margin: 6px auto 0;
}

.settings__side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.projects {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.projects__row {
    --project: var(--ink-3);
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--rule);
}

.projects__swatch {
    width: 24px;
    height: 24px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--project);
    box-shadow: 0 0 0 3px var(--sheet), 0 0 0 4px color-mix(in srgb, var(--project) 45%, var(--rule));
    cursor: pointer;
}

.projects__swatch[aria-expanded="true"] {
    box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--project);
}

.projects__name {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-ctl);
    background: transparent;
    font-weight: 600;
}

.projects__name:not([readonly]):hover {
    border-color: var(--rule);
}

.projects__name:not([readonly]):focus {
    outline: none;
    border-color: var(--pen);
    background: var(--sheet-2);
    box-shadow: 0 0 0 3px var(--pen-soft);
}

.projects__name[readonly] {
    cursor: default;
}

.projects__name[readonly]:focus-visible {
    outline-offset: -2px;
}

.projects__count {
    color: var(--ink-3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.projects__tag {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--sheet-2);
    color: var(--ink-3);
    font-size: 12.5px;
    white-space: nowrap;
}

.projects__row.is-archived .projects__swatch {
    filter: grayscale(0.7);
    opacity: 0.6;
}

.projects__row.is-archived .projects__name {
    color: var(--ink-2);
}

.palette {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 2px 4px 2px;
    animation: fade 0.15s ease-out;
}

.palette__swatch {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--swatch);
    cursor: pointer;
    transition: transform 0.1s;
}

.palette__swatch:hover {
    transform: scale(1.12);
}

.palette__swatch[aria-pressed="true"] {
    box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--swatch);
}

.palette__other {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
}

.palette__custom {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--sheet);
    cursor: pointer;
}

.settings__add {
    display: flex;
    gap: 8px;
}

.settings__add input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px dashed var(--rule);
    border-radius: var(--radius-ctl);
    background: var(--sheet-2);
}

.settings__add input:focus {
    outline: none;
    border-style: solid;
    border-color: var(--pen);
    box-shadow: 0 0 0 3px var(--pen-soft);
}

.projects__archived {
    margin-top: 24px;
}

.projects__archived .sheet__text {
    margin-bottom: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--sheet-2);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-3);
}

.status-pill.is-on {
    background: color-mix(in srgb, var(--done) 14%, var(--sheet));
    color: var(--done);
}

.status-pill.is-on::before {
    background: var(--done);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--done) 25%, transparent);
}

/* Code de liaison : un ticket à recopier dans Telegram. */
.link-code__step {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.link-code__ticket {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border: 1.5px dashed var(--pen);
    border-radius: 12px;
    background: var(--pen-soft);
}

.link-code__command {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    user-select: all;
}

.link-code__timer {
    margin: 8px 0 0;
    color: var(--ink-3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.link-code__expired {
    margin: 0 0 10px;
    color: var(--late);
    font-size: 14px;
}

.switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.switch .sheet__text {
    margin-bottom: 0;
}

.switch__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch__track {
    position: relative;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: var(--rule);
    transition: background-color 0.15s;
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sheet);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
    transition: transform 0.15s;
}

.switch__input:checked + .switch__track {
    background: var(--pen);
}

.switch__input:checked + .switch__track::after {
    transform: translateX(18px);
}

.switch__input:focus-visible + .switch__track {
    outline: 2px solid var(--pen);
    outline-offset: 2px;
}

.switch__input:disabled + .switch__track {
    opacity: 0.6;
}

.settings__session .sheet__text {
    margin-bottom: 12px;
}

@media (max-width: 960px) {
    .settings {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Petits écrans : la grille garde ses 7 colonnes, les pastilles deviennent des points, l'agenda du jour prend le relais. */
@media (max-width: 720px) {
    .cal__head {
        flex-wrap: wrap;
        align-items: center;
        margin-top: 0;
    }

    .cal__month,
    .cal__year,
    .hist__title {
        font-size: 30px;
    }

    .cal__nav {
        width: 100%;
    }

    .cal__today {
        flex: 1;
    }

    .cal__sheet {
        margin: 0 -6px;
    }

    .cal__weekdays span {
        padding: 8px 0 6px;
        font-size: 12px;
        text-align: center;
    }

    .cal__day {
        align-items: center;
        gap: 3px;
        min-height: 58px;
        padding: 4px 2px 6px;
        cursor: pointer;
    }

    .cal__day:hover {
        background-color: transparent;
    }

    .cal__day-head {
        justify-content: center;
        min-height: 0;
        padding: 0;
    }

    .cal__num {
        min-width: 30px;
        height: 30px;
        padding: 0;
        font-size: 14px;
    }

    .cal__day.is-today {
        box-shadow: none;
    }

    .cal__day.is-selected .cal__num {
        box-shadow: 0 0 0 2px var(--pen);
    }

    .cal__day.is-selected {
        background: color-mix(in srgb, var(--pen-soft) 55%, var(--sheet));
    }

    .cal__add,
    .cal__new,
    .cal-chip__time,
    .cal-chip__title {
        display: none;
    }

    .cal__chips {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
        max-width: 34px;
    }

    .cal-chip,
    .cal-chip.is-done,
    .cal-chip.is-late {
        width: 7px;
        min-height: 0;
        height: 7px;
        padding: 0;
        border-radius: 50%;
        background: var(--project);
        box-shadow: none;
        pointer-events: none;
    }

    .cal-chip::before {
        display: none;
    }

    .cal-chip.is-done {
        opacity: 0.35;
    }

    .cal__more {
        padding: 0 4px;
        border: 0;
        background: none;
        font-size: 10.5px;
        pointer-events: none;
    }

    .agenda {
        display: block;
        margin-top: 18px;
    }

    .agenda__day {
        margin: 0 0 10px;
        font-family: var(--font-display);
        font-size: 19px;
        letter-spacing: -0.01em;
    }

    .agenda__list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 0 0 12px;
        padding: 0;
        list-style: none;
    }

    .agenda__item {
        --project: var(--ink-3);
        position: relative;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 10px 14px 10px 18px;
        border: 0;
        border-radius: var(--radius-card);
        background: var(--sheet);
        box-shadow: var(--shadow);
        text-align: left;
        cursor: pointer;
        overflow: hidden;
    }

    .agenda__item::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 5px;
        background: var(--project);
    }

    .agenda__title {
        font-size: 15.5px;
        font-weight: 500;
        overflow-wrap: anywhere;
    }

    .agenda__meta {
        margin-top: 2px;
        color: var(--ink-2);
        font-size: 13px;
    }

    .agenda__item.is-done .agenda__title {
        color: var(--ink-2);
        text-decoration: line-through;
        text-decoration-color: color-mix(in srgb, var(--done) 70%, transparent);
        text-decoration-thickness: 2px;
    }

    .agenda__item.is-late {
        box-shadow: inset 0 0 0 1.5px var(--late), var(--shadow);
    }

    .agenda__empty {
        margin: 0 0 12px;
        padding: 14px;
        border: 1px dashed var(--rule);
        border-radius: var(--radius-card);
        color: var(--ink-3);
        font-size: 14px;
        text-align: center;
    }

    .agenda__form {
        display: flex;
        gap: 8px;
    }

    .agenda__input {
        flex: 1;
        min-width: 0;
        height: 42px;
        padding: 0 12px;
        border: 1px solid var(--rule);
        border-radius: var(--radius-ctl);
        background: var(--sheet);
        font-size: 16px;
    }

    .agenda__input:focus {
        outline: none;
        border-color: var(--pen);
        box-shadow: 0 0 0 3px var(--pen-soft);
    }

    .hist__list::before {
        left: calc(12px + 3.1em + 10px + 5px);
    }

    .hist__event {
        grid-template-columns: 3.1em 12px minmax(0, 1fr);
        gap: 0 10px;
        padding: 7px 12px;
    }

    .sheet {
        padding: 18px 16px 20px;
    }

    .projects__row {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }

    .projects__count {
        display: none;
    }

    .link-code__command {
        font-size: 22px;
    }
}

/* ---------- Petits écrans ---------- */

@media (max-width: 720px) {
    .topbar__row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px 6px;
    }

    .brand {
        order: 1;
    }

    .topbar__actions {
        order: 2;
        margin-left: auto;
    }

    .quick {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .quick__key {
        display: none;
    }

    .quick__input {
        font-size: 16px;
    }

    .tabs {
        padding: 0 6px;
    }

    .views {
        padding: 14px 16px 48px;
    }

    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -16px 14px;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }

    .chip {
        flex: none;
    }

    .board {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .column {
        min-height: 0;
    }

    .panel {
        width: 100vw;
        border-left: 0;
        border-top: 6px solid var(--project);
    }

    .field-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .panel__title {
        font-size: 19px;
    }

    .panel__body {
        padding: 14px 16px 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
