:root{
    --ink:#22303a;
    --ink-soft:#5b6b74;
    --bg:#e8ede9;
    --bg-deep:#dbe3dd;
    --surface:#fbfaf6;
    --surface-alt:#f1efe7;
    --anchor:#2c3e4a;
    --brass:#b8834a;
    --brass-soft:#e4c9a4;
    --sage:#6e8c7c;
    --sage-soft:#cddccf;
    --line: rgba(34,48,58,0.09);
    --shadow: 0 20px 45px rgba(34,48,58,0.16);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-display: 'Fraunces', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
  }

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
  }

  .utility-bar{
    position:fixed;
    top:12px; right:16px;
    z-index:50;
    display:flex;
    align-items:center;
    gap:8px;
    pointer-events:none;
  }
  .utility-bar > *{ pointer-events:auto; }
  .utility-bar.notif-panel-open{ display:none; }

  .hidden{ display:none !important; }

  /* ---- centered gates (auth / onboarding / banned / supervisor) ----
     position:fixed + inset:0 pins this to the real viewport, and
     overflow-y:auto + margin:auto on the child (below) centers short
     content but degrades to a normal top-anchored, fully scrollable
     region when the content is taller than the screen. Centering via
     align-items:center here instead would clip/overflow evenly on
     both edges and leave the top of tall content unreachable by
     scrolling — that's what made the supervisor panel's header
     unreachable. */
  .auth-wrap, .supervisor-stage{
    position:fixed;
    inset:0;
    z-index:1;
    overflow-y:auto;
    display:flex;
    justify-content:center;
    background:
      radial-gradient(circle at 18% 12%, rgba(184,131,74,0.10), transparent 40%),
      radial-gradient(circle at 85% 78%, rgba(110,140,124,0.14), transparent 45%),
      var(--bg);
    /* Extra top padding clears .utility-bar (fixed top:12px, up to ~40px
       tall) which floats above everything at z-index:50 — otherwise its
       buttons sit on top of this panel's own header on narrow viewports,
       where the panel spans close to the full screen width. */
    padding:64px 20px 24px;
  }

  /* ---- app stage (full real screen, no decorative frame) ----
     position:fixed + inset:0 pins this to the actual viewport box,
     independent of body/html's own height. Relying on body's
     min-height chain alone left #app-stage's height undetermined on
     some mobile browsers, so .content never clipped/scrolled
     internally and the tabbar (absolutely positioned against this
     element) drifted with the page instead of staying put. */
  #app-stage{
    position:fixed;
    inset:0;
    z-index:1;
    width:100%;
    max-width:560px;
    margin:0 auto;
    background: var(--surface);
    display:flex;
    flex-direction:column;
  }

  .app-header{
    /* Right padding clears .utility-bar (fixed top:12px;right:16px, up to
       notif-bell + mode-switch + return-supervisor at once) so long header
       titles wrap onto a second line instead of running under those
       buttons. */
    padding: 14px 210px 16px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    flex-shrink:0;
  }
  .notif-bell{
    position:relative;
    flex-shrink:0;
    width:34px; height:34px;
    margin-top:1px;
    border-radius:50%;
    border:1px solid var(--line);
    background: var(--surface-alt);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .notif-bell svg{ width:17px; height:17px; stroke: var(--ink-soft); fill:none; stroke-width:1.8; }
  .notif-bell .tab-badge{ top:-3px; right:-3px; }

  .notif-panel{
    position:absolute;
    inset:0;
    z-index:20;
    background: var(--surface);
    display:flex;
    flex-direction:column;
  }
  .notif-panel-header{
    display:flex;
    align-items:center;
    gap:10px;
    padding:16px 18px;
    border-bottom:1px solid var(--line);
    flex-shrink:0;
  }
  .notif-panel-header h2{
    font-family: var(--font-display);
    font-weight:500;
    font-size:18px;
    margin:0;
    flex:1;
    color: var(--ink);
  }
  .notif-panel-list{
    flex:1;
    overflow-y:auto;
    padding:14px 18px 100px;
  }
  .eyebrow{
    font-family: var(--font-mono);
    font-size:10.5px;
    letter-spacing:0.14em;
    text-transform:uppercase;
    color: var(--sage);
    margin:0 0 4px;
  }
  .app-header h1{
    font-family: var(--font-display);
    font-weight:500;
    font-size:23px;
    margin:0;
    color: var(--ink);
  }

  .content{
    flex:1;
    overflow-y:auto;
    padding: 18px 20px 100px;
    scrollbar-width:none;
  }
  .content::-webkit-scrollbar{ display:none; }

  /* ---- quota pill ---- */
  .quota{
    display:flex;
    align-items:center;
    justify-content:space-between;
    background: var(--anchor);
    color: var(--surface);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    margin-bottom:18px;
  }
  .quota-text{ font-size:12.5px; line-height:1.4; }
  .quota-text b{ font-family: var(--font-display); font-weight:600; font-size:14.5px; display:block; }
  .quota-dots{ display:flex; gap:5px; }
  .quota-dots span{ width:7px; height:7px; border-radius:50%; background:rgba(251,250,246,0.28); }
  .quota-dots span.filled{ background: var(--brass-soft); }

  /* ---- suggestion cards ---- */
  .card{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom:16px;
    box-shadow: 0 8px 20px rgba(34,48,58,0.05);
  }
  .card-top{
    display:flex;
    align-items:center;
    gap:13px;
    margin-bottom:12px;
  }
  .avatar{
    position:relative;
    width:58px; height:58px;
    border-radius:50%;
    flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
  }
  .avatar::before{
    content:"";
    position:absolute; inset:-4px;
    border-radius:50%;
    border:1.5px solid var(--brass-soft);
    opacity:0.9;
  }
  .avatar-shape{ width:56%; height:56%; border-radius:42% 58% 55% 45% / 50% 45% 55% 50%; }
  .av-a{ background: linear-gradient(135deg,#e4c9a4,#b8834a); }
  .av-a .avatar-shape{ background: rgba(251,250,246,0.55); }
  .av-b{ background: linear-gradient(135deg,#cddccf,#6e8c7c); }
  .av-b .avatar-shape{ background: rgba(251,250,246,0.55); }
  .av-c{ background: linear-gradient(135deg,#d8c7d9,#93789e); }
  .av-c .avatar-shape{ background: rgba(251,250,246,0.55); }
  .av-d{ background: linear-gradient(135deg,#c3d3de,#5f8098); }
  .av-d .avatar-shape{ background: rgba(251,250,246,0.55); }

  .card-name{ font-family: var(--font-display); font-weight:600; font-size:16.5px; margin:0; }
  .card-sub{ font-size:12px; color: var(--ink-soft); margin:2px 0 0; }

  .chips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
  .chip{
    font-size:11.5px;
    padding:5px 10px;
    border-radius:20px;
    background: var(--surface-alt);
    color: var(--ink-soft);
    border:1px solid var(--line);
  }

  .whisper{
    font-family: var(--font-display);
    font-style: italic;
    font-size:13.5px;
    color: var(--anchor);
    background: var(--sage-soft);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom:14px;
  }

  .card-actions{ display:flex; gap:10px; }
  .btn{
    font-family: var(--font-body);
    font-weight:600;
    font-size:13px;
    border:none;
    border-radius:14px;
    padding:11px 16px;
    cursor:pointer;
    flex:1;
    text-align:center;
  }
  /* CTA primaire unifié en beige/tan (marine réservé aux fonds de carte et au header). */
  .btn-primary{ background: var(--brass-soft); color: var(--anchor); }
  .btn-ghost{ background:transparent; color: var(--ink-soft); border:1px solid var(--line); flex:0.6; }

  /* ---- forum (category list) ---- */
  .cat-list{ margin-bottom:18px; }
  .cat-row{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:11px 2px;
    border-top:1px solid var(--line);
  }
  .cat-list .cat-row:first-child{ border-top:none; }
  .cat-row.is-empty{ opacity:0.55; }
  .cat-icon{
    width:36px; height:36px;
    border-radius:10px;
    flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    font-size:16px;
    margin-top:1px;
    background: var(--surface-alt);
  }
  .cat-row-name{ font-family: var(--font-body); font-size:15px; font-weight:600; color: var(--ink); margin:0; }
  .cat-row-meta{ font-size:12.5px; color: var(--ink-soft); margin:2px 0 0; }

  .section-label{
    font-family: var(--font-mono);
    font-size:10.5px;
    letter-spacing:0.12em;
    text-transform:uppercase;
    color: var(--ink-soft);
    margin: 4px 0 12px;
  }

  .section-label-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin: 4px 0 12px;
  }
  .icon-add-btn{
    flex-shrink:0;
    width:22px; height:22px;
    border-radius:50%;
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size:15px;
    line-height:1;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .icon-add-btn:hover{ border-color: var(--sage); color: var(--anchor); }

  .thread{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
    padding:13px 0;
    border-bottom:1px solid var(--line);
  }
  .thread:last-child{ border-bottom:none; }
  .thread-tag{
    font-family: var(--font-mono);
    font-size:9.5px;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color: var(--sage);
    margin-bottom:4px;
    display:block;
  }
  .thread p{ margin:0; font-size:13.5px; font-weight:500; }
  .thread-meta{ font-size:11px; color: var(--ink-soft); white-space:nowrap; padding-top:2px; }

  /* ---- défis ---- */
  .defi-card{
    background: var(--anchor);
    color: var(--surface);
    border-radius: var(--radius-lg);
    padding:20px;
    margin-bottom:20px;
  }
  .defi-eyebrow{
    font-family: var(--font-mono);
    font-size:10px;
    letter-spacing:0.14em;
    text-transform:uppercase;
    color: var(--brass-soft);
    margin:0 0 8px;
  }
  .defi-card h2{
    font-family: var(--font-display);
    font-weight:500;
    font-style:italic;
    font-size:19px;
    margin:0 0 14px;
    line-height:1.3;
  }
  .btn-light{ background: var(--brass-soft); color: var(--anchor); width:100%; }

  /* ---- photo picker (réponses défis, messages de forum) ---- */
  .photo-picker{ margin-bottom:10px; }
  .photo-picker-btn{
    display:inline-flex; align-items:center; gap:6px;
    background: rgba(34,48,58,0.06);
    border:1px dashed var(--line);
    border-radius: var(--radius-sm);
    padding:8px 12px;
    font-family: var(--font-body); font-size:12px; font-weight:600;
    color: var(--ink-soft);
    cursor:pointer;
  }
  .photo-picker-btn:hover{ border-color: var(--sage); color: var(--anchor); }
  .defi-card .photo-picker-btn{
    background: rgba(251,250,246,0.08);
    border-color: rgba(251,250,246,0.3);
    color: rgba(251,250,246,0.75);
  }
  .defi-card .photo-picker-btn:hover{ border-color: var(--brass-soft); color: var(--brass-soft); }
  .photo-picker-preview{ position:relative; display:inline-block; }
  .photo-picker-preview img{ width:84px; height:84px; object-fit:cover; border-radius: var(--radius-sm); display:block; }
  .photo-picker-remove{
    position:absolute; top:-7px; right:-7px;
    width:20px; height:20px; border-radius:50%;
    background: var(--anchor); color: var(--surface);
    border:none; font-size:13px; line-height:1; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  .post-photo{ width:100%; max-height:220px; object-fit:cover; border-radius: var(--radius-sm); margin:8px 0; display:block; }

  .defi-card-link{
    display:block;
    background:none;
    border:none;
    padding:0;
    margin-top:12px;
    font-family: var(--font-body);
    font-size:12.5px;
    font-weight:600;
    color: var(--brass-soft);
    cursor:pointer;
    text-align:left;
  }
  .defi-card-link:hover{ text-decoration:underline; }

  .see-all-link{
    display:flex;
    align-items:center;
    gap:5px;
    background:none;
    border:none;
    padding:0;
    margin: -8px 0 20px;
    font-family: var(--font-body);
    font-size:12.5px;
    font-weight:600;
    color: var(--ink-soft);
    cursor:pointer;
  }
  .see-all-link:hover{ color: var(--anchor); }

  .response-row{
    display:flex;
    gap:11px;
    align-items:flex-start;
    padding:12px 0;
    border-bottom:1px solid var(--line);
  }
  .response-row:last-child{ border-bottom:none; }
  .response-avatar{ width:36px; height:36px; border-radius:50%; flex-shrink:0; }
  .response-name{ font-size:12.5px; font-weight:600; margin:0 0 2px; }
  .author-link{ cursor:pointer; }
  .author-link:hover{ text-decoration:underline; }
  .response-text{ font-size:12.5px; color: var(--ink-soft); margin:0; line-height:1.4; }

  .reply-quote, .reply-quote-preview{
    display:block;
    background: var(--surface-alt);
    border:none;
    border-left:2px solid var(--brass);
    border-radius: 0 8px 8px 0;
    padding:5px 10px;
    margin:2px 0 6px;
    width:100%;
    text-align:left;
  }
  .reply-quote{ cursor:pointer; }
  .reply-quote-author{
    display:block;
    font-family: var(--font-body);
    font-size:10.5px;
    font-weight:600;
    color: var(--brass);
    margin-bottom:1px;
  }
  .reply-quote-excerpt{
    display:block;
    font-family: var(--font-body);
    font-size:11.5px;
    color: var(--ink-soft);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .reply-quote-preview .reply-quote-excerpt{ white-space:normal; }

  @keyframes jump-highlight-flash{
    0%{ background: var(--sage-soft); }
    100%{ background: transparent; }
  }
  .response-row.jump-highlight{
    animation: jump-highlight-flash 1.5s ease-out;
    border-radius: var(--radius-sm);
  }

  .like-btn{
    display:inline-flex;
    align-items:center;
    gap:4px;
    background:none;
    border:1px solid var(--line);
    border-radius:14px;
    padding:5px 10px;
    cursor:pointer;
    font-family: var(--font-body);
    font-size:11.5px;
    font-weight:600;
    color: var(--ink-soft);
  }
  .like-btn svg{ width:14px; height:14px; stroke: var(--ink-soft); fill:none; stroke-width:1.8; }
  .like-btn.liked{ color: var(--brass); border-color: var(--brass-soft); background: rgba(184,131,74,0.08); }
  .like-btn.liked svg{ stroke: var(--brass); fill: var(--brass-soft); }

  /* ---- profil ---- */
  .profile-hero{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding: 10px 0 22px;
  }
  .profile-avatar-wrap{
    position:relative;
    width:132px; height:132px;
    margin-bottom:14px;
    display:flex; align-items:center; justify-content:center;
  }
  .veil-ring{
    position:absolute;
    border-radius:50%;
    border:1px solid var(--line);
  }
  .veil-ring.r1{ inset:0; border-color: var(--sage-soft); }
  .veil-ring.r2{ inset:14px; border-color: var(--brass-soft); border-style:dashed; }
  .profile-avatar{
    width:88px; height:88px;
    border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    position:relative;
    z-index:2;
  }
  .profile-avatar .avatar-shape{ width:52%; height:52%; background:rgba(251,250,246,0.55); border-radius:42% 58% 55% 45% / 50% 45% 55% 50%; }
  .profile-name{ font-family: var(--font-display); font-weight:600; font-size:19px; margin:0; }
  .profile-caption{ font-size:12px; color: var(--ink-soft); margin:4px 0 0; text-align:center; max-width:250px; }

  .profile-photos{ display:flex; gap:16px; justify-content:center; flex-wrap:wrap; }
  .profile-photo-slot{ display:flex; flex-direction:column; align-items:center; }
  .profile-photo-label{
    font-family: var(--font-mono);
    font-size:10px;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color: var(--ink-soft);
    margin:-6px 0 0;
  }
  .profile-face-circle{ overflow:hidden; background: var(--surface-alt); }
  .profile-face-circle img{ width:100%; height:100%; object-fit:cover; display:block; }
  .profile-face-locked svg{ width:26px; height:26px; stroke: var(--ink-soft); fill:none; stroke-width:1.6; }
  .profile-photo-edit-btn{
    position:absolute;
    bottom:2px; right:2px;
    z-index:3;
    width:26px; height:26px;
    border-radius:50%;
    background: var(--anchor);
    color: var(--surface);
    border:2px solid var(--surface);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .profile-photo-edit-btn svg{ width:13px; height:13px; stroke: var(--surface); fill:none; stroke-width:2; }

  .setting-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    background: var(--surface);
    border:1px solid var(--line);
    border-radius: var(--radius-md);
    padding:14px 16px;
    margin-bottom:11px;
  }
  .setting-label{ font-size:13.5px; font-weight:600; margin:0 0 2px; }
  .setting-sub{ font-size:11px; color: var(--ink-soft); margin:0; }
  .toggle{
    width:40px; height:23px;
    border-radius:20px;
    background: var(--sage);
    position:relative;
    flex-shrink:0;
  }
  .toggle::after{
    content:"";
    position:absolute; top:2.5px; right:2.5px;
    width:18px; height:18px;
    border-radius:50%;
    background: var(--surface);
  }
  .toggle.off{ background: var(--line); }
  .toggle.off::after{ right:auto; left:2.5px; }

  .prompt-card{
    background: var(--surface);
    border:1px solid var(--line);
    border-radius: var(--radius-md);
    padding:15px 16px;
    margin-bottom:11px;
  }
  .prompt-q{ font-family: var(--font-display); font-style:italic; font-size:13.5px; color: var(--brass); margin:0 0 6px; }
  .prompt-a{ font-size:13.5px; margin:0; line-height:1.45; }

  .trust-note{
    display:flex;
    gap:10px;
    background: var(--sage-soft);
    border-radius: var(--radius-md);
    padding:14px 15px;
    margin-top:6px;
  }
  .trust-note p{ margin:0; font-size:12px; line-height:1.5; color: var(--anchor); }

  /* ---- tab bar ---- */
  .tabbar{
    position:absolute;
    bottom:0; left:0; right:0;
    height:78px;
    background: var(--surface);
    border-top:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-around;
    padding-bottom:14px;
    z-index:10;
  }

  .unsaved-banner{
    position:absolute;
    left:0; right:0; bottom:78px;
    z-index:15;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    background: var(--anchor);
    color: var(--surface);
    padding:14px 20px;
    box-shadow: 0 -6px 16px rgba(34,48,58,0.12);
  }
  .unsaved-banner p{ margin:0; font-size:13px; font-weight:600; }
  .unsaved-banner .btn-sm{ border-color:rgba(251,250,246,0.35); background:transparent; color: var(--surface); }
  .unsaved-banner .btn-sm.primary{ background: var(--brass-soft); color: var(--anchor); border-color: var(--brass-soft); }
  .tab{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    background:none;
    border:none;
    cursor:pointer;
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size:10px;
    font-weight:600;
    padding:6px 10px;
  }
  .tab svg{ width:21px; height:21px; stroke: var(--ink-soft); fill:none; stroke-width:1.7; }
  .tab.active{ color: var(--anchor); }
  .tab.active svg{ stroke: var(--anchor); }
  .tab-badge{
    position:absolute;
    top:2px; right:4px;
    min-width:15px;
    height:15px;
    padding:0 4px;
    border-radius:20px;
    background:#a8453f;
    color: var(--surface);
    font-family: var(--font-body);
    font-size:9.5px;
    font-weight:700;
    line-height:15px;
    text-align:center;
  }

  /* ---- messaging ---- */
  .unread-badge{
    flex-shrink:0;
    min-width:19px;
    height:19px;
    padding:0 5px;
    border-radius:20px;
    background: var(--anchor);
    color: var(--surface);
    font-family: var(--font-body);
    font-size:11px;
    font-weight:700;
    line-height:19px;
    text-align:center;
  }
  .thread-header{
    display:flex;
    align-items:center;
    gap:10px;
    padding-bottom:14px;
    margin-bottom:14px;
    border-bottom:1px solid var(--line);
  }
  .thread-header-name{ flex:1; font-family: var(--font-display); font-weight:600; font-size:15px; margin:0; }
  .message-list{ display:flex; flex-direction:column; gap:12px; margin-bottom:10px; }
  .message-row{ display:flex; flex-direction:column; max-width:78%; }
  .message-row.mine{ align-self:flex-end; align-items:flex-end; }
  .message-row.theirs{ align-self:flex-start; align-items:flex-start; }
  .message-bubble{
    padding:10px 13px;
    border-radius: var(--radius-md);
    font-size:13.5px;
    line-height:1.45;
    word-break:break-word;
  }
  .message-row.mine .message-bubble{ background: var(--anchor); color: var(--surface); border-bottom-right-radius:4px; }
  .message-row.theirs .message-bubble{ background: var(--surface-alt); color: var(--ink); border-bottom-left-radius:4px; }
  .message-meta{ font-size:10.5px; color: var(--ink-soft); margin:4px 4px 0; }
  .typing-indicator{ font-size:11.5px; font-style:italic; color: var(--ink-soft); margin:0 0 10px; }
  #compose-form{ display:flex; gap:8px; align-items:flex-end; }
  #compose-form[hidden]{ display:none; }
  #compose-form textarea{
    flex:1;
    min-height:44px;
    max-height:120px;
    font-family: var(--font-body);
    font-size:13px;
    padding:10px 12px;
    border-radius: var(--radius-sm);
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    resize:vertical;
  }
  #compose-form .btn{ flex:none; padding:11px 18px; }

  /* ---- auth gate ---- */
  .auth-card{
    width:390px;
    max-width:100%;
    margin:auto 0;
    background: var(--surface);
    border:1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding:32px 28px;
  }
  .auth-card .eyebrow{ margin-bottom:6px; }
  .auth-card h1{
    font-family: var(--font-display);
    font-weight:500;
    font-size:23px;
    margin:0 0 20px;
    color: var(--ink);
  }
  .auth-field{
    display:block;
    margin-bottom:14px;
  }
  .auth-field span{
    display:block;
    font-family: var(--font-mono);
    font-size:10.5px;
    letter-spacing:0.1em;
    text-transform:uppercase;
    color: var(--ink-soft);
    margin-bottom:6px;
  }
  .auth-field input{
    width:100%;
    font-family: var(--font-body);
    font-size:14px;
    padding:11px 13px;
    border-radius: var(--radius-sm);
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
  }
  .auth-field input:focus{
    outline:none;
    border-color: var(--brass);
  }
  .auth-error{
    font-size:12.5px;
    color:#a8453f;
    background: rgba(168,69,63,0.1);
    border-radius: var(--radius-sm);
    padding:9px 12px;
    margin:0 0 14px;
  }
  .auth-error.success{
    color: var(--anchor);
    background: var(--sage-soft);
  }
  #auth-form .btn{ width:100%; }
  .auth-switch{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    font-size:12.5px;
    color: var(--ink-soft);
    margin:18px 0 0;
  }
  .auth-switch button{
    background:none;
    border:none;
    padding:0;
    font-family: var(--font-body);
    font-weight:600;
    font-size:12.5px;
    color: var(--anchor);
    text-decoration:underline;
    cursor:pointer;
  }

  .auth-field-label{
    font-family: var(--font-mono);
    font-size:10.5px;
    letter-spacing:0.1em;
    text-transform:uppercase;
    color: var(--ink-soft);
    margin:18px 0 8px;
  }
  .optional-tag{ text-transform:none; letter-spacing:0; font-weight:400; }
  .empty-hint{
    font-size:12.5px;
    color: var(--ink-soft);
    font-style:italic;
    margin:0 0 12px;
  }

  .avatar-picker{ display:flex; gap:10px; margin-bottom:6px; }
  .avatar-picker[hidden]{ display:none; }
  .avatar-option{
    width:52px; height:52px;
    border-radius:50%;
    border:2px solid transparent;
    padding:0;
    cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  .avatar-option .avatar-shape{ width:56%; height:56%; border-radius:42% 58% 55% 45% / 50% 45% 55% 50%; background: rgba(251,250,246,0.55); }
  .avatar-option.active{ border-color: var(--anchor); }

  .interest-picker{ display:flex; flex-wrap:wrap; gap:7px; margin-bottom:6px; }
  .interest-picker[hidden]{ display:none; }
  .interest-option{
    font-size:12px;
    padding:7px 12px;
    border-radius:20px;
    background: var(--surface-alt);
    color: var(--ink-soft);
    border:1px solid var(--line);
    cursor:pointer;
  }
  .interest-option.selected{
    background: var(--anchor);
    color: var(--surface);
    border-color: var(--anchor);
  }

  .prompt-picker-row{ margin-bottom:14px; }
  .prompt-picker-row select{
    width:100%;
    font-family: var(--font-body);
    font-size:12.5px;
    padding:9px 11px;
    border-radius: var(--radius-sm);
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    margin-bottom:6px;
  }
  .prompt-picker-row textarea{
    width:100%;
    font-family: var(--font-body);
    font-size:13px;
    padding:9px 11px;
    border-radius: var(--radius-sm);
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    resize:vertical;
    min-height:56px;
  }

  /* ---- mode switch ---- */
  .mode-switch{
    width:30px; height:30px;
    border-radius:50%;
    border:1px solid var(--line);
    background: var(--surface);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .mode-switch svg{ width:16px; height:16px; stroke: var(--ink-soft); fill:none; stroke-width:1.8; }
  .mode-switch.active{ background: var(--anchor); border-color: var(--anchor); }
  .mode-switch.active svg{ stroke: var(--brass-soft); }

  .return-supervisor{
    display:flex;
    align-items:center;
    gap:6px;
    padding:7px 12px 7px 9px;
    border-radius:20px;
    border:1px solid var(--brass);
    background: var(--brass-soft);
    color: var(--anchor);
    font-family: var(--font-body);
    font-weight:600;
    font-size:11.5px;
    cursor:pointer;
  }
  .return-supervisor svg{ width:14px; height:14px; stroke: var(--anchor); fill:none; stroke-width:2; }

  /* ---- supervisor dashboard ---- */
  .supervisor-panel{
    width:100%;
    max-width:980px;
    margin:auto 0;
    background: var(--surface);
    border:1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding:26px 30px 34px;
  }
  .supervisor-header h1{
    font-family: var(--font-display);
    font-weight:500;
    font-size:24px;
    margin:0;
    color: var(--ink);
  }
  .supervisor-tabbar{
    display:flex;
    gap:8px;
    margin:20px 0 22px;
    border-bottom:1px solid var(--line);
    flex-wrap:wrap;
  }
  .stab{
    background:none;
    border:none;
    padding:9px 4px 12px;
    margin-right:14px;
    font-family: var(--font-body);
    font-weight:600;
    font-size:13px;
    color: var(--ink-soft);
    cursor:pointer;
    border-bottom:2px solid transparent;
  }
  .stab.active{ color: var(--anchor); border-bottom-color: var(--brass); }

  .forum-subtabbar{
    display:flex;
    gap:4px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding:4px;
    margin-bottom:22px;
  }
  .fsub-tab{
    flex:1;
    background:none;
    border:none;
    border-radius:9px;
    padding:8px 10px;
    font-family: var(--font-body);
    font-weight:600;
    font-size:12.5px;
    color: var(--ink-soft);
    cursor:pointer;
  }
  .fsub-tab.active{
    background: var(--surface);
    color: var(--anchor);
    box-shadow: 0 2px 6px rgba(34,48,58,0.12);
  }
  .forum-subpanel[hidden]{ display:none; }
  .admin-row-summary{ cursor:pointer; }

  .stat-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(150px,1fr));
    gap:12px;
    margin-bottom:24px;
  }
  .stat-card{
    background: var(--surface-alt);
    border:1px solid var(--line);
    border-radius: var(--radius-md);
    padding:14px 16px;
  }
  button.stat-card{
    display:block;
    width:100%;
    text-align:left;
    cursor:pointer;
    font:inherit;
    color:inherit;
  }
  button.stat-card:hover{ border-color: var(--sage); }
  .stat-card .stat-value{
    font-family: var(--font-display);
    font-weight:600;
    font-size:24px;
    color: var(--ink);
    display:block;
  }
  .stat-card .stat-label{
    font-family: var(--font-mono);
    font-size:10px;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color: var(--ink-soft);
    margin-top:2px;
    display:block;
  }

  .admin-section-title{
    font-family: var(--font-display);
    font-weight:600;
    font-size:16px;
    margin:0 0 12px;
    color: var(--ink);
  }

  .admin-list{ margin-bottom:26px; }
  .admin-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px 14px;
    background: var(--surface);
    border:1px solid var(--line);
    border-radius: var(--radius-md);
    padding:13px 15px;
    margin-bottom:9px;
  }
  .admin-row-main{ flex:1; min-width:200px; }
  .admin-row-title{ font-size:13.5px; font-weight:600; margin:0 0 2px; color: var(--ink); }
  .admin-row-sub{ font-size:11.5px; color: var(--ink-soft); margin:0; line-height:1.4; }
  .admin-row-actions{ display:flex; flex-wrap:wrap; gap:8px; flex-shrink:0; }

  .btn-sm{
    font-family: var(--font-body);
    font-weight:600;
    font-size:11.5px;
    border-radius:10px;
    padding:7px 12px;
    cursor:pointer;
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
  }
  .btn-sm.danger{ background:rgba(168,69,63,0.1); border-color:rgba(168,69,63,0.3); color:#a8453f; }
  .btn-sm.positive{ background: var(--sage-soft); border-color: var(--sage); color: var(--anchor); }
  .btn-sm.primary{ background: var(--anchor); border-color: var(--anchor); color: var(--surface); }

  /* Compact "delete" affordance used in place of a text "Supprimer" button
     wherever a plain × reads clearly enough on its own (rows, headers) —
     less visually heavy than a full labeled button. */
  .icon-x-btn{
    flex-shrink:0;
    width:30px; height:30px;
    border-radius:50%;
    border:1px solid rgba(168,69,63,0.3);
    background:rgba(168,69,63,0.1);
    color:#a8453f;
    font-family: var(--font-body);
    font-size:16px;
    line-height:1;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .icon-x-btn:hover{ background:rgba(168,69,63,0.18); }

  /* Rangement manuel (catégories) : mêmes proportions que .icon-x-btn, mais
     neutre — ce ne sont pas des actions destructives. */
  .icon-btn{
    flex-shrink:0;
    width:30px; height:30px;
    border-radius:50%;
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size:13px;
    line-height:1;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .icon-btn:hover{ background: var(--sage-soft); color: var(--anchor); }

  .badge{
    font-family: var(--font-mono);
    font-size:9.5px;
    letter-spacing:0.06em;
    text-transform:uppercase;
    padding:3px 8px;
    border-radius:20px;
    background: var(--surface-alt);
    color: var(--ink-soft);
    white-space:nowrap;
  }
  .badge.pending{ background:rgba(184,131,74,0.15); color: var(--brass); }
  .badge.banned{ background:rgba(168,69,63,0.12); color:#a8453f; }
  .badge.challenge{ background: var(--brass-soft); color: var(--anchor); }
  .badge.done{ background: var(--sage-soft); color: var(--anchor); }
  .cat-row-name .badge{ margin-left:8px; vertical-align:1px; }

  .admin-form-row{ display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
  .admin-form-row[hidden]{ display:none; }
  .admin-row-detail{ display:flex; flex-direction:column; align-items:stretch; gap:10px; }
  .admin-row-detail[hidden]{ display:none; }
  .admin-row-detail .admin-form-row{ margin-bottom:0; }

  .modal-overlay{
    position:fixed;
    inset:0;
    z-index:100;
    background: rgba(34,48,58,0.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
  }
  .modal-box{
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width:560px;
    width:100%;
    max-height:85vh;
    overflow-y:auto;
    padding:24px 26px;
  }
  .admin-form-row input, .admin-form-row select, .admin-form-row textarea{
    font-family: var(--font-body);
    font-size:12.5px;
    padding:8px 10px;
    border-radius: var(--radius-sm);
    border:1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
  }
  .swatch{
    width:22px; height:22px;
    border-radius:50%;
    flex-shrink:0;
  }
