/* TopTel24 design system: mobile first, RTL, light and dark. */
@font-face { font-family: Vazirmatn; src: url("fonts/Vazirmatn-wght.f6d31671339d.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f4f6f6; --surface: #ffffff; --surface-2: #f8faf9; --text: #0e1a17; --muted: #64736f; --faint: #9aa7a3;
  --line: #e4eae8; --brand: #0c7a63; --brand-strong: #075c4a; --brand-soft: #e4f4ef; --on-brand: #fff;
  --hero: linear-gradient(140deg, #064d3f 0%, #0b7a63 55%, #13a07f 100%);
  --r1: #12a150; --r2: #2f6fe4; --r3: #ef8a1d; --danger: #c62f2a; --warn-bg: #fff6dd; --warn-text: #6d4c00;
  --shadow: 0 1px 2px rgba(14, 26, 23, .04), 0 6px 20px rgba(14, 26, 23, .06);
  --radius: 18px; --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1110; --surface: #141c1a; --surface-2: #19231f; --text: #e9f0ee; --muted: #9db0aa; --faint: #6f817c;
          --line: #24302d; --brand: #3cc29d; --brand-strong: #6fd8b9; --brand-soft: #143a31; --on-brand: #04261e;
          --hero: linear-gradient(140deg, #04261e 0%, #0a4a3c 60%, #0e6a55 100%);
          --warn-bg: #3a2f0e; --warn-text: #f5d57e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--text);
       font-size: 15.5px; line-height: 1.65; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.35rem; line-height: 1.4; margin: 0 0 .3em; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .error { color: var(--danger); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 18px; height: 18px; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }

/* header */
.hero { background: var(--hero); color: #fff; padding: 14px 16px 18px; position: sticky; top: 0; z-index: 10;
        border-radius: 0 0 22px 22px; box-shadow: 0 8px 24px rgba(6, 77, 63, .18); }
.hero .bar { max-width: 728px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brandmark { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.05rem; }
.brandmark .logo { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: .8rem; }
.hero .who { font-size: .85rem; opacity: .85; }
.search { position: relative; max-width: 728px; margin: 12px auto 0; }
.search .i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { width: 100%; height: 50px; border: 0; border-radius: 16px; padding: 0 46px 0 16px; font: inherit; font-size: 1rem;
                background: var(--surface); color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.12); outline: none; }
.search input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 4px 14px rgba(0,0,0,.12); }
.suggest { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--surface); border-radius: 16px;
           box-shadow: 0 16px 40px rgba(0,0,0,.18); overflow: hidden; z-index: 20; }
.suggest a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.suggest a:last-child { border: 0; }
.suggest b { direction: ltr; font-weight: 700; }
.suggest small { color: var(--muted); white-space: nowrap; }

/* banners */
.banner { max-width: 728px; margin: 12px auto 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--text); font-size: .95rem; }
.banner.warn, .banner.warning { background: var(--warn-bg); color: var(--warn-text); }
.banner.error { background: #fde8e7; color: var(--danger); }
.banner a { font-weight: 700; }
.wrap-banners { padding: 0 16px; }

/* cards and lists */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-top: 14px; box-shadow: var(--shadow); }
.card.narrow { max-width: 420px; margin: 28px auto 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 10px; }
.section-title h2 { color: var(--text); }
.section-title span { color: var(--muted); font-size: .85rem; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list a.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.list .item .grow { flex: 1; min-width: 0; }
.list .name { display: block; font-weight: 700; direction: ltr; text-align: right; }
.list .sub { color: var(--muted); font-size: .88rem; }
.list .sub b { color: var(--text); }
.list .i { color: var(--faint); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }

/* forms */
label, .label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .9rem; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
                          background: var(--surface-2); color: var(--text); outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: var(--surface); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); vertical-align: middle; }
input.code { text-align: center; letter-spacing: .6em; font-size: 1.6rem; font-weight: 700; direction: ltr; height: 60px; }
input.num { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 12px 18px;
       border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-align: center; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.block { width: 100%; margin-top: 18px; height: 52px; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 12px; font-size: .88rem; border-radius: 11px; }
.btn:active { transform: scale(.98); }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: .88rem; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.check-row label { margin: 0; color: var(--text); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { margin: 0; display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1.5px solid var(--line);
                border-radius: 12px; color: var(--text); background: var(--surface-2); }

/* login */
.welcome { text-align: center; padding: 34px 8px 6px; }
.welcome .mark { width: 64px; height: 64px; border-radius: 20px; background: var(--hero); color: #fff; display: grid; place-items: center;
                 margin: 0 auto 14px; font-weight: 800; box-shadow: 0 10px 24px rgba(6,77,63,.25); }
.welcome p { color: var(--muted); margin: 0; }
.points { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.points li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .92rem; }
.points .i { color: var(--brand); }

/* home */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.brand-tile { background: var(--surface); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow);
              display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.brand-tile strong { font-size: 1.05rem; }
.brand-tile span { color: var(--muted); font-size: .85rem; }
.brand-tile::after { content: ""; position: absolute; left: -18px; bottom: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); }

/* product page */
.product-head { margin: 18px 4px 6px; }
.product-head h1 { direction: ltr; text-align: right; }
.product-head .meta { color: var(--muted); font-size: .9rem; }
.options { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 14px; }
.opt-row { padding: 10px 0; }
.opt-row + .opt-row { border-top: 1px solid var(--line); }
.opt-row .title { color: var(--muted); font-size: .82rem; margin-bottom: 6px; display: block; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 44px;
        padding: 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--text);
        line-height: 1.25; font-weight: 600; transition: all .15s; }
.chip small { color: var(--muted); font-size: .72rem; font-weight: 500; margin-top: 2px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 4px 12px rgba(12,122,99,.25); }
.chip.on small { color: inherit; opacity: .85; }
.hint { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
        background: var(--brand-soft); font-size: .9rem; }
.hint .i { color: var(--brand); }
.prices { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.prices > li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.prices > li + li { border-top: 1px solid var(--line); }
.rank { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .9rem;
        background: var(--surface-2); color: var(--faint); }
.rank.r1 { background: var(--r1); color: #fff; } .rank.r2 { background: var(--r2); color: #fff; } .rank.r3 { background: var(--r3); color: #fff; }
.offer { flex: 1; min-width: 0; }
.offer .price { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; display: block; }
.offer .credit { color: var(--muted); font-size: .8rem; font-weight: 500; margin-inline-start: 6px; }
.offer .seller { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.offer .verified { color: var(--r2); }
.offer .tags { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
li.stale .price, li.stale .seller { color: var(--faint); }
.call { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--r1); color: #fff; border-radius: 14px;
        padding: 11px 15px; font-weight: 800; box-shadow: 0 6px 14px rgba(18,161,80,.28); }
.call .num { display: none; font-weight: 500; font-size: .8rem; }
.call.wide { width: 100%; justify-content: center; height: 52px; margin-top: 14px; }
.call.wide .num { display: inline; }
@media (hover: hover) and (min-width: 700px) { .call .num { display: inline; } }
.locked { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }

/* stats (panel) */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.status-card { background: var(--hero); color: #fff; border-radius: var(--radius); padding: 18px; margin-top: 16px; box-shadow: 0 10px 28px rgba(6,77,63,.25); }
.status-card .muted { color: rgba(255,255,255,.8); }
.status-card .btn { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
        background: var(--brand-soft); color: var(--brand-strong); }
.pill.off { background: var(--surface-2); color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }

/* editable product table (panel) */
.edit-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.edit-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; align-items: center; }
.edit-list li + li { border-top: 1px solid var(--line); }
.edit-list li.off { opacity: .55; }
.edit-list .what b { direction: ltr; display: block; text-align: right; }
.edit-list .what span { color: var(--muted); font-size: .82rem; }
.edit-list .inputs { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.edit-list .inputs input.num { padding: 10px 12px; }
.edit-list .toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin: 0; }
.sticky-save { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 14px; }
.sticky-save .btn { width: 100%; height: 52px; box-shadow: 0 10px 24px rgba(12,122,99,.3); }
@media (min-width: 900px) {
  .edit-list li { grid-template-columns: 1fr 160px 160px 90px; }
  .edit-list .inputs { grid-column: auto / span 3; grid-template-columns: 160px 160px 90px; }
}

/* plans (billing) */
.plans { display: grid; gap: 12px; margin-top: 14px; }
.plan { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 2px solid transparent; }
.plan.best { border-color: var(--brand); }
.plan .top { display: flex; justify-content: space-between; align-items: center; }
.plan .amount { font-size: 1.5rem; font-weight: 800; margin: 6px 0 2px; }
.plan .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.wallet { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallet b { font-size: 1.4rem; }
.ledger { list-style: none; padding: 0; margin: 0; }
.ledger li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.plus { color: var(--r1); } .minus { color: var(--danger); }

/* tab bar (phone) and side nav (laptop) */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; display: flex; justify-content: space-around; background: var(--surface);
          border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.05); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--faint); font-size: .74rem; font-weight: 600; border-radius: 14px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on .i { background: var(--brand-soft); border-radius: 10px; padding: 3px 12px; width: 48px; height: 28px; }
@media (min-width: 900px) {
  body.panel { padding-bottom: 0; padding-right: 220px; }
  body.panel .tabbar { top: 0; bottom: 0; right: 0; left: auto; width: 220px; flex-direction: column; justify-content: flex-start;
                       padding: 20px 12px 12px; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; gap: 4px; }
  body.panel .tabbar a { flex: none; flex-direction: row; gap: 10px; padding: 10px 14px; font-size: .95rem; }
  body.panel .tabbar a.on { background: var(--brand-soft); }
  body.panel .tabbar a.on .i { background: none; padding: 0; width: 22px; height: 22px; }
  body.panel main, body.panel .hero .bar, body.panel .wrap-banners { max-width: 980px; }
  body.panel .hero { border-radius: 0 0 0 28px; }
  body.panel .sticky-save { bottom: 16px; }
}
