/* Design tokens shared by both brands. Brand overrides --primary etc. in its own styles.css. */
:root {
  --primary: #2563EB; --primary-hover: #1D4ED8; --primary-soft: #E8EFFF; --on-primary: #fff;
  --text: #17243B; --text-2: #5B6B85; --text-3: #8A97AD;
  --bg: #F5F7FC; --surface: #FFFFFF; --surface-2: #F0F3F9; --border: #E2E7F0; --border-2: #CBD3E1;
  --success: #16A34A; --success-soft: #DCFCE7; --warning: #D97706; --warning-soft: #FEF3C7;
  --danger: #DC2626; --danger-soft: #FEE2E2; --info-soft: #E0F2FE;
  --radius: 14px; --radius-s: 10px; --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(23,36,59,.06), 0 8px 24px -12px rgba(23,36,59,.18);
  --shadow-s: 0 1px 2px rgba(23,36,59,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px; --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-soft: #1E2A4A; --text: #E6EBF5; --text-2: #A5B0C4; --text-3: #7A869C;
    --bg: #0F1420; --surface: #171D2B; --surface-2: #1F2636; --border: #283044; --border-2: #364058;
    --success-soft: #0F2E1C; --warning-soft: #33250A; --danger-soft: #3A1414; --info-soft: #0F2438;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-s: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary-soft: #1E2A4A; --text: #E6EBF5; --text-2: #A5B0C4; --text-3: #7A869C;
  --bg: #0F1420; --surface: #171D2B; --surface-2: #1F2636; --border: #283044; --border-2: #364058;
  --success-soft: #0F2E1C; --warning-soft: #33250A; --danger-soft: #3A1414; --info-soft: #0F2438; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; } h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; } h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 1em; } .muted { color: var(--text-2); } .small { font-size: 13px; } .mono { font-family: var(--mono); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-s); border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; min-height: 44px; }
.btn:active { transform: translateY(1px); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); } .btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--surface); border-color: var(--border-2); color: var(--text); } .btn.secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text-2); } .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); } .btn.success { background: var(--success); color: #fff; }
.btn.block { width: 100%; } .btn.sm { padding: 7px 12px; min-height: 36px; font-size: 14px; } .btn.lg { padding: 14px 24px; font-size: 16px; }
.btn.icon { padding: 8px; min-width: 40px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, input.input, select.input, textarea.input { width: 100%; padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--radius-s); background: var(--surface); min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; min-height: 1.2em; }
.help { color: var(--text-3); font-size: 13px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-s); }
.card.pad-l { padding: 28px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); } .badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); } .badge.primary { background: var(--primary-soft); color: var(--primary); } .badge.info { background: var(--info-soft); color: #0369A1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.grid { display: grid; gap: 16px; } .grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .row.between { justify-content: space-between; } .spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; } th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; background: var(--surface-2); } tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); } .empty .icon { font-size: 40px; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-xs); min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* toast + modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1000; max-width: min(92vw, 480px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.success { background: var(--success); color: #fff; } .toast.error { background: var(--danger); color: #fff; }
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(96vw, 520px); width: 100%; margin: auto; }
dialog.modal::backdrop { background: rgba(10, 16, 30, .55); backdrop-filter: blur(2px); }
dialog.modal .modal-body { background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
@media (max-width: 560px) { dialog.modal { max-width: 100vw; margin: auto 0 0; } dialog.modal .modal-body { border-radius: 18px 18px 0 0; } .modal-actions .btn { flex: 1; } }

/* progress */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; } .progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-s); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; } .tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s); }
.code-big { font-family: var(--mono); font-size: clamp(28px, 8vw, 44px); font-weight: 700; letter-spacing: .12em; color: var(--primary); }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; } .lang-switch button { border: 0; background: transparent; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; text-transform: uppercase; } .lang-switch button.active { background: var(--primary); color: #fff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
