
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

/* =========================================================================
   Darksparrow portal - panel build
   Drop-in replacement. Every class name from the previous sheet is preserved.

   Direction: rack panel. Flat graphite surfaces, hairline rules, square
   corners, silkscreen labels in mono, and state carried by LEDs and a 2px
   left rail rather than by glow or gradient.

   Fonts are pulled from Google above. To self-host or drop back to system
   faces, delete the @import and set --font / --font-mono below.
   ========================================================================= */

:root {
    /* Surfaces - cool graphite, flat, no glow */
    --background: #0e1013;
    --background-elevated: #15181d;
    --background-soft: #1b1f25;
    --background-hover: #22272e;
    --background-rail: #0a0c0e;

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #edeff2;
    --text-soft: #a3a9b3;
    --text-muted: #6d7480;

    /* Accent - kept violet for brand continuity, sharpened and desaturated
       slightly so it reads as an indicator colour, not a decoration. */
    --purple: #8f5cff;
    --purple-strong: #7136f0;
    --purple-soft: rgba(143, 92, 255, 0.14);
    --purple-line: rgba(143, 92, 255, 0.34);

    /* Signal colours - LED palette */
    --blue: #4c8df6;
    --green: #3fcf6b;
    --amber: #e0a32e;
    --red: #e5484d;

    --sidebar-width: 16.5rem;
    --topbar-height: 4.5rem;

    /* Near-square. Kept as variables so any inline template use still works. */
    --radius-small: 2px;
    --radius-medium: 3px;
    --radius-large: 3px;

    /* No drop shadows in this direction - a hairline top highlight only. */
    --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);

    --font: "Atkinson Hyperlegible Next", Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Silkscreen label treatment, used everywhere a field is named */
    --label-size: 0.64rem;
    --label-tracking: 0.13em;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.94rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.has-open-sidebar {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
iframe:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-small);
    background: var(--text);
    color: var(--background);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transform: translateY(-200%);
    transition: transform 120ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

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

/* -------------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------------- */

.portal-shell {
    min-height: 100vh;
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--background-rail);
}

.sidebar-brand {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
}

.brand-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
}

.brand-mark {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius-small);
    background: var(--purple-soft);
    color: #c9adff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-copy {
    display: grid;
    min-width: 0;
}

.brand-copy strong {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-copy small {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.02em;
}

.sidebar-navigation {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.55rem;
}

.sidebar-navigation ul {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem 0.62rem 0.85rem;
    border-radius: var(--radius-small);
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 110ms linear, color 110ms linear;
}

/* Channel-strip rail: 2px, always present, lit only when active */
.sidebar-link::before {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    left: 0;
    width: 2px;
    background: transparent;
    content: "";
}

.sidebar-link:hover {
    background: var(--background-soft);
    color: var(--text);
}

.sidebar-link:hover::before {
    background: var(--border-strong);
}

.sidebar-link.is-active {
    background: var(--background-hover);
    color: var(--text);
}

.sidebar-link.is-active::before {
    background: var(--purple);
}

.sidebar-icon {
    display: grid;
    width: 1.1rem;
    height: 1.1rem;
    place-items: center;
    color: currentColor;
}

.sidebar-support {
    display: grid;
    gap: 0.4rem;
    margin: 0 0.55rem 0.7rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-elevated);
}

.sidebar-support strong {
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-support p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.sidebar-support .button {
    margin-top: 0.35rem;
}

.sidebar-account {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
}

.account-avatar {
    display: grid;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    background: var(--background-soft);
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
}

.account-copy {
    display: grid;
    min-width: 0;
}

.account-copy strong,
.account-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy strong {
    font-size: 0.8rem;
    font-weight: 600;
}

.account-copy span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.account-menu {
    position: absolute;
    right: 0.8rem;
    bottom: calc(100% - 0.2rem);
    z-index: 10;
    min-width: 11rem;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    background: var(--background-soft);
}

.account-menu a,
.account-menu button {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
    background: var(--background-hover);
    color: var(--text);
}

.account-menu-summary {
    display: grid;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.account-menu-summary strong,
.account-menu-summary span {
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-summary strong {
    font-size: 0.74rem;
    font-weight: 600;
}

.account-menu-summary span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.portal-page {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    min-height: var(--topbar-height);
    grid-template-columns: minmax(10rem, 1fr) minmax(18rem, 30rem) minmax(12rem, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 16, 19, 0.9);
    backdrop-filter: blur(0.75rem);
}

.topbar-heading {
    display: grid;
}

.topbar-heading strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.topbar-context {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.topbar-centre {
    display: flex;
    justify-content: center;
}

.topbar-security {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-elevated);
}

.topbar-search:focus-within {
    border-color: var(--purple-line);
}

.topbar-search input {
    min-width: 0;
    padding: 0.62rem 0.75rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-search button {
    width: 2.6rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.topbar-search button:hover {
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.system-health {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    white-space: nowrap;
}

.system-health:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.icon-button {
    display: inline-grid;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--border);
    background: var(--background-soft);
    color: var(--text);
}

.notification-button {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -0.1rem;
    right: -0.1rem;
    display: grid;
    min-width: 0.95rem;
    height: 0.95rem;
    padding: 0 0.2rem;
    place-items: center;
    border: 1px solid var(--background);
    border-radius: 1px;
    background: var(--purple);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 600;
}

.sidebar-close,
.mobile-menu-button {
    display: none;
}

.portal-content {
    width: min(100%, 102rem);
    margin: 0 auto;
    padding: 1.75rem 1.25rem 2.5rem;
}

.portal-footer {
    display: flex;
    width: min(100%, 102rem);
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.portal-footer nav {
    display: flex;
    gap: 1.1rem;
}

.portal-footer a:hover {
    color: var(--text);
}

.portal-backdrop {
    display: none;
}

/* -------------------------------------------------------------------------
   Headings and primitives
   ------------------------------------------------------------------------- */

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.page-heading h1,
.panel-heading h2,
.service-card h2,
.workspace-heading h1 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.page-heading h1 {
    margin-top: 0.3rem;
    font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}

.page-heading p {
    max-width: 48rem;
    margin: 0.45rem 0 0;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.eyebrow {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    font-weight: 500;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 110ms linear, border-color 110ms linear;
}

.button-primary {
    border-color: var(--purple-strong);
    background: var(--purple-strong);
    color: #fff;
}

.button-primary:hover {
    border-color: var(--purple);
    background: var(--purple);
}

.button-secondary {
    border-color: var(--border-strong);
    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--purple-line);
    background: var(--background-soft);
}

.button-small {
    min-height: 1.95rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.68rem;
}

.button-full {
    width: 100%;
}

.text-link,
.metric-link {
    color: #b394ff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.text-link:hover,
.metric-link:hover {
    color: #d3c0ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
}

/* Scribble strip: every panel is named in silkscreen mono on a darker bar */
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--border);
    background: var(--background-rail);
}

.panel-heading h2 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-heading .eyebrow {
    display: none;
}

/* -------------------------------------------------------------------------
   Metrics - mono numerals, lit left rail
   ------------------------------------------------------------------------- */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.metric-card {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.95rem 0.95rem 0.95rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
    transition: border-color 110ms linear;
}

.metric-card::before {
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: -1px;
    width: 2px;
    background: var(--border-strong);
    content: "";
}

.metric-card:hover {
    border-color: var(--border-strong);
}

.metric-icon {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-soft);
    font-size: 0.95rem;
}

.metric-icon-purple {
    border-color: rgba(143, 92, 255, 0.3);
    color: #b394ff;
}

.metric-card:has(.metric-icon-purple)::before {
    background: var(--purple);
}

.metric-icon-blue {
    border-color: rgba(76, 141, 246, 0.3);
    color: #7cb0ff;
}

.metric-card:has(.metric-icon-blue)::before {
    background: var(--blue);
}

.metric-icon-green {
    border-color: rgba(63, 207, 107, 0.3);
    color: #6ee197;
}

.metric-card:has(.metric-icon-green)::before {
    background: var(--green);
}

.metric-icon-amber {
    border-color: rgba(224, 163, 46, 0.3);
    color: #f0c46a;
}

.metric-card:has(.metric-icon-amber)::before {
    background: var(--amber);
}

.metric-copy {
    display: grid;
    align-content: center;
}

.metric-copy strong {
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.metric-copy span {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.metric-link {
    grid-column: 1 / -1;
    margin-top: 0.4rem;
}

/* -------------------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------------------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 0.72fr);
    gap: 0.75rem;
}

.dashboard-main,
.dashboard-aside {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.service-list {
    display: grid;
}

.service-row {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}

.service-row:last-child {
    border-bottom: 0;
}

.service-row:hover {
    background: var(--background-soft);
}

.service-logo {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-soft);
    color: #b394ff;
}

.service-logo svg {
    width: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 1.6;
}

.service-logo-large {
    width: 2.7rem;
    height: 2.7rem;
}

.service-copy {
    min-width: 0;
}

.service-copy h3 {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.service-copy p {
    overflow: hidden;
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Signature: square LEDs, not round dots */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 1px;
    background: var(--text-muted);
}

.status-operational {
    color: var(--green);
}

.status-dot.status-operational {
    background: var(--green);
    box-shadow: 0 0 0.5rem rgba(63, 207, 107, 0.5);
}

.status-maintenance {
    color: var(--amber);
}

.status-dot.status-maintenance {
    background: var(--amber);
    box-shadow: 0 0 0.5rem rgba(224, 163, 46, 0.5);
}

.status-degraded {
    color: var(--red);
}

.status-dot.status-degraded {
    background: var(--red);
    box-shadow: 0 0 0.5rem rgba(229, 72, 77, 0.5);
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--border);
}

.quick-links a {
    display: grid;
    min-height: 6.5rem;
    align-content: center;
    justify-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--background-elevated);
    text-align: center;
    transition: background-color 110ms linear;
}

.quick-links a:hover {
    background: var(--background-hover);
}

.quick-links a span {
    color: #b394ff;
    font-size: 1.3rem;
}

.quick-links a strong {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.announcement-list {
    display: grid;
}

.announcement-list article {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.announcement-list article:last-child {
    border-bottom: 0;
}

.announcement-list strong {
    font-size: 0.8rem;
    font-weight: 600;
}

.announcement-list p {
    margin: 0.25rem 0;
    color: var(--text-soft);
    font-size: 0.76rem;
}

.announcement-list time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.account-summary dl,
.service-metadata {
    display: grid;
    margin: 0;
}

.account-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--border);
}

.account-summary dl div,
.service-metadata div {
    padding: 0.75rem 0.85rem;
    background: var(--background-elevated);
}

.service-metadata div {
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}

.account-summary dt,
.service-metadata dt {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.account-summary dd,
.service-metadata dd {
    margin: 0.3rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ticket-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}

.ticket-preview:last-child {
    border-bottom: 0;
}

.ticket-preview:hover {
    background: var(--background-soft);
}

.ticket-preview strong {
    font-size: 0.8rem;
    font-weight: 600;
}

.ticket-preview p {
    margin: 0.18rem 0 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.67rem;
}

.ticket-reference {
    color: #b394ff;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

/* -------------------------------------------------------------------------
   Pills - flat, bordered, mono
   ------------------------------------------------------------------------- */

.pill {
    display: inline-flex;
    min-height: 1.5rem;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border: 1px solid currentColor;
    border-radius: 1px;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pill-warning,
.pill-open,
.pill-awaitingclient,
.pill-awaitingsupport,
.pill-issued,
.pill-overdue,
.pill-suspended,
.pill-disabled,
.pill-maintenance {
    color: #e6b658;
}

.pill-success,
.pill-resolved,
.pill-paid,
.pill-active,
.pill-operational,
.pill-information {
    color: #62d98d;
}

.pill-draft,
.pill-void,
.pill-unknown,
.pill-degraded {
    color: var(--text-muted);
}

.pill-closed,
.pill-offline,
.pill-critical {
    color: #ef7276;
}

/* .pill-closed is a success state on tickets, a fault state on services.
   Panels that list services opt into the fault reading. */
.service-list .pill-closed,
.data-table .pill-offline,
.data-table .pill-critical {
    color: #ef7276;
}

/* -------------------------------------------------------------------------
   Service cards
   ------------------------------------------------------------------------- */

.service-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.service-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
}

.service-card-top,
.service-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.service-card h2 {
    font-size: 0.98rem;
}

.service-card p {
    margin: 0.3rem 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.service-metadata {
    gap: 0.4rem;
}

.service-card-actions {
    justify-content: flex-start;
    margin-top: auto;
}

/* -------------------------------------------------------------------------
   Workspace (embedded service frame)
   ------------------------------------------------------------------------- */

.workspace-body .portal-content {
    width: auto;
    padding: 0.75rem;
}

.workspace-shell {
    display: grid;
    min-height: calc(100vh - var(--topbar-height) - 4rem);
    grid-template-rows: auto auto minmax(30rem, 1fr);
    gap: 0.55rem;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
}

.workspace-heading {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.workspace-heading h1 {
    font-size: 0.92rem;
}

.workspace-back {
    padding-right: 0.9rem;
    border-right: 1px solid var(--border);
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.workspace-back:hover {
    color: var(--text);
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.workspace-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--purple-line);
    border-left-width: 2px;
    border-radius: var(--radius-small);
    background: var(--purple-soft);
    color: #c4aeee;
}

.workspace-notice p {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.workspace-frame-wrapper {
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-medium);
    background: #fff;
}

.workspace-frame {
    width: 100%;
    height: 100%;
    min-height: 42rem;
    border: 0;
    background: #fff;
}

/* -------------------------------------------------------------------------
   Empty states, flashes, alerts
   ------------------------------------------------------------------------- */

.empty-state {
    padding: 2.5rem 2rem;
    color: var(--text-soft);
    text-align: center;
}

.empty-state strong {
    font-weight: 600;
}

.empty-state p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-state-small {
    padding: 1.25rem 1rem;
}

.flash-stack {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flash-message,
.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-left-width: 2px;
    border-radius: var(--radius-small);
    background: var(--background-elevated);
}

.flash-message p,
.form-alert p {
    margin: 0;
    font-size: 0.79rem;
}

.flash-success {
    border-color: rgba(63, 207, 107, 0.3);
    border-left-color: var(--green);
    color: #7fe0a4;
}

.flash-error,
.form-alert {
    border-color: rgba(229, 72, 77, 0.3);
    border-left-color: var(--red);
    color: #f28f92;
}

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */

.portal-form {
    display: grid;
    gap: 0.9rem;
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field > span {
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    font-weight: 500;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    outline: none;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.form-field textarea {
    min-height: 7rem;
    resize: vertical;
    line-height: 1.6;
}

.form-field select {
    cursor: pointer;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--purple);
}

.form-field small,
.checkbox-field small {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.45;
}

.form-panel {
    padding: 1.1rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.checkbox-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background);
    cursor: pointer;
}

.checkbox-field:hover {
    border-color: var(--border-strong);
}

.checkbox-field input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0.18rem 0 0;
    accent-color: var(--purple);
}

.checkbox-field span {
    display: grid;
    gap: 0.15rem;
}

.checkbox-field strong {
    font-size: 0.76rem;
    font-weight: 600;
}

.support-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.support-callout strong {
    font-size: 0.86rem;
    font-weight: 600;
}

.support-callout p {
    max-width: 42rem;
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

/* -------------------------------------------------------------------------
   Authentication
   ------------------------------------------------------------------------- */

.authentication-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
    background: var(--background);
}

.authentication-shell {
    display: grid;
    width: min(100%, 62rem);
    min-height: 34rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(21rem, 0.9fr);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
}

/* The brand panel is the one place the sheet allows itself a texture:
   a faint patch-bay grid, drawn in CSS, no image required. */
.authentication-brand {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.75rem, 5vw, 3.5rem);
    background:
            linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 100% 2.25rem,
             linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 2.25rem 100%,
             var(--background-rail);
}

.authentication-brand-mark {
    display: grid;
    width: 3.2rem;
    height: 3.2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius-small);
    background: var(--purple-soft);
    color: #c9adff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
}

.authentication-brand h1 {
    max-width: 30rem;
    margin: 0.5rem 0 0;
    font-size: clamp(1.9rem, 3.4vw, 3.1rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.authentication-brand p {
    max-width: 32rem;
    margin: 0.9rem 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.authentication-card {
    display: grid;
    align-content: center;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border-left: 1px solid var(--border);
    background: var(--background-elevated);
}

.authentication-heading {
    margin-bottom: 1.25rem;
}

.authentication-heading h2 {
    margin: 0.3rem 0 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.authentication-heading p,
.authentication-help {
    color: var(--text-muted);
    font-size: 0.77rem;
}

.authentication-heading p {
    margin: 0.4rem 0 0;
}

.authentication-help {
    margin: 1.25rem 0 0;
    text-align: center;
}

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */

.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    white-space: nowrap;
}

.data-table td {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.data-table th {
    position: sticky;
    top: 0;
    background: var(--background-rail);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    font-weight: 500;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--background-soft);
}

.table-primary-link {
    color: #b394ff;
    font-weight: 500;
}

.table-primary-link:hover {
    color: #d3c0ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.numeric-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table-secondary {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.66rem;
}

/* -------------------------------------------------------------------------
   Ticket detail
   ------------------------------------------------------------------------- */

.ticket-page-heading {
    align-items: flex-start;
}

.breadcrumb-link {
    display: inline-block;
    margin-bottom: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.breadcrumb-link:hover {
    color: var(--text);
}

.ticket-heading-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(17rem, 0.55fr);
    gap: 0.75rem;
    align-items: start;
}

.conversation-list {
    display: grid;
}

.conversation-message {
    position: relative;
    padding: 1rem 1rem 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.conversation-message::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: transparent;
    content: "";
}

.conversation-message:last-child {
    border-bottom: 0;
}

.conversation-message.is-current-user {
    background: var(--background-soft);
}

.conversation-message.is-current-user::before {
    background: var(--purple);
}

.conversation-message header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.conversation-message header strong {
    font-size: 0.79rem;
    font-weight: 600;
}

.conversation-message header time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.conversation-body {
    margin-top: 0.6rem;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.6;
}

.ticket-reply-form {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--background-rail);
}

.details-list {
    display: grid;
    margin: 0;
}

.details-list div {
    display: grid;
    grid-template-columns: minmax(6rem, 0.6fr) minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.details-list div:last-child {
    border-bottom: 0;
}

.details-list dt {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--label-size);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.details-list dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* -------------------------------------------------------------------------
   Activity log
   ------------------------------------------------------------------------- */

.activity-list {
    display: grid;
}

.activity-event {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}

.activity-event:last-child {
    border-bottom: 0;
}

.activity-icon {
    display: grid;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-soft);
    color: #b394ff;
}

.activity-copy strong {
    font-size: 0.79rem;
    font-weight: 600;
}

.activity-copy p {
    margin: 0.16rem 0 0;
    color: var(--text-muted);
    font-size: 0.71rem;
}

.activity-meta {
    display: grid;
    justify-items: end;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

/* -------------------------------------------------------------------------
   Errors
   ------------------------------------------------------------------------- */

.error-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    background: var(--background);
}

.error-shell {
    display: grid;
    width: min(100%, 44rem);
    gap: 0.9rem;
}

.error-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
}

.error-brand-mark {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius-small);
    background: var(--purple-soft);
    color: #c9adff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
}

.error-brand > span:last-child {
    display: grid;
}

.error-brand strong {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.error-brand small {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.error-state {
    display: grid;
    max-width: 36rem;
    justify-items: start;
    gap: 0.75rem;
    margin: 4rem auto;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--background-elevated);
}

.error-state h1,
.error-state p {
    margin: 0;
}

.error-state h1 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.error-state p {
    color: var(--text-soft);
}

.error-code {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius-small);
    background: var(--purple-soft);
    color: #c9adff;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
}

.error-code-danger {
    border-color: rgba(229, 72, 77, 0.35);
    background: rgba(229, 72, 77, 0.1);
    color: #f28f92;
}

.error-body .error-state {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(1.35rem, 4vw, 2.25rem);
    border-color: var(--border-strong);
}

.error-body .error-state h1 {
    max-width: 38rem;
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    line-height: 1.08;
}

.error-body .error-state p {
    max-width: 38rem;
    line-height: 1.65;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.technical-details {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background);
}

.technical-details summary {
    cursor: pointer;
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.technical-details pre {
    overflow-x: auto;
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.error-body .technical-details {
    margin-top: 0.35rem;
}

/* -------------------------------------------------------------------------
   Administration console
   Same chassis, red-keyed rails so you always know which side you are on.
   ------------------------------------------------------------------------- */

.admin-sidebar {
    background: var(--background-rail);
    box-shadow: inset -2px 0 0 rgba(229, 72, 77, 0.4);
}

.admin-brand-mark {
    border-color: rgba(229, 72, 77, 0.4);
    background: rgba(229, 72, 77, 0.1);
    color: #f2a1a4;
}

.admin-topbar {
    border-bottom-color: rgba(229, 72, 77, 0.28);
}

.admin-security-label {
    color: #f2a1a4;
}

.admin-warning-card {
    border-color: rgba(229, 72, 77, 0.28);
    border-left-width: 2px;
    border-left-color: var(--red);
    background: rgba(229, 72, 77, 0.05);
}

.admin-warning-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.71rem;
}

.admin-metrics-grid {
    margin-bottom: 0.75rem;
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.admin-action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    transition: border-color 110ms linear, background-color 110ms linear;
}

.admin-action-card:hover {
    border-color: var(--border-strong);
    background: var(--background-soft);
}

.admin-action-card > span {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--background-soft);
    color: #b394ff;
    font-size: 1.05rem;
}

.admin-action-card strong {
    font-size: 0.86rem;
    font-weight: 600;
}

.admin-action-card p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.73rem;
}

.admin-two-column {
    display: grid;
    grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.65fr);
    gap: 0.75rem;
    align-items: start;
}

.admin-two-column-wide-form {
    grid-template-columns: minmax(20rem, 0.85fr) minmax(0, 1.55fr);
}

.admin-form-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 0.75rem);
}

.admin-form-panel > .panel-heading {
    margin: -1.1rem -1.1rem 1rem;
}

.admin-danger-option {
    border-color: rgba(229, 72, 77, 0.3);
    border-left-width: 2px;
    border-left-color: var(--red);
    background: rgba(229, 72, 77, 0.05);
}

.admin-membership {
    display: block;
    margin-bottom: 0.18rem;
    white-space: nowrap;
}

.admin-url {
    display: inline-block;
    max-width: 21rem;
    overflow: hidden;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-announcement-list article {
    padding: 0.9rem 1rem;
}

.admin-announcement-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-announcement-list small {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.sidebar-admin-switch {
    display: grid;
    gap: 0.5rem;
    margin: 0 0.55rem 0.6rem;
    padding: 0.8rem;
    border: 1px solid rgba(229, 72, 77, 0.25);
    border-left-width: 2px;
    border-left-color: var(--red);
    border-radius: var(--radius-small);
    background: rgba(229, 72, 77, 0.05);
}

.sidebar-admin-switch strong {
    font-size: 0.78rem;
    font-weight: 600;
}

.sidebar-admin-switch p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.admin-definition-form {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.admin-definition-form summary {
    cursor: pointer;
    color: #b394ff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-definition-form[open] summary {
    margin-bottom: 0.9rem;
}

/* -------------------------------------------------------------------------
   Responsive - breakpoints unchanged from the previous sheet
   ------------------------------------------------------------------------- */

@media (max-width: 78rem) {
    .portal-topbar {
        grid-template-columns: minmax(10rem, 1fr) minmax(15rem, 24rem) auto;
    }

    .topbar-centre {
        display: none;
    }

    .system-health span:last-child {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-aside .account-summary {
        grid-column: 1 / -1;
    }

    .service-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 72rem) {
    .admin-two-column,
    .admin-two-column-wide-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-form-panel {
        position: static;
    }
}

@media (max-width: 58rem) {
    .portal-sidebar {
        width: min(18rem, calc(100vw - 3rem));
        transform: translateX(-102%);
        transition: transform 160ms ease;
    }

    .portal-shell.sidebar-is-open .portal-sidebar {
        transform: translateX(0);
    }

    .portal-page {
        margin-left: 0;
    }

    .portal-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .mobile-menu-button,
    .sidebar-close {
        display: inline-grid;
    }

    .topbar-search {
        display: none;
    }

    .portal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(6, 7, 9, 0.75);
    }

    .portal-shell.sidebar-is-open + .portal-backdrop {
        display: block;
    }

    .service-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .authentication-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .authentication-brand {
        min-height: 16rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .authentication-card {
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}

@media (max-width: 48rem) {
    .admin-action-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 42rem) {
    .portal-topbar {
        min-height: 4rem;
        padding: 0.6rem 0.8rem;
    }

    .topbar-context {
        display: none;
    }

    .portal-content {
        padding: 1rem 0.85rem 2rem;
    }

    .portal-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem 0.85rem 1.5rem;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading .button {
        width: 100%;
    }

    .metrics-grid,
    .dashboard-aside,
    .quick-links {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-aside .account-summary {
        grid-column: auto;
    }

    .service-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .service-row .service-status,
    .service-row .button {
        grid-column: 2;
        justify-self: start;
    }

    .ticket-preview {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ticket-reference {
        grid-column: 1 / -1;
    }

    .account-summary dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace-toolbar,
    .workspace-heading,
    .workspace-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-back {
        padding-right: 0;
        border-right: 0;
    }

    .workspace-actions {
        width: 100%;
    }

    .workspace-actions .button {
        width: 100%;
    }

    .authentication-body {
        padding: 0;
    }

    .authentication-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .authentication-brand {
        min-height: 13rem;
        padding: 1.5rem;
    }

    .authentication-brand h1 {
        font-size: 1.9rem;
    }

    .authentication-card {
        padding: 1.5rem;
    }

    .support-callout,
    .form-actions,
    .conversation-message header {
        align-items: stretch;
        flex-direction: column;
    }

    .conversation-message header {
        align-items: flex-start;
        gap: 0.2rem;
    }

    .form-actions .button,
    .support-callout .button {
        width: 100%;
    }

    .activity-event {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .activity-meta {
        grid-column: 2;
        justify-items: start;
    }

    .details-list div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
    }

    .details-list dd {
        text-align: left;
    }
}

@media (max-width: 32rem) {
    .error-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .error-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
