:root {
    --bg: #f6f5f0;
    --panel: #ffffff;
    --ink: #20242a;
    --muted: #69717c;
    --line: #d8d5cc;
    --accent: #2f6f5e;
    --accent-dark: #1f4e42;
    --warn: #9f2f2f;
    --ok: #258455;
    --gold: #b88a2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--accent-dark);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: #fffdf8;
}

.brand {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

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

nav a {
    border-radius: 6px;
    color: var(--muted);
    padding: 8px 10px;
    text-decoration: none;
}

nav a.active,
nav a:hover {
    background: #edf3ef;
    color: var(--accent-dark);
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    align-content: center;
    min-height: 62vh;
    max-width: 760px;
}

.hero.compact {
    min-height: auto;
    padding: 24px 0;
}

.hero h1,
.page-head h1,
.panel h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1;
    letter-spacing: 0;
}

.panel h1,
.form h1 {
    font-size: 34px;
    line-height: 1.1;
}

h2 {
    margin: 28px 0 12px;
    font-size: 21px;
}

h3 {
    margin: 0 0 10px;
}

p {
    margin: 0 0 16px;
}

.eyebrow {
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.small-note {
    font-size: 13px;
}

.actions,
.admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.button,
button.button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
}

.button.secondary {
    background: #fff;
    color: var(--accent-dark);
}

.button.danger {
    border-color: var(--warn);
    color: var(--warn);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.stack {
    display: grid;
    gap: 16px;
}

.text-link {
    font-weight: 800;
    justify-self: start;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.modal-backdrop {
    align-items: center;
    background: rgba(32, 36, 42, 0.62);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 20;
}

.modal-backdrop[hidden] {
    display: none;
}

.access-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    max-width: 440px;
    padding: 26px;
    position: relative;
    width: 100%;
}

.modal-close {
    align-items: center;
    background: #f0eee7;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 32px;
}

.not-member-link {
    display: inline-block;
    font-weight: 800;
    margin-top: 16px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    gap: 24px;
    align-items: start;
}

.panel,
.item-card,
.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 24px;
}

.narrow {
    max-width: 520px;
    margin: 32px auto;
}

.readable {
    max-width: 820px;
}

.form {
    display: grid;
    gap: 14px;
}

.local-login {
    margin-top: -14px;
}

.local-login form {
    margin: 0;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.label-heading {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.check-stack {
    display: grid;
    gap: 8px;
}

.inline-check {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.inline-check input {
    width: auto;
}

.tunnel-status {
    align-items: center;
    display: flex;
    font-weight: 800;
    gap: 9px;
}

.copy-input {
    font-family: Consolas, "Courier New", monospace;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    padding: 10px 11px;
}

input[type="file"] {
    background: #fff;
}

textarea {
    resize: vertical;
}

.embed-wrap {
    aspect-ratio: 16 / 9;
    background: #141414;
    border-radius: 8px;
    margin-top: 18px;
    overflow: hidden;
}

.embed-wrap iframe {
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.metric strong {
    display: block;
    font-size: 34px;
}

.metric span {
    color: var(--muted);
}

.checklist {
    display: grid;
    gap: 9px;
    list-style: none;
    padding: 0;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 9px;
}

.status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    flex: 0 0 auto;
}

.status.ok,
.alert.ok {
    background: #e7f5ed;
    color: #1d6844;
}

.status.warn {
    background: #d09a2d;
}

.status.bad {
    background: var(--warn);
}

.health-list {
    display: grid;
    gap: 10px;
}

.health-row {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: 14px minmax(0, 1fr);
    padding: 10px 0;
}

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

.health-row p {
    color: var(--muted);
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.alert {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert.bad {
    background: #f9e8e8;
    color: var(--warn);
}

.alert.warn {
    background: #fff5df;
    color: #704f0b;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.mini-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    margin-right: 10px;
    white-space: nowrap;
}

.mini-button {
    background: transparent;
    border: 0;
    color: var(--accent-dark);
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
    white-space: nowrap;
}

.pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
}

.pill.logged {
    background: #f0eee7;
    color: #4c5660;
}

.pill.sent {
    background: #e7f5ed;
    color: #1d6844;
}

.pill.failed {
    background: #f9e8e8;
    color: var(--warn);
}

.text-list {
    color: var(--muted);
    padding-left: 18px;
}

.text-list li {
    display: list-item;
}

.facts {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 9px 14px;
}

.facts dt {
    color: var(--muted);
    font-weight: 700;
}

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

code,
pre {
    background: #f0eee7;
    border-radius: 6px;
    color: #28352f;
}

code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 2px 5px;
}

pre {
    max-height: 320px;
    overflow: auto;
    padding: 14px;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

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

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