:root {
    --bg: #f4f7fb;
    --sidebar-bg: #f2f5f9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-soft: #eef3f8;
    --line: #e2e8f0;
    --line-strong: #d7dee8;
    --text: #172233;
    --muted: #667281;
    --muted-strong: #4b5766;
    --accent: #3b6df6;
    --accent-strong: #2957d5;
    --accent-soft: #edf3ff;
    --accent-line: #d7e4ff;
    --login-ink: #163042;
    --login-ink-soft: #5d6f7a;
    --login-accent: #285f70;
    --login-accent-strong: #1d4658;
    --success: #177245;
    --success-soft: #eaf8f0;
    --danger: #bf4a3a;
    --danger-soft: #fff3f1;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.05);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --font: "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

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

button,
input,
select {
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    color: var(--text);
    background: #ffffff;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder {
    color: #8a95a4;
}

input:focus,
select:focus {
    outline: none;
    border-color: rgba(59, 109, 246, 0.55);
    box-shadow: 0 0 0 4px rgba(59, 109, 246, 0.12);
}

code {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.94rem;
}

.portal-body,
.login-body {
    min-height: 100vh;
}

.flash-stack {
    position: fixed;
    inset: 18px 18px auto;
    z-index: 40;
    display: grid;
    gap: 10px;
}

.flash-stack-shell {
    left: 296px;
    right: 24px;
}

.flash {
    max-width: 520px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

.flash-success {
    border-color: #cde9d8;
    background: var(--success-soft);
}

.flash-error {
    border-color: #f1d3cd;
    background: var(--danger-soft);
}

.shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    align-content: start;
    gap: 22px;
    padding: 22px 18px 18px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
}

.sidebar-head {
    display: grid;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 46px;
    height: auto;
    flex: 0 0 auto;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
}

.brand-subtitle {
    font-size: 0.83rem;
    color: var(--muted);
}

.new-button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.new-button {
    width: 100%;
    background: #ffffff;
    color: var(--accent);
    border-color: var(--accent-line);
    box-shadow: 0 1px 0 rgba(59, 109, 246, 0.03);
}

.button:hover,
.new-button:hover,
.row-launch:hover,
.nav-link:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.button:hover {
    background: var(--accent-strong);
    box-shadow: 0 10px 24px rgba(41, 87, 213, 0.18);
}

.button:focus-visible,
.new-button:focus-visible,
.row-launch:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible,
.topbar-search input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 109, 246, 0.14);
}

.button-secondary {
    background: #ffffff;
    color: var(--text);
    border-color: var(--line);
}

.button-secondary:hover {
    background: var(--surface-muted);
    box-shadow: none;
}

.button-full {
    width: 100%;
}

.button-icon,
.nav-icon-svg,
.topbar-icon,
.resource-svg,
.inline-icon,
.note-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.button-icon {
    width: 16px;
    height: 16px;
}

.nav-group {
    display: grid;
    gap: 10px;
}

.nav-label,
.section-kicker {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.section-kicker {
    color: var(--accent);
}

.nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    color: var(--muted-strong);
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
}

.nav-link.active {
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(59, 109, 246, 0.08);
}

.nav-link.active::before {
    background: var(--accent);
}

.sidebar-spacer {
    min-height: 12px;
}

.sidebar-user {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.86);
}

.sidebar-user-copy,
.topbar-user-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-copy strong,
.topbar-user-copy strong {
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-copy span,
.sidebar-user-copy small,
.topbar-user-copy span {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
}

.avatar-large {
    width: 44px;
    height: 44px;
    font-size: 0.92rem;
}

.workspace-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.topbar-search {
    flex: 1 1 auto;
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
    color: var(--muted);
}

.topbar-search input {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: auto;
    box-shadow: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--muted-strong);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 4px;
}

.main-scroll {
    padding: 28px 28px 36px;
}

.workspace-page {
    display: grid;
    gap: 24px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.breadcrumbs strong {
    color: var(--text);
}

.hero-panel,
.workspace-canvas,
.surface-panel,
.login-shell > * {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
    gap: 24px;
    padding: 28px;
}

.hero-copy h1,
.login-info-panel h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.25rem, 5vw, 3.35rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-text,
.panel-copy,
.login-lede,
.empty-state p,
.account-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.68;
}

.hero-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.soft-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 600;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-muted);
}

.metric-card span {
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.metric-card small {
    color: var(--muted);
    line-height: 1.5;
}

.workspace-canvas,
.surface-panel {
    padding: 24px;
}

.canvas-header,
.panel-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.canvas-header h2,
.surface-panel h2,
.login-form-header h2 {
    margin: 8px 0 0;
    font-size: 1.65rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.command-deck {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, #fcfdff 0%, #f7fafe 100%);
    overflow: hidden;
}

.workspace-canvas-quiet .command-deck {
    margin-top: 0;
}

.command-deck-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--line);
}

.command-deck-copy {
    display: grid;
    gap: 8px;
    max-width: 620px;
}

.deck-label {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.command-deck-copy p:last-child,
.directory-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.deck-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: min(100%, 520px);
    gap: 0;
}

.deck-kpi {
    display: grid;
    gap: 5px;
    align-content: start;
    padding: 0 18px;
    border-left: 1px solid var(--line);
}

.deck-kpi:first-child {
    border-left: 0;
    padding-left: 0;
}

.deck-kpi span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.deck-kpi strong {
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

.deck-kpi small {
    color: var(--muted);
    line-height: 1.5;
}

.command-deck-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
    gap: 18px;
    align-items: end;
    padding: 18px 20px 20px;
}

.canvas-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    margin-top: 22px;
    margin-bottom: 18px;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
}

.toolbar-search-wide {
    min-height: 54px;
    padding: 0 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.toolbar-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--muted);
}

.toolbar-search input {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: auto;
    box-shadow: none;
}

.toolbar-filters {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.toolbar-filters-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.toolbar-select {
    display: grid;
    gap: 6px;
    min-width: 148px;
}

.toolbar-select span,
.field span {
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.toolbar-select select {
    background: rgba(255, 255, 255, 0.96);
}

.directory-shell {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    overflow: hidden;
}

.directory-strip {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(244, 247, 251, 0.78) 0%, rgba(255, 255, 255, 0.98) 100%);
}

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

.directory-note {
    margin-top: 6px;
    font-size: 0.92rem;
}

.directory-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    color: var(--muted-strong);
    font-size: 0.84rem;
    font-weight: 600;
}

.table-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
}

.table-card-directory {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.table-card-primary {
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.workspace-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.workspace-table th,
.workspace-table td {
    text-align: left;
    vertical-align: top;
    padding: 18px 20px;
}

.workspace-table thead th {
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-muted);
}

.workspace-table tbody td {
    border-top: 1px solid var(--line);
}

.workspace-table tbody tr {
    transition: background 140ms ease;
}

.workspace-table tbody tr:hover {
    background: #fbfdff;
}

.resource-cell {
    display: flex;
    align-items: start;
    gap: 14px;
    min-width: 260px;
}

.resource-type {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid transparent;
    flex: 0 0 auto;
}

.resource-essay {
    background: #eef4ff;
    color: #2b64e3;
    border-color: #d9e6ff;
}

.resource-mbe {
    background: #eef7ff;
    color: #1f7bb5;
    border-color: #d7ebfb;
}

.resource-library {
    background: #f2f6ff;
    color: #4b63c6;
    border-color: #dde4ff;
}

.resource-copy {
    display: grid;
    gap: 4px;
}

.resource-code {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.resource-copy strong {
    font-size: 1rem;
}

.resource-copy span,
.subtle-cell {
    color: var(--muted);
    line-height: 1.55;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 180px;
}

.mini-tag,
.panel-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 600;
}

.row-actions {
    display: grid;
    justify-items: start;
    gap: 8px;
}

.row-launch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.row-launch {
    background: var(--accent);
    color: #ffffff;
}

.row-launch:hover {
    background: var(--accent-strong);
}

.workspace-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    gap: 24px;
}

.table-card-compact {
    margin-top: 18px;
}

.surface-panel-quiet .table-card-compact {
    margin-top: 0;
}

.compact-table th,
.compact-table td {
    padding: 16px 18px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: 0.8rem;
    font-weight: 700;
}

.status-completed,
.status-paid,
.status-processing {
    background: var(--success-soft);
    color: var(--success);
}

.account-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.account-grid {
    display: grid;
    gap: 14px;
    margin: 0;
}

.account-grid div {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
}

.account-grid dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.account-grid dd {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.account-note,
.login-support {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.empty-state {
    display: grid;
    gap: 10px;
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: 20px;
    background: var(--surface-muted);
}

.empty-state h3 {
    margin: 0;
    font-size: 1.2rem;
}

.public-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 48px);
}

.login-body {
    background: #f3f4f6;
}

.login-body .public-shell {
    background: #f3f4f6;
}

.login-stage {
    width: min(760px, 100%);
}

.login-auth-shell {
    display: grid;
    justify-items: center;
    gap: 22px;
    padding: 22px 0 8px;
}

.login-brand {
    width: 320px;
    max-width: 76%;
}

.login-auth-card {
    width: min(620px, 100%);
    min-height: 0;
    padding: 38px 36px 30px;
    border: 1px solid #dfe5ec;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.04);
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 28px;
}

.login-auth-card h1 {
    margin: 0;
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: #1f2937;
}

.login-auth-form {
    display: grid;
    gap: 16px;
    width: min(620px, 100%);
    margin: 0 auto;
}

.login-auth-form-email {
    width: min(460px, 100%);
}

.login-input-field input {
    height: 56px;
    border: 1px solid #cfd5de;
    border-radius: 14px;
    padding: 0 18px;
    background: #ffffff;
    box-shadow: none;
    color: #111827;
    font-size: 1rem;
}

.login-input-field input:focus {
    border-color: rgba(31, 115, 201, 0.58);
    box-shadow: 0 0 0 3px rgba(31, 115, 201, 0.14);
}

.login-submit {
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
    background: #3977bd;
    box-shadow: none;
    font-size: 1rem;
}

.login-submit:hover {
    transform: none;
    background: #2f68a8;
    box-shadow: none;
}

.login-submit:focus-visible {
    box-shadow: 0 0 0 4px rgba(31, 115, 201, 0.18);
}

.login-code-form {
    justify-items: center;
    gap: 18px;
    width: min(520px, 100%);
}

.login-code-group {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.login-code-slot {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #ffffff;
    box-shadow: none;
}

.login-code-slot:focus {
    border-color: #2369da;
    box-shadow: 0 0 0 3px rgba(35, 105, 218, 0.16);
}

.login-code-dash {
    color: #b7b7b7;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
}

.login-code-copy {
    margin: 0;
    text-align: center;
    color: #5b6470;
    line-height: 1.55;
    font-size: 0.92rem;
    max-width: 420px;
}

.login-code-copy strong {
    color: var(--text);
    font-weight: 600;
}

.login-muted-button {
    width: min(280px, 100%);
    min-height: 44px;
    border: 1px solid #dfdfdf;
    border-radius: 10px;
    background: #f5f5f5;
    color: #a3a3a3;
    font-weight: 600;
    cursor: not-allowed;
}

.login-muted-button:not(:disabled) {
    cursor: pointer;
    background: #ffffff;
    color: #4b5563;
}

.login-secondary-link {
    justify-self: center;
    color: #2c61d6;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-secondary-link:hover {
    color: #1f4fb8;
}

.login-debug-token {
    width: min(460px, 100%);
    margin: 4px auto 0;
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px dashed #cfe0fb;
    border-radius: 16px;
    background: #f8fbff;
}

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

@media (max-width: 1180px) {
    .hero-panel,
    .workspace-secondary-grid {
        grid-template-columns: 1fr;
    }

    .command-deck-summary,
    .command-deck-controls,
    .canvas-toolbar {
        grid-template-columns: 1fr;
    }

    .deck-kpis {
        min-width: 0;
    }

    .toolbar-filters {
        flex-wrap: wrap;
    }

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

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

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .flash-stack-shell {
        left: 18px;
    }

    .topbar {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .topbar-search {
        max-width: none;
        order: 2;
        width: 100%;
    }

    .main-scroll {
        padding: 22px 18px 28px;
    }
}

@media (max-width: 720px) {
    .public-shell {
        padding: 16px;
    }

    .hero-panel,
    .workspace-canvas,
    .surface-panel {
        padding: 20px;
    }

    .command-deck-summary,
    .command-deck-controls,
    .directory-strip {
        padding: 16px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .workspace-table th,
    .workspace-table td {
        padding: 14px 12px;
    }

    .resource-cell {
        min-width: 220px;
    }

    .toolbar-filters {
        display: grid;
        grid-template-columns: 1fr;
    }

    .deck-kpis,
    .toolbar-filters-inline {
        grid-template-columns: 1fr;
    }

    .directory-strip {
        align-items: start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .login-auth-card {
        width: min(620px, 100%);
        min-height: auto;
        padding: 28px 20px 22px;
        border-radius: 24px;
    }

    .login-auth-card h1 {
        font-size: clamp(1.9rem, 9vw, 2.45rem);
    }

    .login-brand {
        width: 240px;
    }

    .login-code-copy {
        font-size: 0.9rem;
    }

    .login-code-group {
        gap: 8px;
    }

    .login-code-slot {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .login-submit {
        min-height: 50px;
        font-size: 0.98rem;
    }

    .topbar-user-copy {
        display: none;
    }

    .flash-stack {
        inset: 12px 12px auto;
    }
}
