/* Quantum Escalation Matrix – public + shared styles (CSP-safe: no inline styles, fonts self-hosted) */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }

@font-face { font-family: "Quantum Brand"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/saira-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Quantum Brand"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/saira-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
    --brand-font: "Quantum Brand", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    /* brand: taken from the logo tile */
    --brand: #e0101a;
    --brand-deep: #b30c14;
    --brand-soft: #fdecec;

    /* neutrals */
    --ink: #141a24;
    --ink-2: #1e2635;
    --ink-3: #2b3547;
    --text: #1a2230;
    --muted: #5b677a;
    --faint: #8892a3;
    --line: #e2e6ec;
    --line-strong: #cfd6e2;
    --paper: #f4f5f7;
    --card: #ffffff;
    --head: #f0f2f6;

    --link: #1d4f9f;
    --focus: #2f6fed;

    /* escalation scale: calm -> urgent */
    --l1-bg: #e4edfb; --l1-ink: #17448f;
    --l2-bg: #fdefcf; --l2-ink: #8a5300;
    --l3-bg: #fde4e4; --l3-ink: #b30c14;
    --ok-bg: #dcf3e6; --ok-ink: #11703f;

    --radius: 10px;
    font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Brand mark ---------- */
.brand-mark { display: block; flex: none; border-radius: 22%; }
.brand-mark-sm { width: 32px; height: 32px; }
.brand-mark-md { width: 44px; height: 44px; }
.brand-mark-lg { width: 64px; height: 64px; }

/* ---------- Public header ---------- */
.em-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 32px; min-height: 80px; color: #fff; background: var(--ink);
    border-bottom: 3px solid var(--brand);
}
.em-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.em-brand h1 { margin: 0; font-family: var(--brand-font); font-size: 27px; font-weight: 700; letter-spacing: .3px; line-height: 1.15; }
.em-brand p { margin: 2px 0 0; font-size: 13.5px; color: #aeb7c6; }
.em-public { display: flex; align-items: center; gap: 14px; }
.pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
    font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.pill svg { width: 17px; height: 17px; }
.pill .pill-info { display: none; }
.em-public small { font-size: 12.5px; color: #aeb7c6; }
.em-header-link {
    color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
}
.em-header-link:hover { background: rgba(255,255,255,.1); }

/* ---------- Main + toolbar ---------- */
.em-main { width: 100%; max-width: none; margin: 0; padding: 24px 32px 40px; }
.em-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.field {
    position: relative; display: flex; align-items: center; height: 44px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
}
.field > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.field input, .field select {
    width: 100%; height: 100%; border: 0; background: transparent; font: inherit; font-size: 14.5px;
    color: var(--text); padding: 0 14px 0 42px; border-radius: 8px; outline-offset: -2px;
}
.field input::placeholder { color: var(--faint); }
.field-search { flex: 1 1 auto; }
.field-select { flex: 0 0 320px; }
.field select { appearance: none; -webkit-appearance: none; font-weight: 500; cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%235b677a' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47,111,237,.16); }
.btn-clear {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--text); border-radius: 8px;
    font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
}
.btn-clear svg { width: 18px; height: 18px; color: var(--muted); }
.btn-clear:hover { background: var(--head); }

.em-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.em-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.em-legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Table ---------- */
.em-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.em-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.em-table { width: 100%; min-width: 960px; border-collapse: collapse; table-layout: fixed; }
.em-table th.col-dept { width: 22%; }
.em-table thead th {
    background: var(--head); color: var(--text); text-align: left; font-size: 13.5px; font-weight: 600;
    padding: 0 18px; height: 52px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.em-table thead th .lvl-badge { margin-right: 10px; vertical-align: middle; }
.sort-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sort-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.sort-btn svg { width: 12px; height: 12px; opacity: .55; }
.em-table tbody tr { border-top: 1px solid var(--line); background: #fff; }
.em-table tbody tr:first-child { border-top: 0; }
.em-table tbody tr.alt { background: #f1f5fb; }          /* alternate row colour (class set by escalation-matrix.js, so filtering/sorting keeps the pattern) */
.em-table tbody tr:hover, .em-table tbody tr.alt:hover { background: #e6edf8; }
.em-table tbody tr[hidden] { display: none; }
.em-table tbody th, .em-table tbody td { padding: 14px 18px; text-align: left; vertical-align: top; font-weight: 400; }
.em-table tbody th { border-right: 1px solid var(--line); }

.dept { display: flex; align-items: center; gap: 14px; }
.dept-name { font-weight: 600; font-size: 15px; }
.dept-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; flex: none; background: #eceff4; color: var(--ink-3); }
.dept-ico svg { width: 22px; height: 22px; }

/* level badges */
.lvl-badge {
    display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px;
    border-radius: 6px; font-weight: 700; font-size: 12.5px; flex: none;
}
.lvl-1 { background: var(--l1-bg); color: var(--l1-ink); }
.lvl-2 { background: var(--l2-bg); color: var(--l2-ink); }
.lvl-3 { background: var(--l3-bg); color: var(--l3-ink); }

/* contact cell */
.cell { display: block; }
.contacts { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.contact + .contact { padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.c-head { display: flex; align-items: center; flex-wrap: nowrap; justify-content: space-between; gap: 6px 10px; margin-bottom: 4px; }
.c-name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; min-width: 0; }
.role-badge { font-size: 11.5px; font-weight: 600; padding: 1px 9px; border-radius: 999px; margin-left: auto; flex: none; white-space: nowrap; }
.role-primary { background: var(--ok-bg); color: var(--ok-ink); }
.role-backup  { background: #e8ecf3; color: #475569; }
.c-line { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.c-line .ico { width: 15px; height: 15px; }
.ico-phone, .ico-mail { color: var(--faint); }
.c-link { color: var(--link); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.c-link:hover { text-decoration: underline; }
.wa { display: inline-grid; place-items: center; width: 22px; height: 22px; color: #1fa855; border-radius: 50%; }
.wa .ico { width: 19px; height: 19px; }
.wa:hover { color: #127a3c; }
.c-note { font-size: 12.5px; color: var(--muted); font-style: italic; margin-bottom: 2px; }
.is-unavailable .c-name { color: var(--muted); }

.cell-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 0; }
.cell-empty .dash { color: var(--faint); font-weight: 600; line-height: 1; }
.not-assigned { color: var(--faint); font-size: 13.5px; }

.em-empty td, .em-none { text-align: center !important; color: var(--muted); padding: 40px 16px !important; font-size: 15px; }
.em-alert { margin: 28px auto; max-width: 560px; padding: 18px 22px; border-radius: 10px; background: #fff4e5; border: 1px solid #f2c88f; color: #7a4400; text-align: center; }


/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .field-select { flex-basis: 240px; } }
@media (max-width: 820px) {
    .em-header { padding: 14px 16px; flex-wrap: wrap; }
    .em-brand h1 { font-size: 22px; }
    .em-brand p { font-size: 13px; }
    .brand-mark-md { width: 38px; height: 38px; }
    .em-main { padding: 16px 14px 28px; }
    .em-toolbar { flex-wrap: wrap; }
    .field-search { flex: 1 1 100%; }
    .field-select { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 480px) {
    .em-public small { display: none; }
    .field-select { flex: 1 1 100%; }
    .btn-clear { width: 100%; justify-content: center; }
}
/* ---------- Phone-friendly view: each department becomes a card, levels stack, big tap targets ---------- */
@media (max-width: 720px) {
    body { font-size: 15px; }
    .em-header { padding: 12px 14px; }
    .em-public { gap: 8px; }
    .pill { padding: 5px 11px; font-size: 12.5px; }
    .em-main { padding: 12px 12px 28px; }
    .em-toolbar { gap: 8px; }
    .field, .btn-clear { height: 48px; }
    .field-search { flex: 1 1 100%; }
    .field-select { flex: 1 1 0; min-width: 0; }
    .field input, .field select { font-size: 16px; }              /* 16px stops iOS zooming on focus */
    .btn-clear { flex: 0 0 48px; width: 48px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
    .btn-clear svg { width: 20px; height: 20px; }
    .em-meta { margin-bottom: 8px; }

    .em-card { border: 0; background: transparent; overflow: visible; }
    .em-scroll { overflow: visible; }
    .em-table, .em-table tbody { display: block; width: 100%; min-width: 0; }
    .em-table thead { display: none; }
    .em-table tbody tr { display: block; margin: 0 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(20,26,36,.06); }
    .em-table tbody tr:hover, .em-table tbody tr.alt { background: #fff; }
    .em-table tbody th.col-dept { display: block; width: auto; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--head); }
    .dept-name { font-size: 16px; }
    .em-table tbody td { display: block; padding: 12px 14px 14px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
    .em-table tbody th + td { border-top: 0; }
    .em-table tbody td.cell-1 { border-left-color: var(--l1-ink); }
    .em-table tbody td.cell-2 { border-left-color: var(--l2-ink); }
    .em-table tbody td.cell-3 { border-left-color: var(--l3-ink); }
    .em-table tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
    .em-table tbody td.cell-1::before { color: var(--l1-ink); }
    .em-table tbody td.cell-2::before { color: var(--l2-ink); }
    .em-table tbody td.cell-3::before { color: var(--l3-ink); }
    .cell-empty { flex-direction: row; align-items: center; gap: 8px; padding: 0; }
    .c-name { font-size: 16px; }
    .c-line { margin-top: 6px; gap: 10px; min-height: 40px; }
    .c-line .ico { width: 18px; height: 18px; }
    .c-link { font-size: 15.5px; padding: 8px 0; }
    .wa { width: 40px; height: 40px; background: #e8f7ee; margin-left: auto; }
    .wa .ico { width: 24px; height: 24px; }
    .em-table tbody tr.em-empty, .em-table tbody tr:not([data-dept]) { padding: 0; }
}
/* ---------- Fixed top: header + animation + filter stay put, only the matrix scrolls ---------- */
.em-top { position: sticky; top: 0; z-index: 50; background: var(--paper); box-shadow: 0 2px 10px rgba(20,26,36,.18); }
.em-top .em-toolbar { margin: 0; padding: 10px 32px; background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.em-main { padding-top: 16px; }
@media (max-width: 720px) {
    .em-top .em-toolbar { padding: 8px 12px; gap: 6px; }
    .em-top .field, .em-top .btn-clear { height: 42px; }
    .em-top .em-brand p { display: none; }
    .em-top .em-header { min-height: 0; padding: 8px 12px; flex-wrap: nowrap; }
    .em-top .em-brand { gap: 10px; }
    .em-top .em-brand h1 { font-size: 18px; }
    .em-top .brand-mark-md { width: 32px; height: 32px; }
    .em-top .em-public small { display: none; }
    .em-top .em-hero { height: 92px; }
    .em-main { padding-top: 10px; }
}
@media print { .em-top { position: static; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
    body { background: #fff; }
    .em-header { background: #fff; color: #000; border-bottom: 2px solid #000; }
    .em-brand p, .em-public { display: none; }
    .em-toolbar, .em-meta { display: none; }
    .em-scroll { overflow: visible; } .em-table { min-width: 0; }
    .em-card { border: 0; }
}

/* ---------- Shared buttons ---------- */
.btn-primary, .btn-ghost, .btn-sm { font: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { height: 42px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14.5px; }
.btn-primary:hover { background: var(--ink-3); }
.btn-primary svg, .btn-ghost svg, .btn-sm svg { width: 16px; height: 16px; }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-ghost { height: 42px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); font-weight: 500; font-size: 14.5px; }
.btn-ghost:hover { background: var(--head); }

/* ---------- Sign out (public header, admin view) ---------- */
.logout-form { margin: 0; }
.logout-btn { all: unset; cursor: pointer; font-size: 13.5px; color: #fff; padding: 6px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; }
.logout-btn:hover { background: rgba(255,255,255,.1); }
.logout-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Admin sign-in (split layout) ---------- */
.login-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.login-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 56px; color: #fff; background: var(--ink);
}
.login-aside::before {
    content: ""; position: absolute; right: -140px; bottom: -90px; width: 720px; height: 720px; pointer-events: none;
    background: url("/assets/img/mark-ghost.svg") no-repeat center / contain;
    animation: lg-float 14s ease-in-out infinite;
}
.login-aside::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--brand);
    transform-origin: left center; animation: lg-line 1.1s .3s cubic-bezier(.2,.8,.2,1) both;
}
.login-aside > .login-lockup, .login-aside > .login-pitch, .login-aside > small { position: relative; z-index: 1; }
.login-lockup { display: flex; align-items: center; gap: 16px; }
.login-lockup b { display: block; font-family: var(--brand-font); font-size: 24px; font-weight: 700; letter-spacing: .3px; line-height: 1.15; }
.login-lockup span { font-size: 13.5px; color: #aeb7c6; }
.login-pitch { max-width: 440px; }
.login-pitch h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.3px; }
.login-pitch p { margin: 0; color: #c3cbd8; font-size: 16px; line-height: 1.6; }
.login-aside small { color: #8f99ab; font-size: 12.5px; }
.login-main { display: grid; place-items: center; padding: 32px 24px; }
.login-panel { width: 100%; max-width: 380px; }
.login-panel h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.2px; }
.login-panel > p { margin: 0 0 24px; color: var(--muted); }
.login-panel label { display: block; font-weight: 600; font-size: 13.5px; margin: 16px 0 6px; }
.login-panel input[type=text], .login-panel input[type=password] {
    width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 15px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text);
}
.login-panel input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47,111,237,.16); outline: none; }
.login-panel .btn-primary { width: 100%; height: 48px; margin-top: 24px; font-size: 15px; }
.login-error { margin: 0 0 4px; padding: 10px 14px; font-size: 14px; text-align: left; background: var(--brand-soft); border-color: #f4b8ba; color: var(--brand-deep); max-width: none; }
.login-panel .login-note { margin: 22px 0 0; font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.login-note svg { width: 14px; height: 14px; }
@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-aside { padding: 28px 24px; }
    .login-aside::before { width: 420px; height: 420px; right: -120px; bottom: -120px; }
    .login-pitch { display: none; }
    .login-aside small { display: none; }
}

/* ---------- Sign-in animation (CSS only: the page's CSP blocks scripts) ---------- */
.login-glow, .login-rings { position: absolute; pointer-events: none; z-index: 0; }
.login-glow { inset: -20%; background:
    radial-gradient(40% 40% at 25% 30%, rgba(47,111,237,.20), transparent 70%),
    radial-gradient(35% 35% at 80% 75%, rgba(224,16,26,.18), transparent 70%);
    animation: lg-drift 18s ease-in-out infinite alternate; }
.login-rings { right: 20%; bottom: 20%; width: 0; height: 0; }
.login-rings i { position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; border-radius: 50%;
    border: 1.5px solid rgba(224,16,26,.55); opacity: 0; animation: lg-ripple 7.5s cubic-bezier(.2,.6,.3,1) infinite; }
.login-rings i:nth-child(2) { animation-delay: 2.5s; border-color: rgba(240,170,40,.45); }
.login-rings i:nth-child(3) { animation-delay: 5s; border-color: rgba(47,111,237,.5); }

/* entrance: left panel */
.login-lockup { animation: lg-rise .7s .05s cubic-bezier(.2,.8,.2,1) both; }
.login-lockup .brand-mark, .login-lockup svg, .login-lockup img { animation: lg-pop .8s .15s cubic-bezier(.3,1.4,.5,1) both; }
.login-pitch h2 { animation: lg-rise .8s .25s cubic-bezier(.2,.8,.2,1) both; }
.login-pitch p  { animation: lg-rise .8s .4s cubic-bezier(.2,.8,.2,1) both; }
.login-aside small { animation: lg-fade 1s .8s both; }

/* entrance: form panel */
.login-panel h1 { animation: lg-rise .7s .2s cubic-bezier(.2,.8,.2,1) both; }
.login-panel > p { animation: lg-rise .7s .28s cubic-bezier(.2,.8,.2,1) both; }
.login-panel form > label:nth-of-type(1), .login-panel form > #username { animation: lg-rise .7s .38s cubic-bezier(.2,.8,.2,1) both; }
.login-panel form > label:nth-of-type(2), .login-panel form > #password { animation: lg-rise .7s .48s cubic-bezier(.2,.8,.2,1) both; }
.login-panel .btn-primary { animation: lg-rise .7s .58s cubic-bezier(.2,.8,.2,1) both; }
.login-panel .login-note { animation: lg-fade 1s .8s both; }
.login-error { animation: lg-shake .5s .1s both; }

/* interaction */
.login-panel input { transition: border-color .2s, box-shadow .2s, transform .2s; }
.login-panel input:focus { transform: translateY(-1px); }
.login-panel .btn-primary { position: relative; overflow: hidden; transition: background .2s, transform .15s, box-shadow .2s; }
.login-panel .btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transition: left .6s ease; }
.login-panel .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(20,26,36,.22); }
.login-panel .btn-primary:hover::after { left: 120%; }
.login-panel .btn-primary:active { transform: translateY(0); box-shadow: none; }
.login-note svg { animation: lg-lock 3.5s 1.5s ease-in-out infinite; transform-origin: center; }

@keyframes lg-rise  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lg-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-pop   { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes lg-line  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lg-float { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-24px,-18px) rotate(2.5deg); } }
@keyframes lg-drift { from { transform: translate(-3%,-2%) scale(1); } to { transform: translate(4%,3%) scale(1.12); } }
@keyframes lg-ripple { 0% { transform: scale(.3); opacity: 0; } 12% { opacity: .9; } 100% { transform: scale(5); opacity: 0; } }
@keyframes lg-shake { 0%,100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes lg-lock  { 0%,88%,100% { transform: none; } 92% { transform: rotate(-12deg); } 96% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: reduce) {
    .login-split *, .login-split *::before, .login-split *::after { animation: none !important; transition: none !important; }
}

/* ---------- Installer (centered card on dark) ---------- */
.login-body { background: var(--ink); min-height: 100vh; }
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 30px 28px 24px; border-top: 3px solid var(--brand); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .brand-mark { margin: 0 auto 12px; }
.login-brand h1 { margin: 0; font-family: var(--brand-font); font-size: 26px; font-weight: 700; letter-spacing: .3px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); }
.login-card label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; }
.login-card input[type=text], .login-card input[type=password] {
    width: 100%; height: 44px; padding: 0 14px; font: inherit; font-size: 15px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text);
}
.login-card input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47,111,237,.16); outline: none; }
.login-card .btn-primary { width: 100%; margin-top: 20px; }
.setup-card { max-width: 460px; }
.setup-ok { background: #eafaf1; border: 1px solid #b7e8cc; color: #0f6b3b; padding: 14px 16px; border-radius: 10px; font-size: 14px; }
.setup-ok ul, .setup-log { margin: 8px 0; padding-left: 18px; }
.setup-log { font-size: 13px; color: var(--muted); }
.btn-link { display: grid; place-items: center; text-decoration: none; margin-top: 16px; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: .92em; }
