:root {
  color-scheme: light;
  --page: #e9ecf4;
  --surface: #ffffff;
  --surface-soft: #fafaff;
  --ink: #202337;
  --muted: #73788d;
  --line: #d9dceb;
  --button-line: #bdb8e5;
  --primary: #6558d3;
  --primary-hover: #5548c3;
  --primary-soft: #efedff;
  --mint: #c8f3e4;
  --shadow: 0 14px 40px rgba(47, 46, 86, .07);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #191a27;
  --surface: #222432;
  --surface-soft: #292a3a;
  --ink: #f5f4ff;
  --muted: #b2b2c4;
  --line: #44465b;
  --button-line: #716b9d;
  --primary: #a89fff;
  --primary-hover: #b9b2ff;
  --primary-soft: #383454;
  --mint: #355b52;
  --shadow: 0 14px 40px rgba(0, 0, 0, .18);
}

:root[data-palette="green"] { --primary: #1e5b4f; --primary-hover: #17483f; --primary-soft: #e6f3ed; --button-line: #a9cabe; }
:root[data-palette="blue"] { --primary: #3e63b8; --primary-hover: #2e4b91; --primary-soft: #eaf0ff; --button-line: #afc1e9; }
:root[data-palette="terracotta"] { --primary: #a6533b; --primary-hover: #87422f; --primary-soft: #f7ece7; --button-line: #d9b4a7; }
:root[data-theme="dark"][data-palette="green"] { --primary: #67b596; --primary-hover: #81c9aa; --primary-soft: #253d32; --button-line: #507a67; }
:root[data-theme="dark"][data-palette="violet"] { --primary: #a89fff; --primary-hover: #b9b2ff; --primary-soft: #383454; --button-line: #716b9d; }
:root[data-theme="dark"][data-palette="blue"] { --primary: #91b2ff; --primary-hover: #b0c7ff; --primary-soft: #293754; --button-line: #627ba9; }
:root[data-theme="dark"][data-palette="terracotta"] { --primary: #ed9b7d; --primary-hover: #ffc0a8; --primary-soft: #49312d; --button-line: #a26958; }

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--page); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  transition: background-color .2s ease, color .2s ease;
}

button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 62%, transparent); outline-offset: 3px; }
svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; padding-bottom: calc(84px + var(--safe-bottom)); }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: var(--primary-soft); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: max-content; }
.brand img { width: 42px; height: 42px; border-radius: 14px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: -.02em; }
.brand-copy small { color: var(--muted); font-size: 12px; }
.desktop-nav { display: none; align-items: center; gap: 6px; }
.nav-link { min-height: 42px; border: 0; border-radius: 12px; padding: 0 15px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 600; }
.nav-link:hover, .nav-link.is-active { color: var(--primary); background: var(--primary-soft); }
.header-install { display: none !important; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-logout { display: none; }

.auth-body { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: 28px 18px; }
.auth-page { width: min(100%, 470px); margin: 0 auto; }
.login-brand { margin: 0 0 22px 5px; }
.login-card { padding: clamp(25px, 7vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.login-mark { display: inline-flex; margin-bottom: 22px; }
.login-mark img { width: 48px; height: 48px; border-radius: 15px; }
.login-card h1 { margin-bottom: 9px; font-size: clamp(30px, 8vw, 38px); }
.login-intro { margin-bottom: 25px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 8px; font-size: 13px; font-weight: 700; }
.login-form input:not([type="hidden"]) { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 13px; padding: 0 14px; color: var(--ink); background: var(--surface); font: inherit; }
.login-form input:focus { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.login-submit { width: 100%; margin-top: 16px; }
.login-error { margin: 0 0 18px; border: 1px solid #e6aaaa; border-radius: 12px; padding: 12px 14px; color: #8c2828; background: #fff1f1; font-size: 13px; }
:root[data-theme="dark"] .login-error { border-color: #805050; color: #ffc5c5; background: #432c32; }
.login-note { margin: 21px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

main { width: min(100% - 40px, 1080px); margin: 0 auto; padding: 38px 0 30px; }
.view { animation: enter .24s ease both; }
.welcome-row { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin: 6px 0 26px; }
.eyebrow { margin: 0 0 9px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 10px; font-size: clamp(30px, 8vw, 46px); line-height: 1.1; letter-spacing: -.052em; }
.intro { max-width: 600px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.network-status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #32b57d; box-shadow: 0 0 0 3px rgba(50, 181, 125, .12); }
.is-offline .status-dot { background: #e2a33e; box-shadow: 0 0 0 3px rgba(226, 163, 62, .14); }

.hero-card { position: relative; min-height: 280px; overflow: hidden; display: flex; align-items: center; border-radius: 25px; padding: 30px 26px; background: linear-gradient(115deg, #eeedff 0%, #f5f4ff 62%, #e9f8f3 100%); box-shadow: var(--shadow); }
:root[data-theme="dark"] .hero-card { background: linear-gradient(115deg, #302d4b 0%, #302e43 62%, #263c39 100%); }
.hero-copy { position: relative; z-index: 1; max-width: 580px; }
.hero-kicker { display: inline-block; margin-bottom: 13px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.hero-card h2 { max-width: 480px; margin-bottom: 10px; font-size: clamp(24px, 6vw, 34px); line-height: 1.17; letter-spacing: -.04em; }
.hero-card p { max-width: 470px; margin-bottom: 21px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 14px; padding: 0 17px; cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .16s ease, background-color .16s ease, border-color .16s ease; }
.button:active { transform: scale(.98); }
.button svg { width: 18px; height: 18px; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 22%, transparent); }
:root[data-theme="dark"] .button-primary { color: #191a27; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary, .button-quiet { color: var(--primary); border-color: var(--button-line); background: var(--surface); }
.button-secondary:hover, .button-quiet:hover { border-color: var(--primary); background: var(--primary-soft); }
.button-quiet { min-height: 42px; background: var(--primary-soft); }
.button:disabled { opacity: .7; cursor: default; }
.hero-art { position: absolute; right: 4%; top: 50%; width: 220px; height: 220px; transform: translateY(-50%); }
.art-orbit { position: absolute; inset: 14px; border: 1px solid rgba(101, 88, 211, .15); border-radius: 50%; }
.orbit-two { inset: 38px; border-color: rgba(101, 88, 211, .12); }
.art-tile { position: absolute; top: 50%; left: 50%; width: 94px; height: 94px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.75); border-radius: 28px; color: #fff; background: linear-gradient(145deg, #8379e8, #6558d3); box-shadow: 0 20px 38px rgba(72, 63, 158, .23); transform: translate(-50%, -50%) rotate(-8deg); }
.art-tile svg { width: 48px; height: 48px; stroke: #fff; stroke-width: 2.8; }
.art-spark { position: absolute; color: #877be2; font-size: 34px; }
.spark-one { top: 17px; right: 29px; }
.spark-two { bottom: 20px; left: 11px; color: #58b897; font-size: 62px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.section-note { color: var(--muted); font-size: 12px; }
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.feature-card { min-height: 175px; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 14px; }
.feature-icon svg { width: 20px; height: 20px; }
.icon-violet { color: var(--primary); background: var(--primary-soft); }
.icon-mint { color: #279675; background: #e4f8f0; }
.icon-peach { color: #cb8055; background: #fff0e6; }
:root[data-theme="dark"] .icon-mint { background: #254139; color: #7ed7b8; }
:root[data-theme="dark"] .icon-peach { background: #4c3930; color: #efb28f; }
.feature-card h3 { margin-bottom: 7px; font-size: 14px; letter-spacing: -.02em; }
.feature-card p { max-width: 290px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.page-heading { margin: 6px 0 25px; }
.empty-card { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; color: var(--primary); background: var(--primary-soft); }
.empty-icon svg { width: 26px; height: 26px; }
.empty-card h2 { margin-bottom: 8px; font-size: 20px; }
.empty-card p { max-width: 500px; margin-bottom: 19px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.setting-row { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row h2 { margin-bottom: 5px; font-size: 15px; }
.setting-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.setting-badge { align-self: flex-start; padding: 7px 10px; border-radius: 20px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 700; }
.switch-control { position: relative; display: inline-flex; flex: 0 0 auto; width: 50px; height: 28px; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 18px; background: #d7dfda; cursor: pointer; transition: background .2s; }
.switch-track::before { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0002; content: ""; transition: transform .2s; }
.switch-control input:checked + .switch-track { background: var(--primary); }
.switch-control input:checked + .switch-track::before { transform: translateX(22px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid #7abda0; }
:root[data-theme="dark"] .switch-track { background: #4d6056; }
:root[data-theme="dark"] .switch-control input:checked + .switch-track { background: var(--primary); }
.font-stepper { display: flex; align-items: center; gap: 12px; }
.font-stepper strong { min-width: 72px; color: var(--ink); text-align: center; font-size: 13px; }
.font-step { width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.palette-select { min-width: 150px; min-height: 46px; border: 1px solid var(--button-line); border-radius: 12px; padding: 0 38px 0 13px; color: var(--ink); background: var(--surface); font: inherit; }
.palette-select:focus-visible { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.settings-hint { margin: 15px 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; width: min(100% - 40px, 1080px); margin: 0 auto; padding: 14px 0 20px; color: var(--muted); font-size: 11px; }
.mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(2, 1fr); padding: 8px 16px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -8px 24px rgba(37, 38, 59, .06); }
.mobile-nav-link { min-width: 0; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 14px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 650; }
.mobile-nav-link svg { width: 21px; height: 21px; }
.mobile-nav-link.is-active { color: var(--primary); background: var(--primary-soft); }

@keyframes enter { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (min-width: 640px) {
  .app-shell { padding-bottom: 0; }
  main { width: min(100% - 64px, 1080px); padding-top: 48px; }
  .welcome-row { flex-direction: row; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .feature-card { min-height: 190px; padding: 22px; }
  .setting-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 25px; }
  .setting-row > div { max-width: 65%; }
  .setting-badge { align-self: auto; }
  .page-footer { width: min(100% - 64px, 1080px); }
}

@media (min-width: 900px) {
  .topbar { height: 82px; }
  .desktop-nav { display: flex; }
  .header-install { display: inline-flex !important; }
  .header-logout { display: block; }
  .mobile-nav { display: none; }
  main { min-height: calc(100vh - 138px); padding-top: 57px; }
  .welcome-row { margin-bottom: 32px; }
  .hero-card { min-height: 310px; padding: 42px 48px; }
  .hero-art { right: 8%; width: 260px; height: 260px; }
  .art-tile { width: 112px; height: 112px; border-radius: 32px; }
  .section-heading { margin-top: 43px; }
  .section-note { font-size: 13px; }
  .page-footer { padding-top: 17px; }
}

@media (max-width: 520px) {
  .topbar { height: 68px; padding: 0 20px; }
  .brand img { width: 38px; height: 38px; border-radius: 13px; }
  .brand-copy small { font-size: 11px; }
  main { width: min(100% - 36px, 1080px); padding-top: 30px; }
  .hero-card { min-height: 340px; align-items: flex-start; padding: 25px 22px; }
  .hero-copy { max-width: 100%; }
  .hero-card p { max-width: 330px; }
  .hero-art { top: auto; right: 7px; bottom: -90px; width: 180px; height: 180px; transform: none; opacity: .45; }
  .art-tile { width: 75px; height: 75px; border-radius: 23px; }
  .art-tile svg { width: 38px; height: 38px; }
  .section-heading { align-items: flex-start; flex-direction: column; margin-top: 28px; }
  .feature-grid { gap: 10px; }
  .feature-card { min-height: auto; padding: 17px; }
  .feature-icon { width: 38px; height: 38px; margin-bottom: 12px; }
  .page-footer { width: min(100% - 36px, 1080px); padding-bottom: 16px; }
}

/* Blocs de l’accueil, avec les couleurs et réglages de Base. */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.dashboard-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dashboard-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.dashboard-heading .setting-badge { flex-shrink: 0; }
.dashboard-links, .extension-list { list-style: none; padding: 0; margin: 0; }
.link-icon-library { position: absolute; overflow: hidden; pointer-events: none; }
.dashboard-link-group .dashboard-heading { gap: 12px; margin-bottom: 22px; }
.group-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border: 1px solid var(--button-line); border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.group-icon svg { width: 20px; height: 20px; }
.group-heading-copy { flex: 1; min-width: 0; }
.group-heading-copy p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.dashboard-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.dashboard-links li { min-width: 0; }
.shortcut { display: flex; align-items: center; gap: 13px; min-height: 80px; height: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface-soft); text-decoration: none; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.shortcut-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.shortcut-icon svg { width: 23px; height: 23px; }
.shortcut-copy { display: grid; flex: 1; min-width: 0; gap: 6px; }
.shortcut-copy strong { font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.shortcut-arrow { flex: 0 0 17px; width: 17px; height: 17px; color: var(--muted); transition: color .18s ease, transform .18s ease; }
.shortcut:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.shortcut:active { transform: scale(.98); }
[data-group="favoris-title"] { background: linear-gradient(135deg, var(--primary-soft), var(--surface) 65%); border-color: var(--button-line); }
[data-group="favoris-title"] .dashboard-links { gap: 18px; }
[data-group="favoris-title"] .shortcut { background: var(--surface); }
.shortcut-icon[data-icon="clock"] { color: #946018; background: #fff1d6; }
.shortcut-icon[data-icon="wallet"] { color: #247c60; background: #e1f5eb; }
.shortcut-icon[data-icon="cart"] { color: #3863ae; background: #e8efff; }
.shortcut-icon[data-icon="play"] { color: #ae6530; background: #fff0de; }
:root[data-theme="dark"] .shortcut-icon[data-icon="clock"] { color: #f3c679; background: #463a26; }
:root[data-theme="dark"] .shortcut-icon[data-icon="wallet"] { color: #8ad6b5; background: #264037; }
:root[data-theme="dark"] .shortcut-icon[data-icon="cart"] { color: #a4c2ff; background: #2c3853; }
:root[data-theme="dark"] .shortcut-icon[data-icon="play"] { color: #f0b782; background: #483729; }
@media (hover: hover) {
  .shortcut:hover { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 10%, transparent); transform: translateY(-2px); }
  .shortcut:hover .shortcut-arrow { color: var(--primary); transform: translate(2px, -2px); }
}
@media (min-width: 600px) and (max-width: 899px) { .dashboard-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  [data-group="favoris-title"] { grid-column: 1 / -1; padding: 26px; }
  [data-group="favoris-title"] .dashboard-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  [data-group="favoris-title"] .shortcut { position: relative; flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px 16px; min-height: 160px; }
  [data-group="favoris-title"] .shortcut-icon { flex-basis: auto; width: 48px; height: 48px; border-radius: 15px; }
  [data-group="favoris-title"] .shortcut-arrow { position: absolute; right: 14px; top: 17px; }
  [data-group="favoris-title"] .shortcut-copy { flex: initial; }
  [data-group="favoris-title"] .shortcut-copy strong { font-size: 16px; }
}
.dashboard-note { color: var(--muted); line-height: 1.6; margin: 0; }
.server-info { margin: 0; }
.server-info > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.server-info dt { color: var(--muted); font-size: 14px; }
.server-info dd { margin: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.extension-list { display: flex; flex-wrap: wrap; gap: 8px; }
.extension-list li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-soft); font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

@media (min-width: 640px) and (max-width: 899px) { .app-shell { padding-bottom: calc(84px + var(--safe-bottom)); } }

/* Accès direct aux six rubriques de l’accueil. */
html { scroll-behavior: smooth; }
.block-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 20px; margin: 0 0 36px; }
.block-shortcuts button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 10px; border: 1px solid var(--button-line); border-radius: 14px; color: #fff; background: var(--primary); box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 70%, #000), 0 7px 14px color-mix(in srgb, var(--primary) 18%, transparent); font-size: 12px; font-weight: 700; line-height: 1.4; cursor: pointer; transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.block-shortcuts svg { flex: 0 0 18px; width: 18px; height: 18px; }
.block-shortcuts button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.block-shortcuts button:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 70%, #000); }
:root[data-theme="dark"] .block-shortcuts button { color: var(--page); }
.dashboard-card h2[id] { scroll-margin-top: 24px; }
@media (min-width: 600px) { .block-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .block-shortcuts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

@media (min-width: 1100px) {
  [data-group="favoris-title"] .dashboard-links { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Les logos fournis sont rectangulaires : conserver leurs proportions. */
.brand img[data-theme-logo] { width: 64px; height: 44px; object-fit: contain; border-radius: 0; }
.login-mark img[data-theme-logo] { width: 80px; height: 55px; object-fit: contain; border-radius: 0; }

/* Barre du logo : fond doux le jour, variante de couleur la nuit. */
.topbar .nav-link:hover, .topbar .nav-link.is-active { background: var(--surface); }
:root[data-theme="dark"] .topbar { background: var(--primary); color: #191a27; border-bottom-color: var(--primary); }
:root[data-theme="dark"] .topbar .brand-copy small { color: #303447; }
:root[data-theme="dark"] .topbar .nav-link { color: #191a27; }
:root[data-theme="dark"] .topbar .nav-link:hover,
:root[data-theme="dark"] .topbar .nav-link.is-active { color: var(--primary); background: #191a27; }
:root[data-theme="dark"] .topbar :focus-visible { outline-color: #191a27; }

/* Même bouton Retour en haut que Notes, adapté au défilement du portail. */
.back-to-top { position: fixed; z-index: 8; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; place-items: center; width: 47px; height: 47px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--primary); box-shadow: 0 5px 18px #23233c38; font-size: 25px; line-height: 1; cursor: pointer; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.back-to-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
@media (max-width: 700px) {
  .app-shell .back-to-top { right: 15px; bottom: calc(137px + env(safe-area-inset-bottom, 0px)); width: 43px; height: 43px; }
}
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }
@media print { .back-to-top { display: none !important; } }
