:root {
    color-scheme: dark;
    --bg: #080a0d;
    --bg-elevated: #0d1015;
    --surface: #11151b;
    --surface-2: #151a21;
    --surface-3: #1a2029;
    --surface-soft: rgba(17,21,27,.78);
    --line: #242b34;
    --line-soft: rgba(255,255,255,.065);
    --line-strong: #343d49;
    --text: #f4f6f8;
    --text-soft: #d8dde4;
    --muted: #929ba8;
    --muted-2: #68717e;
    --ember: #e76f51;
    --ember-bright: #f08a67;
    --ember-soft: rgba(231,111,81,.11);
    --gold: #d7aa5b;
    --gold-soft: rgba(215,170,91,.10);
    --teal: #63c2b0;
    --teal-soft: rgba(99,194,176,.10);
    --discord: #5865f2;
    --danger: #ef6a70;
    --shadow: 0 24px 64px rgba(0,0,0,.28);
    --shadow-soft: 0 10px 28px rgba(0,0,0,.20);
    --radius-lg: 12px;
    --radius-md: 9px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent 160px),
        linear-gradient(180deg, #090b0f 0%, #07090c 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .28;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 100% 64px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}

::selection { background: rgba(231,111,81,.34); color: #fff; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid rgba(240,138,103,.9);
    outline-offset: 3px;
}

/* Kept for backwards-compatible markup. The old glowing circles are deliberately gone. */
.ambient { display: none; }
.shell { width: min(1360px, calc(100% - 48px)); margin: 0 auto; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(8,10,13,.90);
    backdrop-filter: blur(18px);
}
.header-inner {
    width: min(1480px, calc(100% - 48px));
    min-height: 72px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; width: max-content; }
.brand img {
    width: 40px;
    height: 40px;
    flex: none;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.brand > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 14px; font-weight: 820; letter-spacing: -.02em; white-space: nowrap; }
.brand-subtitle { margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.portal-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}
.nav-link {
    position: relative;
    padding: 8px 13px;
    border-radius: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}
.nav-link:hover { color: var(--text-soft); background: rgba(255,255,255,.035); }
.nav-link.active { color: #fff; background: var(--surface-3); }
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 4px;
    height: 1px;
    background: var(--ember-bright);
}
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-actions form { margin: 0; }

.status-pill, .live-chip, .resolution-chip, .access-chip, .role-chip, .verified-badge, .archive-count, .rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: rgba(255,255,255,.025);
    color: #cbd1da;
    white-space: nowrap;
}
.status-pill { padding: 7px 10px; font-size: 10px; }
.status-dot, .live-chip i {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 2px;
    background: var(--teal);
    box-shadow: 0 0 12px rgba(99,194,176,.35);
}

.button {
    appearance: none;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 780;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
    border-color: rgba(240,138,103,.38);
    background: linear-gradient(180deg, #e77a5d, #cf5e43);
    box-shadow: 0 8px 20px rgba(207,94,67,.15);
}
.button-primary:hover { background: linear-gradient(180deg, #ee8668, #d96549); box-shadow: 0 10px 24px rgba(207,94,67,.22); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.025); color: #dce1e7; }
.button-ghost:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.button-muted { border-color: var(--line); background: var(--surface-2); color: #cbd2db; }
.button-muted:hover { background: var(--surface-3); }
.button-discord { background: #5865f2; border-color: #6672f3; box-shadow: 0 10px 26px rgba(88,101,242,.18); }
.button-discord:hover { background: #6571f3; }
.button-large { min-height: 50px; padding: 0 20px; border-radius: 8px; font-size: 13px; }
.button-compact { min-height: 36px; padding: 0 12px; }
.text-button { padding: 5px 0; border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 760; }
.text-button:hover { color: #fff; }
.eyebrow { color: var(--ember-bright); font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }

/* Landing */
.home-shell { padding: 70px 0 56px; }
.setup-warning { margin-bottom: 22px; padding: 13px 15px; border: 1px solid rgba(215,170,91,.28); border-radius: 8px; background: var(--gold-soft); color: #efd29b; font-size: 11px; }
.login-layout { min-height: 560px; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); gap: 72px; align-items: center; }
.login-copy { max-width: 730px; }
.login-copy h1 { margin: 15px 0 20px; font-size: clamp(46px, 5.4vw, 74px); line-height: .99; letter-spacing: -.055em; }
.login-copy h1 span { color: #e8b26e; }
.hero-lead { max-width: 650px; margin: 0; color: #aab2bd; font-size: 15px; line-height: 1.72; }
.login-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 29px; }
.discord-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.12); }
.discord-mark svg { width: 18px; height: 18px; display: block; }
.login-note { max-width: 620px; display: flex; gap: 9px; align-items: flex-start; margin-top: 17px; color: var(--muted); font-size: 11px; }
.mini-shield { color: var(--gold); }
.login-panel {
    position: relative;
    padding: 26px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20,25,32,.98), rgba(12,15,20,.98));
    box-shadow: var(--shadow);
}
.login-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--ember), var(--gold), var(--teal));
    opacity: .9;
}
.login-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; }
.live-chip { padding: 6px 9px; font-size: 9px; color: #bce8df; background: var(--teal-soft); border-color: rgba(99,194,176,.20); }
.login-panel-brand { display: flex; align-items: center; gap: 16px; padding: 31px 0 25px; }
.login-panel-brand img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.login-panel-brand h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.login-panel-brand p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.login-benefits { display: grid; border-top: 1px solid var(--line-soft); }
.login-benefit { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.login-benefit-icon { color: var(--gold); font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-benefit b { display: block; font-size: 11px; }
.login-benefit small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.home-info { padding: 56px 0 18px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 7px 0 0; font-size: 27px; letter-spacing: -.04em; }
.info-grid { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.info-card { padding: 20px; border-right: 1px solid var(--line); }
.info-card:last-child { border-right: 0; }
.info-card > span { color: var(--gold); font: 800 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.info-card h3 { margin: 17px 0 6px; font-size: 15px; letter-spacing: -.02em; }
.info-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.62; }

/* Dashboard */
.dashboard-shell { padding: 38px 0 72px; }
.dashboard-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: end; margin-bottom: 22px; }
.dashboard-intro h1 { margin: 7px 0 7px; font-size: clamp(34px,4vw,50px); line-height: 1; letter-spacing: -.052em; }
.dashboard-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.account-card {
    min-width: 305px;
    display: grid;
    grid-template-columns: 46px minmax(0,1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}
.account-avatar { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; background: var(--surface-3); }
.account-copy { min-width: 0; }
.account-copy > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-label { color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.account-copy b { margin-top: 2px; font-size: 12px; }
.account-copy > span:last-child { margin-top: 1px; color: var(--muted); font-size: 9px; }
.verified-badge { padding: 5px 7px; color: #afe1d7; background: var(--teal-soft); border-color: rgba(99,194,176,.18); font-size: 8px; font-weight: 800; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
}
.stat-card { min-height: 122px; padding: 17px 18px; background: var(--surface); }
.stat-card:nth-child(1) { border-top: 2px solid var(--ember); }
.stat-card:nth-child(2) { border-top: 2px solid var(--gold); }
.stat-card:nth-child(3) { border-top: 2px solid #7b8ce5; }
.stat-card:nth-child(4) { border-top: 2px solid var(--teal); }
.stat-label { color: #a3abb6; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.stat-value-row { display: flex; align-items: center; justify-content: space-between; margin: 11px 0 7px; }
.stat-value-row b { font-size: 31px; line-height: 1; letter-spacing: -.05em; }
.stat-icon { color: var(--muted-2); font: 850 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.stat-card small { color: var(--muted-2); font-size: 9px; line-height: 1.45; }

.archive-shell { display: grid; grid-template-columns: 246px minmax(0,1fr); gap: 12px; align-items: start; }
.archive-sidebar, .archive-panel { border: 1px solid var(--line); border-radius: 10px; background: rgba(12,15,20,.92); box-shadow: var(--shadow-soft); }
.archive-sidebar { position: sticky; top: 88px; padding: 15px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 13px; border-bottom: 1px solid var(--line-soft); }
.sidebar-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.03em; }
.filter-group { padding-top: 14px; }
.filter-group + .filter-group { margin-top: 14px; border-top: 1px solid var(--line-soft); }
.filter-label { display: block; margin: 0 3px 7px; color: var(--muted-2); font-size: 8px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.role-filter-list, .category-filter-list { display: grid; gap: 3px; }
.filter-chip {
    appearance: none;
    position: relative;
    width: 100%;
    min-height: 37px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 9px 0 11px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #949ca8;
    text-align: left;
    font-size: 10px;
    font-weight: 740;
}
.filter-chip:hover { background: rgba(255,255,255,.03); color: #d8dde3; }
.filter-chip.active { border-color: var(--line-strong); background: var(--surface-2); color: #fff; }
.filter-chip.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; background: var(--ember-bright); }
.filter-chip b { min-width: 22px; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 8px; text-align: center; }
.filter-chip.active b { color: #efc0ae; background: var(--ember-soft); }
.sidebar-note { display: grid; grid-template-columns: 20px 1fr; gap: 9px; margin-top: 15px; padding: 11px 2px 2px; border-top: 1px solid var(--line-soft); }
.note-mark { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: #9fa7b2; font-size: 9px; font-weight: 900; }
.sidebar-note p { margin: 0; color: var(--muted-2); font-size: 8px; line-height: 1.55; }

.archive-panel { min-width: 0; overflow: hidden; }
.archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.archive-title-row { display: flex; align-items: center; gap: 9px; margin-top: 3px; }
.archive-title-row h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.archive-count { padding: 4px 7px; color: var(--muted); font-size: 8px; }
.archive-controls { display: flex; align-items: center; gap: 7px; min-width: 0; }
.search-wrap {
    width: min(380px,34vw);
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px 0 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #090c10;
}
.search-wrap:focus-within { border-color: #485360; box-shadow: 0 0 0 3px rgba(255,255,255,.025); }
.search-icon { color: #747d89; font-size: 14px; }
.search-wrap input { min-width: 0; width: 100%; min-height: 37px; border: 0; outline: 0; background: transparent; color: #edf1f5; font-size: 10px; }
.search-wrap input::placeholder { color: #59616c; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: #737c88; font: 8px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; }
.sort-wrap { min-height: 39px; display: flex; align-items: center; gap: 7px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #090c10; color: var(--muted-2); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.sort-wrap select { max-width: 130px; border: 0; outline: 0; background: transparent; color: #cfd5dc; font-size: 9px; font-weight: 700; text-transform: none; letter-spacing: normal; }
.sort-wrap option { background: #11151b; color: #fff; }
.ticket-list-header { display: grid; grid-template-columns: minmax(280px,1.4fr) minmax(120px,.55fr) minmax(120px,.55fr) 118px; gap: 14px; padding: 10px 16px 8px; color: var(--muted-2); font-size: 7px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.ticket-grid { display: grid; gap: 0; padding: 0; }
.ticket-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px,1.4fr) minmax(120px,.55fr) minmax(120px,.55fr) 118px;
    gap: 14px;
    align-items: center;
    min-height: 112px;
    padding: 14px 16px;
    border-top: 1px solid var(--line-soft);
    background: rgba(17,21,27,.66);
    transition: background .15s ease, box-shadow .15s ease;
}
.ticket-card:first-child { border-top: 0; }
.ticket-card::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px; background: transparent; }
.ticket-card:hover { background: #151a21; box-shadow: inset 3px 0 0 var(--ember); }
.ticket-card[hidden] { display: none; }
.ticket-main { min-width: 0; }
.ticket-kicker-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ticket-type { color: #e89b82; font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ticket-number { color: var(--muted-2); font: 800 8px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.ticket-card h3 { margin: 5px 0 3px; overflow: hidden; color: #f2f4f7; font-size: 14px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.ticket-reason { margin: 0; overflow: hidden; color: #8e97a3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ticket-date { color: var(--muted-2); font-size: 8px; }
.resolution-chip, .access-chip, .role-chip, .rating-chip { padding: 3px 6px; font-size: 7px; font-weight: 760; }
.resolution-chip { color: #efc4b4; border-color: rgba(231,111,81,.23); background: var(--ember-soft); }
.role-chip { color: #b5bdc7; }
.rating-chip { color: #ead49f; border-color: rgba(215,170,91,.22); background: var(--gold-soft); }
.ticket-cell { min-width: 0; }
.ticket-cell small { display: block; color: var(--muted-2); font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.ticket-cell b { display: block; margin-top: 4px; overflow: hidden; color: #d1d6dd; font-size: 9px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.ticket-open { width: 100%; min-height: 36px; padding: 0 10px; font-size: 9px; }
.empty-state, .no-results { text-align: center; padding: 62px 24px; }
.empty-state { margin: 10px; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,.012); }
.empty-icon { margin: 0 auto; color: var(--gold); font: 900 18px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.empty-state h3, .no-results h3 { margin: 13px 0 5px; font-size: 14px; }
.empty-state p, .no-results p { max-width: 450px; margin: 0 auto; color: var(--muted); font-size: 9px; line-height: 1.6; }

/* Viewer */
.page-viewer { background: #080a0d; }
.viewer-shell { padding: 26px 0 72px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted-2); font-size: 9px; }
.breadcrumb a:hover { color: #fff; }
.viewer-summary-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 21px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--ember);
    border-radius: 9px;
    background: var(--surface);
}
.viewer-heading h1 { margin: 5px 0 4px; font-size: 27px; letter-spacing: -.042em; }
.viewer-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.viewer-pills { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.access-chip { color: #b8c1cb; }
.viewer-meta-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1px;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}
.viewer-meta-card { min-width: 0; padding: 12px 14px; background: #0f1318; }
.viewer-meta-card span { display: block; color: var(--muted-2); font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.viewer-meta-card b { display: block; margin-top: 5px; overflow: hidden; color: #dfe4e9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.closure-card {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 18px;
    padding: 15px 17px;
    margin-bottom: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f1318;
}
.closure-block p { margin: 5px 0 0; color: #b8c0c9; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.closure-divider { width: 1px; background: var(--line); }
.transcript-frame-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #0b0e12;
    box-shadow: var(--shadow);
}
.frame-topbar {
    position: sticky;
    top: 72px;
    z-index: 2;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(17,21,27,.96);
    backdrop-filter: blur(12px);
}
.frame-title { display: flex; align-items: center; gap: 9px; color: #b7c0ca; font-size: 9px; }
.frame-title .status-dot { background: var(--teal); }
.frame-actions { display: flex; align-items: center; gap: 12px; }
.frame-actions a, .frame-actions button { border: 0; background: none; color: #838c98; font-size: 8px; font-weight: 780; }
.frame-actions a:hover, .frame-actions button:hover { color: #fff; }
.transcript-frame {
    display: block;
    width: 100%;
    height: 760px;
    min-height: 680px;
    border: 0;
    background: #0b0e12;
    overflow: hidden;
}
body.transcript-expanded { overflow: hidden; }
body.transcript-expanded .transcript-frame-card { position: fixed; inset: 10px; z-index: 100; border-radius: 8px; }
body.transcript-expanded .frame-topbar { position: static; }
body.transcript-expanded .transcript-frame { height: calc(100vh - 49px) !important; min-height: 0; overflow: auto; }
body.transcript-expanded .frame-actions #expand-transcript { color: #fff; }

/* Dialog */
.portal-dialog { width: min(540px,calc(100% - 30px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); box-shadow: 0 32px 100px rgba(0,0,0,.55); }
.portal-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.dialog-card { margin: 0; padding: 20px; background: #11151b; border-radius: inherit; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.035em; }
.dialog-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.025); color: #aeb6c0; font-size: 19px; line-height: 1; }
.dialog-card > p { margin: 12px 0 15px; color: var(--muted); font-size: 10px; }
.dialog-input-wrap span { display: block; margin-bottom: 6px; color: var(--muted-2); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.dialog-input-wrap input { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #090c10; color: #fff; font-size: 10px; }
.dialog-input-wrap input:focus { border-color: #4c5865; box-shadow: 0 0 0 3px rgba(255,255,255,.025); }
.dialog-message { min-height: 20px; padding-top: 6px; color: var(--muted); font-size: 9px; }
.dialog-message.is-error { color: #f2928f; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }

/* Error pages */
.center-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.message-card { width: min(530px,100%); padding: 38px; border: 1px solid var(--line); border-top: 2px solid var(--ember); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.message-card > img { width: 72px; height: 72px; margin-bottom: 15px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }
.error-code { margin-bottom: 5px; color: #58616d; font: 900 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .16em; }
.message-card h1 { margin: 7px 0 8px; font-size: 26px; letter-spacing: -.04em; }
.message-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.message-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 21px; }

/* Footer */
.site-footer { width: min(1480px,calc(100% - 48px)); min-height: 84px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8px; }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-brand img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.footer-brand b, .footer-brand span { display: block; }
.footer-brand b { color: #cfd5dc; font-size: 9px; }
.footer-brand span { margin-top: 1px; }
.footer-meta { text-align: right; }

@media (max-width: 1100px) {
    .header-inner { grid-template-columns: 1fr auto; }
    .portal-nav { display: none; }
    .archive-shell { grid-template-columns: 220px minmax(0,1fr); }
    .ticket-list-header, .ticket-card { grid-template-columns: minmax(250px,1fr) minmax(120px,.6fr) 112px; }
    .ticket-list-header span:nth-child(3), .ticket-card .ticket-cell:nth-of-type(2) { display: none; }
    .archive-controls { flex-direction: column; align-items: stretch; }
    .search-wrap { width: min(360px,42vw); }
    .sort-wrap { justify-content: space-between; }
}

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr; gap: 34px; min-height: auto; }
    .login-panel { max-width: 650px; }
    .info-grid { grid-template-columns: 1fr; }
    .info-card { border-right: 0; border-bottom: 1px solid var(--line); }
    .info-card:last-child { border-bottom: 0; }
    .dashboard-hero { grid-template-columns: 1fr; align-items: start; }
    .account-card { width: 100%; min-width: 0; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .archive-shell { grid-template-columns: 1fr; }
    .archive-sidebar { position: static; }
    .role-filter-list, .category-filter-list { display: flex; overflow-x: auto; padding-bottom: 2px; }
    .filter-chip { min-width: max-content; width: auto; }
    .sidebar-note { display: none; }
    .filter-group + .filter-group { margin-top: 12px; padding-top: 12px; }
    .archive-toolbar { align-items: stretch; flex-direction: column; }
    .archive-controls { flex-direction: row; }
    .search-wrap { width: 100%; flex: 1; }
    .viewer-meta-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 650px) {
    .shell { width: min(100% - 26px,1360px); }
    .header-inner, .site-footer { width: min(100% - 26px,1480px); }
    .header-inner { min-height: 66px; gap: 12px; }
    .brand img { width: 36px; height: 36px; }
    .brand-name { font-size: 12px; }
    .brand-subtitle { font-size: 8px; }
    .header-actions .status-pill { display: none; }
    .button-compact { min-height: 35px; font-size: 9px; }
    .home-shell { padding-top: 46px; }
    .login-copy h1 { font-size: 43px; }
    .hero-lead { font-size: 13px; }
    .login-actions { align-items: stretch; }
    .login-actions .button { width: 100%; }
    .login-panel { padding: 20px; }
    .login-panel-brand { padding: 25px 0 20px; }
    .login-panel-brand img { width: 62px; height: 62px; }
    .dashboard-shell { padding-top: 27px; }
    .dashboard-intro h1 { font-size: 34px; }
    .account-card { grid-template-columns: 42px minmax(0,1fr); }
    .account-avatar { width: 42px; height: 42px; }
    .verified-badge { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 112px; padding: 14px; }
    .stat-card small { font-size: 8px; }
    .archive-controls { flex-direction: column; }
    .sort-wrap { width: 100%; }
    .ticket-list-header { display: none; }
    .ticket-card { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
    .ticket-card .ticket-cell { display: block !important; }
    .ticket-open { width: 100%; }
    .viewer-summary-card { grid-template-columns: 1fr; }
    .viewer-pills { justify-content: flex-start; }
    .viewer-meta-grid { grid-template-columns: 1fr 1fr; }
    .closure-card { grid-template-columns: 1fr; }
    .closure-divider { width: 100%; height: 1px; }
    .viewer-header .header-actions .button-muted { display: none; }
    .frame-topbar { position: static; align-items: flex-start; flex-direction: column; padding: 11px 13px; }
    .transcript-frame { min-height: 620px; }
    .site-footer { padding: 21px 0; flex-direction: column; align-items: flex-start; justify-content: center; }
    .footer-meta { text-align: left; }
}

@media (max-width: 430px) {
    .header-actions .button-ghost { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .viewer-meta-grid { grid-template-columns: 1fr; }
    .message-card { padding: 28px 20px; }
}

@media print {
    body { background: #fff !important; }
    .site-header, .site-footer, .breadcrumb, .viewer-summary-card, .viewer-meta-grid, .closure-card, .frame-topbar { display: none !important; }
    .viewer-shell { width: 100%; padding: 0; }
    .transcript-frame-card { border: 0; border-radius: 0; box-shadow: none; }
    .transcript-frame { height: auto; min-height: 0; }
}

/* ========================================================================== */
/* v5.2 — original portal visual language                               */
/* ========================================================================== */
:root {
    --bg: #070910;
    --bg-elevated: #0b0e17;
    --surface: rgba(13,17,28,.76);
    --surface-2: rgba(18,23,36,.86);
    --surface-3: rgba(24,30,46,.94);
    --surface-soft: rgba(11,14,22,.66);
    --line: rgba(255,255,255,.085);
    --line-soft: rgba(255,255,255,.055);
    --line-strong: rgba(255,255,255,.14);
    --text: #f7f8fc;
    --text-soft: #dce2ec;
    --muted: #99a5b8;
    --muted-2: #69758a;
    --ember: #ff8a61;
    --ember-bright: #ff9f79;
    --ember-soft: rgba(255,138,97,.12);
    --gold: #ffc06a;
    --gold-soft: rgba(255,192,106,.11);
    --teal: #52d6bd;
    --teal-soft: rgba(82,214,189,.11);
    --discord: #6d78ff;
    --blue: #6d8cff;
    --blue-soft: rgba(109,140,255,.12);
    --purple: #a778ff;
    --purple-soft: rgba(167,120,255,.12);
    --pink: #f270b6;
    --danger: #ff6f84;
    --shadow: 0 32px 90px rgba(0,0,0,.38);
    --shadow-soft: 0 18px 46px rgba(0,0,0,.24);
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

body {
    background:
        radial-gradient(900px 520px at 8% -8%, rgba(255,125,78,.11), transparent 68%),
        radial-gradient(860px 560px at 92% 2%, rgba(166,104,255,.12), transparent 70%),
        radial-gradient(1000px 700px at 64% 90%, rgba(73,116,255,.055), transparent 72%),
        linear-gradient(180deg, #090b13 0%, #070910 52%, #06080e 100%);
}
body::before {
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 48%, transparent 88%);
}
::selection { background: rgba(109,140,255,.34); color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline-color: rgba(109,140,255,.9);
}
.shell { width: min(1420px, calc(100% - 56px)); }

/* Floating Development-Hub style navigation */
.site-header {
    top: 0;
    padding: 12px 0 0;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(7,9,16,.94), rgba(7,9,16,.72) 76%, transparent);
    backdrop-filter: none;
}
.header-inner {
    width: min(1500px, calc(100% - 40px));
    min-height: 64px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(10,13,22,.76);
    box-shadow: 0 16px 44px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.025);
    backdrop-filter: blur(22px) saturate(130%);
}
.brand { gap: 11px; padding-right: 6px; }
.brand img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border-color: rgba(255,255,255,.13);
    box-shadow: 0 9px 24px rgba(0,0,0,.32);
}
.brand-name { font-size: 14px; letter-spacing: -.025em; }
.brand-subtitle { margin-top: 4px; color: #8996aa; font-size: 9px; }
.portal-nav {
    gap: 3px;
    padding: 4px;
    border-color: rgba(255,255,255,.07);
    border-radius: 15px;
    background: rgba(255,255,255,.025);
    box-shadow: inset 0 1px rgba(255,255,255,.018);
}
.nav-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 15px;
    border-radius: 11px;
    color: #8e9aad;
    font-size: 10px;
    font-weight: 760;
}
.nav-link:hover { color: #f5f7fb; background: rgba(255,255,255,.045); }
.nav-link.active {
    color: #fff;
    background:
        linear-gradient(180deg, rgba(109,140,255,.19), rgba(167,120,255,.11)),
        rgba(255,255,255,.035);
    box-shadow: inset 0 0 0 1px rgba(129,147,255,.17), 0 8px 18px rgba(63,78,170,.10);
}
.nav-link.active::after { display: none; }
.header-actions { gap: 7px; }

.status-pill, .live-chip, .resolution-chip, .access-chip, .role-chip, .verified-badge, .archive-count, .rating-chip {
    border-color: var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.035);
}
.status-pill { padding: 8px 11px; color: #b7c2d1; }
.status-dot, .live-chip i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(82,214,189,.08), 0 0 14px rgba(82,214,189,.26);
}

.button {
    min-height: 42px;
    border-radius: 12px;
    font-size: 10px;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button-primary {
    border-color: rgba(119,142,255,.30);
    background: linear-gradient(135deg, #6d8cff, #856ff1 56%, #a76fff);
    box-shadow: 0 12px 28px rgba(92,105,235,.20);
}
.button-primary:hover {
    background: linear-gradient(135deg, #7a98ff, #927af7 56%, #b17dff);
    box-shadow: 0 15px 34px rgba(92,105,235,.27);
}
.button-ghost {
    border-color: var(--line);
    background: rgba(255,255,255,.028);
    color: #d9e0eb;
}
.button-ghost:hover { border-color: rgba(129,147,255,.22); background: rgba(109,140,255,.075); }
.button-muted { border-color: var(--line); background: rgba(255,255,255,.045); color: #bdc7d6; }
.button-muted:hover { background: rgba(255,255,255,.075); }
.button-discord {
    background: linear-gradient(135deg, #5865f2, #6876ff);
    border-color: rgba(142,153,255,.35);
    box-shadow: 0 14px 32px rgba(88,101,242,.24);
}
.button-large { min-height: 52px; border-radius: 14px; }
.button-compact { min-height: 38px; border-radius: 11px; }
.eyebrow { color: #9aabff; letter-spacing: .14em; }

/* Landing */
.home-shell { padding-top: 76px; }
.login-layout { gap: 64px; }
.login-copy h1 {
    max-width: 840px;
    margin-top: 17px;
    font-size: clamp(48px,5.6vw,78px);
    letter-spacing: -.062em;
}
.login-copy h1 span {
    color: transparent;
    background: linear-gradient(90deg, #ff9a6e, #f179b2 45%, #9c82ff 80%, #7d9bff);
    background-clip: text;
    -webkit-background-clip: text;
}
.hero-lead { color: #a3afc0; }
.login-note { color: #7f8ba0; }
.mini-shield { color: #7f93ff; }
.login-panel {
    padding: 28px;
    border-color: var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(145deg, rgba(20,25,39,.82), rgba(11,14,23,.78)),
        rgba(11,14,22,.7);
    box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025);
    backdrop-filter: blur(20px);
}
.login-panel::before {
    inset: -1px 38px auto;
    height: 1px;
    border-radius: 0;
    background: linear-gradient(90deg, transparent, #ff8e68, #f078b1, #a47dff, #6d8cff, transparent);
}
.login-panel-brand img { border-radius: 18px; }
.live-chip { color: #b9eee4; border-color: rgba(82,214,189,.18); background: rgba(82,214,189,.075); }
.login-benefit-icon { color: #91a2ff; }
.home-info { padding-top: 66px; }
.info-grid {
    gap: 12px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.info-card {
    min-height: 170px;
    padding: 23px;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-lg);
    background: rgba(11,14,22,.63);
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255,255,255,.018);
    backdrop-filter: blur(14px);
}
.info-card > span { color: #91a2ff; }
.info-card h3 { font-size: 16px; }

/* Dashboard */
.dashboard-shell { padding-top: 50px; }
.dashboard-hero {
    position: relative;
    align-items: center;
    padding: 31px 32px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(620px 220px at 16% 0%, rgba(255,139,93,.12), transparent 72%),
        radial-gradient(540px 240px at 91% 0%, rgba(121,110,255,.14), transparent 72%),
        rgba(11,14,22,.70);
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255,255,255,.02);
    backdrop-filter: blur(18px);
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    left: 32px;
    right: 32px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,150,103,.42), rgba(157,127,255,.40), transparent);
}
.dashboard-intro h1 { font-size: clamp(38px,4.2vw,54px); }
.dashboard-intro p { color: #a0acbc; }
.account-card {
    min-width: 310px;
    padding: 12px 13px;
    border-radius: 17px;
    background: rgba(9,12,20,.58);
    border-color: rgba(255,255,255,.09);
    box-shadow: inset 0 1px rgba(255,255,255,.025);
    backdrop-filter: blur(14px);
}
.account-avatar { border-radius: 13px; }
.verified-badge { padding: 5px 8px; color: #b9eee4; border-color: rgba(82,214,189,.16); background: rgba(82,214,189,.075); }

.stats-grid {
    gap: 12px;
    margin-bottom: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.stat-card {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(11,14,22,.69);
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255,255,255,.018);
    backdrop-filter: blur(14px);
}
.stat-card::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    right: -60px;
    top: -70px;
    border-radius: 50%;
    filter: blur(26px);
    opacity: .14;
    pointer-events: none;
}
.stat-card:nth-child(1), .stat-card:nth-child(2), .stat-card:nth-child(3), .stat-card:nth-child(4) { border-top: 1px solid var(--line); }
.stat-card:nth-child(1)::after { background: #ff8a61; }
.stat-card:nth-child(2)::after { background: #f270b6; }
.stat-card:nth-child(3)::after { background: #a778ff; }
.stat-card:nth-child(4)::after { background: #52d6bd; }
.stat-label { color: #9ba8bb; }
.stat-value-row b { font-size: 34px; }
.stat-icon { color: #7f8ca2; }

.archive-shell { grid-template-columns: 252px minmax(0,1fr); gap: 14px; }
.archive-sidebar, .archive-panel {
    border-color: var(--line);
    border-radius: var(--radius-xl);
    background: rgba(10,13,21,.70);
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255,255,255,.018);
    backdrop-filter: blur(18px);
}
.archive-sidebar { top: 94px; padding: 18px; }
.sidebar-heading { padding-bottom: 15px; }
.sidebar-heading h2 { font-size: 18px; }
.filter-chip {
    min-height: 40px;
    padding: 0 10px 0 12px;
    border-radius: 11px;
    font-size: 10px;
}
.filter-chip:hover { background: rgba(255,255,255,.035); }
.filter-chip.active {
    border-color: rgba(118,140,255,.16);
    background: linear-gradient(90deg, rgba(109,140,255,.11), rgba(167,120,255,.06));
    box-shadow: inset 0 1px rgba(255,255,255,.015);
}
.filter-chip.active::before {
    top: 9px;
    bottom: 9px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, #6d8cff, #a778ff);
}
.filter-chip b { border-radius: 8px; background: rgba(255,255,255,.045); }
.filter-chip.active b { color: #c9d1ff; background: rgba(109,140,255,.10); }
.note-mark { border-radius: 8px; color: #8fa1ff; }

.archive-panel { overflow: hidden; }
.archive-toolbar { padding: 20px 21px; }
.archive-title-row h2 { font-size: 22px; }
.archive-count { padding: 4px 8px; }
.search-wrap, .sort-wrap {
    min-height: 42px;
    border-color: var(--line);
    border-radius: 12px;
    background: rgba(6,8,14,.56);
}
.search-wrap:focus-within { border-color: rgba(109,140,255,.34); box-shadow: 0 0 0 3px rgba(109,140,255,.07); }
.search-wrap input { min-height: 40px; }
kbd { border-radius: 7px; }

.ticket-list-header { padding: 12px 18px 9px; }
.ticket-grid { padding: 0 12px 12px; gap: 8px; }
.ticket-card {
    min-height: 112px;
    padding: 15px 14px;
    border: 1px solid rgba(255,255,255,.065) !important;
    border-radius: 16px;
    background: rgba(18,22,34,.55);
    box-shadow: inset 0 1px rgba(255,255,255,.015);
}
.ticket-card::before { display: none; }
.ticket-card:hover {
    border-color: rgba(118,140,255,.20) !important;
    background: linear-gradient(100deg, rgba(109,140,255,.055), rgba(167,120,255,.028)), rgba(18,22,34,.72);
    box-shadow: 0 14px 34px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.02);
}
.ticket-type { color: #93a5ff; }
.resolution-chip { color: #ffd0bb; border-color: rgba(255,138,97,.18); background: rgba(255,138,97,.08); }
.role-chip { color: #c0c9d8; }
.rating-chip { color: #ffe0a7; border-color: rgba(255,192,106,.19); background: rgba(255,192,106,.075); }
.ticket-open { border-color: rgba(109,140,255,.20); background: rgba(109,140,255,.085); }
.ticket-open:hover { background: rgba(109,140,255,.14); }
.empty-state { border-radius: 18px; }
.empty-icon { color: #91a2ff; }

/* Viewer */
.page-viewer { background: transparent; }
.viewer-shell { padding: 42px 0 70px; }
.breadcrumb { margin: 0 4px 13px; }
.viewer-summary-card {
    padding: 25px 26px;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(520px 180px at 4% 0%, rgba(255,139,93,.11), transparent 74%),
        radial-gradient(480px 190px at 94% 0%, rgba(118,111,255,.13), transparent 72%),
        rgba(11,14,22,.72);
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255,255,255,.02);
    backdrop-filter: blur(18px);
}
.viewer-heading h1 { margin-top: 7px; font-size: 30px; }
.viewer-heading p { margin-top: 5px; font-size: 10px; }
.resolution-chip, .access-chip { padding: 5px 9px; }
.access-chip { color: #c7d0de; background: rgba(109,140,255,.07); border-color: rgba(109,140,255,.15); }
.viewer-meta-grid {
    gap: 10px;
    margin: 12px 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.viewer-meta-card {
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(11,14,22,.62);
    box-shadow: inset 0 1px rgba(255,255,255,.016);
}
.viewer-meta-card span { color: #718097; }
.viewer-meta-card b { margin-top: 6px; color: #e1e7f0; font-size: 10px; }
.closure-card {
    gap: 20px;
    padding: 18px 20px;
    margin-bottom: 14px;
    border-color: var(--line);
    border-radius: 18px;
    background: rgba(11,14,22,.62);
    box-shadow: inset 0 1px rgba(255,255,255,.016);
}
.closure-block p { color: #b5c0cf; font-size: 10px; }
.closure-divider { background: rgba(255,255,255,.065); }

/* The reader deliberately uses a fixed scroll viewport. No content measurement. */
.transcript-frame-card {
    display: flex;
    flex-direction: column;
    height: clamp(680px, 78vh, 1040px);
    overflow: hidden;
    border-color: var(--line);
    border-radius: var(--radius-xl);
    background: rgba(8,11,18,.82);
    box-shadow: 0 28px 80px rgba(0,0,0,.30), inset 0 1px rgba(255,255,255,.018);
    backdrop-filter: blur(16px);
}
.frame-topbar {
    position: static;
    flex: 0 0 54px;
    min-height: 54px;
    padding: 0 16px;
    border-bottom-color: rgba(255,255,255,.07);
    background: rgba(15,19,30,.94);
    backdrop-filter: blur(20px);
}
.frame-title { color: #b9c4d4; font-size: 9px; }
.frame-title .status-dot { background: var(--teal); }
.frame-actions { gap: 8px; }
.frame-actions a, .frame-actions button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    background: rgba(255,255,255,.025);
    color: #8f9caf;
    font-size: 8px;
}
.frame-actions a:hover, .frame-actions button:hover {
    border-color: rgba(109,140,255,.19);
    background: rgba(109,140,255,.07);
    color: #fff;
}
.transcript-frame {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    border: 0;
    background: #090c14;
    overflow: auto;
}
body.transcript-expanded { overflow: hidden; }
body.transcript-expanded .transcript-frame-card {
    position: fixed;
    inset: 16px;
    z-index: 100;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 38px 120px rgba(0,0,0,.62);
}
body.transcript-expanded::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(3,5,9,.82);
    backdrop-filter: blur(10px);
}
body.transcript-expanded .frame-topbar { flex-basis: 58px; }
body.transcript-expanded .transcript-frame { height: auto !important; min-height: 0; }

/* Dialogs / error pages */
.portal-dialog {
    border-color: var(--line-strong);
    border-radius: 20px;
    box-shadow: 0 36px 120px rgba(0,0,0,.56);
}
.dialog-card {
    padding: 23px;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(20,25,39,.97), rgba(10,13,21,.98));
}
.dialog-close { border-radius: 10px; }
.dialog-input-wrap input {
    min-height: 45px;
    border-radius: 12px;
    background: rgba(6,8,14,.62);
}
.dialog-input-wrap input:focus { border-color: rgba(109,140,255,.34); box-shadow: 0 0 0 3px rgba(109,140,255,.07); }
.message-card {
    border-top: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(11,14,22,.74);
    backdrop-filter: blur(18px);
}
.message-card > img { border-radius: 16px; }

/* Footer */
.site-footer {
    width: min(1500px,calc(100% - 56px));
    border-top-color: rgba(255,255,255,.055);
}
.footer-brand img { border-radius: 9px; }

@media (max-width: 1100px) {
    .header-inner { grid-template-columns: 1fr auto; }
    .portal-nav { display: none; }
    .archive-shell { grid-template-columns: 224px minmax(0,1fr); }
}

@media (max-width: 900px) {
    .site-header { padding-top: 8px; }
    .header-inner { grid-template-columns: 1fr auto; border-radius: 18px; }
    .portal-nav { display: none; }
    .dashboard-hero { padding: 25px; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .archive-shell { grid-template-columns: 1fr; }
    .archive-sidebar { top: auto; }
    .transcript-frame-card { height: 72vh; min-height: 620px; }
}

@media (max-width: 650px) {
    .shell { width: min(100% - 24px,1420px); }
    .header-inner, .site-footer { width: min(100% - 20px,1500px); }
    .header-inner { min-height: 60px; padding: 7px 8px 7px 9px; border-radius: 16px; }
    .brand img { width: 38px; height: 38px; border-radius: 11px; }
    .dashboard-hero { padding: 22px; border-radius: 20px; }
    .account-card { border-radius: 15px; }
    .stat-card { border-radius: 17px; }
    .archive-sidebar, .archive-panel { border-radius: 19px; }
    .ticket-card { border-radius: 14px; }
    .viewer-shell { padding-top: 30px; }
    .viewer-summary-card { border-radius: 20px; }
    .viewer-meta-card { border-radius: 14px; }
    .closure-card { border-radius: 16px; }
    .frame-topbar {
        flex: 0 0 auto;
        align-items: center;
        flex-direction: row;
        padding: 10px 12px;
    }
    .frame-title { min-width: 0; }
    .frame-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .frame-actions { margin-left: auto; }
    .frame-actions a { display: none; }
    .transcript-frame-card { height: 74vh; min-height: 560px; border-radius: 18px; }
    body.transcript-expanded .transcript-frame-card { inset: 8px; border-radius: 16px; }
}

@media (max-width: 430px) {
    .header-actions .button-ghost { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .viewer-meta-grid { grid-template-columns: 1fr; }
    .transcript-frame-card { min-height: 520px; }
}

@media print {
    .transcript-frame-card { height: auto !important; }
    .transcript-frame { height: 100vh !important; min-height: 100vh !important; }
}

/* ==========================================================================\n   v5.3.0 — readability + performance pass\n   Keeps the Development Hub-inspired layout, but removes expensive visual\n   effects and scales the interface type for comfortable desktop reading.\n   ========================================================================== */

:root {
    --shadow: 0 18px 44px rgba(0,0,0,.24);
    --shadow-soft: 0 8px 24px rgba(0,0,0,.16);
}

html { scroll-behavior: auto; }
body {
    background: #080b12;
    font-size: 15px;
}
body::before { display: none; }

/* Remove compositor-heavy glass/blur effects. The same surfaces remain, just
   without asking the GPU to re-blur half the page every time it scrolls. */
.site-header,
.header-inner,
.login-panel,
.info-card,
.dashboard-hero,
.account-card,
.stat-card,
.archive-sidebar,
.archive-panel,
.viewer-summary-card,
.transcript-frame-card,
.frame-topbar,
.message-card,
.portal-dialog::backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.site-header { background: rgba(8,11,18,.98); }
.header-inner { background: #0d111b; box-shadow: 0 8px 24px rgba(0,0,0,.20); }
.dashboard-hero,
.archive-sidebar,
.archive-panel,
.viewer-summary-card,
.login-panel,
.info-card,
.stat-card,
.account-card,
.message-card { background: #0d111b; }
.dashboard-hero { background: linear-gradient(110deg, #0d111b, #101321 72%, #0d111b); }

/* Kill decorative blur blobs that cost more than they contribute. */
.stat-card::after { display: none !important; }
.dashboard-hero::after { opacity: .55; }

/* Smoother controls: no position-shifting hover transforms. */
.button {
    font-size: 12px;
    font-weight: 720;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease !important;
}
.button:hover { transform: none !important; }
.nav-link { transition: background-color .12s ease, color .12s ease; }
.ticket-card { transition: background-color .12s ease, border-color .12s ease !important; }
.ticket-card:hover { transform: none !important; box-shadow: inset 0 0 0 1px rgba(109,140,255,.10) !important; }

/* Header / global typography */
.brand-name { font-size: 16px; font-weight: 760; }
.brand-subtitle { margin-top: 4px; font-size: 11px; color: #98a4b6; }
.nav-link { font-size: 12px; font-weight: 680; }
.status-pill { font-size: 11px; }
.eyebrow { font-size: 10px; letter-spacing: .12em; }
.text-button { font-size: 11px; }

/* Dashboard hero */
.dashboard-intro h1 {
    font-size: clamp(40px, 4vw, 54px);
    line-height: 1.04;
    letter-spacing: -.045em;
}
.dashboard-intro p { font-size: 15px; line-height: 1.55; color: #aeb8c7; }
.account-label { font-size: 9px; letter-spacing: .09em; }
.account-copy b { font-size: 13px; }
.account-copy > span:last-child { font-size: 11px; color: #9aa7b9; }
.verified-badge { font-size: 9px; }

/* Stats */
.stat-card { min-height: 138px; }
.stat-label { font-size: 11px; letter-spacing: .08em; }
.stat-value-row b { font-size: 35px; }
.stat-icon { font-size: 13px; }
.stat-card small { font-size: 11px; line-height: 1.45; color: #8f9caf; }

/* Filters */
.sidebar-heading h2 { font-size: 20px; }
.filter-label { font-size: 10px; }
.filter-chip { min-height: 42px; font-size: 12px; font-weight: 650; }
.filter-chip b { font-size: 10px; }
.sidebar-note { font-size: 11px; line-height: 1.5; }
.note-mark { font-size: 10px; }

/* Archive toolbar */
.archive-title-row h2 { font-size: 24px; }
.archive-count { font-size: 10px; }
.search-wrap { min-height: 44px; }
.search-wrap input { font-size: 12px; }
.search-icon { font-size: 13px; }
.search-wrap kbd { font-size: 9px; }
.sort-wrap { min-height: 44px; }
.sort-wrap > span { font-size: 9px; }
.sort-wrap select { font-size: 11px; }

/* Ticket list: substantially larger than the 7–9px labels from v5.2. */
.ticket-list-header {
    padding-top: 13px;
    padding-bottom: 10px;
    font-size: 9px;
    letter-spacing: .075em;
}
.ticket-card {
    content-visibility: auto;
    contain-intrinsic-size: 112px;
    padding: 15px 14px;
}
.ticket-type { font-size: 10px; letter-spacing: .085em; }
.ticket-number { font-size: 9px; }
.ticket-card h3 { margin-top: 6px; font-size: 16px; line-height: 1.25; }
.ticket-reason { margin-top: 4px; font-size: 11px; line-height: 1.45; color: #a2adbc; }
.ticket-date { font-size: 10px; }
.ticket-cell small { font-size: 9px; letter-spacing: .07em; }
.ticket-cell b { margin-top: 5px; font-size: 11px; line-height: 1.35; color: #dbe1e9; }
.ticket-open { min-height: 38px; font-size: 11px; }
.resolution-chip, .role-chip, .rating-chip { font-size: 9px; }
.no-results h3 { font-size: 17px; }
.no-results p { font-size: 12px; }

/* Viewer readability */
.breadcrumb { font-size: 11px; }
.viewer-heading h1 { font-size: clamp(29px, 3vw, 34px); }
.viewer-heading p { font-size: 11px; }
.viewer-meta-card span { font-size: 9px; letter-spacing: .075em; }
.viewer-meta-card b { font-size: 12px; line-height: 1.35; }
.closure-block p { font-size: 12px; line-height: 1.55; color: #c7d0dc; }
.frame-title { font-size: 11px; }
.frame-actions a, .frame-actions button { font-size: 10px; }

/* Reader: favour scroll performance over effects. */
.transcript-frame-card {
    box-shadow: 0 12px 34px rgba(0,0,0,.20) !important;
    contain: layout paint;
}
.frame-topbar { background: #101521; }
.transcript-frame {
    background: #090c14;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    color-scheme: dark;
}
body.transcript-expanded .transcript-frame-card { box-shadow: 0 14px 48px rgba(0,0,0,.34) !important; }
body.transcript-expanded::after { background: rgba(3,5,9,.90); backdrop-filter: none !important; }

/* Home / sign-in text */
.hero-lead { font-size: 16px; line-height: 1.65; }
.login-note { font-size: 12px; }
.login-panel-top { font-size: 11px; }
.login-panel-brand h2 { font-size: 22px; }
.login-panel-brand p { font-size: 12px; }
.login-benefit b { font-size: 13px; }
.login-benefit small { font-size: 11px; }
.info-card h3 { font-size: 17px; }
.info-card p { font-size: 12px; line-height: 1.55; }

/* Footer */
.footer-brand b { font-size: 11px; }
.footer-brand span, .footer-meta { font-size: 10px; }

/* Avoid expensive motion entirely for people who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 650px) {
    .dashboard-intro h1 { font-size: 34px; }
    .dashboard-intro p { font-size: 14px; }
    .ticket-card h3 { font-size: 15px; }
    .ticket-reason { white-space: normal; }
    .viewer-heading h1 { font-size: 28px; }
}
