/* KubeStrat customer portal — the whole stylesheet, without a build step. */

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-alt: #f5f7fa;
    --ink: #111820;
    --ink-soft: #5c6878;
    --ink-faint: #7a8798;
    --line: #d7e0eb;
    --brand: #275da8;
    --brand-dark: #102b50;
    --accent: #2f6ab5;
    --danger: #b62c39;
    --warn: #886322;
    --ok: #237950;
    --nav: #102b50;
    --nav-active: #29466b;
    --nav-ink: #d5e0ef;
    --nav-muted: #b7c9e0;
    --nav-line: #365071;
    --focus: #4385db;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 18px 45px -30px rgb(16 43 80 / 32%);
    --sans: Arial, Helvetica, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.4rem;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--nav);
}

h1 {
    font-size: 1.55rem;
}

h2 {
    font-size: 1.15rem;
}

h3,
h4 {
    font-size: 1rem;
}

p {
    margin: 0 0 0.75rem;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

.muted {
    color: var(--ink-soft);
}

.small {
    font-size: 0.82rem;
}

.mono {
    font-family: var(--mono);
    font-size: 0.86em;
    word-break: break-all;
}

.block {
    display: block;
}

.right {
    text-align: right;
}

.page-intro {
    margin: 0 0 1.1rem;
    max-width: 70ch;
}

.section-title {
    margin: 1.6rem 0 0.35rem;
}

/* ---------- shell ---------- */

body.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 242px;
    padding: 27px 18px;
    background: var(--nav);
    color: var(--nav-ink);
    display: flex;
    flex-direction: column;
    gap: 26px;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: auto;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.brand-name {
    font-size: 12.5px;
    line-height: 1.2;
    color: #fff;
}

.brand-kicker {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--nav-muted);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav a {
    padding: 11px 14px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.nav a:hover {
    background: var(--nav-active);
    text-decoration: none;
}

.nav a.active {
    background: var(--nav-active);
    color: #fff;
    box-shadow: inset 3px 0 0 #8eb9f0;
}

.sidebar-foot {
    border-top: 1px solid var(--nav-line);
    padding-top: 18px;
    font-size: 10px;
    display: grid;
    gap: 12px;
}

.sidebar-foot .muted {
    color: var(--nav-muted);
}

.site-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-link:hover {
    color: #bfd4ef;
    text-decoration: none;
}

.langs {
    display: flex;
    gap: 6px;
    margin-top: 7px;
}

.langs a {
    padding: 2px 8px;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 999px;
    color: inherit;
    font-size: 10px;
}

.langs a:hover {
    text-decoration: none;
    background: rgb(255 255 255 / 8%);
}

.langs a.active {
    background: #fff;
    border-color: #fff;
    color: var(--nav);
    font-weight: 700;
}

.main {
    flex: 1;
    min-width: 0;
    margin-left: 242px;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 12px 38px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 15px;
    color: var(--nav);
    cursor: pointer;
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-kicker {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.topbar-title h1 {
    margin: 2px 0 0;
    font-size: 18px;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.user-menu {
    position: relative;
}

.user-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 5px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    list-style: none;
}

.user-menu summary:hover {
    border-color: var(--nav);
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--nav);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.user-name {
    font-size: 0.86rem;
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    width: 250px;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 50;
}

.menu-panel p {
    margin: 0 0 0.2rem;
    font-size: 0.82rem;
}

.menu-role {
    font-weight: 650;
}

.menu-email {
    color: var(--ink-soft);
    word-break: break-all;
}

.menu-panel a,
.menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.5rem;
    margin-top: 0.35rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
}

.menu-panel a:hover,
.menu-panel button:hover {
    background: #eaf0fb;
    text-decoration: none;
}

.page {
    flex: 1;
    padding: 26px 38px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 38px 22px;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 10px;
}

.page-foot a {
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- flashes ---------- */

.flash {
    max-width: 46ch;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
}

.flash.success {
    border-color: #cfe8da;
    background: #edf7f1;
    color: #237950;
}

.flash.error {
    border-color: #f0c8cd;
    background: #fff0f0;
    color: #b12c39;
}

.flash.warning {
    border-color: #ecd9b0;
    background: #fff7e7;
    color: #886322;
}

/* ---------- layout helpers ---------- */

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.grid-3-1 {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    align-items: start;
}

.cards {
    display: grid;
}

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

.page-head-meta {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

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

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.card > .card-head + * {
    margin-top: 0;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-head h2,
.card-head h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.2px;
}

.card-head .link {
    font-size: 0.82rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    color: inherit;
}

.stat:hover {
    border-color: var(--nav);
    text-decoration: none;
}

.stat-value {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.4px;
    line-height: 1.1;
    color: var(--nav);
}

.stat-label {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------- tables ---------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.table th {
    text-align: left;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--nav);
    background: #f8fafc;
    padding: 11px 12px;
    border-bottom: 1px solid var(--nav);
    white-space: nowrap;
}

.table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

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

.table tbody tr:hover {
    background: #fafbfd;
}

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

.actions form {
    display: inline-flex;
    margin: 0;
}

/* ---------- pills, badges ---------- */

.pill,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink-soft);
    white-space: nowrap;
}

.pill.tiny {
    font-size: 9.5px;
    padding: 2px 6px;
}

.pill.block {
    margin-top: 5px;
}

.pill.ok,
.status-active {
    border-color: #cfe8da;
    background: #edf7f1;
    color: var(--ok);
}

.status-pending,
.pill.warn {
    border-color: #ecd9b0;
    background: #fff7e7;
    color: var(--warn);
}

.status-expired,
.status-cancelled {
    border-color: #f0c8cd;
    background: #fff0f0;
    color: var(--danger);
}

.ticket-open {
    border-color: #cfdff6;
    background: #edf3fe;
    color: #2c5c9c;
}

.ticket-answered {
    border-color: #cfe8da;
    background: #edf7f1;
    color: var(--ok);
}

.ticket-closed {
    border-color: var(--line);
    background: var(--surface-alt);
    color: var(--ink-faint);
}

.priority-low {
    border-color: var(--line);
    color: var(--ink-faint);
}

.priority-normal {
    border-color: #cfdff6;
    background: #edf3fe;
    color: #2c5c9c;
}

.priority-high {
    border-color: #f0c8cd;
    background: #fff0f0;
    color: var(--danger);
}

.badge.role-admin {
    border-color: #c9b6f0;
    background: #f2ecfd;
    color: #573aa6;
}

.badge.role-support {
    border-color: #bfe0ef;
    background: #ecf7fc;
    color: #1a6480;
}

.badge.role-customer {
    border-color: var(--line);
    background: var(--surface-alt);
    color: var(--ink-soft);
}

.muted-pill {
    opacity: 0.75;
}

/* ---------- lists ---------- */

.list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

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

.list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.list-title {
    font-weight: 600;
    color: var(--ink);
}

.list-item:hover {
    border-color: #cbd8ea;
}

/* ---------- forms ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.form.compact {
    gap: 0.5rem;
}

.form-title {
    margin: 0.4rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}

.form .grid {
    gap: 0.75rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.field > span {
    font-size: 12px;
    font-weight: 500;
    color: var(--nav);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #bdcada;
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px #dfe9f7;
}

input:disabled {
    background: var(--surface-alt);
    color: var(--ink-faint);
}

textarea {
    resize: vertical;
    min-height: 5rem;
}

textarea.mono {
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.45;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
}

.check input {
    margin-top: 0.2rem;
    accent-color: var(--brand);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.form-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.9rem;
    font-size: 0.85rem;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--nav);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    min-height: 36px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--surface-alt);
    border-color: var(--nav);
    text-decoration: none;
}

.btn.primary {
    background: var(--nav);
    border-color: var(--nav);
    color: #fff;
}

.btn.primary:hover {
    background: var(--brand);
    border-color: var(--brand);
}

.btn.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-soft);
}

.btn.danger {
    background: var(--danger);
    border-color: #9d2634;
    color: #fff;
}

.btn.tiny {
    padding: 4px 9px;
    font-size: 11px;
    min-height: 26px;
}

.btn.block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- tabs, steps ---------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid var(--line);
}

.tab {
    padding: 9px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.tab:hover {
    color: var(--nav);
    text-decoration: none;
}

.tab.active {
    color: var(--nav);
    border-bottom-color: var(--brand);
    background: transparent;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: flex;
}

.steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    counter-reset: step;
    margin: 0 0 0.9rem;
}

.steps li {
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-faint);
    font-size: 0.8rem;
    font-weight: 600;
}

.steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    font-size: 0.7rem;
}

.steps li.current {
    border-color: #c9d8ea;
    color: var(--nav);
    background: #f4f8fe;
}

.steps li.current::before {
    background: var(--nav);
    border-color: var(--nav);
    color: #fff;
}

.steps li.done {
    border-color: #cfe8da;
    color: var(--ok);
    background: #edf7f1;
}

.steps li.done::before {
    content: "✓";
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}

/* ---------- facts ---------- */

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.facts > div {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    min-width: 0;
}

.facts dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-faint);
    margin-bottom: 0.2rem;
}

.facts dd {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-word;
}

.facts.compact {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.facts.compact li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--line);
    list-style: none;
}

.facts.compact li:last-child {
    border-bottom: 0;
}

.facts.compact span {
    color: var(--ink-soft);
}

/* ---------- catalog / plan cards ---------- */

.catalog {
    padding-top: 0.6rem;
}

.catalog + .catalog {
    border-top: 1px solid var(--line);
    margin-top: 0.8rem;
}

.catalog-title {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}

.plan-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.plan-card header h4 {
    margin: 0;
}

.prices {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
}

.prices li {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.prices strong {
    font-family: var(--mono);
    font-size: 0.88rem;
    min-width: 8ch;
}

.offer-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.offer-total strong {
    font-size: 1.05rem;
    font-family: var(--mono);
}

/* ---------- disclosures, code ---------- */

details.inline-details,
details.disclosure {
    margin-top: 0.4rem;
}

details.inline-details > summary {
    cursor: pointer;
}

details.disclosure > summary {
    display: inline-flex;
    cursor: pointer;
    list-style: none;
}

details.disclosure > summary::-webkit-details-marker {
    display: none;
}

details.disclosure[open] > summary {
    margin-bottom: 0.6rem;
}

pre.code {
    margin: 0.5rem 0;
    padding: 12px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.55;
    color: #eaf2fd;
    background: #0b2342;
    border-radius: var(--radius-sm);
}

.how {
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

/* ---------- tickets ---------- */

.ticket-subject {
    margin: 0.35rem 0 0.2rem;
}

.thread {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.message {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border-left: 3px solid #cbd8ea;
}

.message.from-staff {
    background: #f2f8ff;
    border-left-color: var(--brand);
}

.message.from-customer {
    background: #fbfcfe;
    border-left-color: #cbd8ea;
}

.message-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
}

/* ---------- auth, install, plain ---------- */

body.auth {
    min-height: 100vh;
    background: var(--surface);
    padding: 0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 50px 60px;
    background: var(--nav);
    color: #fff;
    overflow: hidden;
}

.auth-story::after {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    border: 1px solid rgb(108 149 195 / 22%);
    border-radius: 50%;
    right: -310px;
    top: 15%;
    box-shadow: 0 0 0 80px rgb(108 149 195 / 4%), 0 0 0 160px rgb(108 149 195 / 3%);
    pointer-events: none;
}

.auth-story-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
}

.auth-story-brand:hover {
    text-decoration: none;
}

.auth-story-brand img {
    display: block;
    width: 148px;
    height: auto;
}

.auth-story-copy {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-eyebrow {
    margin: 0 0 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #bfd4ef;
}

.auth-story-copy h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 650;
    letter-spacing: -1.2px;
    line-height: 1.15;
}

.auth-story-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #d3e1f2;
    font-size: 11px;
    font-weight: 600;
}

.auth-story-link:hover {
    color: #fff;
    text-decoration: none;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 40px;
}

.auth-panel-inner {
    width: 100%;
    max-width: 410px;
}

.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 16px;
}

.auth-panel-brand {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--nav);
}

body.install .auth-top {
    margin-bottom: 22px;
}

body.install .auth-top .brand img {
    width: 118px;
    height: auto;
}

.auth-top .langs {
    margin-top: 0;
}

.auth-top .langs a,
body.install .auth-top .langs a {
    border-color: var(--line);
    color: var(--ink-soft);
    background: var(--surface);
}

.auth-top .langs a.active {
    background: var(--nav);
    border-color: var(--nav);
    color: #fff;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 24px 60px -34px rgb(16 43 80 / 35%);
}

.auth-card.wide {
    padding: 28px 30px;
}

.auth-card h1 {
    margin-bottom: 0.9rem;
    font-size: 24px;
    letter-spacing: -0.6px;
}

.auth-intro {
    margin-top: -0.4rem;
}

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 10px;
}

.auth-foot a {
    font-weight: 600;
}

body.install {
    display: grid;
    place-items: center;
    padding: 32px 24px;
    background:
        radial-gradient(900px 420px at 12% -10%, #dbe6f6 0%, transparent 60%),
        var(--bg);
}

body.install .auth-wrap {
    width: min(100%, 900px);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

svg.captcha {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    width: 175px;
    height: 48px;
}

.captcha-refresh {
    font-size: 0.8rem;
}

body.plain {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 100vh;
    padding: 1.5rem;
}

.plain-card {
    width: min(100%, 460px);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.plain-mark {
    display: block;
    width: 46px;
    height: auto;
    margin: 0 auto 14px;
}

.plain-card h1 {
    margin-bottom: 0.5rem;
}

.plain-foot {
    color: var(--ink-faint);
    font-size: 10px;
}

.plain-foot a {
    font-weight: 600;
}

.status-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.status-code {
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--nav);
}

.status-page .btn {
    margin-top: 12px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .page {
        padding: 22px;
    }

    .topbar {
        padding: 12px 22px;
    }

    .page-foot {
        padding: 14px 22px 20px;
    }
}

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

    .auth-story {
        min-height: 0;
        padding: 30px;
        gap: 20px;
    }

    .auth-story-copy,
    .auth-story-link,
    .auth-story::after {
        display: none;
    }

    .auth-panel {
        padding: 32px 24px 40px;
    }
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 160ms ease;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 0 100vmax rgb(9 18 32 / 45%);
    }

    .main {
        margin-left: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

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

    .page {
        padding: 18px 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .page-foot {
        padding: 14px 16px 18px;
    }
}

@media print {
    .sidebar,
    .topbar-tools,
    .page-foot {
        display: none;
    }

    .main {
        margin-left: 0;
    }
}
