/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Curseur par défaut partout — texte uniquement là où on peut écrire */
* { cursor: default !important; user-select: none; -webkit-user-select: none; }
input, textarea, [contenteditable] { cursor: text !important; user-select: text !important; -webkit-user-select: text !important; }
input[type="checkbox"], input[type="radio"] { cursor: pointer !important; }
a, button, label, [role="button"], select, [onclick] { cursor: pointer !important; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Tokens ── */
:root {
  --bg:          #000000;
  --surface-1:   #1C1C1E;
  --surface-2:   #2C2C2E;
  --surface-3:   #3A3A3C;
  --sep:         rgba(255,255,255,0.09);
  --text-1:      #F5F5F7;
  --text-2:      rgba(245,245,247,0.62);
  --text-3:      rgba(245,245,247,0.46);

  /* Seal — couleur d'action : ce qu'on déclenche (CTA, sélection, validation) */
  --seal:        #E0904A;
  --seal-pressed:#C97633;
  --seal-soft:   rgba(224,144,74,0.16);

  /* Wax — second accent, froid (complémentaire de l'orange) : liens secondaires,
     info éditoriale. Contraste avec l'orange principal. */
  --wax:         #E8A96A;
  --wax-pressed: #D4893E;
  --wax-soft:    rgba(232,169,106,0.16);

  /* Sémantiques — légèrement réchauffées/désaturées pour s'accorder à la
     palette plutôt que reprendre tel quel le triplet vert/orange/rouge HIG. */
  --success:     #4FB870;
  --warning:     #E0904A;
  --danger:      #E8584C;
  --danger-soft: rgba(232,88,76,0.16);

  /* Legacy aliases used by app.js / old classes */
  --text:        var(--text-1);
  --muted:       var(--text-2);
  --muted2:      var(--text-3);
  --accent:      var(--seal);
  --accent-dim:  var(--seal-pressed);
  --surface:     var(--surface-1);
  --surface2:    var(--surface-2);
  --border:      var(--sep);
  --border2:     rgba(255,255,255,0.14);
  --error:       var(--danger);

  /* Display — serif à fort caractère réservée aux titres/logo : elle porte
     la métaphore du "sceau"/document officiel du produit. Corps de texte et
     UI restent en Inter, lisible et neutre. Données/identifiants en mono. */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* Échelle typographique fermée — 10 paliers, tout le reste du fichier doit
     s'y référer plutôt que poser des valeurs en rem au cas par cas. */
  --text-3xs:  0.625rem;  /* 10px — micro-labels sous icône (tab bar mobile) */
  --text-2xs:  0.6875rem; /* 11px — micro-labels, badges */
  --text-xs:   0.75rem;   /* 12px — hints, métadonnées */
  --text-sm:   0.8125rem; /* 13px — labels, texte secondaire dense */
  --text-base: 0.875rem;  /* 14px — corps de texte par défaut */
  --text-md:   0.9375rem; /* 15px — champs de saisie, contenu mis en avant */
  --text-lg:   1.0625rem; /* 17px — sous-titres, valeurs de stats secondaires */
  --text-xl:   1.375rem;  /* 22px — titres de page */
  --text-2xl:  1.75rem;   /* 28px — valeurs chiffrées mises en avant (stats) */
  --text-3xl:  clamp(2.4rem, 6vw, 3.6rem); /* hero / display */

  --radius: 14px;
  --radius-sm: 10px;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   EYEBROW
════════════════════════════════════════ */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ════════════════════════════════════════
   TOP BAR (sticky, blur, reveals on scroll)
════════════════════════════════════════ */

.public-header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(0, 0, 0, 0.72);
  border-bottom: 1px solid transparent;
  padding: 0 1.5rem;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
}

.public-header.scrolled,
.app-header.scrolled {
  border-bottom-color: var(--sep);
}

.logo {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-1);
  flex-shrink: 0;
  opacity: 1;
  transition: opacity 0.2s;
}

.public-header.scrolled .logo,
.app-header.scrolled .logo {
  opacity: 1;
}

.logo-img {
  height: 54px;
  width: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
  margin: -15px 0;
}

/* Public nav */
.public-header nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.75rem;
}

.public-header nav a {
  font-size: var(--text-base);
  color: var(--text-2);
  transition: color 0.15s;
}

.public-header nav a:hover { color: var(--text-1); }

/* App nav */
.app-nav {
  display: flex;
  gap: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.app-nav a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-2);
  padding: 0 1rem;
  height: 54px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.app-nav a:hover { color: var(--text-1); }
.app-nav a.active {
  color: var(--text-1);
  border-bottom-color: var(--seal);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-user {
  font-size: var(--text-xs);
  color: var(--text-2);
  font-family: var(--font-mono);
}

/* Hamburger : caché par défaut, réservé au mobile (voir media query) */
.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-1);
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  flex-shrink: 0;
}

.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle:hover { background: var(--surface-2); }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */

.btn-ghost {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-1);
  border: none;
  border-radius: 999px;
  padding: 0.42rem 1rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.btn-ghost:hover { color: var(--text-1); background: var(--surface-2); }

.btn-primary {
  font-size: var(--text-base);
  font-weight: 600;
  color: #fff;
  background: var(--seal);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--seal-pressed); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-large {
  padding: 0.9rem 2rem;
  font-size: var(--text-base);
  width: 100%;
  margin-top: 0.5rem;
  border-radius: var(--radius);
}

/* ════════════════════════════════════════
   VUE LANDING
════════════════════════════════════════ */

#view-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 54px);
}

.landing-hero {
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.landing-hero .eyebrow { margin-bottom: 1.1rem; }

h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--text-1);
  margin-bottom: 1.1rem;
}

h1 em {
  font-style: italic;
  color: var(--wax);
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--text-2);
  max-width: 34ch;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Seal zone (stamp interaction) ── */
.input-zone {
  width: 100%;
  max-width: 640px;
  padding: 0 1.5rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.url-row {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.url-input {
  width: 100%;
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 0.95rem 1.2rem;
  font-size: var(--text-md);
  color: var(--text-1);
  border: 1px solid var(--sep);
  outline: none;
  transition: border-color 0.2s;
}

.url-input::placeholder { color: var(--text-3); }
.url-input:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }

/* Stamp button */
.submit-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid color-mix(in srgb, var(--seal) 35%, var(--sep));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.34,1.4,.64,1), background 0.25s, border-color 0.25s;
  position: relative;
  flex-shrink: 0;
  align-self: center;
  margin: 0 auto;
  color: inherit;
  font: inherit;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  padding: 0;
}

.submit-btn:hover { border-color: color-mix(in srgb, var(--seal) 60%, transparent); }
.submit-btn:active { transform: scale(0.9); }

.submit-btn.sealed {
  background: var(--seal);
  border-color: var(--seal);
}

/* SVG inside stamp */
.submit-btn svg { width: 30px; height: 30px; }
.stamp-ring { fill: none; stroke: var(--seal); stroke-width: 2.2; transition: stroke 0.25s, opacity 0.25s; }
.stamp-dot  { fill: var(--seal); transition: fill 0.25s, opacity 0.15s; }
.stamp-check {
  stroke: #fff; stroke-width: 2.4; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.3s ease 0.1s;
}

.submit-btn.sealed .stamp-ring { stroke: rgba(255,255,255,0); }
.submit-btn.sealed .stamp-dot  { opacity: 0; }
.submit-btn.sealed .stamp-check { stroke-dashoffset: 0; }

.stamp-label {
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* Result pill */
.result {
  width: 100%;
  max-width: 480px;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s, max-height 0.3s, padding 0.3s, margin 0.3s;
}

.result.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 220px;
}

.result-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.75rem;
  min-width: 0;
}

.result-url {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-1);
  word-break: break-all;
}

.seal { display: none; } /* legacy — stamp is the button now */
.seal-svg { display: none; }

.copy-btn {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--seal);
  background: var(--seal-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.copy-btn:hover { background: color-mix(in srgb, var(--seal) 26%, transparent); }
.copy-btn:active { transform: scale(0.95); }
.copy-btn.copied { color: var(--success); background: color-mix(in srgb, var(--success) 16%, transparent); }

.error-msg {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: 0.5rem;
  display: none;
  text-align: center;
}

.error-msg.visible { display: block; }

.slug-hint {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-top: 0.8rem;
}

.slug-hint a { color: var(--wax); cursor: pointer; }
.slug-hint a:hover { text-decoration: underline; }

.result-no-stats {
  font-size: var(--text-xs);
  color: var(--text-2);
  margin-top: 0.4rem;
  text-align: left;
  line-height: 1.5;
  width: 100%;
}

.result-no-stats a { color: var(--wax); cursor: pointer; font-weight: 600; }
.result-no-stats a:hover { text-decoration: underline; }

/* Landing stats */
.landing-stats {
  display: flex;
  gap: 4rem;
  margin-top: 4.5rem;
  padding: 0 1.5rem;
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }

.stat-number {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Landing footer */
.landing-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem 2.5rem 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--sep);
  font-size: var(--text-xs);
  color: var(--text-3);
}

.footer-links { display: flex; gap: 2rem; }
.footer-links a { color: var(--text-3); transition: color 0.15s; }
.footer-links a:hover { color: var(--text-1); }

/* ════════════════════════════════════════
   APP VIEWS
════════════════════════════════════════ */

.app-view {
  /* FIX: élargi de 760px → 900px pour que le tableau ne soit plus coupé */
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  line-height: 1.1;
}

.page-title .dim { color: var(--text-2); }

.page-sub {
  font-size: var(--text-base);
  color: var(--text-2);
  margin-top: 0.3rem;
}

/* ── Dashboard stat tiles ── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
}

.dash-stat-card {
  background: var(--surface-1);
  border-radius: 18px;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: background 0.15s;
}

.dash-stat-card:hover { background: var(--surface-2); }

.dash-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
  line-height: 1;
}

.dash-stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
}

/* Tile icon */
.tile-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  margin-bottom: 0.1rem;
}

.tile-icon svg {
  width: 18px; height: 18px;
  stroke: var(--text-1); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.dash-stat-card.primary .tile-icon { background: var(--seal); }
.dash-stat-card.primary .tile-icon svg { stroke: #fff; }

/* ── Alerte liens expirant bientôt (dashboard) ── */
.dash-expiry-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.dash-expiry-alert .alert-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 0.1rem;
  stroke: var(--warning);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-expiry-alert .alert-body { flex: 1; min-width: 0; }

.dash-expiry-alert .alert-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.25rem;
}

.dash-expiry-alert .alert-list {
  font-size: var(--text-xs);
  color: var(--text-2);
  line-height: 1.5;
}

.dash-expiry-alert .alert-list .slug {
  font-family: var(--font-mono);
  color: var(--text-1);
}

.dash-expiry-alert .alert-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--warning);
}

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--seal);
  cursor: pointer;
}

.section-link:hover { text-decoration: underline; }

/* ── Segmented control ── */
.segmented-wrap {
  margin-bottom: 1rem;
}

.segmented {
  display: inline-flex;
  background: var(--surface-1);
  border-radius: 11px;
  padding: 3px;
}

.segmented button {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  padding: 0.42rem 1rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.segmented button.active {
  background: var(--surface-3);
  color: var(--text-1);
}

/* ── Group label ── */
.group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.6rem 0 0.6rem 0.2rem;
}

/* ── Grouped inset list (links + profile) ── */
.group,
.links-table-wrap {
  background: var(--surface-1);
  border-radius: 16px;
  overflow: hidden;
  border: none;
}

/* override for table context */
.links-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.links-table-wrap::-webkit-scrollbar { display: none; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--sep);
  overflow: hidden;
  cursor: pointer;
}

.group .row:last-child { border-bottom: none; }

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.25s ease;
}

.row.revealed .row-main { transform: translateX(-86px); }

.row-link {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--text-1);
}

.row-dest {
  font-size: var(--text-xs);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.row.revealed .row-meta { transform: translateX(-86px); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.active  { background: var(--success); }
.dot.paused  { background: var(--text-3); }
.dot.expired { background: var(--danger); }

.row-clicks {
  font-size: var(--text-xs);
  color: var(--text-2);
  min-width: 54px;
  text-align: right;
  font-family: var(--font-mono);
}

.row-chevron { color: var(--text-3); flex-shrink: 0; }
.row-chevron svg { width: 14px; height: 14px; }

.row-actions {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex;
  width: 86px;
  transform: translateX(86px);
  transition: transform 0.25s ease;
}

.row.revealed .row-actions { transform: translateX(0); }

.row-actions button {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
}

.row-actions button svg {
  width: 16px; height: 16px;
  stroke: #fff; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.act-edit   { background: var(--surface-3); }
.act-delete { background: var(--danger); }

/* ── Table (fallback / desktop) ── */
.links-table {
  width: 100%;
  /* FIX: élargi de 600px → 720px pour loger toutes les colonnes */
  min-width: 720px;
  border-collapse: collapse;
}

.links-table thead {
  background: var(--surface-1);
  border-bottom: 1px solid var(--sep);
}

.links-table th {
  padding: 0.7rem 1.1rem;
  text-align: left;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.links-table tbody tr {
  border-bottom: 1px solid var(--sep);
  transition: background 0.1s;
}

.links-table tbody tr:last-child { border-bottom: none; }
.links-table tbody tr:hover { background: var(--surface-2); }

.links-table td {
  padding: 0.85rem 1.1rem;
  font-size: var(--text-base);
  color: var(--text-1);
  vertical-align: middle;
}

.links-table td.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--seal);
}

.links-table td.dest {
  color: var(--text-2);
  /* FIX: réduit de 260px → 180px pour libérer de la place pour "CRÉÉ LE" */
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-table td.created {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-2);
  /* FIX: largeur fixée pour que la colonne ne soit plus écrasée */
  width: 110px;
  min-width: 100px;
}

/* FIX: largeur fixée sur le header "CRÉÉ LE" également */
.links-table th.th-created {
  width: 110px;
  min-width: 100px;
}

.links-table td.clicks {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ── Plus grand écran : on a la place, on en profite ─────────────
   Texte, lignes, badges et icônes d'action légèrement agrandis pour
   ne pas laisser un tableau "riquiqui" perdu dans tout cet espace. */
@media (min-width: 1100px) {
  .links-table td {
    padding: 1.05rem 1.3rem;
    font-size: 0.95rem;
  }

  .links-table th {
    padding: 0.85rem 1.3rem;
    font-size: 0.75rem;
  }

  .links-table td.mono,
  .links-table td.created,
  .links-table td.clicks {
    font-size: 0.9rem;
  }

  .links-table td.dest-cell {
    max-width: 320px;
  }

  .favicon { width: 18px; height: 18px; }

  .links-table .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
  }

  .actions-row { gap: 0.25rem; }

  .actions-row button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .actions-row button svg,
  .actions-row button img {
    width: 18px;
    height: 18px;
  }
}

/* ── Sélection multiple ── */
.links-table th.th-check,
.links-table td.th-check {
  width: 2.4rem;
  padding-left: 1.1rem;
  padding-right: 0;
}

.row-select,
#links-select-all {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border-radius: 5px;
  border: 1.5px solid var(--sep);
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.row-select:hover,
#links-select-all:hover {
  border-color: var(--text-3);
}

.row-select:focus-visible,
#links-select-all:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--seal-soft);
}

.row-select:checked,
#links-select-all:checked {
  background-color: var(--seal);
  border-color: var(--seal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
}

#links-select-all:indeterminate {
  background-color: var(--seal);
  border-color: var(--seal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='4' y='7' width='8' height='2' rx='1' fill='%23fff'/%3E%3C/svg%3E");
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bulk-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  font-size: var(--text-xs);
  padding: 0.4rem 0.85rem;
  margin: 0;
  display: inline-block;
}

.table-empty td {
  text-align: center;
  color: var(--text-2);
  padding: 3rem;
  font-size: var(--text-base);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  border: none;
}

.badge.custom {
  background: var(--wax-soft);
  color: var(--wax);
}

/* ── Split Link ── */
.url-split-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.url-split-row .field-input { flex: 1; }

.split-add-btn {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--sep);
  color: var(--text-2);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.split-add-btn:hover {
  color: var(--seal);
  border-color: color-mix(in srgb, var(--seal) 50%, transparent);
  background: var(--surface-3);
}

.split-add-btn.active {
  color: var(--seal);
  border-color: color-mix(in srgb, var(--seal) 50%, transparent);
  background: color-mix(in srgb, var(--seal) 10%, transparent);
}

.split-panel {
  display: none;
  margin-top: 0.9rem;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
}

/* split-panel.visible handled by create-mode-panel now */
.split-panel.visible { display: block; }

.split-panel-hint { margin-top: 0; margin-bottom: 0.9rem; line-height: 1.5; }
.split-panel-hint strong { color: var(--text-2); }

.split-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.split-row-url {
  flex: 1;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: var(--text-base);
  padding: 0.65rem 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

.split-row-url:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }
.split-row-url::placeholder { color: var(--text-3); }

.split-row-percent-wrap {
  position: relative;
  flex-shrink: 0;
  width: 4.6rem;
}

.split-row-percent {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  text-align: right;
  padding: 0.65rem 1.5rem 0.65rem 0.5rem;
  outline: none;
  transition: border-color 0.15s;
}

.split-row-percent:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }

.split-row-percent-sign {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--text-3);
  pointer-events: none;
}

.split-row-remove {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: var(--text-md);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.split-row-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.split-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.split-row-add {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--seal);
  cursor: pointer;
  transition: opacity 0.15s;
}

.split-row-add:hover { opacity: 0.75; }

.split-total {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--success);
  transition: color 0.15s;
}

.split-total.invalid { color: var(--danger); }

.create-result-splits {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.create-result-splits li {
  font-size: var(--text-xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-result-splits .split-pct {
  font-family: var(--font-mono);
  color: var(--text-2);
  margin-right: 0.4rem;
}

.badge.split { background: var(--seal-soft); color: var(--seal); }
.badge.conditional { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }

/* Étiquette libre choisie par l'utilisateur (colonne "Type") — couleur
   neutre distincte de .badge.custom pour ne pas la confondre avec le
   badge perso/auto de la colonne Slug. */
.badge.tag {
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.type-cell-empty {
  color: var(--text-3);
}

/* ── Bandeau d'avertissement liens anonymes ── */
.anon-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent);
  color: var(--text-1);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.anon-warning-banner svg {
  flex-shrink: 0;
  color: var(--warning);
  margin-top: 0.1rem;
}

.anon-warning-banner a {
  color: var(--wax);
  font-weight: 600;
  cursor: pointer;
}

.anon-warning-banner a:hover { text-decoration: underline; }

/* ── Bouton "Créer un autre lien" ── */
.btn-create-another {
  display: block;
  margin: 1rem auto 0;
}


/* ── Lien vivant (routage conditionnel) ── */
.rule-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.rule-row-select-wrap {
  position: relative;
  flex-shrink: 0;
}

.rule-row-type,
.rule-row-value {
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: var(--text-sm);
  padding: 0.6rem 1.8rem 0.6rem 0.7rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.rule-row-type { width: 7.5rem; }
.rule-row-value { width: 7.5rem; }

.rule-row-type:focus,
.rule-row-value:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }

.rule-row-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.rule-row-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: var(--text-sm);
}

.rule-row-url {
  flex: 1;
  min-width: 9rem;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: var(--text-base);
  padding: 0.65rem 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

.rule-row-url:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }
.rule-row-url::placeholder { color: var(--text-3); }

.rule-row-remove {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: var(--text-md);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.rule-row-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.rules-panel-locked {
  opacity: 0.55;
  pointer-events: none;
}

.create-result-rules li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.create-result-rules .rule-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  flex-shrink: 0;
}

/* ── Create form ── */
.create-card {
  background: var(--surface-1);
  border: none;
  border-radius: 18px;
  padding: 2rem;
  max-width: 580px;
}

/* ── Sélecteur de type de lien ── */
.link-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.link-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 1.5px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.1;
}

.link-type-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.link-type-btn:hover {
  border-color: color-mix(in srgb, var(--seal) 45%, transparent);
  color: var(--text-1);
  background: var(--surface-3);
}

.link-type-btn.active {
  border-color: var(--seal);
  background: color-mix(in srgb, var(--seal) 8%, transparent);
  color: var(--seal);
}

.link-type-btn.active svg { opacity: 1; }

.link-type-desc {
  font-size: var(--text-2xs);
  font-weight: 400;
  color: var(--text-3);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}

.link-type-btn.active .link-type-desc {
  color: color-mix(in srgb, var(--seal) 70%, var(--text-3));
}

/* ── Panneau de mode (split / vivant) ── */
.create-mode-panel {
  display: none;
  margin-bottom: 1.5rem;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
}

.create-mode-panel.visible { display: block; }

.form-field { margin-bottom: 1.5rem; }

.field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.field-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
}

.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: var(--text-base);
  padding: 0.75rem 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.field-input:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }
.field-input::placeholder { color: var(--text-3); }

.slug-field {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}

.slug-field:focus-within { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }

.slug-prefix-badge {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-2);
  padding: 0.75rem 0 0.75rem 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.slug-input {
  background: transparent;
  border: none;
  border-radius: 0;
  padding-left: 0.25rem;
  color: var(--seal);
  font-family: var(--font-mono);
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 0.4rem;
}

.link-preview {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.link-preview.visible { display: flex; opacity: 1; transform: translateY(0); }
.link-preview.loading { opacity: 0.55; }

.link-preview-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--surface-3);
  object-fit: contain;
}

.link-preview-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.link-preview-title {
  font-size: var(--text-sm);
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-preview-title.no-title { color: var(--text-3); font-style: italic; }

.link-preview-domain {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

textarea.field-input {
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
  line-height: 1.5;
}

.og-preview-card {
  display: none;
  flex-direction: column;
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-1);
  margin-bottom: 1.1rem;
}

#og-panel.visible .og-preview-card {
  display: flex;
}

.og-preview-image-wrap {
  display: none;
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: var(--surface-3);
  overflow: hidden;
}

.og-preview-image-wrap.visible { display: block; }

.og-preview-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.og-preview-body {
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.og-preview-domain {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.og-preview-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.og-preview-desc {
  font-size: var(--text-xs);
  color: var(--text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-preview-desc:empty { display: none; }

.suggestions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.suggestion-chip {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
  background: var(--surface-2);
  border: none;
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.suggestion-chip:hover { color: var(--text-1); background: var(--surface-3); }

.create-result {
  display: none;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 20%, transparent);
}

.create-result.visible { display: flex; }

.create-result-body { flex: 1; min-width: 0; }

.create-result-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 0.3rem;
}

.create-result-url {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-1);
  display: block;
  word-break: break-all;
}

.create-result-url:hover { color: var(--wax); }

.create-result-original {
  font-size: var(--text-xs);
  color: var(--text-2);
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-result-expiry {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

/* ── UTM (repliable) ── */
.utm-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s;
}

.utm-toggle:hover { color: var(--text-1); }

.utm-toggle-icon { transition: transform 0.15s; flex-shrink: 0; }

.utm-toggle.expanded .utm-toggle-icon { transform: rotate(90deg); }

.utm-panel {
  display: none;
  margin-top: 0.9rem;
  padding: 1rem 1rem 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
}

.utm-panel.visible { display: block; }

.utm-panel .field-hint { margin-top: 0; margin-bottom: 0.9rem; }
.utm-panel .field-hint code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
}

/* ── Select ── */
.select-wrap { position: relative; }

.field-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-field-half { flex: 1; min-width: 0; }

/* ── Number input : retire les flèches natives qui cassent l'UI ── */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ════════════════════════════════════════
   MODAL AUTH — centré sur desktop, bottom sheet sur mobile
════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 1.5rem;
}

.modal-overlay.visible { display: flex; }

.modal {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  animation: modal-in 0.22s cubic-bezier(.34,1.2,.64,1);
}

/* La modale d'édition est plus large pour accueillir les lignes split/règles */
.modal-edit {
  max-width: min(820px, calc(100vw - 3rem));
  max-height: 88vh;
  overflow-y: auto;
}

/* Sur écran large, les champs OG passent en 2 colonnes */
@media (min-width: 600px) {
  .modal-edit .edit-og-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
    align-items: start;
  }
  .modal-edit .edit-og-full { grid-column: 1 / -1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* grabber : masqué sur desktop, visible sur mobile */
.modal::before {
  display: none;
}

.modal-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: var(--surface-3); border: none;
  color: var(--text-2); font-size: var(--text-sm); cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--surface-3); color: var(--text-1); }

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal label {
  display: block;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.45rem; margin-top: 1rem;
}

.modal label:first-of-type { margin-top: 0; }

.modal input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1); font-size: var(--text-base);
  padding: 0.75rem 0.95rem; outline: none;
  transition: border-color 0.15s;
}

.modal input:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }
.modal input::placeholder { color: var(--text-3); }

.modal textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  color: var(--text-1); font-size: var(--text-base);
  font-family: inherit;
  padding: 0.75rem 0.95rem; outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

.modal textarea:focus { border-color: color-mix(in srgb, var(--seal) 50%, transparent); }
.modal textarea::placeholder { color: var(--text-3); }

.modal-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 1.5rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--sep);
}

.modal-error {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--danger); margin-top: 0.5rem;
  display: none; line-height: 1.5;
}

.modal-error.visible { display: block; }

.modal-submit {
  width: 100%; background: var(--seal);
  border: none; border-radius: var(--radius);
  padding: 0.85rem;
  font-size: var(--text-base); font-weight: 600;
  color: #fff; cursor: pointer;
  margin-top: 1.5rem; transition: background 0.15s;
}

.modal-submit:hover { background: var(--seal-pressed); }
.modal-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.modal-switch {
  text-align: center; font-size: var(--text-sm);
  color: var(--text-2); margin-top: 1rem;
}

.modal-switch a { color: var(--wax); cursor: pointer; }
.modal-switch a:hover { text-decoration: underline; }

.modal-link-row {
  text-align: right; font-size: var(--text-xs);
  margin-top: 0.5rem;
}
.modal-link-row a { color: var(--text-3); cursor: pointer; transition: color 0.15s; }
.modal-link-row a:hover { color: var(--wax); }

.modal-hint {
  font-size: var(--text-base); line-height: 1.6;
  color: var(--text-2); margin-bottom: 1.25rem;
}

/* ── Password strength ── */
.pwd-strength { margin-top: 0.6rem; }
.pwd-strength-bar {
  height: 4px; border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.pwd-strength-bar span {
  display: block; height: 100%; width: 0%;
  border-radius: 2px;
  background: var(--danger);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.pwd-strength-label {
  display: block; margin-top: 0.35rem;
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: 0.04em; color: var(--text-3);
}

/* ── Confirm modal ── */
.modal-confirm { max-width: 340px; text-align: center; border-radius: 20px; }
.modal-confirm::before { display: none; }
.modal-confirm-text {
  font-size: var(--text-md); line-height: 1.6;
  color: var(--text-1); margin-bottom: 1.5rem;
}
.modal-confirm-actions { display: flex; gap: 0.6rem; }
.modal-confirm-actions button { flex: 1; margin-top: 0; }

/* ── Menu navigation mobile (toujours bottom sheet, overlay dédié) ── */
.modal-nav { padding: 1.5rem 0 2rem; }

/* L'overlay du menu nav est toujours en bas */
#mobile-nav-overlay {
  align-items: flex-end;
  padding: 0;
}

#mobile-nav-overlay .modal {
  border-radius: 24px 24px 0 0;
  max-width: 100%;
  animation: modal-in-mobile 0.28s cubic-bezier(.32,.72,0,1);
}

#mobile-nav-overlay .modal::before {
  content: '';
  display: block;
  width: 36px; height: 5px;
  border-radius: 3px;
  background: var(--text-3);
  margin: 0 auto 1.5rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
}

.mobile-nav-list a {
  display: block;
  padding: 0.95rem 1.75rem;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-1);
  border-bottom: 1px solid var(--sep);
  transition: background 0.15s;
}

.mobile-nav-list a:last-child { border-bottom: none; }
.mobile-nav-list a:active { background: var(--surface-3); }
.mobile-nav-list a.active { color: var(--seal); }
.mobile-nav-danger { color: var(--danger) !important; }

/* ── Wide modal (stats) ── */
.modal-wide { max-width: 580px; }
.modal-slug-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--wax);
  margin-bottom: 1.25rem;
}

/* ════════════════════════════════════════
   TOASTS
════════════════════════════════════════ */

.toast-container {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 0.6rem;
  z-index: 200; width: 100%; max-width: 380px;
  padding: 0 1rem; pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: var(--text-sm); color: var(--text-1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.22s cubic-bezier(.34,1.4,.64,1);
}

.toast.toast-leaving { animation: toast-out 0.18s ease forwards; }

.toast-action {
  background: transparent; border: none;
  color: var(--seal); font-weight: 600;
  font-size: var(--text-sm); cursor: pointer; white-space: nowrap;
}

.toast-action:hover { text-decoration: underline; }
.toast.toast-error   { background: color-mix(in srgb, var(--danger) 20%, var(--surface-2)); }
.toast.toast-success { background: color-mix(in srgb, var(--success) 15%, var(--surface-2)); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.toast-leaving { animation: none; }
}

/* ════════════════════════════════════════
   SKELETONS
════════════════════════════════════════ */

.skeleton {
  position: relative;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  color: transparent !important;
}

.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}

@keyframes skeleton-shimmer { to { transform: translateX(100%); } }

.skeleton-text { display: inline-block; height: 0.9em; width: 100%; border-radius: 4px; }
.skeleton-favicon { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; }
.dash-stat-value.skeleton { width: 3.5rem; height: 1.6rem; display: inline-block; }
.skeleton-row td { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.skeleton-row .dest-cell { display: flex; align-items: center; gap: 0.6rem; }
.skeleton-row .skeleton-text.w-60 { width: 60%; }
.skeleton-row .skeleton-text.w-40 { width: 40%; }
.skeleton-row .skeleton-text.w-24 { width: 24px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ════════════════════════════════════════
   VIEW TRANSITIONS
════════════════════════════════════════ */

.view-fade-out { animation: view-fade-out 0.12s ease forwards; }
.view-fade-in  { animation: view-fade-in 0.18s ease; }

@keyframes view-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(6px); }
}

@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .view-fade-out, .view-fade-in { animation: none; }
}

/* ════════════════════════════════════════
   PROFIL (grouped settings)
════════════════════════════════════════ */

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 560px;
}

.profile-card {
  background: var(--surface-1);
  border: none;
  border-radius: 16px;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.profile-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 1.6rem 0 0.6rem 0.2rem;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--sep);
  font-size: var(--text-base);
}

.profile-info-row:last-child { border-bottom: none; }

.profile-info-label { color: var(--text-1); }
.profile-info-value { color: var(--text-2); }
.profile-info-value.mono { font-family: var(--font-mono); font-size: var(--text-sm); }

.profile-card .form-field { padding: 0 1.1rem; margin-bottom: 1rem; }
.profile-card .form-field:first-of-type { padding-top: 0.75rem; }
.profile-card .btn-primary { margin: 0 1.1rem 1.1rem; display: block; text-align: center; }
.bio-actions-row { display: flex; align-items: center; gap: 1rem; padding: 0 1.1rem 0.75rem; }
.bio-actions-row .btn-primary { margin: 0 !important; display: inline-flex !important; width: auto !important; text-align: left; }

.profile-card-danger {
  background: color-mix(in srgb, var(--danger) 6%, transparent);
}

.danger-title { color: var(--danger) !important; }

.profile-danger-desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  padding: 0.75rem 1.1rem 0;
  line-height: 1.65;
}

.btn-danger {
  font-size: var(--text-base);
  font-weight: 600;
  color: #fff;
  background: var(--danger);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: opacity 0.15s;
  margin: 0.75rem 1.1rem 1.1rem;
  display: block;
}

.btn-danger:hover { opacity: 0.85; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.success-msg {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--success);
  margin-top: 0.5rem;
  display: none;
  padding: 0 1.1rem;
}

.success-msg.visible { display: block; }

/* ════════════════════════════════════════
   PARAMÈTRES — PAGE LINK-IN-BIO
════════════════════════════════════════ */

.profile-card-desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  padding: 0.75rem 1.1rem 0;
  line-height: 1.6;
}

.profile-card-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
  padding: 0 1.1rem 1rem;
  line-height: 1.55;
}

.bio-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bio-toggle-row .field-label { margin: 0; }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 999px;
  transition: background 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.switch input:checked + .switch-slider { background: var(--seal); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

.bio-handle-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bio-handle-prefix {
  padding: 0.6rem 0 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-3);
  white-space: nowrap;
}

.bio-handle-input-wrap .field-input {
  border: none;
  border-radius: 0;
}

.bio-public-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--seal);
}

.bio-public-link:hover { opacity: 0.85; }

/* ════════════════════════════════════════
   PAGE PUBLIQUE "LINK-IN-BIO" (/@handle)
════════════════════════════════════════ */

/* ── Page publique link-in-bio (/@handle) ── */

.bio-page-body {
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  /* Safe area pour les iPhone avec encoche / Dynamic Island */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.bio-page {
  width: 100%;
  max-width: 460px;
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
}

.bio-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sep);
  margin-bottom: 1rem;
  /* Évite le flash blanc pendant le chargement */
  background: var(--surface-1);
}

.bio-name {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.35rem;
  /* Évite les débordements sur très petits écrans */
  overflow-wrap: break-word;
}

.bio-desc {
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 1.75rem;
  overflow-wrap: break-word;
}

.bio-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.bio-link {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: 999px;
  color: var(--text-1);
  font-size: var(--text-md);
  font-weight: 600;
  /* Zone de tap généreuse + suppression du flash tactile iOS */
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.12s;
  overflow-wrap: break-word;
}

/* Hover uniquement sur les vrais pointeurs (souris) */
@media (hover: hover) {
  .bio-link:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
  }
}

/* Feedback tactile au tap sur mobile */
.bio-link:active {
  background: var(--surface-2);
  transform: scale(0.98);
  transition: background 0.08s, transform 0.08s;
}

.bio-empty {
  color: var(--text-3);
  font-size: var(--text-base);
  padding: 2rem 0;
}

.bio-footer {
  margin-top: 2.5rem;
  font-size: var(--text-xs);
  color: var(--text-3);
}

.bio-footer a { color: var(--wax); font-weight: 600; }

/* ── Ajustements mobile ── */
@media (max-width: 480px) {
  .bio-page {
    padding: 2.25rem 1rem 2rem;
  }

  .bio-avatar {
    width: 72px;
    height: 72px;
  }

  .bio-name {
    font-size: var(--text-xl);
  }

  .bio-links {
    gap: 0.55rem;
  }

  .bio-link {
    padding: 0.9rem 1rem;
    font-size: var(--text-base);
  }
}

/* ════════════════════════════════════════
   ACTION BUTTONS (table) — icônes toujours visibles
   (le swipe-to-reveal reste réservé aux cards mobile,
   où le geste tactile a du sens)
════════════════════════════════════════ */

.links-table tbody tr {
  position: relative;
}

.cell-inner {
  display: block;
}

.links-table td.actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  position: sticky;
  right: 0;
  background: var(--surface-1);
  box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.links-table tbody tr:hover td.actions { background: var(--surface-2); }

.links-table thead th:last-child {
  position: sticky;
  right: 0;
  background: var(--surface-1);
  z-index: 3;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.links-table tbody tr:hover .actions-row,
.links-table tbody tr:focus-within .actions-row {
  opacity: 1;
}

.actions-row button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background 0.15s, color 0.15s;
}

.actions-row button:hover { background: var(--surface-3); color: var(--text-1); }
.actions-row button:active { opacity: 0.7; }

.actions-row button svg {
  display: block;
  flex-shrink: 0;
}

.actions-row .act-pin svg { fill: none; }
.actions-row .act-pin.pinned { color: var(--warning); }
.actions-row .act-pin.pinned svg { fill: currentColor; }

.actions-row .act-copy.copied {
  width: auto;
  padding: 0 0.5rem;
  color: var(--success);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.actions-row .act-delete:hover { background: var(--danger); color: #fff; }

.action-btn {
  font-size: var(--text-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 0.3rem;
  line-height: 1;
  transition: color 0.15s;
}

.action-btn:hover { color: var(--text-1); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.copy-row-btn.copied { color: var(--success); }

@keyframes row-fade-out {
  to { opacity: 0; transform: translateX(6px); }
}

.row-deleting { animation: row-fade-out 0.28s ease forwards; }

/* ════════════════════════════════════════
   DEST CELL / FAVICON
════════════════════════════════════════ */

.dest-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  /* FIX: réduit de 260px → 180px pour libérer de l'espace pour "CRÉÉ LE" */
  max-width: 180px;
  overflow: hidden;
}

.dest-cell-inner {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.dest {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.favicon {
  width: 16px; height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   EXPIRY BADGES
════════════════════════════════════════ */

.expiry-expired { color: var(--danger);  font-size: var(--text-xs); }
.expiry-soon    { color: var(--warning); font-size: var(--text-xs); }
.expiry-ok      { color: var(--text-2);  font-size: var(--text-xs); }
.muted-text     { color: var(--text-2);  font-size: var(--text-base); }

/* ════════════════════════════════════════
   STATS FULLSCREEN
════════════════════════════════════════ */

.stats-fs-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 120;
  display: none;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  overflow: hidden;
  will-change: opacity;
}

.stats-fs-overlay.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.stats-fs {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.stats-fs-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--sep);
  flex-shrink: 0;
}

.stats-fs-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--seal);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: background 0.12s;
}
.stats-fs-back:hover { background: var(--surface-2); }

.stats-fs-title {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-1);
  text-align: center;
}

.stats-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 3rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--sep) transparent;
}

.stats-fs-body::-webkit-scrollbar { width: 6px; }
.stats-fs-body::-webkit-scrollbar-track { background: transparent; }
.stats-fs-body::-webkit-scrollbar-thumb { background: var(--sep); border-radius: 99px; }
.stats-fs-body::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Hero KPIs ── */

.stats-hero {
  margin-bottom: 2rem;
}

.stats-dest-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  color: var(--text-3);
  text-decoration: none;
  word-break: break-all;
  margin-bottom: 1rem;
  transition: color 0.12s;
}
.stats-dest-link:hover { color: var(--text-1); }
.stats-dest-text { text-decoration: underline; text-underline-offset: 3px; }

.skpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.skpi-card {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--sep);
}

.skpi-card.skpi-primary {
  border-color: var(--seal);
  background: color-mix(in srgb, var(--seal) 8%, var(--surface-2));
}

.skpi-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  font-weight: 600;
}

.skpi-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}

.skpi-value.skpi-sm { font-size: var(--text-lg); }

.skpi-card.skpi-primary .skpi-value { color: var(--seal); }

/* ── Sections ── */

.stats-section {
  margin-bottom: 2rem;
}

.stats-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 0 0 0.85rem;
}

.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .stats-grid-2 { grid-template-columns: 1fr; }
  .skpi-row { grid-template-columns: 1fr 1fr; }
}

/* ── Line chart ── */

.linechart-wrap {
  background: var(--surface-2);
  border-radius: 16px;
  border: 1px solid var(--sep);
  padding: 1rem 0.5rem 0.5rem;
  overflow: hidden;
}

.linechart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--sep);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-axis-label {
  font-size: 10px;
  fill: var(--text-3);
  font-family: var(--font-mono);
}

.chart-dot {
  fill: var(--seal);
  stroke: var(--bg);
  stroke-width: 2;
  transition: r 0.1s;
  cursor: pointer;
}
.chart-dot:hover { r: 6; }

/* ── Bar list ── */

.sbar-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.sbar-label {
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbar-track {
  background: var(--surface-3);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.sbar-fill {
  height: 100%;
  background: var(--seal);
  border-radius: 99px;
  min-width: 4px;
  transition: width 0.4s ease;
}

.sbar-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  text-align: right;
  font-family: var(--font-mono);
}

/* ── Donut chart ── */

.stats-donut-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--surface-2);
  border-radius: 16px;
  border: 1px solid var(--sep);
  padding: 1.25rem 1.5rem;
}

.donut-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut-center {
  font-size: 20px;
  font-weight: 700;
  fill: var(--text-1);
  font-family: var(--font-mono);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-base);
  color: var(--text-2);
  min-width: 0;
  -webkit-font-smoothing: antialiased;
}

.donut-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-pct {
  margin-left: auto;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-2);
  flex-shrink: 0;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 480px) {
  .stats-donut-row { flex-direction: column; align-items: flex-start; }
  .donut-svg { width: 110px; height: 110px; }
  .sbar-row { grid-template-columns: 100px 1fr 36px; }
}

/* ════════════════════════════════════════
   PAGE 404
════════════════════════════════════════ */

.notfound-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 54px);
  padding: 3rem 1.5rem;
  text-align: center;
}

.notfound-seal {
  width: 80px; height: 80px;
  margin-bottom: 2rem;
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.notfound-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin-bottom: 0.75rem;
}

.notfound-sub {
  font-size: var(--text-base);
  color: var(--text-2);
  margin-bottom: 2.25rem;
  max-width: 40ch;
  line-height: 1.7;
}

.notfound-slug {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--wax);
  background: var(--wax-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.notfound-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ════════════════════════════════════════
   PAGES LÉGALES (mentions, confidentialité)
════════════════════════════════════════ */

.legal-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 54px);
}

.legal-content {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  flex: 1;
  padding: 3.5rem 1.5rem 4rem;
}

.legal-eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.legal-content h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: var(--text-sm);
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-1);
  margin: 2.25rem 0 0.85rem;
}

.legal-content h2:first-of-type { margin-top: 0; }

.legal-content p {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 1rem;
}

.legal-content ul {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
}

.legal-content li {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.legal-content strong { color: var(--text-1); font-weight: 600; }

.legal-content a {
  color: var(--wax);
  transition: color 0.15s;
}

.legal-content a:hover { color: var(--text-1); }

.legal-card {
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.25rem 0;
}

.legal-card p:last-child { margin-bottom: 0; }

.legal-placeholder {
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-base);
  color: var(--text-2);
  margin-bottom: 2rem;
  transition: color 0.15s;
}

.legal-back:hover { color: var(--text-1); }

.legal-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-1);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  color: var(--text-1);
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.5rem;
}

.api-endpoint code {
  font-size: var(--text-md);
  padding: 0.2rem 0.55rem;
}

.api-method {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  flex-shrink: 0;
}

.api-method.get  { background: var(--wax-soft); color: var(--wax); }
.api-method.post { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }

.api-code {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */

@media (max-width: 680px) {
  .public-header nav,
  .app-nav { position: static; transform: none; display: none; }

  .nav-toggle { display: flex; }

  .dash-stats { grid-template-columns: 1fr 1fr; }

  .app-view { padding: 1.5rem 1rem 3rem; }

  .landing-hero { padding: 3.5rem 1.25rem 2.5rem; }
  .landing-stats { gap: 2.5rem; }
  .landing-footer { flex-direction: column; gap: 1rem; text-align: center; padding: 1.5rem 1.25rem; }

  .page-header { flex-direction: column; gap: 1rem; }

  .url-row { max-width: 100%; }

  /* Sur mobile : bottom sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    border-radius: 24px 24px 0 0;
    padding: 2rem 1.5rem 2.5rem;
    max-width: 100%;
    animation: modal-in-mobile 0.28s cubic-bezier(.32,.72,0,1);
  }

  @keyframes modal-in-mobile {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: none; }
  }

  /* grabber visible sur mobile */
  .modal::before {
    content: '';
    display: block;
    width: 36px; height: 5px;
    border-radius: 3px;
    background: var(--text-3);
    margin: 0 auto 1.5rem;
  }

  /* Le modal confirm reste centré même sur mobile */
  .modal-confirm {
    border-radius: 20px;
    margin: auto;
    padding: 1.75rem 1.5rem;
  }

  /* Le menu nav mobile reste en bottom sheet */
  .modal-nav {
    border-radius: 24px 24px 0 0;
  }
}

/* ── QR Code modal ── */
.modal-qr { max-width: 320px; text-align: center; }
.modal-qr .modal-hint {
  font-size: var(--text-sm);
  color: var(--text-2);
  word-break: break-all;
  margin-bottom: .5rem;
}
.qr-btn {
  padding: .35rem .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#qr-container canvas,
#qr-container img {
  border-radius: 10px;
  border: 6px solid #fff;
  display: block;
  margin: 0 auto;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 0 .5rem;
}
.pagination-btn {
  background: var(--surface-2);
  border: 1px solid var(--sep);
  color: var(--text-1);
  border-radius: 8px;
  padding: .45rem 1rem;
  font-size: var(--text-base);
  cursor: pointer;
  transition: background .15s;
}
.pagination-btn:hover:not(:disabled) { background: var(--surface-3); }
.pagination-btn:disabled { opacity: .35; cursor: default; }
.pagination-info {
  font-size: var(--text-base);
  color: var(--text-2);
  min-width: 90px;
  text-align: center;
}

/* ── Recherche liens ── */
.links-search-wrap {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}
.links-search {
  width: 100%;
  max-width: 360px;
}
/* ════════════════════════════════════════
   MOBILE IMPROVEMENTS
════════════════════════════════════════ */

/* ── Tab bar : cachée par défaut, visible seulement via JS sur mobile ── */
.app-tab-bar {
  display: none;
}

@media (max-width: 680px) {

  /* ── Tab bar ── */
  .app-tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--sep);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
  }

  .tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 4px;
    color: var(--text-3);
    font-size: var(--text-3xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    min-height: 44px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.15s;
  }

  .tab-bar-item svg {
    width: 22px; height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .tab-bar-item.active { color: var(--seal); }

  .tab-bar-item.tab-create { color: #fff; }

  .tab-create-icon {
    width: 40px; height: 40px;
    background: var(--seal);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    flex-shrink: 0;
  }

  .tab-bar-item.tab-create svg {
    width: 20px; height: 20px;
    stroke: #fff;
    stroke-width: 2.2;
  }

  /* Cache le hamburger sur mobile connecté (tab bar remplace) */
  .app-header .nav-toggle { display: none; }

  /* Header connecté plus compact */
  .app-header { height: 48px; }

  /* Contenu des vues app pousse vers le haut pour ne pas se cacher sous la tab bar */
  .app-view {
    padding-bottom: calc(3rem + 56px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Toast au-dessus de la tab bar ── */
  .toast-container {
    bottom: calc(2rem + 56px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Landing : champ URL pleine largeur ── */
  .input-zone { padding: 0 1rem; }
  .url-row { max-width: 100%; }

  /* ── Landing : stamp-label plus lisible ── */
  .stamp-label {
    font-size: var(--text-sm);
    color: var(--text-2);
  }

  /* ── Formulaire créer un lien : form-row en colonne ── */
  .form-row { flex-direction: column; gap: 0; }

  /* ── Bouton "Sceller le lien" plus haut ── */
  .btn-large {
    min-height: 52px;
    padding: 1rem 2rem;
    font-size: var(--text-md);
  }

  /* ── Create card : padding réduit ── */
  .create-card {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }

  .link-type-selector {
    gap: 0.4rem;
  }

  .link-type-btn {
    padding: 0.7rem 0.4rem 0.6rem;
    font-size: var(--text-xs);
    gap: 0.25rem;
  }

  .link-type-btn svg {
    width: 17px;
    height: 17px;
  }

  .link-type-desc {
    font-size: var(--text-2xs);
  }

  /* ── Recherche liens pleine largeur ── */
  .links-search { max-width: 100%; }

  /* ════════════════════════════════════════
     TABLEAUX → CARTES MOBILES
  ════════════════════════════════════════ */

  /* Le wrapper scroll redevient normal flow */
  .links-table-wrap {
    overflow-x: visible;
    background: transparent;
    border-radius: 0;
  }

  /* Cache le tableau et son header */
  .links-table { display: none; }

  /* Remplace par une liste de cartes */
  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-card {
    background: var(--surface-1);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.1s;
  }

  .mobile-card:active { background: var(--surface-2); }

  .mobile-card-inner {
    transition: transform 0.25s cubic-bezier(.32,.72,0,1);
  }

  .mobile-card.revealed .mobile-card-inner {
    transform: translateX(-172px);
  }

  .mobile-card-slug {
    font-family: var(--font-mono);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 0.3rem;
  }

  .mobile-card-dest {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
  }

  .mobile-card-dest img {
    width: 14px; height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .mobile-card-dest span {
    font-size: var(--text-xs);
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-xs);
    color: var(--text-3);
    font-family: var(--font-mono);
  }

  .mobile-card-actions {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 215px;
    display: flex;
    transform: translateX(215px);
    transition: transform 0.25s cubic-bezier(.32,.72,0,1);
  }

  .mobile-card.revealed .mobile-card-actions {
    transform: translateX(0);
  }

  .mobile-card-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: var(--text-md);
    color: #fff;
    transition: opacity 0.15s;
  }

  .mobile-card-actions button:active { opacity: 0.7; }
  .mobile-card-actions button svg { display: block; flex-shrink: 0; }
  .mobile-card-actions .act-copy   { background: var(--surface-3); }
  .mobile-card-actions .act-stats  { background: var(--seal); }
  .mobile-card-actions .act-edit   { background: var(--surface-2); }
  .mobile-card-actions .act-pin    { background: var(--surface-3); }
  .mobile-card-actions .act-pin svg { fill: none; }
  .mobile-card-actions .act-pin.pinned { background: var(--warning); }
  .mobile-card-actions .act-pin.pinned svg { fill: currentColor; }
  .mobile-card-actions .act-delete { background: var(--danger); }

  /* Hint flèche sur la première carte */
  .mobile-cards:not(.swipe-seen) .mobile-card:first-child::after {
    content: '←';
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-base);
    color: var(--text-3);
    pointer-events: none;
    animation: swipe-hint 2s ease 1.2s both;
  }

  @keyframes swipe-hint {
    0%   { opacity: 0; transform: translateY(-50%) translateX(4px); }
    25%  { opacity: 1; transform: translateY(-50%) translateX(-4px); }
    75%  { opacity: 1; transform: translateY(-50%) translateX(-4px); }
    100% { opacity: 0; transform: translateY(-50%) translateX(0); }
  }

  /* Pagination reste visible */
  .pagination { padding-top: 1rem; }
}
/* ── Bio : thème picker ── */
.bio-theme-picker {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.bio-theme-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--sep);
  padding: 0;
  transition: outline 0.1s, transform 0.1s;
}
.bio-theme-swatch:hover { transform: scale(1.1); }

/* ── Bio : compteur de vues ── */
.bio-views-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
}
.bio-views-label { color: var(--text-2); }
.bio-views-count { font-weight: 600; color: var(--text-1); }

/* ── Bio : réordonnancement des liens épinglés ── */
.bio-pins-sortable {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.bio-pin-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--sep);
  border-radius: var(--radius-sm);
  user-select: none;
  -webkit-user-select: none;
  cursor: grab !important;
  transition: background 0.12s, opacity 0.12s;
}
.bio-pin-row.dragging { opacity: 0.45; cursor: grabbing !important; }
.bio-pin-row.drag-over { background: var(--surface-3); border-color: var(--seal); }
.bio-pin-drag { font-size: var(--text-md); color: var(--text-3); flex-shrink: 0; }
.bio-pin-label { flex: 1; font-size: var(--text-base); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bio-pin-slug { font-size: var(--text-xs); color: var(--text-3); font-family: var(--font-mono); flex-shrink: 0; }