:root {
    --ink: #141414;
    --muted: #5c6370;
    --paper: #f1f3f7;
    --card: #ffffff;
    --line: #e8e9ed;
    --line-strong: #d1d4dc;
    --red: #e1191d;
    --red-dark: #c41218;
    --red-soft: #fce8e8;
    --grey-800: #424245;
    --grey-500: #8c92a6;
    --shadow: 0 12px 32px #14141426;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

h1, h2, .brand-name, .domain-title, .kpi strong {
    font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}
h1 { font-size: 34px; margin: 0 0 18px; }
h2 { font-size: 22px; margin: 0 0 12px; }

.topbar {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px #1414141a;
}
.topbar-inner, main, .foot-inner {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
}
.topbar-inner {
    width: calc(100% - 48px);
    max-width: none;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
main { flex: 1 0 auto; padding: 28px 0 48px; }

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ink);
    font-size: 15px;
}
.brand:hover .brand-name { color: var(--red); }
.logo {
    height: 32px;
    width: auto;
    display: block;
}
.brand-name { color: var(--ink); font-size: 18px; }
.brand-text { color: var(--grey-500); }
.topbar-end { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    color: var(--red);
    background: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    border-radius: 4px;
    height: 36px;
    min-width: 130px;
    padding: 2px 8px;
    box-shadow: inset 0 0 0 2px var(--red);
}
.topnav a:hover,
.topnav a.on,
.topnav a.on:hover {
    background: var(--red);
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--red);
}
.nav-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
}
.topnav a:hover .nav-count,
.topnav a.on .nav-count { background: #fff; color: var(--red); }
.who { color: var(--grey-500); font-size: 14px; }

.btn, button.btn, .compose summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover, .compose summary:hover { background: var(--red-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn.ghost:hover { background: var(--red); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.btn.download { width: 100%; margin-top: 18px; }
button.linkish {
    background: none;
    border: 0;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
button.linkish:hover { color: var(--red); }
form.inline { display: inline; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--red);
    border-color: var(--red);
}
select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23141414' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 4.5 6 8.5 10 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}
select::-ms-expand { display: none; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}
.password-toggle:hover { color: var(--ink); }
.password-toggle svg { width: 22px; height: 22px; display: block; }
.password-toggle .eye-shut { display: none; }
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-shut { display: block; }
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 10px 0; }
label input, label textarea, label select { margin-top: 6px; font-weight: 400; }

.banner { padding: 12px 14px; border-radius: 4px; margin: 0 0 16px; }
.banner.error { background: var(--red-soft); color: #8d1216; }
.banner.ok { background: #e8f6d8; color: #3d6b12; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 13px; }
.pad { padding: 12px; }

.auth-wrap {
    min-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}
.auth-card {
    width: min(440px, 100%);
    background: var(--card);
    border-radius: 8px;
    padding: 32px 28px 24px;
    box-shadow: var(--shadow);
}
.auth-card h1 { text-align: left; font-size: 32px; margin-bottom: 8px; }
.auth-card .btn { width: 100%; margin-top: 18px; }
.auth-card .btn.as-nav {
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    color: var(--red);
    box-shadow: inset 0 0 0 2px var(--red);
}
.auth-card .btn.as-nav:hover {
    background: var(--red);
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--red);
}
.forgot { display: block; text-align: left; margin-top: 14px; font-weight: 600; }
.forgot:hover { color: var(--red); }
.signup-link {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.signup-link:hover { color: var(--red); }
.auth-note { color: var(--muted); margin: 28px 0 0; text-align: center; }
.demo-hint {
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    max-width: 460px;
}

body.page-connexion {
    background: #e10600 url("../img/connexion-bg.png") center / cover no-repeat;
    background-attachment: fixed;
}
body.page-connexion {
    --sheet-top: 148px;
    --banner-top: 20px;
}
body.page-connexion main {
    position: relative;
    padding-top: calc(var(--sheet-top) - 72px);
}
body.page-connexion .banner {
    position: absolute;
    top: var(--banner-top);
    left: 0;
    right: 0;
    margin: 0;
    min-height: 46px;
}
body.page-connexion .auth-wrap {
    justify-content: flex-start;
    min-height: 0;
    padding-top: 0;
}
body.page-connexion .modal {
    padding-top: var(--sheet-top);
}
body.page-connexion .auth-card { box-shadow: 0 16px 40px #14141466; }
body.page-connexion .auth-note,
body.page-connexion .demo-hint { color: #fff; }

.search-block {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}
.panel, .deposit, .domain-card, .doc-row, .meta-card, .kpi, .conv-list, .thread {
    background: var(--card);
}
.search-row { display: flex; gap: 10px; align-items: stretch; }
.search-row input { flex: 1; min-width: 0; background: #fff; }
.search-row .btn { flex: 0 0 auto; white-space: nowrap; }
.filters, .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.account-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.account-filters input { flex: 1; min-width: 180px; width: auto; }
.account-filters .btn { margin-left: auto; }
.account-filters a.btn.ghost { margin-left: 0; }
.doc-side.account-actions { flex-direction: row; align-items: stretch; gap: 6px; }
.account-actions form { display: flex; margin: 0; }
.account-actions .btn.small {
    height: 36px;
    min-width: 102px;
    font-size: 12px;
    line-height: 1.15;
    padding: 4px 8px;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
}
.account-edit { padding: 16px 18px; }
.account-edit h3 { margin: 0 0 4px; }
.account-edit .form-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.filters .btn { margin-left: auto; }
.filters .btn + .btn { margin-left: 0; }
.chip-select {
    width: auto;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 7px 36px 7px 12px;
    background-color: #fff;
}
.chip {
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: 4px;
    padding: 6px 12px;
    text-decoration: none;
    background: #fff;
    font-weight: 600;
}
.chip.on, .chip:hover { background: var(--red); color: #fff; border-color: var(--red); }
.chips a.chip {
    display: inline-flex;
    align-items: center;
    color: var(--red);
    background: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 6px 10px;
    border: 0;
    box-shadow: inset 0 0 0 2px var(--red);
}
.chips a.chip.on,
.chips a.chip:hover { background: var(--red); color: #fff; box-shadow: none; }
.chips a.chip.on .nav-count,
.chips a.chip:hover .nav-count { background: #fff; color: var(--red); }

.domains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.domain-card {
    border-radius: 8px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow);
}
.domain-card.active { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.domain-title { color: var(--ink); font-size: 22px; text-decoration: none; }
.domain-title:hover { color: var(--red); }
.subs { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.subs a { color: var(--muted); text-decoration: none; }
.subs a:hover, .subs a.on { color: var(--red); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.recent { margin-top: 28px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.recent-head h2 { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.result-count { font-size: 14px; font-weight: 600; color: var(--muted); }
.doc-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.view-switch { display: flex; gap: 6px; }
.view-switch a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #fff;
    color: var(--grey-800);
}
.view-switch a svg { width: 18px; height: 18px; display: block; }
.view-switch a.on, .view-switch a:hover { background: var(--red); border-color: var(--red); color: #fff; }
.sort-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0 0 16px; }
.sort-row a {
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: 4px;
    padding: 3px 8px;
    text-decoration: none;
    background: #fff;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
}
.sort-row a.on, .sort-row a:hover { background: var(--red); color: #fff; border-color: var(--red); }
.sort-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 99px;
    background: #fff;
    color: var(--red);
    font-size: 11px;
}
.sort-arrow { margin-left: 4px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; overflow-anchor: none; }
.doc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; overflow-anchor: none; }
.doc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 180px;
    padding: 12px;
    border-radius: 8px;
    background: var(--card);
    color: inherit;
    box-shadow: var(--shadow);
}
.doc-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-pick {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 2px solid var(--red);
    border-radius: 50%;
    background: #fff;
    color: #fff;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 1px 4px #14141440;
}
.card-pick svg { width: 16px; height: 16px; opacity: 0; }
.card-pick[aria-pressed="true"] { background: var(--red); }
.card-pick[aria-pressed="true"] svg { opacity: 1; }
.doc-card.is-picked { box-shadow: inset 0 0 0 2px var(--red), var(--shadow); }
.pick-bar {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 30;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px 10px 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 28px #14141433;
}
.pick-bar[hidden] { display: none; }
.pick-bar .btn { margin: 0; }
.doc-card:hover { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.card-preview {
    width: 100%;
    height: 224px;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--line);
    pointer-events: none;
}
.card-preview iframe, .card-preview img {
    width: 100%;
    height: 373px;
    border: 0;
    background: #fff;
    display: block;
    pointer-events: none;
}
.card-preview img { height: 224px; object-fit: cover; object-position: top; }
.card-preview.link-preview { position: relative; }
.card-preview.link-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 960px;
    max-width: none;
    transform: scale(0.25);
    transform-origin: top left;
}
.card-preview.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--paper);
    color: var(--muted);
    font-size: 13px;
}
.card-preview.empty p { margin: 0; }
.doc-card strong { font-size: 18px; }
.doc-card small { color: var(--muted); }
.doc-card .open, .doc-card .actions, .doc-card .card-actions { margin-top: auto; }
.doc-card .actions { white-space: normal; }
.doc-card .card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 0;
}
.doc-card .card-actions form { margin: 0; }
.doc-card .card-actions .btn { min-width: 112px; }
.doc-card a { text-decoration: none; }
.doc-card a:hover strong { color: var(--red); }
.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}
.pager a, .pager span {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 600;
}
.pager a {
    background: #fff;
    border-color: var(--line-strong);
    text-decoration: none;
}
.pager a:hover, .pager span.on {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.pager .ellipsis { color: var(--muted); min-width: 24px; }
.doc-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
}
.doc-row:hover { color: inherit; box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.doc-main { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }
.doc-main:hover { color: inherit; }
.doc-main:hover strong { color: var(--red); }
.doc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.doc-side .actions { font-size: 13px; }
.doc-main strong { font-size: 16px; }
.doc-main strong, .doc-main small { overflow-wrap: anywhere; }
.doc-main small { color: var(--muted); }
.badge {
    width: 44px;
    height: 44px;
    background: var(--red);
    color: #fff;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
.open { color: var(--red); font-weight: 700; font-size: 14px; }

.crumb { color: var(--muted); margin: 0 0 8px; }
.crumb a { text-decoration: none; }
.doc { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .7fr); gap: 18px; align-items: start; }
.preview { background: var(--paper); border-radius: 8px; min-height: 460px; box-shadow: var(--shadow); }
.preview iframe, .preview img { width: 100%; height: 560px; border: 0; background: #fff; object-fit: contain; }
.preview.link-preview { height: 560px; overflow: hidden; position: relative; }
.preview.link-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 1120px;
    max-width: none;
    transform: scale(0.5);
    transform-origin: top left;
}
.preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--grey-800);
    background:
        linear-gradient(to top right, transparent calc(50% - 1px), var(--line-strong), transparent calc(50% + 1px)),
        linear-gradient(to top left, transparent calc(50% - 1px), var(--line-strong), transparent calc(50% + 1px)),
        var(--paper);
}
.preview-empty span { display: block; font-size: 14px; margin-top: 8px; color: var(--muted); }
.meta-card { border-radius: 8px; padding: 8px 18px 18px; box-shadow: var(--shadow); }
.lbl { color: var(--grey-500); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 0; }
.val { margin: 0; font-weight: 600; }
.meta-card .text { margin: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; margin: 0; }
table.data th { text-align: left; background: var(--paper); color: var(--grey-800); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
table.data th, table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbfc; }
.actions { white-space: nowrap; }
.status { border-radius: 4px; padding: 3px 8px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.status.publie { background: var(--red-soft); color: var(--red); }
.status.brouillon { background: var(--paper); color: var(--grey-800); }

.deposit {
    margin-top: 28px;
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.deposit-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.source-col { display: flex; flex-direction: column; gap: 8px; }
.source-switch { display: flex; gap: 8px; }
.source-switch .btn { flex: 1; }
.source-switch .btn.on,
.source-switch .btn.on:hover {
    background: var(--red);
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--red);
}
.link-field {
    min-height: 150px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-weight: 700;
}
.link-field input { width: 100%; font-weight: 400; }
.drop[hidden],
.link-field[hidden] { display: none; }
.fields, .fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.drop {
    position: relative;
    min-height: 150px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--grey-800);
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-copy { pointer-events: none; display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.drop.over { background: var(--red-soft); border-color: var(--red); }
.drop-line { min-height: 74px; }

.panel { border-radius: 8px; padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.stack label { font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { border-radius: 8px; padding: 16px; box-shadow: var(--shadow); }
.kpi strong { display: block; color: var(--red); font-size: 34px; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; align-items: start; }
.chart-row .panel { margin: 0; height: 100%; }
.chart-row > .panel > .disk-state,
.chart-row > .panel > h2 {
    min-height: 47px;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
}
.disk-state { margin: 0 0 16px; padding: 10px 14px; border-radius: 4px; font-size: 18px; font-weight: 700; }
.disk-state.ok { background: #1f8a4c; color: #fff; }
.disk-state.limite { background: #f5c518; color: #141414; }
.disk-state.critique { background: var(--red); color: #fff; }
.disk-chart { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.type-panel .disk-chart { flex-direction: row-reverse; justify-content: flex-start; flex-wrap: nowrap; }
.disk-ring {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--red) var(--used), var(--line-strong) 0);
    display: grid;
    place-items: center;
    flex: none;
}
.disk-hole {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.disk-hole strong { font-size: 28px; line-height: 1; color: var(--ink); }
.disk-hole span { color: var(--muted); font-size: 13px; }
.disk-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.disk-legend li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.swatch.used { background: var(--red); }
.swatch.free { background: var(--line-strong); }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; margin: 10px 0; }
.bar-track { background: var(--paper); height: 10px; overflow: hidden; border-radius: 999px; }
.bar-fill { display: block; height: 100%; background: var(--red); }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--red);
    background: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: inset 0 0 0 2px var(--red);
}
.tabs a.active, .tabs a:hover { color: #fff; background: var(--red); box-shadow: none; }
.tabs a.active .nav-count, .tabs a:hover .nav-count { background: #fff; color: var(--red); }
.tax-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tax-row input[type="text"], .tax-row input:not([type="hidden"]):not([type="radio"]) { flex: 1; min-width: 180px; width: auto; }
.tax-row.sub { margin-left: 22px; }
.color-pick { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; flex: 0 0 auto; }
.color-pick legend { padding: 0; font-size: 13px; color: var(--muted); }
.color-pick .swatches { display: flex; gap: 6px; }
.swatch {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px #14141433;
    cursor: pointer;
}
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch.taken { opacity: .28; cursor: not-allowed; }
.swatch.taken input { cursor: not-allowed; }
.badge.tone-rouge, .swatch.tone-rouge { background: #e1191d; }
.badge.tone-bleu, .swatch.tone-bleu { background: #0b6e99; }
.badge.tone-vert, .swatch.tone-vert { background: #1a7a45; }
.badge.tone-orange, .swatch.tone-orange { background: #c25600; }
.badge.tone-violet, .swatch.tone-violet { background: #643b96; }
.badge.tone-sarcelle, .swatch.tone-sarcelle { background: #0c7574; }
.badge.tone-prune, .swatch.tone-prune { background: #8c3a5e; }
.badge.tone-ardoise, .swatch.tone-ardoise { background: #3a485d; }

.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.conv-list, .thread { border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.conv-search { padding: 10px; background: var(--paper); }
.conv { display: block; padding: 12px 14px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.conv strong, .conv small { display: block; }
.conv small { color: var(--muted); font-weight: 400; }
.conv.active { background: var(--red-soft); }
.conv.waiting { box-shadow: inset 4px 0 0 var(--red); }
.pref { padding: 12px; border-top: 1px solid var(--line); font-size: 14px; background: var(--paper); }
.pref label { font-weight: 400; }
.thread { min-height: 480px; display: flex; flex-direction: column; }
.thread-head, .reply { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; }
.thread-head { border-bottom: 1px solid var(--line); background: #fff; }
.thread-head h2 { font-size: 20px; margin: 0; }
.thread-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.reply { border-top: 1px solid var(--line); align-items: stretch; background: var(--paper); }
.reply textarea { flex: 1; }
.reply-side { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; width: 220px; }
.reply-side .btn,
.reply-side .file-btn { width: 100%; margin: 0; }
.file-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 4px;
    background: #fff;
    color: var(--red);
    box-shadow: inset 0 0 0 2px var(--red);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}
.file-btn input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.file-label { pointer-events: none; }
.file-name {
    display: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    pointer-events: none;
}
.file-name.has-name { display: block; }
.file-btn:hover { background: var(--red); color: #fff; }
.file-btn:hover .file-name { color: #fff; }
.bubble { border-radius: 8px; padding: 10px 12px; max-width: 92%; }
.bubble header { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.bubble p { margin: 0; }
.bubble.mine { background: var(--red-soft); }
.bubble.theirs { background: var(--paper); margin-left: auto; }
.attach a { font-size: 14px; }

.compose { position: relative; }
.compose summary { list-style: none; }
.compose summary::-webkit-details-marker { display: none; }
.compose:not([open]) summary {
    background: #fff;
    color: var(--red);
    box-shadow: inset 0 0 0 2px var(--red);
}
.compose:not([open]) summary:hover {
    background: var(--red);
    color: #fff;
}
.compose[open] summary {
    background: var(--red);
    color: #fff;
    box-shadow: none;
}
.compose:not([open]) > :not(summary) { display: none; }
.compose form {
    position: absolute;
    right: 0;
    top: 48px;
    width: min(420px, 80vw);
    background: var(--card);
    border-radius: 8px;
    padding: 40px 14px 14px;
    box-shadow: var(--shadow);
    z-index: 3;
}

.site-foot {
    margin-top: auto;
    background: var(--grey-800);
    color: #fff;
    padding: 28px 0;
}
.foot-inner {
    width: calc(100% - 48px);
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    align-items: center;
}
.foot-ecap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    align-items: center;
}
.site-foot a { color: #fff; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.foot-credit { margin-left: auto; font-size: 13px; letter-spacing: .04em; white-space: nowrap; }

.modal[hidden] { display: none; }
.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    align-items: start;
    justify-content: center;
    padding: 148px 24px 24px;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: #14141499;
}
#contact-modal .modal-backdrop { background: transparent; }
.modal-card {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100vh - 120px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 28px 24px 20px;
    box-shadow: var(--shadow);
}
.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
#signup-modal .modal-card { width: min(960px, 100%); }
.signup-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.signup-row.passwords, .signup-row.pair { grid-template-columns: 1fr 1fr; }
#signup-modal .form-actions { margin-top: 22px; }
.contact-message textarea { min-height: 96px; }
.modal-card h2 { margin-right: 28px; }
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { color: var(--red); }

@media (max-width: 860px) {
    .domains, .kpis, .doc, .inbox, .stats-grid, .chart-row, .deposit-grid, .fields, .fields-2, .doc-cards { grid-template-columns: 1fr; }
    .type-panel .disk-chart { flex-wrap: wrap; }
    .sort-row { flex-wrap: wrap; }
    .span-2 { grid-column: auto; }
    .search-row, .reply, .page-head, .topbar-inner { flex-direction: column; align-items: stretch; }
    .topbar-inner { padding: 14px 0; }
    .topbar-end { margin-left: 0; justify-content: flex-end; }
    .contact-row, .signup-row, .signup-row.passwords, .signup-row.pair { grid-template-columns: 1fr; }
    body.page-connexion { --sheet-top: 112px; --banner-top: 8px; }
    .reply-side { width: auto; }
    .compose form { position: static; width: auto; margin-top: 8px; }
    .tax-row.sub { margin-left: 0; }
    .bar-row { grid-template-columns: 1fr; }
}
