@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1d2130;
  --muted: #6b7185;
  --line: #e6e8ef;
  --brand: #c13584;
  --brand-2: #833ab4;
  --brand-soft: #fbeaf3;
  --ok: #1e9e62;
  --ok-soft: #e4f6ed;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --err: #d93c3c;
  --err-soft: #fde8e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 4px 16px rgba(20, 24, 40, .04);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.4; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; font-size: .86em; }
.ltr { direction: ltr; text-align: left; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: #151826; color: #cfd3e3;
  padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .6rem 1.2rem; color: #fff; font-weight: 800; font-size: 1.1rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #feda75, #fa7e1e 30%, #d62976 60%, #962fbf 85%, #4f5bd5);
  display: grid; place-items: center; color: #fff; font-size: 1.1rem;
}
.nav a {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border-radius: 10px;
  color: #cfd3e3; margin-bottom: 2px; font-size: .95rem;
}
.nav a:hover { background: #23273a; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(193,53,132,.25), rgba(131,58,180,.25)); color: #fff; }
.nav .ico { width: 1.3rem; text-align: center; }
.sidebar .foot { margin-top: 1.5rem; padding: .6rem; font-size: .82rem; color: #8b90a6; }
.sidebar .foot button { width: 100%; }

.main { flex: 1; min-width: 0; padding: 1.6rem 2rem 4rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.menu-btn { display: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 1rem 1.1rem; }
.stat .n { font-size: 1.7rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .88rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 1rem 0; }

/* ---------- alerts / badges ---------- */
.alert { border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .93rem; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: #7a4f0c; border-color: #f3dcae; }
.alert.err { background: var(--err-soft); color: #8f1f1f; border-color: #f5c2c2; }
.alert.ok { background: var(--ok-soft); color: #145c3b; border-color: #bde7d0; }
.alert.info { background: #eaf1fe; color: #1f3e7a; border-color: #c9dafb; }
.badge { display: inline-block; padding: .05rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eef0f5; color: #474d62; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: .7rem 0 .3rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid #d6d9e3; border-radius: 10px; font: inherit; background: #fff; color: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(193,53,132,.25); border-color: var(--brand); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: .55rem 0; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid #d6d9e3; background: #fff; color: var(--text); border-radius: 10px;
  padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: #f4f5f9; text-decoration: none; }
button.primary, .btn.primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
button.primary:hover { filter: brightness(1.06); }
button.danger { color: var(--err); border-color: #f1c4c4; }
button.danger:hover { background: var(--err-soft); }
button.sm, .btn.sm { padding: .28rem .65rem; font-size: .84rem; border-radius: 8px; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .6rem .55rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .83rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { background: #f1f2f7; border-radius: 8px; padding: .05rem .5rem; font-size: .82rem; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 30, .5); display: flex; align-items: flex-start; justify-content: center; padding: 3vh 1rem; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 720px; padding: 1.4rem 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .actions { display: flex; gap: .6rem; justify-content: flex-start; margin-top: 1.2rem; }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 1.2rem; left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: #1d2130; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: 380px; font-size: .92rem; }
.toast.err { background: #a52727; }
.toast.ok { background: #18784b; }

/* ---------- media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.media-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; transition: transform .12s; }
.media-item:hover { transform: translateY(-2px); }
.media-item .thumb { aspect-ratio: 1; background: #eceef4 center/cover no-repeat; position: relative; }
.media-item .thumb .t { position: absolute; top: .4rem; right: .4rem; }
.media-item .meta { padding: .5rem .6rem; font-size: .82rem; color: var(--muted); display: flex; gap: .7rem; }
.thumb-sm { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #eceef4; }
.preview-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.preview-box { position: relative; width: 120px; }
.preview-box img, .preview-box video { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; background: #eee; display: block; }
.preview-box button { position: absolute; top: 4px; left: 4px; padding: 0 .45rem; }
.preview-box .ord { position: absolute; bottom: 4px; right: 4px; }

/* ---------- comments ---------- */
.comment { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.comment:last-child { border-bottom: 0; }
.comment .who { font-weight: 700; direction: ltr; display: inline-block; }
.comment .replies { margin-right: 1.4rem; border-right: 2px solid var(--line); padding-right: .8rem; margin-top: .4rem; }
.comment.hidden-c { opacity: .55; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; min-height: 70vh; }
.conv-list { overflow-y: auto; max-height: 75vh; padding: .4rem; }
.conv { padding: .65rem .7rem; border-radius: 10px; cursor: pointer; }
.conv:hover { background: #f4f5f9; }
.conv.active { background: var(--brand-soft); }
.conv .u { font-weight: 700; }
.conv .p { color: var(--muted); font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; max-height: 75vh; }
.msgs { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: .45rem; background: #fafbfd; border-radius: 12px; min-height: 300px; }
.msg { max-width: 75%; padding: .5rem .8rem; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: .93rem; }
.msg.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg.out { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; align-self: flex-end; }
.msg .time { display: block; font-size: .72rem; opacity: .7; margin-top: .2rem; }
.composer { display: flex; gap: .5rem; margin-top: .6rem; }
.composer textarea { min-height: 46px; height: 46px; }

/* ---------- logs ---------- */
.log-line { display: grid; grid-template-columns: 150px 80px 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.log-line:last-child { border-bottom: 0; }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid #ccd; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.profile { display: flex; align-items: center; gap: .9rem; }
.profile img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: #eee; }

.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button.active { background: var(--brand-soft); color: var(--brand); border-color: #f2c6dd; }

.type-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.type-pick label { margin: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem; text-align: center; cursor: pointer; font-weight: 600; }
.type-pick input { display: none; }
.type-pick input:checked + span { color: var(--brand); }
.type-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.type-pick .e { font-size: 1.5rem; display: block; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 20% 10%, #fde7f1, transparent 40%), radial-gradient(circle at 80% 90%, #ece4fb, transparent 40%), var(--bg); }
.login-card { width: 100%; max-width: 380px; }

@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .type-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; right: 0; z-index: 40; transform: translateX(100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
  .main { padding: 1rem; }
  .menu-btn { display: inline-flex; }
  .log-line { grid-template-columns: 1fr; gap: .1rem; }
}

.btn.disabled { pointer-events: none; opacity: .5; }

/* ================= پیش‌نمایش گوشی ================= */
.phone-layout { display: grid; grid-template-columns: 400px 1fr; gap: 1.5rem; align-items: start; }
.phone {
  width: 390px; height: 800px; border-radius: 52px; padding: 13px; position: relative;
  background: linear-gradient(145deg, #2a2d3a, #0f1118); box-shadow: 0 30px 60px rgba(15, 18, 30, .35), inset 0 0 0 2px #3a3e4e;
}
.phone::before { content: ""; position: absolute; top: 24px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #05060a; z-index: 5; }
.screen { width: 100%; height: 100%; border-radius: 40px; overflow: hidden; background: #fff; position: relative; display: flex; flex-direction: column; }
.ph-status { height: 50px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 28px 6px; font-size: .78rem; font-weight: 700; direction: ltr; }
.ph-top { display: flex; align-items: center; gap: .5rem; padding: .35rem .9rem .5rem; border-bottom: 1px solid #f0f1f5; flex-shrink: 0; }
.ph-top .t { font-weight: 800; direction: ltr; flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-icon { background: none; border: 0; padding: .2rem .45rem; font-size: 1.05rem; border-radius: 8px; cursor: pointer; color: inherit; }
.ph-icon:hover { background: #f2f3f7; }
.ph-body { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.ph-nav { display: flex; border-top: 1px solid #eceef3; flex-shrink: 0; padding-bottom: 14px; }
.ph-nav button { flex: 1; border: 0; background: none; border-radius: 0; padding: .55rem 0 .3rem; font-size: .78rem; flex-direction: column; gap: 0; color: #8a8fa3; }
.ph-nav button .g { font-size: 1.15rem; line-height: 1.2; }
.ph-nav button.on { color: var(--brand-2); }

.ph-head { display: flex; align-items: center; gap: .9rem; padding: .9rem .9rem .4rem; }
.ph-ava { width: 78px; height: 78px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, #b39ddb, #7e57c2 50%, #5c6bc0); flex-shrink: 0; }
.ph-ava img, .ph-ava .ph-ava-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #e9eaf0; display: grid; place-items: center; font-weight: 800; color: #7e57c2; font-size: 1.6rem; }
.ph-counts { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.ph-counts b { display: block; font-size: 1.02rem; }
.ph-counts span { font-size: .74rem; color: var(--muted); }
.ph-bio { padding: 0 .95rem .6rem; font-size: .84rem; line-height: 1.7; white-space: pre-wrap; }
.ph-bio .n { font-weight: 800; }
.ph-bio a { direction: ltr; display: inline-block; }
.ph-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; padding: 0 .8rem .7rem; }
.ph-kpis div { background: #f5f3fd; border-radius: 10px; padding: .35rem .2rem; text-align: center; }
.ph-kpis b { display: block; font-size: .88rem; color: var(--brand-2); }
.ph-kpis span { font-size: .64rem; color: var(--muted); }
.ph-section-t { font-size: .72rem; color: var(--muted); padding: 0 .95rem .25rem; }
.ph-stories { display: flex; gap: .7rem; padding: .2rem .9rem .8rem; overflow-x: auto; scrollbar-width: none; }
.ph-story { width: 64px; flex-shrink: 0; text-align: center; cursor: pointer; font-size: .68rem; color: var(--muted); }
.ph-story .r { width: 62px; height: 62px; border-radius: 50%; padding: 2.5px; background: linear-gradient(135deg, #f6a5c0, #b39ddb, #7e57c2); }
.ph-story .r div { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid #fff; background: #e9eaf0 center/cover no-repeat; }
.ph-empty-s { font-size: .74rem; color: var(--muted); padding: 0 .95rem .8rem; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ph-cell { aspect-ratio: 4 / 5; background: #eceef4 center/cover no-repeat; position: relative; cursor: pointer; }
.ph-cell .k { position: absolute; top: 4px; left: 5px; font-size: .7rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ph-cell .s { position: absolute; bottom: 0; inset-inline: 0; padding: 10px 5px 3px; font-size: .64rem; color: #fff; display: flex; gap: .45rem; background: linear-gradient(transparent, rgba(0,0,0,.55)); direction: rtl; }
.ph-more { text-align: center; padding: .7rem; }

.ph-media { position: relative; background: #000; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.ph-media img, .ph-media video { width: 100%; height: 100%; object-fit: contain; }
.ph-media .nav-b { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); padding: 0; font-size: .9rem; }
.ph-media .nav-b.l { left: 8px; } .ph-media .nav-b.r { right: 8px; }
.ph-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.ph-dots i.on { background: #fff; }
.ph-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .65rem .8rem .3rem; }
.ph-stats div { border: 1px solid #eceef3; border-radius: 10px; padding: .3rem .4rem; text-align: center; }
.ph-stats b { display: block; font-size: .9rem; }
.ph-stats span { font-size: .66rem; color: var(--muted); }
.ph-cap { padding: .4rem .95rem; font-size: .84rem; white-space: pre-wrap; line-height: 1.75; }
.ph-cap .d { display: block; color: var(--muted); font-size: .7rem; margin-top: .2rem; }
.ph-cm { padding: .45rem .95rem; border-top: 1px solid #f3f4f7; font-size: .82rem; }
.ph-cm .u { font-weight: 700; direction: ltr; display: inline-block; margin-left: .3rem; }
.ph-cm .meta { display: flex; gap: .6rem; font-size: .68rem; color: var(--muted); margin-top: .15rem; }
.ph-cm .meta button { border: 0; background: none; padding: 0; font-size: .68rem; color: var(--muted); font-weight: 600; }
.ph-cm .meta button:hover { color: var(--brand-2); }
.ph-cm.reply { padding-right: 2rem; background: #fbfbfd; }
.ph-cm.hid { opacity: .5; }
.ph-input { display: flex; gap: .4rem; padding: .5rem .6rem; border-top: 1px solid #eceef3; flex-shrink: 0; background: #fff; }
.ph-input input { border-radius: 20px; padding: .4rem .8rem; font-size: .84rem; }
.ph-input button { border-radius: 20px; padding: .3rem .8rem; font-size: .8rem; }
.ph-target { font-size: .7rem; color: var(--brand-2); padding: .3rem .9rem 0; display: flex; justify-content: space-between; }

.ph-conv { display: flex; gap: .65rem; align-items: center; padding: .6rem .9rem; cursor: pointer; }
.ph-conv:hover { background: #f7f7fa; }
.ph-conv .a { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #d1c4e9, #b39ddb); display: grid; place-items: center; font-weight: 800; color: #5e35b1; flex-shrink: 0; }
.ph-conv .x { flex: 1; min-width: 0; }
.ph-conv .x b { direction: ltr; display: inline-block; font-size: .86rem; }
.ph-conv .x div { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-msgs { display: flex; flex-direction: column; gap: .35rem; padding: .7rem; }
.ph-msg { max-width: 78%; padding: .4rem .7rem; border-radius: 16px; font-size: .82rem; white-space: pre-wrap; word-break: break-word; }
.ph-msg.in { background: #f0f1f5; align-self: flex-start; }
.ph-msg.out { background: linear-gradient(90deg, #7e57c2, #5c6bc0); color: #fff; align-self: flex-end; }
.ph-msg i { display: block; font-style: normal; font-size: .62rem; opacity: .7; margin-top: .1rem; }

.ph-story-view { position: absolute; inset: 0; background: #0b0c10; z-index: 10; display: flex; flex-direction: column; color: #fff; }
.ph-story-view .bars { display: flex; gap: 3px; padding: 52px 10px 6px; }
.ph-story-view .bars i { flex: 1; height: 2.5px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.ph-story-view .bars i span { display: block; height: 100%; background: #fff; width: 0; }
.ph-story-view .hd { display: flex; align-items: center; gap: .5rem; padding: 0 .8rem .4rem; font-size: .8rem; }
.ph-story-view .hd b { direction: ltr; }
.ph-story-view .hd .x { margin-right: auto; color: #fff; }
.ph-story-view .st { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ph-story-view .st img, .ph-story-view .st video { width: 100%; height: 100%; object-fit: cover; }
.ph-story-view .tap { position: absolute; top: 0; bottom: 0; width: 35%; cursor: pointer; z-index: 2; }
.ph-story-view .tap.prev { right: 0; } .ph-story-view .tap.next { left: 0; }
.ph-story-view .ins { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; padding: .6rem .7rem 1.3rem; background: rgba(255,255,255,.06); }
.ph-story-view .ins div { text-align: center; font-size: .66rem; opacity: .85; }
.ph-story-view .ins b { display: block; font-size: .95rem; opacity: 1; }
.ph-loading { display: grid; place-items: center; height: 100%; }
.ph-side .card { margin-bottom: 1rem; }
.ph-side ul { margin: .3rem 0 0; padding-right: 1.1rem; font-size: .88rem; }
.ph-side li { margin: .25rem 0; }
@media (max-width: 1100px) { .phone-layout { grid-template-columns: 1fr; justify-items: center; } .ph-side { width: 100%; } }
@media (max-width: 440px) { .phone { transform: scale(.88); transform-origin: top center; } }

.live-dot { display: inline-flex; align-items: center; gap: .25rem; font-size: .66rem; font-weight: 700; color: #9aa0b5; padding: .05rem .45rem; border-radius: 99px; background: #f2f3f7; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: #c3c7d4; }
.live-dot.on { color: #1e9e62; background: #e4f6ed; }
.live-dot.on i { background: #1e9e62; animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(30,158,98,.5); } 70% { box-shadow: 0 0 0 6px rgba(30,158,98,0); } 100% { box-shadow: 0 0 0 0 rgba(30,158,98,0); } }

/* ---------- پیش‌نمایش: ساختار فید ---------- */
.ph-status { color: #111; padding: 0 30px 6px; }
.ph-status #ph-clock { font-size: .9rem; font-weight: 700; }
.sb-ic { display: inline-flex; gap: 5px; align-items: center; color: #111; }
.ph-top { min-height: 50px; border-bottom: 0; padding: .3rem .7rem; }
.ph-top .ph-icon svg { display: block; }
.ph-t2 { flex: 1; text-align: center; line-height: 1.25; margin-left: 2.6rem; }
.ph-t2 small { display: block; font-size: .64rem; color: #8a8fa3; font-weight: 700; letter-spacing: .4px; direction: ltr; }
.ph-t2 b { font-size: .98rem; }
.ph-nav { padding: .2rem .4rem 0; border-top: 1px solid #eceef3; }
.ph-nav button { padding: .55rem 0 .45rem; color: #1b1d26; }
.ph-nav button svg { width: 25px; height: 25px; }
.ph-nav button.on svg { stroke-width: 2.6; }
.ph-nav .ph-nav-ava { width: 27px; height: 27px; border-radius: 50%; overflow: hidden; display: block; border: 1.5px solid transparent; }
.ph-nav .ph-nav-ava img, .ph-nav .ph-nav-ava .ph-ava-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: .7rem; display: grid; place-items: center; background: #e9eaf0; color: #7e57c2; font-weight: 800; }
.ph-nav button.ava-tab.on .ph-nav-ava { border-color: #1b1d26; }
.ph-home-ind { height: 18px; flex-shrink: 0; position: relative; }
.ph-home-ind::after { content: ""; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 120px; height: 4.5px; border-radius: 3px; background: #1b1d26; }

.ph-ava.sm { width: 32px; height: 32px; padding: 0; background: none; }
.ph-ava.sm img, .ph-ava.sm .ph-ava-fallback { border: 0; font-size: .8rem; }
.ph-ava.has-st { cursor: pointer; }
.ph-ava:not(.has-st):not(.sm) { background: #e3e5ee; }
.ph-tabs { display: flex; justify-content: center; border-top: 1px solid #eceef3; }
.ph-tabs span { display: flex; align-items: center; gap: .3rem; padding: .45rem 0; font-size: .74rem; font-weight: 700; border-top: 1.5px solid #1b1d26; margin-top: -1px; }
.ph-grid.reels .ph-cell { aspect-ratio: 9 / 16; }
.ph-cell .k svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); stroke: #fff; }
.ph-cell .s svg { width: 11px; height: 11px; vertical-align: -1px; }

.ph-post { border-bottom: 1px solid #f1f2f6; padding-bottom: .5rem; }
.ph-post-h { display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; }
.ph-post-h b { direction: ltr; font-size: .86rem; }
.ph-post .ph-media { background: #ececec; aspect-ratio: 4 / 5; }
.ph-post .ph-media img, .ph-post .ph-media video { object-fit: cover; }
.ph-play { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.92); cursor: pointer; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.ph-play.hide { display: none; }
.ph-mute { position: absolute; bottom: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: rgba(30,30,35,.75); color: #fff; }
.ph-mute:hover { background: rgba(30,30,35,.9); }
.ph-count { position: absolute; top: 10px; right: 10px; background: rgba(20,20,25,.7); color: #fff; font-size: .7rem; padding: .05rem .5rem; border-radius: 99px; }
.ph-acts { display: flex; align-items: center; gap: 1rem; padding: .55rem .8rem .2rem; }
.ph-acts .a { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: none; padding: 0; color: #1b1d26; font-weight: 600; font-size: .86rem; direction: ltr; }
.ph-acts button.a:hover { color: var(--brand-2); background: none; }
.ph-acts .a svg { width: 24px; height: 24px; }
.ph-acts .a b { font-weight: 600; }
.ph-views { display: flex; align-items: center; gap: .3rem; padding: .15rem .85rem; font-size: .8rem; font-weight: 700; }
.ph-views svg { width: 13px; height: 13px; }
.ph-cap2 { padding: .1rem .85rem; font-size: .84rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.ph-cap2 b { direction: ltr; unicode-bidi: isolate; }
.ph-cap2.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-more-t, .ph-allc { border: 0; background: none; padding: 0 .85rem; font-size: .78rem; color: #8a8fa3; font-weight: 500; display: block; }
.ph-more-t:hover, .ph-allc:hover { background: none; color: var(--brand-2); }
.ph-date { padding: .15rem .85rem .2rem; font-size: .66rem; color: #9aa0b5; }

.ph-sheet { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; justify-content: flex-end; }
.ph-sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .2s; }
.ph-sheet.open .ph-sheet-bg { background: rgba(0,0,0,.35); }
.ph-sheet-in { position: relative; background: #fff; border-radius: 18px 18px 0 0; height: 72%; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .22s ease; padding-bottom: 14px; }
.ph-sheet.open .ph-sheet-in { transform: none; }
.ph-sheet-in .grab { width: 40px; height: 4px; border-radius: 3px; background: #d5d8e2; margin: 8px auto 2px; }
.ph-sheet-h { display: flex; align-items: center; justify-content: center; position: relative; padding: .3rem; border-bottom: 1px solid #f0f1f5; font-size: .9rem; }
.ph-sheet-h .ph-icon { position: absolute; left: .5rem; }
.ph-sheet-b { flex: 1; overflow-y: auto; }
.ph-cm { display: flex; gap: .55rem; border-top: 0; padding: .55rem .8rem; }
.ph-cm.reply { padding-right: 2.6rem; background: none; }
.ph-cm-a { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #d1c4e9, #b39ddb); color: #5e35b1; font-weight: 800; font-size: .75rem; display: grid; place-items: center; flex-shrink: 0; }
.ph-cm-x { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.6; }
.ph-cm-x .u { font-weight: 700; direction: ltr; display: inline-block; margin: 0; }
.ph-cm-x .tm { color: #9aa0b5; font-size: .68rem; }

.ph-statlist { margin: 0 .8rem; border: 1px solid #eceef3; border-radius: 14px; overflow: hidden; }
.ph-statlist div { display: flex; justify-content: space-between; padding: .55rem .8rem; font-size: .82rem; border-bottom: 1px solid #f2f3f7; }
.ph-statlist div:last-child { border-bottom: 0; }
.ph-statlist b { color: var(--brand-2); }
.ph-toplist { padding: 0 .8rem .8rem; }
.ph-topi { display: flex; gap: .6rem; align-items: center; padding: .4rem 0; cursor: pointer; font-size: .8rem; }
.ph-topi .th { width: 48px; height: 48px; border-radius: 8px; background: #eee center/cover no-repeat; flex-shrink: 0; }
.ph-topi .c { font-weight: 600; }
.ph-topi .muted { font-size: .7rem; }
