:root {
    --kdn-bg: #eef2f6;
    --kdn-surface: #ffffff;
    --kdn-surface-soft: #f7f9fb;
    --kdn-header: #081321;
    --kdn-header-soft: #0d1c2d;
    --kdn-text: #172231;
    --kdn-muted: #657486;
    --kdn-border: #d5dde5;
    --kdn-border-strong: #b8c5d1;
    --kdn-primary: #2874e8;
    --kdn-primary-soft: #e8f0ff;
    --kdn-accent: #f0a13a;
    --kdn-success: #169b64;
    --kdn-danger: #d34c55;
    --kdn-radius: 5px;
    --kdn-max: 1320px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    background: var(--kdn-bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--kdn-text);
    background:
        linear-gradient(rgba(25, 48, 72, .018) 1px, transparent 1px),
        var(--kdn-bg);
    background-size: 100% 28px;
    font-size: 12px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

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

h1,
h2,
h3,
p,
dl,
dd,
ul {
    margin-top: 0;
}

h1,
h2,
h3,
strong {
    font-weight: 500;
}

h1 {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.35;
}

h2 {
    margin-bottom: 5px;
    font-size: 12px;
}

h3 {
    margin-bottom: 5px;
    font-size: 11px;
}

p {
    color: var(--kdn-muted);
    font-size: 11px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 8px 10px;
    border-radius: var(--kdn-radius);
    color: #fff;
    background: var(--kdn-primary);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    color: #b8c6d4;
    background: var(--kdn-header);
    border-bottom: 1px solid #1f3246;
}

.header-inner {
    min-height: 56px;
    max-width: var(--kdn-max);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    min-width: 212px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.brand-mark {
    width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #47708f;
    border-radius: 3px;
    color: #fff;
    background: #0f2437;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .8px;
}

.brand-copy {
    display: block;
    line-height: 1.2;
}

.brand-copy strong {
    display: block;
    color: #f3f7fb;
    font-size: 11px;
}

.brand-copy small {
    display: block;
    margin-top: 3px;
    color: #71879a;
    font-size: 8px;
    letter-spacing: .65px;
    text-transform: uppercase;
}

.primary-nav {
    display: flex;
    align-self: stretch;
    align-items: center;
    gap: 2px;
}

.primary-nav a {
    height: 56px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    color: #8fa1b2;
    font-size: 10px;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a.is-active {
    color: #fff;
    border-bottom-color: var(--kdn-primary);
}

.header-actions {
    margin-left: auto;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #263b50;
    border-radius: 4px;
    color: #8ea3b7;
    background: var(--kdn-header-soft);
    font-size: 9px;
}

.system-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--kdn-success);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid #294057;
    border-radius: 4px;
    color: #c6d3df;
    background: #0d1c2d;
    font-size: 10px;
}

.site-main {
    width: min(calc(100% - 32px), var(--kdn-max));
    min-height: calc(100vh - 108px);
    margin: 0 auto;
    padding: 18px 0 30px;
}

.phase-banner {
    min-height: 220px;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 32px;
    overflow: hidden;
    position: relative;
    border: 1px solid #1d3852;
    border-radius: var(--kdn-radius);
    color: #eaf1f7;
    background:
        linear-gradient(90deg, rgba(63, 128, 186, .07) 1px, transparent 1px),
        linear-gradient(rgba(63, 128, 186, .07) 1px, transparent 1px),
        linear-gradient(118deg, #091725 0%, #0d2236 68%, #102b42 100%);
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.phase-banner::after {
    content: "";
    width: 160px;
    height: 2px;
    position: absolute;
    right: 24px;
    bottom: 0;
    background: linear-gradient(90deg, transparent, var(--kdn-accent));
}

.phase-copy {
    max-width: 650px;
}

.phase-copy h1 {
    color: #fff;
}

.phase-copy p {
    max-width: 610px;
    margin-bottom: 15px;
    color: #a8b8c7;
}

.eyebrow {
    margin-bottom: 6px;
    color: #5f99d8;
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.phase-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.inline-form {
    margin: 0;
}

.button {
    min-height: 32px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 500;
}

.button:disabled {
    cursor: wait;
    opacity: .65;
}

.button-primary {
    color: #fff;
    background: var(--kdn-primary);
    border-color: var(--kdn-primary);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: #1f65ce;
}

.button-secondary {
    color: #d8e2eb;
    background: #10263a;
    border-color: #38546d;
}

.request-result {
    min-height: 16px;
    margin-top: 9px;
    color: #89d5b5;
    font-size: 9px;
}

.request-result.is-error {
    color: #f3a5aa;
}

.runtime-panel {
    border: 1px solid #35516a;
    border-radius: 4px;
    background: rgba(5, 16, 27, .72);
}

.runtime-head {
    min-height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #263e52;
    color: #dce7ef;
    font-size: 10px;
}

.status-label {
    padding: 3px 6px;
    border-radius: 3px;
    color: #90dbba;
    background: rgba(22, 155, 100, .12);
    font-size: 8px;
}

.runtime-panel dl {
    margin: 0;
    padding: 6px 12px 10px;
}

.runtime-panel dl div {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(71, 97, 117, .35);
}

.runtime-panel dl div:last-child {
    border-bottom: 0;
}

.runtime-panel dt {
    color: #7890a3;
    font-size: 9px;
}

.runtime-panel dd {
    margin: 0;
    color: #dbe6ee;
    font-size: 9px;
}

.system-strip {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--kdn-border);
    border-radius: var(--kdn-radius);
    background: var(--kdn-surface);
}

.system-strip > div {
    min-height: 70px;
    padding: 12px;
    display: grid;
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 8px;
    border-right: 1px solid var(--kdn-border);
}

.system-strip > div:last-child {
    border-right: 0;
}

.system-strip span {
    grid-row: 1 / 3;
    align-self: center;
    color: var(--kdn-primary);
    font-size: 10px;
}

.system-strip strong {
    font-size: 10px;
}

.system-strip small {
    color: var(--kdn-muted);
    font-size: 8px;
}

.content-section {
    margin-top: 18px;
}

.section-heading {
    margin-bottom: 9px;
    padding-bottom: 7px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    border-bottom: 1px solid var(--kdn-border);
}

.section-heading .eyebrow {
    margin-bottom: 3px;
}

.section-heading h2 {
    margin: 0;
}

.section-note {
    color: var(--kdn-muted);
    font-size: 8px;
}

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

.module-card {
    min-height: 132px;
    padding: 14px;
    position: relative;
    border: 1px solid var(--kdn-border);
    border-top: 2px solid var(--kdn-border-strong);
    border-radius: var(--kdn-radius);
    background: var(--kdn-surface);
}

.module-card.is-ready {
    border-top-color: var(--kdn-primary);
}

.module-code {
    width: 34px;
    height: 28px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border: 1px solid #b9c9db;
    border-radius: 3px;
    color: var(--kdn-primary);
    background: var(--kdn-primary-soft);
    font-size: 9px;
    font-weight: 500;
}

.module-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 5px;
    border-radius: 3px;
    color: #718092;
    background: #edf1f5;
    font-size: 8px;
}

.module-card.is-ready .module-status {
    color: #16754e;
    background: #e4f5ed;
}

.module-card p {
    margin-bottom: 0;
    font-size: 9px;
}

.lock-panel {
    margin-top: 16px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border-left: 3px solid var(--kdn-accent);
    border-radius: 0 var(--kdn-radius) var(--kdn-radius) 0;
    background: #fffaf3;
}

.lock-panel h2 {
    margin-bottom: 0;
}

.lock-panel ul {
    margin-bottom: 0;
    padding-left: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    color: #695b49;
    font-size: 9px;
}

.error-page {
    min-height: 430px;
    display: grid;
    grid-template-columns: 150px minmax(0, 420px);
    align-content: center;
    justify-content: center;
    gap: 24px;
}

.error-code {
    color: #aebdca;
    font-size: 13px;
    letter-spacing: 4px;
    text-align: right;
}

.site-footer {
    min-height: 52px;
    color: #758a9d;
    background: var(--kdn-header);
    border-top: 1px solid #1f3246;
}

.footer-inner {
    min-height: 52px;
    max-width: var(--kdn-max);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 8px;
}

.footer-inner strong {
    margin-right: 8px;
    color: #cbd7e2;
    font-size: 9px;
}

.footer-links {
    display: flex;
    gap: 14px;
}

.footer-links a:hover {
    color: #dce7ef;
}

@media (max-width: 920px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0;
    }

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

    .header-actions {
        display: none;
    }

    .primary-nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        order: 4;
        display: grid;
        grid-template-columns: 1fr 1fr;
        transition: max-height .2s ease;
    }

    .primary-nav.is-open {
        max-height: 220px;
        padding: 8px 0 12px;
    }

    .primary-nav a {
        height: 34px;
        border: 0;
    }

    .primary-nav a.is-active {
        border-left: 2px solid var(--kdn-primary);
        background: #0d1c2d;
    }

    .phase-banner {
        grid-template-columns: 1fr;
    }

    .runtime-panel {
        width: 100%;
    }

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

@media (max-width: 620px) {
    .header-inner {
        min-height: 52px;
        padding: 0 10px;
    }

    .brand {
        min-width: 0;
    }

    .brand-mark {
        width: 31px;
        height: 29px;
    }

    .brand-copy small {
        display: none;
    }

    .site-main {
        width: calc(100% - 18px);
        padding-top: 9px;
    }

    .phase-banner {
        min-height: 0;
        padding: 16px 13px;
        gap: 14px;
    }

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

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

    .system-strip {
        grid-template-columns: 1fr 1fr;
    }

    .system-strip > div {
        min-height: 66px;
        border-bottom: 1px solid var(--kdn-border);
    }

    .system-strip > div:nth-child(2) {
        border-right: 0;
    }

    .system-strip > div:nth-child(3),
    .system-strip > div:nth-child(4) {
        border-bottom: 0;
    }

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

    .module-card {
        min-height: 116px;
    }

    .lock-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .error-page {
        min-height: 350px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .error-code {
        text-align: left;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

