/* The Counting House: charcoal, parchment and aged brass. */
:root {
    color-scheme: dark;
    --bg: #171614;
    --surface: #211f1b;
    --surface-raised: #29261f;
    --line: #40392e;
    --text: #e9e2d4;
    --muted: #b2a898;
    --accent: #d1b580;
    --brass: #b69a63;
    --danger: #e4a49b;
    --positive: #aec39d;
    --console: #131310;
    font: 15px/1.6 "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
p { margin: 0 0 16px; line-height: 1.65; }
h1 { font: 400 clamp(32px, 3.2vw, 46px)/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.9px; margin: 8px 0 16px; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.35; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 12px; }
strong { font-weight: 600; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--accent); margin: 0 0 14px; }
.lede { color: var(--muted); max-width: 76ch; margin: 0 0 32px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10; padding: 12px 20px; background: var(--accent); color: var(--bg); }
.skip-link:focus { top: 12px; }
.site-header { min-height: 84px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 36px; background: #1b1916; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); font-size: 13px; letter-spacing: 2.4px; line-height: 1.5; }
.brand:hover { text-decoration: none; }
.brand img { flex: none; }
.brand strong { display: block; font-size: 10px; font-weight: 400; letter-spacing: 3.7px; color: var(--muted); }
.workspace-label { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.shell { display: flex; min-height: calc(100vh - 148px); }
.sidebar { position: sticky; top: 0; align-self: flex-start; height: calc(100dvh - 84px); min-height: 450px; overflow-y: auto; width: 224px; flex: 0 0 224px; padding: 38px 18px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #1b1916; }
.sidebar > .eyebrow { padding: 0 16px; color: var(--muted); font-size: 9px; }
nav { display: flex; flex-direction: column; gap: 5px; }
nav a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.6; }
nav a:hover { text-decoration: none; color: var(--text); background: var(--surface); }
nav a[aria-current="page"] { background: #b69a6312; border-left-color: var(--brass); color: var(--accent); }
.nav-number { font: 10px ui-monospace, Consolas, monospace; color: var(--muted); }
.admin-nav { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.sidebar-account { margin-top: auto; padding: 56px 14px 0; }
.aside-note { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin: 0; }
.aside-note strong { color: var(--text); font-size: 12px; font-weight: 400; }
.sidebar-account button { margin-top: 14px; padding: 8px 13px; font-size: 12px; }
main { min-width: 0; width: 100%; max-width: 1480px; padding: 40px clamp(24px, 4vw, 64px) 64px; }
main:focus { outline: none; }
.site-footer { min-height: 64px; padding: 20px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; gap: 18px; }
.site-footer > span:first-child { letter-spacing: 1.5px; font-size: 9px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 26px; margin-bottom: 20px; overflow-wrap: anywhere; }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child { margin-bottom: 20px; }
.setup-attempt { display: inline-block; margin: 0 0 14px; color: var(--accent); font-size: 12px; font-weight: 600; }
.provisioning-steps { list-style: none; padding: 0; margin: 0 0 24px; max-width: 600px; }
.provisioning-steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.setup-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 3px; font-size: 14px; }
.setup-check > span { visibility: hidden; }
.setup-step-status { font-size: 11px; }
.provisioning-steps [data-step-state="complete"] .setup-check { color: var(--positive); border-color: var(--positive); background: #aec39d0d; }
.provisioning-steps [data-step-state="complete"] .setup-check > span { visibility: visible; }
.provisioning-steps [data-step-state="current"] { color: var(--text); }
.provisioning-steps [data-step-state="current"] .setup-check { border: 2px solid var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.provisioning-steps [data-step-state="failed"] .setup-check { border-color: var(--danger); }
.provisioning-steps [data-step-state="failed"] .setup-step-status { color: var(--danger); }
.provisioning-card[data-provisioning-state="Ready"] h2 { color: var(--positive); margin-bottom: 0; }
.pod-account-switcher { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.pod-account-switcher a { flex: 1 1 200px; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 18px; border: 1px solid var(--line); border-left-width: 3px; background: var(--surface); overflow-wrap: anywhere; }
.pod-account-switcher strong { color: var(--text); }
.pod-account-switcher span { font-size: 12px; }
@media (max-width: 480px) {
    .provisioning-steps li { grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; }
    .setup-step-status { grid-column: 2; }
}
.section-heading, .page-heading, .account-row, .search-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.section-heading { margin: 32px 0 16px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.card .section-heading { margin: 0 0 18px; }
.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin: 6px 0 8px; }
.page-heading p { margin-bottom: 0; }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-heading .button, .section-heading .button { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; }
.badge { display: inline-flex; align-items: center; vertical-align: middle; max-width: 100%; font-size: 10px; line-height: 1.4; letter-spacing: 1px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); }
.status-badge { font-size: 12px; letter-spacing: 0; padding: 7px 12px; background: var(--bg); }
.status-badge[data-state="Running"], .status-badge[data-state="Observing"] { color: var(--positive); border-color: #536349; background: #222b20; }
.status-badge[data-state="Running"]::before, .status-badge[data-state="Observing"]::before { content: ""; flex: 0 0 5px; height: 5px; border-radius: 50%; margin-right: 8px; background: currentColor; }
.status-badge[data-state^="Unknown"], .status-badge[data-state="Faulted"], .status-badge[data-state="RecoveryRequired"],
.status-badge[data-state="Update POESESSID"], .status-badge[data-state="Game login failed"], .status-badge[data-state="Reconcile trades"], .status-badge[data-state="Account mismatch"], .status-badge[data-state="Runner stopped unexpectedly"] { color: var(--danger); border-color: #78514a; background: #31231f; }
.notice.fault-notice { margin: 12px 0; border-left-color: var(--danger); }
.notice.update-notice { margin: 12px 0; border-left-color: var(--accent); }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.admin-table th { text-align: left; padding: 10px 10px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .4px; background: var(--surface-raised); white-space: nowrap; }
.admin-table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.admin-table .row-attention td { background: #31231f; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.row-actions { width: auto; min-width: 150px; padding: 6px 8px; font-size: 12px; }
.admin-table .badge { white-space: nowrap; }
dialog.action-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 24px 26px; width: min(540px, calc(100vw - 32px)); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
dialog.action-dialog::backdrop { background: rgba(10, 9, 7, .7); }
dialog.action-dialog h2 { margin: 0 0 12px; font: 400 22px/1.3 Georgia, "Times New Roman", serif; }
dialog.action-dialog .actions { margin-top: 18px; }
dialog.action-dialog .actions button { margin-top: 0; }
.pod-table td { vertical-align: top; }
.pod-table .pod-detail td { background: var(--surface-raised); padding-top: 8px; }
.pod-table .pod-detail p { margin: 4px 0; }
.pod-table .connection-progress { max-width: 520px; }
.pod-table progress { width: 100%; max-width: 520px; }
.recovery-items { display: grid; gap: 12px; margin: 12px 0; }
.recovery-item { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; padding: 14px 16px; background: var(--surface-raised); }
.recovery-item h3 { margin: 0 0 8px; font: 600 15px/1.4 "Segoe UI", ui-sans-serif, system-ui, sans-serif; }
.recovery-item p { margin: 0 0 8px; }
.recovery-item .actions { margin-top: 10px; }
.setup-steps { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 10px; }
.setup-steps li { display: flex; gap: 12px; align-items: flex-start; }
.setup-steps li p { margin: 2px 0 0; }
.setup-steps li.done strong { color: var(--muted); text-decoration: line-through; }
.setup-mark { flex: 0 0 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; margin-top: 1px; }
.setup-steps li.done .setup-mark { color: var(--positive); border-color: #536349; background: #222b20; }
.status-badge[data-state="Updating"] { color: var(--accent); border-color: #77633f; }
.status-badge[data-state="Starting"], .status-badge[data-state="Draining"], .status-badge[data-state="AwaitingCode"] { color: var(--accent); border-color: #77633f; }
.account-row { padding: 24px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.account-row > div:first-child > .badge { margin-bottom: 14px; }
.account-row h2 { margin: 0 0 8px; font-size: 24px; }
.account-row h2 a { color: var(--text); }
.account-row p { margin: 0 0 10px; font-size: 13px; }
.account-row > div:last-child { text-align: right; font-size: 13px; }
.account-row > div:last-child > .badge { margin-bottom: 12px; }
.account-row > div:last-child p strong { font-weight: 400; }
.account-list-row { display: flex; align-items: center; gap: 20px; background: transparent; border-width: 0 0 1px; padding: 20px 0; border-radius: 0; margin: 0; }
.account-link { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 1; min-width: 0; }
.account-link strong { color: var(--text); font-size: 17px; }
.account-link span { font-size: 13px; color: var(--muted); }
.delete-account-link { font-size: 12px; color: var(--danger); padding: 8px 0; }
.notice { padding: 18px 22px; margin: 20px 0 28px; border-left: 2px solid var(--brass); background: #29251d; line-height: 1.65; }
.notice p { color: var(--muted); margin: 8px 0 0; }
.notice.unlock-status { margin: 12px 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 20px 0 8px; }
input, select, textarea { width: 100%; min-width: 0; background: var(--bg); border: 1px solid #7c6c54; border-radius: 3px; padding: 11px 12px; color: var(--text); font: inherit; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9e9485; opacity: 1; }
textarea { font: 13px/1.6 ui-monospace, Consolas, monospace; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled, select:disabled { opacity: .55; }
.check { display: flex; gap: 10px; align-items: center; line-height: 1.5; }
.check input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--accent); }
button, .button { display: inline-block; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #201b12; padding: 11px 18px; font: 600 13px/1.4 "Segoe UI", ui-sans-serif, system-ui, sans-serif; cursor: pointer; margin-top: 20px; transition: background .15s, border-color .15s; text-align: center; }
button:hover:not(:disabled), .button:hover { background: #e0c99e; border-color: #e0c99e; text-decoration: none; }
.secondary { background: transparent; color: var(--text); border-color: #746650; }
.secondary:hover:not(:disabled) { background: var(--surface-raised); border-color: var(--brass); }
.danger { background: transparent; color: var(--danger); border-color: #885c54; }
.danger:hover:not(:disabled) { background: #392724; border-color: var(--danger); }
button:disabled { opacity: .42; cursor: not-allowed; }
button[aria-busy="true"] { opacity: .8; cursor: progress; }
button[aria-busy="true"]::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 8px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-busy .7s linear infinite; }
@keyframes button-busy { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::after { animation: none; border-right-color: currentColor; opacity: .5; } }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.actions button, .actions a { margin-top: 0; }
form > .actions { margin-top: 24px; }
.editor { max-width: 820px; }
.validation { color: var(--danger); line-height: 1.7; }
.validation ul { padding-left: 18px; }
.validation:empty, .validation-summary-valid, .field-validation-valid { display: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; }
details { min-width: 0; max-width: 100%; margin-top: 20px; }
summary { cursor: pointer; color: var(--muted); line-height: 1.6; }
summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 18px; }
.advanced { border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; }
.advanced p { max-width: 80ch; }
.server-card details + p { margin-top: 20px; }
.settings-panel { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 24px; }
.settings-panel > summary, .setup-panel > summary { color: var(--text); font-size: 18px; font-weight: 600; }
.settings-panel > summary span { margin-left: 14px; font-weight: 400; }
.settings-panel .split { margin-top: 20px; }
.setup-panel { margin: 30px 0; }
.setup-panel form { max-width: 720px; }
.setup-panel[open] > summary { margin-bottom: 24px; }
.runner-card { border-top: 2px solid var(--brass); }
.server-name { font: 400 32px/1.2 Georgia, serif; letter-spacing: -.5px; }
.runner-card .section-heading p { margin: 8px 0 0; }
.runner-card .section-heading .eyebrow { margin: 0 0 12px; }
.runner-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.runner-meta strong { font-weight: 400; font-variant-numeric: tabular-nums; }
.runner-actions { margin: 22px 0 18px; }
.runner-actions form:has([data-stop]) { margin-left: auto; }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 20px 0; margin-top: 24px; gap: 16px; }
.stat-strip strong { display: block; font: 28px/1.4 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.stat-strip span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.balance-strip { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.search-row { gap: 24px; padding: 22px 24px; border-width: 0 0 1px; border-radius: 0; margin-bottom: 0; }
.search-row h3 { margin: 0 0 10px; }
.search-row h3 a { color: var(--text); font-size: 17px; }
.search-row p { margin: 4px 0; font-size: 12px; }
.search-row .actions { justify-content: flex-end; }
.search-row .actions form:first-child { display: flex; gap: 8px; }
.search-row .actions a { font-size: 12px; }
.search-row button { padding: 9px 12px; font-size: 12px; }
.search-retry { border: 0; padding: 0; margin: 0 0 18px; }
.occupant { padding: 18px 20px; margin: 16px 0; border-left: 2px solid var(--brass); background: var(--bg); }
.occupant .eyebrow { margin-bottom: 8px; font-size: 9px; }
.occupant strong { font-size: 16px; line-height: 1.65; }
.server-card > .section-heading h2 { font: 28px Georgia, serif; }
.connection-progress progress { width: 100%; height: 1rem; accent-color: var(--brass); }
.activity-card { margin-top: 32px; }
.activity-card .section-heading button { margin: 0; }
.feed-status { font-size: 12px; color: var(--muted); }
.feed-status[data-online="true"] { color: var(--positive); }
.activity-feed { list-style: none; padding: 8px 16px; margin: 12px 0 16px; background: var(--console); border: 1px solid var(--line); border-radius: 2px; max-height: 300px; overflow: auto; min-height: 100px; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.activity-feed li { display: grid; grid-template-columns: 90px 65px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #302c24; }
.activity-feed li:last-child { border: 0; }
.activity-feed time { color: var(--muted); }
.activity-feed li:not([data-level]) { display: block; color: var(--muted); }
.log-level { text-transform: uppercase; font-size: 10px; letter-spacing: .7px; color: var(--accent); }
.activity-feed [data-level="attention"] .log-level { color: var(--danger); }
.activity-card > a { font-size: 13px; }
pre { max-width: 100%; overflow-x: auto; white-space: pre; padding: 14px; background: var(--console); border-radius: 2px; }
.runner-log-output { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 65vh; min-height: 180px; overflow: auto; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; border: 1px solid var(--line); padding: 18px; }
.filters { display: flex; align-items: end; gap: 20px; margin-bottom: 28px; }
.filters label { flex: 1; }
.filters select, .filters input { margin-top: 8px; }
.filters button, .filters a { margin-bottom: 8px; }
.filters a { font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 16px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 400; }
.activity-row { display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); padding: 18px 0; font-size: 13px; }
.activity-row time { color: var(--muted); font-size: 12px; }
.activity-row a { margin-left: auto; }
.activity-row code { min-width: 0; overflow-wrap: anywhere; }
[data-league-notice]:empty { display: none; }
.empty { text-align: center; padding: 32px 24px 40px; background: transparent; border-style: dashed; }
.empty-art { display: block; width: 160px; height: 160px; object-fit: contain; margin: 0 auto 14px; }
.empty h2 { font: 26px/1.3 Georgia, serif; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; }
.empty-inline { border: 0; display: flex; align-items: center; gap: 24px; text-align: left; justify-content: flex-start; padding: 20px 0; }
.empty-inline .empty-art { width: 120px; height: 120px; margin: 0; }
.empty-inline p { margin-bottom: 0; }
.scene-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overview-banner { position: relative; isolation: isolate; min-height: 290px; margin-bottom: 0; overflow: hidden; background: #15130f; border: 1px solid var(--line); border-radius: 3px 3px 0 0; }
.overview-banner .scene-image { object-position: center 58%; z-index: -2; }
.overview-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #161410eb, #16141099 35%, transparent 70%); }
.overview-intro { padding: 34px 36px; max-width: 55%; }
.overview-intro h1 { font-size: clamp(30px, 3vw, 42px); margin-bottom: 16px; }
.overview-intro p:last-child { font-size: 13px; color: #c6bcac; margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--surface); margin-bottom: 34px; }
.metrics .card { border: 0; border-radius: 0; border-right: 1px solid var(--line); margin: 0; padding: 20px 28px; background: transparent; }
.metrics .card:last-child { border-right: 0; }
.metrics .muted { font-size: 12px; }
.metrics strong { display: block; font: 30px/1.3 Georgia, serif; margin-top: 8px; }
.guest main:has(.login-layout) { max-width: none; padding: 0; }
.guest .shell { min-height: calc(100vh - 148px); }
.login-layout { display: grid; grid-template-columns: 1.4fr 1fr; min-height: calc(100vh - 148px); }
.login-scene { min-height: 630px; position: relative; isolation: isolate; overflow: hidden; background: #13110e; }
.login-scene .scene-image { z-index: -2; object-position: 64% center; }
.login-scene::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #15130fcc, transparent 65%, #15130fbb); }
.login-intro { position: relative; padding: clamp(40px, 6vw, 90px); }
.login-intro h1 { font-size: clamp(40px, 4vw, 60px); max-width: 500px; margin: 18px 0 24px; }
.login-intro p:last-child { color: #d2c7b6; font-size: 14px; }
.scene-caption { position: absolute; bottom: 28px; left: clamp(40px, 6vw, 90px); right: 20px; font-size: 9px; letter-spacing: 1.6px; color: #c6bcac; }
.login { width: 100%; max-width: 470px; align-self: center; justify-self: center; padding: 52px 48px; }
.login h2 { font: 32px/1.2 Georgia, serif; margin-bottom: 14px; }
.login > .muted { font-size: 13px; }
.login form { margin-top: 32px; }
.login button { width: 100%; margin-top: 28px; }
.login-note { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 28px; }
@media (min-width: 1800px) { main { margin-left: auto; margin-right: auto; } }
@media (max-width: 1100px) {
    .sidebar { width: 200px; flex-basis: 200px; padding-left: 10px; padding-right: 10px; }
    .search-row { flex-direction: column; align-items: stretch; }
    .search-row .actions { justify-content: flex-start; }
    .overview-intro { max-width: 68%; }
    .split { gap: 18px; }
}
@media (max-width: 850px) {
    .site-header { padding: 16px 22px; min-height: 78px; }
    .shell { display: block; }
    .sidebar { position: static; height: auto; min-height: 0; overflow: visible; width: auto; padding: 10px 18px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
    .sidebar > .eyebrow, .aside-note, .nav-number { display: none; }
    nav { flex-direction: row; flex-wrap: wrap; gap: 0; }
    nav a { padding: 8px 10px; border-left: 0; border-bottom: 2px solid transparent; font-size: 12px; }
    nav a[aria-current="page"] { border-bottom-color: var(--brass); }
    .admin-nav { border-top: 0; margin: 0; }
    .sidebar-account { padding: 0; margin-top: 6px; text-align: right; }
    .sidebar-account button { margin: 0; font-size: 11px; padding: 5px 10px; }
    main { padding: 28px 22px 48px; }
    .split { grid-template-columns: 1fr; }
    .login-layout { grid-template-columns: 1fr; }
    .login-scene { min-height: 330px; }
    .login-scene .scene-image { object-position: center 55%; }
    .login-intro { padding: 32px; }
    .login-intro h1 { font-size: 38px; }
    .scene-caption { left: 32px; bottom: 18px; }
    .login { max-width: 500px; padding: 40px 28px; }
}
@media (max-width: 600px) {
    .workspace-label { font-size: 10px; max-width: 100px; text-align: right; }
    .brand { font-size: 11px; letter-spacing: 1.8px; gap: 10px; }
    .brand strong { font-size: 9px; letter-spacing: 2.8px; }
    .brand img { width: 30px; height: 35px; }
    main { padding-left: 18px; padding-right: 18px; }
    .site-header { padding-left: 18px; padding-right: 18px; }
    .card { padding: 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
    .section-heading { gap: 16px; }
    .runner-meta { flex-direction: column; gap: 8px; }
    .server-name { font-size: 28px; }
    .stat-strip { gap: 10px; }
    .stat-strip strong { font-size: 22px; }
    .stat-strip span { font-size: 11px; }
    .balance-strip { grid-template-columns: repeat(2, 1fr); }
    .runner-actions form:has([data-stop]) { margin-left: 0; }
    /* Six run controls become a two-column grid of full-width buttons on phones. */
    .runner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .runner-actions form, .runner-actions button { width: 100%; }
    .runner-actions form:has([data-stop]) { grid-column: 1 / -1; }
    .stat-strip { grid-template-columns: repeat(3, 1fr); }
    .status-badge { font-size: 11px; padding: 6px 10px; }
    [data-unlock] input[type="text"] { width: 100%; }
    .actions { gap: 10px; }
    .actions button { padding: 10px 12px; }
    .search-row { padding: 20px; }
    .activity-feed { padding: 8px 10px; }
    .activity-feed li { grid-template-columns: 80px 1fr; gap: 4px 8px; }
    .activity-feed li > span:last-child { grid-column: 1 / -1; }
    .activity-row { flex-wrap: wrap; gap: 10px; }
    .settings-panel > summary span { display: block; margin: 8px 0 0; }
    .account-row { padding: 24px 0; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
    .account-row > div:last-child { text-align: left; }
    .account-row > div { flex-basis: 100%; }
    .account-link { flex-wrap: wrap; gap: 8px; }
    .account-link span { flex-basis: 100%; }
    .account-list-row { padding: 20px 0; align-items: flex-start; }
    .delete-account-link { max-width: 70px; text-align: right; }
    .filters { flex-wrap: wrap; gap: 12px; }
    .filters label { flex-basis: 100%; margin: 8px 0 0; }
    .filters button, .filters a { margin: 8px 0 0; }
    .site-footer { padding: 20px 18px; flex-direction: column; gap: 6px; }
    .overview-banner { min-height: 280px; }
    .overview-intro { max-width: 95%; padding: 28px 22px; }
    .overview-banner .scene-image { object-position: 65% center; opacity: .65; }
    .overview-banner::after { background: linear-gradient(90deg, #161410e8, #16141088 55%, transparent); }
    .overview-intro h1 { font-size: 34px; }
    .metrics .card { padding: 16px 12px; }
    .metrics .muted { display: block; font-size: 11px; min-height: 34px; line-height: 1.5; }
    .metrics strong { font-size: 26px; margin-top: 4px; }
    .login-scene { min-height: 310px; }
    .login-scene .scene-image { opacity: .65; }
    .login-intro { padding: 28px 24px; }
    .login-intro h1 { font-size: 34px; }
    .scene-caption { left: 24px; }
    .empty-inline { gap: 12px; }
    .empty-inline .empty-art { width: 96px; height: 96px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Compact purchase rows, with the full context and timings in a drawer. */
.history-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 20px; }
.history-heading .eyebrow { margin-bottom: 8px; }
.history-heading h1 { margin: 0 0 8px; font-size: 36px; }
.history-heading .lede { margin: 0; font-size: 13px; }
.history-preview-tools { max-width: 100%; }
.history-preview-tools .actions { gap: 8px; }
.history-preview-tools button { padding: 8px 12px; font-size: 12px; }
.history-preview-tools [role="status"] { font-size: 11px; }
.history-preview-tools .validation { margin: 8px 0 0; max-width: 44ch; font-size: 12px; }
#history-filters { gap: 12px; margin-bottom: 16px; }
#history-filters label { flex: 0 1 240px; margin: 0; font-size: 12px; }
#history-filters input, #history-filters select { margin-top: 4px; padding: 7px 10px; }
#history-filters button, #history-filters a { margin: 0; font-size: 12px; }
#history-filters button { padding: 8px 16px; }
#history-filters a { align-self: center; padding-top: 22px; }
.history-timing-note, .history-record-limit { margin: 12px 0 0; font-size: 12px; }
.history-timing-note p { max-width: 100ch; margin-bottom: 8px; }
.history-timing-note[open] > summary { margin-bottom: 8px; }
.history-purchase-dialog { width: min(940px, calc(100vw - 36px)); max-height: calc(100dvh - 48px); padding: 28px; color: var(--text); background: var(--surface); border: 1px solid var(--brass); border-radius: 4px; }
.history-purchase-dialog::backdrop { background: #000a; }
.history-purchase-dialog .section-heading { margin: 0 0 18px; }
.history-purchase-dialog .section-heading button { margin: 0; }
.history-item-import { margin: 16px 0 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.history-item-import label { margin: 12px 0 7px; }
.history-item-import[open] > summary { margin-bottom: 0; }
.history-item-import textarea { display: block; }
.history-item-import p { margin: 8px 0 0; }
.history-item-import button { margin-top: 10px; padding: 8px 12px; }
.history-import-status { margin: 12px 0 0; overflow-wrap: anywhere; }
.history-purchase-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.history-purchase-fields label { margin-top: 16px; }
.history-purchase-fields input, .history-purchase-fields select { display: block; margin-top: 7px; }
@media (max-width: 700px) {
    .history-purchase-dialog { padding: 20px; }
    .history-purchase-fields { grid-template-columns: 1fr; }
}
.purchase-history { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.purchase-table { table-layout: fixed; min-width: 960px; width: 100%; margin: 0; font-size: 12px; line-height: 1.45; }
.purchase-table > thead { background: var(--surface-raised); }
.purchase-table > thead > tr > th { padding: 11px 10px; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.purchase-toggle-column { width: 34px; }
.purchase-cost-column { width: 138px; }
.purchase-outcome-column { width: 106px; }
.purchase-delivery-column { width: 114px; }
.purchase-duration-column { width: 104px; }
.purchase-time-column { width: 124px; }
.purchase-actions-column { width: 76px; }
.purchase-zone { margin-left: 3px; font-size: 9px; font-weight: 400; }
.purchase-summary > th, .purchase-summary > td { height: 64px; padding: 10px; vertical-align: middle; overflow-wrap: normal; }
.purchase-summary > th { color: var(--text); font-weight: 400; }
.purchase-summary:hover { background: #b69a6308; }
.purchase-summary > .purchase-toggle-cell { padding: 0 2px; }
.purchase-toggle { display: grid; place-items: center; width: 30px; height: 36px; padding: 0; margin: 0; border-color: transparent; background: transparent; color: var(--muted); }
.purchase-toggle:hover:not(:disabled) { background: var(--surface-raised); border-color: var(--line); color: var(--text); }
.purchase-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.purchase-toggle:focus-visible { outline-offset: -2px; }
.purchase-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.purchase-item-copy { min-width: 0; }
.purchase-item-name, .purchase-price { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.purchase-price { color: var(--accent); }
.purchase-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); }
.purchase-icon img { display: block; width: 32px; height: 32px; object-fit: contain; }
.purchase-status { display: inline-block; max-width: 100%; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1.4; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-status[data-outcome="confirmed"] { color: #b6d3ad; background: #243322; border-color: #425a3c; }
.purchase-status[data-outcome="complete"], .purchase-status[data-outcome="deposited"] { color: #b0cce0; background: #202f3a; border-color: #3a5365; }
.purchase-status[data-outcome^="pending"], .purchase-status[data-outcome="in inventory"] { color: var(--accent); background: #332b1d; border-color: #665337; }
.purchase-status[data-outcome="unknown"], .purchase-status[data-outcome="not purchased"] { color: var(--danger); background: #392724; border-color: #68473f; }
.purchase-delete { margin: 0; padding: 5px 9px; font-size: 11px; }
.timing-headline { display: block; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.purchase-cost, .purchase-timestamp { font-variant-numeric: tabular-nums; }
.purchase-detail-row > td { padding: 0; background: var(--bg); }
.purchase-details { padding: 18px 20px 18px 44px; }
.purchase-details > :last-child { margin-bottom: 0; }
.purchase-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.purchase-context dt { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.purchase-context dd { margin: 0; overflow-wrap: anywhere; }
.purchase-timings { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.purchase-timings h3 { font-size: 13px; margin-bottom: 8px; }
.timing-totals, .timing-diagnostics { margin: 14px 0; max-width: 680px; }
.timing-totals > div, .timing-diagnostics > div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; }
.timing-totals dd, .timing-diagnostics dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timing-scroll { overflow-x: auto; }
.timing-stages { font-size: .8rem; min-width: 450px; max-width: 760px; }
.timing-stages caption { text-align: left; padding-bottom: 8px; }
.timing-stages td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.timing-stages th, .timing-stages td { padding: 7px 8px; overflow-wrap: normal; }
.purchase-timings > p { max-width: 680px; font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.search-group { margin-bottom: 28px; }
.search-group-heading { padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.search-group-heading h3 { margin-bottom: 4px; }
.search-group .search-row { margin-bottom: 10px; }
.overview-purchase-metrics .card { display: flex; flex-direction: column; gap: 8px; }
.overview-summary { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 20px; }
.currency-totals { margin: 0; }
.currency-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.currency-totals dd { margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.weekly-chart { margin: 0 0 20px; }
.weekly-chart h2 { margin-bottom: 8px; }
.weekly-purchases { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 12px; list-style: none; padding: 0; margin: 20px 0 0; text-align: center; }
.weekly-purchases strong { display: block; font-size: 14px; color: var(--accent); }
.weekly-track { display: flex; align-items: end; justify-content: center; height: 110px; border-bottom: 1px solid var(--line); margin: 8px 0; }
.weekly-track > span { width: 70%; max-width: 42px; height: 0; background: var(--brass); border-radius: 3px 3px 0 0; }
.weekly-purchases time { font-size: 12px; }
.weekly-purchases small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.overview-purchase { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.overview-purchase .purchase-item { min-width: 0; }
.overview-purchase-cost { flex-shrink: 0; text-align: right; font-size: 13px; }
.notification-events { margin: 18px 0; padding: 16px; border: 1px solid var(--line); }
.notification-events legend { color: var(--muted); padding: 0 6px; }
.notification-history { padding: 14px 0; border-bottom: 1px solid var(--line); }
.notification-history p { margin: 0 0 6px; }
/* Approximates the Discord card FoundryBot posts: brass edge, raised background. */
.announcement-preview { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 4px; padding: 14px 18px; background: var(--surface-raised); max-width: 560px; }
.announcement-title { display: block; margin-bottom: 8px; }
.announcement-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.template-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-raised); margin: 10px 0 0; }
.announcement-recipients { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.announcement-recipients legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.recipient-picker { position: relative; margin: 0; }
.recipient-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; margin: 0; padding: 11px 12px; border: 1px solid #7c6c54; border-radius: 3px; background: var(--bg); color: var(--text); font-size: 13px; }
.recipient-picker > summary::-webkit-details-marker { display: none; }
.recipient-picker[open] > summary { margin-bottom: 0; border-color: var(--accent); }
.recipient-picker[open] > summary svg { transform: rotate(180deg); }
.recipient-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; padding: 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-raised); box-shadow: 0 12px 28px #0006; }
.recipient-menu > p { margin-bottom: 10px; }
.recipient-menu > :last-child { margin-bottom: 0; }
.recipient-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.recipient-toolbar .check { margin: 0; }
.recipient-toolbar button { margin: 0; padding: 5px 10px; font-size: 12px; }
.recipient-list, .recipient-preview-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 3px; }
.recipient-list { max-height: min(280px, 40vh); }
.recipient-row { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.recipient-row:last-child, .recipient-preview-list li:last-child { border-bottom: 0; }
.recipient-row:hover, .recipient-row:has(input:checked) { background: var(--bg); }
.recipient-row:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.recipient-row > span { min-width: 0; }
.recipient-row strong, .recipient-preview-list strong { color: var(--text); font-size: 13px; }
.recipient-signins, .recipient-id { display: block; overflow-wrap: anywhere; }
.recipient-id { font-size: 11px; }
.recipient-preview-list { list-style: none; padding: 0; margin: 0 0 18px; }
.recipient-preview-list li { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.recipient-preview { margin: 0 0 18px; }
.recipient-preview > summary { color: var(--accent); font-size: 13px; }
.recipient-preview[open] > summary { margin-bottom: 10px; }
.recipient-preview .recipient-preview-list { margin-bottom: 0; }
@media (max-width: 700px) {
    .overview-summary { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .weekly-purchases { gap: 5px; }
    .overview-purchase { flex-wrap: wrap; gap: 6px; }
    .overview-purchase-cost { text-align: left; margin-left: 50px; }
    .search-group-heading { align-items: start; flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 600px) {
    .history-heading h1 { font-size: 32px; }
    #history-filters label { flex: 1 1 130px; }
    #history-filters a { padding-top: 0; }
}
