*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
html[dir="rtl"] { direction: rtl; }
body {
  font-family: var(--font-fa);
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--text-brand); text-decoration: none; }
a:hover { color: var(--blue-800); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip {
  position: absolute; inset-inline-start: -999px; top: 8px;
}
.skip:focus { inset-inline-start: 8px; background: var(--bg-surface); padding: 8px 12px; z-index: 100; }

.container { width: min(100% - 48px, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 48px, 480px); margin-inline: auto; }

.display { font-size: 64px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.h1 { font-size: 40px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.h2 { font-size: 28px; line-height: 1.4; font-weight: 700; margin: 0; }
.h3 { font-size: 22px; line-height: 1.45; font-weight: 600; margin: 0; }
.h4 { font-size: 18px; line-height: 1.5; font-weight: 600; margin: 0; }
.body-lg { font-size: 18px; line-height: 2; }
.body { font-size: 16px; line-height: 1.85; }
.body-sm { font-size: 14px; line-height: 1.8; }
.caption { font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.label { font-size: 13px; line-height: 1.6; font-weight: 500; }
.muted { color: var(--text-secondary); }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; font-weight: 500;
  transition: background var(--duration-fast, 160ms) ease, color var(--duration-fast, 160ms) ease, border-color var(--duration-fast, 160ms) ease, transform 120ms ease, box-shadow var(--duration-fast, 160ms) ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--bg-brand); color: var(--text-inverse); }
.btn-primary:hover { background: var(--bg-brand-hover); color: var(--text-inverse); }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-surface-soft); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface-soft); }
.btn-danger { background: transparent; color: var(--status-error); border-color: var(--border); }
.btn-ai { background: var(--violet-600); color: #fff; }
.btn-ai:hover { background: #6d28d9; color: #fff; }
.btn-lg { min-height: 48px; padding: 12px 22px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary);
}
.input:focus { border-color: var(--border-brand); box-shadow: var(--focus); outline: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500;
}
.badge-ok { background: #f0fdf4; color: var(--status-success); }
.badge-warn { background: #fffbeb; color: #b45309; }
.badge-err { background: #fef2f2; color: var(--status-error); }
.badge-info { background: var(--blue-100); color: var(--blue-800); }
.badge-ai { background: #f5f3ff; color: var(--violet-600); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px; background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.logo { font-weight: 700; letter-spacing: 0.12em; font-size: 13px; color: var(--text-primary); }

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-hover) 100%);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(26, 86, 214, 0.22);
}

.brand-mark img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.brand-mark-inline {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.brand-word {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.footer-logo,
.modal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-header .dash-brand,
.site-header .brand-lockup {
  margin: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 800;
}

.brand-lockup .brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-lockup .brand-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav { display: flex; gap: 28px; }
.nav a { color: var(--text-secondary); font-size: 14px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue-600); }
.header-actions { display: flex; gap: 8px; align-items: center; }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.kicker { font-size: 13px; letter-spacing: 0.04em; color: var(--blue-600); font-weight: 600; margin: 0 0 12px; }
pre, code, .code, input[type="tel"], input[type="url"] { direction: ltr; text-align: left; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.site-footer {
  padding: 48px 40px 64px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  color: var(--text-secondary); font-size: 14px;
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text-primary); }
.site-footer h4 { color: var(--text-primary); margin: 0 0 16px; font-size: 13px; }

@media (max-width: 900px) {
  .display { font-size: 40px; line-height: 48px; }
  .h1 { font-size: 32px; line-height: 40px; }
  .site-header { padding: 12px 16px; }
  .nav { display: none; }
  .site-footer { grid-template-columns: 1fr 1fr; padding: 32px 16px 48px; }
  .container { width: min(100% - 32px, var(--container)); }
}
