@font-face {
  font-family: Vazirmatn;
  src: url("fonts/vazirmatn-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C;
}
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/vazirmatn-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/vazirmatn-arabic-700.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C;
}
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/vazirmatn-latin-700.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --accent: #ef4444;
  --accent-strong: #dc2626;
  --accent-deep: #b91c1c;
  --accent-ink: #fca5a5;
  --accent-soft: rgba(239, 68, 68, 0.12);
  --accent-line: rgba(239, 68, 68, 0.38);
  --on-accent: #ffffff;

  --bg: #07080b;
  --bg-elev: #0c0d12;
  --card: #101218;
  --card-2: #151821;
  --card-hover: #171a24;
  --field: #0b0c11;
  --glass: rgba(10, 11, 16, 0.72);
  --tint-1: rgba(255, 255, 255, 0.03);
  --tint-2: rgba(255, 255, 255, 0.06);
  --tint-3: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --ink: #f4f4f5;
  --ink-2: #c7c7cf;
  --ink-3: #8e8e9a;

  --ok: #34d399;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --bad: #f87171;
  --bad-soft: rgba(239, 68, 68, 0.14);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  --sh-1: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 2px rgba(0, 0, 0, 0.35);
  --sh-2: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 40px -20px rgba(0, 0, 0, 0.75);
  --sh-3: 0 28px 70px -28px rgba(0, 0, 0, 0.85);
  --sh-accent: 0 10px 28px -12px rgba(220, 38, 38, 0.7);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms;
  --t-med: 220ms;

  --header-h: 68px;
  --tabbar-h: 64px;
  --sidebar-w: 264px;
  --wrap: 1200px;
}

html[data-theme="light"] {
  color-scheme: light;
  --accent-ink: #b91c1c;
  --accent-soft: rgba(220, 38, 38, 0.08);
  --accent-line: rgba(220, 38, 38, 0.3);
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #fafafb;
  --card-hover: #ffffff;
  --field: #ffffff;
  --glass: rgba(255, 255, 255, 0.8);
  --tint-1: rgba(17, 17, 24, 0.025);
  --tint-2: rgba(17, 17, 24, 0.05);
  --tint-3: rgba(17, 17, 24, 0.08);
  --line: rgba(17, 17, 24, 0.08);
  --line-2: rgba(17, 17, 24, 0.14);
  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-3: #6b6b76;
  --ok: #047857;
  --ok-soft: rgba(5, 150, 105, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --bad: #b91c1c;
  --bad-soft: rgba(220, 38, 38, 0.08);
  --sh-1: 0 1px 2px rgba(17, 17, 24, 0.06);
  --sh-2: 0 1px 2px rgba(17, 17, 24, 0.04), 0 14px 34px -18px rgba(17, 17, 24, 0.18);
  --sh-3: 0 30px 60px -30px rgba(17, 17, 24, 0.3);
  --sh-accent: 0 10px 24px -12px rgba(220, 38, 38, 0.55);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body:not(.is-app):not(.auth-body)::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 720px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 85% -10%, rgba(239, 68, 68, 0.16), transparent 62%),
    radial-gradient(600px 360px at 0% 0%, rgba(255, 255, 255, 0.035), transparent 60%);
}
html[data-theme="light"] body:not(.is-app):not(.auth-body)::before {
  background: radial-gradient(760px 420px at 85% -10%, rgba(239, 68, 68, 0.09), transparent 62%);
}
html, body { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 0.5rem; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.75rem; text-wrap: pretty; }
b, strong { font-weight: 700; }
ul, ol { padding-inline-start: 1.2rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
::selection { background: rgba(239, 68, 68, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.price, .metric b, .stat b, .num, td, .otp-box { font-variant-numeric: tabular-nums; }

.container { width: min(var(--wrap), calc(100% - 2rem)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-head { max-width: 44rem; margin: 0 0 2rem; }
.section-head p, .lede { color: var(--ink-2); }
.section-title { font-size: clamp(1.55rem, 3.4vw, 2.4rem); line-height: 1.35; font-weight: 800; margin: 0.5rem 0 0.6rem; letter-spacing: -0.02em; }
.lede { font-size: 1.08rem; max-width: 40rem; }
.gradient-text { color: var(--accent); }
.text-link { color: var(--accent-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.muted { color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.stack { display: grid; gap: 0.8rem; }
.stack > label { display: grid; gap: 0.35rem; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; inset-inline-start: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 0.55rem 0.9rem; border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: 0.75rem; }
.ph { width: 20px; height: 20px; display: block; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--btn-h);
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn .ph { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--sh-accent); }
.btn-secondary { background: var(--tint-2); color: var(--ink); border-color: var(--line-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-outline { background: transparent; color: var(--accent-ink); border-color: var(--accent-line); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn-block { width: 100%; }
.btn-small { --btn-h: 38px; padding: 0 0.85rem; border-radius: var(--r-sm); font-size: 0.86rem; }
.btn-lg { --btn-h: 54px; padding: 0 1.6rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn[disabled], .btn.is-loading { opacity: 0.6; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: spin 700ms linear infinite;
}
.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--tint-1);
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.icon-btn .ph { width: 20px; height: 20px; }
.icon-btn .dot-badge { position: absolute; top: 9px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-elev); }
.theme-key .i-sun { display: none; }
html[data-theme="light"] .theme-key .i-sun { display: block; }
html[data-theme="light"] .theme-key .i-moon { display: none; }
.toggle { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 1.25rem; border-radius: var(--r-md); background: var(--tint-2); border: 1px solid var(--line); }
.toggle .btn { --btn-h: 38px; background: transparent; border: 0; box-shadow: none; color: var(--ink-2); border-radius: var(--r-sm); }
.toggle .btn[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.4rem; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--field);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent-strong); flex: none; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: left 0.8rem center;
  padding-inline-start: 0.9rem;
  padding-inline-end: 2.4rem;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
input:hover, select:hover, textarea:hover { border-color: var(--tint-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
input:disabled { opacity: 0.65; cursor: not-allowed; }
.form-row { margin-bottom: 1rem; }
.form-row:last-child { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-help { font-size: 0.82rem; color: var(--ink-3); margin-top: 0.35rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }
.field { position: relative; }
.field > .ph { position: absolute; top: 50%; inset-inline-start: 0.85rem; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.field > input { padding-inline-start: 2.7rem; }
.field:has(.field-suffix) > input { padding-inline-end: 3rem; }
.field-suffix { position: absolute; top: 50%; inset-inline-end: 0.45rem; transform: translateY(-50%); }
.field-suffix .icon-btn { width: 36px; height: 36px; border: 0; background: transparent; }
.check { display: flex; align-items: flex-start; gap: 0.55rem; font-weight: 500; color: var(--ink-2); font-size: 0.88rem; cursor: pointer; }
.check input { margin-top: 0.3rem; }
.panel form > table, form .table-wrap { margin-top: 0.5rem; }
td form, .inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
td select, td input, .inline-form select, .inline-form input { width: auto; min-height: 38px; padding-block: 0.3rem; font-size: 0.88rem; border-radius: var(--r-sm); }

/* ---------- Surfaces ---------- */
.card, .panel, .service-card, .plan-card, .stat, .metric, .method, .faq-grid article, .quote, .note, .auth-card, .about-stage, .slide, .brand-hero, .process-stage, .sync-drawer {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}
.panel { padding: clamp(1.1rem, 2.4vw, 1.5rem); margin-bottom: 1rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.panel-head h2 .ph, .panel-head h3 .ph { color: var(--accent-ink); }
.profile-id { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem; margin-bottom: 1.1rem; border-radius: var(--r-md); background: var(--tint-1); border: 1px solid var(--line); }
.profile-id strong { display: block; }
.profile-id .muted { font-size: 0.82rem; }
.card { padding: 1.25rem; }
.icon-bubble {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
}
.icon-bubble .ph { width: 22px; height: 22px; }
.badge, .section-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-full);
  font-size: 0.8rem; font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.badge::before, .section-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.78rem; font-weight: 700;
  background: var(--tint-2); color: var(--ink-2);
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.tag.paid, .tag.active, .tag.completed, .tag.answered { background: var(--ok-soft); color: var(--ok); }
.tag.unpaid, .tag.pending, .tag.open, .tag.customer_reply, .tag.in_progress, .tag.medium, .tag.draft { background: var(--warn-soft); color: var(--warn); }
.tag.cancelled, .tag.refunded, .tag.suspended, .tag.high, .tag.closed, .tag.paused { background: var(--bad-soft); color: var(--bad); }
.featured-badge { align-self: flex-start; display: inline-flex; padding: 0.2rem 0.7rem; border-radius: var(--r-full); background: var(--accent-strong); color: #fff; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.8rem; }

.flash-stack { display: grid; gap: 0.5rem; margin: 1rem auto; }
.flash {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600; font-size: 0.93rem;
  box-shadow: var(--sh-2);
  animation: rise 320ms var(--ease-out) both;
}
.flash .ph { margin-top: 0.2rem; }
.flash p { margin: 0; flex: 1; }
.flash .flash-close { background: none; border: 0; padding: 0.2rem; color: inherit; opacity: 0.7; cursor: pointer; border-radius: 6px; }
.flash.success { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.flash.error { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.flash a { text-decoration: underline; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--sh-1);
  margin-bottom: 1rem;
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: start; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); background: var(--tint-1); white-space: nowrap; }
tbody tr { transition: background-color var(--t-fast) var(--ease-out); }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--accent-ink); font-weight: 600; }
.sheet { color: #18181b; background: #fff; }
.sheet table, .sheet th, .sheet td { color: #18181b; border-color: #e4e4e7; background: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: saturate(170%) blur(18px);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t-med) var(--ease-out);
}
.site-header.is-compact { box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.8); }
.top-strip { border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--ink-3); }
.top-strip .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 36px; }
.top-strip p { margin: 0; display: inline-flex; align-items: center; gap: 0.45rem; }
.top-strip p::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.top-links { display: flex; align-items: center; gap: 1.1rem; }
.top-links a { display: inline-flex; align-items: center; gap: 0.35rem; transition: color var(--t-fast) var(--ease-out); }
.top-links .ph { width: 15px; height: 15px; }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; flex: none; }
.brand img { height: 42px; width: auto; border-radius: 11px; }
.brand-text { display: grid; line-height: 1.3; }
.brand-text strong { font-size: 1rem; font-weight: 800; }
.brand-text span { font-size: 0.74rem; color: var(--ink-3); }
.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 0.8rem;
  border-radius: var(--r-sm);
  font-size: 0.92rem; font-weight: 600; white-space: nowrap;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.main-nav a.is-active { color: var(--ink); background: var(--tint-2); }
.main-nav a.is-active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-inline-start: 0.4rem; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.menu-toggle { display: none; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.35rem 0.25rem 0.6rem; min-height: 42px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--tint-1); cursor: pointer; font-size: 0.88rem; font-weight: 700; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary .ph { width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--t-fast) var(--ease-out); }
.user-menu[open] > summary .ph { transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-strong); color: #fff; font-weight: 800; font-size: 0.85rem; }
.avatar.lg { width: 44px; height: 44px; border-radius: 14px; font-size: 1rem; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 0.78rem; }
.app-actions .icon-btn:has(.avatar) { border: 0; background: transparent; }
.app-content .flash-stack { width: 100%; margin: 0 0 1rem; }
.menu-pop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60;
  width: 240px; padding: 0.4rem;
  background: var(--bg-elev); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  transform-origin: top left;
  animation: pop 160ms var(--ease-out) both;
}
.menu-pop .menu-who { padding: 0.6rem 0.7rem 0.7rem; border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; }
.menu-pop .menu-who b { display: block; font-size: 0.92rem; }
.menu-pop .menu-who span { font-size: 0.8rem; color: var(--ink-3); }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  min-height: 42px; padding: 0 0.7rem; border-radius: var(--r-sm);
  background: none; border: 0; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); text-align: start;
}
.menu-pop form { margin: 0; }
.menu-pop .is-danger { color: var(--bad); }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); animation: fade 200ms var(--ease-out) both; }
.drawer-sheet {
  position: absolute; inset-block: 0; inset-inline-end: 0;
  width: min(360px, 88vw);
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-inline-start: 1px solid var(--line);
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: slide-in 260ms var(--ease-out) both;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.drawer-nav { display: grid; gap: 2px; margin: 0 0 1rem; padding: 0; list-style: none; }
.drawer-nav a { display: flex; align-items: center; gap: 0.75rem; min-height: 50px; padding: 0 0.8rem; border-radius: var(--r-md); font-weight: 600; color: var(--ink-2); }
.drawer-nav a .ph { color: var(--ink-3); }
.drawer-nav a.is-active { background: var(--accent-soft); color: var(--ink); }
.drawer-nav a.is-active .ph { color: var(--accent-ink); }
.drawer-foot { margin-top: auto; display: grid; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.drawer-contact { display: flex; gap: 0.5rem; }
.drawer-contact .icon-btn { width: 46px; height: 46px; }
body.has-drawer { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(2rem, 6vw, 4rem); border-top: 1px solid var(--line); background: var(--bg-elev); }
.footer-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  margin-top: -1px;
  transform: translateY(-50%);
  padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1.2rem, 3vw, 2.2rem);
  border-radius: var(--r-xl);
  background: var(--accent-deep);
  background-image: radial-gradient(520px 220px at 10% 0%, rgba(255, 255, 255, 0.16), transparent 60%);
  color: #fff;
  box-shadow: 0 24px 50px -24px rgba(185, 28, 28, 0.65);
}
.footer-cta h2 { margin: 0 0 0.2rem; font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.footer-cta p { margin: 0; opacity: 0.85; }
.footer-cta .btn-primary { background: #fff; color: #991b1b; box-shadow: none; }
.footer-cta .btn-secondary { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.footer-cta-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.footer-main { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 2rem; padding-bottom: 2.5rem; margin-top: -1rem; }
.footer-brand p { color: var(--ink-3); font-size: 0.9rem; max-width: 22rem; }
.footer-brand .brand { margin-bottom: 1rem; }
.footer-contact { display: grid; gap: 0.5rem; margin: 1rem 0; padding: 0; list-style: none; font-size: 0.9rem; }
.footer-contact a { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink-2); }
.footer-contact .ph { width: 18px; height: 18px; color: var(--accent-ink); }
.socials { display: flex; gap: 0.5rem; }
.footer-col h3 { font-size: 0.85rem; color: var(--ink); margin: 0 0 0.9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.footer-col a { display: inline-flex; min-height: 34px; align-items: center; color: var(--ink-3); font-size: 0.9rem; transition: color var(--t-fast) var(--ease-out); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; padding: 1.1rem 0 calc(1.1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-3); }
.footer-bottom p { margin: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }

.whatsapp-float, .to-top {
  position: fixed; z-index: 35;
  inset-inline-start: max(18px, env(safe-area-inset-left));
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 16px;
  box-shadow: var(--sh-2);
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out);
}
.whatsapp-float { bottom: calc(18px + env(safe-area-inset-bottom)); background: #128c7e; color: #fff; }
.to-top { bottom: calc(78px + env(safe-area-inset-bottom)); border: 1px solid var(--line-2); background: var(--glass); color: var(--ink); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transform: translateY(8px); }
.to-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
.scroll-rail { position: fixed; z-index: 45; inset-block-start: 0; inset-inline: 0; height: 2px; pointer-events: none; }
.scroll-rail span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: right; }

/* ---------- Home ---------- */
.hero { position: relative; padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.25; font-weight: 800; letter-spacing: -0.03em; margin: 1rem 0; }
.hero .lede { font-size: clamp(1.02rem, 1.6vw, 1.15rem); }
.hero-actions, .band-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero-trust div { display: grid; }
.hero-trust b { font-size: 1.35rem; font-weight: 800; }
.hero-trust span { font-size: 0.82rem; color: var(--ink-3); }
.dk-logo { display: block; width: 150px; margin: 1rem 0 0; background: #fff; border-radius: var(--r-sm); padding: 0.35rem 0.6rem; }
.hero-copy { animation: rise 600ms var(--ease-out) both; }
.scroll-hint { display: none; }
.hero-visual { position: relative; min-height: 500px; }
#hero-canvas { width: 100%; height: 500px; display: block; }
.hero-fallback { position: absolute; inset: 40px 10px; display: grid; place-items: center; }
.prism { width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.06) 38%, rgba(239, 68, 68, 0.3) 72%, transparent); border: 1px solid rgba(255, 255, 255, 0.3); }
.float-card {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 0.7rem;
  min-width: 170px; padding: 0.7rem 0.9rem;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--sh-2);
  animation: rise 700ms var(--ease-out) both;
}
.float-card .icon-bubble { width: 38px; height: 38px; }
.card-a { top: 30px; inset-inline-end: 0; animation-delay: 100ms; }
.card-b { top: 46%; inset-inline-start: 0; animation-delay: 180ms; }
.card-c { bottom: 24px; inset-inline-end: 24px; animation-delay: 260ms; }
.float-card strong { display: block; font-size: 1.1rem; line-height: 1.3; }
.float-card span { color: var(--ink-3); font-size: 0.8rem; }

.trust-row { padding: 0 0 2rem; }
.medal-row, .quote-row, .ai-track, .logo-rail { display: flex; gap: 0.8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; scrollbar-width: thin; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.8rem; }
.logo-card {
  min-width: 180px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 1rem;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), background-color var(--t-med) var(--ease-out);
}
.brand-logo { height: 52px; display: flex; align-items: center; justify-content: flex-start; overflow: hidden; margin-bottom: 0.4rem; }
.brand-logo img { max-width: 70%; max-height: 30px; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: 0.75; transition: filter var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out); }
.logo-card:hover .brand-logo img, .logo-card:focus-visible .brand-logo img, .marquee-item:hover .brand-logo img { filter: none; opacity: 1; }
.logo-for-light { display: none; }
html[data-theme="light"] .logo-for-light { display: block; }
html[data-theme="light"] .brand-logo:has(.logo-for-light) .logo-for-dark { display: none; }
.wordmark { font-weight: 800; letter-spacing: -0.02em; font-size: 1.1rem; }
.logo-name { font-weight: 700; }
.logo-role { color: var(--ink-3); font-size: 0.82rem; }

.about-stage, .slide, .brand-hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 1.5rem; align-items: center; padding: clamp(1.25rem, 3vw, 2.2rem); overflow: hidden; }
.brand-hero { grid-template-columns: auto 1fr; }
.brand-hero .brand-logo { width: 120px; height: 120px; justify-content: center; border-radius: var(--r-lg); background: var(--tint-2); border: 1px solid var(--line); margin: 0; }
.brand-hero .brand-logo img { max-width: 72%; max-height: 54px; filter: none; opacity: 1; }
.role { margin: 0; color: var(--accent-ink); font-weight: 700; font-size: 0.85rem; }
.latin { margin: 0; color: var(--ink-3); }
.hub-still, .scene-frame img { width: 100%; height: auto; display: block; border-radius: var(--r-xl); }
.hub-still { width: min(260px, 60vw); margin-inline: auto; }
.scene-frame { margin: 0; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); }
.story-slider { width: min(var(--wrap), calc(100% - 2rem)); margin: 0 auto; overflow: hidden; padding-bottom: 1rem; }
.slider-viewport { display: flex; transition: transform 560ms var(--ease-out); }
.slide { min-width: 100%; min-height: 220px; grid-template-columns: 1fr; align-content: center; }
.slide h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.slide .btn { justify-self: start; }
.slider-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.8rem; }
.dots { display: flex; gap: 0.4rem; }
.dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--r-full); background: var(--tint-3); transition: width var(--t-med) var(--ease-out), background-color var(--t-med) var(--ease-out); }
.dot[aria-current="true"] { width: 24px; background: var(--accent); }

.marquee { overflow: hidden; padding: 0.4rem 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee-forward 44s linear infinite; }
.marquee.is-back .marquee-track { animation: marquee-back 58s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track, .marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-item { width: 160px; height: 56px; display: grid; place-items: center; }
.marquee-item .brand-logo { justify-content: center; margin: 0; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.bento .service-card { grid-column: span 2; }
.bento .service-card.featured { grid-column: span 4; grid-row: span 2; }
.service-card, .plan-card { display: flex; flex-direction: column; padding: 1.4rem; transition: border-color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out); }
.service-card .icon-bubble { margin-bottom: 1rem; }
.service-card h3, .plan-card h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.service-card > p, .plan-card > p { color: var(--ink-2); font-size: 0.93rem; }
.service-card ul, .plan-card ul, .check-list { list-style: none; padding: 0; margin: 0.6rem 0 1.2rem; display: grid; gap: 0.45rem; }
.service-card li, .plan-card li, .check-list li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.92rem; color: var(--ink-2); }
.service-card li .ph, .plan-card li .ph, .check-list li .ph { width: 18px; height: 18px; margin-top: 0.25rem; color: var(--ok); }
.service-card > p:last-child, .plan-card form { margin-top: auto; margin-bottom: 0; }
.service-card.featured, .plan-card.featured { border-color: var(--accent-line); background: var(--card); background-image: radial-gradient(520px 260px at 100% 0%, rgba(239, 68, 68, 0.14), transparent 70%); }
.plan-card.featured::before { content: "پیشنهاد ما"; position: absolute; top: -12px; inset-inline-start: 1.4rem; padding: 0.15rem 0.7rem; border-radius: var(--r-full); background: var(--accent-strong); color: #fff; font-size: 0.75rem; font-weight: 700; }
.plan-card .price { font-size: 1.6rem; font-weight: 800; margin: 0.3rem 0 0.2rem; letter-spacing: -0.02em; color: var(--ink); }
.plan-card .price::after { content: " / دوره"; font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }
.tax-note { color: var(--ink-3); font-size: 0.86rem; margin-top: 1rem; }
.see-widget { display: grid; gap: 0.3rem; margin: 0.4rem 0 1rem; padding: 1rem; border-radius: var(--r-lg); background: var(--tint-1); border: 1px dashed var(--line-2); }
.see-widget p { margin: 0; color: var(--ink-3); font-size: 0.85rem; }
.see-widget strong { font-size: 2rem; color: var(--accent-ink); line-height: 1.2; }
.see-widget label { display: flex; gap: 0.5rem; align-items: center; min-height: 36px; margin: 0; font-weight: 500; }

.process-layout, .sync-layout { display: grid; gap: 1.5rem; }
.process-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; counter-reset: step; }
.process-list button {
  width: 100%; display: grid; gap: 0.1rem; text-align: start;
  padding: 0.9rem 1.1rem; min-height: 56px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.process-list button span { color: var(--ink-3); font-size: 0.88rem; }
.process-list button[aria-current="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.process-stage { padding: 1.6rem; }
.process-stage h3 { font-size: 1.4rem; }
.process-path { width: 100%; height: 40px; }
.process-path path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 8 6; animation: dash 8s linear infinite; }
.sync-map { width: 100%; height: auto; max-height: 460px; }
.sync-map line { stroke: var(--line-2); stroke-dasharray: 4 6; }
.sync-node { cursor: pointer; }
.sync-node circle { fill: var(--card); stroke: var(--line-2); transition: stroke var(--t-fast) var(--ease-out); }
.sync-node:hover circle, .sync-node:focus-visible circle { stroke: var(--accent); }
.sync-node text, .sync-core-label { fill: var(--ink); font-size: 12px; font-family: Vazirmatn, Tahoma, sans-serif; }
.sync-core { fill: var(--accent-soft); stroke: var(--accent); }
.sync-drawer { display: grid; gap: 0.7rem; align-content: start; padding: 1.4rem; }
.stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat { padding: 1.4rem; display: grid; gap: 0.2rem; }
.stat b { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat span { color: var(--ink-3); font-size: 0.9rem; }
.ai-card { min-width: 200px; }
.quote { margin: 0; padding: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 260px; scroll-snap-align: start; }
.quote p { font-size: 1.02rem; margin: 0; }
.quote footer { color: var(--ink-3); font-size: 0.85rem; margin-top: auto; }
.sample { align-self: flex-start; display: inline-flex; padding: 0.05rem 0.55rem; border-radius: var(--r-full); border: 1px solid var(--line-2); font-size: 0.72rem; color: var(--ink-3); }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.faq-grid article { padding: 1.25rem 1.35rem; }
.faq-grid article h3, .faq-grid h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.faq-grid p { color: var(--ink-2); margin: 0; font-size: 0.93rem; }
.final-cta { text-align: center; }
.final-cta .section-title { margin-inline: auto; }
.final-cta > .container > p { color: var(--ink-2); }
.final-cta .band-actions { justify-content: center; }
.method { display: flex; align-items: center; gap: 0.85rem; min-height: 68px; padding: 0.8rem 1rem; margin-bottom: 0.65rem; border-radius: var(--r-lg); text-align: start; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.method b { display: block; line-height: 1.4; }
.method span { color: var(--ink-3); font-size: 0.88rem; }
.band-actions .method { margin: 0; min-width: min(100%, 270px); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.flow li { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; padding: 1rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); }
.flow b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.flow p { margin: 0.2rem 0 0; color: var(--ink-3); font-size: 0.9rem; }
.story { display: grid; gap: 1.4rem; }
.about-orbit { width: min(220px, 40vw); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--accent-line); box-shadow: inset 0 0 0 18px var(--accent-soft); justify-self: center; animation: spin 24s linear infinite; }
.timeline { border-inline-start: 2px solid var(--accent-line); margin-inline-start: 0.4rem; padding-inline-start: 1.1rem; }
.timeline div { margin-bottom: 0.9rem; }

/* ---------- Content pages ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 1.5rem; align-items: start; }
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { font-size: 1.2rem; margin: 1.8rem 0 0.5rem; }
.prose ul, .prose ol { padding-inline-start: 1.2rem; }
.prose li { margin: 0.3rem 0; }
.article-index { padding-top: 1.5rem; }
.article { width: min(760px, calc(100% - 2rem)); margin: 1.6rem auto 2.5rem; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.4; margin-bottom: 0.5rem; }
.article .prose p, .article .prose li { color: var(--ink); font-size: 1.04rem; line-height: 2; }
.search-row { display: flex; gap: 0.6rem; margin: 1rem 0 0.8rem; }
.search-row input { flex: 1; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.2rem; }
.chip-row a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 0.9rem; border-radius: var(--r-full); border: 1px solid var(--line-2); font-size: 0.86rem; font-weight: 600; color: var(--ink-2); transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.chip-row a.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.magazine { display: grid; gap: 1rem; }
.post-card h2 { margin: 0.2rem 0; font-size: 1.22rem; line-height: 1.5; }
.post-card p { margin: 0; color: var(--ink-2); }
.post-kicker { color: var(--accent-ink); font-weight: 700; font-size: 0.8rem; }
.post-meta { color: var(--ink-3); font-size: 0.82rem; }

/* Blog & news */
.blog-switch { display: inline-flex; gap: 4px; padding: 4px; margin-top: 0.4rem; border-radius: var(--r-full); background: var(--tint-1); border: 1px solid var(--line); }
.blog-switch a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 1rem; border-radius: var(--r-full); font-size: 0.88rem; font-weight: 700; color: var(--ink-2); transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.blog-switch a[aria-current="page"] { background: var(--accent); color: #fff; }
.blog-switch .ph { width: 16px; height: 16px; }
.chip-count { font-size: 0.72rem; color: var(--ink-3); margin-inline-start: 0.3rem; }
.chip-row a.is-on .chip-count { color: inherit; opacity: 0.8; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.post-tile { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--tint-1); border: 1px solid var(--line); transition: border-color var(--t-fast) var(--ease-out), transform 220ms var(--ease-out); }
.post-tile.is-lead { grid-column: span 2; grid-row: span 2; }
.post-tile-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: radial-gradient(120% 90% at 85% 10%, rgba(239, 68, 68, 0.22), transparent 60%), var(--tint-2); }
.post-tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.post-tile.no-media { border-top: 3px solid var(--accent); background: linear-gradient(160deg, rgba(239, 68, 68, 0.08), transparent 45%), var(--tint-1); }
.post-tile.is-lead.no-media { grid-row: auto; }
.post-tile.no-media .post-tile-body { padding-top: 1.3rem; }
.post-tile-body { display: grid; gap: 0.35rem; padding: 1rem 1.1rem 1.15rem; align-content: start; flex: 1; }
.post-tile-body .post-kicker, .post-tile-body .post-meta { margin: 0; }
.post-tile h2, .post-tile h3 { margin: 0; font-size: 1.04rem; line-height: 1.65; }
.post-tile.is-lead h2 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
.post-tile h2 a, .post-tile h3 a { color: var(--ink); }
.post-tile h2 a::after, .post-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.post-tile { position: relative; }
.post-tile-excerpt { margin: 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-tile.is-lead .post-tile-excerpt { -webkit-line-clamp: 4; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem; margin: 1.8rem 0 0.5rem; }
.pager a, .pager-gap { min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0 0.7rem; border-radius: var(--r-md); font-weight: 700; font-size: 0.9rem; }
.pager a { border: 1px solid var(--line-2); color: var(--ink-2); }
.pager a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .ph { width: 16px; height: 16px; }
.pager-gap { color: var(--ink-3); }
.blog-about { margin-top: 2rem; }
.blog-about h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.blog-about p { margin: 0; color: var(--ink-2); line-height: 2; }
.blog-about a, .prose a, .post-source a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.article.post-page { width: min(1120px, calc(100% - 2rem)); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-3); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-2); }
.post-header { max-width: 820px; }
.post-header h1 { margin: 0.3rem 0 0.6rem; }
.post-header .lede { margin-top: 0.8rem; }
.post-cover { margin: 1.4rem 0 1.6rem; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 2; max-height: 560px; background: var(--tint-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2.5rem; align-items: start; }
.post-main { min-width: 0; max-width: 760px; }
.post-main .prose { max-width: none; }
.prose h2 { scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h3 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.prose strong { color: var(--ink); }
.prose .callout { margin: 1.4rem 0; padding: 0.9rem 1.1rem; border-radius: var(--r-md); background: var(--accent-soft); border-inline-start: 3px solid var(--accent); }
.prose .callout p { margin: 0; color: var(--ink); }
.tldr { margin: 0 0 1.6rem; padding: 1.1rem 1.25rem; border-radius: var(--r-lg); background: var(--tint-1); border: 1px solid var(--accent-line); }
.tldr h2 { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.5rem; font-size: 1rem; }
.tldr h2 .ph { width: 18px; height: 18px; color: var(--accent-ink); }
.tldr ul { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: 0.35rem; }
.tldr li { color: var(--ink); line-height: 1.9; }
.toc ol { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: 0.45rem; font-size: 0.88rem; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--accent-ink); }
.toc-inline { display: none; margin: 0 0 1.4rem; padding: 0.8rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--tint-1); }
.toc-inline summary { cursor: pointer; font-weight: 700; }
.toc-inline ol { margin-top: 0.7rem; }
.post-aside { position: sticky; top: calc(var(--header-h) + 1.2rem); }
.post-aside .toc { padding: 1rem 1.1rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--tint-1); }
.toc-title { margin: 0 0 0.7rem; font-weight: 800; font-size: 0.9rem; }
.post-source { display: flex; gap: 0.6rem; align-items: flex-start; margin: 1.6rem 0; padding: 0.9rem 1rem; border-radius: var(--r-md); background: var(--tint-1); border: 1px dashed var(--line-2); font-size: 0.88rem; color: var(--ink-2); line-height: 1.9; }
.post-source .ph { flex: none; width: 18px; height: 18px; margin-top: 0.35rem; color: var(--ink-3); }
.post-faq { margin: 2.2rem 0; }
.post-faq h2 { font-size: 1.2rem; margin: 0 0 0.8rem; }
.post-faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--tint-1); margin-bottom: 0.5rem; }
.post-faq summary { cursor: pointer; list-style: none; padding: 0.85rem 1rem; font-weight: 700; display: flex; justify-content: space-between; gap: 1rem; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: "+"; color: var(--accent-ink); font-weight: 800; }
.post-faq details[open] summary::after { content: "−"; }
.post-faq details p { margin: 0; padding: 0 1rem 1rem; color: var(--ink-2); line-height: 2; }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 0; padding: 1.3rem 1.4rem; border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.04)); border: 1px solid var(--accent-line); }
.post-cta h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.post-cta p { margin: 0; color: var(--ink-2); max-width: 36rem; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-related { margin-top: 3rem; }
.post-related > h2, .post-other h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.post-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-other { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.post-other ul { margin: 0 0 0.8rem; padding-inline-start: 1.1rem; display: grid; gap: 0.4rem; }
.post-other a { color: var(--ink-2); }
@media (hover: hover) {
  .post-tile:hover { border-color: var(--accent-line); transform: translateY(-2px); }
  .post-tile:hover .post-tile-media img { transform: scale(1.04); }
  .blog-switch a:not([aria-current]):hover { color: var(--ink); background: var(--tint-2); }
}
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 860px) {
  .post-grid, .post-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .post-grid, .post-grid-3 { grid-template-columns: 1fr; }
  .post-tile.is-lead { grid-column: auto; grid-row: auto; }
  .blog-switch { display: flex; }
  .blog-switch a { flex: 1; justify-content: center; padding: 0 0.6rem; }
  .post-cta-actions, .post-cta-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .post-tile, .post-tile-media img { transition: none; }
}
.wiki-list { display: grid; gap: 1.2rem; }
.app-screen { padding-block: 1.2rem 0.5rem; }

/* ---------- App tiles ---------- */
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.app-tile {
  min-height: 120px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.1rem;
  padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  transition: border-color var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out), background-color var(--t-med) var(--ease-out);
}
.app-tile:active { transform: scale(0.98); }
.app-tile .icon-bubble { margin-bottom: auto; width: 40px; height: 40px; }
.app-tile b { font-size: 0.98rem; margin-top: 0.75rem; }
.app-tile span { color: var(--ink-3); font-size: 0.8rem; line-height: 1.5; }
.note { padding: 1rem 1.15rem; }
.note p { margin: 0.2rem 0; color: var(--ink-2); }
.note time, .note span { color: var(--ink-3); font-size: 0.8rem; }
.push-card { display: grid; gap: 0.5rem; }
.push-card p { margin: 0; color: var(--ink-2); }
.push-card .btn { justify-self: start; }
.push-state { min-height: 1.4rem; color: var(--ink-3); font-size: 0.88rem; }
.thread { display: grid; gap: 0.3rem; padding: 1rem 1.1rem; margin: 0 0 0.7rem; border-radius: var(--r-lg); background: var(--tint-1); border: 1px solid var(--line); max-width: 88%; }
.thread b { font-size: 0.85rem; color: var(--ink-3); }
.thread p { margin: 0; line-height: 1.9; overflow-wrap: anywhere; }
.thread-list { display: grid; margin-bottom: 1.25rem; }
.thread.is-mine { justify-self: end; background: var(--card-2); border-end-end-radius: var(--r-xs); }
.thread.is-staff { justify-self: start; background: var(--accent-soft); border-color: var(--accent-line); border-end-start-radius: var(--r-xs); }
.thread.is-staff b { color: var(--accent-ink); }
.thread-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.thread-meta time { font-size: 0.75rem; color: var(--ink-3); }
.reply-box { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.reply-box textarea { min-height: 110px; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); }
.back-link .ph { width: 16px; height: 16px; }
.count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.45rem; margin-inline-start: 0.4rem; border-radius: var(--r-full); background: var(--tint-2); color: var(--ink-2); font-size: 0.78rem; font-weight: 700; vertical-align: middle; }
.cell-main { display: grid; line-height: 1.5; }
.cell-main span { font-size: 0.78rem; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }
.table-wrap .empty { padding: 2.2rem 1rem; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0.85rem; }
.agent-card { margin: 0; display: grid; gap: 0.6rem; align-content: start; }
.agent-card .panel-head { margin-bottom: 0; }
.agent-card h3 { gap: 0.6rem; }
.agent-card .icon-bubble { width: 36px; height: 36px; border-radius: 11px; }
.agent-card p { margin: 0; }
.menu-push { margin-top: 1rem; }
.table-tools { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; }
.search-field { position: relative; flex: 1; max-width: 360px; margin: 0; }
.search-field .ph { position: absolute; top: 50%; inset-inline-start: 0.85rem; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-field input { padding-inline-start: 2.6rem; }
.cell-user { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.request-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 0.85rem; }
.request-card { margin: 0; display: grid; align-content: start; gap: 0.4rem; }
.request-card .panel-head { margin-bottom: 0.2rem; }
.request-meta { margin: 0; font-size: 0.82rem; color: var(--ink-3); }
.request-notes { margin: 0.2rem 0 0.4rem; padding: 0.7rem 0.85rem; border-radius: var(--r-md); background: var(--tint-1); color: var(--ink-2); font-size: 0.88rem; line-height: 1.8; overflow-wrap: anywhere; }
.request-card .btn { justify-self: start; }
select.select-auto { width: auto; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 0.85rem; align-items: start; }
.edit-card { margin: 0; }
.edit-card .form-actions { justify-content: space-between; }
.edit-card > .btn { margin-top: 0.4rem; }
.inline-field { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.85rem; color: var(--ink-3); }
.inline-field input { width: 5.5rem; min-height: 38px; padding-block: 0.3rem; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 24px; margin: 0; flex: none; border-radius: var(--r-full); background: var(--tint-3); border: 1px solid var(--line-2); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform var(--t-fast) var(--ease-out); }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(-16px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.metrics.metrics-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ledger-head { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr; gap: 0.5rem; margin: 0.4rem 0 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
.entry-list { display: grid; gap: 0.7rem; }
.entry { padding: 0.85rem 1rem; border-radius: var(--r-lg); background: var(--tint-1); border: 1px solid var(--line); }
.entry-head { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.entry-head .muted { font-size: 0.8rem; }
.entry-lines { font-size: 0.85rem; }
.entry-lines td { padding: 0.4rem 0.2rem; border-bottom: 1px dashed var(--line); }
.entry-lines td.num { text-align: end; width: 9rem; }
.editor { padding: 0; overflow: hidden; }
.editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.2rem; cursor: pointer; list-style: none; font-weight: 700; }
.editor > summary::-webkit-details-marker { display: none; }
.editor > summary .ph { color: var(--accent-ink); }
.editor > summary:has(> .ph) { justify-content: flex-start; }
.editor[open] > summary { border-bottom: 1px solid var(--line); }
.editor > form { padding: 1.1rem 1.2rem 1.25rem; }
.list time { flex: none; font-size: 0.78rem; }
.ledger-line { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr; gap: 0.5rem; margin-bottom: 0.5rem; }

/* ---------- Auth ---------- */
.auth-body { background: var(--bg); }
.auth-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-aside {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  background: #0b0c10;
  color: #f4f4f5;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.07);
}
.auth-aside::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 380px at 100% 0%, rgba(239, 68, 68, 0.28), transparent 62%), radial-gradient(500px 300px at 0% 100%, rgba(239, 68, 68, 0.12), transparent 60%); pointer-events: none; }
.auth-aside > * { position: relative; }
.auth-aside .brand-text span { color: #a1a1aa; }
.auth-aside h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.4; font-weight: 800; margin: 0 0 0.8rem; }
.auth-aside p { color: #b4b4bd; max-width: 28rem; }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.9rem; }
.auth-points li { display: flex; gap: 0.8rem; align-items: flex-start; }
.auth-points .icon-bubble { width: 38px; height: 38px; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.auth-points b { display: block; color: #fff; }
.auth-points span { color: #a1a1aa; font-size: 0.88rem; }
.auth-stats { display: flex; gap: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.auth-stats b { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; }
.auth-stats span { font-size: 0.8rem; color: #a1a1aa; }
.auth-main { display: flex; flex-direction: column; padding: calc(1rem + env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem) calc(1.5rem + env(safe-area-inset-bottom)); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; }
.auth-top .back { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-2); font-weight: 600; font-size: 0.92rem; min-height: 44px; }
.auth-center { flex: 1; display: grid; align-content: center; justify-items: center; padding: 1.5rem 0; }
.auth-center .flash-stack { width: min(440px, 100%); margin: 0 0 1rem; }
.auth-wrap { display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: clamp(1.4rem, 4vw, 2.2rem); border-radius: 28px; box-shadow: var(--sh-2); }
.auth-card .auth-mark { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 1.1rem; }
.auth-card .auth-logo { height: 52px; width: auto; border-radius: 14px; margin-bottom: 1.2rem; }
.auth-card h1 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-bottom: 0.35rem; }
.auth-card .auth-sub { color: var(--ink-3); margin-bottom: 1.5rem; font-size: 0.95rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 1.4rem; border-radius: var(--r-md); background: var(--tint-2); border: 1px solid var(--line); }
.auth-tabs label { margin: 0; display: grid; place-items: center; min-height: 40px; border-radius: var(--r-sm); font-size: 0.9rem; font-weight: 700; color: var(--ink-3); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.auth-mode { position: absolute; opacity: 0; pointer-events: none; }
#mode-otp:checked ~ .auth-tabs label[for="mode-otp"],
#mode-pass:checked ~ .auth-tabs label[for="mode-pass"] { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }
#mode-otp:focus-visible ~ .auth-tabs label[for="mode-otp"],
#mode-pass:focus-visible ~ .auth-tabs label[for="mode-pass"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-pane { display: none; }
#mode-otp:checked ~ .pane-otp, #mode-pass:checked ~ .pane-pass { display: block; animation: rise 260ms var(--ease-out) both; }
.mobile-field { position: relative; direction: ltr; }
.mobile-field input { padding-inline-start: 3.6rem; font-size: 1.1rem; letter-spacing: 0.04em; text-align: left; }
.mobile-field .prefix { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; display: flex; align-items: center; gap: 0.35rem; padding-inline: 0.85rem; color: var(--ink-3); font-size: 0.9rem; border-inline-end: 1px solid var(--line); direction: ltr; }
.otp-sent { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.9rem; margin-bottom: 1.2rem; border-radius: var(--r-md); background: var(--tint-1); border: 1px solid var(--line); font-size: 0.9rem; }
.otp-sent b { direction: ltr; unicode-bidi: isolate; }
.otp-sent a { color: var(--accent-ink); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.otp-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.auth-pane .flash { margin-bottom: 1rem; box-shadow: none; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; direction: ltr; margin-bottom: 1rem; }
.otp-box { min-height: 58px; padding: 0; text-align: center; font-size: 1.45rem; font-weight: 800; border-radius: var(--r-md); }
.otp-box:not(:placeholder-shown) { border-color: var(--accent-line); background: var(--accent-soft); }
.otp-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--ink-3); }
.otp-meta form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0.3rem 0; color: var(--accent-ink); font-weight: 700; font-size: 0.86rem; cursor: pointer; min-height: 36px; }
.link-btn[disabled] { color: var(--ink-3); cursor: default; }
.auth-legal { text-align: center; font-size: 0.8rem; color: var(--ink-3); margin: 1.2rem 0 0; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.auth-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0; font-size: 0.8rem; color: var(--ink-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { text-align: center; font-size: 0.88rem; color: var(--ink-3); margin: 1rem 0 0; }
.auth-switch a, .auth-switch label { color: var(--accent-ink); font-weight: 700; display: inline; margin: 0; cursor: pointer; font-size: inherit; }
.steps { display: flex; gap: 0.4rem; margin-bottom: 1.4rem; }
.steps span { height: 4px; flex: 1; border-radius: var(--r-full); background: var(--tint-3); }
.steps span.is-on { background: var(--accent); }

/* ---------- App shell (dashboard & admin) ---------- */
body.is-app { background: var(--bg); }
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: sticky; top: 0; height: 100svh;
  display: flex; flex-direction: column;
  padding: 1rem 0.8rem;
  background: var(--bg-elev);
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar .brand { padding: 0.2rem 0.5rem 1.1rem; }
.sidebar .brand img { height: 38px; }
.side-nav { display: grid; gap: 2px; }
.side-label { margin: 1rem 0.7rem 0.4rem; font-size: 0.72rem; font-weight: 700; color: var(--ink-3); letter-spacing: 0.02em; }
.side-nav a {
  display: flex; align-items: center; gap: 0.7rem;
  min-height: 42px; padding: 0 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem; font-weight: 600;
  color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.side-nav a .ph { width: 19px; height: 19px; color: var(--ink-3); transition: color var(--t-fast) var(--ease-out); }
.side-nav a.is-active { background: var(--accent-soft); color: var(--ink); }
.side-nav a.is-active .ph { color: var(--accent-ink); }
.side-nav a.is-active::after { content: ""; margin-inline-start: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.side-foot { margin-top: auto; padding-top: 1rem; }
.side-promo { padding: 1rem; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: 0.8rem; }
.side-promo b { display: block; font-size: 0.92rem; }
.side-promo p { font-size: 0.8rem; color: var(--ink-2); margin: 0.2rem 0 0.7rem; }
.user-chip { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--tint-1); }
.user-chip div { min-width: 0; flex: 1; line-height: 1.4; }
.user-chip b { display: block; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip span { font-size: 0.75rem; color: var(--ink-3); }
.user-chip form { margin: 0; }
.user-chip .icon-btn { width: 36px; height: 36px; border: 0; background: transparent; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.8rem;
  min-height: 64px; padding: 0 clamp(1rem, 2.5vw, 2rem);
  padding-top: env(safe-area-inset-top);
  background: var(--glass);
  backdrop-filter: saturate(170%) blur(18px);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.app-topbar .brand { display: none; }
.app-title { min-width: 0; flex: 1; line-height: 1.35; }
.app-title span { display: block; font-size: 0.75rem; color: var(--ink-3); }
.app-title strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-actions { display: flex; align-items: center; gap: 0.5rem; }
.app-content { width: 100%; max-width: 1160px; padding: clamp(1rem, 2.5vw, 2rem); padding-bottom: 3rem; }
.app-content > h1:first-child, .app-content > .panel:first-child > h1:first-child { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-bottom: 0.3rem; }
.app-content > h1:first-child + p { color: var(--ink-3); margin-bottom: 1.4rem; }
.app-content > h2 { margin-top: 1.8rem; font-size: 1.1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0 0 0.2rem; font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
.page-head p { margin: 0; color: var(--ink-3); }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.metric { padding: 1.1rem 1.15rem; display: grid; gap: 0.2rem; border-radius: var(--r-xl); transition: border-color var(--t-med) var(--ease-out); }
.metric > .ph, .metric .metric-ico { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: var(--tint-2); color: var(--ink-2); margin-bottom: 0.5rem; }
.metric span { color: var(--ink-3); font-size: 0.84rem; }
.metric b { font-size: clamp(1.3rem, 2.4vw, 1.65rem); font-weight: 800; line-height: 1.3; }
.metric.is-accent { border-color: var(--accent-line); background-image: radial-gradient(300px 140px at 100% 0%, rgba(239, 68, 68, 0.14), transparent 70%); }
.metric.is-accent .metric-ico { background: var(--accent-soft); color: var(--accent-ink); }
a.metric:hover { border-color: var(--line-2); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li:first-child { padding-top: 0; }
.list .list-main { min-width: 0; display: grid; line-height: 1.5; }
.list .list-main b { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .list-main span { font-size: 0.8rem; color: var(--ink-3); }
.empty { display: grid; justify-items: center; text-align: center; gap: 0.4rem; padding: 1.6rem 1rem; color: var(--ink-3); }
.empty .ph { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: var(--tint-2); color: var(--ink-2); }
.empty p { margin: 0; font-size: 0.9rem; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1.25rem; }
.quick a { display: flex; align-items: center; gap: 0.6rem; min-height: 56px; padding: 0 0.9rem; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.quick a .ph { color: var(--accent-ink); }
.notice-inline { margin-bottom: 1.1rem; box-shadow: none; }
.app-content code, .guide code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85em; padding: 0.1rem 0.4rem; border-radius: 6px; background: var(--tint-2); border: 1px solid var(--line); unicode-bidi: isolate; }
.metric b small { font-size: 0.75rem; font-weight: 600; }
.guide-steps { list-style: none; counter-reset: step; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.25rem; }
.guide-steps > li { counter-increment: step; position: relative; padding-block: 0.9rem; padding-inline-start: 3.1rem; border-bottom: 1px solid var(--line); }
.guide-steps > li:last-child { border-bottom: 0; }
.guide-steps > li::before { content: counter(step, persian); position: absolute; inset-inline-start: 0; top: 0.85rem; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; border: 1px solid var(--accent-line); }
.guide-steps h3 { margin: 0 0 0.3rem; font-size: 0.98rem; }
.guide-steps p, .guide-steps ul { margin: 0.25rem 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.9; }
.guide-steps ul { padding-inline-start: 1.1rem; }
.guide-steps a, .guide-note a { color: var(--accent-ink); font-weight: 700; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.tpl { display: grid; gap: 0.75rem; align-content: start; padding: 1rem; border-radius: var(--r-lg); background: var(--tint-1); border: 1px solid var(--line); }
.tpl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.tpl-head strong { display: block; }
.tpl-head .muted { font-size: 0.8rem; }
.tpl-meta { margin: 0; display: grid; gap: 0.35rem; font-size: 0.86rem; }
.tpl-meta div { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tpl-meta dt { color: var(--ink-3); min-width: 4.5rem; }
.tpl-meta dd { margin: 0; display: flex; align-items: center; gap: 0.4rem; }
.tpl-meta .link-btn { min-height: 28px; font-size: 0.8rem; }
.tpl-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; line-height: 1.9; padding: 0.8rem 0.9rem; border-radius: var(--r-md); background: var(--field); border: 1px dashed var(--line-2); color: var(--ink); }
.tpl .btn { justify-self: start; }
.guide-note { box-shadow: none; }
.guide-note h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.guide-note ul { margin: 0; padding-inline-start: 1.1rem; color: var(--ink-2); font-size: 0.88rem; line-height: 1.95; }
.queue-item { display: flex !important; align-items: center; gap: 0.6rem; }
.queue-item .ph { color: var(--ink-3); flex: none; }
.queue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); column-gap: 1.5rem; }
.queue-list li:first-child { padding-top: 0.8rem; }
.queue-list li:last-child { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.section-label { font-size: 1rem; margin: 1.5rem 0 0.8rem; color: var(--ink-2); }
.notice-inline a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.invoice-sum { display: grid; gap: 0; margin: 1rem 0 1.25rem; }
.invoice-sum div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--line-2); }
.invoice-sum div:last-child { border-bottom: 0; font-size: 1.1rem; font-weight: 800; }
.invoice-sum span { color: var(--ink-3); }

/* ---------- Agent admin (CRM, knowledge) ---------- */
.q-list { display: grid; gap: 0.75rem; }
.q-card { display: grid; gap: 0.55rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--tint-1); }
.q-card.is-done { opacity: 0.85; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; font-size: 0.8rem; color: var(--ink-3); }
.q-meta a { color: var(--ink); font-weight: 700; }
.q-text { margin: 0; font-weight: 700; line-height: 1.9; }
.q-answer { margin: 0; padding: 0.55rem 0.8rem; border-inline-start: 3px solid var(--ok); background: var(--ok-soft); border-radius: var(--r-xs); font-size: 0.9rem; line-height: 1.9; }
.q-card textarea { min-height: 70px; }
.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.q-buttons { display: flex; gap: 0.5rem; margin-inline-start: auto; }
.kv { display: grid; gap: 0; margin: 0.6rem 0 1rem; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line-2); font-size: 0.88rem; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; text-align: end; }
.pre-line { white-space: pre-line; line-height: 1.95; margin: 0 0 0.6rem; }
.cell-clip { max-width: 320px; color: var(--ink-2); font-size: 0.86rem; }
.note-form { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.note-form .btn { justify-self: end; }
.crm-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.crm-timeline li { position: relative; padding: 0.55rem 1rem 0.55rem 0; padding-inline-start: 1.1rem; border-inline-start: 2px solid var(--line-2); }
.crm-timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 0.95rem; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); border: 2px solid var(--card); }
.crm-timeline .tl-callback::before, .crm-timeline .tl-meeting::before { background: var(--accent); }
.crm-timeline .tl-contract::before { background: var(--ok); }
.crm-timeline .tl-question::before { background: var(--warn); }
.crm-timeline p { margin: 0.2rem 0 0; font-size: 0.88rem; line-height: 1.85; color: var(--ink-2); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; font-size: 0.84rem; }
.tl-meta span { color: var(--ink-3); font-size: 0.76rem; }
.rule-list { display: grid; gap: 0.5rem; }
.rule { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--tint-1); }
.rule > summary { font-weight: 500; padding: 0.8rem 1rem; }
.rule .cell-main { display: grid; gap: 0.15rem; min-width: 0; }
.rule .cell-main span { font-size: 0.8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule .cell-main b .ph { width: 16px; height: 16px; vertical-align: -3px; }
.rule.is-off { opacity: 0.6; }
.rule > form { padding: 0.9rem 1rem 1rem; }
.tag.crm-lead { background: var(--tint-2); color: var(--ink-2); }
.tag.crm-prospect { background: var(--warn-soft); color: var(--warn); }
.tag.crm-customer { background: var(--ok-soft); color: var(--ok); }
.tag.crm-vip { background: var(--accent-soft); color: var(--accent-ink); }
.tag.crm-lost { background: var(--bad-soft); color: var(--bad); }
.sub-details { margin: 0.4rem 0 1rem; padding: 0.7rem 0.9rem; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.sub-details > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.sub-details[open] > summary { margin-bottom: 0.6rem; }
.mini-steps { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 0.55rem; font-size: 0.88rem; line-height: 1.9; color: var(--ink-2); }
.form-actions-wrap { flex-wrap: wrap; gap: 0.6rem 1.2rem; }
aside > .panel form + form { margin-top: 0.5rem; }
.table-tools .select-auto { width: auto; }
.studio-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.8rem 0; }
.studio-progress { height: 6px; border-radius: var(--r-full); background: var(--tint-2); overflow: hidden; margin-bottom: 0.8rem; }
.studio-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 400ms var(--ease-out); }
.studio-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; max-height: 320px; overflow-y: auto; font-size: 0.86rem; }
.studio-log:empty { display: none; }
.studio-log li { display: flex; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: var(--r-sm); background: var(--tint-1); color: var(--ink-2); }
.studio-log time { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.studio-log .is-ok a { color: var(--ink); font-weight: 700; }
.studio-log .is-err { color: #fca5a5; }
.studio-log .is-warn { color: #fcd34d; }
.studio-log .is-wait { opacity: 0.7; }
.studio-harvest { display: grid; gap: 0.5rem; }
.studio-harvest-row { display: flex; gap: 0.5rem; }
.studio-harvest-row .btn { flex: 1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag.topic-done { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.tag.topic-failed { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.tag.topic-working { background: rgba(250, 204, 21, 0.14); color: #fde68a; }
.tag.topic-skipped { opacity: 0.6; }
[data-theme="light"] .studio-log .is-err, [data-theme="light"] .tag.topic-failed { color: #b91c1c; }
[data-theme="light"] .studio-log .is-warn, [data-theme="light"] .tag.topic-working { color: #92400e; }
[data-theme="light"] .tag.topic-done { color: #166534; }
@media (max-width: 640px) {
  .table-tools { flex-wrap: wrap; }
  .table-tools .search-field { flex: 1 1 100%; }
  .table-tools .select-auto { flex: 1; }
}

/* ---------- Tab bar (mobile app kit) ---------- */
.tabbar { display: none; }

/* ---------- Hover (fine pointers only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-deep); }
  .btn-secondary:hover { background: var(--tint-3); border-color: var(--tint-3); }
  .btn-ghost:hover { background: var(--tint-2); color: var(--ink); }
  .btn-outline:hover { background: var(--accent-soft); }
  .icon-btn:hover { background: var(--tint-2); color: var(--ink); border-color: var(--line-2); }
  .main-nav a:hover { color: var(--ink); background: var(--tint-1); }
  .top-links a:hover, .footer-col a:hover, .footer-contact a:hover { color: var(--ink); }
  .menu-pop a:hover, .menu-pop button:hover { background: var(--tint-2); color: var(--ink); }
  .side-nav a:hover { background: var(--tint-2); color: var(--ink); }
  .drawer-nav a:hover { background: var(--tint-2); }
  .service-card:hover, .plan-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--sh-2); }
  .logo-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
  .app-tile:hover, .quick a:hover, .method:hover { border-color: var(--line-2); background: var(--card-hover); }
  .process-list button:hover { border-color: var(--line-2); }
  .chip-row a:hover { background: var(--tint-2); }
  tbody tr:hover { background: var(--tint-1); }
  .user-menu > summary:hover { border-color: var(--line-2); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .main-nav a { padding: 0 0.6rem; font-size: 0.88rem; }
  .site-header .brand-text span { display: none; }
}
@media (max-width: 1200px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-row { justify-content: space-between; }
}
@media (max-width: 1100px) {
  .footer-main { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .metrics, .metrics.metrics-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-5 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .top-strip, .main-nav, .header-cta, .header-login { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-row { justify-content: space-between; }
  .brand img { height: 36px; }
  .hero-grid, .grid-2, .grid-3, .contact-grid, .faq-grid, .dash-grid, .process-layout { grid-template-columns: 1fr; }
  .hero { padding-top: 1.5rem; }
  .hero-visual, #hero-canvas { min-height: 340px; height: 340px; }
  .bento { grid-template-columns: 1fr; }
  .bento .service-card, .bento .service-card.featured { grid-column: auto; grid-row: auto; }
  .stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-stage, .slide, .brand-hero { grid-template-columns: 1fr; }
  .footer-cta { transform: none; margin: 2rem 0; }
  .footer-main { margin-top: 0; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .whatsapp-float, .to-top { display: none; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* App kit: shells collapse to app bar + bottom tabs */
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-topbar { min-height: 58px; }
  .app-topbar .brand { display: inline-flex; padding: 0; }
  .app-topbar .brand img { height: 34px; }
  .app-topbar .brand-text { display: none; }
  .app-topbar .hide-mobile { display: none; }
  .app-content { padding: 1rem; padding-bottom: 2rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }

  body:not(.auth-body) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 50;
    inset-inline: 0; bottom: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px;
    font-size: 0.7rem; font-weight: 700;
    color: var(--ink-3);
    transition: color var(--t-fast) var(--ease-out);
  }
  .tab-ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: var(--r-full); transition: background-color var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out); }
  .tabbar .ph { width: 22px; height: 22px; }
  .tabbar a:active .tab-ico { transform: scale(0.92); }
  .tabbar a.is-active { color: var(--ink); }
  .tabbar a.is-active .tab-ico { background: var(--accent-soft); color: var(--accent-ink); }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 1.5rem); }
  .table-wrap:has(table.stack) { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: grid; gap: 0.1rem; margin-bottom: 0.7rem; padding: 0.75rem 0.95rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); }
  table.stack td { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); text-align: end; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: 0.8rem; font-weight: 600; text-align: start; flex: none; }
  table.stack td.cell-title { font-weight: 700; justify-content: flex-start; text-align: start; padding-top: 0.2rem; }
  table.stack td.cell-title::before { display: none; }
  table.stack td form, table.stack .inline-form { justify-content: flex-end; }
  table.stack .row-actions { width: 100%; }
  .tpl-grid, .form-grid { grid-template-columns: 1fr; }
  .guide-steps > li { padding-inline-start: 2.7rem; }
  .section { padding: 2.6rem 0; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-actions .btn { flex: 1; }
  .hero-visual, #hero-canvas { min-height: 300px; height: 300px; }
  .float-card { min-width: 0; padding: 0.55rem 0.7rem; }
  .float-card .icon-bubble { display: none; }
  .card-c { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
  .metrics { gap: 0.6rem; }
  .metric { padding: 0.9rem; }
  .metric > .ph, .metric .metric-ico { width: 32px; height: 32px; padding: 7px; }
  .page-head { align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .thread { max-width: 100%; }
  .ledger-line { grid-template-columns: 1fr; }
  .auth-card { border: 0; box-shadow: none; background: transparent; padding: 0.5rem 0; }
  .auth-center { align-content: start; padding-top: 1rem; }
  .otp-box { min-height: 54px; font-size: 1.3rem; }
  th, td { padding: 0.75rem 0.8rem; }
}
@media (min-width: 720px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 961px) {
  .process-layout { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  .process-stage { position: sticky; top: calc(var(--header-h) + 24px); }
  .quote-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .magazine { grid-template-columns: 1.25fr 1fr; }
  .post-feature { grid-row: span 2; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-grid.is-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .is-app .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -80; } }
@keyframes marquee-forward { to { transform: translateX(50%); } }
@keyframes marquee-back { from { transform: translateX(50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .marquee { overflow-x: auto; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header, .app-topbar, .tabbar, .float-card, .to-top { background: var(--bg-elev); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
  .site-header, .site-footer, .tabbar, .sidebar, .app-topbar, .whatsapp-float, .to-top, .scroll-rail { display: none !important; }
  body { background: #fff; color: #000; padding: 0 !important; }
}

.ai-answer p, .ai-docs p { white-space: pre-wrap; }
.ai-docs { margin: 1rem 0 1.5rem; }
.ai-docs code { font-size: .92em; }
.ai-answer { margin: 1rem 0; }
/* Article tables and inline figures */
.prose .table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 420px; }
.prose th, .prose td { padding: 0.65rem 0.9rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.8; }
.prose th { background: var(--accent-soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--line) 25%, transparent); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose .post-figure { margin: 1.8rem 0; }
.prose .post-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); }
.prose .post-figure figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--ink-3); text-align: center; }

/* Article sheet: one aligned column plus a sticky rail */
.article.post-page { width: min(1140px, calc(100% - 2rem)); margin-top: 1.2rem; }
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.4rem;
  align-items: start;
}
.post-main { max-width: none; min-width: 0; }
.post-header { max-width: none; }
.article.post-page .post-header h1 { font-size: clamp(1.65rem, 2.6vw, 2.25rem); line-height: 1.45; margin: 0.35rem 0 0.7rem; }
.post-header .lede { font-size: 1.05rem; line-height: 1.95; color: var(--ink-2); }
.post-cover { margin: 1.15rem 0 1.35rem; aspect-ratio: 16 / 9; max-height: none; border-radius: 18px; }
.tldr { border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); background: var(--tint-1); }
.post-aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-self: start;
}
.post-aside .toc { padding: 0.95rem 1rem 0.45rem; border-radius: 16px; border: 1px solid var(--line); background: var(--tint-1); }
.post-aside .toc-title { margin: 0 0 0.35rem; }
.post-aside .toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.post-aside .toc a {
  display: block;
  padding: 0.62rem 0.1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.7;
  font-size: 0.86rem;
}
.post-aside .toc a:hover { color: var(--accent-ink); }
.side-author {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(239, 68, 68, 0.16), transparent 50%),
    var(--tint-1);
  text-decoration: none;
  color: inherit;
}
.side-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--bg, #07080b), 0 0 0 4px #ef4444; }
.side-author span { display: grid; gap: 0.1rem; min-width: 0; }
.side-author small { color: #f87171; font-size: 0.75rem; }
.side-author strong { font-size: 0.98rem; }
.side-author em { color: var(--ink-3); font-style: normal; font-size: 0.8rem; line-height: 1.6; }
.side-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  padding: 0.75rem 1rem;
}
.side-cta:hover { filter: brightness(1.06); }
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .post-aside { position: static; display: flex; }
  .post-aside .toc { display: none; }
  .toc-inline { display: block; }
  .post-cover { aspect-ratio: 16 / 10; }
}
