/* ==========================================================================
   L2 — admin stylesheet
   Rounded, light, pastel, airy. Light theme only (v1).
   Sections:
     1. Tokens          2. Reset & base        3. Layout shells
     4. Typography      5. Buttons             6. Forms
     7. Cards & pills   8. Site cards          9. Tabs
    10. Tables         11. Alerts & toasts    12. Modal & drawer
    13. Drop zone      14. Code block         15. Empty state
    16. Site hero/QR   17. Stats/sparkline    18. Misc (avatar, kbd, tree…)
    19. Utilities      20. Motion & a11y      21. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --surface-2: #F4F2EE;            /* subtle inset surfaces (input groups, table heads) */
  --ink: #1F2330;
  --ink-2: #6B7080;
  --ink-3: #9AA0AE;                /* placeholders, disabled */
  --line: #ECE9E4;
  --line-strong: #DED9D1;

  --lavender: #CDB9F6;
  --mint: #BFEAD7;
  --peach: #FFD3B6;
  --sky: #BFDDF6;
  --butter: #FBE7A1;
  --rose: #F8C8D4;

  /* 40 % tints for washes and hovers */
  --lavender-soft: #EFE8FC;
  --mint-soft: #E8F7F0;
  --peach-soft: #FFEEE2;
  --sky-soft: #E8F2FC;
  --butter-soft: #FDF5D9;
  --rose-soft: #FCEAEE;

  --accent: #7C6AE0;
  --accent-hover: #6B59CF;
  --accent-text: #5B4BC4;          /* accent used as text on white: 6.5:1 */
  --on-accent: #FFFFFF;
  --danger-text: #9B2C3B;          /* on rose: 5.0:1 */
  --success-text: #1E6B4E;
  --warning-text: #7A5A08;

  --ring: 0 0 0 3px rgba(124, 106, 224, .35);
  --ring-danger: 0 0 0 3px rgba(155, 44, 59, .25);

  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(31, 35, 48, .04), 0 2px 8px rgba(31, 35, 48, .04);
  --shadow: 0 1px 2px rgba(31, 35, 48, .04), 0 8px 24px rgba(31, 35, 48, .06);
  --shadow-lg: 0 2px 4px rgba(31, 35, 48, .05), 0 16px 48px rgba(31, 35, 48, .10);
  --shadow-hover: 0 2px 4px rgba(31, 35, 48, .05), 0 14px 34px rgba(31, 35, 48, .10);

  --font: ui-sans-serif, -apple-system, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 180ms;
  --dur-fast: 120ms;

  --content-max: 1360px;
  --content-max-wide: 1880px; /* site page: the editors want room on large screens */
  --topbar-h: 64px;
}

/* 2. Reset & base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
::selection { background: var(--lavender); color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* 3. Layout shells --------------------------------------------------------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 247, .85);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-5);
  min-height: var(--topbar-h);
  /* Three tracks so the nav sits in the true centre whatever the brand/actions widths. */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-5);
}
.topbar__inner--wide { max-width: var(--content-max-wide); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.01em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__tile {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--lavender), var(--sky));
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(31,35,48,.08);
}
.brand__logo { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.auth-card .brand__logo { width: 48px; height: 48px; border-radius: 15px; }
.nav { display: flex; align-items: center; justify-content: center; gap: var(--space-1); }
.nav__link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: var(--r-pill); color: var(--ink-2); font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav__link[aria-current="page"] { background: var(--lavender-soft); color: var(--accent-text); }
.topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }
/* Search box sitting in a page header next to the primary action. */
.search--header { width: 280px; max-width: 100%; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 4px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: var(--fs-sm); font-weight: 500;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.user-chip:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }

.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-5); }
.main { flex: 1; padding: var(--space-6) 0 var(--space-8); }
.main--narrow .container { max-width: 860px; }
.main--wide .container { max-width: var(--content-max-wide); }
/* Inside a wide page, keep forms and lists at the regular width (left-aligned, like the tabs). */
.panel--capped { max-width: var(--content-max); }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap; margin-bottom: var(--space-5);
}
.page-header__eyebrow { color: var(--ink-2); font-size: var(--fs-sm); margin: 0 0 4px; }
.page-header h1 { margin: 0; }
.page-header__actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }

/* Auth shell: centered card on a soft gradient wash */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: var(--space-5);
  background:
    radial-gradient(60% 50% at 10% 0%, var(--lavender-soft), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, var(--sky-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-6) var(--space-6) var(--space-5);
}
.auth-card .brand { justify-content: center; width: 100%; margin-bottom: var(--space-5); }
.auth-card .brand__tile { width: 44px; height: 44px; border-radius: 14px; font-size: 17px; }
.auth-card h1 { font-size: var(--fs-xl); text-align: center; margin: 0 0 var(--space-2); }
.auth-card__lead { text-align: center; color: var(--ink-2); margin: 0 0 var(--space-5); }
.auth-card__foot { text-align: center; color: var(--ink-3); font-size: var(--fs-xs); margin-top: var(--space-5); }

/* 4. Typography ------------------------------------------------------------ */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 var(--space-3); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--space-3); }
.lead { font-size: var(--fs-lg); color: var(--ink-2); }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.mono { font-family: var(--mono); font-size: .93em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-4);
}
.section-title h2 { margin: 0; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2);
}

/* 5. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-md); line-height: 1; white-space: nowrap;
  text-decoration: none; user-select: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn:focus-visible { box-shadow: var(--ring); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(124,106,224,.25), inset 0 1px 0 rgba(255,255,255,.18); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(124,106,224,.30), inset 0 1px 0 rgba(255,255,255,.18); }

.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { border-color: #CFC9BF; background: #FFFFFF; box-shadow: var(--shadow); }

.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger { background: var(--rose); color: var(--danger-text); }
.btn--danger:hover { background: #F5B7C6; }
.btn--danger:focus-visible { box-shadow: var(--ring-danger); }

.btn--soft { background: var(--lavender-soft); color: var(--accent-text); }
.btn--soft:hover { background: #E4DAFA; }

.btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); border-radius: 10px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: var(--fs-lg); border-radius: 14px; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent;
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { border-color: var(--ink-2) var(--ink-2) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }

/* 6. Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field__label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.field__label .optional { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.field__hint { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; }
.field__error { font-size: var(--fs-sm); color: var(--danger-text); margin: 0; }
.field__success { font-size: var(--fs-sm); color: var(--success-text); margin: 0; }
.field--inline { flex-direction: row; align-items: center; gap: var(--space-3); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }

.input, .textarea, .select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  color: var(--ink); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .textarea:hover, .select:hover { border-color: #CFC9BF; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: #E38FA1; }
.input[aria-invalid="true"]:focus { box-shadow: var(--ring-danger); }
.input--mono, .textarea--mono { font-family: var(--mono); font-size: 13.5px; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.textarea--code { min-height: 320px; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto; }
.select {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%236B7080' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* Input group: input + prefix/suffix addon (e.g. ".comets.page") */
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; position: relative; z-index: 1; }
.input-group .input:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .input:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-group__addon {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2);
  font-size: var(--fs-sm); white-space: nowrap;
}
.input-group__addon:first-child { border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group__addon:last-child { border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Input wrap: input with an inline trailing button (password toggle, copy, status) */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 44px; }
.input-wrap__trail {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.input-wrap__trail:hover { background: var(--surface-2); color: var(--ink); }
.input-wrap__trail svg { width: 18px; height: 18px; }
.input-wrap__status { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; }
.input-wrap__status--ok { color: var(--success-text); }
.input-wrap__status--ko { color: var(--danger-text); }

/* Checkbox / radio */
.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-md); }
.checkbox input { appearance: none; width: 20px; height: 20px; margin: 2px 0 0; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: grid; place-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.checkbox input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--dur-fast) var(--ease); }
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.checkbox input:focus-visible { box-shadow: var(--ring); }
.checkbox__text { display: flex; flex-direction: column; gap: 2px; }
.checkbox__text .field__hint { margin: 0; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: var(--r-pill); margin: 0; flex: none;
  background: var(--line-strong); position: relative; transition: background var(--dur) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(31,35,48,.25); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { box-shadow: var(--ring); }
.switch__text { display: flex; flex-direction: column; gap: 2px; }
.switch__text .field__hint { margin: 0; }

.form-actions { display: flex; gap: var(--space-3); align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: var(--space-5); }
.form-actions--start { justify-content: flex-start; }
.form-actions--between { justify-content: space-between; }

/* Search box */
.search { position: relative; }
.search .input { padding-left: 38px; border-radius: var(--r-pill); }
.search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 17px; height: 17px; pointer-events: none; }

/* 7. Cards & pills --------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: var(--space-5) 28px;
  border: 1px solid rgba(31,35,48,.03);
}
.card--flush { padding: 0; overflow: hidden; }
.card--hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card--wash-lavender { background: linear-gradient(180deg, var(--lavender-soft), var(--surface) 60%); }
.card--wash-mint { background: linear-gradient(180deg, var(--mint-soft), var(--surface) 60%); }
.card--wash-sky { background: linear-gradient(180deg, var(--sky-soft), var(--surface) 60%); }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card__title { margin: 0; font-size: var(--fs-lg); }
.card__subtitle { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.card__body { }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.card__section { padding: var(--space-5) 28px; }
.card__section + .card__section { border-top: 1px solid var(--line); }
.card + .card { margin-top: var(--space-4); }
.card-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .01em; color: var(--ink);
  background: var(--surface-2); white-space: nowrap; line-height: 1;
}
.pill svg { width: 12px; height: 12px; }
.pill--sm { height: 22px; padding: 0 9px; font-size: 11px; }
.pill--mint { background: var(--mint); }
.pill--rose { background: var(--rose); }
.pill--butter { background: var(--butter); }
.pill--lavender { background: var(--lavender); }
.pill--peach { background: var(--peach); }
.pill--sky { background: var(--sky); }
.pill--outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill--mint .pill__dot { background: #2E9E6E; opacity: 1; }
.pill--rose .pill__dot { background: #D2536B; opacity: 1; }
.pill--butter .pill__dot { background: #D3A21C; opacity: 1; }
.pill--lavender .pill__dot { background: var(--accent); opacity: 1; }
.pill--peach .pill__dot { background: #E5813A; opacity: 1; }
.pill--sky .pill__dot { background: #3F87CC; opacity: 1; }
/* Semantic aliases (status → color) */
.pill--active { background: var(--mint); }
.pill--disabled { background: var(--rose); }
.pill--pending { background: var(--butter); }
.pill--password { background: var(--lavender); }
.pill--expiring { background: var(--peach); }
.pill--error { background: var(--rose); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Count badge (tabs, nav) */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; }

/* 8. Site cards (dashboard) ------------------------------------------------ */
.site-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.site-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 22px 24px 20px; border: 1px solid rgba(31,35,48,.03);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.site-card:focus-within { box-shadow: var(--shadow-hover); }
.site-card--disabled { background: linear-gradient(180deg, var(--surface), #FCFAF8); }
.site-card--disabled .site-card__title, .site-card--disabled .site-card__host { color: var(--ink-2); }
.site-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.site-card__top > .row { flex: 1; min-width: 0; align-items: flex-start; }
.site-card__top > .row > div:not(.site-card__icon) { flex: 1; min-width: 0; }
.site-card__icon {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: var(--fs-lg); color: var(--ink);
  background: var(--lavender-soft);
}
.site-card__icon--mint { background: var(--mint-soft); }
.site-card__icon--peach { background: var(--peach-soft); }
.site-card__icon--sky { background: var(--sky-soft); }
.site-card__icon--butter { background: var(--butter-soft); }
.site-card__icon--rose { background: var(--rose-soft); }
.site-card__icon--lavender { background: var(--lavender-soft); }
/* Uploaded favicon: white plate so a transparent icon stays readable. */
.site-card__icon--img { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.site-card__icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: contain; padding: 5px; }
.site-card__icon--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; }
.site-card__icon--lg img { padding: 7px; }

/* Réglages → Icône */
.favicon-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.favicon-row__body { min-width: 220px; flex: 1; }
.favicon-row .field__hint { margin-bottom: 0; }

/* « Partage » card: upload controls + the share preview (how the link unfurls in a messaging app) */
.share-row { display: flex; align-items: flex-start; gap: var(--space-5); flex-wrap: wrap; }
.share-row__body { min-width: 220px; flex: 1; }
.share-row .field__hint { margin-bottom: 0; }
.share-card {
  width: 100%; max-width: 400px; flex: 0 1 400px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.share-card__media {
  position: relative; aspect-ratio: 1.91 / 1;
  background: linear-gradient(135deg, var(--lavender-soft), var(--surface-2) 55%, var(--sky-soft));
  border-bottom: 1px solid var(--line);
}
.share-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.share-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.share-card__body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; min-width: 0; }
.share-card__host { font-size: var(--fs-xs); color: var(--ink-2); font-variant-caps: all-small-caps; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-card__title { font-weight: 600; font-size: var(--fs-md); color: var(--ink); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.share-card__desc { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.site-card__title { margin: 0; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.site-card__title a { color: inherit; }
.site-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* stretched link */
.site-card__title a:focus-visible { box-shadow: none; }
.site-card__title a:focus-visible::after { box-shadow: var(--ring); border-radius: var(--r-lg); }
.site-card__host { display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: var(--fs-sm); color: var(--ink-2); font-family: var(--mono); position: relative; z-index: 1; }
.site-card__host a { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card__host a:hover { color: var(--accent-text); }
.site-card__host svg { width: 13px; height: 13px; }
.site-card__pills { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.site-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.site-card__meta strong { color: var(--ink); font-weight: 600; }
.site-card__meta .meta { display: inline-flex; align-items: center; gap: 6px; }
.site-card__meta svg { width: 14px; height: 14px; color: var(--ink-3); }
.site-card__menu { position: relative; z-index: 5; }
.site-card:has(.menu__list:not([hidden])) { z-index: 10; } /* open menu above sibling cards */

/* 9. Tabs ------------------------------------------------------------------ */
.tabs { }
.tabs__list {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 var(--space-5);
  background: var(--surface-2); border-radius: var(--r-md); max-width: 100%; overflow-x: auto;
}
.tabs__list--full { display: flex; }
.tabs__list--full .tab { flex: 1; }
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .badge { background: var(--line); }
.tab[aria-selected="true"] .badge { background: var(--lavender-soft); color: var(--accent-text); }
.tab svg { width: 16px; height: 16px; }
.tab-panel[hidden] { display: none; }
/* Underline variant */
.tabs--line .tabs__list { background: transparent; border-radius: 0; padding: 0; gap: var(--space-4); border-bottom: 1px solid var(--line); }
.tabs--line .tab { border-radius: 0; height: 44px; padding: 0 4px; position: relative; }
.tabs--line .tab[aria-selected="true"] { background: transparent; box-shadow: none; }
.tabs--line .tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* 10. Tables --------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); border: 1px solid rgba(31,35,48,.03); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; }
.table th { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); }
.table th:first-child { padding-left: 24px; }
.table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr { border-top: 1px solid var(--line); transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: #FCFBF9; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .row-title { font-weight: 600; color: var(--ink); font-size: var(--fs-md); }
.table .row-sub { color: var(--ink-2); font-size: var(--fs-xs); }
.table--plain { box-shadow: none; }

/* 11. Alerts & toasts ------------------------------------------------------ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.5;
  background: var(--sky-soft); color: var(--ink); border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert__body { flex: 1; }
.alert__title { font-weight: 600; margin: 0 0 2px; }
.alert p { margin: 0; }
.alert__close { margin: -4px -6px -4px 0; border: 0; background: transparent; color: var(--ink-2); width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; }
.alert__close:hover { background: rgba(31,35,48,.06); color: var(--ink); }
.alert--info { background: var(--sky-soft); }
.alert--success { background: var(--mint-soft); }
.alert--success svg { color: var(--success-text); }
.alert--warning { background: var(--butter-soft); }
.alert--warning svg { color: var(--warning-text); }
.alert--error { background: var(--rose-soft); }
.alert--error svg { color: var(--danger-text); }
.alert.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }

.toast-region {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none; max-width: min(420px, calc(100vw - 40px));
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px;
  min-width: 260px; max-width: 100%; padding: 14px 14px 14px 16px;
  background: var(--ink); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); line-height: 1.45;
  animation: toast-in var(--dur) var(--ease) both;
  border-left: 4px solid var(--sky);
}
.toast--success { border-left-color: var(--mint); }
.toast--error { border-left-color: var(--rose); }
.toast--warning { border-left-color: var(--butter); }
.toast--info { border-left-color: var(--sky); }
.toast__icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast--success .toast__icon { color: var(--mint); }
.toast--error .toast__icon { color: var(--rose); }
.toast--warning .toast__icon { color: var(--butter); }
.toast--info .toast__icon { color: var(--sky); }
.toast__body { flex: 1; }
.toast__title { font-weight: 600; display: block; }
.toast__action { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: var(--r-sm); padding: 6px 10px; font-weight: 600; font-size: var(--fs-xs); }
.toast__action:hover { background: rgba(255,255,255,.2); }
.toast__close { background: transparent; border: 0; color: rgba(255,255,255,.65); width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; margin: -4px -4px -4px 0; }
.toast__close:hover { background: rgba(255,255,255,.12); color: #fff; }
.toast__close svg { width: 14px; height: 14px; }
.toast.is-leaving { animation: toast-out var(--dur) var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* 12. Modal & drawer ------------------------------------------------------- */
.modal-backdrop, .drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(31,35,48,.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: var(--space-5);
  animation: fade-in var(--dur) var(--ease) both;
}
.modal-backdrop[hidden], .drawer-backdrop[hidden] { display: none; }
.modal-backdrop.is-leaving, .drawer-backdrop.is-leaving { animation: fade-out var(--dur) var(--ease) both; }
.modal {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 28px; animation: pop-in var(--dur) var(--ease) both; outline: none;
}
.modal--wide { max-width: 640px; }
.modal__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; background: var(--lavender-soft); color: var(--accent-text); }
.modal__icon svg { width: 22px; height: 22px; }
.modal--danger .modal__icon { background: var(--rose-soft); color: var(--danger-text); }
.modal__title { margin: 0 0 8px; font-size: var(--fs-xl); }
.modal__text { margin: 0; color: var(--ink-2); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: 24px; flex-wrap: wrap; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal { position: relative; }

.drawer-backdrop { justify-content: flex-end; padding: 0; }
.drawer {
  position: relative; height: 100%; width: min(560px, 100%); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; outline: none;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  animation: slide-in var(--dur) var(--ease) both;
}
.drawer--wide { width: min(760px, 100%); }
.drawer__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 22px 28px 16px; border-bottom: 1px solid var(--line); }
.drawer__title { margin: 0; font-size: var(--fs-xl); }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer__footer { display: flex; justify-content: flex-end; gap: var(--space-3); padding: 16px 28px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer-backdrop.is-leaving .drawer { animation: slide-out var(--dur) var(--ease) both; }
.modal-backdrop.is-leaving .modal { animation: pop-out var(--dur) var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out { to { transform: translateX(24px); opacity: 0; } }
body.has-overlay { overflow: hidden; }

/* 13. Drop zone ------------------------------------------------------------ */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 240px; padding: 32px 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--lavender); border-radius: var(--r-lg);
  background: linear-gradient(180deg, #FFFFFF, #FCFBFE);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dropzone:hover { border-color: #B79EF2; background: linear-gradient(180deg, #FFFFFF, var(--lavender-soft)); }
.dropzone:focus-within, .dropzone:focus-visible { box-shadow: var(--ring); border-color: var(--accent); }
.dropzone.is-dragover {
  border-color: var(--accent); border-style: solid; transform: scale(1.005);
  background: linear-gradient(135deg, var(--lavender-soft), var(--sky-soft) 60%, var(--mint-soft));
  box-shadow: 0 0 0 6px rgba(124,106,224,.10);
}
.dropzone.is-dragover .dropzone__icon { transform: translateY(-4px) scale(1.04); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dropzone__icon {
  position: relative; width: 68px; height: 56px; margin-bottom: 8px;
  transition: transform var(--dur) var(--ease);
}
/* Folder made of CSS shapes: back panel, tab, front panel, a small "page" peeking */
.dropzone__icon::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 10px; bottom: 4px; border-radius: 10px;
  background: linear-gradient(180deg, var(--sky), #A9CFF1);
}
.dropzone__icon::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 22px; bottom: 4px; border-radius: 10px;
  background: linear-gradient(180deg, var(--lavender), #B79EF2);
  box-shadow: 0 6px 14px rgba(124,106,224,.25);
}
.dropzone__icon i { position: absolute; left: 4px; top: 2px; width: 26px; height: 14px; border-radius: 6px 6px 0 0; background: var(--sky); }
.dropzone__icon b { position: absolute; left: 20px; right: 20px; top: 8px; height: 22px; border-radius: 5px; background: #fff; box-shadow: 0 1px 2px rgba(31,35,48,.08); z-index: 1; }
.dropzone__icon b::before, .dropzone__icon b::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 2px; background: var(--line-strong); top: 6px; }
.dropzone__icon b::after { top: 12px; right: 12px; }
.dropzone__icon::after { z-index: 2; }
.dropzone__title { font-weight: 600; font-size: var(--fs-lg); margin: 0; letter-spacing: -.01em; }
.dropzone__title .link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--lavender); }
.dropzone__hint { color: var(--ink-2); font-size: var(--fs-sm); margin: 0; }
.dropzone__types { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.dropzone--compact { min-height: 160px; padding: 20px; }
.dropzone--compact .dropzone__icon { transform: scale(.8); margin-bottom: 0; }

/* File list after selection */
.file-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: var(--fs-sm); }
.file-list .path { font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.file-list svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }

/* Progress */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #A38CF0); transition: width 300ms var(--ease); }

/* 14. Code block ----------------------------------------------------------- */
.code {
  position: relative; background: #2A2D3A; color: #E6E8F0; border-radius: var(--r-md);
  padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.6;
  overflow-x: auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.code pre { margin: 0; white-space: pre; padding-right: 84px; } /* room for .code__copy */
.code--labelled pre, .code--plain pre { padding-right: 0; }
.code code { font-family: inherit; }
.code--wrap pre { white-space: pre-wrap; word-break: break-all; }
.code__copy {
  position: absolute; top: 10px; right: 10px;
  height: 30px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08); color: #E6E8F0; font-family: var(--font); font-size: var(--fs-xs); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--dur) var(--ease);
}
.code__copy:hover { background: rgba(255,255,255,.16); }
.code__copy:focus-visible { box-shadow: 0 0 0 3px rgba(205,185,246,.5); }
.code__copy svg { width: 14px; height: 14px; }
.code__copy.is-copied { background: rgba(191,234,215,.2); color: var(--mint); border-color: rgba(191,234,215,.35); }
.code__label { position: absolute; top: 12px; left: 20px; font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(230,232,240,.5); }
.code--labelled { padding-top: 40px; }
/* Soft syntax tints (hand-applied spans) */
.code .k { color: #CDB9F6; }     /* keys / keywords: lavender */
.code .s { color: #BFEAD7; }     /* strings: mint */
.code .n { color: #FFD3B6; }     /* numbers: peach */
.code .c { color: #8B90A3; font-style: italic; } /* comments */
.code .p { color: #9AA0AE; }     /* punctuation */

/* Inline code */
code.inline, .inline-code { font-family: var(--mono); font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink); }

/* Secret reveal (token shown once) */
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--butter-soft); border: 1px dashed #E9D27E; }
.secret code { flex: 1 1 200px; min-width: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* 15. Empty state ---------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-8) var(--space-5); gap: 8px; }
.empty__art { position: relative; width: 160px; height: 120px; margin-bottom: 12px; }
.blob { position: absolute; border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%; opacity: .95; }
.empty__art .blob:nth-child(1) { width: 92px; height: 82px; left: 8px; top: 18px; background: var(--lavender); transform: rotate(-12deg); }
.empty__art .blob:nth-child(2) { width: 80px; height: 74px; left: 64px; top: 6px; background: var(--sky); transform: rotate(18deg); mix-blend-mode: multiply; }
.empty__art .blob:nth-child(3) { width: 70px; height: 62px; left: 50px; top: 52px; background: var(--mint); transform: rotate(-30deg); mix-blend-mode: multiply; }
.empty__art .blob:nth-child(4) { width: 34px; height: 30px; left: 118px; top: 66px; background: var(--peach); transform: rotate(10deg); }
.empty__art .blob--card { width: 56px; height: 68px; left: 52px; top: 26px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); opacity: 1; transform: rotate(-4deg); z-index: 1; }
.empty__art .blob--card::before, .empty__art .blob--card::after { content: ""; position: absolute; left: 10px; right: 10px; height: 4px; border-radius: 2px; background: var(--line); top: 14px; }
.empty__art .blob--card::after { top: 24px; right: 20px; background: var(--lavender); }
.empty__title { margin: 0; font-size: var(--fs-xl); }
.empty__text { margin: 0; color: var(--ink-2); max-width: 420px; }
.empty__actions { margin-top: 12px; display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; }
.empty--compact { padding: var(--space-6) var(--space-4); }
.empty--compact .empty__art { transform: scale(.75); margin: -14px 0 -6px; }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #EEEBE6 50%, var(--surface-2) 75%); background-size: 200% 100%; border-radius: var(--r-sm); animation: shimmer 1.4s linear infinite; color: transparent !important; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 16. Site hero & QR ------------------------------------------------------- */
.site-hero {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-5); align-items: center;
  background: linear-gradient(135deg, var(--lavender-soft), var(--surface) 45%, var(--sky-soft));
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px; border: 1px solid rgba(31,35,48,.03);
  margin-bottom: var(--space-5);
}
.site-hero > * { min-width: 0; }
.site-hero__title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.site-hero__title h1 { margin: 0; }
.site-hero__desc { color: var(--ink-2); margin: 0 0 16px; }
.site-hero__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: 16px; }
.url-box {
  display: flex; align-items: center; gap: 8px; max-width: 560px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 6px 6px 6px 14px;
  box-shadow: var(--shadow-sm);
}
.url-box__url { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-box__url a { color: inherit; }
.url-box__url .scheme { color: var(--ink-3); }
.qr {
  width: 136px; height: 136px; border-radius: 16px; background: #fff; padding: 10px;
  box-shadow: var(--shadow); display: grid; place-items: center; border: 1px solid var(--line);
}
.qr svg, .qr img { width: 100%; height: 100%; }
.qr--placeholder { background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 50% / 12px 12px; background-clip: content-box; }

/* 17. Stats & sparkline ---------------------------------------------------- */
.stat-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 24px; border: 1px solid rgba(31,35,48,.03); }
.stat__label { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 4px; }
.stat__value { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__delta { font-size: var(--fs-xs); font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat__delta--up { color: var(--success-text); }
.stat__delta--down { color: var(--danger-text); }
.stat--mint { background: linear-gradient(180deg, var(--mint-soft), var(--surface) 70%); }
.stat--lavender { background: linear-gradient(180deg, var(--lavender-soft), var(--surface) 70%); }
.stat--sky { background: linear-gradient(180deg, var(--sky-soft), var(--surface) 70%); }

/* CSS-only sparkline: <div class="sparkline"><i style="--v:.4" title="12 mars: 4 vues"></i>…</div>
   --v ∈ [0,1] relative to the max. Bars fill the width. */
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding: 8px 0 0; }
.sparkline i {
  flex: 1; min-width: 3px; height: calc(max(var(--v, 0) * 100%, 4px)); border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent), var(--lavender)); opacity: .9;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  transform-origin: bottom;
}
.sparkline i:hover { opacity: 1; transform: scaleY(1.03); }
.sparkline i.is-today { background: linear-gradient(180deg, #3F87CC, var(--sky)); }
.sparkline i.is-empty { background: var(--line); }
.sparkline--sm { height: 40px; gap: 2px; padding: 0; }
.sparkline--sm i { border-radius: 2px; }
.sparkline-axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 6px; }

/* 18. Misc ----------------------------------------------------------------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--lavender), var(--sky)); color: var(--ink); font-size: 12px; font-weight: 700; }
.avatar--lg { width: 48px; height: 48px; font-size: 18px; border-radius: 16px; }
.avatar--mint { background: linear-gradient(135deg, var(--mint), var(--sky)); }
.avatar--peach { background: linear-gradient(135deg, var(--peach), var(--rose)); }

kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 1px 0 var(--line-strong); color: var(--ink-2); }

.divider { height: 1px; background: var(--line); margin: var(--space-5) 0; }
.divider--text { display: flex; align-items: center; gap: 12px; height: auto; background: none; color: var(--ink-3); font-size: var(--fs-xs); }
.divider--text::before, .divider--text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Definition list (settings, account) */
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 20px; margin: 0; font-size: var(--fs-sm); }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; color: var(--ink); }

/* Person row (Administrateurs) */
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person__body { flex: 1; min-width: 0; }
.person__name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.person__email { color: var(--ink-2); font-size: var(--fs-sm); }

/* File tree (editor) */
.tree { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); font-family: var(--mono); }
.tree li { margin: 0; }
.tree__item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); width: 100%; border: 0; background: transparent; text-align: left; }
.tree__item:hover { background: var(--surface-2); color: var(--ink); }
.tree__item[aria-current="true"] { background: var(--lavender-soft); color: var(--accent-text); font-weight: 600; }
.tree__item svg { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
.tree__item[aria-current="true"] svg { color: var(--accent); }
.tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree__size { margin-left: auto; color: var(--ink-3); font-size: 11px; }

/* Editor layout */
.editor { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-4); min-height: 420px; }
.editor__side { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px; border: 1px solid rgba(31,35,48,.03); }
.editor__main { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.editor__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.editor__path { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-2); }
.editor .textarea--code { border-radius: var(--r-lg); flex: 1; }

/* Version list */
/* Versions → « Comparer » drawer (versions-diff.js). */
.select--sm { height: 32px; padding: 0 30px 0 10px; font-size: var(--fs-sm); border-radius: 10px; }
.diff-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.diff-head__pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); }
.diff-head__pick strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.diff-head__label { white-space: nowrap; }
.diff-summary { margin: 0 0 var(--space-4); color: var(--ink-2); font-size: var(--fs-sm); min-height: 1.4em; }
.diff { display: flex; flex-direction: column; gap: var(--space-3); }
.diff__file { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.diff__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; list-style: none; font-size: var(--fs-sm); background: var(--surface-2);
}
.diff__head::-webkit-details-marker { display: none; }
.diff__head::before { content: "▸"; color: var(--ink-3); font-size: 11px; width: 10px; }
.diff__file[open] > .diff__head::before { content: "▾"; }
.diff__status { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.diff__status--added { background: var(--mint); color: var(--ink); }
.diff__status--removed { background: var(--rose-soft); color: var(--danger-text); }
.diff__status--modified { background: var(--butter-soft); color: var(--warning-text); }
.diff__path { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.diff__size { color: var(--ink-3); font-size: var(--fs-xs); margin-left: auto; white-space: nowrap; }
.diff__counts { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.diff__plus { color: var(--success-text); font-weight: 600; }
.diff__minus { color: var(--danger-text); font-weight: 600; }
.diff__note { margin: 0; padding: 10px 14px; color: var(--ink-3); font-size: var(--fs-xs); }
.diff__scroll { overflow-x: auto; max-height: 520px; overflow-y: auto; }
.diff__table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12px; line-height: 1.55; }
.diff__no { width: 3.5ch; padding: 0 6px; text-align: right; color: var(--ink-3); user-select: none; vertical-align: top; background: #FBFAF8; border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.diff__text { padding: 0 12px 0 8px; white-space: pre; }
.diff__sign { display: inline-block; width: 1.2ch; color: var(--ink-3); user-select: none; }
.diff__hunk .diff__text { color: var(--accent-text); background: var(--lavender-soft); font-size: 11.5px; }
.diff__hunk .diff__no { color: var(--ink-3); }
.diff__line--add .diff__text { background: #E7F6EC; }
.diff__line--add .diff__sign { color: var(--success-text); }
.diff__line--del .diff__text { background: #FBE7EC; }
.diff__line--del .diff__sign { color: var(--danger-text); }

.version { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.version + .version { border-top: 1px solid var(--line); }
.version__num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--ink-2); flex: none; font-variant-numeric: tabular-nums; }
.version--current .version__num { background: var(--mint); color: var(--ink); }
.version__body { flex: 1; min-width: 0; }
.version__title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version__meta { color: var(--ink-2); font-size: var(--fs-sm); }

/* Dropdown menu (simple, JS toggles [hidden]) */
.menu { position: relative; display: inline-block; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; z-index: 50; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop-in var(--dur-fast) var(--ease) both; }
.menu__list[hidden] { display: none; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: var(--fs-sm); color: var(--ink); }
.menu__item:hover { background: var(--surface-2); text-decoration: none; }
.menu__item svg { width: 16px; height: 16px; color: var(--ink-2); }
.menu__item--danger { color: var(--danger-text); }
.menu__item--danger svg { color: inherit; }
.menu__sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Icon (inline svg sizing helper) */
.icon { width: 18px; height: 18px; flex: none; }
.icon--sm { width: 14px; height: 14px; }

/* 19. Utilities ------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }
.row { display: flex; align-items: center; gap: var(--space-3); }
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--space-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.flex-1 { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* 20. Motion & a11y -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .card--hover:hover, .site-card:hover { transform: none; }
}

/* 21. Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-side { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor__side { max-height: 200px; overflow: auto; }
  .site-hero { grid-template-columns: 1fr; }
  .site-hero .qr { justify-self: start; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --fs-2xl: 24px; --fs-3xl: 28px; }
  .container, .topbar__inner { padding-left: var(--space-4); padding-right: var(--space-4); }
  .main { padding-top: var(--space-5); }
  .topbar__inner { display: flex; flex-wrap: wrap; row-gap: 0; padding-top: 10px; padding-bottom: 10px; }
  .topbar__actions { order: 2; margin-left: auto; }
  .nav { order: 3; width: 100%; padding-top: 8px; overflow-x: auto; justify-content: flex-start; }
  .nav__link { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
  .user-chip .user-chip__name { display: none; }
  .user-chip { padding-right: 4px; }
  .card, .card__section { padding: 20px; }
  .site-hero { padding: 20px; }
  .site-grid, .card-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 10px; }
  .modal { padding: 22px; }
  .modal__actions .btn, .drawer__footer .btn { flex: 1; }
  .drawer { border-radius: 0; }
  .toast-region { left: 16px; right: 16px; bottom: 16px; align-items: stretch; max-width: none; }
  .toast { min-width: 0; }
  .auth-card { padding: 28px 22px 20px; }
  .page-header__actions { width: 100%; flex-wrap: wrap; }
  .search--header { flex: 1 1 100%; width: auto; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .table th, .table td { padding: 10px 12px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .dropzone { min-height: 200px; }
}

/* ==========================================================================
   22. Admin-UI additions (Admin agent) — code editor gutter, preview frame,
       QR block, misc. Appended only; existing components are untouched.
   ========================================================================== */
.code-editor { position: relative; display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; min-height: 420px; }
.code-editor:focus-within { box-shadow: var(--ring); border-color: var(--accent); }
.code-editor__gutter { margin: 0; padding: 12px 10px 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink-3); text-align: right; background: var(--surface-2); border-right: 1px solid var(--line); user-select: none; overflow: hidden; white-space: pre; min-width: 44px; }
.code-editor .code-editor__area { border: 0; border-radius: 0; box-shadow: none; min-height: 420px; height: 420px; resize: vertical; background: transparent; padding: 12px 14px; margin: 0; }
.code-editor .code-editor__area:focus { box-shadow: none; }
.code-editor.is-dirty .code-editor__gutter { color: var(--accent-text); }
.code-editor__preview { border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.code-editor__preview iframe { display: block; width: 100%; height: 480px; border: 0; background: #fff; }
.code-editor__binary { border: 1px solid var(--line-strong); box-shadow: none; }
.kbd--on-accent { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .15); border-color: transparent; box-shadow: none; margin-left: 4px; }
.qr-block { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tree__item .truncate { min-width: 0; flex: 1; }
.tree__item[aria-expanded="false"] + ul { display: none; }
.tree__item[aria-expanded="false"] svg { opacity: .7; }
.tree li li .tree__item { padding-left: 10px; }
.dropzone.is-reading { opacity: .6; pointer-events: none; }
.file-list { max-height: 320px; overflow: auto; }
.page-header__eyebrow .subtle { color: var(--ink-3); }
.site-hero .alert { max-width: 560px; }
.form-actions .btn.is-loading, .drawer__footer .btn.is-loading { min-width: 140px; }
@media (max-width: 900px) {
  .qr-block { align-items: flex-start; }
  .code-editor .code-editor__area { height: 320px; min-height: 320px; }
  .code-editor { min-height: 320px; }
  .code-editor__preview iframe { height: 360px; }
}
.grid-2 > .card + .card, .grid-3 > .card + .card, .site-grid > .card + .card { margin-top: 0; }
@media (min-width: 901px) { .editor__side { max-height: 640px; overflow: auto; align-self: start; position: sticky; top: 84px; } }
