:root {
  --bg: #f8f9f5;
  --surface: #ffffff;
  --surface-2: #eef0e8;
  --text: #20271f;
  --muted: #737b70;
  --line: #dde1d6;
  --accent: #d3ef5b;
  --accent-ink: #25300d;
  --good: #52632b;
  --warning: #926714;
  --danger: #a74330;
  --radius: 9px;
  --font: Vazirmatn, system-ui, sans-serif;
  --selected: #252b22;
  --selected-text: #f8faef;
  --selected-muted: #b4bea8;
  --selected-line: #47503d;
  --header-bg: #f8f9f5ed;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161a15;
  --surface: #20261d;
  --surface-2: #2b3327;
  --text: #f1f4e9;
  --muted: #a6b19e;
  --line: #353e2f;
  --accent: #d3ef5b;
  --accent-ink: #25300d;
  --good: #c1d59f;
  --warning: #ebc27a;
  --danger: #f29b84;
  --selected: #303a26;
  --selected-text: #f8faef;
  --selected-muted: #c4ccbb;
  --selected-line: #515e40;
  --header-bg: #161a15ed;
  color-scheme: dark;
}
html { scroll-padding-top: 135px; }
body { background: var(--bg); }
button { transition: background-color .16s, color .16s, transform .16s; }
button:active { transform: scale(.975); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.relay-shell { max-width: 520px; padding-bottom: 0; min-height: 100dvh; }
.relay-top { position: sticky; top: 0; z-index: 20; padding-top: max(env(safe-area-inset-top), var(--host-safe-top, 0px)); background: var(--header-bg); backdrop-filter: blur(20px); }
.relay-shell .app-header { position: static; display: flex; align-items: center; justify-content: space-between; padding: 11px 23px 9px; border: 0; background: transparent; gap: 20px; }
.relay-brand { display: flex; align-items: center; gap: 10px; }
.relay-brand > div { display: flex; flex-direction: column; }
.relay-brand strong { font-family: Arial, sans-serif; font-size: 26px; font-weight: 800; line-height: .95; letter-spacing: -1.4px; }
.relay-brand strong > span { font-size: 11px; vertical-align: top; letter-spacing: 0; margin-inline-start: 4px; }
.relay-brand small { font-size: 9px; color: var(--muted); margin-top: 4px; }
.relay-mark { width: 25px; height: 32px; display: flex; align-items: center; gap: 3px; transform: skew(-15deg); }
.relay-mark i { display: block; width: 6px; height: 23px; background: var(--text); }
.relay-mark i:nth-child(2) { height: 32px; background: #9bb429; }
.relay-mark i:nth-child(3) { height: 14px; align-self: end; }
.relay-header-tools { display: flex; align-items: center; gap: 6px; }
.relay-language { width: 40px; height: 42px; font-size: 11px; font-weight: 700; border: 0; background: none; }
.relay-shell .icon-btn { border: 0; background: transparent; width: 42px; height: 44px; border-radius: 7px; }
.relay-shell .icon-btn:hover, .relay-shell .icon-btn.is-pressed { background: var(--surface-2); }
.relay-shell .app-nav { position: static; width: auto; display: flex; padding: 0 22px; border: 0; border-bottom: 1px solid var(--line); background: transparent; margin: 0; gap: 25px; max-width: none; }
.relay-shell .app-nav button { border-radius: 0; flex: 0 1 auto; display: flex; flex-direction: row; gap: 7px; padding: 0; min-height: 44px; font-size: 12px; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); white-space: nowrap; }
.relay-shell .app-nav button[aria-current="page"] { background: none; color: var(--text); border-bottom-color: var(--text); }
.relay-nav-count { display: grid; place-items: center; min-width: 18px; height: 18px; font-size: 10px; line-height: 1; padding: 0 4px; background: var(--surface-2); border-radius: 4px; }
.relay-shell .app-main { padding: 0 22px 24px; }
.relay-shell[data-page="subscriptions"] .app-main { padding-bottom: calc(135px + env(safe-area-inset-bottom)); }
.relay-inbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 76px; padding-block: 15px 9px; }
.relay-inbox-toolbar h1 { font-size: 22px; letter-spacing: -.5px; font-weight: 650; }
.relay-inbox-toolbar > div > span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.relay-toolbar-actions { display: flex; gap: 0; }
.relay-toolbar-actions .icon-btn { width: 36px; }
.relay-tools { padding: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; margin-bottom: 14px; }
.relay-tools .list-controls { margin: 0; gap: 8px; }
.relay-tools .search-box { background: var(--bg); border-radius: 5px; font-size: 12px; }
.relay-tools .segmented { gap: 0; }
.relay-tools .segmented button { padding-inline: 7px; font-size: 10px; }
.relay-tools .sort-select { font-size: 10px; max-width: 81px; }
.relay-tools .result-count { font-size: 10px; }
.relay-group { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; font-size: 9px; letter-spacing: 1px; color: var(--muted); }
.relay-group:not(:first-child) { margin-top: 10px; }
.relay-group > span:first-child { display: flex; align-items: center; gap: 7px; }
.relay-group i { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.relay-group i.active { background: #a0b62e; }
.relay-group > .ltr { letter-spacing: 0; }
.relay-shell .app-main article.relay-item { content-visibility: visible; contain-intrinsic-size: none; }
.relay-item { border-bottom: 1px solid var(--line); position: relative; }
.relay-item.is-selected { background: var(--selected); color: var(--selected-text); border: 0; border-radius: 6px; margin-inline: -7px; padding-inline: 7px; }
.relay-item.is-selected::before { content: ''; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 3px; background: var(--accent); border-radius: 0 2px 2px 0; }
.relay-row-toggle { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 13px 6px 5px; background: none; border: 0; text-align: start; min-height: 60px; }
.relay-row-toggle:focus-visible { outline-offset: -4px; outline-color: #9bb429; }
.relay-row-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.relay-row-mark.expired { color: var(--danger); background: color-mix(in srgb,var(--danger) 7%, transparent); border-color: transparent; }
.relay-row-mark.missing { color: var(--danger); border-style: dashed; }
.is-selected .relay-row-mark { background: #cfe858; border-color: transparent; color: #293716; }
.relay-identity { min-width: 0; }
.relay-identity strong { font-size: 12px; line-height: 1.5; font-weight: 600; display: block; overflow-wrap: anywhere; letter-spacing: -.2px; }
.relay-identity .relay-technical, .relay-category { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
[dir="rtl"] .relay-identity .ltr { text-align: right; }
.is-selected .relay-category, .is-selected .relay-technical { color: var(--selected-muted); }
.relay-row-end { display: flex; flex-direction: column; align-items: end; gap: 5px; max-width: 80px; }
.relay-status { font-size: 10px; font-weight: 600; line-height: 1.4; }
.is-selected .relay-status.good { color: #d3ef5b; }
.is-selected .relay-status.critical { color: #ffb59d; }
.relay-row-position { display: flex; align-items: center; gap: 4px; font-size: 8px; color: var(--muted); }
.is-selected .relay-row-position { color: var(--selected-muted); }
.is-selected .relay-row-position .icon { transform: rotate(180deg); }
.relay-preview { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 6px 14px; padding-inline-start: 52px; font-size: 10px; color: var(--muted); }
.relay-tiny-meter { display: block; width: 30px; height: 3px; background: var(--line); direction: ltr; flex-shrink: 0; }
.relay-tiny-meter i { display: block; height: 100%; background: #819832; }
.relay-open { padding: 5px 15px 0; }
.relay-data { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-top: 4px; }
.relay-caption { display: block; font-size: 10px; color: var(--selected-muted); margin-bottom: 0; }
.relay-data strong { display: block; font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -.6px; }
.relay-time { display: flex; align-items: center; gap: 5px; font-size: 10px; padding-bottom: 6px; color: var(--selected-muted); }
.relay-meter { height: 12px; margin-top: 9px; background: var(--selected-line); position: relative; overflow: hidden; direction: ltr; }
.relay-meter-fill { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.relay-meter.warning .relay-meter-fill { background: #e6c779; }
.relay-meter.critical .relay-meter-fill { background: #f09d82; }
.relay-meter > i { position: absolute; inset: 0; background: repeating-linear-gradient(to right,transparent 0,transparent calc(5% - 3px),var(--selected) calc(5% - 3px),var(--selected) 5%); }
.relay-meter.is-unknown { opacity: .5; }
.relay-meter-meta { display: flex; justify-content: space-between; gap: 10px; padding-block: 5px 7px; font-size: 9px; color: var(--selected-muted); }
.relay-meter-meta b { color: var(--selected-text); font-weight: 450; }
.relay-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--selected-line); }
.relay-row-actions button { min-height: 44px; padding: 0; border: 0; background: none; display: flex; align-items: center; gap: 5px; font-size: 10px; }
.relay-auto { color: var(--selected-muted); }
.relay-auto-state { padding: 1px 5px; color: var(--selected-muted); border: 1px solid var(--selected-line); border-radius: 3px; font-size: 9px; }
.relay-auto-state.is-on { color: #d3ef5b; }
.relay-details { color: var(--selected-text); }
[dir="rtl"] .relay-details .icon, [dir="rtl"] .relay-dock-primary > .icon:last-child { transform: rotate(180deg); }
.relay-inline-danger { color: #ffb59d; }
.relay-plan-note { padding-bottom: 10px; color: var(--selected-muted); font-size: 9px; overflow-wrap: anywhere; }
.relay-state-message { display: flex; align-items: start; gap: 12px; padding: 14px 0 20px; color: var(--selected-muted); font-size: 12px; }
.relay-state-message > .icon { color: #ffb59d; margin-top: 3px; }
.relay-endline { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; color: var(--muted); font-size: 8px; letter-spacing: .8px; }
.relay-endline > .ltr { letter-spacing: 0; }
.relay-dock { position: fixed; inset-inline: 0; bottom: 0; max-width: 520px; margin: auto; padding: 16px 22px calc(18px + max(env(safe-area-inset-bottom),var(--host-safe-bottom,0px))); z-index: 30; background: var(--header-bg); backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
.relay-dock-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 9px; color: var(--muted); }
.relay-dock-caption > span:first-child { display: flex; align-items: center; gap: 5px; white-space: nowrap; letter-spacing: .8px; }
.relay-dock-caption i { width: 4px; height: 4px; border-radius: 50%; background: #90a22c; }
.relay-dock-caption > .ltr { overflow-wrap: anywhere; text-align: end; }
.relay-dock-actions { display: flex; gap: 8px; align-items: center; }
.relay-dock-primary { flex: 1; min-width: 0; border: 0; border-radius: 7px; min-height: 49px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 13px; color: var(--accent-ink); background: var(--accent); font-size: 11px; font-weight: 700; }
.relay-dock-primary > span { flex: 1; text-align: start; }
.relay-dock-actions > .icon-btn { width: 47px; height: 49px; border: 1px solid var(--line); background: var(--surface); }
.relay-fetching { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; min-height: 18px; }
.relay-fetching > span { width: 20px; height: 3px; background: #9bb429; animation: relay-load .8s ease infinite alternate; transform-origin: right; }
.relay-loading { padding: 25px 0; font-size: 12px; color: var(--muted); }
.relay-loading > .relay-mark { display: inline-flex; margin-inline-end: 15px; vertical-align: middle; }
.relay-loading-rows { margin-top: 26px; display: grid; gap: 16px; }
.relay-loading-rows i { display: block; height: 75px; border-top: 1px solid var(--line); background: linear-gradient(90deg,var(--surface-2),var(--bg),var(--surface-2)); background-size: 200%; animation: relay-shimmer 1.2s linear infinite; }
.relay-loading-rows i:nth-child(2) { animation-delay: .14s; }
.relay-loading-rows i:nth-child(3) { animation-delay: .28s; }
.relay-shell .load-more { font-size: 11px; border-radius: 5px; background: transparent; }
.relay-page-tag { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 0 13px; font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.relay-shell .page-title { margin-bottom: 19px; }
.relay-shell .page-title h1 { font-size: 24px; font-weight: 600; }
.relay-shell .page-title p { font-size: 11px; margin-top: 5px; }
.relay-ledger .wallet-card { background: none; color: var(--text); padding: 21px 0 24px; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 12px; }
.relay-ledger .wallet-card .balance { font-size: 36px; font-weight: 600; }
.relay-ledger .wallet-card .btn { background: var(--accent); color: var(--accent-ink); border-radius: 5px; font-size: 11px; min-height: 40px; }
.relay-ledger .wallet-tabs { gap: 0; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.relay-ledger .wallet-tabs .btn { border: 0; border-radius: 3px; background: none; color: var(--muted); }
.relay-ledger .wallet-tabs .selected { color: var(--text); background: var(--surface-2); }
.relay-ledger .section-title h2 { font-size: 16px; }
.relay-ledger .search-box { border-radius: 5px; font-size: 11px; background: var(--surface); }
.relay-ledger .segmented button { border-radius: 3px; font-size: 10px; padding-inline: 10px; }
.relay-ledger .segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.relay-ledger .transaction { padding-block: 17px; gap: 10px; grid-template-columns: 29px minmax(0,1fr) auto; }
.relay-ledger .tx-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); }
.relay-ledger .tx-icon .icon { width: 14px; height: 14px; }
.relay-ledger .tx-title { font-size: 11px; }
.relay-ledger .tx-amount { font-size: 11px; }
.relay-ledger .tx-meta { font-size: 9px; }
.relay-store .category-list { gap: 0; border-top: 1px solid var(--line); counter-reset: categories; }
.relay-store .category-card { grid-template-columns: 35px minmax(0,1fr) 20px; padding: 22px 0; border: 0; border-bottom: 1px solid var(--line); background: none; border-radius: 0; gap: 14px; }
.relay-store .category-card:hover { background: var(--surface-2); }
.relay-store .category-symbol { width: 35px; height: 35px; background: var(--text); color: var(--accent); border-radius: 7px; font-size: 18px; }
.relay-store .category-card h3 { font-size: 13px; }
.relay-store .category-card p { font-size: 10px; }
.relay-store .category-card > .icon { width: 17px; }
.btn { border-radius: 6px; }
.btn.primary { color: var(--accent-ink); }
.btn.secondary { border: 1px solid var(--line); }
.badge { border-radius: 4px; font-size: 10px; }
.sheet { border-radius: 15px 15px 0 0; }
.sheet-header { padding-block: 18px 14px; }
.sheet-header h2 { font-size: 17px; font-weight: 600; }
.sheet .icon-btn { border-radius: 5px; }
.sheet .notice, .sheet .technical-value, .sheet .detail-usage, .sheet .renew-summary, .sheet .field input, .sheet .field select, .sheet .field textarea, .sheet .plan-card { border-radius: 6px; }
.sheet .detail-usage { background: var(--selected); color: var(--selected-text); }
.sheet .detail-usage .muted { color: var(--selected-muted); }
.sheet .plan-card { padding: 16px; }
.sheet .plan-card:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.sheet .plan-card .price { font-size: 20px; }
.sheet .action-grid .btn { font-size: 11px; }
.sheet .fact-list dt { font-size: 11px; }
.sheet .fact-list dd { font-size: 11px; }
.toast { border-radius: 7px; bottom: calc(119px + env(safe-area-inset-bottom)); font-size: 12px; }
@keyframes relay-load { from { transform: scaleX(.2); opacity: .5; } to { transform: scaleX(1); opacity: 1; } }
@keyframes relay-shimmer { to { background-position: -200%; } }
@media (max-width: 380px) {
  .relay-shell .app-header { padding-inline: 18px; }
  .relay-shell .app-nav { padding-inline: 18px; gap: 22px; }
  .relay-shell .app-main { padding-inline: 18px; }
  .relay-dock { padding-inline: 18px; }
  .relay-inbox-toolbar h1 { font-size: 21px; }
  .relay-data strong { font-size: 23px; }
  .relay-time { font-size: 9px; }
  .relay-identity strong { font-size: 11px; }
  .relay-row-end { max-width: 67px; }
  .relay-dock-primary { font-size: 10px; padding-inline: 11px; }
  .relay-dock-actions > .icon-btn { width: 45px; }
}
@media (min-width: 700px) {
  body { background: color-mix(in srgb,var(--bg) 95%,var(--text)); }
  .relay-shell { border-inline: 1px solid var(--line); }
  .relay-dock { border-inline: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
