/* StayHers : codes visuels familiers des plateformes de créatrices
   (fond clair, accent bleu, menu à icônes, profil avec bannière, galerie carrée, fil de publications). */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --surface: #ffffff;
  --text: #0f1419;
  --muted: #6b7680;
  --border: #e7eaed;
  --accent: #1c8ee6;
  --accent-hover: #1479c7;
  --accent-soft: #e8f3fd;
  --on-accent: #ffffff;
  --ok: #17845a;
  --ok-soft: #e4f5ee;
  --warn: #9a6400;
  --warn-soft: #fff4dc;
  --danger: #d93a35;
  --danger-soft: #fdebea;
  --overlay: rgba(0, 0, 0, .55);
  --radius: 14px;
  --sidebar: 268px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1013; --bg-soft: #161a1f; --surface: #12161a; --text: #e9edf0; --muted: #8b959e;
    --border: #252b31; --accent: #3aa0f0; --accent-hover: #5cb2f4; --accent-soft: #14283a; --on-accent: #06121c;
    --ok: #4fcf96; --ok-soft: #12291f; --warn: #f2c063; --warn-soft: #2e2512; --danger: #ff7b74; --danger-soft: #331816;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1013; --bg-soft: #161a1f; --surface: #12161a; --text: #e9edf0; --muted: #8b959e;
  --border: #252b31; --accent: #3aa0f0; --accent-hover: #5cb2f4; --accent-soft: #14283a; --on-accent: #06121c;
  --ok: #4fcf96; --ok-soft: #12291f; --warn: #f2c063; --warn-soft: #2e2512; --danger: #ff7b74; --danger-soft: #331816;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Menu latéral ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 18px 16px;
  border-right: 1px solid var(--border); background: var(--bg);
  display: flex; flex-direction: column; gap: 6px; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; fill: var(--accent); }
.brand-mark .tick { fill: none; stroke: var(--on-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.me { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--text); margin-bottom: 8px; }
.me:hover { background: var(--bg-soft); text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-text b, .me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.avatar.xl { width: 112px; height: 112px; font-size: 38px; border: 4px solid var(--bg); }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a {
  display: flex; align-items: center; gap: 16px; padding: 11px 12px; border-radius: 999px;
  color: var(--text); font-size: 16px; font-weight: 500;
}
nav a:hover { background: var(--bg-soft); text-decoration: none; }
nav a.active { color: var(--accent); font-weight: 700; }
.ico { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a.active .ico { stroke-width: 2.4; }
.badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.badge:empty { display: none; }
.dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; }
.dot.on { display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.sidebar-note { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 12px; }

/* ---------- Colonne principale ---------- */
main {
  margin-left: var(--sidebar); max-width: 940px; min-height: 100vh;
  border-right: 1px solid var(--border); padding: 24px 28px 60px;
}
.view { display: none; }
.view.active { display: block; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.warn { background: var(--warn-soft); border-color: transparent; }
.card p { margin: 0 0 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.doc { display: flex; flex-direction: column; gap: 8px; }
.doc p { flex: 1; margin: 0; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

/* ---------- Accueil façon profil ---------- */
.profile-head { margin: -24px -28px 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.cover {
  height: 170px;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent) 0%, transparent 60%),
    linear-gradient(120deg, var(--accent-hover), var(--accent-soft));
  opacity: .9;
}
.head-row { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 28px; margin-top: -56px; }
.head-actions { display: flex; gap: 8px; padding-bottom: 6px; }
.head-id { padding: 10px 28px 0; }
.head-id h1 { margin: 0; }
.stats { display: flex; gap: 28px; padding: 14px 28px 10px; flex-wrap: wrap; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.alert b { color: var(--danger); }
.stat.good b { color: var(--ok); }

/* ---------- Formulaires ---------- */
input, textarea, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; }
label input, label textarea { margin-top: 6px; font-weight: 400; }
label.inline { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
label.inline input { width: 80px; margin: 0; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 14px; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.card label + label, .card label.check + label.check { margin-top: 12px; }
.card select { width: auto; margin-bottom: 12px; }
.row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.row > input { flex: 1; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form2 .full { grid-column: 1 / -1; }
.form2 button { justify-self: start; }

button, .btn {
  font: inherit; font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
  white-space: nowrap; text-align: center; display: inline-block;
}
button:hover, .btn:hover { background: var(--bg-soft); text-decoration: none; }
.primary, button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.small { padding: 6px 14px; font-size: 13px; }
button.ghost { border-color: transparent; color: var(--muted); }
button.danger { color: var(--danger); }
.msg { margin: 10px 0 0; font-size: 14px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

.drop {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 34px 20px; text-align: center;
  cursor: pointer; font-weight: 400; font-size: 15px; background: var(--bg-soft);
}
.drop strong { color: var(--accent); }
.drop small { display: block; margin-top: 6px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Galerie de contenus ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--radius); overflow: hidden; }
.gallery .empty { grid-column: 1 / -1; padding: 10px 0; }
.tile { position: relative; aspect-ratio: 1; background: var(--bg-soft); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tile:hover img { transform: scale(1.03); }
.tile-tag, .tile-leaks {
  position: absolute; top: 8px; left: 8px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--overlay); color: #fff;
}
.tile-leaks { left: auto; right: 8px; background: var(--danger); }
.tile-leaks:hover { text-decoration: none; filter: brightness(1.1); }
.tile-del {
  position: absolute; bottom: 52px; right: 8px; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  background: var(--overlay); color: #fff; border: 0; font-size: 13px; opacity: 0; transition: opacity .15s;
}
.tile:hover .tile-del, .tile-del:focus { opacity: 1; }
.tile-cap {
  position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; color: #fff; font-size: 13px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); display: flex; flex-direction: column;
}
.tile-cap span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-cap small { color: rgba(255, 255, 255, .8); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Fil des fuites ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 2; }
.toolbar select { width: auto; border-radius: 999px; }
.spacer { flex: 1; }
.post { border-bottom: 1px solid var(--border); padding: 16px 0; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.post-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel { display: flex; padding: 6px; cursor: pointer; }
.sel input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.post-media { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 12px 0 10px 50px; max-width: 520px; border-radius: var(--radius); overflow: hidden; }
.post-media figure { margin: 0; position: relative; background: var(--bg-soft); }
.post-media img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.post-media figcaption {
  position: absolute; left: 8px; bottom: 8px; font-size: 12px; font-weight: 600; color: #fff;
  background: var(--overlay); padding: 2px 8px; border-radius: 999px;
}
.post-body { margin-left: 50px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.post-body .line { color: var(--muted); word-break: break-all; }
.post-body .line b { color: var(--text); font-weight: 600; margin-right: 4px; }
.post-body .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.post-body .note { background: var(--bg-soft); color: var(--text); border-radius: 10px; padding: 8px 10px; margin-top: 4px; word-break: normal; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0 50px; }

/* ---------- Pastilles et tableaux ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.en_cours, .pill.signalee { background: var(--warn-soft); color: var(--warn); }
.pill.termine, .pill.retiree { background: var(--ok-soft); color: var(--ok); }
.pill.erreur, .pill.detectee { background: var(--danger-soft); color: var(--danger); }
.pill.ignoree { background: var(--bg-soft); color: var(--muted); }
.pill.video { background: var(--accent-soft); color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); padding: 6px 8px; }
.table td { border-bottom: 1px solid var(--border); padding: 10px 8px; vertical-align: top; }
.table td.url { max-width: 360px; word-break: break-all; }
.bar { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.bar .label { width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { flex: 1; height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- Dossiers et surveillance ---------- */
.notice { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg-soft);
  border-radius: 10px; padding: 14px; max-height: 340px; overflow: auto; margin: 8px 0; }
.notice-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-line { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.key-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-weight: 400; }
.key-row input { margin: 0; flex: 1; }
.key-hint { white-space: nowrap; font-size: 13px; }
.help { margin-top: 10px; font-size: 13px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--accent); }
.help ol { margin: 8px 0 0; padding-left: 20px; }
.run { border-top: 1px solid var(--border); padding: 10px 0; }
.run:first-child { border-top: 0; }
.run summary { cursor: pointer; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; list-style: none; }
.run summary::-webkit-details-marker { display: none; }
.run pre { white-space: pre-wrap; font-size: 12px; background: var(--bg-soft); padding: 10px; border-radius: 10px; margin: 8px 0 0; max-height: 280px; overflow: auto; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; gap: 20px; padding: 30px; z-index: 20; cursor: zoom-out; }
.lightbox figure { margin: 0; text-align: center; color: #fff; font-size: 13px; }
.lightbox img { max-width: 44vw; max-height: 80vh; border-radius: 10px; }

/* ---------- Mobile : barre d'onglets en bas ---------- */
@media (max-width: 860px) {
  .sidebar {
    inset: auto 0 0 0; width: auto; height: 62px; padding: 0 4px calc(env(safe-area-inset-bottom) + 0px);
    flex-direction: row; border-right: 0; border-top: 1px solid var(--border);
  }
  .brand, .me, .sidebar-note { display: none; }
  nav { flex-direction: row; width: 100%; justify-content: space-around; }
  nav a { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 10.5px; border-radius: 10px; position: relative; flex: 1; min-width: 0; }
  nav a span:not(.badge):not(.dot) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  nav a .badge, nav a .dot { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  nav a .lbl { font-size: 0; }
  nav a .lbl::after { content: attr(data-short); font-size: 10.5px; }
  main { margin-left: 0; border-right: 0; padding: 20px 16px 90px; }
  .profile-head { margin: -20px -16px 16px; }
  .cover { height: 120px; }
  .head-row { padding: 0 16px; margin-top: -44px; }
  .avatar.xl { width: 88px; height: 88px; font-size: 30px; }
  .head-actions .btn:not(.primary) { display: none; }
  .head-id, .stats { padding-left: 16px; padding-right: 16px; }
  .stats { gap: 16px; }
  .grid2, .grid3, .form2 { grid-template-columns: 1fr; }
  .gallery { margin: 0 -16px; border-radius: 0; }
  .tile-del { opacity: 1; }
  .post-media, .post-body, .post-actions { margin-left: 0; }
  .row { flex-wrap: wrap; }
  .status-card { flex-direction: column; align-items: stretch; }
  .toolbar { flex-wrap: wrap; }
}
