:root {
    --bg: #eef2f0;
    --panel: #fbfbf8;
    --ink: #101312;
    --muted: #4a5551;
    --line: #151817;
    --soft-line: #b7c1bd;
    --accent: #00a870;
    --accent-soft: #ddfff2;
    --warn: #f7ff8f;
    --shadow: rgba(16, 19, 18, 0.18);
    --surface: #f4f6f5;
    --page-max: 1120px;
    --content-max: 100%;
    --page-gutter: clamp(12px, 2vw, 28px);
    --panel-gap: clamp(12px, 2vw, 18px);
    --section-gap: clamp(18px, 5vh, 54px);
    --panel-pad: clamp(14px, 2vw, 18px);
    --hero-pad: clamp(20px, 3.2vw, 34px);
    --shadow-offset: 4px;
    --motion-fast: 120ms;
    --mono: "Consolas", "IBM Plex Mono", "Courier New", monospace;
    --sans: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(16, 19, 18, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(16, 19, 18, 0.045) 1px, transparent 1px),
        var(--bg);
    background-size: 24px 24px;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: #004dff;
    font-weight: 700;
}

a:hover {
    color: var(--ink);
    background: var(--warn);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.site-header,
main,
footer {
    width: min(var(--page-max), calc(100vw - var(--page-gutter)));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--panel-gap);
    margin-top: var(--panel-gap);
    padding: 12px 14px;
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
}

.brand {
    font-family: var(--mono);
    color: var(--ink);
    text-decoration: none;
    font-size: 1.2rem;
}

.brand-mark {
    font-weight: 800;
}

.brand-dot {
    color: var(--accent);
    font-weight: 800;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    color: var(--ink);
    padding: 4px 8px;
    border: 1px solid var(--soft-line);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

nav a:hover,
nav a:focus-visible {
    background: var(--accent-soft);
}

nav a:active,
.button:active {
    transform: translate(1px, 1px);
}

.external-icon {
    width: 0.85em;
    height: 0.85em;
    fill: currentColor;
    flex: 0 0 auto;
    vertical-align: -0.08em;
}

nav a[aria-current="page"] {
    background: var(--accent-soft);
    border-color: var(--line);
}

main {
    flex: 1 0 auto;
    padding: var(--panel-gap) 0 var(--page-gutter);
}

.index-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.58fr);
    gap: 0;
    min-height: clamp(230px, 29vw, 330px);
    margin-bottom: var(--section-gap);
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
}

.hero-cta {
    display: grid;
    align-content: center;
    padding: var(--hero-pad);
    border-right: 1px solid var(--soft-line);
}

.hero-cta h1 {
    max-width: 620px;
    font-family: var(--mono);
    font-size: clamp(2.2rem, 4.8vw, 3.9rem);
    letter-spacing: 0;
}

.hero-cta p {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.hero-visual {
    position: relative;
    display: grid;
    min-height: 100%;
    overflow: hidden;
    background: #fff;
    isolation: isolate;
}

.dither-canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    background: var(--panel);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(251, 251, 248, 0.2), rgba(251, 251, 248, 0.74)),
        repeating-linear-gradient(0deg, rgba(16, 19, 18, 0.05) 0 1px, transparent 1px 10px);
    pointer-events: none;
}

.index-stats {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    min-height: 100%;
    background: rgba(251, 251, 248, 0.68);
    backdrop-filter: blur(1.5px);
}

.index-stats div {
    display: grid;
    align-content: center;
    min-height: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--soft-line);
    background: linear-gradient(90deg, rgba(251, 251, 248, 0.72), rgba(251, 251, 248, 0.42));
}

.index-stats div:last-child {
    border-bottom: 0;
}

.index-stats span,
.detail-summary span {
    font-family: var(--mono);
    color: #202725;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.index-stats strong,
.detail-summary strong {
    margin-top: 5px;
    font-family: var(--mono);
    font-size: 1rem;
}

.index-stats [data-live-count] {
    display: inline-block;
    margin-right: 4px;
    color: #050707;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    line-height: 1;
}

.index-stats strong {
    color: #050707;
    text-shadow: 0 1px 0 rgba(251, 251, 248, 0.75);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--panel-gap);
    align-items: stretch;
    margin-bottom: var(--panel-gap);
}

.hero-copy,
.status-panel,
.notice,
.section {
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
}

.hero-copy {
    padding: clamp(22px, 4vw, 46px);
}

.eyebrow {
    margin: 0 0 8px;
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    max-width: 100%;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

h1 {
    max-width: 780px;
    font-family: var(--mono);
    font-size: clamp(2.1rem, 5vw, 4.7rem);
    letter-spacing: 0;
}

h2 {
    font-family: var(--mono);
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
}

h3 {
    font-family: var(--mono);
    font-size: 1.35rem;
}

.lede {
    max-width: 760px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.12rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    color: #fff;
    background: var(--line);
    border: 2px solid var(--line);
    font-family: var(--mono);
    text-decoration: none;
    transition: background-color var(--motion-fast) ease, transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.button.secondary {
    color: var(--ink);
    background: var(--accent-soft);
}

.button.small {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.88rem;
}

.status-panel {
    display: grid;
    align-content: stretch;
}

.status-panel div {
    display: grid;
    gap: 4px;
    padding: 18px;
    border-bottom: 1px solid var(--soft-line);
}

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

.status-label {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.status-panel strong {
    font-family: var(--mono);
    font-size: 1.03rem;
}

.notice {
    margin-bottom: var(--panel-gap);
    padding: 10px 14px;
    background: #f7fff9;
    border-left-width: 4px;
    font-size: 0.95rem;
}

.section {
    margin-bottom: var(--panel-gap);
    padding: clamp(16px, 3vw, 26px);
}

.compact-section {
    padding: var(--panel-pad);
}

.index-workbench {
    width: var(--content-max);
    margin: 0 auto var(--panel-gap);
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: var(--panel-gap);
    align-items: end;
    margin-bottom: 14px;
}

.search-box {
    display: grid;
    gap: 5px;
    min-width: min(360px, 100%);
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
}

.search-box input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.search-box input::placeholder {
    color: #68736f;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.listing-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: var(--content-max);
}

.listing-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 136px;
    padding: 16px;
    border: 1px solid var(--soft-line);
    background: #fff;
    transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.listing-row:hover {
    background: #fafffc;
    border-color: var(--line);
}

.row-main {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.row-main h3 {
    font-size: 1.2rem;
}

.row-title span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.row-title strong {
    color: var(--ink);
    font-size: 0.98rem;
}

.row-main p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: end;
    gap: 8px;
    min-width: 0;
    margin-top: auto;
}

.row-actions .button {
    width: 100%;
    min-height: 40px;
    gap: 5px;
}

.listing-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: var(--content-max);
    margin: 10px auto 0;
}

.listing-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--soft-line);
    background: #fff;
    font-family: var(--mono);
    font-size: 0.88rem;
    text-align: center;
    text-decoration: none;
}

.listing-actions a:hover,
.listing-actions a:focus-visible {
    border-color: var(--line);
    background: var(--accent-soft);
}

.listing-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--soft-line);
    background: #fff;
}

.card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--mono);
}

.severity,
.card-code {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    font-size: 0.78rem;
}

.severity.high {
    background: var(--warn);
}

.card-code {
    background: var(--surface);
    color: var(--muted);
}

.listing-card p {
    margin: 0;
    color: var(--muted);
}

dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

dl div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--soft-line);
}

dt {
    font-family: var(--mono);
    color: var(--ink);
    font-weight: 800;
}

dd {
    margin: 0;
    color: var(--muted);
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.card-links a {
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    text-decoration: none;
}

.empty-state {
    margin: 18px 0 0;
    padding: 12px;
    border: 1px solid var(--soft-line);
    background: #fff;
    font-family: var(--mono);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
}

.split p {
    margin-bottom: 0;
    color: var(--muted);
}

.listing-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
    gap: 0;
    margin-bottom: 14px;
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
}

.detail-title {
    padding: clamp(18px, 3vw, 28px);
    border-right: 1px solid var(--soft-line);
}

.detail-title h1 {
    max-width: 780px;
    font-family: var(--mono);
    font-size: clamp(2rem, 5vw, 3.8rem);
}

.detail-title p:last-child,
.section-copy {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-summary div {
    display: grid;
    align-content: center;
    min-height: 78px;
    padding: 12px;
    border-right: 1px solid var(--soft-line);
    background: rgba(255, 255, 255, 0.38);
}

.detail-summary div:last-child {
    border-right: 0;
}

.host-table {
    display: grid;
    margin-top: 14px;
    border: 1px solid var(--soft-line);
    background: #fff;
}

.table-controls {
    display: grid;
    grid-template-columns: minmax(260px, 420px);
    gap: 12px;
    margin-top: 14px;
}

.host-row {
    display: grid;
    grid-template-columns: 20px minmax(260px, 1.1fr) minmax(220px, 1fr) minmax(110px, 0.38fr);
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--soft-line);
    font-family: var(--mono);
    font-size: 0.84rem;
}

.host-data-row {
    border-bottom: 1px solid var(--soft-line);
}

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

.host-data-row > summary {
    list-style: none;
    cursor: pointer;
}

.host-data-row > summary::-webkit-details-marker {
    display: none;
}

.host-data-row > summary::before {
    content: "+";
    color: var(--accent);
    font-weight: 800;
}

.host-data-row[open] > summary::before {
    content: "-";
}

.host-data-row:hover > summary,
.host-data-row[open] > summary {
    background: #fafffc;
}

.host-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.host-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.host-head {
    grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 1fr) minmax(110px, 0.38fr);
    color: var(--muted);
    background: var(--surface);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.empty-host {
    color: var(--muted);
}

.host-endpoint {
    overflow-wrap: anywhere;
}

.host-endpoint em {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.74rem;
    font-style: normal;
}

.models-cell {
    align-self: stretch;
    display: grid;
    align-items: center;
}

.host-row-detail {
    padding: 0 12px 12px 42px;
    background: #fafffc;
}

.model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.models-empty {
    display: block;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.84rem;
}

.model-list span,
.model-list em {
    min-height: 24px;
    padding: 3px 6px;
    background: var(--surface);
    border: 1px solid var(--soft-line);
    color: var(--ink);
    font-size: 0.78rem;
    font-style: normal;
    overflow-wrap: anywhere;
}

.host-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--mono);
}

.host-pagination .button {
    min-width: 64px;
}

.page-status {
    color: var(--muted);
    font-size: 0.86rem;
}

.host-status {
    color: var(--muted);
    font-weight: 800;
}

.table-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.table-note code {
    font-family: var(--mono);
    color: var(--ink);
}

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

.detail-grid article {
    padding: 14px;
    border: 1px solid var(--soft-line);
    background: #fff;
}

.plain-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    margin-bottom: var(--panel-gap);
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--soft-line);
    border-top: 2px solid var(--line);
    box-shadow: none;
    font-family: var(--mono);
    font-size: 0.9rem;
}

footer a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 860px) {
    .site-header,
    .index-hero,
    .listing-detail,
    .hero,
    .split {
        grid-template-columns: 1fr;
    }

    .site-header,
    .section-head {
        align-items: start;
    }

    .site-header {
        flex-direction: column;
    }

    .hero-cta,
    .detail-title {
        border-right: 0;
        border-bottom: 1px solid var(--soft-line);
    }

    .index-hero {
        min-height: 0;
        margin-bottom: var(--panel-gap);
    }

    .hero-visual {
        min-height: 210px;
    }

    .index-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: auto;
    }

    .index-stats div {
        min-height: 86px;
        border-right: 1px solid var(--soft-line);
        border-bottom: 0;
    }

    .index-stats div:last-child {
        border-right: 0;
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
        min-width: 0;
    }

    nav {
        justify-content: flex-start;
    }

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

    .listing-table,
    .listing-actions {
        grid-template-columns: 1fr;
    }

    .listing-row {
        min-height: 0;
    }

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

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

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .site-header,
    main,
    footer {
        width: min(var(--page-max), calc(100vw - var(--page-gutter)));
    }

    .site-header {
        align-items: stretch;
    }

    nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 7px;
    }

    nav a {
        justify-content: center;
        min-height: 34px;
        padding-inline: 7px;
        text-align: center;
    }

    h1,
    .detail-title h1,
    .hero-cta h1 {
        font-size: clamp(1.85rem, 9vw, 2.45rem);
    }

    dl div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .index-stats,
    .detail-summary {
        grid-template-columns: 1fr;
    }

    .index-stats div,
    .detail-summary div {
        min-height: auto;
        border-right: 0 !important;
        border-bottom: 1px solid var(--soft-line) !important;
    }

    .index-stats div:last-child,
    .detail-summary div:last-child {
        border-bottom: 0 !important;
    }

    .host-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .host-row span {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .host-head {
        display: none;
    }

    .host-data-row > .host-row {
        grid-template-columns: 20px 1fr;
    }

    .host-data-row > summary::before {
        grid-column: 1;
        grid-row: 1 / span 3;
    }

    .host-row-detail {
        padding: 0 12px 12px 42px;
    }

    .host-data-row > .host-row > span {
        display: grid;
        gap: 3px;
    }

    .host-data-row > .host-row > span::before {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .host-data-row > .host-row > span:nth-child(1)::before {
        content: "Host";
    }

    .host-data-row > .host-row > span:nth-child(2)::before {
        content: "Models";
    }

    .host-data-row > .host-row > span:nth-child(3)::before {
        content: "State";
    }

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

    footer {
        display: grid;
        gap: 8px;
    }
}
