/* ===== RHUB design system — utilisable par le hub ET par les apps : <link rel="stylesheet" href="/_rhub/rhub.css"> ===== */
:root {
  color-scheme: dark;
  --bg: #0b0d12; --bg-2: #10131a; --surface: #151923; --surface-2: #1c2230; --surface-3: #242b3b;
  --border: #272e3f; --border-strong: #38415a;
  --text: #e8eaf0; --muted: #98a1b5; --faint: #6b7489;
  --accent: #6d8cff; --accent-2: #9b6dff; --accent-fg: #fff; --accent-soft: rgba(109, 140, 255, .14);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --danger: #f87171; --danger-soft: rgba(248, 113, 113, .14);
  --radius: 14px; --radius-sm: 9px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ring: 0 0 0 3px rgba(109, 140, 255, .45);
}
:root[data-theme='light'] { color-scheme: light; --bg: #f5f6fa; --bg-2: #eceef5; --surface: #fff; --surface-2: #f3f4f9; --surface-3: #e8eaf2; --border: #dfe2ec; --border-strong: #c3c9da; --text: #161a26; --muted: #5b647a; --faint: #8a93a8; --accent: #4560e6; --accent-soft: rgba(69, 96, 230, .1); --ok: #059669; --ok-soft: rgba(5, 150, 105, .12); --warn: #b45309; --warn-soft: rgba(180, 83, 9, .12); --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .1); --shadow: 0 10px 30px rgba(30, 40, 80, .12); }
@media (prefers-color-scheme: light) { :root[data-theme='auto'] { color-scheme: light; --bg: #f5f6fa; --bg-2: #eceef5; --surface: #fff; --surface-2: #f3f4f9; --surface-3: #e8eaf2; --border: #dfe2ec; --border-strong: #c3c9da; --text: #161a26; --muted: #5b647a; --faint: #8a93a8; --accent: #4560e6; --accent-soft: rgba(69, 96, 230, .1); --ok: #059669; --ok-soft: rgba(5, 150, 105, .12); --warn: #b45309; --warn-soft: rgba(180, 83, 9, .12); --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .1); --shadow: 0 10px 30px rgba(30, 40, 80, .12); } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.55 var(--font); color: var(--text); background: radial-gradient(1200px 500px at 10% -10%, var(--accent-soft), transparent 60%), radial-gradient(900px 400px at 100% 0, rgba(155, 109, 255, .08), transparent 60%), var(--bg); background-attachment: fixed; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .08rem .35rem; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- mise en page --- */
.container { max-width: 1040px; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }
.container.narrow { max-width: 460px; padding-top: 12vh; } .container.mid { max-width: 780px; }
.stack { display: flex; flex-direction: column; gap: .8rem; } .stack.lg { gap: 1.4rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; } .row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* --- barre du haut --- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: .02em; color: var(--text); } .brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.topbar nav { display: flex; gap: .2rem; } .topbar nav a { color: var(--muted); padding: .35rem .7rem; border-radius: 8px; font-weight: 500; }
.topbar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; } .topbar nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.topbar .right { margin-left: auto; display: flex; gap: .6rem; align-items: center; } .who { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .who { display: none; } .topbar { padding: .5rem .8rem; gap: .5rem; } }
.subnav { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 1.4rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.subnav a { padding: .4rem .85rem; border-radius: 99px; color: var(--muted); font-weight: 500; } .subnav a:hover { background: var(--surface-2); text-decoration: none; }
.subnav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }

/* --- boutons --- */
.btn, button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; color: var(--accent-fg); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 2px 10px rgba(109, 140, 255, .25); transition: transform .12s, filter .12s, background .12s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn:active { transform: translateY(1px); } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); box-shadow: none; } .btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); filter: none; }
.btn.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); box-shadow: none; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; } .btn.icon { padding: .3rem .55rem; } .btn.block { width: 100%; }

/* --- formulaires --- */
.field { display: flex; flex-direction: column; gap: .3rem; text-align: left; } .field > span, label.lbl { font-size: .82rem; font-weight: 600; color: var(--muted); }
input:not([type='checkbox']):not([type='radio']), select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .75rem; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface-2); cursor: pointer; font-size: .9rem; } .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.hint { font-size: .8rem; color: var(--faint); }

/* --- cartes, badges, alertes --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card h2 { margin-bottom: .2rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); } .badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.danger { background: var(--danger-soft); color: var(--danger); }
.alert { padding: .7rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); } .alert.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); } .alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.secret { font-family: var(--mono); font-size: 1.05rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px dashed var(--border-strong); user-select: all; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .4rem; font-family: var(--mono); }
.codes span { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .5rem; text-align: center; user-select: all; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 190px; height: 190px; }

/* --- stats, tableaux, listes --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; } .stat b { display: block; font-size: 1.6rem; line-height: 1.1; } .stat span { color: var(--muted); font-size: .82rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th, td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); } tr:last-child td { border-bottom: 0; }
details.fold { border-top: 1px solid var(--border); padding-top: .6rem; } details.fold > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; list-style: none; } details.fold > summary::before { content: '▸ '; } details.fold[open] > summary::before { content: '▾ '; }
.user-card { display: flex; flex-direction: column; gap: .7rem; } .user-card.banned { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* --- hub : cartes d'apps --- */
.hero { margin: .6rem 0 1.4rem; } .hero h1 { font-size: 1.9rem; } .search { max-width: 420px; margin-top: .9rem; }
.section-title { margin: 1.6rem 0 .7rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.app-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; --app-color: var(--accent); }
.app-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--app-color); opacity: .75; }
.app-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.app-link { display: flex; flex-direction: column; gap: .25rem; padding: 1.2rem; color: inherit; height: 100%; } .app-link:hover { text-decoration: none; }
.app-icon { font-size: 2rem; line-height: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--app-color) 16%, transparent); margin-bottom: .4rem; }
.app-card h3 { margin: 0; } .app-card p { margin: 0; color: var(--muted); font-size: .88rem; } .app-meta { margin-top: .5rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.fav { position: absolute; top: .6rem; right: .6rem; background: transparent; border: 0; color: var(--faint); font-size: 1.15rem; padding: .2rem .4rem; border-radius: 8px; } .fav:hover { background: var(--surface-2); color: var(--warn); } .fav.on { color: var(--warn); }

/* --- notifications --- */
.toasts { position: fixed; z-index: 999; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast { padding: .7rem .95rem; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: pop .2s ease-out; }
.toast.ok { border-left: 4px solid var(--ok); } .toast.err { border-left: 4px solid var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
kbd { font-family: var(--mono); font-size: .75rem; padding: .05rem .4rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ===== v2 : connexion, compte, administration ===== */
.logo.big { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; font-size: 1.6rem; }
a.stat { color: inherit; transition: border-color .15s, transform .15s; } a.stat:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .9rem; }
ul.plain li { padding-bottom: .45rem; border-bottom: 1px solid var(--border); } ul.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.card.flat summary { list-style: none; } .card.flat summary::-webkit-details-marker { display: none; }
.secret.small { font-size: .9rem; }
.user-card .row { align-items: center; }
select { appearance: auto; }

/* ===== v3 : hub en icônes (icône + nom dessous), compte en attente ===== */
.dock { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 1.4rem .8rem; margin-top: 1.4rem; }
.tile { position: relative; --app-color: var(--accent); }
.tile-link { display: flex; flex-direction: column; align-items: center; gap: .55rem; color: var(--text); text-align: center; padding: .3rem .2rem; border-radius: var(--radius); }
.tile-link:hover { text-decoration: none; }
.tile-icon { position: relative; display: grid; place-items: center; width: 76px; height: 76px; font-size: 2.3rem; line-height: 1; border-radius: 22px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--app-color) 30%, var(--surface)), color-mix(in srgb, var(--app-color) 12%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--app-color) 35%, var(--border)); box-shadow: 0 6px 16px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: transform .15s, box-shadow .15s; }
.tile-link:hover .tile-icon, .tile-link:focus-visible .tile-icon { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 24px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .16); }
.tile-icon.maint { filter: grayscale(.6); opacity: .7; }
.tile-icon.maint::after { content: '🛠️'; position: absolute; right: -6px; bottom: -6px; font-size: 1rem; }
.tile-name { font-size: .86rem; font-weight: 600; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-fav { position: absolute; top: -2px; right: calc(50% - 50px); background: var(--surface); border: 1px solid var(--border); color: var(--faint); font-size: .8rem; line-height: 1; width: 24px; height: 24px; border-radius: 99px; padding: 0; opacity: 0; transition: opacity .12s; }
.tile:hover .tile-fav, .tile-fav:focus-visible, .tile-fav.on { opacity: 1; }
.tile-fav.on { color: var(--warn); }
@media (hover: none) { .tile-fav { opacity: .85; } }
.avatar.emoji { font-size: 1.25rem; background: var(--surface-3); }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.7rem; }

/* ===== v4 : style « liquid glass » (barre du haut, icônes, accueil) ===== */
:root {
  --glass-bg: rgba(255, 255, 255, .10); --glass-border: rgba(255, 255, 255, .26); --glass-hi: rgba(255, 255, 255, .5); --glass-shadow: rgba(0, 0, 0, .35);
  --spring: cubic-bezier(.34, 1.56, .64, 1); --smooth: cubic-bezier(.22, 1, .36, 1);
  --blob-1: rgba(255, 122, 184, .22); --blob-2: rgba(90, 200, 250, .2); --blob-3: rgba(255, 209, 102, .14);
}
:root[data-theme='light'] { --glass-bg: rgba(255, 255, 255, .5); --glass-border: rgba(255, 255, 255, .8); --glass-hi: rgba(255, 255, 255, 1); --glass-shadow: rgba(40, 50, 100, .18); --blob-1: rgba(255, 122, 184, .32); --blob-2: rgba(90, 200, 250, .34); --blob-3: rgba(255, 209, 102, .3); }
@media (prefers-color-scheme: light) { :root[data-theme='auto'] { --glass-bg: rgba(255, 255, 255, .5); --glass-border: rgba(255, 255, 255, .8); --glass-hi: rgba(255, 255, 255, 1); --glass-shadow: rgba(40, 50, 100, .18); --blob-1: rgba(255, 122, 184, .32); --blob-2: rgba(90, 200, 250, .34); --blob-3: rgba(255, 209, 102, .3); } }

/* fond coloré : le verre n'a de sens que s'il y a quelque chose à flouter derrière */
body { background: radial-gradient(circle at 18% 12%, var(--blob-1) 0, transparent 42%), radial-gradient(circle at 86% 26%, var(--blob-2) 0, transparent 46%), radial-gradient(circle at 42% 88%, var(--blob-3) 0, transparent 42%), radial-gradient(1200px 500px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); background-attachment: fixed; }

.glass, .glass-bar, .tile-icon, .widget, .folder-panel { background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px) saturate(180%) brightness(1.06); backdrop-filter: blur(14px) saturate(180%) brightness(1.06);
  box-shadow: inset 1.5px 1.5px 1px var(--glass-hi), inset -1px -1px 1px rgba(255, 255, 255, .22), inset 0 0 18px 2px rgba(255, 255, 255, .08), 0 10px 30px var(--glass-shadow), 0 2px 6px rgba(0, 0, 0, .12); }

/* --- barre du haut flottante --- */
.topbar { top: calc(10px + env(safe-area-inset-top, 0px)); width: min(calc(100% - 24px), 1040px); margin: 10px auto 0; padding: .4rem .5rem .4rem .8rem; border-radius: 999px; border-bottom: 1px solid var(--glass-border); isolation: isolate; }
.topbar::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 65%, rgba(255, 255, 255, .14) 100%); pointer-events: none; z-index: -1; }
.topbar nav { position: relative; }
.topbar nav a { position: relative; z-index: 1; border-radius: 999px; transition: color .3s; }
.topbar nav a:hover, .topbar nav a[aria-current='page'] { background: transparent; }
.nav-pill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); opacity: 0; pointer-events: none;
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, .7), inset -1px -1px 1px rgba(255, 255, 255, .25), inset 0 0 12px rgba(255, 255, 255, .18), 0 3px 10px rgba(0, 0, 0, .16);
  -webkit-backdrop-filter: blur(4px) brightness(1.15); backdrop-filter: blur(4px) brightness(1.15); }
.nav-pill.show { opacity: 1; }
.nav-pill.anim { transition: transform .55s var(--spring), width .55s var(--spring); animation: stretch .55s var(--smooth); }
@keyframes stretch { 0% { scale: 1 1; } 35% { scale: 1.18 .86; } 70% { scale: .96 1.05; } 100% { scale: 1 1; } }

/* --- composants verre --- */
.chip { padding: .45rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer; transition: transform .3s var(--spring), background .25s; }
.chip:active { transform: scale(.93); } .chip.on { background: color-mix(in srgb, var(--accent) 38%, var(--glass-bg)); } .chip.danger { color: var(--danger); }

/* --- accueil --- */
.hub { padding-top: 1.6rem; }
.hub-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.02em; margin: 0; }
.hub-date { margin: .15rem 0 1rem; color: var(--muted); text-transform: capitalize; }
.hub-search { display: flex; align-items: center; gap: .6rem; max-width: 520px; padding: .15rem 1rem; border-radius: 999px; transition: box-shadow .3s, transform .3s var(--spring); }
.hub-search:focus-within { transform: scale(1.015); box-shadow: inset 1.5px 1.5px 1px var(--glass-hi), 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent), 0 8px 24px var(--glass-shadow); }
.hub-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hub-search input:not([type='checkbox']):not([type='radio']) { background: none; border: 0; box-shadow: none; padding: .7rem 0; border-radius: 0; }
.hub-search input:focus { box-shadow: none; }
.hub-section { margin-top: 1.7rem; animation: hubIn .55s var(--smooth) both; } .hub-section:nth-of-type(2) { animation-delay: .06s; } .hub-section:nth-of-type(3) { animation-delay: .12s; }
@keyframes hubIn { from { opacity: 0; transform: translateY(14px) scale(.98); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.hub-title { margin: 0 0 .2rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.hub-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; } .hub-tools { display: flex; gap: .5rem; } .hub-hint { margin: .4rem 0 0; }

.dock { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1.6rem 1rem; margin-top: 1rem; }
.dock.row-dock { display: flex; flex-wrap: wrap; gap: 1.2rem 1rem; } .row-dock .tile { width: 112px; }
.tile-icon { width: 88px; height: 88px; font-size: 2.7rem; border-radius: 26px; background: linear-gradient(160deg, color-mix(in srgb, var(--app-color) 34%, var(--glass-bg)), var(--glass-bg)); border-color: color-mix(in srgb, var(--app-color) 30%, var(--glass-border)); transition: transform .4s var(--spring), box-shadow .3s; }
.tile-link:hover .tile-icon, .tile-link:focus-visible .tile-icon { transform: translateY(-4px) scale(1.07); }
.tile-link:active .tile-icon { transform: scale(.92); }
button.tile-link { background: none; border: 0; width: 100%; font: inherit; }
.tile-fav { right: calc(50% - 58px); background: var(--glass-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: var(--glass-border); }
.tile-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: #ff3b5c; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 3px 8px rgba(255, 59, 92, .45); animation: badgePulse 2.4s ease-in-out infinite; }
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.tile-icon.maint::after { right: -2px; bottom: -4px; }

/* dossier : mini-grille 2×2 */
.folder-icon { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 11px; font-size: 1.15rem; align-content: center; justify-items: center; }
.folder-icon i { font-style: normal; line-height: 1.25; }

/* organisation */
.hub.editing .tile[data-key] { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; animation: wiggle .3s ease-in-out infinite alternate; }
.hub.editing .tile[data-key]:nth-child(2n) { animation-delay: -.12s; } .hub.editing .tile[data-key]:nth-child(3n) { animation-delay: -.2s; }
@keyframes wiggle { from { rotate: -1.6deg; } to { rotate: 1.6deg; } }
.tile.dragging { opacity: .3; animation: none !important; }
.tile.drop-into .tile-icon { transform: scale(1.18); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent), inset 1.5px 1.5px 1px var(--glass-hi); }
.tile.drop-before::before, .tile.drop-after::after { content: ''; position: absolute; top: 6px; bottom: 28px; width: 4px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tile.drop-before::before { left: -9px; } .tile.drop-after::after { right: -9px; }
.drag-ghost { position: fixed; z-index: 300; width: 88px; height: 88px; margin: -44px 0 0 -44px; display: grid; place-items: center; font-size: 2.7rem; border-radius: 26px; pointer-events: none; transform: scale(1.12) rotate(4deg); background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 1.5px 1.5px 1px var(--glass-hi); }

.overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.2rem; background: rgba(10, 12, 24, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: hubIn .3s var(--smooth) both; }
.folder-panel { width: min(100%, 480px); max-height: 85vh; overflow: auto; padding: 1.3rem; border-radius: 32px; display: flex; flex-direction: column; gap: .8rem; }
.folder-title { margin: 0; text-align: center; } .folder-name { text-align: center; font-weight: 700; font-size: 1.15rem; border-radius: 999px; background: var(--glass-bg); }
.folder-dock { margin-top: .4rem; } .folder-actions { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }

/* widgets */
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.widget { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; border-radius: 24px; color: var(--text); background: linear-gradient(160deg, color-mix(in srgb, var(--app-color, var(--accent)) 16%, var(--glass-bg)), var(--glass-bg)); transition: transform .35s var(--spring); }
a.widget:hover { text-decoration: none; transform: translateY(-3px); } a.widget:active { transform: scale(.98); }
.widget-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; } .widget-ico { font-size: 1.3rem; } .widget-sum { color: var(--muted); font-size: .85rem; }
.widget-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; }
.widget-list li { position: relative; padding-left: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .widget-list li::before { content: ''; position: absolute; left: 0; top: .5em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--app-color, var(--accent)); }
.widget-list li.done { opacity: .55; text-decoration: line-through; }
.terra { position: relative; height: 74px; border-radius: 18px 18px 26px 26px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(120, 220, 170, .12)); border: 1px solid var(--glass-border); }
.terra-plants { position: relative; z-index: 1; display: flex; gap: .15rem; margin-bottom: 14px; font-size: 1.6rem; } .terra-plants i { font-style: normal; display: inline-block; transform-origin: bottom; animation: sway 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); }
@keyframes sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.terra-soil { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: linear-gradient(180deg, #8b6b4a, #5d4630); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass, .glass-bar, .tile-icon, .widget, .folder-panel, .drag-ghost { background: var(--surface-2); } }
@media (prefers-reduced-transparency: reduce) { .glass, .glass-bar, .tile-icon, .widget, .folder-panel, .nav-pill, .drag-ghost { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-2); } }
@media (max-width: 640px) { .topbar { border-radius: 28px; } .dock { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 1.3rem .6rem; } .tile-icon, .drag-ghost { width: 78px; height: 78px; font-size: 2.4rem; } .drag-ghost { margin: -39px 0 0 -39px; } .tile-fav { right: calc(50% - 52px); } .row-dock .tile { width: 96px; } }

/* ===== v6 : accueil en grille libre (apps, dossiers, widgets, favoris, récents) ===== */
.hub-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.hub-tools { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.chip:disabled { opacity: .35; cursor: default; pointer-events: none; }
.edit-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding: .7rem 1.1rem; border-radius: 22px; }
.edit-bar .hint { margin: 0; flex: 1 1 280px; }
.mini-chip { padding: .2rem .65rem; font-size: .74rem; margin-left: auto; }

.hgrid { --cols: 8; --gap: 14px; --row: 120px; --cell: 120px; --rows: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), var(--row)); grid-auto-rows: var(--row); gap: var(--gap); margin-top: 1.4rem; position: relative; animation: hubIn .55s var(--smooth) both; }
.hub.editing .hgrid { background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 26%, transparent) 1.6px, transparent 2.2px); background-size: calc((100% + var(--gap)) / var(--cols)) calc(var(--row) + var(--gap)); background-position: calc(var(--gap) / -2) calc(var(--gap) / -2); }

.gi { position: relative; min-width: 0; min-height: 0; }
.gi > .tile { height: 100%; display: flex; align-items: center; justify-content: center; }
.gi .tile-link { max-width: 100%; }
.gi .tile-icon { width: clamp(50px, calc(var(--cell) * .68), 88px); height: clamp(50px, calc(var(--cell) * .68), 88px); font-size: clamp(1.5rem, calc(var(--cell) * .4), 2.7rem); border-radius: 28%; }
.gi .tile-fav { top: 2px; right: 4px; }
.gi .widget { height: 100%; min-width: 0; overflow: hidden; }
.hub.editing .gi { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.hub.editing .gi.icon { animation: wiggle .3s ease-in-out infinite alternate; }
.gi.dragging { opacity: .35; outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 24px; animation: none !important; }
.gi.into .tile-icon { transform: scale(1.18); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent), inset 1.5px 1.5px 1px var(--glass-hi); }
.gi-del { position: absolute; top: 2px; left: 2px; z-index: 4; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 99px; border: 2px solid rgba(255, 255, 255, .5); background: var(--danger); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.gi-resize { position: absolute; right: 6px; bottom: 6px; z-index: 4; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; cursor: nwse-resize; touch-action: none; font-size: .85rem; color: var(--text); background: var(--glass-bg); border: 1px solid var(--glass-border); }
.gi-ghost { position: fixed; z-index: 300; display: grid; place-items: center; font-size: 2.4rem; border-radius: 24px; pointer-events: none; opacity: .88; transform: rotate(2deg) scale(1.03); background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 1.5px 1.5px 1px var(--glass-hi); }

.widget-head { min-width: 0; } .widget-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-dock { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: .55rem .4rem; align-content: start; flex: 1; min-height: 0; overflow: hidden; }
.mini { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 0; color: var(--text); text-align: center; }
.mini:hover { text-decoration: none; }
.mini-ico { position: relative; display: grid; place-items: center; width: 52px; height: 52px; font-size: 1.6rem; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--app-color, var(--accent)) 34%, var(--glass-bg)), var(--glass-bg)); border: 1px solid color-mix(in srgb, var(--app-color, var(--accent)) 30%, var(--glass-border)); transition: transform .3s var(--spring); }
.mini:hover .mini-ico { transform: translateY(-2px) scale(1.06); }
.mini-name { max-width: 100%; font-size: .72rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pal { width: min(100%, 580px); }
.pal .hub-title { margin-top: .4rem; }
.pal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.pal-item { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 16px; text-align: left; font: inherit; color: var(--text); cursor: pointer; background: var(--glass-bg); border: 1px solid var(--glass-border); }
.pal-item:disabled { opacity: .45; cursor: default; }
.pal-item .pi { font-size: 1.4rem; line-height: 1; }
.pal-item small { display: block; color: var(--muted); font-size: .74rem; }
.pal-item em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .8rem; }
@media (max-width: 640px) { .hub-head-row { align-items: center; } .gi-ghost { font-size: 2rem; } }

/* ===== v5 : accès par app (admin) ===== */
details.access { border-top: 1px solid var(--border); padding-top: .8rem; }
details.access > summary { cursor: pointer; }
details.access[open] > summary { margin-bottom: .7rem; }
.access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem 1rem; max-height: 280px; overflow: auto; padding: .2rem; }
.access-list .check { flex-wrap: wrap; }

/* v6.1 : aperçu de dossier dans la grille (petits emojis dans l'icône) + noms longs */
.gi .tile-icon.folder-icon { font-size: clamp(.95rem, calc(var(--cell) * .17), 1.25rem); padding: 10px; gap: 3px; }
.gi .tile-link { padding: .3rem 0; }
.gi .tile-name { font-size: .8rem; }
