/* WorkWave */
:root {
  color-scheme: light;
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #e8eeed;
  --ink: #10243a;
  --ink-2: #4d6072;
  --line: #d5dedd;
  --line-strong: #a9b9ba;
  --brand: #0b6e75;
  --brand-hover: #085960;
  --on-brand: #ffffff;
  --brand-soft: #dceeee;
  --danger: #b92c33;
  --danger-soft: #fbe6e5;
  --warn-soft: #fdf1d3;
  --warn-ink: #6d4d05;
  --ok-soft: #dcf3e4;
  --ok-ink: #14613a;
  --todo: #5b6f82;
  --doing: #1673b3;
  --done: #1d8a54;
  --level-1: #6fa8c9;
  --level-2: #2fa89a;
  --level-3: #d9a520;
  --level-4: #e97e2e;
  --level-5: #dc3a43;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 36, 58, .07);
  --shadow-lift: 0 8px 24px rgba(16, 36, 58, .16);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1724;
    --surface: #14243a;
    --surface-2: #1b2e47;
    --ink: #e8eff4;
    --ink-2: #a2b3c2;
    --line: #27405a;
    --line-strong: #41617f;
    --brand: #3cc4bd;
    --brand-hover: #63d6d0;
    --on-brand: #06222a;
    --brand-soft: #143e47;
    --danger: #ff7f7f;
    --danger-soft: #41202a;
    --warn-soft: #3d3216;
    --warn-ink: #f4d58a;
    --ok-soft: #153a2b;
    --ok-ink: #8ce0b3;
    --todo: #9ab0c4;
    --doing: #62b2ea;
    --done: #58cf8e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand); }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.muted { color: var(--ink-2); }
.icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Barre supérieure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.logo-mark { width: 30px; height: 21px; color: var(--brand); }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.is-active { background: var(--brand-soft); color: var(--brand); }
.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-name { font-weight: 550; }
.topbar-user form { margin: 0; }

.avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink);
  font-size: .72rem; font-weight: 700;
}
.avatar-admin { background: var(--brand); color: var(--on-brand); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon-danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 0; border: 0; background: none;
  color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.link-button:hover { color: var(--brand); }
.link-button .icon { width: 15px; height: 15px; }

/* ---------- Mise en page ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.back-link:hover { color: var(--brand); }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-page { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.empty {
  padding: 40px 20px; text-align: center; color: var(--ink-2);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty h1 { color: var(--ink); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 500; }
.flash-success { background: var(--ok-soft); color: var(--ok-ink); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warn-soft); color: var(--warn-ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-weight: 550; box-shadow: var(--shadow-lift);
}
.toast.is-error { background: var(--danger); color: #fff; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend, .label { font-weight: 600; font-size: .9rem; padding: 0; }
.field legend { margin-bottom: 6px; }
.field small, .label small { font-weight: 400; color: var(--ink-2); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
input[readonly] { background: var(--surface-2); color: var(--ink-2); cursor: default; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.inline-form .grow { flex: 1 1 220px; }
.input-with-button { display: flex; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.inline-check { min-height: 40px; }
.client-form { margin-bottom: 18px; }

/* ---------- Niveaux : une vague qui monte ---------- */
.level { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.level-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.level-bars i { width: 4px; border-radius: 2px; background: var(--line); }
.level-bars i:nth-child(1) { height: 5px; }
.level-bars i:nth-child(2) { height: 8px; }
.level-bars i:nth-child(3) { height: 10px; }
.level-bars i:nth-child(4) { height: 13px; }
.level-bars i:nth-child(5) { height: 16px; }
.level-1 .level-bars i:nth-child(-n+1) { background: var(--level-1); }
.level-2 .level-bars i:nth-child(-n+2) { background: var(--level-2); }
.level-3 .level-bars i:nth-child(-n+3) { background: var(--level-3); }
.level-4 .level-bars i:nth-child(-n+4) { background: var(--level-4); }
.level-5 .level-bars i { background: var(--level-5); }

.level-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.level-option { cursor: pointer; }
.level-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.level-option-box {
  display: flex; justify-content: center; align-items: center; height: 100%;
  padding: 10px 6px; border: 1px solid var(--line-strong); border-radius: 8px;
}
.level-option-box .level { flex-direction: column; gap: 5px; font-size: .8rem; }
.level-option:hover .level-option-box { background: var(--surface-2); }
.level-option input:checked + .level-option-box { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.level-option input:focus-visible + .level-option-box { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Statuts ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-todo { color: var(--todo); }
.status-doing { color: var(--doing); }
.status-done { color: var(--done); }
.meta-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 9px; }
.segmented button {
  min-height: 34px; padding: 4px 2px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-current { background: var(--surface); box-shadow: var(--shadow); }
.segmented button.status-todo { color: var(--todo); }
.segmented button.status-doing { color: var(--doing); }
.segmented button.status-done { color: var(--done); }

/* ---------- Filtres ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  margin-bottom: 18px;
}
.filter { display: flex; flex-direction: column; gap: 3px; flex: 0 1 200px; min-width: 140px; }
.filter > span:not(.sr-only) { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.filter:has(select[name="sort"]) { flex-basis: 280px; }
.filter-search { position: relative; flex: 1 1 240px; max-width: 360px; justify-content: flex-end; }
.filter-search .icon { position: absolute; left: 11px; bottom: 11px; color: var(--ink-2); }
.filter-search input { padding-left: 36px; }
.filters-reset { align-self: center; margin-top: 18px; font-weight: 600; font-size: .9rem; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-tabs { display: none; }
.column {
  background: var(--surface-2); border-radius: 12px; padding: 12px;
  border-top: 3px solid var(--todo); min-height: 200px;
  transition: box-shadow .12s;
}
.column-doing { border-top-color: var(--doing); }
.column-done { border-top-color: var(--done); }
.column.is-over { box-shadow: inset 0 0 0 2px var(--brand); }
.column-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .95rem; padding: 2px 4px 12px;
}
.column-title span {
  min-width: 26px; padding: 1px 8px; border-radius: 999px; text-align: center;
  background: var(--surface); font-size: .8rem; color: var(--ink-2);
}
.column-cards { display: flex; flex-direction: column; gap: 10px; }
.column-empty { display: none; padding: 22px 8px; text-align: center; color: var(--ink-2); font-size: .9rem; }
.column-cards > .column-empty:first-child { display: block; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 12px 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .12s, transform .12s;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.card[draggable="true"] { cursor: grab; }
.card.is-dragging { opacity: .4; }
.card-level-5 { border-left: 3px solid var(--level-5); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-project {
  font-size: .78rem; font-weight: 650; color: var(--brand);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-title { font-size: .98rem; font-weight: 600; overflow-wrap: anywhere; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-title a:hover { color: var(--brand); }
.card-title a:focus-visible::after { outline: 2px solid var(--brand); outline-offset: 2px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .8rem; color: var(--ink-2); }
.card-creator { display: inline-flex; align-items: center; gap: 6px; width: 100%; }
.card-creator .avatar { width: 22px; height: 22px; font-size: .6rem; }
.card-count { display: inline-flex; align-items: center; gap: 3px; }
.card-count .icon { width: 14px; height: 14px; }
.card-status { display: none; position: relative; z-index: 1; }
.card-status select { min-height: 36px; padding: 4px 8px; font-size: .88rem; }
@media (hover: none) { .card-status { display: block; } }

/* ---------- Page ticket ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.eyebrow { color: var(--brand); font-weight: 650; font-size: .85rem; margin-bottom: 4px; }
.ticket-head h1 { overflow-wrap: anywhere; }
.prose { overflow-wrap: anywhere; line-height: 1.6; }
.ticket-side { position: sticky; top: 76px; }
.ticket-side .panel { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.meta { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.meta > div { display: flex; justify-content: space-between; gap: 14px; }
.meta dt { color: var(--ink-2); font-size: .88rem; flex: none; }
.meta dd { margin: 0; font-weight: 550; text-align: right; font-size: .9rem; overflow-wrap: anywhere; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gallery-item { margin: 0; min-width: 0; }
.gallery-item img, .gallery-item video {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: 8px; background: var(--surface-2);
}
.gallery-item video { object-fit: contain; background: #000; }
.gallery-item figcaption {
  margin-top: 4px; font-size: .76rem; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.locked-note { display: flex; gap: 8px; color: var(--ink-2); font-size: .88rem; }
.links { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.links .count { color: var(--ink-2); font-weight: 500; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.link-list li {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px;
  padding: 4px 6px 4px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
.link-list a { flex: 1 1 180px; min-width: 0; font-weight: 550; overflow-wrap: anywhere; }
.link-list form { margin: 0; }
.link-id { color: var(--ink-2); font-weight: 400; }
.link-form { margin: 0; }
.comments { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.comments .count { color: var(--ink-2); font-weight: 500; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.thread-replies { display: flex; flex-direction: column; gap: 12px; margin-left: 19px; padding-left: 20px; border-left: 2px solid var(--line); }
.comment { display: flex; gap: 11px; scroll-margin-top: 80px; }
.comment:target .comment-main { background: var(--brand-soft); }
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border-radius: 8px; }
.comment-main > * { max-width: 100%; }
.comment-main .gallery, .reply-slot { width: 100%; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.comment-head time { color: var(--ink-2); font-size: .8rem; }
.comment-body { overflow-wrap: anywhere; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: .72rem; font-weight: 650;
}
.tag-off { background: var(--surface-2); color: var(--ink-2); }
.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form-title { margin-top: 8px; }
.reply-slot .comment-form { margin-top: 8px; }

.dropzone .dropzone-target {
  font-size: inherit;
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-weight: 550;
}
.dropzone-target:hover, .dropzone-target.is-over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.dropzone-target small { font-weight: 400; width: 100%; font-size: .78rem; }
.dropzone-target input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-target:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dropzone-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .88rem; }
.dropzone-list img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.dropzone-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-files { list-style: none; margin: 0; padding: 0; }
.existing-files li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.existing-files li span { min-width: 0; overflow-wrap: anywhere; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(6, 15, 25, .85); }
.lightbox img { max-width: 94vw; max-height: 94vh; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: fixed; top: 14px; right: 14px; background: rgba(255, 255, 255, .9); color: #10243a; }
.lightbox-close:hover { background: #fff; color: #10243a; }

/* ---------- Listes d'administration ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.row.is-muted .row-title { color: var(--ink-2); }
.row-flat { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.row-flat form { margin: 0; }
.row-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: .85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.row-link { font-size: .88rem; font-weight: 600; white-space: nowrap; }
.row-details summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 12px 14px; cursor: pointer; list-style: none;
}
.row-details summary::-webkit-details-marker { display: none; }
.row-details summary .row-title { flex: 1 1 160px; }
.row-toggle { color: var(--ink-2); display: inline-flex; }
.row-details[open] .row-toggle { color: var(--brand); }
.row-body { padding: 14px; border-top: 1px solid var(--line); }
.row-body .inline-form { margin-bottom: 12px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.install-checks, .install-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.install-checks .is-ok { color: var(--ok-ink); }
.install-checks .is-bad { color: var(--danger); font-weight: 600; }

/* ---------- Connexion ---------- */
.login-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: #0d2438; overflow-x: hidden; position: relative;
}
.login {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  padding: 24px 16px 150px;
  display: flex; flex-direction: column; gap: 22px;
}
.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: #f1f7f7; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
}
.login-brand .logo-mark { width: 44px; height: 31px; color: #4fd0c8; }
.login-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px; background: var(--surface); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}
.login-card h1 { font-size: 1.35rem; }
.login-card .flash { margin: 0; }
.login-waves { position: fixed; left: 0; bottom: 0; width: 100%; height: 34vh; z-index: 1; }
.wave { transform-box: fill-box; transform-origin: center; }
.wave-back { fill: #12405a; animation: drift 16s ease-in-out infinite alternate; }
.wave-mid { fill: #0f6a78; animation: drift 12s ease-in-out infinite alternate-reverse; }
.wave-front { fill: #17949a; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-5%) scaleX(1.12); } to { transform: translateX(5%) scaleX(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; }
  .card, .column { transition: none; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1000px) {
  .ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .ticket-side { position: static; grid-row: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .page { padding: 16px 16px 92px; }
  h1 { font-size: 1.45rem; }
  .topbar { padding: 8px 16px; gap: 12px; }
  .topbar-name { display: none; }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .mainnav a { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: .72rem; text-align: center; }
  .mainnav .icon { width: 21px; height: 21px; }
  .toast { bottom: 84px; }

  .filter { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .filter-search, .filter:has(select[name="sort"]) { flex: 1 1 100%; max-width: none; }
  .filters-reset { margin-top: 0; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }

  .board-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
    padding: 3px; margin-bottom: 12px; background: var(--surface-2); border-radius: 9px;
  }
  .board-tab {
    min-height: 40px; padding: 4px; border: 0; border-radius: 7px; background: transparent;
    color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  }
  .board-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .board {
    display: flex; gap: 12px; margin: 0 -16px; padding: 0 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
    align-items: flex-start; scrollbar-width: none; position: relative;
  }
  .board::-webkit-scrollbar { display: none; }
  .column { flex: 0 0 100%; scroll-snap-align: start; }
  .column-title { display: none; }

  .level-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thread-replies { margin-left: 8px; padding-left: 12px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .inline-form > .btn { width: 100%; }
  .row-flat { flex-wrap: wrap; }
  .row-flat .row-grow { flex: 1 1 calc(100% - 50px); }
  .row-flat .row-link { margin-right: auto; }
}
