/* ==========================================================================
   Helpdesk — customer portal and staff desk
   1 Tokens · 2 Base · 3 Controls · 4 Shared components · 5 Conversation
   6 Portal (public) · 7 Staff desk shell · 8 Staff pages · 9 Chart
   10 Responsive
   ========================================================================== */

/* 1 ── Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Surfaces and text */
    --navy: #12344D;
    --navy-2: #1B4563;
    --navy-3: #0D2638;
    --ink: #183247;
    --ink-2: #475867;
    --muted: #5C6F82;
    --line: #CFD7DF;
    --line-soft: #E3E8EE;
    --bg: #F5F7F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFB;

    /* Interactive */
    --link: #2C5CC5;
    --link-dark: #1F4AA8;
    --link-tint: #E5F0FD;
    --focus: #2C5CC5;

    /* Modules */
    --support: #2C5CC5;
    --abuse: #C2264B;
    --abuse-dark: #A81D3E;
    --abuse-tint: #FCE9EE;

    /* Status tones: text on tint */
    --info: #1F4AA8;
    --info-tint: #E5F0FD;
    --ok: #00694F;
    --ok-tint: #DFF5EE;
    --warn: #8A5300;
    --warn-tint: #FEF0D9;
    --bad: #B5121B;
    --bad-tint: #FFE9EB;
    --neutral: #475867;
    --neutral-tint: #EBEFF3;
    --note-tint: #FFF6E3;
    --note-line: #F0D9A4;

    /* Priority marks */
    --prio-low: #5BA745;
    --prio-normal: #4D9DE8;
    --prio-high: #F0A400;
    --prio-urgent: #E5383B;

    /* Shape, depth, motion */
    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --shadow-1: 0 1px 2px rgba(18, 52, 77, .08);
    --shadow-2: 0 4px 14px rgba(18, 52, 77, .10);
    --shadow-3: 0 12px 32px rgba(18, 52, 77, .16);
    --ease: 160ms ease-out;

    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

    --rail: 64px;
    --topbar: 56px;
}

/* 2 ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--navy); line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 12px; }

a { color: var(--link); text-underline-offset: 3px; transition: color var(--ease); }
a:hover { color: var(--link-dark); }

code, pre, .ref, .input--mono { font-family: var(--mono); }
code { font-size: 13px; word-break: break-all; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ref { font-size: .9em; font-weight: 600; color: var(--muted); white-space: nowrap; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--navy); color: #fff; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: 1360px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.container--narrow { max-width: 980px; }
.container--slim { max-width: 480px; }

/* 3 ── Controls ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--r-sm);
    font: 600 14px/1.3 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}
.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn--primary:active { background: var(--navy-3); }
.btn--secondary { background: var(--surface); border-color: var(--line); color: var(--navy); box-shadow: var(--shadow-1); }
.btn--secondary:hover { background: var(--surface-2); border-color: #A9B8C6; color: var(--navy); }
.btn--secondary:active { background: var(--neutral-tint); }
.btn--ghost { background: transparent; color: var(--link); }
.btn--ghost:hover { background: var(--link-tint); color: var(--link-dark); }
.btn--danger { background: var(--surface); border-color: var(--line); color: var(--bad); box-shadow: var(--shadow-1); }
.btn--danger:hover { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); }
.btn--sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn--lg { min-height: 46px; padding: 12px 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.is-busy::before {
    content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { margin-bottom: 18px; min-width: 0; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.field__required { margin-left: 3px; color: var(--bad); font-weight: 700; }
.field__optional { margin-left: 4px; font-weight: 400; color: var(--muted); }
.field__hint { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.field__error { display: flex; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--bad); }
.field__error::before { content: "!"; display: grid; place-items: center; flex: none; width: 16px; height: 16px; margin-top: 2px; background: var(--bad); border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; }

.input {
    display: block; width: 100%; min-height: 40px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
    color: var(--ink); font: 400 15px/1.5 var(--font);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.input:hover { border-color: #A9B8C6; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(44, 92, 197, .18); }
.input::placeholder { color: #7B8B9A; }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
textarea.input { resize: vertical; min-height: 96px; }
select.input { padding-right: 30px; cursor: pointer; }
.input--mono { font-size: 13.5px; }
.input--file { padding: 7px 8px; font-size: 13px; cursor: pointer; }
.has-error .input { border-color: var(--bad); }
.has-error .input:focus { box-shadow: 0 0 0 3px rgba(181, 18, 27, .16); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--link); flex: none; cursor: pointer; }

.pw { position: relative; }
.pw .input { padding-right: 64px; }
.pw__toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 10px; background: none; border: 0; border-radius: 4px; color: var(--link); font: 600 13px var(--font); cursor: pointer; }
.pw__toggle:hover { background: var(--link-tint); }

/* Honeypot field: off-screen for people, visible to form-filling bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.form__group { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.form__group legend {
    display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 16px; padding: 0;
    font-size: 15px; font-weight: 700; color: var(--navy);
}
.form__group legend::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.form--narrow { max-width: 580px; }
.form--tight .field { margin-bottom: 14px; }

/* 4 ── Shared components ──────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 22px; }
.card + .card { margin-top: 16px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.card__title { margin-bottom: 14px; font-size: 15px; }
.card__head .card__title { margin-bottom: 0; }
.card__sub { margin: -8px 0 12px; font-size: 13px; color: var(--muted); }
.card__subtitle { margin: 20px 0 10px; font-size: 13px; color: var(--ink-2); }
.card__foot { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 600; }

.alert { display: block; margin: 0 0 16px; padding: 12px 16px; border: 1px solid; border-left-width: 4px; border-radius: var(--r-sm); font-size: 14px; }
.alert--ok { background: var(--ok-tint); border-color: #8FD4BF; color: #004D3A; }
.alert--bad { background: var(--bad-tint); border-color: #F3A9AD; color: #8A0E15; }
.alert--info { background: var(--info-tint); border-color: #A9C8F3; color: #163A85; }
.error-summary ul { margin: 6px 0 0; padding-left: 18px; }
.error-summary a { color: inherit; font-weight: 600; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--info { background: var(--info-tint); color: var(--info); }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--bad { background: var(--bad-tint); color: var(--bad); }
.badge--neutral { background: var(--neutral-tint); color: var(--neutral); }
.badge--plain::before { display: none; }

/* Small tags above a ticket's subject */
.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.6; white-space: nowrap; }
.pill--new { background: var(--ok-tint); color: var(--ok); }
.pill--responded { background: #F5E9FB; color: #8A3FB0; }
.pill--spam { background: var(--bad-tint); color: var(--bad); }
.pill--module { background: var(--neutral-tint); color: var(--neutral); }
.pill--abuse { background: var(--abuse-tint); color: var(--abuse-dark); }

.prio { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.prio__mark { width: 10px; height: 10px; border-radius: 2px; background: var(--prio-normal); }
.prio--low .prio__mark { background: var(--prio-low); }
.prio--high .prio__mark { background: var(--prio-high); }
.prio--urgent .prio__mark { background: var(--prio-urgent); }
.prio--urgent { font-weight: 700; }

.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--1 { background: #DCEBFD; color: #1F4AA8; }
.avatar--2 { background: #DFF5EE; color: #00694F; }
.avatar--3 { background: #FEF0D9; color: #8A5300; }
.avatar--4 { background: #F5E9FB; color: #8A3FB0; }
.avatar--5 { background: #FFE9EB; color: #B5121B; }
.avatar--6 { background: #E3EEF2; color: #12546B; }
.avatar--staff { background: var(--navy); color: #fff; }

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dot--support { background: var(--support); }
.dot--abuse, .dot--notice { background: var(--abuse); }

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.facts--stack { flex-direction: column; gap: 12px; }
.facts--wide { margin-bottom: 16px; }
.facts--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 24px; }

/* Spam score and the reasons behind it */
.score { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.score__bar { width: 72px; height: 6px; background: var(--neutral-tint); border-radius: 3px; }
.score--ok .score__fill { fill: var(--ok); }
.score--warn .score__fill { fill: var(--prio-high); }
.score--bad .score__fill { fill: var(--prio-urgent); }
.score--bad { color: var(--bad); }
.screening { margin-top: 14px; font-size: 13px; }
.screening summary { color: var(--link); font-weight: 600; cursor: pointer; }
.screening__list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.screening__list li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.screening__points { padding: 0 6px; border-radius: 4px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.screening__points--plus { background: var(--warn-tint); color: var(--warn); }
.screening__points--minus { background: var(--ok-tint); color: var(--ok); }
.screening__none { margin: 10px 0 0; color: var(--ink-2); }
.screening__note { margin: 10px 0 0; color: var(--muted); }
.resources li .badge { margin-left: auto; }
.others--inline li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

.resources { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.resources li { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; }
.resources li + li { border-top: 1px solid var(--line-soft); }
.resources__kind { flex: none; width: 54px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.evidence {
    max-height: 320px; margin: 0; padding: 14px 16px; overflow: auto;
    background: var(--navy-3); border-radius: var(--r-sm); color: #D7E2EC; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}

.empty { margin: 0; color: var(--muted); font-size: 14px; }
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; background: var(--link-tint); border-radius: 50%; color: var(--link); }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { margin: 0; color: var(--muted); }

/* 5 ── Conversation ───────────────────────────────────────────────────── */
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; scroll-margin-top: 120px; }
.msg__bubble { padding: 12px 16px 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); }
.msg--staff .msg__bubble { background: #F3F8FF; border-color: #D5E4F8; }
.msg--note .msg__bubble { background: var(--note-tint); border-color: var(--note-line); }
.msg__head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-bottom: 6px; }
.msg__author { font-weight: 700; color: var(--navy); }
.msg__role { font-size: 12px; color: var(--muted); }
.msg__head .thread__meta { margin-left: auto; }
.msg__body { overflow-wrap: anywhere; }
.msg__note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--warn); }
.thread__meta { font-size: 12px; color: var(--muted); }
.thread__event {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-left: 48px; padding-left: 12px;
    border-left: 2px solid var(--line); font-size: 13px; color: var(--ink-2); scroll-margin-top: 120px;
}
.files { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; font-size: 13px; }
.files li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.files a { font-weight: 600; text-decoration: none; }
.files a:hover { text-decoration: underline; }

/* 6 ── Portal (public) ────────────────────────────────────────────────── */
/* Navy, because the logo artwork is white. */
.portal-header { position: relative; z-index: 2; background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, .1); }
.portal-header__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo { display: block; flex: none; height: auto; max-width: 100%; }
.brand__sub { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .28); color: #C9D6E0; line-height: 1.2; white-space: nowrap; }

.portal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.portal-nav__link { padding: 8px 12px; border-radius: var(--r-sm); color: #D7E2EC; font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color var(--ease), color var(--ease); }
.portal-nav__link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.portal-nav__link.is-active { background: rgba(255, 255, 255, .16); color: #fff; }
.portal-nav .btn { margin-left: 8px; }
.portal-nav .btn--primary { background: #fff; border-color: #fff; color: var(--navy); }
.portal-nav .btn--primary:hover { background: #E6EDF3; border-color: #E6EDF3; color: var(--navy); }
.portal-header :focus-visible { outline-color: #fff; }
.portal-nav .usermenu summary:hover, .portal-nav .usermenu[open] summary { background: rgba(255, 255, 255, .12); }
.portal-nav .usermenu summary::after { border-color: #C9D6E0; }

.portal-footer { margin-top: 72px; padding: 22px 0 32px; border-top: 1px solid var(--line-soft); background: var(--surface); font-size: 13px; color: var(--muted); }
.portal-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.portal-footer a { color: var(--muted); }

.flash { margin-top: 20px; }
.flash .alert { margin-bottom: 0; }

/* Home */
.hero { padding: 64px 0 96px; background: var(--navy) radial-gradient(900px 320px at 50% 0, rgba(77, 157, 232, .28), transparent 70%); color: #fff; text-align: center; }
.hero__title { margin: 0 auto 10px; max-width: 16em; color: #fff; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.hero__lede { max-width: 640px; margin: 0 auto 28px; color: #C9D6E0; font-size: 16px; }

.lookup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; max-width: 920px; margin: 0 auto; padding: 8px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); text-align: left; }
.lookup__field { position: relative; }
.lookup__field label { position: absolute; left: 13px; top: 7px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.lookup__field .input { min-height: 54px; padding: 24px 12px 6px; border-color: transparent; background: var(--bg); }
.lookup__field .input:focus { background: var(--surface); border-color: var(--focus); }
.lookup .btn { min-height: 54px; padding-left: 22px; padding-right: 22px; }
.hero__hint { margin: 14px 0 0; font-size: 13px; color: #C9D6E0; }

.choices { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: -52px; }
.choice {
    display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 16px; padding: 24px;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
    color: var(--ink); text-decoration: none; cursor: pointer; transition: box-shadow var(--ease), border-color var(--ease);
}
.choice:hover { border-color: var(--link); box-shadow: var(--shadow-3); color: var(--ink); }
.choice__icon { grid-row: span 3; display: grid; place-items: center; width: 48px; height: 48px; background: var(--link-tint); border-radius: var(--r-lg); color: var(--link); }
.choice__title { font-size: 17px; font-weight: 700; color: var(--navy); }
.choice__text { color: var(--ink-2); font-size: 14px; }
.choice__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--link); font-size: 14px; font-weight: 700; }
.choice--abuse:hover { border-color: var(--abuse); }
.choice--abuse .choice__icon { background: var(--abuse-tint); color: var(--abuse); }
.choice--abuse .choice__go { color: var(--abuse-dark); }

.choice--kb:hover { border-color: var(--ok); }
.choice--kb .choice__icon { background: var(--ok-tint); color: var(--ok); }
.choice--kb .choice__go { color: var(--ok); }

.kb-popular { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.kb-popular__link { display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color var(--ease), box-shadow var(--ease); }
.kb-popular__link:hover { border-color: #A9C8F3; box-shadow: var(--shadow-2); color: var(--ink); }
.kb-popular__link strong { display: block; color: var(--navy); font-size: 15px; font-weight: 600; }
.kb-popular__link small { color: var(--muted); font-size: 13px; }
.kb-popular__icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; background: var(--link-tint); border-radius: var(--r-sm); color: var(--link); }

.section { padding-top: 56px; }
.section__title { margin-bottom: 20px; font-size: 20px; text-align: center; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how li { position: relative; padding: 20px 20px 20px 64px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); counter-increment: how; color: var(--ink-2); font-size: 14px; }
.how li::before { content: counter(how); position: absolute; left: 20px; top: 20px; display: grid; place-items: center; width: 30px; height: 30px; background: var(--navy); border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; }
.how strong { display: block; margin-bottom: 2px; color: var(--navy); font-size: 15px; }

.faq { max-width: 980px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-radius: var(--r); color: var(--navy); font-weight: 600; cursor: pointer; list-style: none; transition: background-color var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { background: var(--surface-2); }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); font-size: 14px; }

/* Knowledge base */
.hero--compact { padding: 44px 0 52px; }
.lookup--single { grid-template-columns: minmax(0, 1fr) auto; max-width: 760px; }
.hero__alt { margin: 16px 0 0; font-size: 14px; color: #C9D6E0; }
.hero__alt a { color: #fff; font-weight: 600; }
.section--tight { padding-top: 32px; }
.kb-searchbar { margin-bottom: 20px; }
.kb-searchbar .lookup { max-width: none; border: 1px solid var(--line-soft); box-shadow: var(--shadow-1); }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kb-grid .card + .card { margin-top: 0; }
.kb-cat__title { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 17px; }
.kb-cat__title a { color: var(--navy); text-decoration: none; }
.kb-cat__title a:hover { color: var(--link); }
.kb-cat__icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; background: var(--link-tint); border-radius: var(--r); color: var(--link); }
.kb-cat__text { margin-bottom: 4px; color: var(--ink-2); font-size: 14px; }
.kb-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.kb-links a { display: block; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; transition: background-color var(--ease), color var(--ease); }
.kb-links a:hover { background: var(--link-tint); color: var(--link-dark); }

.kb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kb-list .card + .card { margin-top: 0; }
.kb-item { padding: 18px 20px; transition: border-color var(--ease), box-shadow var(--ease); }
.kb-item:hover { border-color: #A9C8F3; box-shadow: var(--shadow-2); }
.kb-item__title { color: var(--navy); font-size: 16px; font-weight: 700; text-decoration: none; }
.kb-item__title:hover { color: var(--link); }
.kb-item__text { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.kb-item__meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.kb-article { padding: 32px; }
.kb-article h1 { font-size: 28px; letter-spacing: -0.02em; }
.kb-article__meta { margin: 6px 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* Rendered article text */
.prose { max-width: 72ch; font-size: 16px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 16px; }
.prose h2 { margin: 30px 0 10px; font-size: 20px; }
.prose h3 { margin: 24px 0 8px; font-size: 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose code { padding: 2px 6px; background: var(--neutral-tint); border-radius: 4px; font-size: .88em; }
.prose pre { margin: 0 0 16px; padding: 14px 16px; overflow-x: auto; background: var(--navy-3); border-radius: var(--r-sm); color: #D7E2EC; font-size: 13px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; color: inherit; word-break: normal; }
.prose blockquote { margin: 0 0 16px; padding: 12px 16px; background: var(--info-tint); border-left: 4px solid var(--link); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose blockquote p { margin: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 6px 0; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.prose__image { display: inline-block; max-width: 100%; cursor: zoom-in; }
.prose__image:hover img { border-color: #A9C8F3; box-shadow: var(--shadow-2); }

.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.feedback__title { font-size: 15px; }
.feedback__form { display: flex; gap: 8px; }
.feedback__thanks { display: flex; gap: 8px; margin: 0; color: var(--ink); font-weight: 600; }
.feedback__thanks .icon { margin-top: 3px; color: var(--ok); }
.aside__cta { margin-top: 12px; }

/* Article suggestions under the subject of a new ticket */
.suggest { margin: 10px 0 0; padding: 12px 14px; background: var(--info-tint); border: 1px solid #C5DAF6; border-radius: var(--r-sm); font-size: 14px; }
.suggest__title { margin: 0 0 6px; font-weight: 700; color: var(--navy); }
.suggest ul { margin: 0; padding-left: 18px; }
.suggest li { margin-bottom: 2px; }

/* Customer account */
.portal-nav .usermenu { margin-left: 6px; }
.portal-nav .usermenu summary { padding: 3px 6px 3px 3px; }
.alert__action { margin-top: 10px; }
.check-email__title { margin-bottom: 6px; font-size: 22px; }
.account-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.account-tabs { margin-bottom: 14px; }
.trow--customer { grid-template-columns: 40px minmax(0, 1fr) auto; }
.trow--customer .trow__meta { border-left: 0; padding-left: 0; }
.trow__kind { display: grid; place-items: center; width: 40px; height: 40px; background: var(--link-tint); border-radius: var(--r); color: var(--link); }
.trow__kind--abuse { background: var(--abuse-tint); color: var(--abuse); }

/* Inner pages */
.page { padding-top: 36px; }
.page__foot { margin: 20px 0 0; font-size: 13px; color: var(--muted); }
.page-intro { margin-bottom: 22px; }
.page-intro h1 { margin-bottom: 6px; font-size: 28px; letter-spacing: -0.02em; }
.page-intro p { max-width: 62ch; margin: 0; color: var(--ink-2); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--link); }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.form-layout .card { padding: 26px; }

.aside { position: sticky; top: 20px; display: grid; gap: 16px; font-size: 14px; }
.aside .card { padding: 20px; }
.aside .card + .card { margin-top: 0; }
.aside__title { margin: 0 0 12px; font-size: 14px; }
.aside__note { margin: 0; color: var(--ink-2); }
.aside .card--abuse-note { background: var(--abuse-tint); border-color: #F3C3CF; box-shadow: none; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; color: var(--ink-2); }
.steps li { position: relative; padding-left: 36px; counter-increment: step; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
    width: 24px; height: 24px; background: var(--navy); border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff;
}
.steps strong { color: var(--navy); }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); }
.ticks li { display: flex; gap: 10px; }
.ticks .icon { margin-top: 3px; color: var(--ok); }

/* A ticket as its requester sees it */
.ticket-head { padding: 0; overflow: hidden; }
.ticket-head__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; padding: 22px 24px; }
.ticket-head__label { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ticket-head__ref { margin: 0; font: 700 22px/1.3 var(--mono); color: var(--navy); }
.ticket-head__subject { margin-top: 8px; font-size: 20px; overflow-wrap: anywhere; }
.ticket-head__facts { padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--line-soft); }

.statusband { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-top: 1px solid var(--line-soft); }
.statusband__seal { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; }
.statusband__title { font-size: 22px; }
.statusband__text { margin: 2px 0 0; color: var(--ink-2); }
.statusband--info { background: linear-gradient(90deg, var(--info-tint), transparent 70%); }
.statusband--warn { background: linear-gradient(90deg, var(--warn-tint), transparent 70%); }
.statusband--ok { background: linear-gradient(90deg, var(--ok-tint), transparent 70%); }
.statusband--neutral { background: linear-gradient(90deg, var(--neutral-tint), transparent 70%); }
.statusband--info .statusband__seal { background: var(--surface); color: var(--info); box-shadow: inset 0 0 0 2px var(--info); }
.statusband--warn .statusband__seal { background: var(--surface); color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }
.statusband--ok .statusband__seal { background: var(--ok); color: #fff; }
.statusband--neutral .statusband__seal { background: var(--surface); color: var(--neutral); box-shadow: inset 0 0 0 2px var(--neutral); }

.progress { display: grid; grid-template-columns: 1fr 1fr auto; list-style: none; margin: 0; padding: 20px 24px 22px; border-top: 1px solid var(--line-soft); }
.progress__step { position: relative; padding: 24px 12px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.progress__step::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--line); }
.progress__step:last-child { padding-right: 0; }
.progress__step:last-child::before { display: none; }
.progress__dot { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 16px; height: 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 50%; color: #fff; }
.progress__dot .icon { display: none; }
.progress__step.is-done, .progress__step.is-current { color: var(--navy); }

/* Motion: stages appear in order, the finished part of the line draws itself,
   and the stage being worked on keeps a quiet pulse and a travelling highlight. */
.progress__step:nth-child(1) { --delay: 0ms; }
.progress__step:nth-child(2) { --delay: 450ms; }
.progress__step:nth-child(3) { --delay: 900ms; }
.progress__step::after { content: ""; position: absolute; top: 7px; left: 0; height: 2px; }
.progress__step:last-child::after { display: none; }
.progress__step.is-done::after { right: 0; background: var(--ok); transform-origin: left; animation: progress-fill 450ms ease-out calc(var(--delay) + 120ms) both; }
.progress__step.is-done .progress__dot, .progress__step.is-current .progress__dot { z-index: 1; animation: progress-pop 320ms cubic-bezier(.2, .9, .3, 1.4) var(--delay) both; }
.progress:not(.progress--finished) .progress__step.is-current .progress__dot { animation: progress-pop 320ms cubic-bezier(.2, .9, .3, 1.4) var(--delay) both, progress-pulse 1.9s ease-out calc(var(--delay) + 400ms) infinite; }
.progress:not(.progress--finished) .progress__step.is-current::after { width: 34%; background: linear-gradient(90deg, transparent, var(--link), transparent); opacity: 0; animation: progress-travel 2.4s ease-in-out calc(var(--delay) + 500ms) infinite; }
@keyframes progress-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes progress-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes progress-pulse { 0% { box-shadow: 0 0 0 0 rgba(44, 92, 197, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(44, 92, 197, 0); } }
@keyframes progress-travel { 0% { transform: translateX(0); opacity: 0; } 20%, 70% { opacity: 1; } 100% { transform: translateX(194%); opacity: 0; } }
.progress__step.is-done .progress__dot { background: var(--ok); border-color: var(--ok); }
.progress__step.is-done .progress__dot .icon { display: block; }
.progress__step.is-current .progress__dot { border-color: var(--link); box-shadow: 0 0 0 4px rgba(44, 92, 197, .18); }
.progress__step.is-current .progress__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--link); }
.progress--finished .progress__step.is-current .progress__dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px rgba(0, 105, 79, .16); }
.progress--finished .progress__step.is-current .progress__dot::after { display: none; }
.progress--finished .progress__step.is-current .progress__dot .icon { display: block; }

.progress--closed .progress__step.is-current .progress__dot { background: var(--neutral); border-color: var(--neutral); box-shadow: 0 0 0 4px rgba(71, 88, 103, .16); }

.progress--4 { grid-template-columns: 1fr 1fr 1fr auto; }
.progress__step:nth-child(4) { --delay: 1350ms; }
.statusband__due { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; font-weight: 700; color: var(--warn); }
.statusband__due.is-late { color: var(--bad); }
.statusband--bad { background: linear-gradient(90deg, var(--bad-tint), transparent 70%); }
.statusband--bad .statusband__seal { background: var(--surface); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }

/* The reported page: screenshot beside what we found */
.notice-intro { margin-bottom: 4px; color: var(--ink-2); }
.site { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.site summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; background: var(--surface-2); border-radius: var(--r); cursor: pointer; list-style: none; }
.site summary::-webkit-details-marker { display: none; }
.site summary::before { content: ""; flex: none; width: 8px; height: 8px; margin-right: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--ease); }
.site[open] summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--r) var(--r) 0 0; }
.site[open] summary::before { transform: rotate(45deg); }
.site__url { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--navy); }
.site__body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; padding: 16px; }
.site__shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.site__shot a { display: block; cursor: zoom-in; }
.site__noshot { display: grid; place-items: center; gap: 8px; min-height: 180px; margin: 0; padding: 20px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--muted); font-size: 13px; text-align: center; }
.site__facts { display: grid; gap: 10px; margin: 0; align-content: start; }
.site__facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.site__facts dt { font-weight: 700; color: var(--navy); }
.site__facts dd { margin: 0; overflow-wrap: anywhere; }
.site__state { display: block; font-size: 13px; color: var(--muted); }
.site-tools { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 12px 0 4px; }
.site-tools form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-tools .input { width: auto; min-height: 32px; max-width: 260px; }
.notify-btn { margin-top: 12px; }

.guidance p { margin-bottom: 10px; color: var(--ink-2); }
.guidance p:last-child { margin-bottom: 0; }
.guidance strong { color: var(--navy); }
.mistake { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.mistake > div { flex: 1 1 320px; }
.mistake .card__title { margin-bottom: 6px; }
.mistake p { margin: 0; color: var(--ink-2); font-size: 14px; }

.resolve { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-2); }

.error-page { padding: 80px 24px 40px; text-align: center; }
.error-page__code { display: inline-block; margin-bottom: 12px; padding: 2px 12px; background: var(--neutral-tint); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--neutral); }
.error-page h1 { margin-bottom: 10px; font-size: 30px; letter-spacing: -0.02em; }
.error-page p { max-width: 520px; margin-left: auto; margin-right: auto; color: var(--ink-2); }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.error-page .evidence { text-align: left; }

/* Staff sign-in */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth__side { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 48px; background: var(--navy) radial-gradient(700px 400px at 0 100%, rgba(77, 157, 232, .3), transparent 70%); color: #fff; }
.auth__pitch { max-width: 420px; }
.auth__pitch h2 { margin-bottom: 10px; color: #fff; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.auth__pitch p { margin: 0; color: #C9D6E0; }
.auth__main { display: grid; place-items: center; padding: 32px 24px; }
.auth__box { width: 100%; max-width: 380px; }
.auth__box > .brand { display: none; margin-bottom: 24px; padding: 12px 16px; background: var(--navy); border-radius: var(--r); }
.auth__title { margin-bottom: 4px; font-size: 24px; }
.auth__sub { margin-bottom: 22px; color: var(--muted); }
.auth__foot { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* 7 ── Staff desk shell ───────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100vh; padding: 10px 0; background: var(--navy); }
.rail__logo { display: grid; place-items: center; flex: none; width: 52px; height: 36px; margin-bottom: 14px; border-radius: var(--r); text-decoration: none; }
.rail__nav { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail__sep { flex: none; width: 28px; height: 1px; margin: 8px 0; background: rgba(255, 255, 255, .16); }
.rail__link { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r); color: #B6C6D3; text-decoration: none; transition: background-color var(--ease), color var(--ease); }
.rail__link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rail__link.is-active { background: rgba(255, 255, 255, .16); color: #fff; }
.rail__link.is-active::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; background: #fff; border-radius: 0 3px 3px 0; }
.rail__badge { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 5px; background: var(--prio-urgent); border: 2px solid var(--navy); border-radius: 999px; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 14px; text-align: center; }
.rail__badge--quiet { background: #5C7A93; }
.rail__label {
    position: absolute; left: calc(100% + 10px); top: 50%; z-index: 40; padding: 5px 10px; pointer-events: none;
    background: var(--navy-3); border-radius: var(--r-sm); box-shadow: var(--shadow-2); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap;
    opacity: 0; transform: translate(-4px, -50%); transition: opacity var(--ease), transform var(--ease);
}
.rail__link:hover .rail__label, .rail__link:focus-visible .rail__label { opacity: 1; transform: translate(0, -50%); }

.workspace { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: var(--topbar); padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.gsearch { display: flex; flex: 1; max-width: 520px; }
.gsearch__box { position: relative; flex: 1; min-width: 0; }
.gsearch__box .icon { position: absolute; left: 11px; top: 50%; z-index: 2; margin-top: -8px; color: var(--muted); pointer-events: none; }
.gsearch .input { min-height: 36px; padding: 6px 10px 6px 34px; font-size: 14px; }
.gsearch__box .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.gsearch select.input { width: auto; padding-left: 10px; margin-left: -1px; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.gsearch .input:focus { position: relative; z-index: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.usermenu { position: relative; }
.usermenu summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; font-weight: 600; color: var(--navy); cursor: pointer; list-style: none; transition: background-color var(--ease); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--bg); }
.usermenu summary::after { content: ""; width: 7px; height: 7px; margin: -3px 4px 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow-3); }
.usermenu__who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.usermenu__who strong { display: block; color: var(--navy); }
.usermenu__who span { font-size: 12.5px; color: var(--muted); }
.usermenu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: var(--r-sm); color: var(--ink); font: 500 14px var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.usermenu__item:hover { background: var(--bg); color: var(--navy); }
.usermenu__item--danger { color: var(--bad); }
.usermenu__item--danger:hover { background: var(--bad-tint); color: var(--bad); }
.usermenu form { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }

.newmenu summary, .newmenu summary:hover, .newmenu[open] summary { padding: 5px 12px; background: var(--navy); border-radius: var(--r-sm); color: #fff; }
.newmenu summary:hover, .newmenu[open] summary { background: var(--navy-2); }
.newmenu summary::after { margin: -3px 2px 0 2px; border-color: #fff; }
.newmenu .usermenu__panel { min-width: 190px; }

.content { flex: 1; min-width: 0; padding: 22px 24px 56px; }
.content > .alert { margin-bottom: 16px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; overflow-wrap: anywhere; }
.page-head__sub { max-width: 70ch; margin: 4px 0 0; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { margin: 0 0 2px; font-size: 13px; color: var(--muted); }

/* 8 ── Staff pages ────────────────────────────────────────────────────── */
/* Dashboard */
.queue + .queue { margin-top: 18px; }
.queue__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.queue__head h2 { font-size: 14px; }
.queue__head a { margin-left: auto; font-size: 13px; font-weight: 600; text-decoration: none; }
.queue__head a:hover { text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color var(--ease), box-shadow var(--ease); }
.tile:hover { border-color: var(--link); box-shadow: var(--shadow-2); color: var(--ink); }
.tile__label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tile__value { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile--alert .tile__value { color: var(--bad); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-top: 18px; }
.dash-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.dash-col .card + .card { margin-top: 0; }

.mini-list { list-style: none; margin: -6px 0 0; padding: 0; }
.mini + .mini { border-top: 1px solid var(--line-soft); }
.mini__link { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.mini__link:hover .mini__subject { color: var(--link); }
.mini__main { flex: 1; min-width: 0; }
.mini__subject { display: block; overflow: hidden; font-weight: 600; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; transition: color var(--ease); }
.mini__meta { display: block; overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.hbars__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) 28px; align-items: center; gap: 12px; }
.hbars__row a { overflow: hidden; color: var(--ink); font-weight: 500; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.hbars__row a:hover { color: var(--link); text-decoration: underline; }
.hbars__bar { width: 100%; height: 8px; background: var(--neutral-tint); border-radius: 2px; }
.hbars__fill { fill: var(--abuse); }
.hbars__value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Ticket queue */
.queue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 16px; align-items: start; }

.viewbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.views { display: flex; flex-wrap: wrap; gap: 6px; }
.views__tab { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: border-color var(--ease), background-color var(--ease), color var(--ease); }
.views__tab:hover { border-color: var(--link); color: var(--link); }
.views__tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.views__count { font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }
.viewbar__count { font-size: 13px; color: var(--muted); }

.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.trow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 204px; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow-1); transition: border-color var(--ease), box-shadow var(--ease); }
.trow:hover { border-color: #A9C8F3; box-shadow: var(--shadow-2); }
.trow__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.trow__subject { color: var(--navy); font-size: 15px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.trow__subject:hover { color: var(--link); }
.trow__sub { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.trow__sub span + span::before { content: "·"; margin-right: 8px; }
.trow__meta { display: grid; gap: 6px; justify-items: start; min-width: 0; padding-left: 14px; border-left: 1px solid var(--line-soft); font-size: 13px; }
.trow__agent { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; overflow: hidden; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.trow__agent .icon { color: var(--muted); }

.filters { position: sticky; top: calc(var(--topbar) + 16px); padding: 18px; }
.filters summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; cursor: pointer; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-135deg); transition: transform var(--ease); }
.filters:not([open]) summary { margin-bottom: 0; }
.filters:not([open]) summary::after { transform: rotate(45deg); }
.filters h2 { font-size: 14px; }
.filters .field { margin-bottom: 12px; }
.filters .input { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.filters__search { position: relative; }
.filters__search .icon { position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }
.filters__search .input { padding-left: 32px; }
.filters__actions { display: grid; gap: 8px; margin-top: 16px; }
.filters__clear { font-size: 13px; font-weight: 600; text-align: center; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Ticket page */
.ticketbar { position: sticky; top: var(--topbar); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -22px -24px 18px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.ticketbar__back { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.ticketbar__back:hover { color: var(--link); }
.ticketbar__back .icon { transform: rotate(180deg); }
.ticketbar form { display: inline-flex; }
.content > .alert + .ticketbar { margin-top: 0; margin-bottom: 18px; }
.ticketbar__spacer { flex: 1; }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 16px; align-items: start; }
.ticket-title { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 16px; }
.ticket-title__icon { display: grid; place-items: center; width: 44px; height: 44px; background: var(--link-tint); border-radius: var(--r); color: var(--link); }
.ticket-title__icon--abuse { background: var(--abuse-tint); color: var(--abuse); }
.ticket-title h1 { font-size: 20px; overflow-wrap: anywhere; }
.ticket-title__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.ticket-layout--form { margin: 0; }
.ticket-layout__actions { grid-column: 1 / -1; margin-top: 0; }
.ticket-layout--form .form__group:last-child, .ticket-layout--form .form__group:last-child .field:last-child { margin-bottom: 0; }
.ticket-side { display: grid; gap: 16px; }
.ticket-side .card { padding: 18px; }
.ticket-side .card + .card { margin-top: 0; }
.ticket-side .card__title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ticket-side .input { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }

.contact { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.contact strong { display: block; color: var(--navy); }
.contact span { font-size: 13px; color: var(--muted); }

.segmented { display: inline-flex; margin: 0 0 10px; padding: 3px; border: 0; background: var(--neutral-tint); border-radius: var(--r); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background-color var(--ease), color var(--ease); }
.segmented input:checked + span { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.composer { scroll-margin-top: 120px; transition: background-color var(--ease), border-color var(--ease); }
.composer__hint { margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.composer:has(input[value="internal"]:checked) { background: var(--note-tint); border-color: var(--note-line); }
.composer__actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding-top: 4px; }
.composer__actions .field { margin: 0; min-width: 220px; }

.copy { display: flex; gap: 8px; margin-top: 10px; }
.copy .input { font-size: 12px; }

.others { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.others li { display: grid; gap: 4px; justify-items: start; }
.others a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.others a:hover { color: var(--link); }

/* Abuse desk: reports received / notices sent */
.switcher { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; background: var(--neutral-tint); border-radius: var(--r); }
.switcher__tab { padding: 7px 14px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color var(--ease), color var(--ease); }
.switcher__tab:hover { color: var(--navy); }
.switcher__tab.is-active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-1); }
.switcher__tab .muted { font-weight: 400; }

.action-row { margin-bottom: 12px; }
.action-row__inputs { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
.tokens { display: grid; gap: 10px; margin: 0; font-size: 13px; }
.tokens dt { font-weight: 600; }
.tokens dd { margin: 2px 0 0; color: var(--ink-2); }

/* Tables and setup pages */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; text-align: left; color: var(--muted); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table th.num, .table td.num { text-align: right; }
.table__person { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); }
.table__action { text-align: right; font-weight: 600; }
a.table__person { text-decoration: none; }
a.table__person:hover { color: var(--link); }
.table__person small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* Customer record */
.customer-head { display: flex; align-items: flex-start; gap: 14px; }
.customer-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.account-explain { margin: 14px 0; font-size: 13px; color: var(--ink-2); }
.account-actions { display: grid; gap: 8px; margin-top: 12px; }
.table--compact { font-size: 13px; }
.table--compact th, .table--compact td { padding: 6px 10px; }

.table__title { color: var(--navy); font-weight: 600; text-decoration: none; }
.table__title:hover { color: var(--link); text-decoration: underline; }

.inline-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-filters .input { width: auto; min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 14px; }

.editor__bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.editor__bar .field__label { margin-bottom: 0; }
.segmented--sm { margin: 0; }
.segmented__btn { padding: 5px 14px; background: none; border: 0; border-radius: var(--r-sm); color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; transition: background-color var(--ease), color var(--ease); }
.segmented__btn.is-active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-1); }
.editor__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.editor__hint { font-size: 13px; color: var(--muted); }
.editor__status { margin: 0 0 8px; padding: 8px 12px; background: var(--info-tint); border-radius: var(--r-sm); font-size: 13px; color: var(--info); }
.editor__status.is-error { background: var(--bad-tint); color: var(--bad); }
textarea.is-dropping { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(44, 92, 197, .18); }
.editor__preview { min-height: 320px; max-width: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.format-help { margin-top: 12px; font-size: 13px; }
.format-help summary { color: var(--link); font-weight: 600; cursor: pointer; }
.format-help .table { margin-top: 8px; }
.kb-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; }
.form__actions-end { margin-left: auto; }
.row-form .row-form__wide { flex: 2 1 280px; }
.row-form .row-form__narrow { flex: 0 0 90px; }

/* Mobile app: devices on the profile page, and the notification prompt */
/* Installer and updates */
.install .card + .card, .install .card + form, .install .alert + form { margin-top: 16px; }
.install__ok { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ok); font-weight: 600; }
.install__checks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.install__checks li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); }
.install__checks .icon { flex: none; margin-top: 2px; }
.install__checks .is-ok .icon { color: var(--ok); }
.install__checks .is-bad .icon, .install__checks .is-bad strong { color: var(--bad); }
.install__checks .is-warn .icon { color: var(--warn); }
.empty-state .install__go { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 14px; }
.install .steps pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; }
.update-notes { margin: 0 0 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; white-space: pre-wrap; }
.update-card { margin-top: 16px; }

/* Email import */
.mailbox__error { max-width: 340px; margin-top: 4px; color: var(--bad); font-size: 12.5px; line-height: 1.4; }
.mail-log { margin-top: 16px; }
.mail-log .card__title { padding: 16px 18px 0; }
.page__note { margin: 12px 2px 0; color: var(--muted); font-size: 13px; }

/* Two-step sign-in */
.input--code { max-width: 220px; font: 600 20px/1.2 var(--mono); letter-spacing: .12em; }
.auth__box .input--code { max-width: none; }
.twostep-card, .twostep-rule { margin-top: 16px; }
.twostep-card p, .twostep-rule p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.twostep-card p:last-child { margin-bottom: 0; }
.setup { margin: 0; padding: 0; list-style: none; counter-reset: setup; display: grid; gap: 22px; color: var(--ink-2); }
.setup > li { position: relative; padding-left: 40px; counter-increment: setup; }
.setup > li::before { content: counter(setup); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 26px; height: 26px; background: var(--navy); border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; }
.setup strong { color: var(--navy); }
.setup__qr { width: 224px; margin: 14px 0 10px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); line-height: 0; }
.setup__qr svg { display: block; width: 100%; height: auto; }
.setup__manual summary { color: var(--link); font-size: 14px; font-weight: 600; cursor: pointer; }
.setup__key { margin: 10px 0 6px; }
.setup__key code { display: inline-block; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); color: var(--navy); font-size: 15px; font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; }
.setup__confirm { margin-top: 12px; }
.codes { border-left: 4px solid var(--ok); }
.codes__box { max-width: 240px; margin-bottom: 10px; font-size: 15px; font-weight: 600; line-height: 1.7; letter-spacing: .04em; resize: none; }

.devices { margin-top: 16px; }
.devices__list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.devices__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.devices__list li + li { border-top: 1px solid var(--line-soft); }
.devices__list strong { display: block; color: var(--navy); }
.devices__list small { color: var(--muted); font-size: 13px; }
.app-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.app-banner__actions { display: flex; gap: 8px; }

/* Email previews */
.mail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: start; }
.mail-grid .card + .card { margin-top: 0; }
.mail { padding: 0; overflow: hidden; }
.mail__head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.mail__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 15px; }
.mail__when { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
.mail__envelope { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; }
.mail__envelope dt { color: var(--muted); }
.mail__envelope dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mail__frame { display: block; width: 100%; height: 540px; border: 0; background: var(--bg); }
.mail__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.mail__foot details { flex: 1 1 100%; order: 2; }
.mail__foot summary { color: var(--link); font-weight: 600; cursor: pointer; }
.mail__text { max-height: 260px; margin: 10px 0 4px; padding: 12px 14px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; }

.stack { display: grid; gap: 12px; }
.stack .card + .card { margin-top: 0; }
.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; padding: 16px 18px; }
.row-form .field { flex: 1 1 200px; margin: 0; }
.row-form .check { padding-bottom: 9px; }
.row-form > .muted { padding-bottom: 9px; font-size: 13px; }

.disclosure { padding: 0; }
.disclosure summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 14px 18px; border-radius: var(--r); cursor: pointer; transition: background-color var(--ease); }
.disclosure summary:hover { background: var(--surface-2); }
.disclosure__title { font-weight: 600; color: var(--navy); }
.disclosure[open] summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--r) var(--r) 0 0; }
.disclosure .form { padding: 18px; }

/* 9 ── Chart ──────────────────────────────────────────────────────────── */
.legend { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend__swatch--support { background: var(--support); }
.legend__swatch--abuse { background: var(--abuse); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.chart__axis { stroke: var(--line); stroke-width: 1; }
.chart__tick { fill: var(--muted); font: 500 11px var(--font); }
.chart__hit { fill: transparent; }
.chart__col { outline: none; cursor: default; }
.chart__col:hover .chart__hit, .chart__col:focus-visible .chart__hit { fill: rgba(18, 52, 77, .05); }
.chart__bar--support { fill: var(--support); }
.chart__bar--abuse { fill: var(--abuse); }
.chart__tip {
    position: absolute; z-index: 2; min-width: 120px; padding: 8px 10px; pointer-events: none;
    background: var(--navy-3); border-radius: var(--r-sm); box-shadow: var(--shadow-2); color: #fff; font-size: 12px; line-height: 1.5;
}
.chart__tip strong { display: block; margin-bottom: 2px; }
.chart__tip span { display: flex; align-items: center; gap: 6px; }
.chart__tip b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { color: var(--muted); font-weight: 600; cursor: pointer; }
.chart-table .table { max-width: 340px; margin-top: 8px; }

/* 10 ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .ticket-layout, .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
    .queue-layout { grid-template-columns: minmax(0, 1fr); }
    .queue-layout .filters { position: static; order: -1; }
    .filters form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; align-items: end; }
    .filters__actions { grid-column: 1 / -1; grid-template-columns: auto auto 1fr; align-items: center; margin-top: 4px; }
    .filters__clear { text-align: left; }
}

@media (max-width: 900px) {
    .form-layout { grid-template-columns: minmax(0, 1fr); }
    .aside { position: static; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__side { display: none; }
    .auth__box > .brand { display: inline-flex; }

    /* The rail becomes a labelled strip along the top. */
    .app { grid-template-columns: minmax(0, 1fr); }
    .rail { position: static; flex-direction: row; height: auto; padding: 8px 12px; overflow-x: auto; }
    .rail__logo { margin: 0 8px 0 0; }
    .rail__nav { flex-direction: row; }
    .rail__sep { width: 1px; height: 24px; margin: 0 4px; }
    .rail__link { display: flex; gap: 8px; width: auto; padding: 0 12px; }
    .rail__link.is-active::before { display: none; }
    .rail__label { position: static; padding: 0; background: none; box-shadow: none; opacity: 1; transform: none; font-size: 13px; }
    .rail__badge { position: static; border: 0; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px 40px; }
    .ticketbar { margin: -18px -16px 16px; padding: 10px 16px; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .workspace { font-size: 15px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .input, .btn { min-height: 44px; font-size: 16px; }
    .btn--sm { min-height: 40px; font-size: 14px; }
    .card, .form-layout .card { padding: 18px; }

    .portal-nav__link { padding: 8px 10px; }
    .hero { padding: 40px 0 84px; }
    .lookup { grid-template-columns: minmax(0, 1fr); }
    .page { padding-top: 24px; }
    .page-intro h1 { font-size: 24px; }

    .ticket-head { padding: 0; }
    .ticket-head__top, .ticket-head__facts, .statusband, .progress { padding-left: 18px; padding-right: 18px; }
    .statusband { align-items: flex-start; }
    .statusband__seal { width: 48px; height: 48px; }
    .progress__step { font-size: 12px; }

    .site__body { grid-template-columns: minmax(0, 1fr); }
    .site__facts div { grid-template-columns: 110px minmax(0, 1fr); }
    .action-row__inputs { grid-template-columns: minmax(0, 1fr); }
    .msg { grid-template-columns: minmax(0, 1fr); }
    .msg > .avatar { display: none; }
    .msg__head .thread__meta { margin-left: 0; width: 100%; }
    .thread__event { margin-left: 0; }

    .usermenu summary span:not(.avatar) { display: none; }
    .topbar { gap: 8px; }
    .topbar__actions { gap: 4px; }
    .topbar__wide { display: none; }
    .gsearch { min-width: 0; }
    .gsearch select.input { display: none; }
    .gsearch__box .input { border-radius: var(--r-sm); }
    .ticketbar { position: static; }
    .mail-grid { grid-template-columns: minmax(0, 1fr); }
    .trow { grid-template-columns: minmax(0, 1fr); }
    .trow > .avatar, .trow > .trow__kind { display: none; }
    .trow--customer { grid-template-columns: minmax(0, 1fr); }
    .trow__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line-soft); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .progress__step::after, .progress__dot { animation: none !important; }
    .progress:not(.progress--finished) .progress__step.is-current::after { display: none; }
    *, *::before, *::after { transition: none !important; animation-duration: .001ms !important; }
}
