:root {
    color-scheme: dark;
    --surface: #182b2a;
    --card: #203936;
    --input: #294743;
    --text: #e0eeea;
    --muted: #adc7c0;
    --accent: #63c7b2;
    --accent-text: #102c27;
    --border: #365950;
    --input-border: #73988f;
    --focus: #a0e4d3;
    font-family: Figtree, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--surface);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
main-container { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; }
main-container > header { display: flex; align-items: center; gap: 36px; padding: 20px clamp(20px, 4vw, 56px); }
#top-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
#top-logo p { font-weight: 700; letter-spacing: .03em; }
#top-logo p span { font-weight: 400; color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-weight: 800; }
main-container > footer { padding: 24px; text-align: center; font-size: .8rem; color: var(--muted); }
.auth-page #main, .auth-page #info-box { display: grid; }
center-content { display: flex; justify-content: center; align-items: center; padding: 24px 20px; }
login-screen { display: block; width: 100%; max-width: 450px; padding: 36px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: 0 16px 60px #0002; }
h1 { font-size: clamp(1.7rem, 4vw, 2.1rem); line-height: 1.2; margin: 10px 0 16px; }
p { line-height: 1.55; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; margin: 0; }
.login-heading > p:last-child, .login-footnote, #verification-help { color: var(--muted); font-size: .9rem; }
.credentials-section, .field { display: flex; flex-direction: column; gap: 9px; }
.credentials-section { gap: 20px; margin-top: 28px; }
label { font-size: .9rem; font-weight: 600; }
input { width: 100%; min-height: 46px; border: 1px solid var(--input-border); border-radius: 9px; padding: 12px; background: var(--input); color: var(--text); font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; background: var(--accent); color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { filter: brightness(1.1); }
button:disabled { opacity: .6; cursor: wait; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.login-button { width: 100%; font-weight: 600; }
.text-button { background: transparent; color: var(--focus); align-self: flex-start; padding: 0; }
.login-footnote { margin: 24px 0 0; font-size: .8rem; }
#verification-help { margin: 0; }
#login-status { margin: 0; font-size: .9rem; }
.error { color: #ffb3b3; }
nav { display: flex; gap: 24px; }
nav { flex-wrap: wrap; }
.nav-tabs { display: flex; flex-wrap: wrap; gap: 24px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.health-card { padding: 20px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.health-card header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.health-card h3 { margin: 0; overflow-wrap: anywhere; }
.health-card p { overflow-wrap: anywhere; }
.health-badge { display: inline-block; padding: 6px 10px; border-radius: 20px; font-size: .85rem; background: var(--input); white-space: nowrap; }
[data-health="healthy"] .health-badge { background: #164d3c; color: #a5edd3; }
[data-health="unhealthy"] .health-badge { background: #563131; color: #ffc4c4; }
[data-health="unknown"] .health-badge { background: #514628; color: #f4dc98; }
nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; }
nav a { color: var(--text); text-decoration: none; }
tools { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.portal-page #main { padding: clamp(24px, 6vw, 72px); }
.welcome-card { max-width: 800px; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--border); border-radius: 20px; background: var(--card); }
#portal-status { position: fixed; bottom: 16px; right: 16px; max-width: calc(100vw - 32px); padding: 16px; background: var(--card); border: 1px solid var(--input-border); border-radius: 9px; }
@media (max-width: 650px) {
    main-container > header { flex-wrap: wrap; gap: 12px 24px; }
    tools { margin-left: 0; width: 100%; justify-content: space-between; }
    login-screen { padding: 26px 22px; }
    center-content { padding: 12px 16px; }
}

.page-card { width: 100%; padding: clamp(20px, 3vw, 36px); border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 24px 0; }
.filter-bar label { display: grid; gap: 8px; min-width: 180px; flex: 1; }
.table-scroll { overflow-x: auto; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .85rem; }
td { overflow-wrap: anywhere; white-space: pre-wrap; }
td:first-child { min-width: 70px; }
.muted { color: var(--muted); }
.error-entry { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 12px 0; }
.error-entry summary { cursor: pointer; overflow-wrap: anywhere; }
.error-entry summary span { display: block; margin-top: 8px; font-size: .85rem; }
.error-context { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 10px; }
.error-context dt { color: var(--muted); }
.error-context dd { margin: 0; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--surface); border-radius: 8px; }
.home-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 24px; }
.home-links a { color: var(--focus); }
dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); }
dialog::backdrop { background: #0008; }
#user-editor { display: grid; gap: 18px; }
#user-editor > label { display: grid; gap: 8px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.checkbox-label { display: flex !important; align-items: center; gap: 10px; margin: 12px 0; }
.checkbox-label input { width: 20px; min-height: 20px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--border); border-radius: 8px; }
@media (max-width: 650px) { .error-context { grid-template-columns: 1fr; } .error-context dd { margin-bottom: 10px; } }
.deployment-actions { margin-top: 1.5rem; }
.deployment-actions form { margin: 0; }
.deployment-commit { font-family: monospace; overflow-wrap: anywhere; }
.deployment-details { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 36rem; }
