/* Hub DPC — reprend la maquette « Hub Employés » (couleurs et polices du site et du planner). */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-latin-var.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --navy: #0D132F;
  --navy-2: #111A45;
  --blue: #3F5EFF;
  --blue-light: #8699FF;
  --blue-pale: #C3CCFF;
  --card: rgba(22, 29, 64, 0.72);
  --card-hover: rgba(30, 40, 88, 0.85);
  --line: rgba(134, 153, 255, 0.2);
  --line-soft: rgba(134, 153, 255, 0.18);
  --chip: rgba(134, 153, 255, 0.16);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--navy); color: #fff; font-family: var(--body); -webkit-font-smoothing: antialiased; }
/* Pas de curseur de texte clignotant sur les textes (navigation au curseur de Chrome, touche F7) — seulement dans les champs */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.page {
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) clamp(16px, 5vw, 64px) max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(80% 60% at 85% 10%, rgba(63, 94, 255, 0.45), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(44, 66, 178, 0.55), transparent 65%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy) 100%);
}
.watermark { position: absolute; right: -8vw; bottom: -10vw; width: min(70vw, 820px); height: auto; opacity: 0.05; pointer-events: none; z-index: 0; }

/* ---------- en-tête ---------- */
.topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 44px; height: 44px; display: block; }
.brand span { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: 0.01em; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.date { font-size: 14px; font-weight: 500; color: var(--blue-light); text-transform: capitalize; white-space: nowrap; }

.account { position: relative; }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; overflow: hidden; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--chip); border: 1px solid var(--line); color: #fff; font-family: var(--display); font-weight: 600;
  transition: border-color 0.18s;
}
.avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--blue-light); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 16px;
  background: #161D40; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.account-menu[hidden] { display: none; }
.account-name { margin: 0; font-weight: 600; }
.account-handle { margin: 4px 0 14px; font-size: 13px; color: var(--blue-light); }
.logout {
  width: 100%; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; font-weight: 500;
}
.logout:hover { background: rgba(239, 68, 68, 0.18); }

/* ---------- contenu ---------- */
.hero { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 0; }
.intro { text-align: center; margin-bottom: 48px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-light); }
h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 7vw, 80px); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.lead { margin: 0; font-size: 17px; line-height: 1.5; color: var(--blue-pale); max-width: 460px; text-wrap: pretty; }

.tiles { width: 100%; max-width: 880px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 432px)); justify-content: center; gap: 16px; }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 96px; padding: 24px 28px;
  border-radius: 16px; background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.tile:hover, .tile:focus-visible { background: var(--card-hover); border-color: rgba(134, 153, 255, 0.45); transform: translateY(-2px); outline: none; }
.tile-icon { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; background: var(--chip); display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 26px; height: 26px; }
.tile-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-title { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.2; }
.tile-desc { font-size: 14px; line-height: 1.4; color: var(--blue-pale); }
.tile-arrow { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px; background: rgba(134, 153, 255, 0.14); display: flex; align-items: center; justify-content: center; font-size: 18px; transition: background 0.18s; }
.tile:hover .tile-arrow { background: var(--blue); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--blue-pale); }

/* ---------- pied de page ---------- */
.footer { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--blue-light); }
.footer a:hover { color: #fff; }

/* ---------- connexion ---------- */
.login { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 32px 0; }
.login-logo { width: 72px; height: 72px; margin-bottom: 8px; }
.login-title { font-size: clamp(36px, 8vw, 56px); }
.login-card { width: 100%; margin-top: 18px; padding: 28px; border-radius: 16px; background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.discord-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 15px 20px; border: 0; border-radius: 12px; cursor: pointer;
  background: #5865F2; color: #fff; font-family: var(--display); font-weight: 600; font-size: 16px; transition: background 0.18s, transform 0.18s;
}
.discord-btn:hover { background: #4752C4; transform: translateY(-1px); }
.discord-btn svg { width: 24px; height: 24px; }
.remember { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--blue-pale); cursor: pointer; }
.remember input { width: 16px; height: 16px; accent-color: var(--blue); }
.alert { width: 100%; margin: 6px 0 0; padding: 12px 16px; border-radius: 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; font-size: 14px; line-height: 1.45; }
.fineprint { margin: 6px 0 0; font-size: 13px; color: var(--blue-light); }
.fineprint a { color: inherit; text-decoration: underline; }
/* Connecter mes serveurs (coordination du démarchage) */
.guilds { max-width: 560px; }
.guilds-card { text-align: left; gap: 10px; }
.guilds-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--blue-pale); }
.guilds-card strong { color: #fff; }
.guilds-card .discord-btn { margin-top: 12px; }
.guilds-h { margin: 8px 0 0; font-family: var(--display); font-size: 17px; font-weight: 600; }
.guilds-h:first-child { margin-top: 0; }

@media (max-width: 600px) {
  .brand span, .date { display: none; }
  .hero { padding: 40px 0; }
  .intro { margin-bottom: 32px; }
  .tile { padding: 20px; gap: 16px; }
  .tile-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .tile, .discord-btn { transition: none; } .tile:hover, .discord-btn:hover { transform: none; } }

/* ---------- menu du compte : lien d'administration ---------- */
.menu-link { display: block; margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); font-weight: 500; text-align: center; }
.menu-link:hover { border-color: var(--blue-light); }
.menu-link[hidden] { display: none; }

/* ---------- gestion du hub ---------- */
.pill { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); font-size: 14px; font-weight: 500; white-space: nowrap; }
.pill:hover { border-color: var(--blue-light); }
.admin { position: relative; z-index: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 40px 0; display: flex; flex-direction: column; gap: 32px; }
.panel { padding: 28px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel h2 { margin: 6px 0 0; font-family: var(--display); font-size: 28px; font-weight: 700; }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--blue-pale); max-width: 560px; line-height: 1.45; }
.opt { color: var(--blue-light); font-weight: 400; }

.admin label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--blue-pale); }
.admin input:not([type=checkbox]):not([type=radio]) {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13, 19, 47, 0.7);
  color: #fff; font: 16px/1.3 var(--body);
}
.admin input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

.btn, .btn-ghost, .btn-danger, .btn-icon { cursor: pointer; border-radius: 10px; font: 500 14px var(--body); padding: 11px 16px; white-space: nowrap; transition: background 0.18s, border-color 0.18s; }
.btn { background: var(--blue); border: 1px solid var(--blue); color: #fff; }
.btn:hover { background: #3450e6; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: #fff; }
.btn-ghost:hover { border-color: var(--blue-light); }
.btn-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
.btn-icon { width: 38px; padding: 9px 0; background: transparent; border: 1px solid var(--line); color: #fff; }
.btn-icon:disabled { opacity: 0.3; cursor: default; }

.alert-ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.alert[hidden] { display: none; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 12px; background: rgba(13, 19, 47, 0.55); border: 1px solid var(--line-soft); }
.row-off { opacity: 0.55; }
.row-avatar, .row-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--chip); font-family: var(--display); font-weight: 600; }
.row-icon { border-radius: 12px; }
.row-icon svg { width: 22px; height: 22px; }
.row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-main p { margin: 0; }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row-sub { font-size: 13px; color: var(--blue-pale); margin-top: 3px !important; overflow-wrap: anywhere; }
.row-url { color: var(--blue-light); }
.row-roles { font-size: 12px; color: var(--blue-light); margin-top: 6px !important; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--blue-light); }
.status { flex: 0 0 auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.status-ok { color: #86efac; border-color: rgba(34, 197, 94, 0.35); }
.status-wait { color: var(--blue-light); border-color: var(--line); }
.status-warn { color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
.status-off { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }

.editor { margin-bottom: 8px; padding: 22px; border-radius: 14px; border: 1px solid rgba(134, 153, 255, 0.45); background: rgba(13, 19, 47, 0.7); display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 20px; }
.editor h3 { margin: 0; font-family: var(--display); font-size: 20px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.admin fieldset { margin: 0; padding: 0; border: 0; }
.admin legend { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--blue-pale); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.admin .icon-choice { position: relative; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-weight: 500; font-size: 11px; color: var(--blue-pale); }
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-face svg { width: 24px; height: 24px; color: #fff; display: block; }
.icon-choice:has(input:checked) { border-color: var(--blue); background: rgba(63, 94, 255, 0.18); color: #fff; }
.icon-choice:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.admin .check { flex-direction: row; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; color: #fff; font-weight: 500; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.check:has(input:checked) { border-color: var(--blue); background: rgba(63, 94, 255, 0.14); }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 720px) {
  .panel { padding: 20px 16px; }
  .inline-form, .editor-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .admin .brand span { display: inline; }
}

/* ---------- Stockage Windows ---------- */
.files { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 0 8px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--blue-light); }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: #fff; font-weight: 600; }
.crumbs .sep { opacity: 0.5; }
.files-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 18px; flex: 1; min-height: 70vh; }
.files-list, .viewer { border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.files-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: calc(100vh - 220px); align-self: start; }
.files-note { margin: 0; padding: 18px; color: var(--blue-pale); font-size: 14px; }
.file-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; padding: 10px 12px; border-radius: 10px; }
.file-row:hover { background: rgba(134, 153, 255, 0.1); }
.file-row.is-active { background: rgba(63, 94, 255, 0.22); }
.file-ico { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 10px; background: var(--chip); display: flex; align-items: center; justify-content: center; }
.file-ico svg { width: 20px; height: 20px; }
.file-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.file-meta { font-size: 12px; color: var(--blue-light); }
.viewer { display: flex; flex-direction: column; overflow: hidden; }
.viewer-empty { margin: auto; padding: 40px; color: var(--blue-pale); text-align: center; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.viewer-title { flex: 1; min-width: 0; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-back { display: none; }
.viewer-frame { flex: 1; width: 100%; min-height: 70vh; border: 0; background: #fff; }
.viewer-img { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 60vh;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0 25%, transparent 0 50%) 0 0 / 24px 24px; }
.viewer-img img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.viewer-media { width: 100%; max-height: 75vh; background: #000; }
.viewer-audio { margin: 40px auto; }
.viewer-none { margin: auto; padding: 40px; text-align: center; color: var(--blue-pale); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.viewer .btn, .viewer .btn-ghost { padding: 8px 14px; }
@media (max-width: 860px) {
  .files-layout { grid-template-columns: 1fr; min-height: 0; }
  .files-list { max-height: none; }
  .files-layout .viewer { display: none; }
  .files-layout.has-file .files-list { display: none; }
  .files-layout.has-file .viewer { display: flex; }
  .viewer-back { display: inline-block; }
  .viewer-head { flex-wrap: wrap; }
  .viewer-title { order: 3; flex-basis: 100%; }
  .viewer-frame { min-height: 75vh; }
}

/* ---------- droits du stockage (gestion du hub) ---------- */
.roles-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(63, 94, 255, 0.18); color: #dbe1ff; }
.badge-muted { background: transparent; border: 1px dashed var(--line); color: var(--blue-light); font-weight: 500; }
.badge-none { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.row-link { background: none; border: 0; padding: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.row-link:hover { color: var(--blue-light); }
.rule-editor { width: 100%; margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px solid rgba(134, 153, 255, 0.45); display: flex; flex-direction: column; gap: 12px; }
.rule-mode { display: flex; flex-wrap: wrap; gap: 16px; }
.admin .rule-mode label { flex-direction: row; align-items: center; gap: 8px; color: #fff; font-weight: 500; font-size: 14px; cursor: pointer; }
.rule-mode input { accent-color: var(--blue); }
[hidden] { display: none !important; }
.admin select { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13, 19, 47, 0.7); color: #fff; font: 16px/1.3 var(--body); }
.admin select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.row:has(.rule-editor) { flex-wrap: wrap; }
.rule-editor { flex-basis: 100%; }

/* ---------- Status ---------- */
.status-page { position: relative; z-index: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 36px 0; display: flex; flex-direction: column; gap: 24px; }
.status-summary { display: flex; align-items: center; gap: 18px; padding: 24px 28px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.status-summary.is-up { border-color: rgba(34, 197, 94, 0.4); background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), var(--card) 60%); }
.status-summary.is-down { border-color: rgba(239, 68, 68, 0.45); background: linear-gradient(90deg, rgba(239, 68, 68, 0.14), var(--card) 60%); }
.summary-dot { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 999px; background: var(--blue-light); }
.is-up .summary-dot { background: #22c55e; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18); }
.is-down .summary-dot { background: #ef4444; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2); }
.summary-title { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 700; }
.summary-sub { margin: 4px 0 0; font-size: 14px; color: var(--blue-pale); }
.status-group { gap: 14px; }
.status-group h2 { margin: 0; font-family: var(--display); font-size: 20px; }
.status-row { gap: 14px; }
.status-row.is-down { border-color: rgba(239, 68, 68, 0.45); }
.status-row .row-title a:hover { color: var(--blue-light); }
.dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 999px; }
.dot-up { background: #22c55e; }
.dot-warn { background: #f59e0b; }
.dot-down { background: #ef4444; box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.2); }
.uptime { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.uptime-bar { display: flex; gap: 2px; }
.uptime-bar span { width: 6px; height: 22px; border-radius: 2px; }
.uptime-bar .up { background: #22c55e; }
.uptime-bar .warn { background: #f59e0b; }
.uptime-bar .down { background: #ef4444; }
.uptime-bar .nodata { background: rgba(134, 153, 255, 0.15); }
.uptime-pct { margin: 0; font-size: 12px; color: var(--blue-light); }
@media (max-width: 720px) {
  .status-summary { padding: 18px; }
  .summary-title { font-size: 20px; }
  .uptime { width: 100%; align-items: flex-start; padding-left: 26px; }
  .uptime-bar span { width: auto; flex: 1; }
  .uptime-bar { width: 100%; }
}
.status-groups { display: flex; flex-direction: column; gap: 24px; }
.status-summary > div { min-width: 0; }
.status-row .row-title { font-size: 16px; }

/* ---------- « Voir en tant que » ---------- */
.viewas-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: #f59e0b; color: #1a1300; font-size: 14px; text-align: center; }
.viewas-bar a { padding: 4px 12px; border-radius: 999px; background: #1a1300; color: #fde68a; font-weight: 600; }
.viewas-bar a:hover { background: #000; }
.admin .check-solo { align-self: flex-start; }
.admin fieldset:disabled { opacity: 0.4; }
.admin fieldset:disabled .check { cursor: not-allowed; }

/* ---------- accueil : densité selon le nombre d'éléments (voir hub.js) ---------- */
.tile-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body[data-density] .hero { padding: 32px 0; }
body[data-density] .intro { margin-bottom: 28px; gap: 10px; }
body[data-density] .tiles { max-width: 1180px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
body[data-density] .tile { min-height: 80px; padding: 18px 20px; gap: 16px; border-radius: 14px; }
body[data-density] .tile-icon { width: 44px; height: 44px; border-radius: 12px; }
body[data-density] .tile-icon svg { width: 22px; height: 22px; }
body[data-density] .tile-title { font-size: 19px; }
body[data-density] .tile-desc { font-size: 13px; }
body[data-density] .tile-arrow { width: 34px; height: 34px; font-size: 16px; }
body[data-density="dense"] h1 { font-size: clamp(36px, 5.5vw, 64px); }
body[data-density="compact"] h1 { font-size: clamp(32px, 4.5vw, 52px); }
body[data-density="compact"] .lead { font-size: 15px; }
body[data-density="compact"] .tiles { max-width: 1440px; gap: 12px; }
body[data-density="compact"] .tile { min-height: 70px; padding: 14px 16px; gap: 12px; }
body[data-density="compact"] .tile-icon { width: 40px; height: 40px; }
body[data-density="compact"] .tile-title { font-size: 17px; }
body[data-density="compact"] .tile-desc { -webkit-line-clamp: 1; }
body[data-density="compact"] .tile-arrow { display: none; }
@media (min-width: 1000px) { body[data-density="dense"] .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { body[data-density="compact"] .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1240px) { body[data-density="compact"] .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-height: 800px) and (min-width: 1000px) { body[data-density] .hero { padding: 40px 0; } }
/* Écrans peu hauts (portables) : on resserre l'en-tête pour garder toutes les tuiles visibles */
@media (max-height: 820px) and (min-width: 700px) {
  body[data-density] .page { padding-top: 18px; padding-bottom: 18px; }
  body[data-density] .topbar { padding-bottom: 16px; }
  body[data-density] .hero { padding: 20px 0; }
  body[data-density] .intro { margin-bottom: 20px; gap: 8px; }
  body[data-density] h1 { font-size: clamp(30px, 4vw, 46px); }
  body[data-density] .footer { padding-top: 16px; }
}
