:root {
    --app-background: #f6f9fd;
    --app-surface: #ffffff;
    --app-surface-soft: #f8faff;
    --app-surface-blue: #eef5ff;
    --app-text: #0d1830;
    --app-text-soft: #52627d;
    --app-text-faint: #75829a;
    --app-border: #dce5f1;
    --app-border-strong: #c9d6e7;
    --app-blue: #146ef5;
    --app-blue-hover: #075dd9;
    --app-blue-soft: #e7f0ff;
    --app-success: #147a55;
    --app-success-soft: #eaf8f2;
    --app-danger: #b4233a;
    --app-danger-soft: #fff0f2;
    --app-warning: #875200;
    --app-warning-soft: #fff8e7;
    --app-radius-small: 10px;
    --app-radius: 16px;
    --app-radius-large: 24px;
    --app-shadow-small: 0 1px 2px rgba(13, 24, 48, 0.04), 0 8px 24px rgba(48, 82, 130, 0.06);
    --app-shadow: 0 1px 2px rgba(13, 24, 48, 0.04), 0 24px 64px rgba(48, 82, 130, 0.11);

    /* Replaces the neutral base tokens only inside the demo application. */
    --color-background: var(--app-background);
    --color-surface: var(--app-surface);
    --color-text: var(--app-text);
    --color-muted: var(--app-text-soft);
    --color-border: var(--app-border);
    --color-accent: var(--app-blue);
    --color-accent-hover: var(--app-blue-hover);
    --shadow-soft: var(--app-shadow);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--app-background);
    color: var(--app-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a,
button,
input,
select,
summary {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
        box-shadow 160ms ease, transform 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(20, 110, 245, 0.24);
    outline-offset: 3px;
}

/* Application shell */

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(201, 214, 231, 0.82);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px) saturate(145%);
}

.site-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(calc(100% - 3rem), 1280px);
    min-height: 76px;
    margin: 0 auto;
    padding: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--app-text);
    font-size: 1.18rem;
    font-weight: 730;
    letter-spacing: -0.03em;
}

.brand:hover {
    color: var(--app-text);
}

.brand-mark {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 9px;
    background: var(--app-text);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 760;
    letter-spacing: -0.04em;
}

.nav-primary,
.nav-utility {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #2e3c55;
    font-size: 0.925rem;
    font-weight: 560;
}

.nav-primary {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-primary > a,
.nav-menu > summary,
.nav-utility > a:not(.button) {
    border-radius: 9px;
    padding: 0.55rem 0.78rem;
}

.nav-primary > a:hover,
.nav-menu > summary:hover,
.nav-utility > a:not(.button):hover {
    background: var(--app-surface-blue);
    color: var(--app-text);
}

.nav-primary > a.is-current,
.nav-menu.is-current > summary,
.nav-utility > a.is-current,
.mobile-navigation-panel a.is-current {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.nav-utility {
    margin-left: auto;
}

.nav-menu {
    position: relative;
}

.nav-menu > summary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    list-style: none;
}

.nav-menu > summary::-webkit-details-marker,
.mobile-navigation > summary::-webkit-details-marker {
    display: none;
}

.nav-menu > summary::after {
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: translateY(-0.12rem) rotate(45deg);
}

.nav-menu[open] > summary::after {
    transform: translateY(0.12rem) rotate(225deg);
}

.nav-menu-panel {
    position: absolute;
    top: calc(100% + 0.8rem);
    left: 50%;
    display: grid;
    width: 600px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.98);
    padding: 0.65rem;
    box-shadow: var(--app-shadow);
    transform: translateX(-50%);
}

.nav-menu-panel a {
    display: grid;
    gap: 0.18rem;
    border-radius: 11px;
    padding: 0.8rem 0.9rem;
}

.nav-menu-panel a:hover {
    background: var(--app-surface-blue);
    color: var(--app-text);
}

.nav-menu-panel a.is-current {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.nav-menu-panel a.is-current span {
    color: #4e6f9e;
}

.nav-menu-panel strong {
    font-size: 0.9rem;
    font-weight: 670;
}

.nav-menu-panel span {
    color: var(--app-text-faint);
    font-size: 0.78rem;
    font-weight: 450;
}

.locale-form {
    display: inline-flex;
    align-items: center;
    margin-left: 0.3rem;
}

.locale-code {
    display: none;
}

.locale-form select,
.locale-form button {
    min-height: 2.35rem;
    border-color: transparent;
    border-radius: 9px;
    background: transparent;
    padding: 0.4rem 0.5rem;
    color: var(--app-text-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

.locale-form select:hover,
.locale-form select:focus {
    border-color: var(--app-border);
    background: var(--app-surface-soft);
}

.mobile-navigation {
    display: none;
}

.button,
.stack-form button,
.inline-action button,
.inline-form button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-blue);
    border-radius: var(--app-radius-small);
    background: var(--app-blue);
    color: #ffffff;
    padding: 0.72rem 1.1rem;
    box-shadow: 0 8px 18px rgba(20, 110, 245, 0.17);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 680;
    cursor: pointer;
}

.button:hover,
.stack-form button:hover,
.inline-action button:hover,
.inline-form button:hover {
    border-color: var(--app-blue-hover);
    background: var(--app-blue-hover);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(20, 110, 245, 0.22);
    transform: translateY(-1px);
}

.button-small {
    min-height: 38px;
    border-radius: 9px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
}

.button-secondary {
    border-color: var(--app-border-strong);
    background: rgba(255, 255, 255, 0.78);
    color: var(--app-blue);
    box-shadow: none;
}

.button-secondary:hover {
    border-color: var(--app-blue);
    background: #ffffff;
    color: var(--app-blue-hover);
    box-shadow: var(--app-shadow-small);
}

.site-main {
    padding: 0;
}

.page-shell {
    width: min(calc(100% - 3rem), 1280px);
    margin: 0 auto;
}

.site-main .page-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.site-main .page-shell > div:not(.home-page) {
    max-width: 1040px;
    margin: clamp(2.5rem, 6vw, 5rem) auto;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-large);
    background: var(--app-surface);
    padding: clamp(1.5rem, 5vw, 4rem);
    box-shadow: var(--app-shadow-small);
}

.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/login"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/register/username"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/register/email"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/forgot-password"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/reset-password"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/magic-link"]),
.site-main .page-shell > div:not(.home-page):has(> form.stack-form[action="/login/magic"]) {
    max-width: 820px;
}

.site-main h1 {
    margin: 0;
    max-width: 820px;
    color: var(--app-text);
    font-size: clamp(2.3rem, 5vw, 4.25rem);
    font-weight: 720;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.site-main .page-shell > div:not(.home-page) h1 {
    font-size: clamp(2.15rem, 4vw, 3.45rem);
}

.lead {
    max-width: 720px;
    margin: 1.15rem 0 0;
    color: var(--app-text-soft);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.65;
}

.site-footer {
    border-top: 1px solid var(--app-border);
    background: #ffffff;
}

.site-footer .page-shell {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: var(--app-text-faint);
}

.footer-brand {
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -0.025em;
}

.site-footer small {
    text-align: right;
}

/* Homepage */

.home-page {
    padding: 2rem 0 0;
}

.home-hero {
    position: relative;
    display: grid;
    min-height: 690px;
    align-items: center;
    grid-template-columns: minmax(0, 0.88fr) minmax(540px, 1.12fr);
    gap: clamp(2.5rem, 5vw, 5rem);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-large);
    background-color: #f2f7ff;
    background-image:
        linear-gradient(rgba(103, 151, 217, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 151, 217, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 72% 28%, rgba(112, 169, 255, 0.15), transparent 34%);
    background-size: 64px 64px, 64px 64px, auto;
    padding: clamp(3rem, 7vw, 6.2rem) clamp(1.5rem, 5vw, 4.75rem);
    box-shadow: var(--app-shadow-small);
}

.home-hero::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(246, 250, 255, 0.92) 0%, rgba(246, 250, 255, 0.42) 47%, transparent 75%);
    content: "";
    pointer-events: none;
}

.hero-copy,
.product-preview {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 1.1rem;
    color: var(--app-blue);
    font-size: 0.77rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 670px;
}

.hero-copy .lead {
    max-width: 620px;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero-actions .button {
    min-width: 168px;
}

.technology-line {
    margin: 1.45rem 0 0;
    color: var(--app-text-faint);
    font-size: 0.78rem;
    font-weight: 620;
    letter-spacing: 0.02em;
}

.product-preview {
    overflow: hidden;
    border: 1px solid rgba(190, 205, 226, 0.95);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 28px 70px rgba(47, 87, 145, 0.18), 0 2px 8px rgba(47, 87, 145, 0.08);
    transform: perspective(1400px) rotateY(-1.3deg) rotateX(0.5deg);
}

.preview-topbar {
    display: grid;
    min-height: 56px;
    align-items: center;
    grid-template-columns: 1fr auto 1fr;
    border-bottom: 1px solid var(--app-border);
    padding: 0 1rem;
}

.preview-brand {
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.preview-environment {
    color: var(--app-text-faint);
    font-size: 0.66rem;
    font-weight: 620;
}

.preview-status {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 0.38rem;
    border: 1px solid #cce9dd;
    border-radius: 999px;
    background: var(--app-success-soft);
    padding: 0.25rem 0.48rem;
    color: var(--app-success);
    font-size: 0.62rem;
    font-weight: 690;
}

.preview-status i {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: #20a875;
    box-shadow: 0 0 0 3px rgba(32, 168, 117, 0.12);
}

.preview-body {
    display: grid;
    min-height: 400px;
    grid-template-columns: 132px minmax(0, 1fr);
}

.preview-sidebar {
    display: grid;
    align-content: start;
    gap: 0.3rem;
    border-right: 1px solid var(--app-border);
    background: rgba(248, 250, 255, 0.82);
    padding: 1rem 0.7rem;
}

.preview-sidebar span {
    border-radius: 7px;
    padding: 0.55rem 0.65rem;
    color: var(--app-text-faint);
    font-size: 0.64rem;
    font-weight: 580;
}

.preview-sidebar .is-active {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.preview-content {
    min-width: 0;
    padding: 1.25rem;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.preview-heading div {
    display: grid;
    gap: 0.15rem;
}

.preview-heading span,
.preview-cards span {
    color: var(--app-text-faint);
    font-size: 0.62rem;
}

.preview-heading strong {
    font-size: 0.9rem;
    font-weight: 700;
}

.preview-heading .preview-chip {
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-soft);
    padding: 0.28rem 0.52rem;
    color: var(--app-text-soft);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.58rem;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.preview-cards > div {
    display: grid;
    min-width: 0;
    gap: 0.22rem;
    border: 1px solid var(--app-border);
    border-radius: 11px;
    background: #ffffff;
    padding: 0.8rem;
    box-shadow: 0 5px 14px rgba(47, 87, 145, 0.04);
}

.preview-cards strong {
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    font-weight: 710;
}

.preview-cards small {
    color: var(--app-text-faint);
    font-size: 0.56rem;
    line-height: 1.35;
}

.preview-flow {
    margin-top: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 11px;
    background: #ffffff;
    padding: 0.9rem;
}

.preview-flow p {
    margin: 0;
    color: var(--app-text-soft);
    font-size: 0.62rem;
    font-weight: 650;
}

.flow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.flow-steps span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.35rem;
}

.flow-steps i {
    display: grid;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--app-blue-soft);
    color: var(--app-blue);
    font-size: 0.55rem;
    font-style: normal;
    font-weight: 750;
}

.flow-steps b {
    overflow: hidden;
    font-size: 0.58rem;
    font-weight: 650;
    text-overflow: ellipsis;
}

.flow-steps em {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, var(--app-border), var(--app-blue));
}

.product-section {
    padding: clamp(5rem, 10vw, 8.5rem) 0;
}

.section-heading {
    display: grid;
    max-width: 760px;
    gap: 1rem;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-heading .eyebrow {
    margin: 0;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.25rem);
    font-weight: 720;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.section-heading > p:last-child {
    max-width: 650px;
    margin: 0;
    color: var(--app-text-soft);
    font-size: 1.08rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--app-border);
    border-left: 1px solid var(--app-border);
}

.feature-card {
    display: grid;
    min-height: 250px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.35rem;
    border-right: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.4);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.feature-card:hover {
    background: #ffffff;
}

.feature-icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border: 1px solid #cbdcf3;
    border-radius: 13px;
    background: var(--app-surface-blue);
    color: var(--app-blue);
}

.feature-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.feature-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 690;
    letter-spacing: -0.025em;
}

.feature-card p {
    margin: 0.65rem 0 1.2rem;
    color: var(--app-text-soft);
    font-size: 0.94rem;
}

.feature-card a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--app-blue);
    font-size: 0.88rem;
    font-weight: 680;
}

.feature-card a::after {
    content: "→";
}

.feature-card a:hover {
    color: var(--app-blue-hover);
}

/* Shared application components */

.stack-form {
    display: grid;
    gap: 0.65rem;
    max-width: 720px;
    margin-top: 2rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface-soft);
    padding: clamp(1rem, 4vw, 1.6rem);
}

.stack-form h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.stack-form label {
    margin-top: 0.3rem;
    color: var(--app-text);
    font-size: 0.875rem;
    font-weight: 650;
}

.stack-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
}

.stack-form input,
.inline-form input {
    min-height: 46px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-small);
    background: #ffffff;
    padding: 0.72rem 0.82rem;
    color: var(--app-text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(13, 24, 48, 0.025);
}

.stack-form input:hover,
.inline-form input:hover {
    border-color: #aebed3;
}

.stack-form input:focus,
.inline-form input:focus {
    border-color: var(--app-blue);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(20, 110, 245, 0.11);
}

.stack-form input[type="checkbox"] {
    width: 1.05rem;
    min-height: auto;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--app-blue);
    box-shadow: none;
}

.stack-form small {
    color: var(--app-text-faint);
}

.stack-form > button {
    width: fit-content;
    margin-top: 0.7rem;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-form input {
    flex: 1;
    min-width: 0;
}

.external-login-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.google-login-button,
.github-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-small);
    background: #ffffff;
    color: #1f1f1f;
    padding: 0.72rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 650;
}

.google-login-button:hover,
.github-login-button:hover {
    border-color: #aebed3;
    background: var(--app-surface-soft);
    color: var(--app-text);
    box-shadow: var(--app-shadow-small);
    transform: translateY(-1px);
}

.google-login-button:active,
.github-login-button:active {
    background: #eef3f8;
    box-shadow: none;
}

.google-login-button img,
.github-login-button img {
    display: block;
    flex: 0 0 20px;
    height: auto;
    object-fit: contain;
}

.form-success,
.form-error,
.demo-warning,
.empty-state {
    max-width: 720px;
    border: 1px solid;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
}

.form-success {
    margin: 1.25rem 0 0;
    border-color: #cce9dd;
    background: var(--app-success-soft);
    color: var(--app-success);
}

.form-error {
    margin: 1.25rem 0 0;
    border-color: #f0c8cf;
    background: var(--app-danger-soft);
    color: var(--app-danger);
}

.demo-warning {
    margin-top: 1.5rem;
    border-color: #edd8a3;
    border-left-width: 1px;
    background: var(--app-warning-soft);
    color: var(--app-warning);
}

.empty-state {
    margin-top: 2rem;
    border-color: var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text-soft);
}

.item-list {
    gap: 0.65rem;
    margin-top: 2rem;
}

.item-list li {
    border-color: var(--app-border);
    border-radius: 12px;
    background: #ffffff;
    padding: 0.9rem 1rem;
}

.item-list li:hover {
    border-color: var(--app-border-strong);
    box-shadow: var(--app-shadow-small);
}

.item-list small {
    color: var(--app-text-faint);
}

.info-section {
    margin-top: 2.5rem;
    border-top-color: var(--app-border);
    padding-top: 2rem;
}

.info-section h2,
.info-section h3 {
    color: var(--app-text);
    letter-spacing: -0.025em;
}

.info-fields,
.detail-list {
    display: grid;
    gap: 0;
    margin: 1.25rem 0 0;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #ffffff;
}

.info-fields div,
.detail-list {
    grid-template-columns: minmax(10rem, 0.34fr) minmax(0, 1fr);
}

.info-fields div,
.detail-list dt,
.detail-list dd {
    padding: 0.8rem 1rem;
}

.info-fields div + div,
.detail-list dt:not(:first-of-type),
.detail-list dd:not(:first-of-type) {
    border-top: 1px solid var(--app-border);
}

.info-fields dt,
.detail-list dt {
    color: var(--app-text-soft);
    font-size: 0.86rem;
    font-weight: 650;
}

.info-fields dd,
.detail-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.detail-list dt {
    background: var(--app-surface-soft);
}

.table-scroll {
    margin-top: 1.5rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
}

.info-table {
    border: 0;
    background: #ffffff;
}

.info-table th,
.info-table td {
    border-bottom-color: var(--app-border);
    padding: 0.85rem 1rem;
}

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

.info-table th {
    background: var(--app-surface-soft);
    color: var(--app-text-soft);
    font-size: 0.75rem;
    font-weight: 720;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.info-table tbody tr:hover {
    background: #f9fbff;
}

.code-block {
    overflow-x: auto;
    margin: 1.5rem 0 0;
    border: 1px solid #26334b;
    border-radius: 12px;
    background: #0d1830;
    color: #dce8ff;
    padding: 1.15rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
}

.inline-action {
    margin-top: 2rem;
}

/* Interior application pages */

.site-main .page-shell > .app-page {
    max-width: 1180px;
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.25rem;
}

.page-header > div {
    min-width: 0;
}

.page-header .lead {
    margin-bottom: 0;
}

.page-chip,
.count-badge,
.status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbdcf3;
    border-radius: 999px;
    background: var(--app-surface-blue);
    color: var(--app-blue);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.75rem;
    font-weight: 690;
    letter-spacing: 0.01em;
}

.page-chip {
    min-height: 2.2rem;
    padding: 0.45rem 0.72rem;
}

.count-badge {
    min-width: 1.8rem;
    height: 1.8rem;
    padding: 0 0.45rem;
}

.count-badge-large {
    min-width: 3.25rem;
    height: 3.25rem;
    font-size: 1rem;
}

.panel {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--app-shadow-small);
}

.panel h2,
.panel h3 {
    margin-top: 0;
    color: var(--app-text);
    letter-spacing: -0.03em;
}

.panel h2 {
    font-size: 1.2rem;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.panel-heading h2,
.panel-heading h3 {
    margin: 0;
}

.workspace-grid {
    display: grid;
    align-items: start;
    gap: 1.25rem;
}

.panel-form.stack-form {
    max-width: none;
    margin: 1.25rem 0 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.panel-form.stack-form h2 {
    margin-bottom: 0.8rem;
}

.panel-form.stack-form input {
    width: 100%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
    color: var(--app-blue);
    font-size: 0.88rem;
    font-weight: 670;
}

.back-link::before {
    content: "←";
}

.back-link:hover {
    color: var(--app-blue-hover);
}

/* Database */

.database-status-panel {
    position: relative;
    overflow: hidden;
}

.database-status-panel::after {
    position: absolute;
    top: -6rem;
    right: -5rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(20, 110, 245, 0.06);
    content: "";
    pointer-events: none;
}

.database-status-heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.database-status-heading > div {
    display: grid;
    gap: 0.15rem;
}

.database-status-heading strong {
    font-size: 1.05rem;
}

.database-status-heading span:last-child {
    color: var(--app-text-soft);
    font-size: 0.88rem;
}

.status-orb {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: #21a875;
    box-shadow: 0 0 0 7px rgba(33, 168, 117, 0.11);
}

.database-status-panel .code-block {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

/* Notes */

.notes-workspace {
    grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1.32fr);
}

.compose-panel {
    position: sticky;
    top: 100px;
}

.compose-panel .panel-form > button {
    width: 100%;
}

.collection-panel .item-list,
.collection-panel .empty-state {
    margin-top: 1.25rem;
}

.note-list li {
    position: relative;
    align-items: center;
    padding-right: 2.8rem;
}

.note-list li::after {
    position: absolute;
    right: 1rem;
    color: var(--app-blue);
    content: "→";
}

.note-list a {
    min-width: 0;
    overflow: hidden;
    font-weight: 640;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-document {
    overflow: hidden;
    padding: 0;
}

.note-document > p {
    min-height: 260px;
    margin: 0;
    padding: clamp(2rem, 6vw, 4.5rem);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 560;
    letter-spacing: -0.035em;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.note-metadata {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface-soft);
}

.note-metadata > div {
    padding: 1rem 1.25rem;
}

.note-metadata > div + div {
    border-left: 1px solid var(--app-border);
}

.note-metadata dt {
    color: var(--app-text-faint);
    font-size: 0.72rem;
    font-weight: 720;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.note-metadata dd {
    margin: 0.25rem 0 0;
    overflow-wrap: anywhere;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
}

.access-page > .demo-warning {
    max-width: none;
    margin: -0.75rem 0 1.25rem;
}

/* Roles and access tools */

.roles-workspace {
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
}

.guidance-panel {
    background: linear-gradient(145deg, #ffffff, #f4f8ff);
}

.guidance-panel .demo-warning {
    max-width: none;
    margin: 0;
}

.session-note {
    margin: 1.25rem 0 0;
    color: var(--app-text-soft);
    font-size: 0.9rem;
}

.action-panel .form-success {
    margin-bottom: 0;
}

.button-danger,
.stack-form .button-danger {
    border-color: #efc5cb;
    background: #ffffff;
    color: var(--app-danger);
    box-shadow: none;
}

.button-danger:hover,
.stack-form .button-danger:hover {
    border-color: var(--app-danger);
    background: var(--app-danger-soft);
    color: var(--app-danger);
    box-shadow: none;
}

.lookup-panel {
    display: grid;
    max-width: 560px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
}

.lookup-panel > label {
    color: var(--app-text-soft);
    font-size: 0.82rem;
    font-weight: 670;
}

.access-workspace {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 1.25rem;
}

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

.form-grid > div {
    display: grid;
    gap: 0.45rem;
}

.grants-results-panel {
    min-height: 360px;
}

.grants-placeholder {
    display: grid;
    min-height: 300px;
    place-content: center;
    justify-items: center;
    color: var(--app-text-faint);
    text-align: center;
}

.grants-placeholder span {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    border: 1px solid #cbdcf3;
    border-radius: 15px;
    background: var(--app-surface-blue);
    color: var(--app-blue);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 720;
}

.grants-placeholder p {
    margin: 0.85rem 0 0;
    font-size: 0.9rem;
}

.grants-results-panel .item-list {
    margin-top: 1.1rem;
}

.grants-results-panel .item-list li {
    display: grid;
    align-items: stretch;
    gap: 0.45rem;
}

.grants-results-panel .item-list code {
    color: var(--app-blue);
    font-size: 0.85rem;
    font-weight: 680;
}

.grants-results-panel .item-list form {
    margin-top: 0.55rem;
    border-top: 1px solid var(--app-border);
    padding-top: 0.8rem;
}

.grants-results-panel .item-list form > label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--app-text-soft);
    font-size: 0.78rem;
    font-weight: 650;
}

.grants-history-heading {
    margin-top: 2rem;
    border-top: 1px solid var(--app-border);
    padding-top: 1.5rem;
}

/* Current user and account */

.status-badge {
    gap: 0.45rem;
    min-height: 2.2rem;
    padding: 0.45rem 0.72rem;
    font-family: inherit;
}

.status-badge i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
}

.status-badge.is-online {
    border-color: #cce9dd;
    background: var(--app-success-soft);
    color: var(--app-success);
}

.status-badge.is-online i {
    background: #21a875;
}

.status-badge.is-offline {
    border-color: var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text-soft);
}

.status-badge.is-offline i {
    background: var(--app-text-faint);
}

.userinfo-grid {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    gap: 1.25rem;
}

.userinfo-panel .empty-state {
    margin-bottom: 0;
}

.account-info-panel h3 {
    margin-top: 2rem;
}

.account-info-panel .table-scroll {
    margin-bottom: 0;
}

.site-main .page-shell > .account-page {
    max-width: 820px;
}

.account-summary-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface-soft);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.account-avatar {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 18px;
    background: var(--app-blue);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 740;
    box-shadow: 0 12px 28px rgba(20, 110, 245, 0.22);
}

.account-summary-card .lead {
    margin: 0;
}

.account-summary-card .inline-action {
    margin-top: 1.25rem;
}

/* Authentication pages provided by base */

.site-main .page-shell > .auth-page {
    max-width: 760px;
}

.auth-page > h1,
.auth-page > .lead {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.auth-page > .form-success,
.auth-page > .form-error,
.auth-page > .empty-state {
    margin-right: auto;
    margin-left: auto;
}

.auth-page > .stack-form {
    margin-right: auto;
    margin-left: auto;
}

.auth-page .external-login-options {
    justify-content: center;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 1.25rem;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    font-weight: 610;
}

.auth-links a {
    color: var(--app-blue);
}

.auth-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 1.35rem 0 0;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.auth-switch a {
    color: var(--app-blue);
    font-weight: 680;
}

.site-main .page-shell > .registration-page {
    max-width: 1080px;
}

.registration-options {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.registration-options .stack-form {
    width: 100%;
    height: 100%;
    margin: 0;
}

.registration-page > .external-login-options {
    margin-top: 1.25rem;
}

@media (max-width: 1120px) {
    .site-nav,
    .page-shell {
        width: min(calc(100% - 2rem), 1280px);
    }

    .nav-primary {
        position: static;
        margin-left: auto;
        transform: none;
    }

    .nav-utility {
        margin-left: 0;
    }

    .nav-utility > a:first-child {
        display: none;
    }

    .home-hero {
        min-height: 640px;
        grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
        gap: 2rem;
        padding-inline: 2.5rem;
    }

    .preview-body {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .access-workspace {
        grid-template-columns: 1fr;
    }

    .compose-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .site-nav {
        min-height: 68px;
    }

    .nav-primary,
    .nav-utility {
        display: none;
    }

    .locale-form {
        position: relative;
        display: inline-grid;
        width: 2.5rem;
        height: 2.5rem;
        place-items: center;
        overflow: hidden;
        border: 1px solid var(--app-border);
        border-radius: 9px;
        background: #ffffff;
        margin-left: auto;
    }

    .locale-code {
        display: block;
        color: var(--app-text-soft);
        font-size: 0.72rem;
        font-weight: 720;
        letter-spacing: 0.04em;
    }

    .locale-form select {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
        opacity: 0;
    }

    .mobile-navigation {
        display: block;
    }

    .mobile-navigation > summary {
        display: grid;
        width: 2.5rem;
        height: 2.5rem;
        place-items: center;
        border: 1px solid var(--app-border);
        border-radius: 9px;
        background: #ffffff;
        cursor: pointer;
        list-style: none;
    }

    .mobile-navigation > summary span[aria-hidden="true"],
    .mobile-navigation > summary span[aria-hidden="true"]::before,
    .mobile-navigation > summary span[aria-hidden="true"]::after {
        width: 1rem;
        height: 1.5px;
        background: var(--app-text);
        content: "";
    }

    .mobile-navigation > summary span[aria-hidden="true"] {
        position: relative;
    }

    .mobile-navigation > summary span[aria-hidden="true"]::before,
    .mobile-navigation > summary span[aria-hidden="true"]::after {
        position: absolute;
        left: 0;
    }

    .mobile-navigation > summary span[aria-hidden="true"]::before {
        top: -0.33rem;
    }

    .mobile-navigation > summary span[aria-hidden="true"]::after {
        top: 0.33rem;
    }

    .mobile-navigation-panel {
        position: absolute;
        top: calc(100% + 0.65rem);
        right: 0;
        display: grid;
        width: min(360px, calc(100vw - 2rem));
        gap: 0.15rem;
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius);
        background: rgba(255, 255, 255, 0.98);
        padding: 0.65rem;
        box-shadow: var(--app-shadow);
    }

    .mobile-navigation-panel a,
    .mobile-navigation-label {
        border-radius: 9px;
        padding: 0.65rem 0.75rem;
        color: var(--app-text-soft);
        font-size: 0.9rem;
        font-weight: 590;
    }

    .mobile-navigation-panel a:hover {
        background: var(--app-surface-blue);
        color: var(--app-text);
    }

    .mobile-navigation-label {
        padding-bottom: 0.25rem;
        color: var(--app-text-faint);
        font-size: 0.68rem;
        font-weight: 720;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .mobile-navigation-separator {
        height: 1px;
        margin: 0.45rem 0;
        background: var(--app-border);
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding: 4.5rem 3rem 3rem;
    }

    .hero-copy {
        max-width: 680px;
    }

    .product-preview {
        max-width: 720px;
        transform: none;
    }

    .feature-card {
        min-height: 230px;
        grid-template-columns: 1fr;
    }

    .notes-workspace,
    .roles-workspace,
    .userinfo-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
    }

    .registration-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-nav,
    .page-shell {
        width: min(calc(100% - 1.25rem), 1280px);
    }

    .brand-mark {
        width: 1.85rem;
        height: 1.85rem;
    }

    .home-page {
        padding-top: 0.65rem;
    }

    .home-hero {
        min-height: auto;
        border-radius: 18px;
        background-size: 44px 44px, 44px 44px, auto;
        padding: 3.5rem 1.25rem 1.25rem;
    }

    .home-hero::before {
        background: linear-gradient(180deg, rgba(246, 250, 255, 0.82), rgba(246, 250, 255, 0.2));
    }

    .hero-copy h1 {
        font-size: clamp(2.55rem, 13vw, 4.1rem);
    }

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

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

    .technology-line {
        line-height: 1.6;
    }

    .preview-topbar {
        grid-template-columns: 1fr auto;
    }

    .preview-environment {
        display: none;
    }

    .preview-body {
        min-height: 330px;
        grid-template-columns: 1fr;
    }

    .preview-sidebar {
        display: flex;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
        padding: 0.55rem;
    }

    .preview-sidebar span {
        white-space: nowrap;
    }

    .preview-content {
        padding: 0.9rem;
    }

    .preview-cards {
        grid-template-columns: 1fr;
    }

    .preview-cards > div:nth-child(3) {
        display: none;
    }

    .flow-steps b {
        display: none;
    }

    .product-section {
        padding: 5.5rem 0;
    }

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

    .feature-card {
        min-height: 0;
    }

    .site-main .page-shell > div:not(.home-page) {
        margin: 1.25rem auto 2.5rem;
        border-radius: 18px;
        padding: 1.25rem;
    }

    .site-main .page-shell > .app-page {
        border: 0;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }

    .site-main .page-shell > div:not(.home-page) h1 {
        font-size: clamp(2.15rem, 12vw, 3.1rem);
    }

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

    .page-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-chip,
    .count-badge-large,
    .status-badge {
        align-self: flex-start;
    }

    .panel {
        border-radius: 14px;
        padding: 1.1rem;
    }

    .note-metadata,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .note-metadata > div + div {
        border-top: 1px solid var(--app-border);
        border-left: 0;
    }

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

    .account-summary-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .stack-form > button,
    .inline-form button {
        width: 100%;
    }

    .info-fields div,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .detail-list dt,
    .detail-list dd {
        border-top: 0 !important;
    }

    .detail-list dd:not(:last-child) {
        border-bottom: 1px solid var(--app-border);
    }

    .site-footer .page-shell {
        min-height: 130px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.4rem;
    }

    .site-footer small {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
