/* Jo Mail — shared styles (RTL first) */

:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --border: #e1e6e1;
  --text: #13201a;
  --muted: #5b6a62;
  --brand: #0b7a55;
  --brand-strong: #086345;
  --brand-soft: #e4f3ec;
  --on-brand: #ffffff;
  --accent: #ce1126;
  --accent-soft: #fdecee;
  --warn: #a8660b;
  --warn-soft: #fdf3e2;
  --ring: rgb(11 122 85 / .25);
  --shadow-sm: 0 1px 2px rgb(16 32 24 / .06);
  --shadow: 0 1px 2px rgb(16 32 24 / .05), 0 10px 30px rgb(16 32 24 / .07);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Noto Sans', Tahoma, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1210; --surface: #131b18; --surface-2: #19231f; --border: #24312b; --text: #e7efea;
    --muted: #94a59c; --brand: #34c08d; --brand-strong: #4fd3a1; --brand-soft: #123026; --on-brand: #06231a;
    --accent: #ff5468; --accent-soft: #3a1419; --warn: #f0b252; --warn-soft: #33260f; --ring: rgb(52 192 141 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1210; --surface: #131b18; --surface-2: #19231f; --border: #24312b; --text: #e7efea;
  --muted: #94a59c; --brand: #34c08d; --brand-strong: #4fd3a1; --brand-soft: #123026; --on-brand: #06231a;
  --accent: #ff5468; --accent-soft: #3a1419; --warn: #f0b252; --warn-soft: #33260f; --ring: rgb(52 192 141 / .3);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 16px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--brand); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a.link { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.nav a.link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
@media (max-width: 760px) { .nav a.link { display: none; } }
.lang-select {
  min-height: 36px; max-width: 150px; padding: 4px 28px 4px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer;
}
[dir="rtl"] .lang-select { padding: 4px 10px 4px 28px; }
.lang-select:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); border-color: var(--brand); }
@media (max-width: 420px) { .lang-select { max-width: 96px; } }

.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.footer-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 14px; font-size: 13.5px; }
.footer-langs a { color: var(--muted); padding: 2px 4px; }
.footer-langs a[aria-current] { color: var(--brand); font-weight: 600; }
.legal + .container .footer-langs { justify-content: center; padding-bottom: 28px; }

.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); white-space: pre; text-align: left; margin: 8px 0 18px; color: var(--text); }
.qr-box { display: grid; place-items: center; padding: 16px; margin-top: 12px; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.qr-box svg { max-width: 100%; height: auto; }
.otp { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; background: var(--brand-soft); border-bottom: 1px solid var(--border); }
.otp-label { color: var(--muted); font-size: 13.5px; }
.otp-code { font: 700 26px var(--mono); letter-spacing: 4px; color: var(--brand-strong); }
.code-badge { display: inline-block; padding: 0 8px; margin-inline-end: 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); font: 600 12.5px var(--mono); letter-spacing: 1px; }
.bell.active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
details > summary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); border-radius: 8px; }

/* Left-to-right languages */
[dir="ltr"] .viewer-back svg { transform: scaleX(-1); }
[dir="ltr"] .side-item .addr, [dir="ltr"] .table td.mono { text-align: start; }


/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 8px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus, .select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--ring); border-color: var(--brand); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--accent); }
.btn-danger:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 10px 22px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.input, .select, textarea {
  width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); transition: box-shadow .15s, border-color .15s;
}
textarea { min-height: 90px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13px; color: var(--muted); }
.form { display: grid; gap: 14px; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.input-group:focus-within { box-shadow: 0 0 0 4px var(--ring); border-color: var(--brand); }
.input-group input, .input-group select { border: 0; background: transparent; min-height: 44px; padding: 8px 12px; }
.input-group input { flex: 1; min-width: 0; outline: none; }
.input-group select { outline: none; border-inline-start: 1px solid var(--border); max-width: 50%; }
.input-group .at { display: grid; place-items: center; padding-inline: 2px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14.5px; }
.announcement { background: var(--brand); color: var(--on-brand); text-align: center; padding: 8px 16px; font-size: 14px; }

/* ---------- hero & address box ---------- */
.hero { position: relative; padding: 56px 0 28px; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1;
  background: radial-gradient(closest-side, var(--brand-soft), transparent 70%);
}
.hero-head { text-align: center; max-width: 760px; margin-inline: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--muted); box-shadow: var(--shadow-sm); }
.eyebrow img { width: 16px; height: 16px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 52px); font-weight: 700; margin-top: 18px; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { margin-top: 14px; font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 18px; color: var(--muted); font-size: 14.5px; }
.chips span { display: inline-flex; align-items: center; gap: 6px; }
.chips svg { width: 18px; height: 18px; color: var(--brand); }

.addr-card { max-width: 780px; margin: 32px auto 0; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.addr-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.addr-row { display: flex; gap: 10px; align-items: stretch; }
.addr-value {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 10px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px dashed var(--border); font-family: var(--mono);
  font-size: clamp(16px, 3.2vw, 22px); font-weight: 600; direction: ltr; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; cursor: pointer;
}
.addr-value::-webkit-scrollbar { display: none; }
.addr-value.loading { color: var(--muted); }
.addr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.timer svg { width: 16px; height: 16px; }
.timer.low { color: var(--accent); }
@media (max-width: 560px) {
  .addr-card { padding: 16px; border-radius: 18px; }
  .addr-row { flex-direction: column; }
  .addr-actions .btn { flex: 1 1 calc(50% - 8px); }
}

/* ---------- inbox ---------- */
.inbox {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr; min-height: 520px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.inbox-list { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.inbox-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.inbox-head h3 { font-size: 16px; }
.inbox-head .count { color: var(--muted); font-size: 14px; }
.inbox-head .btn { margin-inline-start: auto; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 var(--ring); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ring); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.msg-list { flex: 1; overflow-y: auto; max-height: 640px; }
.msg-item {
  width: 100%; display: flex; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; text-align: start; cursor: pointer;
}
.msg-item:hover { background: var(--surface-2); }
.msg-item.active { background: var(--brand-soft); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); font-weight: 700; text-transform: uppercase; }
.msg-item.unread .avatar { background: var(--brand); color: var(--on-brand); }
.msg-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.msg-top { display: flex; align-items: baseline; gap: 8px; }
.msg-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 500; }
.msg-item.unread .msg-top strong, .msg-item.unread .msg-subject { font-weight: 700; }
.msg-top time { flex: none; font-size: 12.5px; color: var(--muted); }
.msg-subject, .msg-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.msg-preview { color: var(--muted); font-size: 13px; }

.inbox-viewer { display: flex; flex-direction: column; min-width: 0; }
.viewer-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 20px; color: var(--muted); }
.viewer-empty svg { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--border); }
.viewer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.viewer-head h2 { font-size: 19px; word-break: break-word; }
.viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.viewer-meta strong { color: var(--text); font-weight: 600; }
.viewer-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer-back { display: none; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.att { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; cursor: pointer; }
.att:hover { border-color: var(--brand); }
.att svg { width: 16px; height: 16px; color: var(--brand); }
.viewer-body { flex: 1; display: flex; min-height: 420px; background: #fff; }
.viewer-body iframe { flex: 1; width: 100%; border: 0; min-height: 420px; background: #fff; }
.viewer-text { flex: 1; padding: 20px; white-space: pre-wrap; word-break: break-word; background: var(--surface); font-size: 15px; }

.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--muted); }
.empty .loader { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty .loader svg { width: 28px; height: 28px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.empty strong { color: var(--text); font-size: 16px; }

@media (max-width: 820px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { border-inline-end: 0; }
  .inbox .inbox-viewer { display: none; }
  .inbox.viewing .inbox-list { display: none; }
  .inbox.viewing .inbox-viewer { display: flex; }
  .viewer-back { display: inline-flex; }
}

/* ---------- marketing sections ---------- */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(24px, 3.6vw, 34px); }
.section-head p { margin-top: 10px; color: var(--muted); font-size: 17px; }
.kicker { display: block; color: var(--brand); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.feature { padding: 22px; }
.feature .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }

.steps { counter-reset: step; }
.step { padding: 22px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: 12px;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--border); font-size: 15px; }
.compare thead th { font-size: 14px; color: var(--muted); font-weight: 600; }
.compare thead th.us { color: var(--brand); }
.compare td.us { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); font-weight: 600; }
.compare tr:last-child td { border-bottom: 0; }
.yes, .no { display: inline-flex; align-items: center; gap: 6px; }
.yes svg, .no svg { width: 18px; height: 18px; }
.yes { color: var(--brand); }
.no { color: var(--muted); }
.table-wrap { overflow-x: auto; }

.pricing { align-items: stretch; }
.plan { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); position: relative; }
.plan.featured .badge { position: absolute; top: -12px; inset-inline-start: 22px; background: var(--brand); color: var(--on-brand); }
.plan h3 { font-size: 18px; }
.plan .price { font-size: 32px; font-weight: 700; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 15px; }
.plan li svg { width: 18px; height: 18px; color: var(--brand); flex: none; margin-top: 4px; }

.faq { max-width: 780px; margin-inline: auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--brand); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

.cta { text-align: center; padding: 44px 24px; border-radius: 24px; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: var(--on-brand); }
.cta h2 { font-size: clamp(22px, 3.4vw, 30px); }
.cta p { margin: 10px 0 20px; opacity: .9; }
.cta .btn { background: var(--surface); color: var(--brand); border-color: transparent; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; margin-top: 40px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--muted); }

/* ---------- auth page ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 18px 0; }
.tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.form-error { color: var(--accent); font-size: 14px; min-height: 1em; }

/* ---------- app shell (dashboard / admin) ---------- */
.shell { display: grid; grid-template-columns: 290px 1fr; gap: 20px; padding-block: 24px; align-items: start; }
.sidebar { position: sticky; top: 84px; display: grid; gap: 12px; }
.side-card { padding: 14px; }
.side-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; padding: 4px 6px 10px; }
.side-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.side-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: start; font-size: 14px; color: var(--text);
}
.side-item:hover { background: var(--surface-2); text-decoration: none; }
.side-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-item svg { width: 18px; height: 18px; flex: none; }
.side-item .addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; font-family: var(--mono); font-size: 13px; }
.side-item .label { flex: 1; }
.pill { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; text-align: center; }
.main { display: grid; gap: 16px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 22px; }
.usage { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.usage span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

.stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px; }
.stat .label { font-size: 13.5px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.mono { font-family: var(--mono); font-size: 13px; direction: ltr; text-align: end; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); }
.toolbar .input { max-width: 320px; }
.pager { display: flex; gap: 8px; justify-content: center; padding: 14px; }

.chart { width: 100%; height: 220px; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--brand-strong); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--border); }
.bars-list { display: grid; gap: 10px; }
.bars-list .row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.bars-list .row .usage { grid-column: 1 / -1; }

/* ---------- dialog & toast ---------- */
dialog {
  width: min(460px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog.wide { width: min(900px, calc(100% - 32px)); }
dialog::backdrop { background: rgb(8 14 11 / .45); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.dialog-head h3 { font-size: 18px; }
.dialog-body { padding: 16px 20px 20px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.toast {
  padding: 11px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14.5px;
  box-shadow: var(--shadow); animation: toast-in .2s ease-out;
}
.toast.success { background: var(--brand); color: var(--on-brand); }
.toast.error { background: var(--accent); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.legal { max-width: 780px; margin: 0 auto; padding: 48px 16px; }
.legal h1 { font-size: 30px; margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
