:root {
    color-scheme: dark;
    --page-bg: #05090f;
    --page-bg-soft: #0b1320;
    --glass: rgba(8, 13, 20, 0.76);
    --glass-strong: rgba(8, 12, 18, 0.88);
    --glass-soft: rgba(15, 22, 34, 0.44);
    --line: rgba(196, 214, 230, 0.16);
    --line-strong: rgba(215, 229, 241, 0.3);
    --ink: #edf3fa;
    --muted: #a9b8c8;
    --muted-strong: #cfdeec;
    --accent: #8cb8d3;
    --accent-strong: #d9e9f5;
    --accent-warm: #d8b98c;
    --ok: #8ed1b5;
    --alert: #e79889;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --content-width: 1380px;
    --heading-font: Bahnschrift, "Trebuchet MS", sans-serif;
    --body-font: "Aptos", "Segoe UI", sans-serif;
    --mono-font: Consolas, "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(143, 192, 221, 0.09), transparent 36%),
        linear-gradient(180deg, #04070c 0%, var(--page-bg) 52%, #030507 100%);
    color: var(--ink);
    font-family: var(--body-font);
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

img {
    max-width: 100%;
}

[data-protected-media],
.ambient-photo,
.ambient-strip {
    -webkit-user-select: none;
    user-select: none;
}

.dch-page {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

.ambient-scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.ambient-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 4, 7, 0.42), rgba(2, 5, 9, 0.84)),
        radial-gradient(circle at 78% 20%, rgba(224, 184, 128, 0.18), transparent 24%),
        radial-gradient(circle at 18% 18%, rgba(116, 159, 188, 0.14), transparent 24%);
}

.ambient-photo {
    position: absolute;
    inset: -6%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.ambient-photo--base {
    background-image: var(--atmo-dark-url);
    opacity: 0.28;
    filter: saturate(0.9) brightness(0.4);
    animation: ambient-pan 34s ease-in-out infinite alternate;
}

.ambient-photo--depth {
    background-image: var(--atmo-blur-url);
    opacity: 0.11;
    filter: blur(30px) saturate(1.02) brightness(0.36);
    transform: scale(1.18);
    animation: ambient-depth 26s ease-in-out infinite alternate;
}

.ambient-veil,
.ambient-orb,
.ambient-strip {
    position: absolute;
}

.ambient-veil {
    inset: 0;
    background:
        radial-gradient(circle at 30% 18%, rgba(110, 154, 186, 0.16), transparent 22%),
        radial-gradient(circle at 72% 78%, rgba(210, 182, 143, 0.12), transparent 20%);
    filter: blur(34px);
    animation: ambient-breathe 18s ease-in-out infinite;
}

.ambient-orb {
    width: 30rem;
    height: 30rem;
    right: -9rem;
    top: -7rem;
    background: radial-gradient(circle, rgba(141, 188, 215, 0.12), transparent 68%);
    filter: blur(10px);
    animation: ambient-breathe 22s ease-in-out infinite alternate;
}

.ambient-strip {
    background-image: var(--atmo-full-url);
    background-position: center;
    background-size: cover;
    opacity: 0.12;
    filter: blur(7px) saturate(0.8) brightness(0.42);
    border: 1px solid rgba(238, 243, 250, 0.07);
}

.ambient-strip--top {
    top: 2.5rem;
    left: 50%;
    width: min(74vw, 72rem);
    height: 5rem;
    transform: translateX(-50%);
    border-radius: 999px;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}

.ambient-strip--side {
    left: -3rem;
    bottom: 10vh;
    width: 18rem;
    height: 34vh;
    border-radius: 0 999px 999px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 28%);
    mask-image: linear-gradient(90deg, transparent, black 28%);
}

.surface {
    position: relative;
    z-index: 1;
}

.shell {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
}

.glass-card,
.panel,
.metric-card,
.status-card {
    background: linear-gradient(180deg, rgba(14, 20, 30, 0.86), rgba(8, 12, 18, 0.92));
    border: 1px solid rgba(215, 229, 241, 0.14);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(120%);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.eyebrow {
    margin: 0 0 0.9rem;
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.hero-title,
.panel-title,
.section-title,
.login-title {
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hero-title,
.login-title {
    margin: 0;
    line-height: 1.02;
}

.hero-title {
    font-size: clamp(2.15rem, 4vw, 3.4rem);
}

.login-title {
    font-size: clamp(2.35rem, 5vw, 4.25rem);
    max-width: 12ch;
}

.lede,
.subtitle,
.panel-subtitle,
.small-copy {
    color: var(--muted);
    line-height: 1.65;
    max-width: 66ch;
    overflow-wrap: anywhere;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.topbar > *,
.section-bar > *,
.toolbar > *,
.topbar-actions > *,
.login-meta > *,
.brand-signature > *,
.section-stack > *,
.panel-header > * {
    min-width: 0;
}

.topbar-actions,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.brand-lockup {
    width: clamp(10rem, 22vw, 15rem);
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
}

.brand-signature {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand-mark,
.loader-mark {
    background-image: var(--brand-mark-url);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    flex: none;
}

.brand-mark {
    width: clamp(4.6rem, 10vw, 6rem);
    aspect-ratio: 1;
    border-radius: 22px;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.34),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.loader-token {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.loader-mark {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 8px;
    opacity: 0.92;
}

.loader-mark--pulse {
    animation: loader-pulse 2.8s ease-in-out infinite;
}

.identity-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.chip,
.status-pill,
.toggle-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(223, 235, 247, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-strong);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: normal;
}

.toggle-chip,
.primary-button,
.ghost-button {
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

.toggle-chip:hover,
.toggle-chip:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.toggle-chip {
    background: rgba(157, 197, 220, 0.08);
}

.toggle-chip[data-audio-active="true"] {
    background: rgba(140, 184, 211, 0.18);
    color: #f4f9ff;
    box-shadow: 0 0 0 1px rgba(140, 184, 211, 0.16) inset;
}

.primary-button,
.ghost-button {
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    border: 1px solid transparent;
    text-align: center;
    white-space: normal;
}

.primary-button {
    background: linear-gradient(135deg, rgba(140, 184, 211, 0.96), rgba(107, 155, 185, 0.96));
    color: #071019;
    font-weight: 700;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--ink);
}

.metric-grid,
.status-grid,
.panel-grid {
    display: grid;
    gap: 1rem;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.status-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.panel-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 296px), 1fr));
}

.metric-card,
.status-card {
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.2rem;
}

.metric-label,
.status-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-value {
    margin: 0.55rem 0 0;
    color: #f8fbff;
    font-family: var(--heading-font);
    font-size: 2.05rem;
    font-weight: 600;
}

.metric-value--state {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.2;
}

.metric-caption,
.status-note {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.status-value {
    margin: 0.45rem 0 0;
    color: var(--accent-strong);
    font-size: 1.1rem;
    font-weight: 600;
}

.panel {
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.panel-header {
    padding: 1.2rem 1.35rem 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-title {
    margin: 0 0 0.4rem;
    font-size: 1.18rem;
}

.panel-subtitle {
    margin: 0;
    font-size: 0.92rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: #c5d7e8;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.035);
}

td {
    color: #eaf2fb;
    font-size: 0.95rem;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.mono {
    font-family: var(--mono-font);
    font-size: 0.88rem;
    color: #d7e5f0;
}

.status-pill {
    min-height: auto;
    padding: 0.3rem 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-pill--alert {
    color: #ffe5e0;
    background: rgba(231, 152, 137, 0.18);
    border-color: rgba(231, 152, 137, 0.28);
}

.status-pill--ok {
    color: #e7fbf4;
    background: rgba(142, 209, 181, 0.16);
    border-color: rgba(142, 209, 181, 0.24);
}

.empty-state {
    padding: 1.2rem 1.35rem 1.5rem;
    color: var(--muted);
}

.section-stack {
    display: grid;
    gap: 1rem;
}

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

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 430px);
    gap: clamp(1.4rem, 3vw, 3rem);
    align-items: center;
    min-height: 100vh;
    padding: clamp(1.5rem, 3vw, 2.2rem) 0;
}

.login-story {
    padding: clamp(1rem, 2vw, 1.8rem);
    max-width: 42rem;
}

.login-card {
    border-radius: 32px;
    padding: 1.5rem;
}

.login-frame {
    padding: 1.55rem;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(10, 15, 22, 0.82), rgba(7, 11, 16, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field label {
    color: var(--muted-strong);
    font-size: 0.86rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    border: 1px solid rgba(217, 233, 245, 0.12);
    border-radius: 16px;
    padding: 0.92rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    outline: none;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
    border-color: rgba(140, 184, 211, 0.4);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(140, 184, 211, 0.12);
}

.field select {
    width: 100%;
    border: 1px solid rgba(217, 233, 245, 0.12);
    border-radius: 14px;
    padding: 0.72rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    outline: none;
}

.error-banner {
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: #ffe8e3;
    background: rgba(231, 152, 137, 0.14);
    border: 1px solid rgba(231, 152, 137, 0.22);
}

.success-banner {
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: #e7fbf4;
    background: rgba(142, 209, 181, 0.14);
    border: 1px solid rgba(142, 209, 181, 0.2);
}

.dashboard-banner {
    margin: 1rem 1.2rem 0;
}

.helper-copy {
    margin: -0.1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.login-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding-top: 0.3rem;
    flex-wrap: wrap;
}

.auth-panel-topbar {
    align-items: flex-start;
}

.secondary-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.secondary-link:hover,
.secondary-link:focus-visible {
    text-decoration: underline;
}

.language-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.language-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(215, 229, 241, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    text-decoration: none;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.language-link:hover,
.language-link:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    color: var(--ink);
}

.language-link-active {
    background: rgba(140, 184, 211, 0.16);
    border-color: rgba(140, 184, 211, 0.28);
    color: #f4f9ff;
}

.auth-submit {
    justify-content: center;
    text-align: center;
}

.auth-link-button {
    display: inline-flex;
    text-decoration: none;
}

.toolbar form {
    margin: 0;
}

.dashboard-shell,
.client-shell {
    display: grid;
    gap: 1.15rem;
    padding: 1.5rem 0 2.2rem;
}

.dashboard-shell {
    gap: 0.95rem;
    padding: 1.15rem 0 2rem;
}

.hero-panel {
    border-radius: 32px;
    padding: 1.35rem;
}

.dashboard-shell .hero-panel {
    padding: 1.05rem;
}

.hero-inner {
    display: grid;
    gap: 1.2rem;
    padding: clamp(1rem, 2vw, 1.25rem);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(10, 15, 22, 0.86), rgba(7, 11, 16, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-shell .hero-inner {
    gap: 0.95rem;
    padding: clamp(0.85rem, 1.7vw, 1rem);
}

.dashboard-shell .hero-title {
    font-size: clamp(1.95rem, 3.3vw, 2.85rem);
}

.dashboard-shell .subtitle {
    margin: 0.2rem 0 0;
}

.brand-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.brand-row .brand-lockup {
    width: clamp(8rem, 18vw, 12rem);
}

.section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    margin: 0;
    font-size: 1.1rem;
}

.action-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.68rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(215, 229, 241, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    text-decoration: none;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.action-link:hover,
.action-link:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.action-link--alert {
    border-color: rgba(231, 152, 137, 0.22);
    color: #ffe8e3;
    background: rgba(231, 152, 137, 0.1);
}

.action-link-inline {
    min-height: 1.95rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 0.95rem;
}

.sector-card {
    border-radius: var(--radius-lg);
    padding: 1rem 1.05rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        linear-gradient(180deg, rgba(10, 15, 22, 0.88), rgba(7, 11, 16, 0.94));
    border: 1px solid rgba(215, 229, 241, 0.12);
}

.mission-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
    gap: 1rem;
    align-items: start;
}

.panel-featured {
    min-height: 100%;
    max-height: 31rem;
}

.panel-featured .table-wrap {
    max-height: 24rem;
    overflow: auto;
}

.systems-stack {
    display: grid;
    gap: 1rem;
}

.alert-panel {
    min-height: 100%;
}

.workflow-form {
    display: grid;
    gap: 0.75rem;
}

.field-inline {
    gap: 0.35rem;
}

.field-inline span {
    color: var(--muted-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.workflow-submit {
    width: 100%;
}

.alert-list {
    display: grid;
    gap: 0.85rem;
    padding: 1.1rem 1.2rem 1.3rem;
}

.alert-entry {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.alert-entry p {
    margin: 0.45rem 0 0;
}

.alert-entry__top {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
}

.atmosphere-panel {
    overflow: hidden;
}

.atmosphere-panel-header {
    align-items: center;
}

.atmosphere-stage {
    position: relative;
    min-height: 16rem;
    isolation: isolate;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(6, 10, 16, 0.72), rgba(4, 7, 12, 0.94));
}

.atmosphere-slide,
.atmosphere-stage-overlay,
.atmosphere-stage-copy {
    position: absolute;
    inset: 0;
}

.atmosphere-slide {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 900ms ease, transform 7600ms ease;
}

.atmosphere-slide.is-active {
    opacity: 1;
    transform: scale(1.1);
}

.atmosphere-stage-overlay {
    background:
        linear-gradient(180deg, rgba(3, 6, 10, 0.18), rgba(3, 6, 10, 0.82)),
        radial-gradient(circle at top left, rgba(141, 188, 215, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(216, 185, 140, 0.14), transparent 30%);
    z-index: 1;
}

.atmosphere-stage-copy {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 1.15rem 1.2rem 1.25rem;
    max-width: 28rem;
}

.atmosphere-stage-copy .eyebrow {
    margin-bottom: 0;
}

.client-summary {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.client-meta {
    color: var(--muted);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

#flow-panel,
#queue-panel,
#alerts-panel,
#cases-panel,
#documents-panel,
#activity-panel {
    scroll-margin-top: 1rem;
}

@keyframes ambient-pan {
    from {
        transform: scale(1.05) translate3d(-1.5%, 0, 0);
    }
    to {
        transform: scale(1.09) translate3d(1.5%, -1.5%, 0);
    }
}

@keyframes ambient-depth {
    from {
        transform: scale(1.18) translate3d(-1.2%, 1%, 0);
    }
    to {
        transform: scale(1.24) translate3d(1.2%, -1%, 0);
    }
}

@keyframes ambient-breathe {
    from {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 0.8;
    }
    to {
        transform: scale(1.04) translate3d(1.2%, -1.2%, 0);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .dashboard-shell {
        padding: 1rem 0 1.8rem;
    }

    .mission-grid {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    }

    .dashboard-shell .hero-title {
        font-size: clamp(1.85rem, 4.5vw, 2.6rem);
    }
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .mission-grid {
        grid-template-columns: 1fr;
    }

    .login-story {
        padding-bottom: 0;
        order: 2;
    }

    .login-card {
        order: 1;
    }

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

    .toolbar,
    .topbar-actions {
        justify-content: flex-start;
    }

    .action-strip {
        width: 100%;
    }
}

@media (max-width: 820px) {
    .toolbar,
    .action-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .toolbar form,
    .toolbar .ghost-button {
        width: 100%;
    }

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

@media (max-width: 760px) {
    .shell {
        width: min(calc(100% - 1rem), var(--content-width));
    }

    .hero-panel,
    .login-card {
        padding: 0.9rem;
    }

    .hero-inner,
    .login-frame {
        padding: 1rem;
    }

    .login-shell,
    .dashboard-shell,
    .client-shell {
        gap: 1rem;
    }

    .login-shell {
        min-height: auto;
        padding: 1rem 0 1.4rem;
    }

    .login-story {
        max-width: none;
        padding: 0.35rem 0.25rem 0;
    }

    .login-title {
        font-size: clamp(2rem, 10vw, 3rem);
        max-width: 10ch;
    }

    .dashboard-shell .hero-title {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
    }

    .lede,
    .subtitle,
    .panel-subtitle,
    .helper-copy {
        font-size: 0.95rem;
        line-height: 1.58;
    }

    th,
    td {
        padding: 0.8rem 0.9rem;
    }

    .topbar,
    .login-meta {
        align-items: stretch;
    }

    .toolbar,
    .topbar-actions,
    .language-switch {
        width: 100%;
    }

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

    .login-meta .auth-submit {
        grid-column: 1 / -1;
        width: 100%;
    }

    .section-bar {
        align-items: stretch;
    }

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

    .action-link {
        min-height: 2.8rem;
    }

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

    .metric-value {
        font-size: 1.8rem;
    }

    .atmosphere-stage {
        min-height: 13rem;
    }

    .brand-row {
        align-items: flex-start;
    }

    .ambient-photo--base {
        opacity: 0.2;
    }

    .ambient-photo--depth {
        opacity: 0.07;
        filter: blur(26px) saturate(0.96) brightness(0.3);
    }

    .ambient-strip--top,
    .ambient-strip--side {
        opacity: 0.08;
    }
}

@media (max-width: 620px) {
    .panel-grid,
    .metric-grid,
    .status-grid,
    .control-grid,
    .client-summary {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .action-strip,
    .login-meta,
    .language-switch {
        display: grid;
        grid-template-columns: 1fr;
    }

    .toolbar .chip,
    .toolbar form,
    .toolbar .ghost-button,
    .action-link,
    .language-link {
        width: 100%;
    }

    .panel-featured,
    .alert-panel {
        max-height: none;
    }

    .panel-featured .table-wrap {
        max-height: none;
    }

    .login-meta > * {
        width: 100%;
    }

    .table-wrap {
        overflow: visible;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table {
        border-collapse: separate;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 0.85rem;
        padding: 1rem;
    }

    .responsive-table tr {
        overflow: hidden;
        border: 1px solid rgba(215, 229, 241, 0.1);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.025);
    }

    .responsive-table td {
        padding: 0.82rem 1rem 0.92rem;
    }

    .responsive-table td:first-child {
        border-top: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.45rem;
        color: #c5d7e8;
        font-size: 0.71rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }
}

@media (max-width: 480px) {
    .shell {
        width: min(calc(100% - 0.75rem), var(--content-width));
    }

    .hero-panel,
    .login-card {
        padding: 0.75rem;
        border-radius: 26px;
    }

    .hero-inner,
    .login-frame {
        padding: 0.9rem;
        border-radius: 22px;
    }

    .brand-signature {
        gap: 0.7rem;
    }

    .brand-mark {
        width: 4rem;
        border-radius: 18px;
    }

    .loader-token {
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .eyebrow {
        letter-spacing: 0.18em;
        font-size: 0.74rem;
    }

    .login-title {
        font-size: clamp(1.85rem, 11vw, 2.45rem);
        max-width: 9ch;
    }

    .ambient-strip--top,
    .ambient-strip--side {
        display: none;
    }

    .ambient-orb {
        width: 20rem;
        height: 20rem;
        right: -8rem;
        top: -5rem;
    }
}

@keyframes loader-pulse {
    0%,
    100% {
        transform: scale(0.96);
        opacity: 0.78;
    }
    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

html[data-motion-mode="reduced"] *,
html[data-motion-mode="reduced"] *::before,
html[data-motion-mode="reduced"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
}

html[data-motion-mode="off"] *,
html[data-motion-mode="off"] *::before,
html[data-motion-mode="off"] *::after {
    animation: none !important;
    transition: none !important;
}

html[data-motion-mode="off"] .ambient-photo,
html[data-motion-mode="off"] .ambient-veil,
html[data-motion-mode="off"] .ambient-orb,
html[data-motion-mode="off"] .ambient-strip {
    opacity: 0.06 !important;
}

.dashboard-hero {
    background:
        linear-gradient(180deg, rgba(15, 20, 28, 0.9), rgba(9, 13, 19, 0.95));
}

.dashboard-hero-inner {
    gap: 1.2rem;
}

.dashboard-heading {
    display: grid;
    gap: 0.4rem;
}

.dashboard-title {
    max-width: 12ch;
}

.dashboard-intro-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.dashboard-intro-note,
.panel-soft {
    border: 1px solid rgba(215, 229, 241, 0.08);
    border-radius: 20px;
    padding: 1rem 1.05rem;
    background: rgba(255, 255, 255, 0.03);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 1rem;
    align-items: start;
}

.workspace-rail {
    display: grid;
    gap: 1rem;
}

.workboard-panel {
    max-height: 40rem;
}

.workboard-panel .table-wrap {
    max-height: 33rem;
    overflow: auto;
}

.utility-panel {
    display: grid;
    gap: 1rem;
}

.utility-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0 1.2rem 1.25rem;
}

.status-grid-quiet {
    grid-template-columns: 1fr;
}

.atmosphere-panel-compact {
    display: grid;
    gap: 1rem;
}

.atmosphere-panel-compact .panel-header {
    border-bottom: 0;
    padding-bottom: 0;
}

.atmosphere-stage-compact {
    min-height: 12rem;
    margin: 0 1.2rem 1.2rem;
}

.motion-toggle-group {
    display: grid;
    gap: 0.65rem;
    padding: 0 1.2rem;
}

.motion-toggle-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.motion-toggle-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.motion-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    padding: 0.42rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(215, 229, 241, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-strong);
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.motion-toggle-button:hover,
.motion-toggle-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.motion-toggle-button[data-motion-active="true"] {
    background: rgba(140, 184, 211, 0.16);
    border-color: rgba(140, 184, 211, 0.28);
    color: #f4f9ff;
}

.panel-grid-support {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid-client-top {
    grid-template-columns: 1fr;
}

.panel-grid-client-main {
    grid-template-columns: 1fr;
}

.client-progress-list {
    display: grid;
    gap: 0.85rem;
    padding: 0 1.2rem 1.25rem;
}

.client-progress-row {
    display: grid;
    gap: 0.4rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(215, 229, 241, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.client-progress-row p {
    margin: 0;
    color: var(--ink);
}

.client-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.client-link-unavailable {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.motion-toggle-group-client {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.board-page .dashboard-shell {
    gap: 1rem;
}

.board-header-inner {
    gap: 1rem;
}

.board-banner {
    margin: 0;
}

.board-feedback {
    min-height: 1.25rem;
}

.board-feedback[data-feedback-tone="loading"] {
    color: var(--muted-strong);
}

.board-feedback[data-feedback-tone="success"] {
    color: var(--ok);
}

.board-feedback[data-feedback-tone="error"] {
    color: var(--alert);
}

.board-page .ghost-button[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.board-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.95rem;
}

.board-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.3fr) minmax(260px, 0.82fr);
    gap: 1rem;
    align-items: start;
}

.board-queue-panel,
.board-detail-panel {
    min-height: 100%;
}

.board-support-rail {
    display: grid;
    gap: 1rem;
}

.board-support-panel .panel-header {
    padding-bottom: 0.95rem;
}

.board-support-list {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1.15rem 1.2rem;
}

.board-support-item {
    display: grid;
    gap: 0.45rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(215, 229, 241, 0.08);
}

.board-support-item--alert {
    border-color: rgba(231, 152, 137, 0.16);
    background: rgba(231, 152, 137, 0.06);
}

.board-support-item__top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.board-support-item__title {
    margin: 0;
    color: #f4f9ff;
    font-weight: 600;
    line-height: 1.4;
}

.board-support-item__meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.board-queue-list {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1.15rem 1.2rem;
    max-height: 42rem;
    overflow: auto;
}

.board-queue-row {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(215, 229, 241, 0.08);
    background: rgba(255, 255, 255, 0.025);
    text-decoration: none;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.board-queue-row:hover,
.board-queue-row:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(140, 184, 211, 0.26);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.board-queue-row.is-selected {
    border-color: rgba(140, 184, 211, 0.38);
    background: rgba(140, 184, 211, 0.1);
    box-shadow: inset 0 0 0 1px rgba(140, 184, 211, 0.12);
}

.board-queue-row__top,
.board-queue-row__bottom {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.board-queue-row__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.board-queue-row__subject,
.board-detail-subject,
.board-activity-item p {
    margin: 0;
}

.board-queue-row__subject {
    color: #f4f9ff;
    font-weight: 600;
    line-height: 1.45;
}

.board-queue-row__meta,
.board-detail-meta-item span:last-child,
.board-queue-row__bottom {
    color: var(--muted);
    font-size: 0.9rem;
}

.board-detail-content {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.15rem 1.2rem;
}

.board-detail-section {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(215, 229, 241, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.board-detail-heading {
    display: grid;
    gap: 0.35rem;
}

.board-detail-subject {
    color: #f4f9ff;
    font-family: var(--heading-font);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
}

.board-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.board-detail-meta-item {
    display: grid;
    gap: 0.28rem;
}

.board-detail-body {
    margin: 0;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(8, 12, 18, 0.55);
    border: 1px solid rgba(215, 229, 241, 0.08);
    color: var(--ink);
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.board-workflow-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.board-workflow-form .workflow-submit {
    grid-column: 1 / -1;
}

.board-activity-list {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.2rem;
}

.board-activity-item {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(215, 229, 241, 0.08);
}

.board-activity-item__top {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.board-activity-item__meta {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

[data-board-root].is-loading .board-queue-panel,
[data-board-root].is-loading .board-detail-panel,
[data-board-root].is-loading .board-activity-panel,
[data-board-root].is-loading .board-support-panel {
    opacity: 0.78;
}

@media (max-width: 1120px) {
    .workspace-grid,
    .panel-grid-client-main,
    .panel-grid-support,
    .panel-grid-client-top,
    .board-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-intro-bar,
    .board-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .utility-link-grid,
    .motion-toggle-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .board-detail-meta,
    .board-workflow-form {
        grid-template-columns: 1fr;
    }

    .dashboard-intro-note,
    .panel-soft {
        padding: 0.9rem 0.95rem;
    }

    .atmosphere-stage-compact {
        margin: 0 1rem 1rem;
    }

    .motion-toggle-group {
        padding: 0 1rem;
    }
}
