:root {
    color-scheme: dark;
    --bg: #101114;
    --surface: #1b1d22;
    --surface-2: #24272d;
    --border: #383c44;
    --text: #f3f4f6;
    --muted: #a9adb6;
    --accent: #d6f45d;
    --accent-ink: #171a0c;
    --cyan: #65c8d0;
    --danger: #f17979;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); line-height: 1.5; letter-spacing: 0; }
a { color: inherit; }
button, input, select { font: inherit; letter-spacing: 0; }
button, .button-link {
    min-height: 42px;
    border: 0;
    border-radius: 5px;
    padding: 9px 15px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 750;
    cursor: pointer;
}
button:hover, .button-link:hover { filter: brightness(1.06); }
button:disabled { cursor: not-allowed; filter: none; opacity: 0.5; }
input, select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 9px 11px;
    background: #121419;
    color: var(--text);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 2rem; line-height: 1.08; }
h2 { font-size: 1.1rem; }

.site-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: #15171b;
}
.brand { color: var(--text); font-size: 1.25rem; font-weight: 850; text-decoration: none; }
.header-actions { display: flex; gap: 8px; }
.header-actions button { min-height: 38px; padding: 7px 10px; }
.quiet-button, .secondary-button { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.app-shell { min-height: calc(100vh - 64px); }
.side-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #15171b;
}
.side-nav a, .tab-nav a { white-space: nowrap; padding: 9px 11px; color: var(--muted); text-decoration: none; }
.side-nav a:hover, .tab-nav a:hover, .tab-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.page-content { width: min(100%, 980px); padding: 24px 16px 56px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.eyebrow { margin-bottom: 5px; color: var(--cyan); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.muted { color: var(--muted); }

.home-shell { min-height: 100vh; display: grid; align-content: center; gap: 28px; padding: 32px 18px; }
.home-intro { max-width: 600px; }
.home-intro h1 { font-size: 4rem; }
.home-intro > p:last-child { color: var(--muted); font-size: 1.05rem; }
.login-panel { width: 100%; max-width: 460px; padding: 22px; border: 1px solid var(--border); background: var(--surface); }
.form-stack { display: grid; gap: 14px; }
.form-stack button, .secondary-button { width: 100%; }
.narrow-form { max-width: 480px; }
.section-rule { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); }
.section-rule::before, .section-rule::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.notice { margin: 0 0 20px; padding: 11px 13px; border-left: 3px solid var(--cyan); background: var(--surface); }
.notice.error { border-color: var(--danger); color: #ffc2c2; }
.notice.success { border-color: var(--accent); }
.detail-list { margin: 0; border-top: 1px solid var(--border); }
.detail-list > div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.detail-list dt { color: var(--muted); font-size: .82rem; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.code-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.selectable { user-select: all; }
.content-section { margin-top: 30px; }
.enter-form { margin-top: 32px; }
.enter-button { width: 100%; min-height: 52px; font-size: 1.05rem; }
.status-line { color: var(--muted); }
.status-line.online { color: var(--accent); }
.tab-nav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.filter-form { display: grid; gap: 6px; margin-bottom: 18px; }
.filter-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.roster { border-top: 1px solid var(--border); }
.roster-row { display: grid; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.roster-row > div:first-child { display: grid; gap: 2px; }
.roster-row span { color: var(--muted); font-size: .85rem; }
.row-actions, .button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions select { min-width: 150px; }
.row-actions form { display: contents; }
.danger-link { align-content: center; min-height: 42px; padding: 9px 10px; color: var(--danger); }
.danger-button { background: var(--danger); color: #220707; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.confirmation { max-width: 620px; }
.settings-intro { max-width: 720px; }
.preset-grid { display: grid; gap: 10px; }
.preset-option {
    min-height: 118px;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-align: left;
}
.preset-option strong { color: var(--accent); font-size: 1.05rem; }
.preset-option span { color: var(--text); font-weight: 600; }
.preset-option small { color: var(--muted); font-weight: 400; }
.settings-panel { padding-top: 24px; border-top: 1px solid var(--border); }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--text); }
.check-row input { width: 20px; min-height: 20px; margin: 0; }

@media (min-width: 760px) {
	h1 { font-size: 2.7rem; }
	.home-intro h1 { font-size: 6rem; }
    .app-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
    .side-nav { display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--border); border-bottom: 0; }
    .page-content { padding: 42px clamp(28px, 5vw, 64px) 72px; }
    .home-shell { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); align-items: center; padding: 6vw; }
    .detail-list > div { grid-template-columns: 160px minmax(0, 1fr); align-items: baseline; }
    .roster-row { grid-template-columns: minmax(160px, 1fr) minmax(280px, auto); align-items: center; }
    .row-actions { justify-content: flex-end; }
    .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
