:root {
    color-scheme: dark;
    --bg: #101214;
    --surface: #171a1f;
    --surface-strong: #1f242b;
    --border: #313944;
    --text: #f6f8fb;
    --muted: #aab4c0;
    --accent: #2dd4bf;
    --accent-strong: #f59e0b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7f3;
    --surface: #ffffff;
    --surface-strong: #edf2ef;
    --border: #d7ded9;
    --text: #16211d;
    --muted: #58675f;
    --accent: #0f766e;
    --accent-strong: #b45309;
    --shadow: 0 18px 50px rgba(35, 50, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

.theme-toggle {
    position: fixed;
    z-index: 10;
    top: 1rem;
    right: 1rem;
    min-width: 4.75rem;
    min-height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 700;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

.theme-toggle:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
}

.page-shell {
    width: min(960px, calc(100% - 2rem));
    min-height: 100vh;
    margin: 0 auto;
    padding: 5rem 0 2rem;
    display: grid;
    align-content: center;
    gap: 1rem;
}

.site-header,
.intro,
.verse-of-day,
.diagnostics,
.site-footer {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 3.25rem;
    line-height: 1;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
    line-height: 1.25;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}

.status-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 16%, transparent);
}

.intro {
    padding: 1.25rem 1.5rem;
    background: var(--surface-strong);
}

.intro p,
.section-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.verse-of-day {
    overflow: hidden;
}

.verse-body {
    padding: 1.1rem 1.5rem 1.35rem;
}

.verse-quote {
    margin: 0;
    padding: 0 0 0 0.9rem;
    border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
}

.verse-text {
    margin: 0;
}

.verse-meta {
    margin: 0.85rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    color: var(--muted);
    font-size: 0.96rem;
}

.verse-reference-link {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16rem;
}

.verse-reference-link:hover {
    color: var(--accent-strong);
}
.diagnostics {
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.diagnostics:not([open]) > .section-heading {
    border-bottom: 0;
}

.diagnostics > summary.section-heading {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.diagnostics > summary.section-heading::-webkit-details-marker {
    display: none;
}

.diagnostics > summary.section-heading::after {
    content: "+";
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent);
    font-weight: 800;
}

.diagnostics[open] > summary.section-heading::after {
    content: "-";
}

.diagnostics > summary.section-heading:hover::after {
    border-color: var(--accent);
}

.diagnostics > summary.section-heading:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: -3px;
}

.diagnostic-list {
    margin: 0;
}

.diagnostic-row {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.diagnostic-row:last-child {
    border-bottom: 0;
}

dt {
    color: var(--muted);
    font-weight: 750;
}

dd {
    min-width: 0;
    margin: 0;
}

code {
    color: var(--text);
    overflow-wrap: anywhere;
}

a {
    color: inherit;
}

.status-shell {
    align-content: start;
}

.hub-auth-form,
.hub-alert-body {
    padding: 1.25rem 1.5rem;
}

.hub-action-grid {
    display: grid;
    gap: 1rem;
}

.hub-stacked-form {
    display: grid;
    gap: 0.55rem;
}

.hub-password-label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--muted);
    font-weight: 750;
}

.hub-stacked-form .hub-password-label {
    margin-bottom: 0;
}

.hub-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.hub-password-row input,
.hub-password-row select,
.hub-text-input {
    min-width: 0;
    min-height: 2.65rem;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 0.85rem;
}

.hub-password-row input:focus-visible,
.hub-password-row select:focus-visible,
.hub-text-input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.hub-textarea {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 0.85rem;
    resize: vertical;
}

.hub-textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.hub-submit {
    min-height: 2.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg);
    cursor: pointer;
    font-weight: 800;
    padding: 0 1rem;
}

.hub-submit:hover {
    background: var(--accent-strong);
}

.hub-submit:disabled {
    cursor: wait;
    opacity: 0.68;
}

.hub-submit-secondary {
    background: var(--surface-strong);
    color: var(--text);
}

.hub-submit-danger {
    border-color: color-mix(in srgb, #ef4444 50%, var(--border));
    background: #ef4444;
    color: #ffffff;
}

.hub-danger-action {
    padding: 1rem;
    border: 1px solid color-mix(in srgb, #ef4444 45%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, #ef4444 9%, transparent);
}

.hub-inline-note {
    color: var(--muted);
}

.hub-alert {
    border-color: color-mix(in srgb, var(--accent-strong) 48%, var(--border));
}

.hub-notice {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
}

.hub-alert-body {
    color: var(--text);
}

.hub-alert-body p {
    margin-bottom: 0.5rem;
}

.hub-alert-body p:last-child {
    margin-bottom: 0;
}

.network-table-wrap {
    overflow-x: auto;
}

.network-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.network-table th,
.network-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.network-table thead th {
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
}

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

.network-table tbody th {
    min-width: 14rem;
}

.hive-device-table {
    min-width: 860px;
}

.hive-device-table tbody th {
    min-width: 18rem;
}

.vendor-icon {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    margin-right: 0.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 900;
    vertical-align: middle;
}

.vendor-tp-link {
    border-color: color-mix(in srgb, #38bdf8 60%, var(--border));
}

.vendor-hive {
    border-color: color-mix(in srgb, #f59e0b 65%, var(--border));
}

.vendor-raspberry-pi {
    border-color: color-mix(in srgb, #e11d48 62%, var(--border));
}

.vendor-vodafone {
    border-color: color-mix(in srgb, #ef4444 62%, var(--border));
}

.network-device-name {
    display: inline-grid;
    gap: 0.1rem;
    vertical-align: middle;
}

.network-device-name span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 650;
}

.hive-device-id {
    display: block;
    max-width: 24rem;
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
}

.status-pill,
.port-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    padding: 0 0.55rem;
    white-space: nowrap;
}

.status-yes,
.port-open {
    border-color: color-mix(in srgb, var(--accent) 56%, var(--border));
    color: var(--text);
}

.status-no,
.port-closed {
    color: var(--muted);
}

.status-not-checked {
    color: var(--muted);
}

.hive-online-state {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.85rem;
    white-space: nowrap;
}

.hive-online-dot {
    display: inline-block;
    width: 0.82rem;
    height: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 15%, transparent);
}

.hive-online-online {
    border-color: color-mix(in srgb, #16a34a 50%, var(--border));
    background: #22c55e;
    box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 18%, transparent);
}

.hive-online-offline {
    border-color: color-mix(in srgb, #dc2626 50%, var(--border));
    background: #ef4444;
    box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 18%, transparent);
}

.hive-meter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 8.5rem;
}

.hive-meter {
    width: 6.25rem;
    height: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-strong);
    vertical-align: middle;
    appearance: none;
}

.hive-meter::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--surface-strong);
}

.hive-meter::-webkit-progress-value {
    border-radius: 999px;
    background: var(--accent);
}

.hive-meter::-moz-progress-bar {
    border-radius: 999px;
    background: var(--accent);
}

.hive-meter-low::-webkit-progress-value {
    background: #ef4444;
}

.hive-meter-low::-moz-progress-bar {
    background: #ef4444;
}

.hive-meter-medium::-webkit-progress-value {
    background: #f59e0b;
}

.hive-meter-medium::-moz-progress-bar {
    background: #f59e0b;
}

.hive-meter-high::-webkit-progress-value {
    background: #22c55e;
}

.hive-meter-high::-moz-progress-bar {
    background: #22c55e;
}

.hive-meter-value {
    min-width: 2.6rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.hive-meter-empty {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.port-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hub-footer-link {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16rem;
}

.hub-footer-link:hover {
    color: var(--accent-strong);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--muted);
}

@media (max-width: 680px) {
    .theme-toggle {
        top: 0.75rem;
        right: 0.75rem;
    }

    .page-shell {
        width: min(100% - 1rem, 960px);
        padding-top: 4.5rem;
        align-content: start;
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 2.25rem;
    }

    .diagnostic-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .hub-password-row {
        grid-template-columns: 1fr;
    }

    .network-table {
        min-width: 42rem;
    }
}
