:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --surface: #12181f;
  --surface-2: #18212a;
  --surface-3: #202b35;
  --line: #2b3742;
  --line-strong: #3d4b57;
  --text: #f3f5f7;
  --muted: #9ba9b7;
  --accent: #e33846;
  --cyan: #4bc7d6;
  --gold: #e0a11b;
  --green: #45c97a;
  --danger: #e25a65;
  --shadow: 0 12px 30px rgba(0, 0, 0, .22);
  --row-height: 88px;
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

html[data-accent="#2c9caa"] { --accent: #2c9caa; }
html[data-accent="#e0a11b"] { --accent: #e0a11b; }
html[data-accent="#7759c2"] { --accent: #7759c2; }
html[data-density="compact"] { --row-height: 70px; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #e7edf1;
  --line: #ced8df;
  --line-strong: #aebbc5;
  --text: #18212a;
  --muted: #657583;
  --shadow: 0 12px 28px rgba(21, 34, 44, .1);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --bg: #eef2f5;
    --surface: #ffffff;
    --surface-2: #f7f9fb;
    --surface-3: #e7edf1;
    --line: #ced8df;
    --line-strong: #aebbc5;
    --text: #18212a;
    --muted: #657583;
    --shadow: 0 12px 28px rgba(21, 34, 44, .1);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--cyan) 65%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 64px; padding: 9px max(20px, calc((100% - 1440px) / 2));
  display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.brand img { width: 38px; height: 38px; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.primary-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.primary-nav a { padding: 9px 12px; border-radius: 4px; color: var(--muted); font-weight: 600; }
.primary-nav a:hover { color: var(--text); background: var(--surface-2); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; border-right: 1px solid var(--line); padding: 9px 12px; color: var(--muted); background: transparent; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover, .segmented button.is-active { color: var(--text); background: var(--surface-3); }
.segmented.compact button { padding: 7px 9px; font-size: 12px; }

.page-shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; }
.site-footer { width: min(1440px, calc(100% - 40px)); margin: 40px auto 0; padding: 24px 0 32px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.monitor-console { min-height: 180px; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(500px, 1.25fr); align-items: center; gap: 44px; padding: 34px 0 28px; border-bottom: 1px solid var(--line); }
.monitor-title-block h1, .workspace-head h1, .admin-header h1, .server-detail-hero h1 { margin: 8px 0 7px; font-size: 34px; line-height: 1.15; }
.monitor-title-block p, .workspace-head p, .admin-header p { margin: 0; color: var(--muted); }
.network-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 700; text-transform: uppercase; font-size: 11px; }
.network-state span, .status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.network-state span, .status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(69, 201, 122, .12); }
.status-dot.offline { background: var(--danger); }

.summary-rail { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.summary-rail > div { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line); }
.summary-rail > div:last-child { border-right: 0; }
.summary-rail span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.summary-rail strong { font-size: 24px; }
.summary-rail strong small { color: var(--muted); font-size: 14px; }

.mode-strip { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.mode-chip { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-weight: 700; }
.mode-chip:hover, .mode-chip.is-active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

.server-browser, .service-catalog, .download-band, .client-catalog, .analytics-section, .players-section, .uptime-section, .cabinet-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.catalog-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.catalog-heading h2, .section-heading h2, .cabinet-section h2, .admin-panel h2 { margin: 2px 0 0; font-size: 24px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 800; text-transform: uppercase; }

.filter-bar { display: grid; grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(130px, .65fr)); gap: 10px; margin-bottom: 14px; }
.filter-bar label, .panel-form label, .plan-editor label, .owner-plan label, .settings-editor label, .admin-row > label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
input, select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; background: var(--surface); color: var(--text); }
input:hover, select:hover { border-color: var(--line-strong); }

.server-list { display: grid; gap: 7px; }
.server-row { min-height: var(--row-height); display: grid; grid-template-columns: minmax(300px, 2.2fr) 120px minmax(120px, .8fr) 120px 90px 116px; align-items: center; gap: 14px; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 5px; background: var(--surface); transition: border-color .15s, background .15s; }
.server-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.server-row.promoted { border-left-color: var(--gold); }
.server-row[data-color="#b62f42"] { background: color-mix(in srgb, #b62f42 13%, var(--surface)); }
.server-row[data-color="#e0a11b"] { background: color-mix(in srgb, #e0a11b 13%, var(--surface)); }
.server-row[data-color="#2c9caa"] { background: color-mix(in srgb, #2c9caa 13%, var(--surface)); }
.server-row[data-color="#7759c2"] { background: color-mix(in srgb, #7759c2 13%, var(--surface)); }
.server-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.server-identity > div { min-width: 0; }
.server-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.server-name-line a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 750; }
.server-name-line a:hover { color: var(--cyan); }
.server-subline { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.service-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 3px 6px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 3px; color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); font-size: 10px; font-weight: 800; }
.map-preview { width: 120px; height: 68px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #101820; color: var(--muted); font-size: 12px; }
.map-preview img { width: 100%; height: 100%; object-fit: cover; }
.map-preview.image-error img { display: none; }
.server-map-name, .server-population, .server-latency { min-width: 0; display: grid; gap: 5px; }
.server-map-name span, .server-population span, .server-latency span { color: var(--muted); font-size: 11px; }
.server-map-name strong, .server-latency strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-population strong { font-size: 18px; }
.server-population strong small { color: var(--muted); font-size: 12px; }
progress { width: 100%; height: 5px; border: 0; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
progress::-webkit-progress-bar { background: var(--surface-3); }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.server-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.server-card-extra { display: none; }

.button, .icon-button, .icon-command { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; padding: 9px 13px; background: var(--surface-2); color: var(--text); font-weight: 700; }
.button:hover, .icon-button:hover, .icon-command:hover { border-color: var(--line-strong); background: var(--surface-3); }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { filter: brightness(1.08); }
.button.secondary { background: var(--surface); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.wide { width: 100%; }
.compact-button { min-height: 36px; padding: 7px 12px; }
.icon-button { width: 38px; min-height: 38px; padding: 0; font-size: 19px; }
.icon-command { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.icon-command.positive { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); color: var(--green); }
.icon-command.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }

html[data-view="cards"] .server-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html[data-view="cards"] .server-row { min-height: 330px; grid-template-columns: 1fr 92px; grid-template-rows: auto 98px auto auto; align-items: start; padding: 16px; }
html[data-view="cards"] .server-identity { grid-column: 1 / 3; }
html[data-view="cards"] .map-preview { grid-column: 1 / 3; width: 100%; height: 98px; }
html[data-view="cards"] .server-map-name, html[data-view="cards"] .server-population, html[data-view="cards"] .server-latency { align-self: center; }
html[data-view="cards"] .server-row-actions { grid-column: 2; grid-row: 3 / 5; align-self: end; }
html[data-view="cards"] .server-card-extra { grid-column: 1 / 3; display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
html[data-view="cards"] .server-card-extra b { color: var(--gold); }

.service-price-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.service-price-grid article { min-height: 190px; padding: 17px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 5px; background: var(--surface); }
.service-price-grid article > span { color: var(--cyan); font-size: 11px; font-weight: 800; }
.service-price-grid h3 { margin: 10px 0 7px; font-size: 20px; }
.service-price-grid p { min-height: 52px; margin: 0 0 14px; color: var(--muted); }
.service-price-grid strong { display: block; font-size: 20px; }
.service-price-grid strong small, .service-price-grid em { color: var(--muted); font-size: 12px; font-style: normal; }

.download-band { display: grid; grid-template-columns: 1.4fr 1fr auto; align-items: center; gap: 30px; }
.download-band h2 { margin: 4px 0 7px; font-size: 24px; }
.download-band p { margin: 0; color: var(--muted); }
.release-meta { display: grid; gap: 7px; margin: 0; }
.release-meta div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; }
.release-meta dt { color: var(--muted); }
.release-meta dd { margin: 0; min-width: 0; }
.release-meta code { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-build-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.client-build-card { display: grid; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.client-build-copy small { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.client-build-copy h3 { margin: 6px 0 8px; font-size: 22px; }
.client-build-copy p { margin: 0; color: var(--muted); }
.client-build-card .download-button { justify-self: start; }
.client-build-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.build-library-hero { min-height: 220px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.build-library-hero h1 { margin: 8px 0 10px; font-size: clamp(32px, 5vw, 48px); line-height: 1.08; }
.build-library-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; }
.build-library-hero dl { min-width: 360px; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.build-library-hero dl div { padding: 16px; border-right: 1px solid var(--line); }
.build-library-hero dl div:last-child { border-right: 0; }
.build-library-hero dt { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.build-library-hero dd { margin: 6px 0 0; font-size: 20px; font-weight: 750; }
.build-library { padding: 30px 0; }
.build-library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.build-library-card { min-width: 0; display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.build-library-card.is-featured { border-color: color-mix(in srgb, var(--gold) 48%, var(--line)); box-shadow: inset 0 3px var(--gold); }
.build-cover { min-height: 250px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, var(--surface-3), #0f171d); }
.build-cover img { width: 100%; height: 100%; object-fit: cover; }
.build-cover > span { color: var(--muted); font-size: 42px; font-weight: 800; }
.build-card-body { min-width: 0; display: grid; align-content: start; gap: 13px; padding: 20px; }
.build-card-kicker { display: flex; justify-content: space-between; gap: 12px; color: var(--cyan); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.build-card-kicker b { color: var(--gold); }
.build-card-body h3 { margin: 0; font-size: 23px; }
.build-card-body h3 a:hover { color: var(--cyan); }
.build-card-body > p { margin: 0; color: var(--muted); }
.build-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.build-card-meta dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.build-card-meta dd { margin: 4px 0 0; font-weight: 700; }
.build-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.build-detail { padding-top: 24px; }
.build-detail-hero { position: relative; isolation: isolate; min-height: 370px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); align-items: end; gap: 34px; overflow: hidden; padding: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.build-detail-cover { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; }
.build-detail-hero::before { position: absolute; inset: 0; z-index: -2; content: ""; background: linear-gradient(90deg, color-mix(in srgb, var(--surface) 98%, transparent) 0%, color-mix(in srgb, var(--surface) 88%, transparent) 58%, color-mix(in srgb, var(--surface) 72%, transparent) 100%); }
.build-detail-hero::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(0deg, var(--surface) 0%, transparent 72%); }
.build-detail-brand { min-width: 0; display: flex; align-items: center; gap: 18px; }
.build-detail-brand img { flex: 0 0 auto; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.build-detail-brand h1 { margin: 7px 0 8px; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; }
.build-detail-brand p { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; }
.build-download-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); }
.build-download-panel dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.build-download-panel dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.build-download-panel dd { margin: 4px 0 0; font-weight: 700; }
.artifact-hash { min-width: 0; margin: 13px 0 0; color: var(--muted); font-size: 10px; }
.artifact-hash span { display: block; margin-bottom: 4px; }
.artifact-hash code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button.is-disabled { opacity: .55; cursor: default; }
.build-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.build-gallery figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.build-gallery img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: cover; }
.build-gallery figcaption { padding: 9px 11px; color: var(--muted); font-size: 12px; }
.build-detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 36px; padding: 34px 0; }
.build-copy h2, .build-requirements h2 { margin: 6px 0 14px; font-size: 26px; }
.build-copy h3 { margin: 26px 0 12px; }
.prose { color: var(--muted); line-height: 1.7; white-space: pre-line; }
.feature-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.feature-list li { position: relative; padding-left: 24px; }
.feature-list li::before { position: absolute; left: 0; color: var(--green); content: "✓"; font-weight: 800; }
.build-requirements { align-self: start; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.build-requirements > dl { margin: 0; }
.build-requirements > dl div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.build-requirements > dl div:last-child { border-bottom: 0; }
.build-requirements dt { color: var(--muted); }
.build-requirements dd { margin: 0; font-weight: 700; text-align: right; }
.build-note { margin: 18px 0 0; padding: 12px; border-left: 3px solid var(--cyan); background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.5; }

.back-link { display: inline-flex; margin-top: 24px; color: var(--muted); font-weight: 700; }
.back-link:hover { color: var(--cyan); }
.server-detail-hero { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.3fr); gap: 34px; padding: 26px 0 32px; border-bottom: 1px solid var(--line); }
.detail-map-stage { position: relative; min-height: 280px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #0f171d; }
.detail-map-stage img { width: 100%; height: 100%; object-fit: cover; }
.detail-map-stage img.map-fallback { width: 120px; height: 120px; object-fit: contain; opacity: .45; }
.detail-map-stage > span { position: absolute; left: 12px; bottom: 12px; padding: 5px 8px; border-radius: 3px; background: rgba(9, 13, 17, .82); color: #fff; font-weight: 700; }
.detail-main { align-self: center; }
.detail-kicker { display: flex; align-items: center; gap: 8px; }
.detail-kicker .ping { margin-left: auto; color: var(--muted); }
.detail-endpoint { color: var(--cyan); font-family: Consolas, monospace; }
.server-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.server-meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 12px; }
.detail-occupancy { margin: 22px 0; }
.server-score { display: flex; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.server-score strong { font-size: 30px; }
.server-score strong small { color: var(--muted); font-size: 16px; }
.server-score span { color: var(--muted); }
.detail-actions { display: flex; gap: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 4px 7px; border-radius: 3px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 800; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-chip.online, .status-chip.approved { color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.status-chip.offline { color: var(--danger); }
.status-chip.unknown { color: var(--gold); }

.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.analytics-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.analytics-grid article > span, .analytics-grid article > small { display: block; color: var(--muted); }
.analytics-grid article > strong { display: block; margin: 5px 0 0; font-size: 28px; }
.analytics-grid dl { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.analytics-grid dl div { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; }
.analytics-grid dt { color: var(--muted); }
.analytics-grid dd { margin: 0; font-weight: 700; }
.uptime-bars { display: flex; gap: 3px; overflow: hidden; }
.uptime-bars i { flex: 1 1 4px; max-width: 12px; height: 34px; border-radius: 2px; background: var(--danger); }
.uptime-bars i.online { background: var(--green); }

.data-table { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.data-row { min-height: 46px; display: grid; align-items: center; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row.header { min-height: 38px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.data-row small { display: block; margin-top: 3px; color: var(--muted); }
.players-table .data-row { grid-template-columns: 1fr 120px 160px; }
.orders-table .data-row { grid-template-columns: 140px 150px minmax(220px, 1fr) 100px 100px; }
.ledger-table .data-row { grid-template-columns: 140px 160px 100px 100px minmax(220px, 1fr); }
.build-table .data-row { grid-template-columns: 100px minmax(220px, 1fr) 110px 100px; }
.audit-table .data-row { grid-template-columns: 170px minmax(180px, 1fr) minmax(180px, 1fr); }
.amount-positive { color: var(--green); font-weight: 700; }
.amount-negative { color: var(--danger); font-weight: 700; }

.workspace-head, .admin-header { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.balance { min-width: 260px; padding: 16px 20px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 5px; background: var(--surface); }
.balance span, .balance small { display: block; color: var(--muted); }
.balance strong { display: block; margin: 4px 0; font-size: 26px; }
.workspace-nav { display: flex; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.workspace-nav a { padding: 8px 10px; border-radius: 4px; color: var(--muted); font-weight: 700; }
.workspace-nav a:hover { color: var(--text); background: var(--surface-2); }
.owner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.owner-server-list { display: grid; gap: 8px; }
.owner-server-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) 150px 130px minmax(230px, 1fr); gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.owner-server-row.is-archived { opacity: .65; }
.owner-server-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.owner-server-main > div, .owner-live { display: grid; gap: 5px; min-width: 0; }
.owner-server-main span, .owner-live span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.owner-analytics { display: grid; grid-template-columns: repeat(3, 1fr); grid-column: 1 / 4; gap: 7px; }
.owner-analytics span { padding: 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 11px; }
.owner-analytics b { display: block; margin-bottom: 3px; color: var(--text); }
.owner-services { grid-column: 4; display: flex; flex-wrap: wrap; gap: 5px; }
.moderation { padding: 5px 7px; border-radius: 3px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.moderation.approved, .moderation.pending_review { color: var(--green); }
.moderation.rejected { color: var(--danger); }
.moderation.pending_verification { color: var(--gold); }
.panel-form { display: grid; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.panel-form h2 { margin: 3px 0; }
.panel-form p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.owner-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.owner-plan { min-height: 270px; display: grid; gap: 11px; padding: 17px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 5px; background: var(--surface); }
.owner-plan > div { display: flex; justify-content: space-between; align-items: center; }
.owner-plan h3 { margin: 2px 0 0; font-size: 20px; }
.owner-plan p { margin: 0; color: var(--muted); }
.owner-plan > strong { font-size: 20px; }
.owner-plan > strong small { color: var(--muted); font-size: 12px; }
.logout-row { padding: 24px 0; }

.notice { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 4px; background: var(--surface); }
.notice.success { border-left-color: var(--green); }
.notice.error { border-left-color: var(--danger); }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }

.admin-console { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding-top: 20px; }
.admin-sidebar { position: sticky; top: 84px; align-self: start; display: grid; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.admin-sidebar a { display: flex; justify-content: space-between; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 650; }
.admin-sidebar a:last-child { border-bottom: 0; }
.admin-sidebar a:hover, .admin-sidebar a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 3px 0 var(--accent); }
.admin-sidebar b { color: var(--cyan); font-size: 11px; }
.admin-workspace { min-width: 0; }
.admin-panel { min-width: 0; padding-bottom: 32px; }
.admin-summary { margin-bottom: 14px; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.service-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.service-grid h3 { margin: 12px 0 4px; text-transform: capitalize; }
.service-grid p { margin: 0; color: var(--muted); font-size: 12px; }
.runtime-config { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px 0 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.runtime-config div { padding: 13px; border-right: 1px solid var(--line); }
.runtime-config div:last-child { border-right: 0; }
.runtime-config dt { color: var(--muted); font-size: 11px; }
.runtime-config dd { margin: 6px 0 0; font-weight: 700; }
.admin-list { display: grid; gap: 7px; }
.admin-row { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.admin-primary { min-width: 230px; display: grid; gap: 4px; margin-right: auto; }
.admin-primary span, .admin-primary small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.server-live-state { min-width: 145px; color: var(--muted); font-size: 12px; }
.server-live-state b { color: var(--green); }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.row-actions form { margin: 0; }
.settings-editor { position: relative; }
.settings-editor > summary { list-style: none; }
.settings-editor > summary::-webkit-details-marker { display: none; }
.settings-editor[open] > form { position: absolute; right: 0; z-index: 20; width: 270px; display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); box-shadow: var(--shadow); }
.purge-editor[open] > form { width: 340px; }
.user-management-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.balance-value { color: var(--gold); white-space: nowrap; }
.finance-summary { margin-bottom: 18px; }
.admin-subsection { margin-top: 22px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-item { padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.plan-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.plan-editor > strong, .plan-editor > .button { grid-column: 1 / -1; }
.check-label { display: flex !important; align-items: center; gap: 7px; }
.check-label input { width: 18px; min-height: 18px; }
.narrow-form { max-width: 560px; }

.admin-header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-header-actions form { margin: 0; }
.build-admin-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.build-admin-status article { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.build-admin-status span, .build-admin-status small { color: var(--muted); }
.build-admin-status strong { font-size: 21px; }
.status-good { color: var(--green); }
.status-warn { color: var(--gold); }
.status-bad { color: var(--danger); }
.build-admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; padding-top: 22px; }
.build-admin-nav { position: sticky; top: 84px; align-self: start; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.build-admin-nav a { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.build-admin-nav a:last-child { border-bottom: 0; }
.build-admin-nav a:hover { color: var(--text); background: var(--surface-2); box-shadow: inset 3px 0 var(--accent); }
.build-admin-workspace { min-width: 0; }
.build-editor { margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.build-editor > summary { padding: 12px 14px; background: var(--surface-2); cursor: pointer; font-weight: 750; }
.build-form-grid, .build-inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 15px; }
.build-form-grid label, .build-inline-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.build-form-grid textarea, .build-inline-form textarea { width: 100%; min-height: 70px; resize: vertical; border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; background: var(--surface); color: var(--text); font: inherit; }
.build-form-grid .span-2, .build-inline-form .span-2 { grid-column: 1 / -1; }
.build-inline-form { grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; align-items: end; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.build-product-list, .recipe-list, .job-list, .channel-list { display: grid; gap: 10px; }
.build-product-row, .recipe-card { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.build-product-row.is-archived { opacity: .68; }
.build-product-row > header, .recipe-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.build-product-row h3, .recipe-card h3 { margin: 8px 0 5px; font-size: 20px; }
.build-product-row header p, .recipe-card header p { margin: 0; color: var(--muted); }
.build-product-row .build-editor, .recipe-card .build-editor { margin: 14px 0 0; }
.asset-table .data-row { grid-template-columns: minmax(220px, 1.35fr) minmax(160px, 1fr) 120px 90px minmax(310px, 1.3fr); }
.asset-table code { font-size: 10px; }
.asset-publish-form { display: grid; grid-template-columns: minmax(86px, 1fr) minmax(76px, .8fr) auto; align-items: center; gap: 6px; }
.asset-publish-form input { min-width: 0; width: 100%; }
.component-list { display: grid; gap: 6px; margin: 14px 0 0; padding: 12px 12px 12px 34px; border-top: 1px solid var(--line); }
.component-list li { padding-left: 4px; }
.component-list li span { display: block; margin-top: 3px; color: var(--muted); }
.component-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.component-actions { flex: 0 0 auto; }
.component-actions button:disabled { opacity: .45; cursor: not-allowed; }
.queue-form { grid-template-columns: 1fr 1fr auto; margin: 14px 0 0; }
.job-row { min-width: 0; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 1fr) 50px auto auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.job-row > div { min-width: 0; display: grid; gap: 4px; }
.job-row > div strong, .job-row > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row > div small { color: var(--muted); }
.job-row details { position: relative; }
.job-events { position: absolute; right: 0; z-index: 20; width: min(560px, 75vw); max-height: 320px; overflow: auto; margin: 6px 0 0; padding: 12px 12px 12px 32px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); box-shadow: var(--shadow); }
.job-events li { margin: 6px 0; }
.job-events time { margin-right: 8px; color: var(--muted); font-size: 11px; }
.job-events .event-error { color: var(--danger); }
.job-events .event-warning { color: var(--gold); }
.channel-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.channel-list article > div { display: grid; gap: 4px; }
.channel-list span, .channel-list small { color: var(--muted); }
.version-list { display: grid; gap: 8px; margin-top: 12px; }
.version-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.version-list article > div:first-child { display: grid; gap: 4px; }
.version-list article span { color: var(--muted); font-size: 12px; }
.build-audit-table .data-row { grid-template-columns: 170px minmax(180px, .7fr) minmax(220px, 1fr); }

@media (max-width: 1180px) {
  .topbar { gap: 12px; }
  .brand { min-width: 190px; }
  .density-switch { display: none; }
  .monitor-console { grid-template-columns: 1fr; gap: 20px; }
  .filter-bar { grid-template-columns: 2fr repeat(2, 1fr); }
  .filter-bar label:nth-child(4), .filter-bar label:nth-child(5) { grid-row: 2; }
  .server-row { grid-template-columns: minmax(260px, 2fr) 110px 110px 90px 100px; }
  .server-map-name { display: none; }
  html[data-view="cards"] .server-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-price-grid { grid-template-columns: repeat(3, 1fr); }
  .owner-server-row { grid-template-columns: 1fr 130px 120px; }
  .owner-services { grid-column: 1 / 4; }
  .admin-console { grid-template-columns: 190px minmax(0, 1fr); }
  .build-admin-status { grid-template-columns: repeat(2, 1fr); }
  .build-inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-admin-row { align-items: flex-start; flex-wrap: wrap; }
  .row-actions { width: 100%; }
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 9px 14px; }
  .brand { margin-right: auto; }
  .primary-nav { order: 3; width: 100%; overflow-x: auto; }
  .page-shell, .site-footer { width: min(100% - 24px, 1440px); }
  .summary-rail { grid-template-columns: repeat(2, 1fr); }
  .summary-rail > div:nth-child(2) { border-right: 0; }
  .summary-rail > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .search-field { grid-column: 1 / 3; }
  .filter-bar label:nth-child(n) { grid-row: auto; }
  .server-row { grid-template-columns: minmax(0, 1fr) 92px; grid-template-rows: auto auto auto; }
  .server-identity { grid-column: 1 / 3; }
  .map-preview { width: 92px; height: 58px; grid-column: 2; grid-row: 2; }
  .server-population { grid-column: 1; grid-row: 2; }
  .server-latency { display: none; }
  .server-row-actions { grid-column: 1 / 3; justify-content: stretch; }
  .server-row-actions .button { flex: 1; }
  html[data-view="cards"] .server-list { grid-template-columns: 1fr; }
  .service-price-grid, .owner-plan-grid { grid-template-columns: repeat(2, 1fr); }
  .download-band, .server-detail-hero { grid-template-columns: 1fr; }
  .build-library-hero, .build-detail-hero, .build-detail-grid { grid-template-columns: 1fr; }
  .build-library-hero dl { min-width: 0; }
  .build-detail-hero { padding: 28px; }
  .detail-map-stage { min-height: 230px; }
  .owner-layout, .user-management-grid { grid-template-columns: 1fr; }
  .owner-server-row { grid-template-columns: 1fr 120px; }
  .owner-live { grid-column: 1 / 3; }
  .owner-analytics, .owner-services { grid-column: 1 / 3; }
  .admin-console { grid-template-columns: 1fr; }
  .build-admin-layout { grid-template-columns: 1fr; }
  .build-admin-nav { position: static; display: flex; overflow-x: auto; }
  .build-admin-nav a { flex: 0 0 auto; border-right: 1px solid var(--line); border-bottom: 0; }
  .admin-sidebar { position: static; display: flex; overflow-x: auto; }
  .admin-sidebar a { flex: 0 0 auto; border-right: 1px solid var(--line); border-bottom: 0; }
  .service-grid, .runtime-config { grid-template-columns: repeat(2, 1fr); }
  .runtime-config div:nth-child(2) { border-right: 0; }
  .plan-grid { grid-template-columns: 1fr; }
  .data-table { overflow-x: auto; }
  .data-row { min-width: 760px; }
  .job-row { grid-template-columns: minmax(0, 1fr) 1fr 50px; }
  .job-row details, .job-row form { grid-row: 2; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar .segmented { display: none; }
  .primary-nav a { padding: 8px; }
  .monitor-title-block h1, .workspace-head h1, .admin-header h1, .server-detail-hero h1 { font-size: 28px; }
  .monitor-console { min-height: 0; padding-top: 26px; }
  .summary-rail > div { padding: 13px; }
  .catalog-heading, .section-heading, .workspace-head, .admin-header { align-items: flex-start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .service-price-grid, .owner-plan-grid, .analytics-grid { grid-template-columns: 1fr; }
  .build-library-hero dl, .build-card-meta { grid-template-columns: 1fr; }
  .build-library-hero dl div { border-right: 0; border-bottom: 1px solid var(--line); }
  .build-library-hero dl div:last-child { border-bottom: 0; }
  .build-library-card { grid-template-columns: 1fr; }
  .build-cover { min-height: 190px; max-height: 260px; }
  .build-detail-hero { min-height: 0; padding: 22px 16px; }
  .build-detail-brand { align-items: flex-start; flex-direction: column; }
  .build-detail-brand img { width: 70px; height: 70px; }
  .build-download-panel dl { grid-template-columns: 1fr; }
  .service-price-grid article { min-height: 0; }
  .owner-server-row { grid-template-columns: 1fr; }
  .owner-live, .owner-analytics, .owner-services { grid-column: 1; }
  .owner-analytics { grid-template-columns: 1fr; }
  .plan-editor { grid-template-columns: 1fr; }
  .admin-header-actions { justify-content: flex-start; }
  .build-admin-status, .build-form-grid, .build-inline-form { grid-template-columns: 1fr; }
  .build-form-grid .span-2, .build-inline-form .span-2 { grid-column: 1; }
  .build-product-row > header, .recipe-card > header, .channel-list article, .version-list article { align-items: stretch; flex-direction: column; }
  .component-row { align-items: stretch; flex-direction: column; }
  .component-actions { justify-content: flex-start; }
  .job-row { grid-template-columns: 1fr; }
  .job-row details, .job-row form { grid-row: auto; }
  .site-footer { display: grid; gap: 6px; }
}
