/* =============================================================================
   WA Gateway – design system (public site + dashboard)
   ============================================================================= */
:root {
  --brand: #0f9d74;
  --brand-600: #0b8562;
  --brand-700: #086b4f;
  --brand-50: #e8f8f2;
  --brand-100: #c9eedf;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --bg: #f6f8fb;
  --card: #ffffff;
  --code-bg: #0b1220;
  --code-ink: #dbe4f0;
  --red: #dc2626;
  --red-50: #fdecec;
  --amber: #b45309;
  --amber-50: #fef4e2;
  --blue: #2563eb;
  --blue-50: #e9f0fe;
  --violet: #7c3aed;
  --violet-50: #f1ebfe;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #22c08f;
    --brand-600: #1aa97c;
    --brand-700: #5ee0b5;
    --brand-50: #0f2a23;
    --brand-100: #154235;
    --ink: #e6edf6;
    --ink-2: #c3cfdd;
    --muted: #8a9bb0;
    --line: #223047;
    --line-2: #1a263a;
    --bg: #0b1120;
    --card: #111a2c;
    --code-bg: #070c17;
    --red: #f87171;
    --red-50: #3a1518;
    --amber: #fbbf24;
    --amber-50: #3a2a0c;
    --blue: #60a5fa;
    --blue-50: #13233f;
    --violet: #a78bfa;
    --violet-50: #241a40;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --brand: #22c08f;
  --brand-600: #1aa97c;
  --brand-700: #5ee0b5;
  --brand-50: #0f2a23;
  --brand-100: #154235;
  --ink: #e6edf6;
  --ink-2: #c3cfdd;
  --muted: #8a9bb0;
  --line: #223047;
  --line-2: #1a263a;
  --bg: #0b1120;
  --card: #111a2c;
  --code-bg: #070c17;
  --red: #f87171;
  --red-50: #3a1518;
  --amber: #fbbf24;
  --amber-50: #3a2a0c;
  --blue: #60a5fa;
  --blue-50: #13233f;
  --violet: #a78bfa;
  --violet-50: #241a40;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--line-2);
  border: 1px solid var(--line);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  word-break: break-word;
}
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  margin: 0 0 1.2em;
}
pre code { background: none; border: 0; padding: 0; font-size: 0.82rem; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.8rem; display: block; margin-top: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(5, 80, 60, 0.25); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: var(--line); }
.btn-danger-ghost:hover { background: var(--red-50); }
.btn-light { background: #fff; color: #064e3b; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 0.83rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- forms */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 0.86rem; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.93rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 0.86rem; }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--line-2);
  color: var(--muted);
  cursor: pointer;
}
.input-addon:hover { color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; }
.check b { display: block; font-weight: 600; font-size: 0.92rem; }
.check small { color: var(--muted); font-size: 0.82rem; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 22px; background: var(--line); border-radius: 22px; position: relative; transition: background 0.2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- alerts / badges */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 0.9rem; border: 1px solid transparent; }
.alert-error { background: var(--red-50); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-success { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.alert-warn { background: var(--amber-50); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert-info { background: var(--blue-50); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  background: var(--line-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-green { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge-red { background: var(--red-50); color: var(--red); border-color: transparent; }
.badge-amber { background: var(--amber-50); color: var(--amber); border-color: transparent; }
.badge-blue { background: var(--blue-50); color: var(--blue); border-color: transparent; }
.badge-violet { background: var(--violet-50); color: var(--violet); border-color: transparent; }
.badge .dot, .conn-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------- public: header / footer */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; color: var(--ink); letter-spacing: -0.02em; text-decoration: none !important; }
.brand .logo-mark { width: 32px; height: 32px; color: var(--brand); stroke: none; }
.brand.small { font-size: 0.95rem; }
.brand.small .logo-mark { width: 26px; height: 26px; }
.brand.light { color: #fff; }
.brand.light .logo-mark { color: rgba(255, 255, 255, 0.18); }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a { color: var(--ink-2); font-weight: 550; font-size: 0.92rem; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--line-2); text-decoration: none; }
.nav-cta { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nav-burger { display: none; }
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.footer-inner nav a { color: var(--muted); font-size: 0.9rem; }
.footer-inner p { margin: 0 0 0 auto; font-size: 0.85rem; }

/* ---------------------------------------------------------------- public: landing */
.hero { padding: 72px 0 56px; background: radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), radial-gradient(700px 380px at -10% 10%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 5px 11px; border-radius: 999px; margin-bottom: 18px; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 36em; }
.grad { background: linear-gradient(90deg, var(--brand), #14b8a6 60%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-size: 0.92rem; }
.checks li { display: inline-flex; gap: 7px; align-items: center; }
.checks svg { color: var(--brand); }
.checks.light { flex-direction: column; color: rgba(255, 255, 255, 0.92); }
.checks.light svg { color: #6ee7b7; }
.hero-visual { position: relative; padding-bottom: 60px; }
.code-card { background: var(--code-bg); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.06); }
.code-card pre { margin: 0; border-radius: 0; padding: 18px 20px 22px; }
.code-card-head { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.code-card-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.code-title { color: #8796ad; font-size: 0.8rem; margin-left: 8px; font-weight: 600; }
.tok-k { color: #7dd3fc; } .tok-s { color: #86efac; } .tok-p { color: #f9a8d4; } .tok-n { color: #fcd34d; } .tok-c { color: #64748b; }
.phone { position: absolute; right: -10px; bottom: 0; width: 270px; background: #e7ddd3; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; border: 6px solid #111827; }
.phone-top { display: flex; gap: 10px; align-items: center; background: #075e54; color: #fff; padding: 10px 12px; }
.phone-top small { display: block; opacity: 0.8; font-size: 0.72rem; }
.phone-top b { font-size: 0.86rem; }
.phone .avatar .logo-mark { width: 30px; height: 30px; color: #25d366; }
.bubble { position: relative; margin: 14px 12px 16px 12px; background: #fff; color: #111; padding: 10px 12px 18px; border-radius: 10px 10px 10px 2px; font-size: 0.82rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); }
.bubble .time { position: absolute; right: 8px; bottom: 3px; font-size: 0.66rem; color: #53bdeb; }
.section { padding: 72px 0; }
.section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature p { color: var(--muted); margin: 0; font-size: 0.93rem; }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); margin-bottom: 16px; }
.feature-icon svg { width: 21px; height: 21px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { padding: 24px; border: 1px dashed var(--line); border-radius: 16px; background: var(--bg); }
.steps li > span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 14px; }
.steps p { color: var(--muted); margin: 0; font-size: 0.93rem; }
.case-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.case { display: flex; gap: 14px; padding: 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.case > svg { width: 22px; height: 22px; color: var(--brand); margin-top: 2px; }
.case h3 { margin-bottom: 4px; }
.case p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px; border-radius: 22px; background: linear-gradient(120deg, #064e3b, #0f9d74 60%, #14b8a6); color: #fff; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; opacity: 0.9; }
.cta-band .hero-actions { margin: 0; }

/* ---------------------------------------------------------------- public: docs */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 40px; }
.docs-nav-inner { position: sticky; top: 90px; display: grid; gap: 2px; max-height: calc(100vh - 110px); overflow: auto; }
.docs-nav-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.docs-nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-size: 0.9rem; border-left: 2px solid transparent; }
.docs-nav a:hover { background: var(--line-2); text-decoration: none; }
.docs-nav a.active { color: var(--brand-600); background: var(--brand-50); font-weight: 600; }
.prose section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 86px; }
.prose section:last-child { border-bottom: 0; }
.prose h1 { font-size: 2.2rem; }
.prose h2 { font-size: 1.45rem; }
.prose p, .prose li { color: var(--ink-2); }
.endpoint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.endpoint code { font-size: 0.95rem; font-weight: 600; }
.method { font-family: var(--mono); font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.04em; }
.method.get { background: var(--blue-50); color: var(--blue); }
.method.post { background: var(--brand-50); color: var(--brand-600); }
.method.delete { background: var(--red-50); color: var(--red); }
.callout { border: 1px solid var(--brand-100); background: var(--brand-50); padding: 14px 16px; border-radius: 12px; margin: 0 0 1.2em; color: var(--ink-2); }
.callout.warn { border-color: color-mix(in srgb, var(--amber) 30%, transparent); background: var(--amber-50); }
.callout code.block { display: block; margin-top: 6px; font-size: 0.95rem; background: var(--card); }
.flow { padding-left: 1.2em; }
.flow li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1.2em; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; background: var(--line-2); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.params td:first-child { white-space: nowrap; }
.tabs { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1.2em; background: var(--code-bg); }
.tab-list { display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.tab { border: 0; background: transparent; color: #8796ad; font: inherit; font-size: 0.8rem; font-weight: 600; padding: 8px 12px; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; }
.tab.active { color: #fff; background: rgba(255, 255, 255, 0.07); }
.copy-btn { margin-left: auto; border: 1px solid rgba(255, 255, 255, 0.15); background: transparent; color: #cbd5e1; font: inherit; font-size: 0.75rem; padding: 4px 10px; border-radius: 7px; cursor: pointer; align-self: center; margin-bottom: 6px; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.08); }
.tab-panel { display: none; margin: 0; border-radius: 0; }
.tab-panel.active { display: block; }

/* ---------------------------------------------------------------- auth pages */
.page-auth { background: var(--bg); }
.auth-wrap { display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; min-height: 100vh; }
.auth-side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px; color: #fff; background: radial-gradient(600px 300px at 0% 100%, rgba(20, 184, 166, 0.45), transparent 70%), linear-gradient(150deg, #052e24, #075e54 55%, #0f9d74); }
.auth-side h2 { color: #fff; font-size: 1.9rem; }
.auth-side p { color: rgba(255, 255, 255, 0.85); }
.muted-light { color: rgba(255, 255, 255, 0.6) !important; font-size: 0.85rem; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-card .alert { margin: 16px 0 0; }
.auth-card form { margin-top: 24px; }
.only-sm { display: none !important; }

/* ---------------------------------------------------------------- app shell */
.page-app { background: var(--bg); }
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 4px 8px; }
.side-nav { display: grid; gap: 2px; }
.side-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 550; font-size: 0.92rem; text-decoration: none; }
.side-nav a svg { width: 18px; height: 18px; color: var(--muted); }
.side-nav a:hover { background: var(--line-2); }
.side-nav a.active { background: var(--brand-50); color: var(--brand-700); }
.side-nav a.active svg { color: var(--brand); }
.sidebar-backdrop { display: none; }
.side-foot { margin-top: auto; padding: 0 10px; }
.side-link { font-size: 0.85rem; color: var(--muted); }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.conn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; background: var(--line-2); color: var(--muted); border: 1px solid var(--line); text-decoration: none !important; }
.conn-pill.ok { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.conn-pill.ok .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.conn-pill.warn { background: var(--amber-50); color: var(--amber); border-color: transparent; }
.conn-pill.bad { background: var(--red-50); color: var(--red); border-color: transparent; }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--ink); cursor: pointer; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50; display: grid; }
.menu a, .menu button { text-align: left; padding: 9px 11px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 0.9rem; background: none; border: 0; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--line-2); }
.demo-banner { background: var(--amber-50); color: var(--amber); padding: 8px 24px; font-size: 0.86rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.content { padding: 26px 24px 60px; max-width: 1280px; width: 100%; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.55rem; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; }
.card-head p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; background: color-mix(in srgb, var(--line-2) 50%, transparent); border-radius: 0 0 16px 16px; }
.cards { display: grid; gap: 20px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.layout-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.stat-sub { font-size: 0.78rem; color: var(--muted); }
.i-green { background: var(--brand-50); color: var(--brand-600); }
.i-blue { background: var(--blue-50); color: var(--blue); }
.i-violet { background: var(--violet-50); color: var(--violet); }
.i-red { background: var(--red-50); color: var(--red); }
.i-amber { background: var(--amber-50); color: var(--amber); }
.chart { width: 100%; height: auto; max-height: 260px; display: block; }
.chart .bar-sent { fill: var(--brand); }
.chart .bar-recv { fill: color-mix(in srgb, var(--blue) 70%, transparent); }
.chart .bar-otp { fill: var(--violet); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.device-hero { display: flex; gap: 18px; align-items: center; }
.device-avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.device-avatar svg { width: 28px; height: 28px; }
.qr-box { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 16px; border: 1px solid var(--line); width: fit-content; margin: 0 auto; }
.qr-box img { width: 264px; height: 264px; image-rendering: pixelated; display: block; }
.pair-code { font-family: var(--mono); font-size: 2.2rem; font-weight: 800; letter-spacing: 0.25em; text-align: center; padding: 18px; background: var(--brand-50); color: var(--brand-700); border-radius: 14px; border: 1px dashed var(--brand-100); }
.howto { counter-reset: h; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); font-size: 0.93rem; }
.howto li::before { counter-increment: h; content: counter(h); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: 0.78rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 0.9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.table-card .table-wrap { border: 0; border-radius: 0 0 16px 16px; margin: 0; }
.table-card table td { vertical-align: middle; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 0.8rem; }
.cell-text { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-height: 36px; padding: 6px 10px; font-size: 0.88rem; }
.toolbar .grow { flex: 1; min-width: 180px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--line); margin-bottom: 8px; stroke-width: 1.5; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--code-bg); color: #86efac; padding: 12px 14px; border-radius: 10px; font-family: var(--mono); font-size: 0.88rem; word-break: break-all; }
.secret-box button { flex: none; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; background: var(--bg); }
.rule-head { display: flex; gap: 10px; align-items: center; }
.rule-head .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; background: var(--brand-50); color: var(--brand-700); }
.rule-head .select { width: auto; min-height: 36px; padding: 6px 10px; }
.preview-bubble { background: #dcf8c6; color: #111; padding: 10px 12px 18px; border-radius: 10px 10px 2px 10px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; position: relative; max-width: 360px; margin-left: auto; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); }
.preview-bubble .time { position: absolute; right: 8px; bottom: 3px; font-size: 0.66rem; color: #667781; }
.chat-bg { background: #efeae2; border-radius: 12px; padding: 18px; }
.code-inline { font-family: var(--mono); font-size: 0.8rem; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: var(--mono); font-size: 0.82rem; }

/* toasts & modal */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 100; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 380px; background: var(--ink); color: var(--card); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 0.9rem; animation: toast-in 0.2s ease-out; }
.toast.error { background: var(--red); color: #fff; }
.toast.success svg { color: #6ee7b7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-root:empty { display: none; }
.modal-overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.55); display: grid; place-items: center; padding: 20px; z-index: 90; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal .card-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
.center-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 20px; }

/* ---------------------------------------------------------------- responsive */
.only-md { display: none; }
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2 { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .phone { right: 8px; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-nav { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, 0.45); z-index: 55; }
  .only-md { display: inline-grid; }
  .layout-2-even { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .only-sm { display: inline-flex !important; margin-bottom: 24px; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; margin: 0; }
  .nav-links.open { display: flex; }
  .nav-burger { display: inline-grid; }
  .hide-sm { display: none !important; }
  .container { padding: 0 16px; }
  .hero { padding: 44px 0 32px; }
  .hero-visual { padding-bottom: 0; }
  .phone { position: relative; right: auto; margin: -30px auto 0; }
  .feature-grid, .steps, .case-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .cta-band { padding: 28px 22px; }
  .footer-inner p { margin: 0; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 0 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; flex-direction: column; gap: 8px; }
  .stat-value { font-size: 1.35rem; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .conn-pill span:last-child { display: none; }
  .cell-text { max-width: 180px; }
  .toasts { left: 16px; right: 16px; }
  .toast { max-width: none; }
}
.auth-card form + p { margin-top: 18px; }

/* =============================================================================
   SaaS components
   ============================================================================= */
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-sm); }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.price-card h3 { margin: 0; font-size: 1.15rem; }
.price-card .muted { margin: 0; min-height: 2.6em; }
.price-badge { position: absolute; top: -12px; left: 24px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 8px; }
.price b { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.price span { color: var(--muted); font-size: 0.9rem; }
.price-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; font-size: 0.9rem; color: var(--ink-2); }
.price-list li { display: flex; gap: 8px; align-items: flex-start; }
.price-list svg { color: var(--brand); margin-top: 3px; }
.price-list li.off { color: var(--muted); text-decoration: line-through; opacity: 0.7; }
.price-list li.off svg { color: var(--muted); }
.price-card.current { outline: 2px dashed var(--brand); outline-offset: 3px; }

/* usage meters */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.meter { display: grid; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; }
.meter-top span:first-child { color: var(--ink-2); font-weight: 600; }
.meter-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width 0.4s; }
.bar.warn i { background: #f59e0b; }
.bar.full i { background: var(--red); }

/* plan summary card */
.plan-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: 16px; background: linear-gradient(120deg, var(--brand-50), var(--card)); border: 1px solid var(--brand-100); margin-bottom: 20px; }
.plan-card h3 { margin: 0; }
.plan-card p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }

/* devices */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.device-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.device-card .device-hero { gap: 14px; }
.device-card .device-avatar { width: 46px; height: 46px; border-radius: 13px; }
.device-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.device-card.add { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--muted); cursor: pointer; min-height: 190px; background: transparent; }
.device-card.add:hover { border-color: var(--brand); color: var(--brand); }
.device-card.add svg { width: 30px; height: 30px; }
.select-inline { width: auto; min-height: 36px; padding: 6px 10px; }

/* upload dropzone + preview */
.dropzone { position: relative; display: grid; place-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); color: var(--muted); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.dropzone svg { width: 30px; height: 30px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone b { color: var(--ink); }
.file-preview { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.file-preview .thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--line-2); flex: none; display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 0.8rem; overflow: hidden; }
.file-preview .thumb svg { width: 30px; height: 30px; }
.file-preview video.thumb { background: #000; }
.file-preview .meta { flex: 1; min-width: 0; }
.file-preview .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview audio { width: 100%; margin-top: 6px; height: 34px; }
.preview-media { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; margin-bottom: 6px; }
.preview-doc { display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, 0.05); border-radius: 8px; padding: 10px; margin-bottom: 6px; font-weight: 600; }

/* impersonation / pending banners */
.imp-banner { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; background: #7c3aed; color: #fff; padding: 8px 16px; font-size: 0.88rem; font-weight: 600; }
.imp-banner button { background: #fff; color: #5b21b6; border: 0; border-radius: 8px; padding: 5px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.nav-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 0.7rem; font-weight: 800; padding: 1px 7px; }
.limit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mini-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.mini-stat b { display: block; font-size: 1.3rem; }
.mini-stat span { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 720px) {
  .price b { font-size: 1.7rem; }
  .file-preview .thumb { width: 64px; height: 64px; }
}

/* legal pages */
.legal { max-width: 820px; padding-top: 40px; padding-bottom: 40px; }
.legal h2 { font-size: 1.2rem; margin-top: 28px; }
.legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: 4px; color: var(--ink-2); }

/* inbox */
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--line-2); }
.switch.small { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.switch.small .track { width: 34px; height: 19px; }
.switch.small .track::after { width: 13px; height: 13px; }
.switch.small input:checked + .track::after { transform: translateX(15px); }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 210px); min-height: 480px; overflow: hidden; }
.conv-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.conv-list { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.conv:hover { background: var(--line-2); }
.conv.active { background: var(--brand-50); }
.conv-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.conv-top, .conv-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.conv-top small { color: var(--muted); font-size: 0.72rem; flex: none; }
.conv-text { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .nav-count { margin-left: 0; }
.thread-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-pane > .empty { margin: auto; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: #efeae2; }
:root[data-theme='dark'] .thread { background: #0b141a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .thread { background: #0b141a; } }
.msg { display: flex; }
.msg.out { justify-content: flex-end; }
.msg-bubble { max-width: min(560px, 80%); padding: 7px 10px 6px; border-radius: 10px; background: #fff; color: #111; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); }
.msg.out .msg-bubble { background: #d9fdd3; }
.msg-meta { display: block; text-align: right; font-size: 0.68rem; color: #667781; margin-top: 2px; }
.msg-meta .cell-sub { font-size: 0.68rem; color: #8696a0; }
.msg-meta .read { color: #53bdeb; }
.reply { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; background: var(--card); }
.reply-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-row .textarea { min-height: 42px; max-height: 140px; resize: none; }
.reply-row label.icon-btn { cursor: pointer; }
@media (max-width: 960px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .inbox .thread-pane { display: none; }
  .inbox.has-thread .conv-pane { display: none; }
  .inbox.has-thread .thread-pane { display: flex; }
  .inbox.has-thread { position: fixed; inset: 64px 0 0 0; z-index: 15; height: auto; min-height: 0; border-radius: 0; border: 0; }
}

/* integrations */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.int-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.int-card .price-list { margin: 0; flex: 1; }
.int-head { display: flex; gap: 14px; align-items: center; }
.int-head h3 { margin: 0 0 2px; }
.int-head p { margin: 0; }
.int-icon { flex: none; width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; }
.int-wp { background: #21759b; }
.int-whmcs { background: #2c9a4e; }
.int-php { background: #777bb4; }
.int-node { background: #3c873a; }
.int-python { background: #3776ab; }
.int-postman { background: #ff6c37; }
.int-card details { font-size: 0.88rem; color: var(--ink-2); }
.int-card summary { cursor: pointer; font-weight: 600; color: var(--brand-600); }
.int-card ol { padding-left: 1.2em; margin: 8px 0 0; display: grid; gap: 6px; }
.int-card ol code { white-space: normal; word-break: break-word; }

/* =============================================================================
   Visual refresh – Inter typeface, dark sidebar, refined surfaces, richer landing
   ============================================================================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root { --bg: #f5f7fb; --radius: 14px; --side: #0c1322; --side-line: #1a2540; }
body { font-feature-settings: 'cv11', 'ss01', 'ss03'; letter-spacing: -0.006em; }
h1, h2, h3 { letter-spacing: -0.025em; }
.stat-value, .price b, .numbers b { font-feature-settings: 'tnum', 'cv11'; }

/* surfaces */
.card { border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.card-head { padding: 15px 20px; }
.card-head h2, .card-head h3 { font-weight: 650; }
.btn { font-weight: 600; letter-spacing: -0.01em; }
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand)); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 2px rgba(5, 80, 60, 0.3); }
.btn-primary:hover { background: var(--brand-600); }
.page-head h1 { font-size: 1.5rem; font-weight: 720; }
.table-card table tbody tr { transition: background 0.12s; }
.table-card table tbody tr:hover td { background: color-mix(in srgb, var(--line-2) 70%, transparent); }
th { font-weight: 650; }
.stat { align-items: center; }
.stat-value { font-weight: 760; }
.badge { font-weight: 600; }
.input, .select, .textarea { border-radius: 10px; }
.modal { border-radius: 16px; }

/* dark sidebar (same in light and dark theme) */
.sidebar { background: var(--side); border-right: 1px solid var(--side-line); color: #c7d2e3; padding: 16px 12px; scrollbar-width: thin; scrollbar-color: #22304f transparent; }
.sidebar .brand { color: #fff; padding: 6px 10px 10px; }
.sidebar .brand .logo-mark { color: #19b386; }
.side-group { color: #5d6e8c; padding: 16px 12px 6px; }
.side-nav a { color: #b3c0d6; padding: 8px 12px; border-radius: 9px; font-weight: 520; font-size: 0.9rem; }
.side-nav a svg { color: #6f82a3; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a:hover svg { color: #c7d2e3; }
.side-nav a.active { background: linear-gradient(90deg, rgba(25, 179, 134, 0.26), rgba(25, 179, 134, 0.08)); color: #fff; box-shadow: inset 2px 0 0 #2dd4a0; }
.side-nav a.active svg { color: #4ade9f; }
.side-foot { padding: 0 2px; }
.side-plan { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: #c7d2e3; text-decoration: none !important; }
a.side-plan:hover { background: rgba(255, 255, 255, 0.08); }
.side-plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-plan-top b { color: #fff; font-size: 0.88rem; }
.side-plan-top span:not(.badge) { color: #4ade9f; font-size: 0.78rem; font-weight: 650; }
.side-plan small { color: #8698b5; font-size: 0.76rem; }
.side-plan .bar { background: rgba(255, 255, 255, 0.08); border-color: transparent; height: 6px; }

/* top bar */
.topbar { height: 60px; background: color-mix(in srgb, var(--card) 88%, transparent); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); min-width: 0; }
.crumbs i { font-style: normal; opacity: 0.5; }
.crumbs .topbar-title { font-size: 0.95rem; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn { box-shadow: var(--shadow-sm); }

/* landing */
.hero { padding: 84px 0 64px; }
.hero h1 { font-weight: 800; letter-spacing: -0.04em; }
.works { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.works-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 30px; padding-top: 20px; padding-bottom: 20px; }
.works-inner span { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.works-inner b { color: var(--ink-2); font-weight: 650; font-size: 0.98rem; opacity: 0.78; }
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.numbers div { padding: 26px 24px; border-right: 1px solid var(--line); }
.numbers div:last-child { border-right: 0; }
.numbers b { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; color: var(--brand-600); }
.numbers span { color: var(--muted); font-size: 0.9rem; }
.faq { max-width: 860px; }
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; transition: box-shadow 0.15s; }
.faq-item[open] { box-shadow: var(--shadow); }
.faq-item summary { cursor: pointer; list-style: none; padding: 17px 28px 17px 0; font-weight: 650; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--brand); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin: 0 0 18px; color: var(--ink-2); }

/* footer */
.site-footer { background: var(--side); color: #9fb0c9; border-top: 0; padding: 56px 0 26px; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { margin: 14px 0 0; max-width: 34ch; font-size: 0.9rem; line-height: 1.6; }
.footer-grid h4 { color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 4px 0 14px; }
.footer-grid a:not(.brand) { display: block; color: #9fb0c9; font-size: 0.92rem; padding: 4px 0; }
.footer-grid a:not(.brand):hover { color: #fff; text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--side-line); font-size: 0.82rem; color: #71829f; }
.footer-note { opacity: 0.8; }

@media (max-width: 960px) {
  .numbers { grid-template-columns: 1fr 1fr; }
  .numbers div:nth-child(2) { border-right: 0; }
  .numbers div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hero { padding: 48px 0 36px; }
  .numbers b { font-size: 1.6rem; }
  .numbers div { padding: 18px 16px; }
  .crumbs span, .crumbs i { display: none; }
  .footer-bottom { flex-direction: column; }
}
