/* ==========================================================================
   AlertKeep Design System v3
   Cleaner spacing, softer palette, clearer hierarchy.
   ========================================================================== */

:root {
    /* Brand (from logo: deep navy shield + cyan eye + red alert badge) */
    --ak-primary: #17335E;
    --ak-primary-2: #1E4278;
    --ak-primary-3: #2A5493;
    --ak-primary-soft: #E8EEF7;
    --ak-accent: #17B7CE;
    --ak-accent-2: #26C7DD;
    --ak-accent-soft: rgba(23, 183, 206, 0.10);
    --ak-accent-border: rgba(23, 183, 206, 0.30);

    /* Semantic (real alerts only) */
    --ak-danger: #E14846;
    --ak-danger-2: #EF5B59;
    --ak-danger-soft: rgba(225, 72, 70, 0.10);
    --ak-warn: #F59E0B;
    --ak-warn-soft: rgba(245, 158, 11, 0.12);
    --ak-info: #17B7CE;
    --ak-info-soft: rgba(23, 183, 206, 0.10);
    --ak-success: #16A34A;
    --ak-success-soft: rgba(22, 163, 74, 0.10);

    /* Neutrals (navy-tinted, not pure grey) */
    --ak-bg: #F7F9FC;
    --ak-bg-2: #EEF2F8;
    --ak-surface: #FFFFFF;
    --ak-surface-2: #FAFBFD;
    --ak-surface-3: #EEF2F8;
    --ak-border: #E1E6EE;
    --ak-border-soft: #EAEEF5;
    --ak-border-strong: #C5CDDA;
    --ak-text: #0F1B33;
    --ak-text-muted: #5B6B85;
    --ak-text-soft: #8A97AC;

    /* Shadows (navy-tinted, not pure grey) */
    --ak-shadow-xs: 0 1px 2px rgba(23, 51, 94, 0.04);
    --ak-shadow-sm: 0 1px 2px rgba(23, 51, 94, 0.04), 0 1px 3px rgba(23, 51, 94, 0.04);
    --ak-shadow: 0 2px 4px rgba(23, 51, 94, 0.05), 0 4px 12px rgba(23, 51, 94, 0.06);
    --ak-shadow-lg: 0 6px 12px -3px rgba(23, 51, 94, 0.07), 0 10px 30px -8px rgba(23, 51, 94, 0.12);
    --ak-shadow-xl: 0 20px 40px -12px rgba(23, 51, 94, 0.20);

    /* Layout */
    --ak-sidebar-w: 260px;
    --ak-header-h: 64px;
    --ak-content-max: 1360px;
    --ak-page-pad: 32px;

    /* Radii */
    --ak-r-xs: 6px;
    --ak-r-sm: 8px;
    --ak-r: 10px;
    --ak-r-lg: 14px;
    --ak-r-xl: 20px;
    --ak-r-pill: 999px;

    /* Font */
    --ak-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ak-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Motion */
    --ak-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ===== Reset ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: var(--ak-font);
    color: var(--ak-text);
    background: var(--ak-bg);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
}
a { color: var(--ak-accent); text-decoration: none; transition: color 0.12s var(--ak-ease); }
a:hover { color: var(--ak-accent-2); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

h1, h2, h3, h4, h5 { color: var(--ak-text); margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; }
h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-size: 16px; line-height: 1.35; letter-spacing: -0.01em; }
h4 { font-size: 14px; line-height: 1.4; }
p { margin: 0; }

input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ===== Splash ============================================================ */
.ak-splash {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 100vh;
    padding: 0 24px;
    text-align: center;
    background:
        radial-gradient(1200px 600px at 50% -20%, rgba(23,183,206,0.10), transparent 60%),
        radial-gradient(800px 400px at 50% 120%, rgba(23,51,94,0.08), transparent 60%),
        #F7F9FC;
    color: #0F1B33;
    font-family: 'Inter', -apple-system, sans-serif;
    animation: splash-fade 0.4s ease both;
}
@keyframes splash-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.ak-splash-brand {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px;
    animation: splash-rise 0.6s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.ak-splash-logo {
    height: 72px; width: auto;
    animation: splash-breathe 2.6s ease-in-out infinite;
}
.ak-splash-wordmark {
    font-size: 26px; font-weight: 700;
    letter-spacing: -0.03em;
    color: #17335E;
}
.ak-splash-tag {
    font-size: 14.5px;
    color: rgba(15,27,51,0.60);
    margin-bottom: 40px;
    animation: splash-rise 0.6s 0.1s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.ak-splash-bar {
    position: relative;
    width: min(280px, 80vw); height: 3px;
    background: rgba(23,51,94,0.08);
    border-radius: 999px;
    overflow: hidden;
    animation: splash-rise 0.6s 0.15s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.ak-splash-fill {
    position: absolute; top: 0; left: 0;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, #17335E, #17B7CE, transparent);
    border-radius: 999px;
    animation: splash-slide 1.6s linear infinite;
}
@keyframes splash-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}
.ak-splash-hint {
    margin-top: 18px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 11px;
    color: rgba(15,27,51,0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: splash-rise 0.6s 0.2s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes splash-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes splash-breathe {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.04); }
}

/* Back-compat aliases (old classes still used elsewhere) */
.ak-boot { display: none; }

/* ===== Layout ============================================================ */
.ak-layout {
    display: grid;
    grid-template-columns: var(--ak-sidebar-w) 1fr;
    min-height: 100vh;
}

/* Sidebar - light theme */
.ak-sidebar {
    background: var(--ak-surface);
    color: var(--ak-text-muted);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--ak-border);
    padding: 22px 14px 14px 14px;
}
.ak-sidebar::-webkit-scrollbar { width: 5px; }
.ak-sidebar::-webkit-scrollbar-thumb { background: var(--ak-border); border-radius: 4px; }

.ak-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 0 10px 24px 10px;
    color: var(--ak-text); font-weight: 700; font-size: 18px;
    letter-spacing: -0.03em;
}
.ak-brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #17335E 0%, #17B7CE 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.5);
    color: white;
}
.ak-brand-mark svg { width: 17px; height: 17px; }

.ak-nav {
    display: flex; flex-direction: column; gap: 1px; flex: 1;
}
.ak-nav-group-label {
    text-transform: uppercase; font-size: 10.5px;
    color: var(--ak-text-soft); letter-spacing: 0.1em;
    padding: 18px 12px 6px 12px; font-weight: 600;
}
.ak-nav a, .ak-nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 12px; border-radius: 8px;
    color: var(--ak-text-muted); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.14s var(--ak-ease);
    position: relative;
}
.ak-nav a:hover {
    background: var(--ak-surface-3); color: var(--ak-text); text-decoration: none;
}
.ak-nav a.active {
    background: var(--ak-accent-soft); color: var(--ak-accent);
}
.ak-nav a.active::before {
    content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px;
    width: 3px; background: var(--ak-accent);
    border-radius: 0 3px 3px 0;
}
.ak-nav a.active .ak-nav-ico { color: var(--ak-accent); opacity: 1; }
.ak-nav-ico { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.9; }
.ak-nav-count {
    margin-left: auto; background: var(--ak-surface-3);
    color: var(--ak-text-muted); padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.ak-nav-count.hot { background: var(--ak-danger); color: white; }

.ak-trust {
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    background: var(--ak-surface-2);
    border: 1px solid var(--ak-border-soft);
    color: var(--ak-text-muted); font-size: 12px;
    line-height: 1.55;
}
.ak-trust-title {
    color: var(--ak-text); font-weight: 600; margin-bottom: 4px; font-size: 12.5px;
    display: flex; align-items: center; gap: 6px;
}
.ak-trust-icon { width: 13px; height: 13px; color: var(--ak-success); }

/* Main */
.ak-main {
    display: flex; flex-direction: column;
    min-width: 0; background: var(--ak-bg);
}
.ak-header {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--ak-header-h); padding: 0 var(--ak-page-pad);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--ak-border);
    position: sticky; top: 0; z-index: 10;
}
.ak-header-title { font-size: 15px; font-weight: 600; color: var(--ak-text); letter-spacing: -0.01em; }
.ak-header-actions { display: flex; align-items: center; gap: 10px; }

.ak-header-icon-btn {
    width: 34px; height: 34px; border-radius: 8px;
    background: transparent; border: 1px solid transparent;
    color: var(--ak-text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.14s var(--ak-ease);
    position: relative;
}
.ak-header-icon-btn:hover { background: var(--ak-surface-3); color: var(--ak-text); }
.ak-header-icon-btn svg { width: 17px; height: 17px; }
.ak-header-icon-btn .dot {
    position: absolute; top: 7px; right: 7px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ak-danger); border: 2px solid white;
}

.ak-content {
    flex: 1; padding: 28px var(--ak-page-pad) 60px var(--ak-page-pad);
    max-width: var(--ak-content-max); width: 100%;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .ak-layout { grid-template-columns: 1fr; }
    .ak-sidebar { position: static; height: auto; max-height: none; padding: 12px; }
    .ak-content { padding: 20px 18px; }
    .ak-header { padding: 0 18px; }
    :root { --ak-page-pad: 18px; }
}

/* ===== Toolbar =========================================================== */
.ak-toolbar {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 28px; flex-wrap: wrap;
}
.ak-toolbar-title { margin-right: auto; }
.ak-toolbar-title .ak-toolbar-sub {
    color: var(--ak-text-muted); font-size: 14px; margin-top: 6px;
    max-width: 640px;
}

/* ===== Button ============================================================ */
.ak-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; min-height: 38px;
    border: 1px solid transparent; border-radius: 9px;
    font-size: 13.5px; font-weight: 500; line-height: 1;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: all 0.14s var(--ak-ease);
    letter-spacing: -0.005em;
}
.ak-btn:hover { text-decoration: none; }
.ak-btn:active { transform: translateY(0.5px); }
.ak-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ak-btn svg { width: 14px; height: 14px; }

.ak-btn-primary {
    background: var(--ak-primary); color: white;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ak-btn-primary:hover:not(:disabled) { background: var(--ak-primary-3); color: white; }

.ak-btn-accent {
    background: var(--ak-accent); color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255,255,255,0.16);
}
.ak-btn-accent:hover:not(:disabled) { background: #4338CA; color: white; }

.ak-btn-secondary {
    background: white; color: var(--ak-text);
    border-color: var(--ak-border);
    box-shadow: var(--ak-shadow-xs);
}
.ak-btn-secondary:hover:not(:disabled) { background: var(--ak-surface-2); border-color: var(--ak-border-strong); }

.ak-btn-danger { background: var(--ak-danger); color: white; box-shadow: 0 1px 2px rgba(225, 29, 72, 0.3); }
.ak-btn-danger:hover:not(:disabled) { background: #BE123C; color: white; }

.ak-btn-ghost { background: transparent; color: var(--ak-text-muted); }
.ak-btn-ghost:hover:not(:disabled) { background: var(--ak-surface-3); color: var(--ak-text); }

.ak-btn-sm { padding: 6px 11px; min-height: 30px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.ak-btn-sm svg { width: 13px; height: 13px; }
.ak-btn-lg { padding: 11px 20px; min-height: 44px; font-size: 15px; border-radius: 10px; }

/* ===== Card ============================================================== */
.ak-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-r-lg);
    box-shadow: var(--ak-shadow-xs);
    overflow: hidden;
    transition: border-color 0.15s var(--ak-ease), box-shadow 0.15s var(--ak-ease);
}
.ak-card-hover { cursor: pointer; }
.ak-card-hover:hover { box-shadow: var(--ak-shadow); border-color: var(--ak-border-strong); }

.ak-card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ak-border-soft);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.ak-card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ak-card-sub { color: var(--ak-text-muted); font-size: 12.5px; margin-top: 3px; }
.ak-card-body { padding: 22px; }
.ak-card-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--ak-border-soft);
    background: var(--ak-surface-2);
    color: var(--ak-text-muted); font-size: 12.5px;
}

/* ===== Stat ============================================================== */
.ak-stat {
    padding: 20px 22px;
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-r-lg);
    box-shadow: var(--ak-shadow-xs);
    position: relative;
    overflow: hidden;
    transition: all 0.16s var(--ak-ease);
}
.ak-stat:hover { box-shadow: var(--ak-shadow); border-color: var(--ak-border-strong); }
.ak-stat-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.ak-stat-label {
    font-size: 12.5px; color: var(--ak-text-muted); font-weight: 500;
    letter-spacing: -0.005em;
}
.ak-stat-ico {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ak-accent-soft); color: var(--ak-accent);
}
.ak-stat-ico svg { width: 16px; height: 16px; }
.ak-stat-ico.danger { background: var(--ak-danger-soft); color: var(--ak-danger); }
.ak-stat-ico.warn { background: var(--ak-warn-soft); color: var(--ak-warn); }
.ak-stat-ico.success { background: var(--ak-success-soft); color: var(--ak-success); }
.ak-stat-ico.info { background: var(--ak-info-soft); color: var(--ak-info); }

.ak-stat-value {
    font-size: 30px; font-weight: 700; letter-spacing: -0.035em;
    line-height: 1.05; color: var(--ak-text);
}
.ak-stat-value .muted-suffix {
    font-size: 15px; font-weight: 500; color: var(--ak-text-muted);
    margin-left: 2px;
}
.ak-stat-delta { font-size: 12.5px; color: var(--ak-text-muted); margin-top: 8px; }
.ak-stat-delta.up { color: var(--ak-success); }
.ak-stat-delta.down { color: var(--ak-danger); }

/* ===== Badge ============================================================= */
.ak-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: var(--ak-r-pill);
    font-size: 11.5px; font-weight: 500; line-height: 1.55;
    background: var(--ak-surface-3); color: var(--ak-text);
}
.ak-badge-danger { background: var(--ak-danger-soft); color: #9F1239; }
.ak-badge-warn { background: var(--ak-warn-soft); color: #C2410C; }
.ak-badge-info { background: var(--ak-info-soft); color: #075985; }
.ak-badge-success { background: var(--ak-success-soft); color: #065F46; }
.ak-badge-accent { background: var(--ak-accent-soft); color: var(--ak-accent); }
.ak-badge-dot::before {
    content: ""; width: 6px; height: 6px; border-radius: var(--ak-r-pill);
    background: currentColor; flex-shrink: 0;
}

/* ===== Field ============================================================= */
.ak-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.ak-field-label { font-size: 13px; font-weight: 500; color: var(--ak-text); }
.ak-field-hint { font-size: 12px; color: var(--ak-text-muted); line-height: 1.5; }
.ak-field-error { font-size: 12px; color: var(--ak-danger); }
.ak-input, .ak-select, .ak-textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: 9px;
    font-size: 13.5px; color: var(--ak-text);
    transition: all 0.14s var(--ak-ease);
    box-shadow: var(--ak-shadow-xs);
}
.ak-input:focus, .ak-select:focus, .ak-textarea:focus {
    outline: none;
    border-color: var(--ak-accent);
    box-shadow: 0 0 0 3px var(--ak-accent-soft);
}
.ak-input::placeholder { color: var(--ak-text-soft); }
.ak-textarea { min-height: 90px; resize: vertical; }

/* ===== Empty ============================================================= */
.ak-empty {
    text-align: center; padding: 56px 24px;
    background: var(--ak-surface);
    border: 1px dashed var(--ak-border-strong);
    border-radius: var(--ak-r-lg);
    color: var(--ak-text-muted);
}
.ak-empty-ico {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--ak-accent-soft); color: var(--ak-accent);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.ak-empty-ico svg { width: 24px; height: 24px; }
.ak-empty-title { color: var(--ak-text); font-size: 16px; margin-bottom: 6px; font-weight: 600; }

/* ===== Table ============================================================= */
.ak-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ak-table th {
    text-align: left; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--ak-text-muted);
    font-weight: 600; padding: 11px 22px;
    background: var(--ak-surface-2);
    border-bottom: 1px solid var(--ak-border);
    position: sticky; top: 0;
}
.ak-table td {
    padding: 14px 22px;
    border-bottom: 1px solid var(--ak-border-soft);
    font-size: 13.5px;
    vertical-align: middle;
}
.ak-table tr:last-child td { border-bottom: 0; }
.ak-table tbody tr { transition: background 0.12s var(--ak-ease); }
.ak-table tbody tr:hover td { background: var(--ak-surface-2); }

/* ===== Skeleton ========================================================== */
.ak-skel {
    background: linear-gradient(90deg, var(--ak-border-soft) 0%, var(--ak-border) 50%, var(--ak-border-soft) 100%);
    background-size: 200% 100%;
    animation: ak-skel 1.4s infinite;
    border-radius: var(--ak-r-sm);
}
@keyframes ak-skel {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.ak-skel-line { height: 12px; margin-bottom: 8px; }
.ak-skel-box { height: 96px; }

/* ===== Grid ============================================================== */
.ak-grid { display: grid; gap: 20px; }
.ak-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ak-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ak-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ak-grid-cams { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ak-row { display: flex; align-items: center; gap: 10px; }
.ak-row-end { justify-content: flex-end; }
.ak-col { display: flex; flex-direction: column; gap: 10px; }
.ak-spacer { flex: 1; }

/* ===== Utility =========================================================== */
.ak-muted { color: var(--ak-text-muted); }
.ak-soft { color: var(--ak-text-soft); }
.ak-mono { font-family: var(--ak-font-mono); font-size: 12.5px; }
.ak-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ===== Toast ============================================================= */
.ak-toast-host {
    position: fixed; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 1000; max-width: 400px;
}
.ak-toast {
    padding: 12px 16px; border-radius: 10px;
    background: white; color: var(--ak-text);
    border: 1px solid var(--ak-border);
    box-shadow: var(--ak-shadow-xl);
    font-size: 13.5px;
    min-width: 260px;
    animation: ak-toast-in 0.24s var(--ak-ease);
    display: flex; align-items: flex-start; gap: 10px;
    border-left: 3px solid var(--ak-accent);
}
.ak-toast-success { border-left-color: var(--ak-success); }
.ak-toast-danger { border-left-color: var(--ak-danger); }
.ak-toast-warn { border-left-color: var(--ak-warn); }
.ak-toast-ico { flex-shrink: 0; width: 20px; height: 20px; }
.ak-toast-ico.success { color: var(--ak-success); }
.ak-toast-ico.danger { color: var(--ak-danger); }
.ak-toast-ico.warn { color: var(--ak-warn); }
.ak-toast-title { font-weight: 600; margin-bottom: 2px; }
.ak-toast-body { color: var(--ak-text-muted); font-size: 12.5px; }
@keyframes ak-toast-in {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Focus ============================================================= */
*:focus-visible {
    outline: 2px solid var(--ak-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Blazor error UI =================================================== */
#blazor-error-ui {
    background: var(--ak-danger); color: white;
    padding: 12px 20px; display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 2000; box-shadow: var(--ak-shadow-xl);
}
#blazor-error-ui .dismiss, #blazor-error-ui .reload {
    color: white; text-decoration: underline; cursor: pointer; margin-left: 12px;
}
.loading-progress, .loading-progress-text { display: none; }

/* ===== Modal ============================================================= */
.ak-modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(11, 18, 32, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: ak-fade 0.16s var(--ak-ease);
}
.ak-modal {
    background: var(--ak-surface); border-radius: var(--ak-r-xl);
    box-shadow: var(--ak-shadow-xl);
    max-width: 560px; width: 100%;
    max-height: calc(100vh - 40px); overflow: auto;
    animation: ak-modal-in 0.2s var(--ak-ease);
}
.ak-modal-head {
    padding: 22px 26px;
    border-bottom: 1px solid var(--ak-border-soft);
    display: flex; align-items: center; justify-content: space-between;
}
.ak-modal-body { padding: 24px 26px; }
.ak-modal-foot {
    padding: 16px 26px;
    border-top: 1px solid var(--ak-border-soft);
    display: flex; justify-content: flex-end; gap: 8px;
    background: var(--ak-surface-2);
}
@keyframes ak-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ak-modal-in {
    from { transform: scale(0.98) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== Live indicator chip ============================================== */
.ak-live-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--ak-r-pill);
    background: var(--ak-surface-2); border: 1px solid var(--ak-border);
    font-size: 11.5px; color: var(--ak-text-muted); font-weight: 500;
}

/* Blazor <FocusOnNavigate> focuses h1 after nav for a11y.
   Kill the visible outline; screen readers still get the announcement. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible {
    outline: none;
}

/* ===== Marketing section head (global) ================================== */
.seg-head-block {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--ak-border);
}
.seg-eyebrow {
    font-family: var(--ak-font-mono);
    font-size: 11.5px;
    color: var(--ak-text-soft);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: block;
}
.seg-heading {
    font-size: clamp(24px, 2.8vw, 32px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ak-primary);
    font-weight: 700;
    margin: 0 auto;
    max-width: 620px;
}
.seg-heading-mute {
    color: var(--ak-text-soft);
    font-weight: 500;
}
.seg-sub {
    font-size: 16px; line-height: 1.6;
    color: var(--ak-text-muted);
    margin: 24px auto 0;
    max-width: 560px;
}
@media (max-width: 900px) {
    .seg-head-block { margin-bottom: 32px; padding-bottom: 24px; }
}

/* ===== Marketing FAQ accordion (global so all pages can use) ============ */
.faq-list {
    max-width: 780px;
    margin: 0 auto;
    border-top: 1px solid var(--ak-border);
}
.faq-item {
    border-bottom: 1px solid var(--ak-border);
}
.faq-item summary {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 22px 4px;
    cursor: pointer;
    list-style: none;
    font-size: 16px; font-weight: 600;
    color: var(--ak-primary);
    letter-spacing: -0.01em;
    transition: color 0.15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--ak-accent); }
.faq-plus {
    position: relative;
    width: 20px; height: 20px;
    flex-shrink: 0;
}
.faq-plus::before,
.faq-plus::after {
    content: "";
    position: absolute;
    background: var(--ak-text-soft);
    transition: transform 0.2s ease;
}
.faq-plus::before { top: 9px; left: 2px; width: 16px; height: 2px; }
.faq-plus::after  { top: 2px; left: 9px; width: 2px; height: 16px; }
.faq-item[open] .faq-plus::after {
    transform: rotate(90deg);
    transform-origin: center;
}
.faq-body-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}
.faq-item[open] .faq-body-wrap { grid-template-rows: 1fr; }
.faq-body {
    overflow: hidden;
    padding: 0 4px 0;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ak-text-muted);
    max-width: 680px;
}
.faq-body a {
    color: var(--ak-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.faq-item[open] .faq-body { padding-bottom: 24px; }
