/* =========================================================================
   Suivi des dossiers — feuille de style
   ========================================================================= */
/* Instrument Sans (SIL Open Font License, voir fonts/OFL-instrument-sans.txt), hébergée localement. */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(../fonts/instrument-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(../fonts/instrument-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: italic; font-display: swap; font-weight: 400 700;
  src: url(../fonts/instrument-sans-latin-wght-italic.woff2) format('woff2'); }

:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e4e7ed;
  --border-strong: #cdd2dc;
  --text: #171b24;
  --text-2: #4a5263;
  --muted: #717a8c;
  --primary: #2f5bea;
  --primary-600: #2449c7;
  --primary-soft: #eaf0ff;
  --danger: #d93a3a;
  --danger-soft: #fdeceb;
  --warning: #b86e00;
  --warning-soft: #fff4e0;
  --success: #1f8a4c;
  --success-soft: #e5f6ec;
  --info: #2f6fb8;
  --info-soft: #e6f0fb;
  --neutral-soft: #eef0f4;
  --sidebar: #141b2d;
  --sidebar-text: #aeb7cb;
  --sidebar-active: #ffffff;
  --series-1: #2f5bea;
  --commission: #8a4bd6;
  --series-2: #e8883a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 58px;
  --font: 'Instrument Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e121b;
    --surface: #161c29;
    --surface-2: #1b2232;
    --border: #262f42;
    --border-strong: #35415b;
    --text: #e6eaf2;
    --text-2: #b9c1d2;
    --muted: #8591a8;
    --primary: #5b82ff;
    --primary-600: #7a99ff;
    --primary-soft: #1f2b4d;
    --danger: #f06a6a;
    --danger-soft: #3a1f24;
    --warning: #f0a940;
    --warning-soft: #3a2c16;
    --success: #4cc27f;
    --success-soft: #16332a;
    --info: #6aa7ec;
    --info-soft: #182b40;
    --neutral-soft: #242d40;
    --sidebar: #0b0f18;
    --series-1: #5b82ff;
    --commission: #b48cff;
    --series-2: #f0a052;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-optical-sizing: auto;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; word-spacing: .04em; line-height: 1.15; }
h2 { font-size: 1.06rem; font-weight: 620; word-spacing: .03em; }
h3 { font-size: .95rem; font-weight: 620; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible, a:focus-visible, .segmented button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--neutral-soft); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; color: inherit; padding: 6px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--neutral-soft); }

/* ---------------------------------------------------------------- Formulaires */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field-label { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); }
.field .hint { font-size: .78rem; color: var(--muted); }
.field .err { font-size: .8rem; color: var(--danger); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; min-height: 40px; width: 100%; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--primary); }
input.invalid, select.invalid, textarea.invalid, .tag-input.invalid { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: var(--radius-sm); margin: 0; font-size: .9rem; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.input-affix { position: relative; }
.input-affix input { padding-right: 44px; }
.input-affix .affix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }

/* Tag input */
.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 5px 8px; background: var(--surface); min-height: 40px; cursor: text;
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.tag-input input { border: 0; padding: 4px 2px; min-height: 0; flex: 1; min-width: 120px; outline: none; background: transparent; box-shadow: none !important; }
.tag-input .tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 1rem; line-height: 1; }

/* ---------------------------------------------------------------- Connexion */
.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 32px 28px 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 1.45rem; }
.login-card p.muted { margin: -8px 0 6px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); position: relative; flex: none; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 25%; height: 3px; border-radius: 2px; background: #fff; }
.brand-mark::before { top: 34%; width: 50%; box-shadow: 0 6px 0 #fff; }
.brand-mark::after { top: calc(34% + 12px); width: 32%; }
.brand-mark.sm { width: 28px; height: 28px; border-radius: 7px; }
.brand-mark.sm::before { top: 30%; height: 2px; box-shadow: 0 4px 0 #fff; }
.brand-mark.sm::after { top: calc(30% + 8px); height: 2px; }

/* ---------------------------------------------------------------- Structure */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 650; }
.sidebar-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--sidebar-text); padding: 9px 12px; border-radius: 10px; font-weight: 520; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(91, 130, 255, .18); background: color-mix(in srgb, var(--primary) 26%, transparent); color: var(--sidebar-active); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav a svg { flex: none; opacity: .9; }
.nav .nav-sep { font-size: .78rem; font-weight: 600; color: #7a8499; padding: 16px 12px 4px; }
.sidebar-foot { padding: 14px 18px; font-size: .75rem; color: #6b7690; border-top: 1px solid rgba(255, 255, 255, .06); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h);
}
.topbar-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); padding: 4px 8px; border-radius: 999px; }
.user-chip:hover { background: var(--neutral-soft); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.menu-btn { display: none; }
.backdrop { display: none; }
.view { padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

/* ---------------------------------------------------------------- Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 20px; }
.card + .card, .card + .grid-2, .grid-2 + .card, .kpis + .card, .kpis + .kpis, .notice + .card { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.grid-main-side > .col { display: flex; flex-direction: column; gap: 20px; }
.grid-main-side > .col > .card + .card { margin-top: 0; }

.notice { padding: 11px 14px; border-radius: var(--radius-sm); line-height: 1.45; background: var(--info-soft); color: var(--info); font-size: .88rem; border: 1px solid transparent; }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice + .grid-2, .notice + .kpis { margin-top: 16px; }

/* ---------------------------------------------------------------- KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; color: var(--text); position: relative; overflow: hidden; }
a.kpi:hover { border-color: var(--border-strong); text-decoration: none; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-accent, transparent); }
.kpi .label { font-size: .84rem; color: var(--text-2); font-weight: 560; }
.kpi .value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpis-money .kpi .value { font-size: 1.35rem; }
.kpis.kpis-money { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi.k-ouvert { --kpi-accent: var(--info); }
.kpi.k-en_cours { --kpi-accent: var(--warning); }
.kpi.k-termine { --kpi-accent: var(--success); }
.kpi.k-refuse { --kpi-accent: var(--danger); }
.kpi.k-total { --kpi-accent: var(--primary); }
.kpi.k-commission { --kpi-accent: var(--commission); }
.kpi.k-commission .value { color: var(--commission); }
.kpi.k-commission-soft { --kpi-accent: var(--commission); opacity: .9; }

/* ---------------------------------------------------------------- Badges & tags */
.badge { font-family: var(--font); display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ouvert { background: var(--info-soft); color: var(--info); }
.badge-en_cours { background: var(--warning-soft); color: var(--warning); }
.badge-termine { background: var(--success-soft); color: var(--success); }
.badge-refuse { background: var(--danger-soft); color: var(--danger); }
.badge-archive, .badge-neutral { background: var(--neutral-soft); color: var(--text-2); }
.badge-admin { background: var(--primary-soft); color: var(--primary); }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--text-2); font-size: .78rem; font-weight: 500; }
a.tag:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.due-overdue { color: var(--danger); font-weight: 600; }
.due-soon { color: var(--warning); font-weight: 600; }

/* ---------------------------------------------------------------- Segmented */
.segmented { display: inline-flex; background: var(--neutral-soft); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { white-space: nowrap; border: 0; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 7px; font: inherit; font-size: .86rem; font-weight: 580; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.period-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-custom input { width: auto; padding: 5px 8px; }

/* ---------------------------------------------------------------- Graphique */
.chart-wrap { width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); }
.chart .s1 { fill: var(--series-1); }
.chart .s-com { fill: var(--commission); }
.chart .s2 { fill: var(--series-2); }
.chart rect.hit { fill: transparent; }
.chart rect.hit:hover { fill: var(--neutral-soft); opacity: .6; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l1 { background: var(--series-1); }
.legend .l-com { background: var(--commission); }
.legend .l2 { background: var(--series-2); }
.period-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.period-summary div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.period-summary b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.period-summary span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--neutral-soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--series-1); border-radius: 99px; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--neutral-soft); }
.stack span { height: 100%; }
.stack .st-ouvert { background: var(--info); }
.stack .st-en_cours { background: var(--warning); }
.stack .st-termine { background: var(--success); }
.stack .st-refuse { background: var(--danger); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .82rem; color: var(--text-2); }
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 22px; }
.sub-grid h3 { margin-bottom: 12px; }

/* ---------------------------------------------------------------- Listes compactes */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list a.row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; color: var(--text); }
.list a.row:hover { background: var(--surface-2); text-decoration: none; }
.list .row .main-col { flex: 1; min-width: 0; }
.list .row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .row .meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .row .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- Filtres */
.filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; }
.filters .more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.filters-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 14px; }
.filters-bar .left, .filters-bar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; bottom: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; }

/* ---------------------------------------------------------------- Tableau */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .82rem; color: var(--text-2); font-weight: 600; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { opacity: .35; margin-left: 3px; }
.table th.sorted .arrow { opacity: 1; color: var(--primary); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table tbody tr.archived td { opacity: .65; }
.table td.name-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-bottom: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.pager .pages { display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- Détail */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.detail-grid .item { padding: 12px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.detail-grid .item:nth-child(odd) { border-right: 1px solid var(--border); }
.detail-grid .item.full { grid-column: 1 / -1; border-right: 0; }
.detail-grid dt { font-size: .82rem; color: var(--muted); font-weight: 560; margin-bottom: 3px; }
.detail-grid dd { margin: 0; word-break: break-word; }
.amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.amounts div { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.amounts span { font-size: .78rem; color: var(--muted); font-weight: 600; display: block; }
.amounts b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .88rem; margin: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; text-align: right; }

/* ---------------------------------------------------------------- Historique */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding: 0 18px 18px 38px; }
.timeline > li::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.timeline > li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 14px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline .dot.a-create { border-color: var(--success); }
.timeline .dot.a-delete { border-color: var(--danger); }
.timeline .dot.a-archive, .timeline .dot.a-restore { border-color: var(--muted); }
.timeline .dot.a-export { border-color: var(--info); }
.timeline .head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.timeline .head b { font-weight: 600; }
.timeline .when { font-size: .8rem; color: var(--muted); }
.changes { margin: 8px 0 0; padding: 0; list-style: none; font-size: .84rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.changes li { display: grid; grid-template-columns: 200px 1fr; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.changes li:last-child { border-bottom: 0; }
.changes .f { color: var(--muted); font-weight: 600; }
.changes .v { min-width: 0; word-break: break-word; }
.changes del { color: var(--danger); text-decoration: line-through; opacity: .85; }
.changes ins { color: var(--success); text-decoration: none; }
.timeline-card { padding-top: 18px; }

/* ---------------------------------------------------------------- Modales & toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 25, .5); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--surface); padding: 11px 15px; border-radius: 12px; font-weight: 520; box-shadow: var(--shadow-lg); font-size: .9rem; animation: slide .18s ease-out; max-width: 380px; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--success); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.error-box { padding: 24px; text-align: center; }

/* ---------------------------------------------------------------- Comptes client */
.auth-switch { margin: 0; text-align: center; font-size: .88rem; color: var(--muted); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--primary); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.form-error.ok { color: var(--success); background: var(--success-soft); }
.badge-client { background: #f1eafe; color: #6b3fd4; }
@media (prefers-color-scheme: dark) { .badge-client { background: #2c2147; color: #b89cff; } }
.client-msg { background: var(--primary-soft); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-top: 20px; }
.client-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px; color: var(--text); transition: border-color .12s, transform .12s; }
.client-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.client-card + .client-card { margin-top: 0; }
.cc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-title { font-weight: 650; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.cc-amounts div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.cc-amounts span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.cc-amounts b { font-variant-numeric: tabular-nums; }
.cc-msg { font-size: .85rem; background: var(--primary-soft); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text-2); }
.cc-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.progress { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.progress li { position: relative; min-width: 0; text-align: center; overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.progress li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress .pdot { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-strong); position: relative; z-index: 1; }
.progress li.done, .progress li.current { color: var(--text); }
.progress li.done .pdot { background: var(--primary); border-color: var(--primary); }
.progress li.done::before, .progress li.current::before { background: var(--primary); }
.progress li.current .pdot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.progress.is-refused li.current .pdot { border-color: var(--danger); background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.progress.is-refused li.current { color: var(--danger); }
.progress:not(.is-refused) li.current:last-child .pdot { background: var(--success); border-color: var(--success); }
.timeline .dot.s-termine { border-color: var(--success); }
.timeline .dot.s-refuse { border-color: var(--danger); }
.timeline .dot.s-en_cours { border-color: var(--warning); }

/* ---------------------------------------------------------------- Demandes client */
.badge-pending { background: #fff1d6; color: #9a5b00; }
@media (prefers-color-scheme: dark) { .badge-pending { background: #3a2c16; color: #f0b660; } }
.kpi.k-pending { --kpi-accent: #d98a00; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f0a020; color: #1a1300; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.nav-count.static { margin-left: 6px; vertical-align: 2px; }
.demandes-card { border-color: #f0c060; margin-bottom: 20px; }
.demandes-card h2 { display: flex; align-items: center; gap: 8px; }
.request-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px;
  border: 1px solid #f0c060; background: var(--warning-soft); border-radius: var(--radius); color: var(--text); }
.request-banner > div:first-child { display: flex; gap: 12px; align-items: flex-start; }
.request-banner svg { color: var(--warning); flex: none; margin-top: 2px; }
.request-banner .actions { display: flex; gap: 8px; }
.demande-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.demande { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-left: 3px solid #f0a020; }
.demande-grid > .card + .card { margin-top: 0; }
.demande-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.cc-msg.refused { background: var(--danger-soft); color: var(--danger); }
.progress .psub { font-size: .7rem; font-weight: 600; color: #b87400; text-align: center; }
.progress.is-waiting li.current .pdot { border-color: #f0a020; background: var(--surface); box-shadow: 0 0 0 4px var(--warning-soft); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--warning-soft); } }
.progress.is-waiting li.current { color: var(--text); }
.progress:not(.is-refused):not(.is-waiting) li.current:first-child .pdot { background: var(--primary); }
.timeline .dot.a-accept { border-color: var(--success); background: var(--success); }
.timeline .dot.a-reject { border-color: var(--danger); background: var(--danger); }
.steps-explainer { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.steps-explainer li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; color: var(--text-2); }
.steps-explainer li b { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--neutral-soft); font-size: .78rem; }
.steps-explainer li.on { border-color: var(--primary); color: var(--text); }
.steps-explainer li.on b { background: var(--primary); color: #fff; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) {
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .filters .more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sub-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 16px; }
  .topbar { padding: 8px 16px; }
}
@media (max-width: 720px) {
  h1 { font-size: 1.3rem; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .filters, .filters .more { grid-template-columns: 1fr 1fr; }
  .sub-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .item:nth-child(odd) { border-right: 0; }
  .amounts { grid-template-columns: 1fr; }
  .user-chip .uname { display: none; }
  .changes li { grid-template-columns: 1fr; gap: 2px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 1.35rem; }
  .kpis-money .kpi .value { font-size: 1.1rem; }

  /* Le tableau devient une liste de cartes */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td, .table.responsive tfoot { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: 8px 4px; }
  .table.responsive td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; max-width: none; }
  .table.responsive td::before { content: attr(data-label); font-size: .76rem; color: var(--muted); font-weight: 600; text-align: left; flex: none; }
  .table.responsive td.name-cell { white-space: normal; }
  .table.responsive td[data-empty] { display: none; }
}
@media (max-width: 420px) {
  .client-grid, .demande-grid { grid-template-columns: 1fr; }
  .filters, .filters .more { grid-template-columns: 1fr; }
  .topbar-user .btn { padding: 5px 8px; }
}

/* ---------- Boutiques ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bq-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.bq-tools .search { position: relative; flex: 1 1 260px; max-width: 420px; }
.bq-tools .search svg { bottom: 50%; transform: translateY(50%); }
.bq-tools .search input { width: 100%; }
.delai { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.dl-fast { background: var(--success-soft); color: var(--success); }
.dl-short { background: var(--info-soft); color: var(--info); }
.dl-mid { background: var(--warning-soft); color: var(--warning); }
.dl-long { background: var(--danger-soft); color: var(--danger); }
.bq-edit td { padding: 6px 8px; }
.bq-edit input { width: 100%; min-width: 0; }
@media (max-width: 760px) {
  .bq-edit thead { display: none; }
  .bq-edit tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); }
  .bq-edit td { display: block; padding: 0; border: 0; }
}
.delai::first-letter { text-transform: uppercase; }
.bq-tabs { margin-bottom: 14px; }
.bq-tabs button svg { width: 14px; height: 14px; vertical-align: -2px; }
.bq-edit input.priv { border-style: dashed; border-color: color-mix(in srgb, var(--commission) 45%, var(--border)); }
.bq-save-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 18px; margin: 0; align-items: center; border-radius: 0 0 var(--radius) var(--radius); }
.bq-save-bar #bq-dirty { margin-right: auto; color: var(--warning); }
#bq-hist { padding: 6px 18px; }
@media (max-width: 760px) {
  .bq-edit tr { grid-template-columns: 1fr 1fr auto; }
  .bq-edit td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .bq-edit td:nth-child(2) { grid-column: 1 / 3; grid-row: 2; }
  .bq-edit td:nth-child(3) { grid-column: 1 / 2; grid-row: 3; }
  .bq-edit td:nth-child(4) { grid-column: 2 / 3; grid-row: 3; }
  .bq-edit td:nth-child(5) { grid-column: 1 / 3; grid-row: 4; }
  .bq-edit td:nth-child(6) { grid-column: 1 / 3; grid-row: 5; }
  .bq-edit td:nth-child(7) { grid-row: 1 / 6; grid-column: 3; align-self: center; }
}
.marchand-field select + input { margin-top: 6px; }
.bq-priv-inline { color: var(--commission); font-style: italic; }

.dl-gris { background: var(--neutral-soft); color: var(--text-2); }
.bq-edit select.color-sel { width: 100%; font-weight: 600; border-color: transparent; }
.bq-edit select.color-sel:not([class*="dl-"]) { border-color: var(--border-strong); background: var(--surface); }
.bq-edit select.color-sel option { background: var(--surface); color: var(--text); font-weight: 400; }
.bq-edit-hint { flex: 1 1 260px; }

/* ---------- Palettes de couleurs du site (choisies par l'administrateur, attribut data-theme sur <html>) ---------- */
html[data-theme="violet"] { --primary: #6d4ae8; --primary-600: #5835cc; --primary-soft: #f0ebff; --sidebar: #1c1433; --series-1: #6d4ae8; }
html[data-theme="vert"] { --primary: #16875a; --primary-600: #0f6e49; --primary-soft: #e3f5ec; --sidebar: #0f2a20; --series-1: #16875a; }
html[data-theme="turquoise"] { --primary: #0c8595; --primary-600: #08697a; --primary-soft: #e0f4f6; --sidebar: #0c2a30; --series-1: #0c8595; }
html[data-theme="orange"] { --primary: #c75a12; --primary-600: #a8490b; --primary-soft: #fdefe4; --sidebar: #2d1a0e; --series-1: #c75a12; }
html[data-theme="rose"] { --primary: #d12f68; --primary-600: #b02254; --primary-soft: #fce8ef; --sidebar: #2d1320; --series-1: #d12f68; }
html[data-theme="rouge"] { --primary: #b83227; --primary-600: #98271e; --primary-soft: #fbe9e7; --sidebar: #2a1210; --series-1: #b83227; }
html[data-theme="graphite"] { --primary: #3d4a5c; --primary-600: #2c3746; --primary-soft: #eceff3; --sidebar: #111418; --series-1: #3d4a5c; }
html[data-theme="perso"] {
  --primary: var(--theme-color);
  --primary-600: color-mix(in srgb, var(--theme-color) 82%, #000);
  --primary-soft: color-mix(in srgb, var(--theme-color) 12%, #fff);
  --sidebar: color-mix(in srgb, var(--theme-color) 16%, #0d1117);
  --series-1: var(--theme-color);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="violet"] { --primary: #9b7dff; --primary-600: #b39cff; --primary-soft: #2a2046; --sidebar: #110c1f; --series-1: #9b7dff; }
  html[data-theme="vert"] { --primary: #3fc78a; --primary-600: #62d6a1; --primary-soft: #15342a; --sidebar: #08170f; --series-1: #3fc78a; }
  html[data-theme="turquoise"] { --primary: #3cc4d4; --primary-600: #62d3e0; --primary-soft: #133338; --sidebar: #071a1e; --series-1: #3cc4d4; }
  html[data-theme="orange"] { --primary: #f39a52; --primary-600: #f7b27a; --primary-soft: #3a2616; --sidebar: #1a0f07; --series-1: #f39a52; }
  html[data-theme="rose"] { --primary: #f06a98; --primary-600: #f48db0; --primary-soft: #3a1a28; --sidebar: #1a0a12; --series-1: #f06a98; }
  html[data-theme="rouge"] { --primary: #ee6a5c; --primary-600: #f28b80; --primary-soft: #3a1c1a; --sidebar: #180908; --series-1: #ee6a5c; }
  html[data-theme="graphite"] { --primary: #9fb0c6; --primary-600: #bccadc; --primary-soft: #252d38; --sidebar: #0a0c10; --series-1: #9fb0c6; }
  html[data-theme="perso"] {
    --primary: color-mix(in srgb, var(--theme-color) 78%, #fff);
    --primary-600: color-mix(in srgb, var(--theme-color) 62%, #fff);
    --primary-soft: color-mix(in srgb, var(--theme-color) 22%, #171e2d);
    --sidebar: color-mix(in srgb, var(--theme-color) 12%, #07090e);
  }
}

/* Sélecteur de palette */
.palette-btn { color: var(--text-2); }
.palette-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; }
.palette-pop h3 { margin: 0 0 10px; font-size: .9rem; }
.palette-wrap { position: relative; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent; background: transparent; border-radius: 10px; padding: 6px 4px; cursor: pointer; font: inherit; font-size: .75rem; color: var(--text-2); }
.swatch:hover { background: var(--surface-2); }
.swatch.active { border-color: var(--primary); color: var(--text); font-weight: 600; }
.swatch .dots { display: flex; border-radius: 999px; overflow: hidden; width: 40px; height: 22px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch .dots i { flex: 1; }
.swatch-custom { position: relative; }
.swatch-custom input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.palette-note { margin: 10px 0 0; }
.settings-palette { margin-bottom: 16px; }
.settings-palette .card-body { padding-top: 6px; }
@media (max-width: 520px) {
  .palette-pop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
}

/* =========================================================================
   Boutiques : annuaire (lecture)
   ========================================================================= */
.bq-bar {
  position: sticky; top: var(--topbar-h); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; padding: 16px 20px 10px;
}
.bq-bar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bq-search { position: relative; flex: 1 1 280px; max-width: 480px; }
.bq-search svg { position: absolute; left: 12px; top: 50%; bottom: auto; transform: translateY(-50%); }
.bq-search input { padding-left: 38px; min-height: 42px; background: var(--surface-2); }
.bq-search input:focus-visible { background: var(--surface); }
.bq-az { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bq-az::-webkit-scrollbar { display: none; }
.bq-az a, .bq-az span { flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; font-size: .82rem; font-weight: 620; }
.bq-az a { color: var(--text-2); }
.bq-az a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.bq-az span { color: var(--muted); opacity: .4; }

.bq-groups { padding: 4px 20px 8px; }
.bq-group { scroll-margin-top: calc(var(--topbar-h) + 118px); }
.bq-group-head { margin: 0; }
/* Colonnes indépendantes (comme un répertoire) : chaque boutique garde sa propre hauteur. */
.bq-items { list-style: none; margin: 0; padding: 0; columns: 280px; column-gap: 32px; }
.bq-item { padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); min-width: 0; break-inside: avoid; -webkit-column-break-inside: avoid; }
.bq-item-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bq-item-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.bq-item-top .delai { flex: none; }
.bq-item-note { margin: 4px 0 0; font-size: .89rem; color: var(--text-2); line-height: 1.45; }
.bq-item-priv { margin: 4px 0 0; font-size: .86rem; color: var(--commission); line-height: 1.45; }
.bq-item-priv svg { vertical-align: -2px; }

/* Classement alphabétique : la lettre en marge, comme dans un répertoire */
.by-letter .bq-group { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; }
.by-letter .bq-group-head { padding-top: 10px; font-size: 1.6rem; font-weight: 600; line-height: 1; color: var(--primary); letter-spacing: -.02em; }
/* Classement par rapidité : un intitulé par tranche de délai */
.by-speed .bq-group-head { padding: 18px 0 4px; font-size: 1rem; display: flex; align-items: baseline; gap: 8px; }
.bq-group-count { font-size: .85rem; font-weight: 500; }
.bq-empty p { margin: 0 auto 6px; max-width: 46ch; }
.bq-empty-title { color: var(--text); font-weight: 600; }
.bq-empty .btn { margin-top: 10px; }
.bq-foot { padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--border); }

/* =========================================================================
   Téléphone : cibles tactiles, pas de zoom automatique, feuilles en bas d'écran
   ========================================================================= */
@media (max-width: 720px) {
  :root { --topbar-h: 54px; }
  body { font-size: 15.5px; }
  h1 { font-size: 1.5rem; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }
  .page-head { margin-bottom: 18px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }

  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-foot .btn { flex: 1; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .toast { max-width: none; }

  .bq-bar { padding: 12px 14px 8px; }
  .bq-search { flex-basis: 100%; max-width: none; }
  .bq-groups { padding: 0 14px 4px; }
  .by-letter .bq-group { grid-template-columns: minmax(0, 1fr); }
  .by-letter .bq-group-head { padding: 16px 0 2px; font-size: 1.15rem; }
  .bq-group { scroll-margin-top: calc(var(--topbar-h) + 150px); }
  .bq-item { padding: 13px 0; }
  .bq-foot { padding: 12px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Boutiques : catégories, tri, Hot ---------- */
.bq-sort { position: relative; flex: none; display: flex; align-items: center; }
.bq-sort svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.bq-sort select { padding-left: 34px; min-height: 42px; width: auto; font-weight: 560; background-color: var(--surface-2); }
.bq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bq-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  min-height: 36px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.bq-chip:hover { border-color: var(--border-strong); color: var(--text); }
.bq-chip svg { opacity: .85; }
.bq-chip-n { font-size: .8rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.bq-chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.bq-chip.active .bq-chip-n { color: inherit; opacity: .8; }
.bq-chip.is-hot svg { color: #e8590c; opacity: 1; }
.bq-chip.is-hot.active { background: #fff1e6; border-color: #e8590c; color: #c2410c; }
.bq-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .bq-chip.is-hot.active { background: #3a2214; color: #ff9b57; border-color: #ff9b57; } }

.bq-hint { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 20px 0; font-size: .88rem; color: var(--text-2); }
.bq-hint svg { color: var(--primary); width: 15px; height: 15px; flex: none; }
.bq-item-name { display: inline-flex; align-items: center; gap: 6px; }
.bq-hot { display: inline-flex; color: #e8590c; }
.bq-hot svg { width: 15px; height: 15px; }
.bq-item-cat { margin: 3px 0 0; display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); }
.bq-item-cat svg { width: 13px; height: 13px; }
.bq-item-link { display: block; color: inherit; margin: -12px -10px; padding: 12px 10px; border-radius: 10px; }
.bq-item-link:hover { background: var(--surface-2); text-decoration: none; }
.bq-item-link:hover .bq-item-name { color: var(--primary); }
.bq-go { display: inline-flex; color: var(--muted); margin-left: -6px; }
.bq-go svg { width: 16px; height: 16px; }
.bq-item-top { gap: 10px; }
.bq-item-top .bq-item-name { flex: 1; }
.bq-empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Édition : catégorie + flamme Hot */
.bq-cat-cell { display: flex; gap: 6px; align-items: center; }
.bq-cat-cell select { flex: 1; }
.hot-toggle { position: relative; flex: none; display: inline-grid; cursor: pointer; }
.hot-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.hot-toggle > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.hot-toggle input:checked + span { color: #fff; background: #e8590c; border-color: #e8590c; }
.hot-toggle input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.bq-fcat select { width: auto; min-height: 40px; }

@media (max-width: 720px) {
  .bq-bar-row { flex-wrap: nowrap; }
  .bq-search { flex: 1 1 auto; min-width: 0; }
  .bq-sort select { width: 46px; padding: 0; color: transparent; background-color: var(--surface-2); }
  .bq-sort select option { color: var(--text); }
  .bq-sort svg { left: 50%; transform: translateX(-50%); color: var(--text-2); }
  .bq-chips { flex-wrap: nowrap; overflow-x: auto; margin: 10px -14px 0; padding: 0 14px 2px; scrollbar-width: none; scroll-padding: 0 14px; }
  .bq-chips::-webkit-scrollbar { display: none; }
  .bq-hint { padding: 10px 40px 0 14px; }
  /* Lettres : rail vertical sur le bord droit, comme le répertoire du téléphone */
  .bq-az {
    position: fixed; z-index: 25; right: 18px; top: calc(var(--topbar-h) + 128px); bottom: 12px;
    display: flex; flex-direction: column; justify-content: space-evenly; gap: 0; margin: 0; padding: 4px 0; overflow: visible;
  }
  .bq-az a, .bq-az span { min-width: 22px; height: auto; flex: 1 1 0; max-height: 24px; font-size: .68rem; border-radius: 6px; }
  .bq-az span { opacity: .3; }
  .bq-groups.has-az { padding-right: 36px; }
}

.is-flat .bq-group { display: block; }
.is-flat .bq-items { padding-top: 4px; }

/* =========================================================================
   Captures d'écran
   ========================================================================= */
.cap-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cap { position: relative; min-width: 0; }
.cap-open { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.cap-open img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cap-open:hover { border-color: var(--primary); }
.cap-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cap-ph { display: grid; place-items: center; height: 100%; color: var(--muted); }
.cap-ph.cap-err { color: var(--danger); }
.cap-meta { display: flex; flex-direction: column; margin-top: 6px; font-size: .8rem; line-height: 1.35; min-width: 0; }
.cap-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-del { position: absolute; top: 6px; right: 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); }
.cap-del:hover { background: var(--danger-soft); color: var(--danger); }
.cap-count { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.cap-count svg { width: 15px; height: 15px; }
.card-head h2 svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; color: var(--muted); }
.cap-up { margin: 10px 0 0; }
.cap-up:empty { display: none; }

/* Zone d'ajout dans le formulaire de demande */
.cap-drop { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: .92rem; }
.cap-picker.drag .cap-drop { border-color: var(--primary); background: var(--primary-soft); }
.cap-drop > div { flex: 1; min-width: 0; }
.cap-drop b { color: var(--text); font-weight: 600; }
.cap-drop-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--primary); }
.cap-pick-btn { flex: none; }
.cap-pick-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cap-pick-list:empty { display: none; }
.cap-pick-list li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; min-width: 0; }
.cap-pick-list img { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 6px; flex: none; background: var(--surface-2); }
.cap-pick-list .cap-name { flex: 1; min-width: 0; font-weight: 560; }
.cap-pick-status:empty { display: none; }

/* Visionneuse */
.viewer { position: fixed; inset: 0; z-index: 150; background: rgba(8, 10, 16, .97); display: flex; flex-direction: column; animation: fade .12s ease-out; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff; background: #08090d; }
.viewer-bar .icon-btn { color: #fff; }
.viewer-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.viewer-name .muted { color: rgba(255, 255, 255, .6); font-weight: 500; margin-left: 6px; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px 16px; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.viewer-nav { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.viewer-nav:hover { background: rgba(255, 255, 255, .22); }
.viewer-nav.prev svg { transform: rotate(180deg); }

@media (max-width: 720px) {
  .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cap-drop { flex-wrap: wrap; }
  .cap-drop-icon { display: none; }
  .cap-pick-btn { width: 100%; }
  .viewer-stage { padding: 0 4px 12px; gap: 4px; }
  .viewer-nav { width: 36px; height: 36px; position: absolute; bottom: 20px; }
  .viewer-nav.prev { left: calc(50% - 46px); }
  .viewer-nav.next { right: calc(50% - 46px); }
}

/* =========================================================================
   Boutiques à la une (Hot)
   ========================================================================= */
.bq-featured { padding: 18px 0 22px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.bq-featured.is-full { border-bottom: 0; }
.bq-feat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.bq-feat-head h3 { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
.bq-feat-sub { color: var(--muted); font-size: .88rem; }
.bq-feat-all { margin-left: auto; font-size: .9rem; }
.bq-feat-flame { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff;
  background: linear-gradient(160deg, #ffb02e, #ff6a1a 55%, #d9230f); box-shadow: 0 4px 14px -4px rgba(255, 106, 26, .7); }
.bq-feat-flame svg { width: 17px; height: 17px; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }

.bq-feat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bq-feat-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 176px; padding: 16px 16px 14px;
  border-radius: 16px; color: #fff; text-decoration: none;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 128, 40, .55), transparent 55%),
    radial-gradient(90% 80% at 0% 110%, rgba(220, 38, 38, .38), transparent 60%),
    linear-gradient(160deg, #2b1309, #140b08 72%);
  border: 1px solid rgba(255, 150, 70, .35);
  box-shadow: 0 14px 30px -16px rgba(232, 89, 12, .75), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.bq-feat-card:hover { transform: translateY(-2px); text-decoration: none; border-color: rgba(255, 170, 90, .7);
  box-shadow: 0 18px 36px -14px rgba(255, 106, 26, .85), inset 0 1px 0 rgba(255, 255, 255, .1); }
a.bq-feat-card:focus-visible { outline: 3px solid #ffb02e; outline-offset: 3px; }
.bq-feat-bg { position: absolute; z-index: -1; right: -22px; bottom: -26px; color: #ff7a1a; opacity: .16; transform: rotate(-12deg); }
.bq-feat-bg svg { width: 132px; height: 132px; stroke-width: 1.4; }
.bq-feat-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; margin-bottom: 6px;
  border-radius: 999px; font-size: .75rem; font-weight: 700; color: #2b1100; background: linear-gradient(90deg, #ffc247, #ff8a2a); }
.bq-feat-badge svg { width: 13px; height: 13px; stroke-width: 2.4; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.bq-feat-name { font-size: 1.25rem; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; overflow-wrap: anywhere; }
.bq-feat-cat { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: rgba(255, 255, 255, .62); }
.bq-feat-cat svg { width: 13px; height: 13px; }
.bq-feat-note { margin-top: 6px; font-size: .86rem; line-height: 1.4; color: rgba(255, 255, 255, .85);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bq-feat-priv { margin-top: 4px; font-size: .82rem; color: #d8b8ff; }
.bq-feat-priv svg { vertical-align: -2px; }
.bq-feat-foot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 10px; }
.bq-feat-delai { display: flex; flex-direction: column; line-height: 1.2; }
.bq-feat-delai span { font-size: .72rem; color: rgba(255, 255, 255, .55); }
.bq-feat-delai b { font-size: 1.05rem; font-weight: 650; white-space: nowrap; }
.bq-feat-delai b::first-letter { text-transform: uppercase; }
.bq-feat-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: .82rem; font-weight: 650; color: #ffb27a; white-space: nowrap; }
.bq-feat-cta svg { width: 15px; height: 15px; }
.bq-groups.is-feat { padding-top: 0; }

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  30% { transform: scale(1.08, 1.12) rotate(2deg); }
  60% { transform: scale(.96, 1.04) rotate(-1deg); }
}

@media (max-width: 720px) {
  .bq-featured { padding: 14px 0 18px; }
  .bq-featured:not(.is-full) .bq-feat-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 14px; gap: 12px; margin: 0 0 0 -14px; padding: 2px 0 10px 14px; scrollbar-width: none; }
  .bq-featured:not(.is-full) .bq-feat-list::-webkit-scrollbar { display: none; }
  .bq-featured:not(.is-full) .bq-feat-list li { flex: 0 0 84%; scroll-snap-align: start; }
  .bq-featured.is-full .bq-feat-list { grid-template-columns: 1fr; }
  .bq-feat-card { min-height: 164px; }
}

/* =========================================================================
   Messagerie d'un dossier
   ========================================================================= */
.chat { display: flex; flex-direction: column; }
.chat-scroll { max-height: 440px; min-height: 160px; overflow-y: auto; padding: 14px 20px 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 40ch; padding: 18px 0; }
.chat-empty svg { width: 26px; height: 26px; color: var(--primary); opacity: .7; }
.chat-empty p { margin: 6px 0 0; font-size: .92rem; }
.chat-day { display: flex; justify-content: center; margin: 12px 0 6px; }
.chat-day span { font-size: .76rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }
.chat-day span::first-letter { text-transform: uppercase; }
.chat-msg { display: flex; flex-direction: column; max-width: min(78%, 560px); margin-top: 8px; }
.chat-msg.grouped { margin-top: 2px; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-author { font-size: .78rem; font-weight: 600; color: var(--text-2); margin: 0 10px 3px; }
.chat-bubble { padding: 9px 13px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.chat-msg.mine .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg.mine.grouped .chat-bubble { border-top-right-radius: 5px; }
.chat-msg.theirs .chat-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 5px; }
.chat-msg.theirs.grouped .chat-bubble { border-top-left-radius: 5px; }
.chat-msg.from-client .chat-bubble { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.chat-msg.mine .chat-bubble a { color: #fff; text-decoration: underline; }
.chat-time { font-size: .72rem; color: var(--muted); margin: 3px 10px 0; font-variant-numeric: tabular-nums; }
.chat-compose { position: relative; display: flex; align-items: flex-end; gap: 6px; padding: 12px 14px 4px 12px; border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; min-height: 42px; max-height: 180px; resize: none; border-radius: 21px; padding: 10px 16px; line-height: 1.4; background: var(--surface-2); }
.chat-compose textarea:focus-visible { background: var(--surface); }
.chat-send { border-radius: 21px; min-height: 42px; padding: 0 16px; }
.chat-send svg { width: 16px; height: 16px; }
.chat-hint { margin: 0; padding: 4px 20px 12px; }
.chat-nowrite { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.chat-card .card-head h2 svg { color: var(--primary); }

.nav-count-msg { background: var(--primary); color: #fff; }
.nav-count.static-count { margin-left: 0; flex: none; }
.badge-msg { background: var(--primary); color: #fff; font-size: .72rem; padding: 1px 7px; }
.badge-msg::before { display: none; }
.cc-unread { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: .84rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.cc-unread svg { width: 15px; height: 15px; }

/* Boîte de réception (équipe) */
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li + li { border-top: 1px solid var(--border); }
.inbox-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--text); }
.inbox-row:hover { background: var(--surface-2); text-decoration: none; }
.inbox-row .avatar { width: 38px; height: 38px; font-size: .85rem; }
.inbox-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.inbox-name { font-weight: 600; flex: none; }
.inbox-ref { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-when { flex: none; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.inbox-last { color: var(--text-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row.is-unread .inbox-name, .inbox-row.is-unread .inbox-last { color: var(--text); font-weight: 650; }
.inbox-row.is-unread .inbox-when { color: var(--primary); font-weight: 600; }

@media (max-width: 720px) {
  .chat-scroll { max-height: 60vh; padding: 12px 14px 6px; }
  .chat-msg { max-width: 86%; }
  .chat-compose { padding: 10px 12px 12px; }
  .chat-compose textarea { font-size: 16px; }
  .chat-send span { display: none; }
  .chat-send { width: 44px; padding: 0; }
  .inbox-row { padding: 12px 14px; gap: 12px; }
  .inbox-top { flex-wrap: wrap; }
  .inbox-ref { order: 3; flex-basis: 100%; }
}

/* ---------- Messagerie : pièces jointes, auteur, statut, saisie, réponses rapides ---------- */
.chat-tools { display: flex; align-items: center; gap: 2px; padding-bottom: 1px; }
.chat-tools .icon-btn { width: 40px; height: 40px; justify-content: center; align-items: center; border-radius: 50%; color: var(--text-2); cursor: pointer; }
.chat-tools .icon-btn:hover { color: var(--primary); background: var(--primary-soft); }
.chat-tools .icon-btn[aria-expanded="true"] { color: var(--primary); background: var(--primary-soft); }
.chat-quick { position: absolute; left: 12px; right: 14px; bottom: calc(100% + 6px); z-index: 5; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.chat-quick button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .9rem;
  padding: 9px 12px; border-radius: 9px; cursor: pointer; line-height: 1.4; }
.chat-quick button:hover, .chat-quick button:focus-visible { background: var(--primary-soft); outline: none; }
.chat-pending { list-style: none; margin: 0; padding: 0 14px 6px 60px; display: flex; flex-wrap: wrap; gap: 8px; }
.chat-pending li { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 4px 4px 4px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .85rem; min-width: 0; }
.chat-pending img, .chat-pend-ic { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex: none; }
.chat-pend-ic { display: grid; place-items: center; color: var(--danger); background: var(--surface); }
.chat-pend-ic svg { width: 18px; height: 18px; }
.chat-pending .cap-name { flex: 1; min-width: 0; }
.chat.drag .chat-scroll { outline: 2px dashed var(--primary); outline-offset: -6px; background: var(--primary-soft); }

.chat-author { display: inline-flex; align-items: center; gap: 6px; }
.chat-team { font-size: .68rem; font-weight: 650; color: var(--primary); background: var(--primary-soft); padding: 1px 6px; border-radius: 999px; }
.chat-status { font-weight: 600; }
.chat-status.is-seen { color: var(--primary); }
.chat-img { display: block; padding: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; max-width: min(280px, 100%); }
.chat-img img { display: block; max-width: 100%; max-height: 260px; object-fit: cover; }
.chat-img .cap-ph { width: 200px; height: 140px; }
.chat-msg.mine .chat-img { border-bottom-right-radius: 5px; }
.chat-msg.theirs .chat-img { border-bottom-left-radius: 5px; }
.chat-img:focus-visible, .chat-file:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chat-file { display: flex; align-items: center; gap: 10px; max-width: 320px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chat-file:hover { border-color: var(--primary); }
.chat-file svg { flex: none; color: var(--danger); width: 26px; height: 26px; }
.chat-file-txt { display: flex; flex-direction: column; min-width: 0; }
.chat-file-txt b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-txt span { font-size: .78rem; color: var(--muted); }
.chat-msg.mine .chat-file { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }

.chat-typing { display: flex; align-items: center; gap: 8px; padding: 0 20px 8px; font-size: .82rem; color: var(--muted); }
.chat-typing .dots { display: inline-flex; gap: 3px; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.chat-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.chat-typing .dots i:nth-child(2) { animation-delay: .15s; }
.chat-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }

.toast.msg { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary); }

@media (max-width: 720px) {
  .chat-compose { padding: 10px 10px 12px 6px; gap: 2px; }
  .chat-tools .icon-btn { width: 38px; height: 38px; }
  .chat-pending { padding: 0 12px 8px; }
  .chat-quick { left: 6px; right: 6px; }
  .chat-typing { padding: 0 14px 6px; }
}

/* =========================================================================
   Téléphone : zones à toucher assez grandes (≈ 40 px)
   ========================================================================= */
.bq-az-pop { position: fixed; z-index: 60; left: 50%; top: 45%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 22px;
  display: grid; place-items: center; font-size: 2.4rem; font-weight: 650; color: #fff; background: color-mix(in srgb, var(--primary) 88%, transparent);
  box-shadow: var(--shadow-lg); pointer-events: none; }
@media (max-width: 720px) {
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; flex: none; margin-top: 1px; }
  .check { gap: 10px; padding: 6px 0; min-height: 36px; align-items: center; }
  .card-head > a, .card-head .small > a, .bq-feat-all, .link-btn { display: inline-flex; align-items: center; min-height: 40px; }
  .table.responsive td a { display: inline-flex; align-items: center; min-height: 36px; }
  .timeline .head a, .timeline a.mono { display: inline-flex; align-items: center; min-height: 34px; }
  .tag { padding: 6px 10px; font-size: .82rem; }
  .tags { gap: 6px; }
  .bq-az { touch-action: none; min-width: 28px; }
  .bq-az a, .bq-az span { min-width: 28px; }
  .segmented button { min-height: 36px; }
  .breadcrumb a { display: inline-block; padding: 6px 0; }
  .cc-head > a { display: inline-flex; align-items: center; min-height: 36px; }
  .pager .btn { min-width: 40px; }
}

/* =========================================================================
   Fiche boutique (détails)
   ========================================================================= */
.cat-high-tech { --cat: #2f6fe0; } .cat-automobile { --cat: #52606d; } .cat-mode { --cat: #7c4ddb; } .cat-beaute { --cat: #d6407e; }
.cat-bijoux { --cat: #c08a12; } .cat-maison { --cat: #1f8f5f; } .cat-marketplace { --cat: #e0661b; } .cat-autre { --cat: #64748b; }
body.no-scroll { overflow: hidden; }

/* Logos (liste, cartes Hot, fiche) */
.bq-logo { flex: none; display: inline-grid; place-items: center; overflow: hidden; background: #fff; }
.bq-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bq-mono { color: #fff; font-weight: 700; letter-spacing: .02em; background: linear-gradient(140deg, var(--cat, #64748b), color-mix(in srgb, var(--cat, #64748b) 55%, #000)); }
.bq-item-logo { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); font-size: .7rem; }
.bq-item-logo.bq-mono { border: 0; }
.bq-item-link { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; margin: -12px -10px; padding: 12px 10px; width: calc(100% + 20px); border-radius: 10px; }
.bq-item-link:hover { background: var(--surface-2); }
.bq-item-link:hover .bq-item-name { color: var(--primary); }
.bq-item-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.bq-item-top { gap: 10px; }
button.bq-feat-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.bq-feat-card:hover { transform: translateY(-2px); border-color: rgba(255, 170, 90, .7); box-shadow: 0 18px 36px -14px rgba(255, 106, 26, .85), inset 0 1px 0 rgba(255, 255, 255, .1); }
button.bq-feat-card:focus-visible { outline: 3px solid #ffb02e; outline-offset: 3px; }
.bq-feat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bq-feat-logo { width: 42px; height: 42px; border-radius: 11px; padding: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }

/* Fenêtre */
.bqd-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 10, 16, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .16s ease-out; }
.bqd-backdrop.closing { animation: fadeout .16s ease-in forwards; }
@keyframes fadeout { to { opacity: 0; } }
.bqd {
  position: relative; width: min(900px, 100%); max-height: min(660px, calc(100vh - 40px)); max-height: min(660px, calc(100dvh - 40px));
  display: grid; grid-template-columns: 40% minmax(0, 1fr); overflow: hidden; outline: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
  animation: bqdIn .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes bqdIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.bqd-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; justify-content: center; align-items: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.bqd-close:hover { background: var(--surface-2); }

.bqd-visual { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; min-height: 100%;
  background: radial-gradient(120% 80% at 30% 20%, color-mix(in srgb, var(--cat) 16%, #fff), #fff 70%); }
.bqd-hot { position: absolute; top: 18px; left: 18px; }
.bqd-logo { width: 52%; max-width: 200px; aspect-ratio: 1; border-radius: 22px; }
.bqd-logo img { padding: 6%; }
.bqd-logo.bq-mono { font-size: clamp(2.2rem, 5vw, 3.4rem); border-radius: 30px; box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--cat) 80%, #000); }
.bqd-logo:not(.bq-mono) { box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .25); }
.bqd-logo-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.bqd-logo-tools .btn { cursor: pointer; }
.bqd-logo-hint { margin: 10px 0 0; font-size: .78rem; color: #6b7280; text-align: center; max-width: 24ch; }

.bqd-body { display: flex; flex-direction: column; padding: 34px 32px 26px; overflow-y: auto; min-height: 0; }
.bqd-cat { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: .84rem; font-weight: 650; color: var(--cat); background: color-mix(in srgb, var(--cat) 13%, transparent); }
.bqd-cat svg { width: 15px; height: 15px; }
@media (prefers-color-scheme: dark) { .bqd-cat { color: color-mix(in srgb, var(--cat) 60%, #fff); } }
.bqd-name { margin: 12px 48px 6px 0; font-size: 2rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; overflow-wrap: anywhere; }
.bqd-name.sm { font-size: 1.35rem; margin-top: 0; }
.bqd-desc { margin: 0 0 18px; color: var(--text-2); line-height: 1.5; }
.bqd-stats { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.bqd-stat { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.bqd-stat span { font-size: .78rem; color: var(--muted); font-weight: 560; }
.bqd-stat b { font-size: 1.18rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bqd-stat b::first-letter { text-transform: uppercase; }
.bqd-stat.is-money b { color: var(--success); }
.bqd-stat.is-delai[class*="dl-"] { border-color: transparent; }
.bqd-stat.is-delai[class*="dl-"] span { color: inherit; opacity: .8; }
.bqd-h { margin: 22px 0 8px; font-size: .95rem; font-weight: 650; }
.bqd-conds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bqd-conds li { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; line-height: 1.4; }
.bqd-conds svg { flex: none; color: var(--success); margin-top: 0; }
.bqd-note, .bqd-priv { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 11px 14px; border-radius: 12px; font-size: .92rem; line-height: 1.45; }
.bqd-note { background: var(--info-soft); color: var(--text); }
.bqd-note svg { flex: none; color: var(--info); margin-top: 1px; }
.bqd-priv { background: color-mix(in srgb, var(--commission) 10%, transparent); color: var(--commission); }
.bqd-priv svg { flex: none; margin-top: 2px; }
.bqd-empty { margin: 18px 0 0; }
.bqd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 22px; }
.bqd-actions .btn { min-height: 46px; }
.bqd-cta { flex: 1 1 100%; font-size: 1rem; min-height: 52px !important; border-radius: 14px; }
.bqd-cta svg { width: 18px; height: 18px; }

/* Formulaire de la fiche */
.bqd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 12px; }
.bqd-grid .full { grid-column: 1 / -1; }
.bqd-hot-toggle { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 560; color: var(--text); cursor: pointer; }
.bqd-hot-toggle svg { color: #e8590c; width: 17px; height: 17px; }
.bqd-form .form-error { margin-top: 12px; }
.bqd-form input.priv { border-style: dashed; }

@media (max-width: 720px) {
  .bqd-backdrop { place-items: end center; padding: 0; }
  .bqd { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); width: 100%; border-radius: 22px 22px 0 0; border-bottom: 0;
    max-height: 94vh; max-height: 94dvh; animation: bqdUp .24s cubic-bezier(.2, .8, .2, 1); }
  @keyframes bqdUp { from { transform: translateY(40px); opacity: .4; } }
  .bqd-visual { min-height: 0; height: 148px; padding: 16px; }
  .bqd-logo { width: 96px; border-radius: 20px; }
  .bqd-logo.bq-mono { font-size: 2rem; border-radius: 24px; }
  .bqd-logo-tools { margin-top: 10px; }
  .bqd-logo-hint { display: none; }
  .bqd-visual:has(.bqd-logo-tools) { height: auto; }
  .bqd-body { padding: 20px 18px 0; }
  .bqd-name { font-size: 1.6rem; margin-right: 0; }
  .bqd-stats { gap: 8px; }
  .bqd-stat { padding: 10px 11px; }
  .bqd-stat b { font-size: 1.02rem; }
  .bqd-actions { position: sticky; bottom: 0; margin: auto -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
  .bqd-actions .btn { flex: 1; }
  .bqd-grid { grid-template-columns: minmax(0, 1fr); }
  .bqd-close { top: 10px; right: 10px; }
}
/* Formulaire de la fiche : boutons toujours visibles en bas */
.bqd-form { padding-bottom: 0; }
.bqd-form .bqd-actions { position: sticky; bottom: 0; z-index: 2; margin-top: 16px; padding: 14px 0 20px; background: var(--surface); border-top: 1px solid var(--border); justify-content: flex-end; }
@media (max-width: 720px) { .bqd-form .bqd-actions { margin: 16px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); } }
/* La colonne de droite défile dans la fenêtre (au lieu d'être coupée) */
.bqd-body { max-height: min(660px, calc(100vh - 40px)); max-height: min(660px, calc(100dvh - 40px)); }
@media (max-width: 720px) { .bqd-body { max-height: none; } }

/* =========================================================================
   Accueil client : tuiles de chiffres clés (+ mêmes tuiles teintées sur le tableau de bord)
   ========================================================================= */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile, .kpi[class*="k-"] {
  --t: var(--kpi-accent, var(--primary));
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 18px; border-radius: 18px; color: var(--text); text-decoration: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--t) 11%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--t) 30%, var(--border));
  box-shadow: none;
}
.tile::after, .kpi[class*="k-"]::after { content: ""; position: absolute; z-index: -1; right: -34px; top: -34px; width: 110px; height: 110px; border-radius: 50%;
  background: color-mix(in srgb, var(--t) 10%, transparent); }
.kpi[class*="k-"]::before { display: none; }
a.tile:hover, a.kpi[class*="k-"]:hover { border-color: color-mix(in srgb, var(--t) 55%, var(--border)); text-decoration: none; }
.tile-ic, .kpi-ic { color: var(--t); display: inline-flex; }
.tile-val { font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--t); font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile-lbl { font-size: .74rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi[class*="k-"] .value { color: var(--t); order: 0; }
.kpi[class*="k-"] .label { order: 1; }
.kpi[class*="k-"] .sub { order: 2; }
.kpi[class*="k-"] .kpi-ic { order: -1; }
.t-blue { --t: #3b82f6; } .t-amber { --t: #f59e0b; } .t-green { --t: #16a34a; } .t-gold { --t: #d4a017; }
@media (prefers-color-scheme: dark) {
  .t-blue { --t: #60a5fa; } .t-amber { --t: #fbbf24; } .t-green { --t: #34d399; } .t-gold { --t: #facc15; }
}
.home-sec { margin-top: 28px; }
.sec-title { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 1.15rem; font-weight: 650; }
.sec-title svg { color: var(--primary); }
.home-sec .client-grid { margin-top: 0; }

/* =========================================================================
   Annonces (« Actualités »)
   ========================================================================= */
.ann-list { display: flex; flex-direction: column; gap: 14px; }
.ann {
  --a: var(--primary);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 22px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--a);
}
.ann.has-img { grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); }
.ann-info { --a: #3b82f6; } .ann-nouveaute { --a: #8b5cf6; } .ann-promo { --a: #e8590c; } .ann-important { --a: #dc2626; }
@media (prefers-color-scheme: dark) { .ann-info { --a: #60a5fa; } .ann-nouveaute { --a: #a78bfa; } .ann-promo { --a: #fb923c; } .ann-important { --a: #f87171; } }
.ann-main { display: flex; flex-direction: column; min-width: 0; }
.ann-head { display: flex; align-items: center; gap: 12px; }
.ann-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--a) 85%, #fff), var(--a)); box-shadow: 0 6px 16px -8px var(--a); }
.ann-title { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; min-width: 0; }
.ann-new { flex: none; display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; color: #fff; background: var(--primary); }
.ann-body { margin-top: 12px; white-space: pre-line; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; max-height: 15.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.ann.open .ann-body { max-height: none; -webkit-mask-image: none; mask-image: none; }
.ann-body b { font-weight: 700; }
.ann-more { align-self: flex-start; margin-top: 6px; }
.ann-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 14px; font-size: .82rem; }
.ann-tag { font-weight: 650; color: var(--a); }
.ann-pin { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 600; }
.ann-admin { margin-left: auto; }
.ann-img { border-radius: 14px; overflow: hidden; background: var(--surface-2); align-self: start; }
.ann-img img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.empty > svg { width: 30px; height: 30px; color: var(--primary); }

/* Éditeur d'annonce */
.modal.modal-wide { max-width: 980px; }
.ann-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.ann-form { display: flex; flex-direction: column; gap: 14px; }
.ann-types { display: flex; flex-wrap: wrap; gap: 8px; }
.ann-type { position: relative; cursor: pointer; }
.ann-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ann-type > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-weight: 600; font-size: .88rem; color: var(--text-2); }
.ann-type > span svg { width: 16px; height: 16px; color: var(--a); }
.ann-type input:checked + span { border-color: var(--a); background: color-mix(in srgb, var(--a) 12%, transparent); color: var(--text); }
.ann-type input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.ann-img-pick { display: flex; gap: 8px; align-items: center; }
.ann-img-pick .btn { cursor: pointer; }
.ann-del { align-self: flex-start; margin-top: 6px; }
.ann-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ann-preview .ann { box-shadow: var(--shadow); }
.ann-preview .ann.has-img { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ann-editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .tile { padding: 16px; border-radius: 16px; }
  .tile-val { font-size: 1.7rem; }
  .ann, .ann.has-img { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
  .ann-img { order: -1; }
  .ann-img img { max-height: 200px; }
  .ann-admin { margin-left: 0; width: 100%; }
  .ann-admin .btn { width: 100%; }
}
/* Espacement des mots dans les titres en gras (la police est serrée en graisse forte) */
h3, .ann-title, .bq-feat-name, .bqd-name, .cc-title, .tile-val { word-spacing: .06em; }
.ann-title { letter-spacing: 0; }
.tile-val { letter-spacing: -.02em; }

/* ---------- Actualités : bouton d'action et carrousel ---------- */
.ann-btn { align-self: flex-start; margin-top: 14px; min-height: 42px; padding: 8px 18px; border: 0; border-radius: 12px; font-weight: 700;
  background: var(--a); color: #fff; box-shadow: 0 8px 20px -10px var(--a); }
.ann-btn:hover { background: color-mix(in srgb, var(--a) 85%, #000); color: #fff; text-decoration: none; }
.ann-btn svg { width: 16px; height: 16px; }
.ann-btn-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; }
.ann-btn-presets { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); align-items: center; }
.ann-btn-presets .link-btn { font-size: .82rem; min-height: 0; }

.ann-carousel { position: relative; }
.ann-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  align-items: flex-start; transition: height .25s ease; border-radius: 18px; }
.ann-track::-webkit-scrollbar { display: none; }
.ann-track:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ann-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.ann-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.ann-arrow { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.ann-arrow:hover { color: var(--primary); border-color: var(--primary); }
.ann-arrow[data-prev] svg { transform: rotate(180deg); }
.ann-arrow:focus-visible, .ann-dots button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ann-dots { display: flex; align-items: center; gap: 4px; }
.ann-dots button { width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.ann-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); transition: width .2s ease, background .2s ease; }
.ann-dots button.is-new::before { background: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.ann-dots button.active::before { width: 22px; background: var(--primary); }
@media (max-width: 720px) {
  .ann-btn { width: 100%; justify-content: center; }
  .ann-btn-fields { grid-template-columns: minmax(0, 1fr); }
}
