/* ================= ABU SHAMEKH — black & gold, firelight ================= */
:root{
  --bg:#0A0705;
  --card:#14100B;
  --card-2:#1B150E;
  --text:#F3EDE2;
  --muted:#9A8F80;
  --gold-1:#7A5A1E;
  --gold-2:#F5D07A;
  --gold-3:#B98A2E;
  --ember:#FF5A1F;
  --hair:rgba(232,180,74,.25);
  --hair-soft:rgba(232,180,74,.14);
  --gold-grad:linear-gradient(135deg,#7A5A1E 0%,#F5D07A 42%,#B98A2E 68%,#F5D07A 100%);
  --radius:18px;
  --fs:1;
}
html[data-font="large"]{ --fs:1.15; }

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;
  font-size:calc(15px * var(--fs));
  line-height:1.7;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button,input,textarea{ font-family:inherit; }
button{ user-select:none; -webkit-user-select:none; }
input,textarea{ user-select:text; -webkit-user-select:text; }
.hidden{ display:none !important; }
.svg-defs{ position:absolute; width:0; height:0; overflow:hidden; }
::selection{ background:rgba(245,208,122,.28); color:#fff; }

/* ---------- fire background ---------- */
.bg-fire{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(125% 72% at 50% -12%,
      rgba(255,90,31,.22) 0%,
      rgba(122,26,5,.09) 44%,
      rgba(10,7,5,0) 76%);
}
.bg-noise{
  position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.04;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:140px 140px;
}
.embers{ position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden; }
.ember{
  position:absolute; bottom:-8px; border-radius:50%;
  background:#FFA45C;
  box-shadow:0 0 7px 1px rgba(255,90,31,.75);
  opacity:0;
  animation-name:rise; animation-timing-function:linear; animation-iteration-count:infinite;
}
@keyframes rise{
  0%{ transform:translateY(0) scale(1); opacity:0; }
  12%{ opacity:.8; }
  65%{ opacity:.45; }
  100%{ transform:translateY(-108vh) scale(.35); opacity:0; }
}

/* ---------- icons ---------- */
.ic{
  width:22px; height:22px; flex:0 0 auto;
  fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round;
}
.logo-svg{ filter:drop-shadow(0 0 7px rgba(255,90,31,.55)) drop-shadow(0 0 14px rgba(245,208,122,.22)); }
.logo--xl{ width:116px; height:116px; }
.logo--md{ width:84px; height:84px; }
.logo--sm{ width:36px; height:36px; }

/* ---------- app shell ---------- */
.app{
  position:relative; z-index:1;
  height:100vh; height:var(--app-h, 100dvh);
  max-width:560px; margin-inline:auto;
  display:flex; flex-direction:column; overflow:hidden;
  border-inline:1px solid rgba(232,180,74,.10);
  background:rgba(10,7,5,.55);
}
@media (max-width:600px){
  .app{ border:none; background:transparent; }
}

.appbar{
  flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 16px;
  border-bottom:1px solid var(--hair);
  background:linear-gradient(180deg, rgba(20,16,11,.94), rgba(16,12,8,.72));
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  box-shadow:inset 0 1px 0 rgba(255,90,31,.06);
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-txt{ display:flex; flex-direction:column; line-height:1.15; min-width:0; }
.brand-name{
  font-size:calc(19px * var(--fs)); font-weight:900; color:var(--gold-2); letter-spacing:0;
}
@supports (-webkit-background-clip:text){
  .brand-name{
    background:var(--gold-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  }
}
.brand-sub{ font-size:calc(10.5px * var(--fs)); color:var(--muted); font-weight:500; }

.icon-btn{
  display:grid; place-items:center;
  width:44px; height:44px; flex:0 0 auto;
  border-radius:14px; border:1px solid transparent;
  background:transparent; color:var(--text); cursor:pointer;
  transition:background .18s, border-color .18s, transform .12s;
}
.icon-btn:hover{ background:rgba(232,180,74,.08); border-color:var(--hair-soft); }
.icon-btn:active{ transform:scale(.94); }

/* ---------- screens ---------- */
#main{
  flex:1 1 auto; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding-bottom:16px;
  scrollbar-width:thin; scrollbar-color:rgba(232,180,74,.25) transparent;
}
#main::-webkit-scrollbar{ width:6px; }
#main::-webkit-scrollbar-thumb{ background:rgba(232,180,74,.22); border-radius:6px; }
.screen{ display:block; animation:screenIn .22s ease-out; }
@keyframes screenIn{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none;} }

.screen-pad{ padding:0 14px; }
.section-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:16px 14px 10px;
}
.section-head h2{
  margin:0; font-size:calc(20px * var(--fs)); font-weight:800; color:var(--text);
}
.section-head .sub{ font-size:calc(12.5px * var(--fs)); color:var(--muted); font-weight:500; }
.muted{ color:var(--muted); }
.tnum{ font-variant-numeric:tabular-nums; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:0 18px;
  border-radius:14px; border:1px solid var(--hair);
  background:var(--card-2); color:var(--text);
  font-size:calc(14.5px * var(--fs)); font-weight:700; cursor:pointer;
  transition:transform .12s ease, filter .18s ease, background .18s;
}
.btn:active{ transform:scale(.97); }
.btn--sm{ min-height:38px; padding:0 14px; font-size:calc(13.5px * var(--fs)); border-radius:12px; }
.btn--gold{
  background:var(--gold-grad); border-color:rgba(245,208,122,.55); color:#1A1206;
  box-shadow:0 8px 22px -12px rgba(245,208,122,.85);
}
.btn--gold:hover{ filter:brightness(1.06); }
.btn--ghost{ background:transparent; }
.btn--danger{ color:var(--ember); border-color:rgba(255,90,31,.42); background:rgba(255,90,31,.07); }
.btn--block{ width:100%; }
.btn:disabled{ opacity:.42; cursor:not-allowed; transform:none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .tab:focus-visible{
  outline:2px solid var(--gold-2); outline-offset:2px;
}

/* ---------- avatars ---------- */
.avatar{
  position:relative; display:grid; place-items:center; flex:0 0 auto;
  border-radius:50%; background:#14100B;
  border:1px solid rgba(232,180,74,.38);
  overflow:hidden; user-select:none;
  font-weight:800; color:var(--gold-2);
}
.avatar .av-letter{
  line-height:1; color:var(--gold-2);
  background:var(--gold-grad); -webkit-background-clip:text; background-clip:text;
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .avatar .av-letter{ color:var(--gold-2); }
}
.avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.av-40{ width:40px; height:40px; font-size:17px; }
.av-46{ width:46px; height:46px; font-size:19px; }
.av-52{ width:52px; height:52px; font-size:21px; }
.av-58{ width:58px; height:58px; font-size:24px; }
.av-72{ width:72px; height:72px; font-size:30px; }
.av-96{ width:96px; height:96px; font-size:40px; }

.badge-demo{
  display:inline-flex; align-items:center;
  font-size:calc(9.5px * var(--fs)); font-weight:700; line-height:1;
  padding:3px 7px; border-radius:999px;
  color:#F5D07A; border:1px solid rgba(232,180,74,.4);
  background:rgba(232,180,74,.09);
  white-space:nowrap;
}

/* ---------- story rail ---------- */
.story-rail{
  display:flex; gap:14px; align-items:flex-start;
  overflow-x:auto; padding:14px 14px 10px;
  scrollbar-width:none;
}
.story-rail::-webkit-scrollbar{ display:none; }
.story-item{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:none; border:0; padding:0; cursor:pointer; flex:0 0 auto; width:72px;
}
.story-item:active{ transform:scale(.96); }
.story-name{
  font-size:calc(11px * var(--fs)); color:var(--muted); font-weight:600;
  max-width:72px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.story-ring{
  position:relative; display:grid; place-items:center;
  width:66px; height:66px; border-radius:50%; padding:3px;
  background:conic-gradient(from 210deg,#7A5A1E,#F5D07A,#B98A2E,#F5D07A,#7A5A1E);
  box-shadow:0 0 14px -4px rgba(245,208,122,.45);
  transition:box-shadow .2s;
}
.story-ring > .avatar{ box-shadow:0 0 0 2px #0A0705; border:0; }
.story-ring.seen{
  background:linear-gradient(150deg,#3a332a,#241f19);
  box-shadow:none;
}
.story-ring.mine{
  background:linear-gradient(150deg,#241c12,#1a140d);
  border:1px dashed rgba(232,180,74,.55);
}
.story-plus{
  position:absolute; inset-block-end:-1px; inset-inline-end:-1px;
  width:23px; height:23px; border-radius:50%;
  background:var(--gold-grad); color:#1A1206;
  display:grid; place-items:center; border:2px solid #0A0705;
}
.story-plus .ic{ width:13px; height:13px; stroke-width:2.8; }
.story-plus-naked{ display:grid; place-items:center; color:var(--gold-2); }
.story-plus-naked .ic{ width:24px; height:24px; stroke-width:2; }

/* ---------- posts ---------- */
.feed{ display:flex; flex-direction:column; gap:14px; padding:4px 14px 8px; }
.post{
  background:var(--card);
  border:1px solid var(--hair);
  border-radius:var(--radius);
  box-shadow:inset 0 1px 0 rgba(255,90,31,.06), 0 14px 30px -24px #000;
  overflow:hidden;
}
.post-head{
  display:flex; align-items:center; gap:10px; padding:12px 14px 10px;
}
.post-head .grow{ flex:1 1 auto; min-width:0; }
.post-name{
  display:flex; align-items:center; gap:7px; flex-wrap:wrap;
  font-size:calc(14.5px * var(--fs)); font-weight:800; color:var(--text);
}
.post-time{ font-size:calc(11.5px * var(--fs)); color:var(--muted); font-weight:500; }
.post-text{
  margin:0; padding:0 14px 12px;
  font-size:calc(15px * var(--fs)); line-height:1.75; color:var(--text);
  overflow-wrap:anywhere;
}
.post-img{ display:block; width:100%; max-height:460px; object-fit:cover; background:#0d0a07; }
.post-art{
  position:relative; aspect-ratio:4/3; display:grid; place-items:center; overflow:hidden;
  background:
    radial-gradient(120% 100% at 50% 118%, rgba(255,90,31,.24), transparent 62%),
    linear-gradient(160deg,#1d1509 0%,#0c0906 58%,#16100a 100%);
  border-top:1px solid var(--hair-soft); border-bottom:1px solid var(--hair-soft);
}
.post-art::after{
  content:''; position:absolute; inset:0;
  background-image:repeating-linear-gradient(135deg, rgba(232,180,74,.06) 0 1px, transparent 1px 22px);
  pointer-events:none;
}
.post-art-letter{
  font-size:84px; font-weight:900; line-height:1;
  background:var(--gold-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  opacity:.92; filter:drop-shadow(0 0 18px rgba(245,208,122,.22));
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .post-art-letter{ color:var(--gold-2); }
}
.post-actions{
  display:flex; align-items:center; gap:6px; padding:6px 8px 8px;
}
.pact{
  display:inline-flex; align-items:center; gap:7px;
  min-height:44px; padding:0 12px; border-radius:12px;
  background:transparent; border:0; color:var(--muted); cursor:pointer;
  font-size:calc(13px * var(--fs)); font-weight:700;
  font-variant-numeric:tabular-nums;
  transition:color .16s, background .16s, transform .12s;
}
.pact:active{ transform:scale(.94); }
.pact:hover{ background:rgba(232,180,74,.07); color:var(--text); }
.pact.liked{ color:var(--gold-2); }
.pact.liked .ic{ fill:var(--gold-2); stroke:var(--gold-2); animation:pop .34s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop{ 0%{transform:scale(.6)} 60%{transform:scale(1.22)} 100%{transform:scale(1)} }

/* ---------- FAB ---------- */
.fab{
  position:absolute; z-index:20;
  inset-block-end:78px; inset-inline-end:18px;
  width:58px; height:58px; border-radius:50%;
  display:grid; place-items:center; cursor:pointer;
  background:var(--gold-grad); color:#1A1206; border:1px solid rgba(245,208,122,.6);
  box-shadow:0 12px 26px -10px rgba(245,208,122,.75), 0 0 0 6px rgba(255,90,31,.06);
  transition:transform .14s ease, filter .2s;
}
.fab .ic{ width:26px; height:26px; stroke-width:2.4; }
.fab:active{ transform:scale(.92); }

/* ---------- tabbar ---------- */
.tabbar{
  flex:0 0 auto; display:grid; grid-template-columns:repeat(5,1fr); gap:2px;
  padding:5px 6px 7px;
  border-top:1px solid var(--hair);
  background:linear-gradient(0deg, rgba(12,9,6,.99), rgba(20,16,11,.86));
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
}
.tab{
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  min-height:52px; padding:5px 2px;
  background:none; border:0; border-radius:12px; cursor:pointer;
  color:var(--muted); font-size:calc(10.5px * var(--fs)); font-weight:700;
  transition:color .18s;
}
.tab .ic{ width:22px; height:22px; }
.tab.active{ color:var(--gold-2); }
.tab.active::before{
  content:''; position:absolute; top:-1px; width:22px; height:2px; border-radius:2px;
  background:var(--gold-grad); box-shadow:0 0 10px rgba(245,208,122,.7);
}
.tab-badge{
  position:absolute; top:2px; inset-inline-end:calc(50% - 22px);
  min-width:17px; height:17px; padding:0 4px;
  display:grid; place-items:center;
  border-radius:999px; background:var(--ember); color:#fff;
  font-size:10px; font-weight:800; line-height:1;
  box-shadow:0 0 0 2px #0A0705;
}

/* ---------- cards / rows ---------- */
.card{
  background:var(--card);
  border:1px solid var(--hair);
  border-radius:var(--radius);
  box-shadow:inset 0 1px 0 rgba(255,90,31,.06), 0 14px 30px -26px #000;
}
.list{ display:flex; flex-direction:column; gap:10px; padding:0 14px; }
.row{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:11px 13px; text-align:start; cursor:pointer;
  background:var(--card); border:1px solid var(--hair); border-radius:16px;
  color:var(--text); transition:border-color .18s, background .18s, transform .12s;
}
.row:active{ transform:scale(.99); }
.row:hover{ border-color:rgba(232,180,74,.42); }
.row .grow{ flex:1 1 auto; min-width:0; }
.row-title{
  display:flex; align-items:center; gap:7px;
  font-size:calc(14.5px * var(--fs)); font-weight:800;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-sub{
  font-size:calc(12.5px * var(--fs)); color:var(--muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-meta{ display:flex; flex-direction:column; align-items:flex-end; gap:5px; flex:0 0 auto; }
.row-time{ font-size:calc(10.5px * var(--fs)); color:var(--muted); font-variant-numeric:tabular-nums; }
.unread-pill{
  min-width:20px; height:20px; padding:0 6px;
  display:grid; place-items:center; border-radius:999px;
  background:var(--gold-grad); color:#1A1206;
  font-size:11px; font-weight:900; line-height:1; font-variant-numeric:tabular-nums;
}

/* ---------- empty states ---------- */
.empty{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:38px 22px; text-align:center;
  border:1px dashed rgba(232,180,74,.24); border-radius:var(--radius);
  background:linear-gradient(180deg, rgba(20,16,11,.7), rgba(12,9,6,.4));
  margin:8px 14px;
}
.empty .empty-ic{
  width:52px; height:52px; border-radius:50%; display:grid; place-items:center;
  background:rgba(232,180,74,.08); color:var(--gold-2); border:1px solid var(--hair);
}
.empty h3{ margin:4px 0 0; font-size:calc(16px * var(--fs)); font-weight:800; }
.empty p{ margin:0; color:var(--muted); font-size:calc(13px * var(--fs)); max-width:34ch; }

/* ---------- friends ---------- */
.search-box{
  display:flex; align-items:center; gap:9px;
  margin:0 14px 12px; padding:0 14px; height:48px;
  background:#100c08; border:1px solid var(--hair); border-radius:16px;
  color:var(--muted);
}
.search-box .ic{ width:19px; height:19px; }
.search-box input{
  flex:1 1 auto; min-width:0; height:100%;
  background:none; border:0; outline:none; color:var(--text);
  font-size:max(16px, calc(14.5px * var(--fs)));
}
.search-box input::placeholder{ color:#6f665a; }

.chips{ display:flex; gap:8px; padding:0 14px 12px; flex-wrap:wrap; }
.chip{
  min-height:38px; padding:0 16px; border-radius:999px; cursor:pointer;
  border:1px solid var(--hair); background:transparent; color:var(--muted);
  font-size:calc(13px * var(--fs)); font-weight:700;
  transition:color .18s, background .18s, border-color .18s;
}
.chip.active{
  color:#1A1206; border-color:rgba(245,208,122,.6);
  background:var(--gold-grad);
  box-shadow:0 6px 18px -12px rgba(245,208,122,.9);
}

.friend-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px;
  padding:0 14px 8px;
}
.friend-card{
  position:relative; display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:16px 10px 13px; cursor:pointer; text-align:center;
  background:var(--card); border:1px solid var(--hair); border-radius:var(--radius);
  box-shadow:inset 0 1px 0 rgba(255,90,31,.055);
  transition:border-color .18s, transform .12s;
}
.friend-card:active{ transform:scale(.98); }
.friend-card:hover{ border-color:rgba(232,180,74,.45); }
.fc-name{
  font-size:calc(13.5px * var(--fs)); font-weight:800; color:var(--text);
  max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.fav-btn{
  position:absolute; top:6px; inset-inline-start:6px;
  width:34px; height:34px; border-radius:50%; display:grid; place-items:center;
  background:rgba(10,7,5,.6); border:1px solid transparent; color:#5c5349; cursor:pointer;
  transition:color .18s, border-color .18s, transform .12s;
}
.fav-btn .ic{ width:16px; height:16px; }
.fav-btn:active{ transform:scale(.9); }
.fav-btn.on{ color:var(--gold-2); border-color:rgba(232,180,74,.4); }
.fav-btn.on .ic{ fill:var(--gold-2); }

/* ---------- profile ---------- */
.profile-cover{
  position:relative; height:132px; overflow:hidden;
  background:
    radial-gradient(110% 120% at 50% 130%, rgba(255,90,31,.3), transparent 64%),
    linear-gradient(150deg,#221808,#0c0906 70%);
  border-bottom:1px solid var(--hair);
  display:grid; place-items:center;
}
.profile-cover::after{
  content:''; position:absolute; inset:0;
  background-image:repeating-linear-gradient(120deg, rgba(232,180,74,.07) 0 1px, transparent 1px 26px);
}
.profile-cover .cover-letter{
  font-size:76px; font-weight:900; line-height:1; opacity:.45;
  background:var(--gold-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .profile-cover .cover-letter{ color:var(--gold-2); }
}
.profile-main{ padding:0 16px 24px; }
.profile-top{ display:flex; align-items:flex-end; gap:14px; margin-top:-38px; }
.profile-top .avatar{ box-shadow:0 0 0 4px #0A0705, 0 0 22px -6px rgba(245,208,122,.5); }
.profile-name{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:14px 0 2px; font-size:calc(21px * var(--fs)); font-weight:900;
}
.profile-handle{ color:var(--muted); font-size:calc(12.5px * var(--fs)); font-weight:600; }
.profile-bio{ margin:10px 0 0; color:var(--text); opacity:.9; font-size:calc(14px * var(--fs)); }
.profile-stats{
  display:flex; gap:10px; margin:16px 0; flex-wrap:wrap;
}
.stat{
  flex:1 1 0; min-width:82px; padding:10px 8px; text-align:center;
  background:var(--card-2); border:1px solid var(--hair-soft); border-radius:14px;
}
.stat b{ display:block; font-size:calc(17px * var(--fs)); font-weight:900; color:var(--gold-2); font-variant-numeric:tabular-nums; }
.stat span{ font-size:calc(11px * var(--fs)); color:var(--muted); }
.profile-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.profile-actions .btn{ flex:1 1 auto; }
.gallery{
  display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px;
}
.gallery img{ width:100%; aspect-ratio:1; object-fit:cover; border-radius:10px; border:1px solid var(--hair-soft); }

/* ---------- account ---------- */
.logo-block{
  display:grid; place-items:center; gap:8px; padding:22px 0 6px;
}
.logo-block .motto{
  font-size:calc(11.5px * var(--fs)); color:var(--muted); letter-spacing:.02em;
}
.settings-group{ padding:0 14px; margin-top:14px; }
.settings-group h3{
  margin:0 0 8px; font-size:calc(12.5px * var(--fs)); font-weight:800;
  color:var(--gold-2); letter-spacing:.01em; opacity:.9;
}
.set-row{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-bottom:1px solid rgba(232,180,74,.1);
  background:var(--card);
}
.set-row:first-of-type{ border-start-start-radius:var(--radius); border-start-end-radius:var(--radius); }
.set-row:last-of-type{ border-bottom:0; border-end-start-radius:var(--radius); border-end-end-radius:var(--radius); }
.set-list{ border:1px solid var(--hair); border-radius:var(--radius); overflow:hidden; box-shadow:inset 0 1px 0 rgba(255,90,31,.06); }
.set-label{ flex:1 1 auto; min-width:0; }
.set-label b{ display:block; font-size:calc(14px * var(--fs)); font-weight:700; }
.set-label small{ display:block; color:var(--muted); font-size:calc(11.5px * var(--fs)); line-height:1.5; }
.seg{
  display:inline-flex; padding:3px; gap:3px; border-radius:12px;
  background:#0E0A07; border:1px solid var(--hair); flex:0 0 auto;
}
.seg button{
  min-height:34px; padding:0 12px; border-radius:9px; border:0; cursor:pointer;
  background:transparent; color:var(--muted); font-size:calc(12.5px * var(--fs)); font-weight:700;
}
.seg button.on{ background:var(--gold-grad); color:#1A1206; }
.switch{
  position:relative; flex:0 0 auto; width:48px; height:28px; border-radius:999px;
  background:#2a2218; border:1px solid var(--hair); cursor:pointer; padding:0;
  transition:background .2s, border-color .2s;
}
.switch::after{
  content:''; position:absolute; top:3px; inset-inline-start:3px;
  width:20px; height:20px; border-radius:50%; background:#8b8175;
  transition:transform .2s ease, background .2s;
}
.switch.on{ background:linear-gradient(135deg,#7A5A1E,#F5D07A 60%,#B98A2E); border-color:rgba(245,208,122,.65); }
.switch.on::after{ transform:translateX(-19px); background:#1A1206; }

.banner{
  display:flex; gap:10px; align-items:flex-start;
  margin:14px; padding:13px 14px;
  border:1px solid rgba(232,180,74,.3); border-radius:16px;
  background:linear-gradient(180deg, rgba(232,180,74,.09), rgba(232,180,74,.03));
  color:#EADFCB; font-size:calc(12.5px * var(--fs)); line-height:1.65;
}
.banner .ic{ color:var(--gold-2); width:19px; height:19px; margin-top:2px; }
.danger-zone{ padding:0 14px 26px; margin-top:8px; }

/* ---------- overlays ---------- */
.overlay{
  position:absolute; inset:0; z-index:50;
  display:flex; flex-direction:column;
  background:var(--bg);
  animation:ovIn .2s ease-out;
}
@keyframes ovIn{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none;} }
.overlay::before{
  content:''; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(120% 55% at 50% -8%, rgba(255,90,31,.16), transparent 70%);
}
.ov-head{
  position:relative; flex:0 0 auto;
  display:flex; align-items:center; gap:10px;
  padding:8px 12px; border-bottom:1px solid var(--hair);
  background:linear-gradient(180deg, rgba(20,16,11,.96), rgba(16,12,8,.8));
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
}
.ov-title{ margin:0; font-size:calc(16px * var(--fs)); font-weight:800; flex:1 1 auto; text-align:center; }
.ov-spacer{ width:44px; flex:0 0 auto; }
.ov-body{ position:relative; flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch; }

/* ---------- chat ---------- */
.chat-head-main{ display:flex; align-items:center; gap:10px; flex:1 1 auto; min-width:0; }
.chat-head-main .grow{ min-width:0; }
.chat-head-name{
  display:flex; align-items:center; gap:7px;
  font-size:calc(14.5px * var(--fs)); font-weight:800;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.chat-head-sub{ font-size:calc(11px * var(--fs)); color:var(--muted); }

.chat-body{
  position:relative; flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch;
  display:flex; flex-direction:column; gap:8px;
  padding:14px 12px 8px;
}
.msg{
  max-width:80%; padding:9px 13px; border-radius:16px;
  font-size:calc(14.5px * var(--fs)); line-height:1.65;
  overflow-wrap:anywhere; position:relative;
  animation:msgIn .18s ease-out;
}
@keyframes msgIn{ from{opacity:0; transform:translateY(6px) scale(.98);} to{opacity:1; transform:none;} }
.msg.mine{
  align-self:flex-end;
  background:var(--gold-grad); color:#1A1206; font-weight:600;
  border-radius:16px 16px 16px 5px;
  box-shadow:0 8px 20px -14px rgba(245,208,122,.9);
}
.msg.theirs{
  align-self:flex-start;
  background:#1B150E; border:1px solid var(--hair); color:var(--text);
  border-radius:16px 16px 5px 16px;
}
.msg-time{
  display:block; margin-top:3px; font-size:10.5px; opacity:.6;
  text-align:end; font-variant-numeric:tabular-nums;
}
.msg-img{
  display:block; width:100%; max-width:240px; border-radius:11px; margin-bottom:6px;
  border:1px solid rgba(0,0,0,.25);
}
.msg.mine .msg-img{ border-color:rgba(0,0,0,.18); }

.quick-row{
  position:relative; flex:0 0 auto; display:flex; gap:7px; overflow-x:auto;
  padding:8px 12px 2px; scrollbar-width:none;
}
.quick-row::-webkit-scrollbar{ display:none; }
.quick-row:empty{ display:none; }
.quick{
  flex:0 0 auto; min-height:36px; padding:0 13px; border-radius:999px; cursor:pointer;
  border:1px solid var(--hair); background:rgba(232,180,74,.06); color:#DCCFB6;
  font-size:calc(12.5px * var(--fs)); font-weight:600;
}
.quick:active{ background:rgba(232,180,74,.16); }

.chat-composer{
  position:relative; flex:0 0 auto;
  display:flex; align-items:center; gap:8px;
  padding:9px 10px 11px;
  border-top:1px solid var(--hair);
  background:linear-gradient(180deg, rgba(20,16,11,.9), rgba(12,9,6,.99));
}
.chat-composer input{
  flex:1 1 auto; min-width:0; height:46px; padding:0 15px;
  border-radius:15px; border:1px solid var(--hair);
  background:#0F0B07; color:var(--text); outline:none;
  font-size:max(16px, calc(14.5px * var(--fs)));
}
.chat-composer input::placeholder{ color:#6f665a; }
.chat-composer input:focus{ border-color:rgba(245,208,122,.55); }
.send-btn{
  width:46px; height:46px; flex:0 0 auto; border-radius:50%;
  display:grid; place-items:center; cursor:pointer;
  background:var(--gold-grad); color:#1A1206; border:1px solid rgba(245,208,122,.6);
  box-shadow:0 8px 20px -12px rgba(245,208,122,.9);
  transition:transform .12s;
}
.send-btn:active{ transform:scale(.92); }
.send-btn .ic{ width:21px; height:21px; stroke-width:2.2; }

/* ---------- compose ---------- */
.compose-text{
  display:block; width:calc(100% - 28px); margin:14px; padding:14px;
  background:var(--card); border:1px solid var(--hair); border-radius:var(--radius);
  color:var(--text); outline:none; resize:vertical; min-height:130px;
  font-size:max(16px, calc(15px * var(--fs))); line-height:1.7;
}
.compose-text::placeholder{ color:#6f665a; }
.compose-text:focus{ border-color:rgba(245,208,122,.5); }
.compose-media{ padding:0 14px; }
.compose-media img{
  display:block; width:100%; border-radius:var(--radius); border:1px solid var(--hair);
  max-height:320px; object-fit:cover;
}
.compose-tools{ display:flex; gap:9px; padding:14px; }
.tool-btn{
  flex:1 1 0; display:flex; align-items:center; justify-content:center; gap:8px;
  min-height:48px; border-radius:14px; cursor:pointer;
  background:var(--card-2); border:1px solid var(--hair); color:var(--text);
  font-size:calc(13.5px * var(--fs)); font-weight:700;
}
.tool-btn:active{ transform:scale(.98); }

/* ---------- story viewer ---------- */
.overlay--story{ background:#050302; z-index:70; }
.story-stage{ position:relative; flex:1 1 auto; overflow:hidden; touch-action:pan-y; }
.story-bars{
  position:absolute; top:10px; inset-inline:10px; z-index:3;
  display:flex; gap:4px;
}
.story-bar{
  flex:1 1 0; height:3px; border-radius:3px; overflow:hidden;
  background:rgba(255,255,255,.22);
}
.story-bar i{ display:block; height:100%; width:0%; background:linear-gradient(90deg,#F5D07A,#B98A2E); border-radius:3px; }
.story-bar.done i{ width:100%; }
.story-top{
  position:absolute; top:22px; inset-inline:10px; z-index:3;
  display:flex; align-items:center; gap:10px;
}
.story-top .grow{ flex:1 1 auto; min-width:0; }
.story-top-name{
  font-size:calc(13.5px * var(--fs)); font-weight:800; color:#fff;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.story-top-time{ font-size:calc(10.5px * var(--fs)); color:rgba(255,255,255,.72); }
.story-content{ position:absolute; inset:0; display:grid; place-items:center; }
.story-content img{ width:100%; height:100%; object-fit:cover; }
.story-text-card{
  width:100%; height:100%;
  display:grid; place-items:center; padding:56px 30px;
  background:
    radial-gradient(110% 70% at 50% 118%, rgba(255,90,31,.4), transparent 62%),
    linear-gradient(160deg,#1b1209 0%,#080604 60%,#150e07 100%);
  text-align:center;
}
.story-text-card p{
  margin:0; font-size:calc(23px * var(--fs)); font-weight:800; line-height:1.6; color:#F7EFDF;
  text-shadow:0 2px 22px rgba(0,0,0,.7);
  overflow-wrap:anywhere; max-width:22ch;
}
.story-text-card .st-letter{
  position:absolute; font-size:190px; font-weight:900; line-height:1;
  opacity:.1; color:#F5D07A; pointer-events:none;
}
.story-nav-btn{
  position:absolute; z-index:3; inset-block-start:50%; transform:translateY(-50%);
  width:44px; height:44px; border-radius:50%; display:grid; place-items:center;
  background:rgba(10,7,5,.55); border:1px solid rgba(232,180,74,.3); color:#F5D07A; cursor:pointer;
}
.story-tapzone{ position:absolute; inset:0; z-index:2; }

/* ---------- sheet ---------- */
.sheet-wrap{
  position:absolute; inset:0; z-index:60;
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet-backdrop{
  position:absolute; inset:0; background:rgba(4,3,2,.68);
  backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px);
  animation:fadeIn .2s ease-out;
}
@keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }
.sheet{
  position:relative; width:100%; max-height:88%;
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:var(--card);
  border:1px solid var(--hair); border-bottom:0;
  border-radius:22px 22px 0 0;
  padding:10px 16px 22px;
  box-shadow:0 -18px 50px -20px #000, inset 0 1px 0 rgba(255,90,31,.08);
  animation:sheetIn .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes sheetIn{ from{ transform:translateY(28px); opacity:.6;} to{ transform:none; opacity:1;} }
.sheet::before{
  content:''; display:block; width:42px; height:4px; border-radius:4px;
  background:rgba(232,180,74,.3); margin:2px auto 12px;
}
.sheet-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.sheet-head h3{ margin:0; font-size:calc(17px * var(--fs)); font-weight:800; }
.sheet p{ color:var(--muted); font-size:calc(13.5px * var(--fs)); line-height:1.7; }
.sheet-actions{ display:flex; flex-direction:column; gap:9px; margin-top:14px; }
.sheet-actions .btn{ width:100%; }
.field{ margin-top:12px; }
.field label{
  display:block; margin-bottom:6px; font-size:calc(12.5px * var(--fs)); font-weight:700; color:var(--gold-2);
}
.field input, .field textarea{
  width:100%; min-height:48px; padding:10px 14px;
  background:#0F0B07; border:1px solid var(--hair); border-radius:14px;
  color:var(--text); outline:none;
  font-size:max(16px, calc(14.5px * var(--fs)));
}
.field textarea{ min-height:86px; resize:vertical; line-height:1.7; }
.field input:focus, .field textarea:focus{ border-color:rgba(245,208,122,.55); }
.check-row{
  display:flex; align-items:center; gap:10px; margin-top:14px;
  padding:12px 14px; border:1px solid rgba(255,90,31,.3); border-radius:14px;
  background:rgba(255,90,31,.06); cursor:pointer;
  font-size:calc(13px * var(--fs)); color:#F0DCC9;
}
.check-box{
  width:22px; height:22px; flex:0 0 auto; border-radius:7px;
  border:1px solid rgba(255,90,31,.5); display:grid; place-items:center;
  background:#0F0B07; color:transparent;
}
.check-box.on{ background:var(--ember); border-color:var(--ember); color:#fff; }
.check-box .ic{ width:14px; height:14px; stroke-width:3; }

/* comments */
.comment-list{ display:flex; flex-direction:column; gap:12px; max-height:46vh; overflow-y:auto; padding:4px 2px 8px; }
.comment{ display:flex; gap:10px; align-items:flex-start; }
.comment .grow{ min-width:0; }
.comment-name{ font-size:calc(12.5px * var(--fs)); font-weight:800; color:var(--gold-2); }
.comment-text{ font-size:calc(13.5px * var(--fs)); color:var(--text); overflow-wrap:anywhere; }
.comment-time{ font-size:calc(10.5px * var(--fs)); color:var(--muted); }
.comment-form{ display:flex; gap:8px; align-items:center; margin-top:8px; padding-top:10px; border-top:1px solid var(--hair); }
.comment-form input{
  flex:1 1 auto; min-width:0; height:46px; padding:0 14px;
  background:#0F0B07; border:1px solid var(--hair); border-radius:14px;
  color:var(--text); outline:none;
  font-size:max(16px, calc(14.5px * var(--fs)));
}
.comment-form input:focus{ border-color:rgba(245,208,122,.55); }
.comment-form button{
  width:46px; height:46px; flex:0 0 auto; border-radius:50%;
  display:grid; place-items:center; cursor:pointer;
  background:var(--gold-grad); color:#1A1206; border:1px solid rgba(245,208,122,.6);
}
.comment-form button .ic{ width:20px; height:20px; stroke-width:2.2; }

/* ---------- toast ---------- */
.toast{
  position:absolute; z-index:100;
  inset-block-end:96px; inset-inline:0; margin-inline:auto;
  width:max-content; max-width:86%;
  padding:11px 18px; border-radius:14px;
  background:rgba(28,22,15,.97); color:var(--text);
  border:1px solid var(--hair);
  box-shadow:0 16px 34px -18px #000;
  font-size:calc(13px * var(--fs)); font-weight:700; text-align:center;
  animation:toastIn .22s ease-out;
}
@keyframes toastIn{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none;} }

/* ---------- splash ---------- */
.splash{
  position:fixed; inset:0; z-index:200;
  display:grid; place-items:center;
  background:radial-gradient(120% 70% at 50% 0%, #1d1108 0%, #0A0705 55%, #050302 100%);
  transition:opacity .42s ease, visibility .42s;
}
.splash.out{ opacity:0; visibility:hidden; }
.splash-inner{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:24px; }
.splash-name{
  margin:12px 0 0; font-size:calc(32px * var(--fs)); font-weight:900; letter-spacing:0;
  background:var(--gold-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 4px 18px rgba(245,208,122,.28));
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .splash-name{ color:var(--gold-2); }
}
.splash-sub{ margin:0; color:var(--muted); font-size:calc(12.5px * var(--fs)); }
.splash-bar{
  margin-top:20px; width:120px; height:2px; border-radius:2px;
  background:rgba(232,180,74,.16); overflow:hidden;
}
.splash-bar span{
  display:block; height:100%; width:40%; border-radius:2px;
  background:var(--gold-grad);
  animation:slide 1.1s ease-in-out infinite;
}
@keyframes slide{ 0%{ transform:translateX(150%);} 100%{ transform:translateX(-260%);} }

/* ---------- motion off ---------- */
.no-motion *, .no-motion *::before, .no-motion *::after{
  animation-duration:.001ms !important;
  animation-iteration-count:1 !important;
  transition-duration:.001ms !important;
}
.no-motion .embers{ display:none; }
@media (prefers-reduced-motion: reduce){
  .ember{ animation:none; }
  .screen{ animation:none; }
}

/* ---------- small screens ---------- */
@media (max-width:380px){
  .brand-sub{ display:none; }
  .story-ring{ width:60px; height:60px; }
  .story-ring .av-58{ width:52px; height:52px; font-size:21px; }
  .story-item{ width:66px; }
  .friend-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .post-art-letter{ font-size:64px; }
}
@media (min-width:900px){
  .app{ box-shadow:0 0 90px -30px rgba(255,90,31,.22); }
}