:root {
    color-scheme: light;
    --page-canvas: #f5f7fb;
    --page-surface: #ffffff;
    --page-surface-muted: #f8f9fc;
    --page-ink: #172033;
    --page-muted: #667085;
    --page-border: #dfe3eb;
    --page-brand: #41519e;
    --page-brand-dark: #29366f;
    --page-brand-light: #7181cf;
    --page-brand-soft: #eef0fa;
    --page-orange: #f06424;
    --page-yellow: #ffdc5e;
    --page-focus: #7181cf;
    --page-action: #41519e;
    --page-action-hover: #344487;
    --attention-bg: #ffd84d;
    --attention-ink: #241900;
    --critical-bg: #fef3f2;
    --critical-ink: #b42318;
    --information-bg: #eef0fa;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page-canvas);
}

body.public-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--page-ink);
    background: var(--page-canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.public-shell *,
.public-shell *::before,
.public-shell *::after {
    box-sizing: border-box;
}

.public-shell a {
    color: inherit;
}

.public-shell :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--page-focus);
    outline-offset: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    clip-path: inset(50%) !important;
}

.skip-link {
    position: fixed;
    z-index: 10;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: var(--page-ink);
    background: #fff;
    border: 1px solid var(--page-border);
    border-radius: 0.5rem;
    font-weight: 700;
    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}

.public-main {
    display: grid;
    min-height: 0;
}

.instance-page {
    display: grid;
    min-height: 100%;
    place-items: center;
    width: min(100%, 42rem);
    margin-inline: auto;
    padding: clamp(1.25rem, 4vw, 3.5rem);
}

.instance-card {
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.25rem, 4vw, 2rem);
    width: 100%;
    padding: clamp(1.5rem, 6vw, 3.5rem);
    background: var(--page-surface);
    border: 1px solid var(--page-border);
    border-radius: 2rem;
    box-shadow:
        0 1px 2px rgb(16 24 40 / 0.04),
        0 1.5rem 4rem rgb(16 24 40 / 0.1);
}

.instance-mark-panel {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 8.5rem;
    overflow: hidden;
    place-items: center;
    padding: 2rem clamp(1.5rem, 6vw, 3rem);
    background: var(--page-brand);
    border: 1px solid var(--page-brand-dark);
    border-radius: 1rem;
    box-shadow: inset 0 -0.3rem 0 var(--page-orange);
    isolation: isolate;
}

.instance-mark-panel::after {
    position: absolute;
    z-index: -1;
    right: -4.5rem;
    bottom: -5.5rem;
    width: 11rem;
    height: 11rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 2.5rem rgb(255 255 255 / 0.025),
        0 0 0 5rem rgb(255 255 255 / 0.02);
    content: "";
}

.instance-mark {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 15rem);
    height: auto;
}

.instance-notice {
    width: 100%;
    padding: 0.9rem 1rem;
    color: var(--page-brand-dark);
    background: var(--information-bg);
    border: 1px solid #d8dcf0;
    border-radius: 0.75rem;
    font-size: 0.94rem;
    text-align: left;
}

.instance-notice[hidden] {
    display: none;
}

.instance-notice--warning {
    color: var(--attention-ink);
    background: var(--attention-bg);
    border-color: #f5c400;
}

.instance-notice--critical {
    color: var(--critical-ink);
    background: var(--critical-bg);
    border-color: #fecdca;
}

.instance-notice a {
    display: inline-block;
    margin-left: 0.35rem;
    font-weight: 700;
}

.instance-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 4.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--page-border);
    border-radius: 0.85rem;
}

.instance-badge--with-region {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: stretch;
}

.instance-badge--attention {
    color: var(--attention-ink);
    background: var(--attention-bg);
    border-color: #f5c400;
    box-shadow: 0 0 0 4px rgb(255 216 77 / 0.16);
}

.instance-badge--production {
    color: var(--page-ink);
    background: var(--page-surface-muted);
    border-color: var(--page-border);
}

.instance-badge__environment {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.095em;
    text-align: center;
}

.instance-badge__environment strong {
    font-weight: 850;
}

.instance-badge__tenant {
    letter-spacing: 0.06em;
}

.instance-badge__region {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-left: 1rem;
    border-left: 1px solid rgb(23 32 51 / 0.25);
    font-size: 0.95rem;
    font-weight: 700;
}

.instance-badge__region small {
    margin-top: 0.1rem;
    font-size: 0.76rem;
    font-weight: 600;
    opacity: 0.78;
}

.instance-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.5rem;
}

.instance-actions--authenticated {
    flex-direction: row;
    gap: 1.1rem;
}

.public-shell .instance-sign-in {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1.15rem minmax(0, 1fr) 1.35rem;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 3.75rem;
    padding: 0.8rem 1.35rem;
    color: #fff;
    background: var(--page-action);
    border: 2px solid var(--page-brand-dark);
    border-radius: 999px;
    box-shadow:
        0 0.5rem 0 var(--page-yellow),
        0 1rem 2rem rgb(65 81 158 / 0.18);
    font-size: 1rem;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.public-shell .instance-sign-in:hover {
    color: #fff;
    background: var(--page-action-hover);
    box-shadow:
        0 0.6rem 0 var(--page-yellow),
        0 1.1rem 2.25rem rgb(65 81 158 / 0.22);
    transform: translateY(-0.1rem);
}

.public-shell .instance-sign-in:active {
    color: #fff;
    box-shadow:
        0 0.15rem 0 var(--page-yellow),
        0 0.45rem 1rem rgb(65 81 158 / 0.16);
    transform: translateY(0.35rem);
}

.instance-sign-in__grid {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    justify-self: start;
    fill: currentColor;
}

.instance-sign-in__label {
    min-width: 0;
    text-align: center;
}

.instance-sign-in__arrow {
    justify-self: end;
    font-size: 1.55rem;
    font-weight: 400;
    line-height: 1;
}

.instance-auth-divider {
    display: grid;
    grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    color: var(--page-muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
}

.instance-auth-divider::before,
.instance-auth-divider::after {
    height: 1px;
    background: var(--page-border);
    content: "";
}

.public-shell .instance-local-sign-in {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.72rem 1.2rem;
    color: var(--page-brand-dark);
    background: var(--page-surface);
    border: 1px solid #b9c1e1;
    border-radius: 999px;
    box-shadow: 0 0.2rem 0 var(--page-brand-soft);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.public-shell .instance-local-sign-in:hover {
    color: var(--page-brand-dark);
    background: var(--page-brand-soft);
    border-color: var(--page-brand-light);
    box-shadow: 0 0.28rem 0 #d9def3;
    transform: translateY(-0.06rem);
}

.public-shell .instance-local-sign-in:active {
    box-shadow: none;
    transform: translateY(0.14rem);
}

.instance-sign-out-form {
    flex: 0 0 auto;
    margin: 0;
}

.instance-sign-out {
    min-height: 2.75rem;
    padding: 0.65rem 0.35rem;
    color: var(--page-muted);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.instance-sign-out:hover {
    color: var(--page-brand-dark);
    background: var(--page-brand-soft);
}

.public-shell .instance-support {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.2rem;
    padding: 0.55rem 0.85rem 0.55rem 0.6rem;
    color: var(--page-brand);
    background: var(--page-brand-soft);
    border: 1px solid #cdd3ed;
    border-radius: 999px;
    box-shadow: 0 0.2rem 0 var(--page-yellow);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.public-shell .instance-support::before {
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: #fff;
    background: var(--page-brand);
    border-radius: 50%;
    content: "?";
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1;
}

.public-shell .instance-support::after {
    content: "↗";
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
}

.public-shell .instance-support:hover {
    color: #fff;
    background: var(--page-brand);
    box-shadow: 0 0.28rem 0 var(--page-yellow);
    transform: translateY(-0.08rem);
}

.public-shell .instance-support:hover::before {
    color: var(--page-brand);
    background: #fff;
}

.public-shell .instance-support:active {
    box-shadow: 0 0.08rem 0 var(--page-yellow);
    transform: translateY(0.12rem);
}

.instance-footer a:hover {
    color: var(--page-brand);
}

.instance-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--page-muted);
    padding: 0 1rem 1.25rem;
    font-size: 0.8rem;
}

.instance-footer a {
    text-decoration: none;
}

.instance-footer a + a {
    padding-left: 0.65rem;
    border-left: 1px solid var(--page-border);
}

@media (max-width: 32rem) {
    .instance-page {
        padding: 1rem;
    }

    .instance-card {
        padding: 1.5rem 1rem;
        border-radius: 1rem;
    }

    .instance-sign-in {
        gap: 0.65rem;
        padding-inline: 1.1rem;
    }

    .instance-actions--authenticated {
        flex-direction: column;
        gap: 0.75rem;
    }

    .instance-actions--authenticated .instance-sign-in {
        width: 100%;
    }

    .instance-sign-out {
        min-height: 2.5rem;
        padding-inline: 1rem;
    }

    .instance-badge--with-region {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .instance-badge__region {
        padding-top: 0.5rem;
        padding-left: 0;
        border-top: 1px solid rgb(23 32 51 / 0.25);
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .instance-sign-in,
    .instance-local-sign-in,
    .instance-support,
    .instance-sign-out {
        transition: none;
    }
}
