:root{
    --bg:#ffffff; --panel:#ffffff; --panel-2:#f6f7f9; --text:#17181c; --text-2:#6b7280;
    --line:#e7e9ee; --gold:#f6c445; --bubble-out:#f6c445; --bubble-out-text:#1c1b16;
    --bubble-in:#eef0f3; --ink:#15161a;
    --sidebar-w:370px; --radius:18px;
    --shadow:0 1px 2px rgba(20,22,26,.06), 0 8px 30px rgba(20,22,26,.06);
  }
  @media (prefers-color-scheme: dark){
    :root{
      --bg:#0e0f12; --panel:#16171b; --panel-2:#1d1f24; --text:#f2f3f5; --text-2:#9aa1ac;
      --line:#24262b; --gold:#f6c445; --bubble-out:#f6c445; --bubble-out-text:#1c1b16;
      --bubble-in:#24262b; --ink:#15161a;
      --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
    }
  }
  *{box-sizing:border-box}
  html,body{height:100%}
  body{
    margin:0; background:var(--bg); color:var(--text);
    font-family:-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    font-size:15px; line-height:1.4; -webkit-font-smoothing:antialiased;
    overflow-x:hidden;
  }
  button{font:inherit; color:inherit; cursor:pointer; border:0; background:none}
  svg{display:block}
  .wm{font-weight:800; letter-spacing:-.03em}
  .wm .dot{color:var(--gold)}
  .icon{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
  .iconbtn{
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; border-radius:50%; color:var(--text-2);
  }
  .iconbtn:hover{background:var(--panel-2); color:var(--text)}

  /* ---------- PAIRING ---------- */
  #pairing{
    position:fixed; inset:0; z-index:20; background:var(--bg);
    display:flex; align-items:center; justify-content:center; padding:24px;
  }
  .pair-card{
    width:min(920px,100%); background:var(--panel); border:1px solid var(--line);
    border-radius:24px; box-shadow:var(--shadow); overflow:hidden;
    display:grid; grid-template-columns:1.1fr .9fr;
  }
  .pair-left{padding:44px 42px}
  .pair-brand{font-size:30px; margin:0 0 6px}
  .pair-brand span{font-weight:800}
  .pair-sub{color:var(--text-2); margin:0 0 26px}
  .steps{list-style:none; margin:0 0 22px; padding:0; counter-reset:s}
  .steps li{
    position:relative; padding:10px 0 10px 44px; counter-increment:s;
    border-top:1px solid var(--line); color:var(--text);
  }
  .steps li:first-child{border-top:0}
  .steps li::before{
    content:counter(s); position:absolute; left:0; top:9px;
    width:28px; height:28px; border-radius:50%; background:var(--ink); color:#fff;
    display:grid; place-items:center; font-weight:700; font-size:13px;
  }
  .note{font-size:12.5px; color:var(--text-2); margin:0 0 22px}
  .btn-ink{
    display:inline-flex; align-items:center; gap:8px; background:var(--ink); color:#fff;
    padding:12px 22px; border-radius:999px; font-weight:600;
  }
  .btn-ink:hover{opacity:.92}
  .pair-right{
    background:var(--panel-2); display:flex; align-items:center; justify-content:center; padding:36px;
    border-left:1px solid var(--line);
  }
  .qr-frame{
    position:relative; background:#fff; padding:16px; border-radius:22px;
    box-shadow:var(--shadow); border:1px solid var(--line);
  }
  .qr{display:block; width:230px; height:230px}
  .qr-logo{
    position:absolute; inset:0; margin:auto; width:52px; height:52px; border-radius:12px;
    background:var(--ink); color:#fff; display:grid; place-items:center;
    box-shadow:0 0 0 6px #fff;
  }
  .qr-logo b{font-weight:800; font-size:20px; letter-spacing:-.03em}
  .qr-logo b i{color:var(--gold); font-style:normal}

  /* ---------- APP ---------- */
  #app{display:none; height:100dvh}
  #app.on{display:flex}
  .sidebar{
    width:var(--sidebar-w); flex:0 0 var(--sidebar-w);
    border-right:1px solid var(--line); background:var(--panel);
    display:flex; flex-direction:column; min-height:0;
  }
  .side-head{
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 12px 12px 16px; border-bottom:1px solid var(--line);
  }
  .side-head .wm{font-size:22px}
  .side-head .tools{display:flex; align-items:center; gap:2px}
  .search-wrap{padding:10px 12px}
  .search{
    display:flex; align-items:center; gap:10px; background:var(--panel-2);
    border-radius:999px; padding:9px 14px; color:var(--text-2);
  }
  .search svg{width:18px; height:18px; flex:0 0 auto}
  .search input{
    border:0; outline:0; background:transparent; color:var(--text);
    width:100%; font-size:14.5px;
  }
  .search input::placeholder{color:var(--text-2)}
  .chats{flex:1 1 auto; overflow-y:auto; min-height:0; padding-bottom:68px}
  .row{
    display:flex; align-items:center; gap:12px; padding:11px 14px; cursor:pointer;
    border-left:3px solid transparent; position:relative;
  }
  .row + .row .meta::before{
    content:""; position:absolute; left:66px; right:0; top:0; height:1px; background:var(--line);
  }
  .row:hover{background:var(--panel-2)}
  .row.active{background:var(--panel-2); border-left-color:var(--gold)}
  .avatar{
    width:48px; height:48px; border-radius:50%; flex:0 0 auto;
    display:grid; place-items:center; font-weight:700; color:#3a3a3a; font-size:17px;
  }
  .avatar.group{background:var(--ink); color:#fff}
  .avatar.group svg{width:24px; height:24px; stroke:#fff}
  .meta{flex:1 1 auto; min-width:0; position:relative; padding:1px 0}
  .meta .top{display:flex; align-items:baseline; justify-content:space-between; gap:8px}
  .meta .name{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .meta .time{font-size:11.5px; color:var(--text-2); flex:0 0 auto}
  .row.active .meta .time.unreadtime,.meta .time.unreadtime{color:var(--gold)}
  .meta .bot{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:1px}
  .meta .preview{
    color:var(--text-2); font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .badge{
    flex:0 0 auto; min-width:20px; height:20px; padding:0 6px; border-radius:999px;
    background:var(--gold); color:var(--bubble-out-text); font-size:12px; font-weight:700;
    display:grid; place-items:center;
  }

  .chatpanel{
    flex:1 1 auto; display:flex; flex-direction:column; min-width:0; min-height:0;
    background:var(--panel-2);
  }
  /* empty state */
  .empty{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    text-align:center; gap:12px; padding:24px; background:var(--panel);
  }
  .empty .lock{width:96px; height:96px; color:var(--line)}
  .empty h2{margin:0; font-size:26px; font-weight:800}
  .empty h2 span{font-weight:800}
  .empty p{margin:0; color:var(--text-2); max-width:360px}
  .empty .sep{width:220px; height:1px; background:var(--line); margin-top:8px}

  /* conversation */
  .conv{display:none; flex-direction:column; height:100%; min-height:0}
  .conv.on{display:flex}
  .chat-head{
    display:flex; align-items:center; gap:12px; padding:9px 12px;
    border-bottom:1px solid var(--line); background:var(--panel);
  }
  .chat-head .back{display:none}
  .chat-head .avatar{width:40px; height:40px; font-size:15px}
  .chat-head .who{flex:1 1 auto; min-width:0}
  .chat-head .who .n{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .chat-head .who .s{font-size:12.5px; color:var(--text-2)}
  .chat-head .actions{display:flex; align-items:center; gap:2px}

  .messages{
    flex:1 1 auto; overflow-y:auto; min-height:0; padding:16px 6% 10px;
    display:flex; flex-direction:column; gap:6px;
  }
  .daychip{
    align-self:center; background:var(--panel); color:var(--text-2);
    font-size:12px; padding:5px 12px; border-radius:999px; margin:4px 0 8px;
    border:1px solid var(--line);
  }
  .msg{max-width:74%; padding:8px 11px 6px; border-radius:var(--radius); position:relative; word-wrap:break-word}
  .msg.in{align-self:flex-start; background:var(--bubble-in); color:var(--text); border-bottom-left-radius:6px}
  .msg.out{align-self:flex-end; background:var(--bubble-out); color:var(--bubble-out-text); border-bottom-right-radius:6px}
  .msg .txt{white-space:pre-wrap}
  .msg .line{
    display:flex; align-items:center; gap:4px; justify-content:flex-end;
    font-size:10.5px; margin-top:2px; opacity:.7;
  }
  .msg.out .line{color:var(--bubble-out-text)}
  .msg .line svg{width:15px; height:12px; stroke:currentColor; fill:none; stroke-width:2}
  .quote{
    border-left:3px solid rgba(28,27,22,.5); padding:3px 8px; margin-bottom:5px;
    background:rgba(0,0,0,.06); border-radius:8px; font-size:13px;
  }
  .msg.in .quote{border-left-color:var(--gold); background:rgba(0,0,0,.05)}
  .quote .qn{font-weight:700; font-size:12px; display:block; opacity:.85}
  .delivered{align-self:flex-end; font-size:11px; color:var(--text-2); margin:-2px 2px 4px}
  .typing{
    align-self:flex-start; background:var(--bubble-in); border-bottom-left-radius:6px;
    border-radius:var(--radius); padding:12px 14px; display:inline-flex; gap:4px;
  }
  .typing i{width:7px; height:7px; border-radius:50%; background:var(--text-2); display:inline-block; animation:blink 1.2s infinite}
  .typing i:nth-child(2){animation-delay:.2s}
  .typing i:nth-child(3){animation-delay:.4s}
  @keyframes blink{0%,60%,100%{opacity:.25; transform:translateY(0)}30%{opacity:1; transform:translateY(-3px)}}

  .composer{
    display:flex; align-items:flex-end; gap:8px; padding:10px 12px;
    border-top:1px solid var(--line); background:var(--panel);
  }
  .composer .field{
    flex:1 1 auto; display:flex; align-items:center; gap:8px; background:var(--panel-2);
    border-radius:22px; padding:6px 10px 6px 14px; min-height:44px;
  }
  .composer .field input{
    flex:1 1 auto; border:0; outline:0; background:transparent; color:var(--text);
    font-size:15px; padding:6px 0;
  }
  .composer .field input::placeholder{color:var(--text-2)}
  .send{
    flex:0 0 auto; width:44px; height:44px; border-radius:50%; background:var(--ink); color:#fff;
    display:none; align-items:center; justify-content:center;
  }
  .send.show{display:inline-flex}
  .composer .rightset.hide{display:none}

  /* ---------- Dropdown menu ---------- */
  .menu-wrap{position:relative}
  .dropdown{
    position:absolute; right:2px; top:46px; z-index:40;
    background:var(--panel); border:1px solid var(--line); border-radius:14px;
    box-shadow:var(--shadow); padding:6px; min-width:220px;
    display:flex; flex-direction:column;
  }
  .dropdown[hidden]{display:none}
  .dropdown button{
    display:flex; align-items:center; gap:12px; width:100%; text-align:left;
    padding:10px 12px; border-radius:10px; color:var(--text); font-size:14.5px;
  }
  .dropdown button:hover,.dropdown button:focus-visible{background:var(--panel-2); outline:0}
  .dropdown button svg{width:18px; height:18px; stroke:var(--text-2); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:0 0 auto}
  .dropdown .sep{height:1px; background:var(--line); margin:5px 8px}
  .dropdown button.danger{color:#d64545}
  .dropdown button.danger svg{stroke:#d64545}
  .dropdown.up{top:auto; bottom:52px}
  .dropdown.left{right:auto; left:2px}
  .dropdown.cards{min-width:274px}
  .dropdown.cards button{align-items:center; padding:9px 12px}
  .dropdown.cards button svg{width:20px; height:20px}
  .dropdown .mi-txt{display:flex; flex-direction:column; gap:1px; min-width:0}
  .dropdown .mi-title{font-weight:600; font-size:14.5px}
  .dropdown .mi-sub{font-size:12px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

  /* ---------- Toast ---------- */
  .toast{
    position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(10px);
    background:var(--ink); color:#fff; padding:10px 16px; border-radius:999px;
    font-size:13.5px; box-shadow:var(--shadow); opacity:0; pointer-events:none;
    transition:opacity .2s ease, transform .2s ease; z-index:70; max-width:90vw; text-align:center;
  }
  .toast.on{opacity:1; transform:translateX(-50%) translateY(0)}

  /* ---------- Sidebar bottom bar (ciri khas) ---------- */
  .sidebar-foot{
    position:fixed; left:0; bottom:0; z-index:35; width:var(--sidebar-w);
    display:flex; align-items:center; gap:10px; padding:10px 12px;
    border-top:1px solid var(--line); background:var(--panel);
  }
  /* desktop: feed/profil penuh — sidebar chat hilang, bar melayang di tengah bawah */
  @media (min-width:821px){
    #app.feed-open .sidebar, #app.profile-open .sidebar{display:none}
    #app.feed-open .sidebar-foot, #app.profile-open .sidebar-foot{
      left:50%; transform:translateX(-50%); width:min(360px,92vw); bottom:18px;
      border:1px solid var(--line); border-radius:26px; box-shadow:var(--shadow);
    }
  }
  .foot-icon{
    width:42px; height:42px; border-radius:50%; display:grid; place-items:center;
    color:var(--text-2); flex:0 0 auto;
  }
  .foot-icon:hover{background:var(--panel-2); color:var(--text)}
  .foot-icon svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
  .foot-center{position:relative; flex:1 1 auto; min-width:0; display:flex; justify-content:center}
  .pill-newchat{
    display:inline-flex; align-items:center; justify-content:center; gap:7px;
    width:100%; max-width:160px; height:44px; border-radius:999px;
    background:var(--ink); color:#fff; font-weight:600; font-size:14.5px;
  }
  .pill-newchat:hover{opacity:.92}
  .pill-newchat svg{width:17px; height:17px; stroke:#fff; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round}
  .sidebar-foot.notif-on .foot-icon{display:none}
  .sidebar-foot.notif-on .foot-center{max-width:none}

  /* ---------- Dynamic notification card ---------- */
  .notif-card{
    position:absolute; left:0; right:0; top:0; width:100%; text-align:left;
    background:var(--ink); color:#fff; border-radius:26px; overflow:hidden;
    max-height:0; opacity:0; transform:translateY(10px);
    transition:max-height .32s ease, opacity .24s ease, transform .32s ease, padding .32s ease;
    padding:0 8px; pointer-events:none;
  }
  .sidebar-foot.notif-on .pill-newchat{display:none}
  .sidebar-foot.notif-on .notif-card{position:relative; max-height:220px; opacity:1; transform:none; padding:8px; pointer-events:auto}
  .notif-row{display:flex; align-items:center; gap:10px; padding:2px 4px}
  .avatar-sm{width:38px; height:38px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:15px; color:#3a3a3a; flex:0 0 auto; cursor:pointer}
  .notif-body{flex:1 1 auto; min-width:0; cursor:pointer}
  .notif-name{font-weight:700; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .notif-preview{font-size:12.5px; opacity:.72; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .notif-btn{width:34px; height:34px; border-radius:50%; display:grid; place-items:center; color:inherit; flex:0 0 auto}
  .notif-btn:hover{background:rgba(128,128,128,.22)}
  .notif-btn svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
  .voice-play{width:36px; height:36px; border-radius:50%; background:rgba(128,128,128,.24); color:inherit; display:grid; place-items:center; flex:0 0 auto}
  .voice-play svg{width:16px; height:16px; fill:currentColor; stroke:none}
  .wave{display:flex; align-items:center; gap:2px; height:26px; flex:1 1 auto; min-width:0; overflow:hidden}
  .wave i{width:3px; min-width:3px; background:currentColor; border-radius:2px; opacity:.85; transform:scaleY(.4); transform-origin:center}
  .wave.playing i{animation:wavebar .9s ease-in-out infinite}
  @keyframes wavebar{0%,100%{transform:scaleY(.35)}50%{transform:scaleY(1)}}
  .quick-reply{display:flex; align-items:center; gap:8px; padding:8px 4px 2px}
  .quick-reply[hidden]{display:none}
  .quick-reply input{
    flex:1 1 auto; min-width:0; border:0; outline:0; border-radius:999px; padding:9px 13px;
    background:rgba(128,128,128,.22); color:inherit; font-size:14px;
  }
  .quick-reply input::placeholder{color:inherit; opacity:.6}
  .qr-send{width:34px; height:34px; border-radius:50%; background:var(--gold); color:#1c1b16; display:grid; place-items:center; flex:0 0 auto}
  .qr-send svg{width:16px; height:16px; stroke:#1c1b16; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round}
  @media (prefers-color-scheme: dark){
    .pill-newchat{background:#f2f3f5; color:#15161a}
    .pill-newchat svg{stroke:#15161a}
    .notif-card{background:#f2f3f5; color:#15161a}
  }

  /* ---------- Stories / Status tray ---------- */
  .stories{
    display:flex; gap:14px; padding:12px 14px; overflow-x:auto;
    border-bottom:1px solid var(--line); -ms-overflow-style:none; scrollbar-width:none;
  }
  .stories::-webkit-scrollbar{display:none}
  .story{flex:0 0 auto; width:60px; display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; background:none}
  /* ring = solid border + gap (persis app: hijau belum dilihat / abu sudah), bukan conic gradient */
  .story .ring{
    width:58px; height:58px; border-radius:50%; padding:3px; box-sizing:border-box;
    border:2.5px solid #25D366;
    display:grid; place-items:center;
  }
  .story.seen .ring{border-color:#8a9099}
  .story.mine .ring{border-color:#25D366}
  .story .inner{width:100%; height:100%; border-radius:50%; overflow:hidden}
  .story .av{width:100%; height:100%; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:16px; color:#3a3a3a}
  .story.mine .av{position:relative}
  .story .plus{
    position:absolute; right:-1px; bottom:-1px; width:19px; height:19px; border-radius:50%;
    background:var(--ink); color:#fff; display:grid; place-items:center; border:2px solid var(--panel);
  }
  .story .plus svg{width:11px; height:11px; stroke:#fff; fill:none; stroke-width:2.4}
  .story .lbl{font-size:11.5px; color:var(--text-2); max-width:58px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

  /* ---------- Story viewer ---------- */
  .story-viewer{position:fixed; inset:0; z-index:60; background:#0a0a0c; display:none; flex-direction:column}
  .story-viewer.on{display:flex}
  .sv-bars{display:flex; gap:4px; padding:12px 14px 4px}
  .sv-bars .bar{flex:1 1 0; height:3px; border-radius:3px; background:rgba(255,255,255,.32); overflow:hidden}
  .sv-bars .bar > i{display:block; height:100%; width:0; background:#fff; border-radius:3px}
  .sv-bars .bar.done > i{width:100%}
  .sv-bars .bar.active > i{animation:svfill 4.2s linear forwards}
  @keyframes svfill{from{width:0}to{width:100%}}
  .sv-head{display:flex; align-items:center; gap:12px; padding:8px 14px; color:#fff; z-index:2}
  .sv-head .av{width:38px; height:38px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:15px; color:#3a3a3a; flex:0 0 auto}
  .sv-head .n{font-weight:700; font-size:15px}
  .sv-head .tm{font-size:12px; opacity:.75}
  .sv-head .close{margin-left:auto; color:#fff}
  .sv-body{flex:1; display:grid; place-items:center; text-align:center; color:#fff; padding:40px 28px; font-size:23px; font-weight:600; line-height:1.35}
  .sv-nav{position:absolute; top:64px; bottom:0; width:38%; z-index:1; background:none}
  .sv-nav.left{left:0} .sv-nav.right{right:0}

  /* ---------- Feed / Beranda (Posts) ---------- */
  .chat-head{min-height:58px}
  .foot-icon.active{background:var(--gold); color:#1c1b16}
  .feed{display:none; flex-direction:column; height:100%; min-height:0; background:var(--panel)}
  .feed.on{display:flex}
  .feed-title{flex:1 1 auto; font-weight:800; font-size:19px; letter-spacing:-.02em}
  .feed-scroll{flex:1 1 auto; overflow-y:auto; min-height:0; background:var(--panel)}
  .post-composer{display:flex; align-items:center; gap:8px; padding:10px 14px; border-bottom:1px solid var(--line)}
  .pc-field{flex:1 1 auto; display:flex; align-items:center; gap:6px; background:var(--panel-2); border-radius:22px; padding:5px 8px 5px 14px; min-width:0}
  .pc-field input{flex:1 1 auto; min-width:0; border:0; outline:0; background:transparent; color:var(--text); font-size:14.5px; padding:6px 0}
  .pc-field input::placeholder{color:var(--text-2)}
  .post-btn{display:none; background:var(--gold); color:#1c1b16; border-radius:999px; padding:9px 16px; font-weight:700; font-size:14px; flex:0 0 auto}
  .post-btn.show{display:inline-flex}
  .post{padding:14px; border-bottom:1px solid var(--line)}
  .post-head{display:flex; align-items:center; gap:10px}
  .post-av{width:42px; height:42px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:16px; color:#3a3a3a; flex:0 0 auto}
  .post-meta{flex:1 1 auto; min-width:0}
  .post-name{font-weight:700; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .post-sub{font-size:12px; color:var(--text-2)}
  .post-del{color:var(--text-2); flex:0 0 auto}
  .post-del:hover{color:#E53935}
  .post-text{margin:10px 0 0; font-size:14.5px; white-space:pre-wrap; word-wrap:break-word}
  .post-img{display:block; margin:12px -14px -14px; height:210px; width:calc(100% + 28px)}
  .post-actions{display:flex; align-items:center; gap:22px; margin-top:12px}
  .act{display:inline-flex; align-items:center; gap:6px; color:var(--text-2); font-size:13px; font-weight:600}
  .act svg{width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
  .act:hover{color:var(--text)}
  .act.liked{color:#E53935}
  .act.liked svg{fill:#E53935; stroke:#E53935}

  /* comment sheet */
  .sheet-overlay{position:fixed; inset:0; z-index:65; background:rgba(0,0,0,.42); display:none; align-items:flex-end; justify-content:center}
  .sheet-overlay.on{display:flex}
  .sheet{width:100%; max-width:460px; max-height:80vh; background:var(--panel); border-radius:20px 20px 0 0; display:flex; flex-direction:column; box-shadow:var(--shadow)}
  .sheet-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--line)}
  .sheet-head h3{margin:0; font-size:16px; font-weight:700}
  .comment-list{flex:1 1 auto; overflow-y:auto; min-height:60px; padding:4px 16px}
  .comment{display:flex; gap:10px; padding:11px 0; border-bottom:1px solid var(--line)}
  .comment:last-child{border-bottom:0}
  .c-av{width:36px; height:36px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:14px; color:#3a3a3a; flex:0 0 auto}
  .c-body{flex:1 1 auto; min-width:0}
  .c-name{font-weight:700; font-size:13.5px}
  .c-text{font-size:14px; margin-top:1px}
  .c-reply{font-size:12px; color:var(--text-2); margin-top:3px; background:none; font-weight:600}
  .sheet-input{display:flex; align-items:center; gap:8px; padding:10px 14px; border-top:1px solid var(--line)}
  .sheet-input input{flex:1 1 auto; min-width:0; border:0; outline:0; background:var(--panel-2); border-radius:999px; padding:10px 14px; color:var(--text); font-size:14.5px}
  .sheet-input input::placeholder{color:var(--text-2)}
  .sheet-send{width:40px; height:40px; border-radius:50%; background:var(--gold); color:#1c1b16; display:grid; place-items:center; flex:0 0 auto}
  .sheet-send svg{width:17px; height:17px; stroke:#1c1b16; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round}
  @media (min-width:821px){
    .sheet-overlay{align-items:center}
    .sheet{border-radius:20px; max-height:72vh}
  }

  /* ---------- Profil & Pengaturan ---------- */
  /* iOS insetGrouped tokens (scoped ke #profileView) */
  #profileView{
    --ios-group:#F2F2F7; --ios-card:#FFFFFF; --ios-sep:#C6C6C8;
    --ios-gray:#8E8E93; --ios-field:#E4E4E9; --ios-accent:var(--text);
    background:var(--ios-group);
  }
  #profileView .feed-scroll{background:var(--ios-group); padding-bottom:96px}
  #profileView .chat-head{background:var(--ios-group); border-bottom:0; justify-content:center; position:relative}
  #profileView .feed-title{flex:0 0 auto; font-size:17px; font-weight:700}
  #profileView .back{position:absolute; left:6px; color:var(--ios-accent)}
  /* profile hero */
  .prof-hero{padding:8px 16px 0; text-align:center}
  .prof-cover{height:150px; border-radius:16px; background:linear-gradient(135deg,#8e9aaf,#c9d6df)}
  .prof-avatar{width:104px; height:104px; border-radius:50%; margin:-52px auto 0; border:4px solid var(--ios-group); display:grid; place-items:center; font-weight:700; font-size:38px; color:#fff; background:#8e97a8}
  .prof-actions{margin-top:10px; display:flex; align-items:center; justify-content:center; gap:8px; font-size:14px}
  .prof-link{color:var(--ios-accent); font-weight:600; background:none}
  .prof-dot{color:var(--ios-gray)}
  /* insetGrouped card + hairline inset */
  .ios-card{background:var(--ios-card); border-radius:12px; margin:22px 16px 0; overflow:hidden}
  .ios-sec + .ios-card{margin-top:6px}
  .ios-card > *{position:relative}
  .ios-card > * + *::before{content:""; position:absolute; left:16px; right:0; top:0; height:1px; transform:scaleY(.5); transform-origin:top; background:var(--ios-sep)}
  .ios-field{padding:8px 16px 10px; text-align:left}
  .f-label{font-size:12px; color:var(--ios-gray)}
  .f-box{background:var(--ios-field); border-radius:8px; padding:9px 12px; margin-top:5px; font-size:15px; color:var(--text)}
  .pin-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; text-align:left}
  .pin-val{font-size:20px; font-weight:700; color:var(--ios-accent); letter-spacing:.06em; font-variant-numeric:tabular-nums; margin-top:2px}
  .pin-copy{display:inline-flex; align-items:center; gap:6px; color:var(--ios-accent); font-weight:600; font-size:14px; background:none; flex:0 0 auto}
  .pin-copy svg{width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
  .ios-caption{font-size:12px; color:var(--ios-gray); text-align:center; margin:8px 32px 0; line-height:1.4}
  .ios-sec{font-size:13px; color:var(--ios-gray); text-transform:uppercase; letter-spacing:.02em; padding:0 0 0 32px; margin-top:24px}
  .set-row{display:flex; align-items:center; gap:12px; width:100%; text-align:left; padding:11px 16px; color:var(--text); background:none}
  .set-row:active{background:rgba(120,120,128,.12)}
  .set-txt{flex:1 1 auto; min-width:0}
  .set-title{font-size:17px; color:var(--text)}
  .set-sub{font-size:13px; color:var(--ios-gray); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .set-chev{color:var(--ios-sep); flex:0 0 auto; display:grid; place-items:center}
  .set-chev svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round}
  @media (prefers-color-scheme: dark){
    #profileView{ --ios-group:#000000; --ios-card:#1C1C1E; --ios-sep:#38383A; --ios-field:#1C1C1E; }
  }

  /* responsive */
  @media (max-width:820px){
    .pair-card{grid-template-columns:1fr}
    .pair-right{border-left:0; border-top:1px solid var(--line)}
    .pair-left{padding:30px 24px}
    .sidebar{width:100%; flex-basis:100%}
    .chatpanel{display:none}
    #app.show-chat .sidebar{display:none}
    #app.show-chat .chatpanel{display:flex}
    .chat-head .back{display:inline-flex}
    .msg{max-width:82%}
    .sidebar-foot{width:100%}
    #app.show-chat .sidebar-foot{display:none}
  }

/* ---------- status penautan (pairing sungguhan) ---------- */
.pair-status{ margin:14px 0 2px; font-size:14px; line-height:1.5; color:var(--text-2) }
.pair-status.ok{ color:#1a7f4b; font-weight:600 }
.pair-status.warn{ color:#9a6b00 }
.pair-status.err{ color:#b3261e }
.pair-countdown{ margin:0 0 10px; font-size:12px; color:var(--text-2); font-variant-numeric:tabular-nums }
.pair-done{ margin:10px 0; padding:12px 14px; border-radius:10px; background:#e9f7ef;
            color:#1a7f4b; font-size:14px; line-height:1.5 }
.btn-ink.ghost{ background:transparent; border:1px solid var(--line); color:var(--text-2) }
/* QR diredupkan saat kedaluwarsa supaya tak ada yang memindai kode mati. */
.qr-mati{ opacity:.25; filter:grayscale(1) }

/* ---------- spanduk & keadaan kosong ---------- */
.banner-belum{
  position:fixed; left:0; right:0; top:0; z-index:60;
  padding:9px 16px; font-size:13px; line-height:1.45; text-align:center;
  background:#fff4d6; color:#7a5a00; border-bottom:1px solid #f0dfae;
}
/* Konten digeser turun supaya spanduk tidak menutupi bilah atas. */
#app.on{ padding-top:38px }
.kosong{
  padding:34px 20px; text-align:center; color:var(--text-2); font-size:14px; line-height:1.6;
}
