/* =====================================================================
   z4g.fr — design minimal. Monochrome, une seule couleur d'accent,
   tous les contrôles à la même hauteur, animations discrètes.
   ===================================================================== */
:root {
  --bg: #0b0b0c;
  --bg-soft: #0f0f11;
  --panel: #131315;
  --panel-2: #1b1b1e;
  --border: #26262a;
  --border-strong: #3a3a40;
  --text: #ededee;
  --muted: #8b8b93;
  --accent: #5b9dff;
  --accent-2: #5b9dff;
  --accent-grad: #5b9dff;           /* plus de dégradé : couleur unie */
  --danger: #e5484d;
  --success: #3fb97a;
  --nav-bg: rgba(11, 11, 12, 0.85);
  --radius: 12px;
  --ctrl: 36px;                     /* hauteur unique des boutons / liens de la barre */
  --shadow: none;
}
body.light-mode {
  --bg: #fafafa;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f1f3;
  --border: #e4e4e7;
  --border-strong: #cfcfd4;
  --text: #111113;
  --muted: #6b6b74;
  --accent: #2563eb;
  --accent-2: #2563eb;
  --accent-grad: #2563eb;
  --success: #1f9d61;
  --nav-bg: rgba(250, 250, 250, 0.85);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 15px;
  transition: background-color .2s ease, color .2s ease;
}
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }
p { line-height: 1.6; color: var(--muted); }
h1, h2, h3 { margin-top: 0; letter-spacing: -0.4px; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes spinIcon { to { transform: rotate(360deg); } }
.container, .section { animation: fadeUp .3s ease both; }
.card { animation: fadeUp .3s ease both; }
.alert { animation: pop .2s ease both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Barre du haut : tout sur la même ligne, même hauteur ---- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  height: 60px; padding: 0 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--nav-bg); backdrop-filter: blur(10px); z-index: 50;
}
.nav .logo { display: inline-flex; align-items: center; gap: 8px; height: var(--ctrl); font-weight: 800; font-size: 18px; letter-spacing: -0.4px; color: var(--text); }
.nav .logo span { color: var(--accent); }
.logo-img { height: 28px; width: 28px; object-fit: cover; border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.nav-links form { margin: 0; display: flex; }
.nav-links > a, .nav-links > form > button, .nav-links > .btn, .nav-links > button {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctrl); margin: 0; padding: 0 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; line-height: 1;
}
.nav-links > a { color: var(--muted); }
.nav-links > a:hover { color: var(--text); background: var(--panel-2); opacity: 1; }
.nav-links > .btn { margin-left: 4px; }

/* Bouton clair / sombre : petit carré à contour fin avec soleil ou lune */
.theme-btn {
  width: var(--ctrl); height: var(--ctrl); padding: 0; margin: 0 4px 0 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--text); cursor: pointer; box-shadow: none;
}
.theme-btn:hover { background: var(--panel-2); transform: none; }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
body.light-mode .theme-btn .i-sun { display: block; }
body.light-mode .theme-btn .i-moon { display: none; }
.theme-btn.spin svg { animation: spinIcon .4s ease; }

/* ---- Mise en page ---- */
.container { max-width: 480px; margin: 0 auto; padding: 48px 20px; }
.wide { max-width: 960px; }
.center { text-align: center; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
  transition: border-color .2s ease;
}

/* ---- Formulaires : champs et boutons à la même hauteur ---- */
label { display: block; margin: 16px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, textarea, select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-size: 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=color] { padding: 3px; cursor: pointer; }
input[type=checkbox] { width: auto; height: auto; }
textarea { height: auto; min-height: 90px; padding: 10px 12px; font-family: ui-monospace, monospace; resize: vertical; }

button, .btn {
  margin-top: 20px; height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--text);
  background: var(--text); color: var(--bg); font-weight: 600; cursor: pointer; font-size: 14px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
  box-shadow: none;
}
button:hover, .btn:hover { opacity: .88; transform: none; }
button:active, .btn:active { transform: scale(.96); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary, .btn.secondary { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
button.secondary:hover, .btn.secondary:hover { background: var(--panel-2); opacity: 1; }
button.danger { background: transparent; border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; opacity: 1; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--panel-2); color: var(--text); opacity: 1; }
button:disabled { opacity: .5; cursor: not-allowed; }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid var(--border); border-left-width: 3px; background: var(--panel); }
.alert.error { border-left-color: var(--danger); color: var(--danger); }
.alert.success { border-left-color: var(--success); color: var(--success); }

/* ---- Tableaux ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr { transition: background-color .15s; }
tbody tr:hover { background: var(--panel-2); }
td form { margin: 0; }
td button { margin: 0; height: 32px; padding: 0 12px; font-size: 13px; }
td select { height: 32px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); }
.badge.starter { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.badge.pro { color: var(--text); border-color: var(--text); }

/* ---- Onglets du dashboard ---- */
.app-tabs { display: flex; align-items: center; gap: 2px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.app-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; }
.app-tabs a:hover { color: var(--text); opacity: 1; }
.app-tabs a.active { color: var(--text); border-color: var(--text); }

.link-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; cursor: grab; transition: opacity .15s, background-color .15s; }
.link-item:last-of-type { border-bottom: none; }
.link-item.dragging { opacity: .4; }
.link-item > div:nth-child(2) { flex: 1; }
.link-item form { margin: 0; }
.link-item button, .link-item .btn { margin: 0; height: 32px; padding: 0 12px; font-size: 13px; }
.drag-handle { color: var(--muted); font-size: 18px; user-select: none; }

/* ---- Offres ---- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg-soft); position: relative; transition: border-color .2s, transform .2s; }
.plan-box:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan-box.active, .plan-box.highlight { border-color: var(--text); }
.plan-box .tag { position: absolute; top: -10px; right: 16px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.plan-box h3 { font-size: 16px; margin-bottom: 4px; }
.plan-price { font-size: 24px; font-weight: 800; margin: 6px 0 12px; }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-box ul { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--muted); }
.plan-box li { padding: 5px 0 5px 20px; position: relative; }
.plan-box li::before { content: '✓'; position: absolute; left: 0; color: var(--text); font-weight: 700; }
.plan-box li.no::before { content: '—'; color: var(--muted); }
.plan-box li.no { opacity: .5; }

/* ---- Page d'accueil ---- */
.hero { text-align: center; padding: 80px 20px 50px; }
.hero-badge { display: inline-block; border: 1px solid var(--border-strong); padding: 5px 14px; border-radius: 20px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.hero h1 { font-size: 46px; line-height: 1.1; max-width: 720px; margin: 0 auto 18px; }
.hero h1 .grad { color: var(--accent); background: none; -webkit-text-fill-color: currentColor; }
.hero p.lead { font-size: 17px; max-width: 540px; margin: 0 auto 28px; }
.hero-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-ctas .btn { margin-top: 0; height: 44px; padding: 0 24px; font-size: 15px; }

.section { max-width: 960px; margin: 0 auto; padding: 60px 20px; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 28px; }
.section-head p { max-width: 500px; margin: 8px auto 0; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: border-color .2s, transform .2s; }
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature .icon { width: 38px; height: 38px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { font-size: 14px; margin: 0; }

.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.featured-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; transition: transform .15s, border-color .15s; }
.featured-card:hover { transform: translateY(-2px); border-color: var(--border-strong); opacity: 1; }
.featured-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }

.final-cta { text-align: center; padding: 80px 20px; border-top: 1px solid var(--border); }
.final-cta h2 { font-size: 28px; margin-bottom: 8px; }
.final-cta .btn { margin-top: 12px; }

.site-footer { border-top: 1px solid var(--border); padding: 26px 24px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- Page bio publique (les couleurs viennent du profil de l'utilisateur) ---- */
.footer-brand { text-align: center; padding: 20px; }
.footer-brand.lg { font-size: 15px; opacity: 1; }
.footer-brand.sm { font-size: 11px; opacity: .6; }
.profile-link {
  display: block; width: 100%; text-align: center; padding: 15px; margin-bottom: 12px;
  border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  font-weight: 600; transition: transform .12s, background .12s;
}
.profile-link:hover { transform: translateY(-2px); opacity: 1; }
.profile-link:active { transform: scale(.98); }
.avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 16px; border: 3px solid rgba(255,255,255,0.15); }
.profile-page { max-width: 480px; margin: 0 auto; padding: 55px 20px; text-align: center; min-height: 100vh; }

/* ---- Personnalisation : thèmes rapides + aperçu ---- */
.customize-layout { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.customize-layout form { flex: 1 1 320px; min-width: 280px; }
.palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.palette-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; height: auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; margin: 0; color: var(--text);
  transition: border-color .15s, transform .12s;
}
.palette-swatch:hover { border-color: var(--border-strong); opacity: 1; }
.palette-swatch.selected { border-color: var(--text); }
.swatch-preview { width: 100%; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(128,128,128,0.25); }
.swatch-dot { width: 12px; height: 12px; border-radius: 50%; }
.swatch-label { font-size: 11px; color: var(--muted); text-align: center; font-weight: 500; }
.preview-wrap { flex: 0 0 260px; position: sticky; top: 80px; }
.preview-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.preview-frame {
  width: 260px; min-height: 400px; border-radius: 18px; padding: 28px 18px; text-align: center;
  border: 5px solid var(--panel-2); overflow: hidden; transition: background .15s, color .15s;
}
.preview-frame h1 { font-size: 19px; margin: 0 0 6px; }
.preview-frame p { font-size: 12px; margin: 0; color: inherit; }
.preview-frame .profile-link { padding: 10px; font-size: 12px; margin-bottom: 9px; }

/* ---- Messages, signalements ---- */
.msg-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.msg-item:last-child { border-bottom: none; }
.msg-item.unread { border-left: 2px solid var(--accent); padding-left: 12px; }
.msg-item form { margin: 0; }
.msg-item button { margin: 0; height: 30px; padding: 0 12px; font-size: 12px; }
.unread-badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.report-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.report-row form { margin: 0; }
.report-row button { margin: 0; height: 32px; padding: 0 12px; font-size: 13px; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .nav { padding: 0 12px; }
  .nav .logo { font-size: 16px; }
  .nav-links { gap: 2px; font-size: 13px; }
  .nav-links > a, .nav-links > form > button, .nav-links > .btn { padding: 0 8px; font-size: 13px; }
  .hero { padding-top: 56px; }
  .hero h1 { font-size: 32px; }
  .container, .container.wide { padding: 28px 14px; }
  .card { padding: 18px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .plans-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(3, 1fr); }
  .link-item { flex-wrap: wrap; }
  .link-item > div:first-of-type { flex: 1 1 100%; order: 1; }
  .link-item form, .link-item .btn { order: 2; }
  .customize-layout { flex-direction: column; }
  .preview-wrap { position: static; margin: 0 auto; width: 100%; }
  .preview-frame { width: 100%; max-width: 320px; margin: 0 auto; }
  #unsaved-bar { flex-direction: column; align-items: stretch; text-align: center; }
  #unsaved-bar button { width: 100%; }
}

/* ---- Sélecteur de langue (même hauteur que le reste de la barre) ---- */
.lang-select {
  width: auto; height: var(--ctrl); margin: 0 4px 0 0; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.lang-select:hover { background: var(--panel-2); }
.lang-select option { background: var(--panel); color: var(--text); }
@media (max-width: 640px) { .lang-select { padding: 0 4px; max-width: 78px; } }

/* =====================================================================
   Animations supplémentaires (toutes coupées si prefers-reduced-motion)
   ===================================================================== */
button, .btn { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

body.leaving { opacity: 0; transition: opacity .15s ease; }

/* arrivée en cascade des cartes et du haut de la page d'accueil */
.container > .card:nth-of-type(2), .wide > .card:nth-of-type(2) { animation-delay: .05s; }
.container > .card:nth-of-type(3), .wide > .card:nth-of-type(3) { animation-delay: .10s; }
.container > .card:nth-of-type(4), .wide > .card:nth-of-type(4) { animation-delay: .15s; }
.container > .card:nth-of-type(n+5), .wide > .card:nth-of-type(n+5) { animation-delay: .2s; }
.hero > * { animation: fadeUp .5s ease both; }
.hero > *:nth-child(2) { animation-delay: .07s; }
.hero > *:nth-child(3) { animation-delay: .14s; }
.hero > *:nth-child(4) { animation-delay: .21s; }

/* petits mouvements au survol */
.logo-img { transition: transform .25s ease; }
.nav .logo:hover .logo-img { transform: rotate(-8deg) scale(1.08); }
.nav .logo:hover { opacity: 1; }
.theme-btn:hover svg { transform: rotate(18deg); }
.theme-btn svg { transition: transform .25s ease; }
.link-item:hover, .msg-item:hover { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.palette-swatch:hover { transform: translateY(-2px); }
.app-tabs a.active { animation: pop .25s ease both; }
.unread-badge { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, 0); } }
.badge { transition: transform .15s ease, border-color .15s ease; }
.badge:hover { transform: scale(1.06); }
.hero-badge { animation: fadeUp .5s ease both, floaty 4s ease-in-out 1s infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* le changement clair/sombre se fait en fondu sur tous les éléments principaux */
.card, .nav, .plan-box, .feature, .featured-card, .palette-swatch, input, select, textarea, th, td, .alert {
  transition-property: background-color, border-color, color, transform, box-shadow, opacity;
  transition-duration: .25s;
}

/* ---- Barre latérale de l'espace membre ---- */
.container.wide:has(> .sidebar) {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 36px; row-gap: 0;
  max-width: 1240px; align-items: start;
}
.container.wide:has(> .sidebar) > :not(.sidebar) { grid-column: 2; min-width: 0; }
.sidebar { grid-column: 1; grid-row: 1 / 999; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.sidebar-toggle { display: none; }
.sidebar-body { display: flex; flex-direction: column; gap: 2px; }
.sb-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px 10px; }
.sb-title:first-child { margin-top: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; transition: background .15s, color .15s, transform .15s; }
.sidebar a:hover { background: var(--panel-2); color: var(--text); opacity: 1; transform: translateX(2px); }
.sidebar a.active, .sb-site.active { background: var(--panel-2); color: var(--text); }
.sidebar a.active { animation: pop .25s ease both; }
.sidebar svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar a.sb-sub { padding-left: 36px; height: 30px; font-size: 13px; }
.sidebar a.sb-add { color: var(--accent); }
.sb-site { display: flex; align-items: center; border-radius: 8px; }
.sb-site .sb-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-site .sb-ext { width: 30px; height: 30px; padding: 0; justify-content: center; flex: none; }
.sb-logout { margin: 14px 0 0; }
.sb-logout button { width: 100%; height: var(--ctrl); margin: 0; }
html { scroll-behavior: smooth; }
.card[id] { scroll-margin-top: 80px; }
@media (max-width: 900px) {
  .container.wide:has(> .sidebar) { display: block; }
  .sidebar { position: static; max-height: none; margin-bottom: 20px; }
  .sidebar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; height: var(--ctrl); margin: 0; background: var(--panel); color: var(--text); border: 1px solid var(--border); }
  .sidebar-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .sidebar-body { display: none; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
  .sidebar.open .sidebar-body { display: flex; }
}
.ip-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---- Mot de passe : jauge, générateur ---- */
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; margin: 0; }
.pw-btn { margin: 0; width: var(--ctrl); padding: 0; flex: none; height: auto; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.pw-meter i { height: 4px; border-radius: 2px; background: var(--border); transition: background .25s; }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: #e8a23a; }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: #b5c93a; }
.pw-meter[data-level="4"] i { background: var(--success); }
.pw-label { font-size: 12px; color: var(--muted); min-height: 16px; margin-top: 4px; }
.pw-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.pw-actions button { margin: 0; height: 32px; font-size: 13px; padding: 0 12px; }
.pw-match { font-size: 12px; min-height: 16px; margin-top: 4px; }
.pw-match.ok { color: var(--success); } .pw-match.ko { color: var(--danger); }

/* ---- Blocs de lien cliquables ---- */
.block-picker-title { font-size: 13px; color: var(--muted); margin: 18px 0 8px; }
.block-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.block-btn { display: flex; align-items: center; gap: 8px; height: 40px; margin: 0; padding: 0 12px; justify-content: flex-start;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 500; }
.block-btn i { width: 10px; height: 10px; border-radius: 50%; background: var(--bc); flex: none; }
.block-btn:hover { border-color: var(--bc); transform: translateY(-1px); }
.block-btn.on { border-color: var(--bc); box-shadow: 0 0 0 1px var(--bc); }

/* ---- Pop-up Discord ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.modal-backdrop.closing { opacity: 0; transition: opacity .2s; }
.modal { position: relative; width: 100%; max-width: 400px; padding: 28px 24px 22px; text-align: center; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; animation: pop .25s ease both; }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 20px; }
.modal .btn { display: flex; justify-content: center; width: 100%; height: 44px; margin: 0 0 8px; background: #5865F2; border-color: #5865F2; color: #fff; }
.modal .ghost { width: 100%; margin: 0; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; padding: 0; margin: 0; background: transparent; border: none; color: var(--muted); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Optimisation téléphone ---- */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }              /* évite le zoom automatique sur iPhone */
  button, .btn { min-height: 40px; }
  .nav { height: 54px; }
  .nav .nav-member { display: none; }                      /* connecté : tout est dans le menu latéral */
  .container, .container.wide { padding: 20px 12px 40px; }
  h1 { font-size: 24px; }
  .card { padding: 16px; border-radius: 12px; }
  .link-item { padding: 12px 0; }
  .link-item .drag-handle { display: none; }
  .block-picker { grid-template-columns: repeat(2, 1fr); }
  .report-row, .msg-item { flex-wrap: wrap; }
  .modal { padding: 24px 18px 18px; }
  form[style*="display:flex"] { flex-wrap: wrap; }
  .sidebar-body a { height: 40px; }
  .sidebar a.sb-sub { height: 36px; }
  .sb-site .sb-ext { height: 36px; width: 40px; }
  .pw-actions button { flex: 1; }
}
@media (max-width: 380px) { .lang-select { max-width: 60px; } .nav .logo { font-size: 15px; } }
