:root {
  --bg: #f1f3f5;
  --surface: #fff;
  --surface-2: #e9edf2;
  --text: #152029;
  --muted: #65717e;
  --line: #d5dce3;
  --accent: #2057f2;
  --accent-ink: #fff;
  --good: #197548;
  --warning: #946115;
  --danger: #bd3c40;
  --radius: 8px;
  --font: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111821;
  --surface: #19232f;
  --surface-2: #22303e;
  --text: #f1f5ff;
  --muted: #a5b2c4;
  --line: #334356;
  --accent: #6893ff;
  --accent-ink: #0a1b42;
  --good: #6adaaa;
  --warning: #f4bf69;
  --danger: #ff8e96;
  color-scheme: dark;
}
body { background: var(--bg); font-family: var(--font); font-size: 13px; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.app-shell { max-width: 600px; min-height: 100dvh; margin-inline: auto; background: var(--bg); }
.app-header { position: sticky; top: 0; z-index: 20; min-height: 65px; padding: max(12px, env(safe-area-inset-top), var(--host-safe-top, 0px)) 21px 11px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.signal-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.signal-brand > strong { font-size: 14px; font-weight: 800; line-height: 1.5; }
.signal-mark { direction: ltr; display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 25px; height: 24px; flex: none; color: var(--accent); }
.signal-mark i { display: block; width: 4px; height: 8px; background: currentColor; }
.signal-mark i:nth-child(2) { height: 13px; }
.signal-mark i:nth-child(3) { height: 19px; }
.signal-mark i:nth-child(4) { height: 24px; }
.signal-header-actions { display: flex; align-items: center; gap: 5px; }
.signal-language { height: 39px; min-width: 39px; border: 0; color: var(--text); background: transparent; font-size: 12px; font-weight: 800; }
.signal-settings { border: 0 !important; background: transparent !important; color: var(--text) !important; min-width: 39px; min-height: 39px; }
.app-main { padding: 27px 20px calc(108px + max(env(safe-area-inset-bottom), var(--host-safe-bottom, 0px))); }
.signal-page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 20px; }
.signal-kicker { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .05em; }
html[dir="rtl"] .signal-kicker { font-size: 10px; letter-spacing: 0; }
.signal-page-heading h1 { display: flex; align-items: center; gap: 11px; margin: 0; font-size: clamp(25px, 7vw, 29px); font-weight: 850; letter-spacing: -.7px; line-height: 1.3; }
.signal-total { display: inline-grid; place-items: center; min-width: 26px; height: 25px; padding: 0 7px; color: var(--muted); border: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: 0; border-radius: 4px; }
.signal-refresh { border: 1px solid var(--line) !important; background: var(--surface) !important; width: 40px; height: 40px; border-radius: 7px; color: var(--text); }
.signal-overview { isolation: isolate; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1px 1fr; min-height: 96px; padding: 16px 20px; color: #fff; background: #2057f2; border-radius: 8px; }
.overview-stat { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 0; text-align: start; border: 0; background: transparent; color: #fff; }
.overview-stat:nth-of-type(2) { padding-inline-start: 21px; }
.overview-label { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 500; }
.overview-label > i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.overview-stat > strong { font-size: 31px; line-height: 1.4; font-weight: 650; }
.overview-divider { margin-block: 5px; background: #ffffff45; }
.overview-decoration { position: absolute; inset-inline-end: 12px; bottom: -7px; opacity: .13; z-index: -1; }
.overview-decoration .signal-mark { width: 91px; height: 76px; gap: 9px; color: #fff; }
.overview-decoration .signal-mark i { width: 13px; height: 25px; }
.overview-decoration .signal-mark i:nth-child(2) { height: 43px; }
.overview-decoration .signal-mark i:nth-child(3) { height: 60px; }
.overview-decoration .signal-mark i:nth-child(4) { height: 78px; }
.signal-tools { margin-top: 20px; }
.signal-tools .search-box { min-height: 45px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; box-shadow: none; }
.signal-tools .search-box input { font-size: 12px; }
.signal-tools .segmented { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 5px; }
.signal-tools .segmented button, .signal-tools button[data-action="filter"], .signal-tools button[data-action="sort"] { border-radius: 5px; min-height: 34px; box-shadow: none; font-size: 11px; }
.signal-tools select { max-width: 145px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.signal-list-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin: 22px 0 12px; }
.signal-list-title h2 { margin: 0; font-size: 12px; font-weight: 800; }
.signal-list-title > span { color: var(--muted); font-size: 9px; }
.signal-tickets { display: grid; gap: 13px; }
.signal-ticket { --ticket-tone: var(--good); position: relative; overflow: hidden; padding: 15px 15px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 2px 0 #15202905; }
.signal-ticket.warning { --ticket-tone: var(--warning); }
.signal-ticket.critical { --ticket-tone: var(--danger); }
.signal-ticket.muted { --ticket-tone: var(--muted); }
.ticket-heading { display: flex; align-items: start; gap: 8px; }
.ticket-serial { margin-top: 2px; min-width: 15px; color: var(--muted); font-size: 10px; font-weight: 500; }
.ticket-identity { min-width: 0; flex: 1; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--text); text-align: start; border: 0; background: none; }
.ticket-identity > strong { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; line-height: 1.5; }
.ticket-technical { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.ticket-status { display: flex; align-items: center; gap: 5px; max-width: 110px; padding: 3px 6px; color: var(--ticket-tone); background: color-mix(in srgb, var(--ticket-tone) 8%, transparent); border: 1px solid color-mix(in srgb, var(--ticket-tone) 20%, transparent); border-radius: 4px; font-size: 9px; font-weight: 600; line-height: 1.5; }
.ticket-status > i { flex: none; width: 4px; height: 4px; background: currentColor; }
.ticket-description { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 0; padding-inline-start: 23px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.ticket-description > span { opacity: .5; }
.ticket-reading { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.ticket-eyebrow { display: block; font-size: 10px; color: var(--muted); }
.ticket-allowance { display: block; font-size: clamp(22px, 6vw, 29px); font-weight: 750; letter-spacing: -.7px; line-height: 1.65; }
.ticket-allowance.is-unavailable { color: var(--muted); }
.ticket-time { display: flex; flex-wrap: wrap; align-content: center; justify-content: flex-end; align-items: center; gap: 4px; flex: 0 1 112px; text-align: end; }
.ticket-time > strong { font-size: 13px; font-weight: 650; }
.ticket-time > span { flex-basis: 100%; color: var(--muted); font-size: 9px; }
.ticket-time > svg { color: var(--muted); }
.signal-rail { direction: ltr; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; margin-top: 8px; height: 5px; }
.signal-rail > i { background: var(--surface-2); }
.signal-rail > i.is-filled { background: var(--accent); }
.critical .signal-rail > i.is-filled, .warning .signal-rail > i.is-filled { background: var(--ticket-tone); }
.ticket-usage-detail { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 15px; font-size: 9px; color: var(--muted); line-height: 1.6; }
.ticket-usage-detail b { color: var(--text); font-weight: 500; }
.ticket-usage-detail > strong { color: var(--ticket-tone); font-size: 10px; font-weight: 600; white-space: nowrap; }
.usage-separator { opacity: .5; }
.ticket-bottom { border-top: 1px solid var(--line); }
.ticket-auto { display: flex; align-items: center; gap: 5px; padding-top: 9px; font-size: 9px; color: var(--muted); line-height: 1.7; }
.ticket-actions { display: flex; align-items: center; gap: 10px; min-height: 51px; }
.ticket-primary, .ticket-details { min-height: 42px; border: 0; display: flex; align-items: center; gap: 7px; background: transparent; font-size: 11px; font-weight: 700; text-align: start; padding: 5px 0; }
.ticket-primary { color: var(--accent); flex: 1; }
.ticket-details { color: var(--muted); font-size: 10px; font-weight: 500; gap: 8px; }
html[dir="rtl"] .ticket-details > svg, html[dir="rtl"] .overview-label > svg { transform: scaleX(-1); }
.ticket-state-content { margin: 16px 0 13px; }
.ticket-state-content > p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.9; }
.ticket-expiry { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--danger); font-size: 10px; font-weight: 600; }
.is-inactive { border-inline-start: 3px solid var(--ticket-tone); padding-inline-start: 13px; }
.signal-footnote { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 24px; color: var(--muted); font-size: 9px; }
.signal-small-mark .signal-mark { height: 13px; width: 17px; gap: 2px; color: var(--muted); }
.signal-small-mark .signal-mark i { width: 3px; height: 4px; }
.signal-small-mark .signal-mark i:nth-child(2) { height: 7px; }
.signal-small-mark .signal-mark i:nth-child(3) { height: 10px; }
.signal-small-mark .signal-mark i:nth-child(4) { height: 13px; }
.signal-loading { display: grid; place-items: center; padding: 50px 15px; min-height: 220px; color: var(--muted); font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.signal-loading-bars { animation: signal-pulse 1.1s ease-in-out infinite alternate; }
@keyframes signal-pulse { to { opacity: .25; } }
.app-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; max-width: 600px; margin-inline: auto; display: flex; justify-content: space-around; align-items: stretch; gap: 8px; padding: 7px 20px calc(7px + max(env(safe-area-inset-bottom), var(--host-safe-bottom, 0px))); min-height: 72px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0; box-shadow: 0 -5px 24px #15202904; }
.app-nav .signal-nav-item { position: relative; display: flex; flex-direction: row; flex: 1; justify-content: center; align-items: center; gap: 7px; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.app-nav .signal-nav-item.is-current { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.signal-nav-item.is-current:after { position: absolute; content: ''; top: -8px; inset-inline: 26%; height: 3px; background: var(--accent); }
.signal-nav-icon { display: grid; place-items: center; }
.btn { min-height: 44px; border-radius: 6px; font-size: 12px; font-weight: 650; box-shadow: none; }
.primary, .btn.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.secondary, .btn.secondary { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.btn.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); }
.badge { border-radius: 4px; font-size: 10px; padding: 4px 7px; }
.panel { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; background: var(--surface); }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.section-title { font-size: 14px; font-weight: 750; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 5px; min-height: 45px; background: var(--surface); }
.field label { font-size: 12px; font-weight: 600; }
.notice { border-radius: 6px; border-inline-start: 3px solid var(--warning); font-size: 12px; line-height: 1.9; }
.empty { padding: 36px 18px; border: 1px dashed var(--line); border-radius: 7px; background: var(--surface); }
.wallet-card { border: 0; border-radius: 8px; background: #2057f2; color: #fff; padding: 23px !important; box-shadow: none; }
.wallet-card .muted { color: #e5edff; }
.wallet-card strong, .wallet-card .balance { font-size: 33px; font-weight: 650; }
.wallet-tabs { gap: 7px; }
.wallet-tabs button { border-radius: 5px; }
.transaction-list { gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.transaction { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 15px 13px; }
.transaction:last-child { border-bottom: 0; }
.tx-icon { border-radius: 5px; background: var(--surface-2); }
.tx-amount { font-size: 14px; font-weight: 750; }
.category-list, .plan-list { gap: 12px; }
.category-card { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; border-inline-start: 3px solid var(--accent); }
.category-card h3, .plan-card h3 { font-size: 15px; }
.plan-card { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.plan-card[aria-pressed="true"], .plan-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sheet-backdrop { backdrop-filter: blur(3px); background: #0b142574; }
dialog.sheet { max-width: 580px; border-radius: 15px 15px 0 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.sheet-header { border-bottom: 1px solid var(--line); padding: 18px 20px; }
.sheet-header h2 { font-size: 18px; font-weight: 800; }
.sheet-body { padding: 20px; }
.sheet-actions { background: var(--surface); border-top: 1px solid var(--line); padding: 14px 20px max(14px, env(safe-area-inset-bottom), var(--host-safe-bottom, 0px)); }
.fact-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.fact-list > div { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.fact-list > *:last-child { border-bottom: 0; }
.renew-summary, .technical-value { border-radius: 7px; }
.progress { height: 5px; border-radius: 1px; background: var(--surface-2); }
.progress > * { border-radius: 1px; }
.toast { border-radius: 6px; background: var(--text); color: var(--surface); box-shadow: 0 8px 32px #0b14251f; font-size: 12px; }
@media (min-width: 500px) {
  .app-main { padding-inline: 28px; }
  .app-header { padding-inline: 28px; }
  .ticket-allowance { font-size: 32px; }
  .signal-ticket { padding: 18px 20px 0; }
  .signal-list-title > span { font-size: 10px; }
}
@media (max-width: 370px) {
  .app-main { padding-inline: 15px; }
  .app-header { padding-inline: 16px; }
  .app-nav .signal-nav-item { gap: 5px; padding-inline: 6px; font-size: 10px; }
  .app-nav { padding-inline: 13px; gap: 4px; }
  .signal-list-title > span { font-size: 8px; }
  .ticket-description { font-size: 9px; }
  .ticket-status { max-width: 96px; font-size: 8px; }
  .ticket-identity > strong { font-size: 12px; }
  .ticket-allowance { font-size: 22px; }
  .ticket-time { flex-basis: 95px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
