:root{
      --color-primary-ghost: rgba(255,122,0,.10);
      --color-border: rgba(255,255,255,.18);
      --color-card-bg: rgba(255,255,255,.03);
      --text-dim: var(--color-muted);
    }

    main{
      width:100%;
      max-width:1400px;
      margin:0 auto;
      padding:24px clamp(12px,4vw,40px) 80px;
    }

    /* ===== Public user header ===== */
    .user-header{
      width:min(100%,1400px);
      margin:28px auto 18px;
      padding:10px 4px;
      display:flex;
      gap:18px;
      align-items:center;
    }
    .user-header .info{ flex:1; min-width:0; }

    .avatar{
      width:clamp(130px,13vw,190px);
      height:clamp(130px,13vw,190px);
      border-radius:50%;
      border:none;
      background:#fff;
      position:relative;
      overflow:hidden;
      object-fit:cover;
      display:block;
      flex:0 0 auto;
    }

    .display{
      margin:0;
      font-weight:900;
      font-size:clamp(32px,4.5vw,54px);
      letter-spacing:.2px;
      line-height:1.05;
      color:var(--color-text);
      font-family:"Intro Rust",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI";
    }
    .name-row{
      display:flex;
      align-items:center;
      gap:10px;
      flex-wrap:wrap;
    }

    .meta{
      display:flex;
      flex-wrap:wrap;
      gap:12px;
      align-items:center;
      color:var(--color-muted);
      font-size:clamp(15px,1.5vw,18px);
      margin-top:6px;
    }
    .handle-rank{
      display:inline-flex;
      align-items:center;
      gap:8px;
    }
    .handle-rank .rank-icon{ vertical-align:middle; }
    .meta .sep{ opacity:.55; }
    #uHandle{ font-weight:800; color:inherit; }

    .bio{
      margin:.7rem 0 0 0;
      opacity:.95;
      font-size:clamp(16px, 1.6vw, 20px);
      line-height:1.5;
      max-width:80ch;
      white-space:pre-wrap;
    }

    .telegram-channels{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-top:10px;
    }
    .telegram-channels[hidden]{ display:none; }
    .telegram-channel-badge{
      display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 10px;
  border-radius:9999px;
  border:none;
  background:var(--color-border-soft);
  color:var(--color-muted);
  font-family:"Display Book",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI";
  font-size:12px;
  text-decoration:none;
  transition: background .2s ease, color .2s ease;
    }
    .telegram-channel-badge:hover,
    .telegram-channel-badge:focus-visible{
      background:var(--color-border);
      color:var(--color-muted);
    }
    .telegram-channel-badge img{
      width:16px;
      height:16px;
      display:block;
    }
    .telegram-channel-badge__icon{
      width:16px;
      height:16px;
      display:inline-block;
      flex:0 0 auto;
      background:currentColor;
      opacity:.9;
    }
    .telegram-channel-badge__icon--link{
      -webkit-mask:url("/assets/icons/link.svg") center/contain no-repeat;
      mask:url("/assets/icons/link.svg") center/contain no-repeat;
    }
    .telegram-channel-badge--uiverse{
      text-transform: lowercase;
    }

    .user-actions{
      margin-top:14px;
      display:flex;
      align-items:center;
      gap:12px;
      flex-wrap:wrap;
    }
    .follow-btn{
      min-width:120px;
    }
    .follow-btn{
      display:inline-flex;
      align-items:center;
      justify-content:flex-start;
      gap:10px;
      transition:background-color .2s ease, color .2s ease, border-color .2s ease;
      padding-right:8px;
    }
    .follow-btn .follow-label{
      display:inline-block;
      min-width:0;
      text-align:left;
      white-space:nowrap;
    }
    .follow-btn .follow-icon{
      width:16px;
      height:16px;
      display:grid;
      place-items:center;
      position:relative;
      flex:0 0 auto;
    }
    .follow-plus{
      position:absolute;
      inset:0;
      display:block;
      transform-origin:center;
      transition: opacity .18s ease;
    }
    .follow-bar{
      position:absolute;
      left:50%;
      top:50%;
      height:2px;
      width:14px;
      background: currentColor;
      border-radius:999px;
      transform-origin:center;
    }
    .follow-bar--h{
      transform: translate(-50%, -50%) rotate(0deg);
    }
    .follow-bar--v{
      transform: translate(-50%, -50%) rotate(90deg);
    }
    .follow-check{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      display:block;
      fill:none;
      stroke: currentColor;
      stroke-width:2;
      stroke-linecap:round;
      stroke-linejoin:round;
      opacity:0;
      transform: scale(0.92);
      transition: opacity .2s ease, transform .2s ease;
      pointer-events:none;
    }
    .follow-check path{
      vector-effect: non-scaling-stroke;
    }
    .follow-btn[data-icon="plus"] .follow-plus{
      opacity:1;
    }
    .follow-btn[data-icon="plus"] .follow-check{
      opacity:0;
      transform: scale(0.92);
    }
    .follow-btn[data-icon="check"] .follow-plus{
      opacity:0;
    }
    .follow-btn[data-icon="check"] .follow-check{
      opacity:1;
      transform: scale(1);
    }
    .follow-btn.is-spinning .follow-plus{
      opacity:1;
    }
    .follow-btn.is-spinning .follow-check{
      opacity:0;
      transform: scale(0.92);
    }
    .follow-btn.is-spinning[data-spin="cw"] .follow-plus{
      animation: follow-spin-cw .12s linear;
    }
    .follow-btn.is-spinning[data-spin="ccw"] .follow-plus{
      animation: follow-spin-ccw .12s linear;
    }
    @keyframes follow-spin-cw{
      from{ transform: rotate(0deg); }
      to{ transform: rotate(90deg); }
    }
    @keyframes follow-spin-ccw{
      from{ transform: rotate(0deg); }
      to{ transform: rotate(-90deg); }
    }

    @media (max-width:720px){
      .user-header{ flex-direction:column; align-items:flex-start; }
    }

    /* ===== Posts section (with tabs) ===== */
    .user-posts{
      width:min(100%,1400px);
      margin:24px auto 72px;
      padding:6px;
      display:flex;
      flex-direction:column;
      gap:24px;
    }
    .tab-header{
      position:relative;
      display:flex;
      gap:16px;
      padding-bottom:14px;
      border-bottom:2px solid color-mix(in srgb,var(--color-border,#d4d4d4) 85%,#f1f1f1);
    }
    .tab-btn{
      position:relative;
      flex:1;
      min-width:0;
      background:none;
      border:0;
      padding:12px 0;
      font-family:"Display Bold",system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
      font-size:clamp(16px,2vw,20px);
      font-weight:400;
      color:color-mix(in srgb,var(--color-muted,#777) 78%,var(--color-bg,#fff));
      cursor:pointer;
      text-align:center;
      transition:color .25s ease;
    }
    .tab-btn.is-active{ color:var(--color-primary); }
    .tab-slider{
      position:absolute;
      bottom:-2px;
      height:4px;
      border-radius:var(--radius-interactive);
      background:var(--color-primary);
      transform:translate3d(0,0,0);
      transition:transform .35s cubic-bezier(.6,.05,.25,1), width .35s cubic-bezier(.6,.05,.25,1);
      pointer-events:none;
      left:0;
      width:50%;
    }
    .tab-panels{ position:relative; }
    .tab-panel{ display:none; }
    .tab-panel.is-active{ display:block; }

    .user-grid{
      --post-grid-gap: var(--post-gap,10px);
      --post-grid-min: 320px;
      --post-grid-row: 12px;
    }
    @media (max-width:1100px){ .user-grid{ --post-grid-min: 280px; } }
    @media (max-width:800px){ .user-grid{ --post-grid-min: 240px; } }
    @media (max-width:560px){ .user-grid{ --post-grid-min: 100%; } }

    .user-grid .card{
      display:block;
      width:100%;
      max-width:520px;
      position:relative;
      border-radius:16px;
      overflow:hidden;
      background:#fff;
      border:1px solid var(--color-border);
      box-shadow:0 10px 28px rgba(0,0,0,.16);
      text-decoration:none;
      color:inherit;
      transform:translateZ(0);
      min-width:0;
    }
    .user-grid .card a{ text-decoration:none; color:inherit; }

    .user-grid .thumb{
      display:block;
      width:100%;
      background:#fff;
      border:0;
      pointer-events:none;
      margin:0;
      overflow:hidden;
      position:relative;
    }
    .user-grid .thumb iframe{
      width:100%;
      display:block;
      border:0;
      background:#fff;
    }
    .user-grid img.thumb{
      width:100%;
      height:auto;
      object-fit:cover;
      display:block;
    }

    .user-grid .meta2{
      position:absolute;
      inset:0;
      display:flex;
      flex-direction:column;
      justify-content:flex-end;
      padding:12px;
      background:rgba(0,0,0,.65);
      color:#fff;
      opacity:0;
      transition:opacity .18s ease;
    }
    .user-grid .card:hover .meta2{ opacity:1; }

    .user-grid .card > .name,
    .user-grid .card > .desc,
    .user-grid .card > .tags { display:none !important; }

    .name{
      font-weight:900;
      margin:0 0 6px 0;
      font-size:1.05rem;
      white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
      color:#fff;
    }
    .desc{
      margin:0 0 6px 0;
      color:rgba(255,255,255,.9);
      line-height:1.25;
      max-height:3.3em;
      overflow:hidden;
    }
    /* Tags dans l'overlay — pills + reveal au hover */
    .user-grid .meta2 .tags{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      white-space:normal;          /* autorise le retour à la ligne */
      max-height:72px;             /* ~2 lignes de tags */
      overflow:hidden;
      opacity:0;
      transform: translateY(4px);
      transition: opacity .18s ease, transform .18s ease;
      font-size:.9rem;
    }
    .user-grid .card:hover .meta2 .tags{
      opacity:1;
      transform:none;
    }
    /* Style “pill” pour ancres ou spans */
    .user-grid .meta2 .tags a,
    .user-grid .meta2 .tags .tag{
      display:inline-flex;
      align-items:center;
      padding:4px 10px;
      border-radius:9999px;
      text-decoration:none;
      font-weight:700;
      line-height:1;
      background: rgba(255,255,255,.14);
      border:1px solid rgba(255,255,255,.25);
      color:#fff;
    }
    /* Supporte aussi le markup .o-tags (comme sur /library) */
    .user-grid .meta2 .o-tags{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      white-space:normal;
      max-height:72px;
      overflow:hidden;
      opacity:0;
      transform: translateY(4px);
      transition: opacity .18s ease, transform .18s ease;
      font-size:.9rem;
      color:rgba(255,255,255,.9);
    }
    .user-grid .card:hover .meta2 .o-tags{
      opacity:1;
      transform:none;
    }
    .user-grid .meta2 .o-tags a,
    .user-grid .meta2 .o-tags .tag{
      display:inline-flex;
      align-items:center;
      padding:4px 10px;
      border-radius:9999px;
      text-decoration:none;
      font-weight:700;
      line-height:1;
      background: rgba(255,255,255,.14);
      border:1px solid rgba(255,255,255,.25);
      color:#fff;
    }
