/* Console theme: neutral surfaces, jade actions, shared spacing and type. */
:root {
  --font-body: 14px;
  --font-caption: 13px;
  color-scheme: dark;
  --bg: #111618;
  --sidebar: #151c1e;
  --panel: #1b2326;
  --surface-2: #222d31;
  --surface-hover: #2a383d;
  --field: #151d20;
  --panel-gradient: linear-gradient(160deg, #1e282b, #1b2326);
  --card-gradient: linear-gradient(155deg, #243034, #1c272a);
  --inset-gradient: linear-gradient(160deg, #1b2528, #182124);
  --canvas-gradient: radial-gradient(ellipse 1000px 500px at 65% 0, #29594a14, transparent 75%);
  --ink: #edf3f4;
  --text: var(--ink);
  --muted: #b5c2c7;
  --subtle: #9daeb5;
  --line: #303d42;
  --border-strong: #4b6068;
  --primary: #257459;
  --primary-dark: #2b8264;
  --accent: #8adbbb;
  --primary-soft: #203c33;
  --danger: #ff9b9b;
  --danger-soft: #352429;
  --danger-line: #684148;
  --success: #7bd9b0;
  --success-soft: #20342d;
  --success-line: #365e4e;
  --warning: #efc779;
  --warning-soft: #352f23;
  --warning-line: #645336;
  --chart-primary: #65bea1;
  --chart-secondary: #bcc8bf;
  --chart-danger: #e58d8a;
  --sidebar-muted: #9daeb5;
  --shadow: 0 2px 8px #00000014;
  --shadow-lg: 0 24px 80px #0007;
  --topbar-height: 68px;
  --radius: 12px;
  --radius-control: 8px;
  --panel-padding: 24px;
}
html { scroll-padding-top: calc(var(--topbar-height) + 16px); scrollbar-color: #49564f transparent; scrollbar-width: thin; }
body { font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--bg); background-image: var(--canvas-gradient); background-attachment: fixed; }
::selection { background: #286b54; color: #fff; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { font-weight: 550; }
button:active { transform: none; }
button:focus-visible, summary:focus-visible, a:focus-visible, .clickable-row:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
:is(.content,dialog) :is(label,input,select,textarea,button) { font-size: 14px; }
h1, h2 { font-size: 28px; font-weight: 650; letter-spacing: -.025em; line-height: 1.35; }
h3 { font-size: 15px; font-weight: 600; }
.muted { font-size: var(--font-caption); color: var(--muted); }
.eyebrow { color: var(--subtle); font-size: var(--font-caption); font-weight: 600; letter-spacing: .15em; margin-bottom: 8px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 200; padding: 10px 16px; background: var(--panel); color: var(--ink); border: 1px solid var(--accent); border-radius: 6px; }
.skip-link:focus { top: 10px; }

/* The global utility bar and the game navigation have separate scopes. */
.topbar { min-height: 68px; padding: 0 24px 0 0; gap: 24px; flex-wrap: nowrap; background: #171f22; border-bottom-color: var(--line); backdrop-filter: none; box-shadow: var(--shadow); }
.topbar-main { gap: 16px; flex: 1; min-width: 0; }
.server-identity { display: flex; align-items: center; gap: 4px; min-width: 0; flex-shrink: 0; }
.server-identity-label { display: inline-block; max-width: 220px; padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-weight: 750; color: var(--ink); background: var(--surface-2); }
.server-identity-label[data-kind="test"] { color: #9acbff; border-color: #4b76a5; background: #203143; }
.server-identity-label[data-kind="production"] { color: #ffc9ab; border-color: #916346; background: #3b2c23; }
.server-identity-label[data-kind="development"] { color: #ace4c6; border-color: #477a61; background: #20372a; }
.login-server-label { max-width: 100%; margin: 0 0 18px; }
.server-identity .icon-button { width: 28px; min-height: 28px; padding: 3px; }
.brand { width: 252px; min-height: 68px; padding: 0 20px; border-right: 1px solid var(--line); flex-shrink: 0; gap: 9px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.brand-mark { background: linear-gradient(145deg, #368768, #246248); box-shadow: inset 0 1px 0 #ffffff26; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 8px; }
.version-badge { padding: 3px 7px; font-size: var(--font-caption); font-weight: 500; border-radius: 6px; color: var(--subtle); background: #ffffff06; }
.page-location { display: flex; gap: 9px; min-width: 0; padding-left: 0; border: 0; }
.page-location span { overflow: hidden; max-width: 240px; font-size: var(--font-caption); text-overflow: ellipsis; white-space: nowrap; }
.page-location strong { flex-shrink: 0; color: var(--ink); font-size: var(--font-caption); font-weight: 550; }
.page-location strong::before { content: "/"; margin-right: 9px; color: var(--border-strong); }
.topbar-right { min-width: 0; gap: 12px; }
.sidebar-game-scope { margin: 14px 0 2px; padding: 16px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.game-picker { display: grid; grid-template-columns: minmax(0,1fr); min-width: 0; gap: 9px; font-size: var(--font-caption); }
.game-picker-label { display: block; padding-left: 10px; color: var(--muted); font-size: var(--font-caption); }
.game-picker select, .game-picker .ops-select { width: 100%; max-width: none; }
.game-picker .ops-select-input { min-height: 42px; background: var(--surface-2); border-color: var(--line); font-size: var(--font-caption); font-weight: 600; }
.sidebar-game-switch { display: none; align-items: center; justify-content: center; min-height: 38px; margin-top: 8px; padding: 8px; color: var(--muted); background: var(--surface-2); }
.sidebar-game-switch svg { width: 18px; height: 18px; }
.sidebar-game-switch:hover { color: var(--ink); }
.sidebar-collapsed .sidebar-game-scope { display: none; }
.sidebar-collapsed .sidebar-game-switch { display: flex; }
.sidebar-collapsed .brand { width: 72px; justify-content: center; padding: 0; }
.sidebar-collapsed .brand > span:not(.brand-mark) { display: none; }
.timezone-picker { gap: 6px; font-size: var(--font-caption); }
.timezone-picker > .field-label-title { display: flex; order: 2; font-size: 0; }
.timezone-picker .context-help-button { margin-left: 0; }
.timezone-picker select, .timezone-picker .ops-select { width: 175px; }
.topbar .ops-select-input { min-height: 34px; height: 34px; font-size: var(--font-caption); }
.user-badge { overflow: hidden; max-width: 160px; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); font-size: var(--font-caption); white-space: nowrap; text-overflow: ellipsis; }
#logoutButton { min-height: 32px; padding: 5px 8px; font-size: var(--font-caption); }
.layout { min-height: calc(100dvh - var(--topbar-height)); }
.sidebar { top: var(--topbar-height); width: 252px; flex-basis: 252px; height: calc(100dvh - var(--topbar-height)); padding: 14px 14px 24px; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; background: var(--sidebar); }
.sidebar-heading { height: 30px; margin-bottom: 9px; color: var(--subtle); font-size: var(--font-caption); font-weight: 500; letter-spacing: .08em; }
.sidebar-collapse { width: 24px; height: 24px; border: 0; background: transparent; }
.nav-section-toggle { padding: 15px 10px 9px; font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: .02em; color: var(--ink); }
.nav-section-toggle:hover { color: var(--ink); }
.nav-section.has-active > .nav-section-toggle { color: var(--accent); }
.nav-section-title { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.nav-section-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-section-toggle .nav-chevron { color: var(--subtle); font-size: 14px; font-weight: 400; }
.nav-section[data-nav-group="system"] { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); border-radius: 0; }
.nav-section-items { gap: 2px; }
.nav-section:not(.collapsed) .nav-section-items { margin: 2px 0 4px 18px; padding-left: 9px; border-left: 1px solid var(--line); }
.sidebar-collapsed .nav-section .nav-section-items { margin: 0; padding: 0; border: 0; }
.nav-button { min-height: 38px; gap: 10px; padding: 8px 10px; border-radius: var(--radius-control); font-size: var(--font-body); font-weight: 450; color: var(--muted); transition: background-color .15s, color .15s; }
.nav-button:hover { background: var(--surface-2); color: var(--ink); }
.nav-button.active, .sidebar-collapsed .nav-button.active { color: #d2f3e4; background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.primary-navigation > .nav-root-button { min-height: 42px; font-size: 15px; font-weight: 700; color: var(--ink); }
.primary-navigation > .nav-root-button.active { color: #d2eddf; }
.nav-root-button:not(.active) .nav-icon { color: inherit; }
.nav-icon { width: 18px; height: 18px; color: var(--subtle); display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-button.active .nav-icon { color: var(--accent); }
.sidebar .sidebar-context { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 10px 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.sidebar-context .context-name { font-size: var(--font-caption); font-weight: 550; color: var(--ink); }
.sidebar-context .context-id { min-width: 0; font-size: var(--font-caption); margin: 0; }
.sidebar-context .context-meta { flex-shrink: 0; gap: 8px; font-size: var(--font-caption); margin: 0; color: var(--subtle); }
.nav-search { position: relative; display: flex; align-items: center; margin: 0 0 8px; }
.nav-search > svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--subtle); pointer-events: none; }
.nav-search input { min-height: 36px; height: 36px; padding: 6px 50px 6px 32px; font-size: var(--font-caption); background: var(--field); border-color: var(--line); border-radius: var(--radius-control); font-weight: 400; }
.nav-search kbd { position: absolute; right: 8px; padding: 0 3px; border: 1px solid var(--line); border-radius: 3px; font-family: inherit; font-size: var(--font-caption); line-height: 17px; color: var(--subtle); pointer-events: none; }
.nav-search input:not(:placeholder-shown) + kbd { display: none; }
.nav-search input::-webkit-search-cancel-button { appearance: none; }
.search-clear { position: absolute; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
.search-clear:hover { color: var(--ink); background: var(--surface-hover); }
.nav-button:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.nav-search-empty { padding: 20px 10px; color: var(--muted); font-size: var(--font-caption); text-align: center; }
.nav-filtering .nav-section.collapsed .nav-section-items { display: grid !important; }
.nav-filtering .nav-filtered-out { display: none !important; }
.nav-section.nav-filtered-out { display: none; }
.sidebar-collapsed .nav-search, .sidebar-collapsed .nav-search-empty { display: none; }

/* Surface depth is subtle; color is reserved for actions and status. */
.content { width: min(1780px, 100%); padding: 32px 32px 56px; }
.workspace-intro { color: var(--muted); font-size: var(--font-caption); line-height: 1.7; margin: 8px 0 0; }
.page-heading { align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading .action-row { margin: 0; flex-shrink: 0; }
.page-heading p { margin-bottom: 0; }
.panel, .stat-card, .game-workspace-card, .leaderboard-card, .campaign-card, .host-metric { border-radius: var(--radius); background: var(--panel-gradient); box-shadow: inset 0 1px 0 #ffffff04, var(--shadow); }
.stat-card, .host-metric, .game-workspace-card, .leaderboard-card, .campaign-card { background: var(--card-gradient); }
.audience-summary-card, .help-disclosure, .payment-order-detail { background: var(--panel-gradient); }
.engagement-item, .retention-item, .import-module, .payment-detail-grid > div, .frame-room-detail-grid > div,
.telemetry-sample-card, .telemetry-occurrence, .setting-switch { background: var(--card-gradient); }
.configuration-callout > div, .reset-schedule-builder, .import-summary, .catalog-summary,
.tag-management-item, .segment-item, .note-item, .payment-channel-row, .payment-event-list > div,
.telemetry-health-row, .telemetry-property-editor { background: var(--inset-gradient); }
.tag-management-item:hover, .segment-item:hover { background: var(--card-gradient); }
.health-alerts, .attention-item, .warning-note, .restriction-banner, .telemetry-coverage,
.import-danger, .import-conflicts, .import-warnings, .import-error, .delivery-card {
  background-image: linear-gradient(125deg, #ffffff08, transparent 75%);
}
.panel { padding: var(--panel-padding); }
.panel-heading { gap: 16px; }
.panel-heading h3 { font-weight: 600; }
.stat-grid { gap: 14px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-card .label { font-size: var(--font-body); color: var(--muted); }
.stat-card .value { margin-top: 12px; font-size: 32px; line-height: 1.25; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat-card .subvalue { margin-top: 9px; font-size: var(--font-caption); color: var(--subtle); text-wrap: pretty; }
.stat-note-part { display: inline-block; max-width: 100%; vertical-align: top; }
#paymentSummaryCards .value { font-size: 28px; text-wrap: balance; }
.workspace-stats { gap: 14px; padding: 0; margin-bottom: 30px; border: 0; }
.workspace-stats .stat-card, .workspace-stats .stat-card:first-child { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-gradient); }
.workspace-stats .stat-card .label { font-size: var(--font-body); }
.workspace-stats .stat-card .value { font-size: 32px; margin-top: 10px; }
.workspace-stats .stat-card .subvalue { margin-top: 8px; line-height: 1.6; }
.workspace-stats .stat-card:nth-child(3) .value { color: var(--success); }
.workspace-main-grid { grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "primary secondary"; gap: 24px; margin-bottom: 0; align-items: start; }
.workspace-primary, .workspace-secondary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
.workspace-primary { grid-area: primary; }
.workspace-secondary { grid-area: secondary; }
.workspace-primary > *, .workspace-secondary > * { min-width: 0; }
.workspace-games-section { margin: 0; }
.workspace-games-section .section-heading { align-items: center; margin-bottom: 16px; }
.workspace-games-section .section-heading > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.workspace-games-section .section-heading h2 { font-size: 18px; }
.workspace-games-section .search-compact input { width: 220px; }
.workspace-games-section .game-workspace-grid { grid-template-columns: minmax(0,1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-gradient); }
.game-operation-row { padding: var(--panel-padding); min-width: 0; border-bottom: 1px solid var(--line); background: transparent; }
.game-operation-row:first-child { border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }
.game-operation-row:last-child { border-bottom-left-radius: calc(var(--radius) - 1px); border-bottom-right-radius: calc(var(--radius) - 1px); }
.game-operation-row:last-child { border-bottom: 0; }
.game-operation-row.has-issue { box-shadow: inset 3px 0 var(--warning); }
.game-row-main { display: grid; grid-template-columns: minmax(160px,1fr) minmax(210px,1fr) auto; align-items: center; gap: 20px; }
.game-row-identity { min-width: 0; }
.game-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-identity-copy { min-width: 0; }
.game-icon { position: relative; display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; overflow: hidden; border: 1px solid #668a753d; border-radius: 11px; background: var(--card-gradient); color: var(--accent); font-size: 18px; font-weight: 650; line-height: 1; }
.game-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.game-icon.is-loaded img { opacity: 1; }
.game-icon.is-loaded .game-icon-fallback { visibility: hidden; }
.game-icon-editor { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--inset-gradient); }
.game-icon-editor.has-unsaved-changes { border-color: var(--warning-line); }
.game-icon-editor .section-draft-status { color: var(--warning); font-size: var(--font-caption); }
.game-icon-gallery-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.game-icon-gallery-heading strong { color: var(--ink); font-size: var(--font-caption); font-weight: 600; }
.game-icon-gallery-heading span { color: var(--subtle); font-size: var(--font-caption); }
.game-icon-presets { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; }
.game-icon-presets .game-icon-preset { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: #161e1a66; color: var(--muted); font-size: var(--font-caption); font-weight: 500; line-height: 1.4; cursor: pointer; }
.game-icon-preset img { display: block; width: 56px; height: 56px; border-radius: 12px; }
.game-icon-preset:not(:disabled):hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--ink); }
.game-icon-preset[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--accent); color: var(--ink); }
.game-icon-preset[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--primary); font-size: var(--font-caption); font-weight: 700; }
.game-icon-preset:disabled { opacity: .5; cursor: not-allowed; }
.game-icon-editor-body { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.game-icon-preview-wrap { flex: 0 0 80px; text-align: center; }
.game-icon-preview .game-icon { width: 80px; height: 80px; font-size: 30px; border-radius: 18px; }
.game-icon-current { display: block; margin-top: 6px; font-size: var(--font-caption); color: var(--subtle); }
.game-icon-editor-fields { flex: 1; min-width: 0; }
.game-icon-editor-fields input[type="file"] { width: 100%; max-width: 100%; min-width: 0; font-size: var(--font-caption); }
.game-icon-editor-fields .field-hint { margin: 8px 0 12px; }
.game-icon-editor > .muted { margin: 12px 0 0; }
.game-icon-editor input::file-selector-button { padding: 5px 8px; margin-right: 8px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--ink); background: var(--surface-2); cursor: pointer; }
.game-row-identity h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.game-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.game-row-meta .game-card-id { overflow-wrap: anywhere; }
.game-row-metrics { display: flex; flex-wrap: wrap; min-width: 0; gap: 0; text-align: right; }
.game-row-metrics > div { flex: 1 1 80px; min-width: max-content; padding: 4px 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; }
.game-row-metrics span { display: block; color: var(--muted); font-size: var(--font-caption); }
.game-row-metrics strong { display: block; margin-top: 4px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-row-details { margin-top: 12px; }
.game-row-details > summary { display: flex; width: fit-content; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--muted); font-size: var(--font-caption); }
.game-row-details > summary::-webkit-details-marker { display: none; }
.game-row-details > summary:hover { color: var(--ink); }
.game-row-details[open] > summary > span { transform: rotate(180deg); }
.game-row-detail-body { padding-top: 12px; color: var(--muted); font-size: var(--font-caption); }
.game-row-detail-body p { margin: 0 0 12px; overflow-wrap: anywhere; }
.game-row-detail-body dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 12px; }
.game-row-detail-body dt { color: var(--subtle); }
.game-row-detail-body dd { margin: 4px 0 0; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.workspace-secondary .panel { padding: 22px; }
.workspace-secondary .panel-heading { margin-bottom: 0; }
.workspace-secondary .panel-heading h3 { font-size: 15px; font-weight: 650; }
.workspace-secondary .attention-list { margin-top: 16px; }
.workspace-secondary .healthy-state { min-height: 116px; }
.chart-panel { min-height: 300px; }
.attention-panel { min-height: 0; }
.workspace-primary .chart-panel { background: var(--panel-gradient); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--panel-padding); }
.activity-chart.large { height: 210px; }
.activity-chart { background-image: repeating-linear-gradient(to top, transparent 0, transparent 49px, #b5c2c70d 49px, #b5c2c70d 50px); }
.chart-day { min-width: 38px; flex-basis: 38px; }
.chart-bars { gap: 4px; }
.chart-series { width: min(14px, 38%); }
.chart-value { font-size: var(--font-body); font-weight: 500; opacity: 0; transition: opacity .15s; }
.chart-day:hover .chart-value, .chart-day:focus-visible .chart-value, .chart-day.selected .chart-value { opacity: 1; }
.chart-bar.active, .active-dot { background: var(--chart-primary); }
.chart-bar.new, .new-dot { background: var(--chart-secondary); }
.chart-label { color: var(--subtle); font-size: var(--font-body); }
.chart-tooltip { background: var(--surface-2); color: var(--muted); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.legend { gap: 6px; font-size: var(--font-caption); white-space: nowrap; }
.dot { width: 6px; height: 6px; }
.trend-summary { gap: 16px; margin-top: 20px; }
.trend-item { padding: 0; background: transparent; border-radius: 0; border: 0; }
.trend-item > span, .trend-item em { font-size: var(--font-caption); }
.trend-item strong { font-size: 14px; font-weight: 600; }
.workspace-health-summary { grid-template-columns: minmax(0,1fr); gap: 0; margin: 12px 0 0; }
.workspace-health-item { padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; }
.workspace-health-item:last-child { padding-bottom: 0; border-bottom: 0; }
.workspace-health-item > span, .workspace-health-item > strong { font-size: var(--font-caption); font-weight: 500; }
.workspace-health-item small { display: none; }
.workspace-health-item:has(.status-warning, .status-error, .status-info) > small { display: block; color: var(--muted); font-size: var(--font-caption); }
.healthy-state { min-height: 124px; }
.healthy-state > div { display: grid; justify-items: center; gap: 5px; }
.healthy-state .healthy-icon { width: 28px; height: 28px; margin-bottom: 2px; font-size: 15px; }
.healthy-state strong { font-size: var(--font-caption); font-weight: 500; }
.healthy-state p { max-width: 240px; font-size: var(--font-caption); margin: 0; }
.count-badge { min-width: 22px; min-height: 22px; padding: 1px 6px; font-size: var(--font-caption); border-radius: 5px; font-weight: 500; }
.section-heading h2 { font-size: 18px; font-weight: 600; }
.section-heading p { margin-top: 4px; font-size: var(--font-caption); }
.search-compact input { width: 240px; font-size: var(--font-caption); }
.search-compact .muted { font-size: var(--font-caption); }
.game-workspace-grid { gap: 16px; }
.game-workspace-card { padding: 20px; }
.game-workspace-card:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.game-card-header h3 { font-size: 15px; font-weight: 600; }
.game-card-id { color: var(--subtle); font-size: var(--font-caption); }
.game-health { padding: 3px 6px; font-size: var(--font-caption); font-weight: 500; border-radius: 5px; white-space: nowrap; }
.game-card-description { height: auto; min-height: 20px; margin: 14px 0; font-size: var(--font-caption); }
.game-metric-grid { gap: 14px 8px; padding: 14px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.game-metric { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset-gradient); }
.game-metric strong { font-size: 16px; font-weight: 550; font-variant-numeric: tabular-nums; }
.game-metric span { font-size: var(--font-caption); color: var(--subtle); }
.game-activity-note { font-size: var(--font-caption); }
.game-card-footer .primary { color: var(--accent); background: var(--primary-soft); border-color: transparent; font-size: var(--font-caption); }
.game-card-footer .primary:hover { background: #2c4a3d; }

/* Fields, actions and tables share a compact, consistent rhythm. */
label { gap: 7px; color: var(--muted); font-weight: 500; }
input, textarea, select { min-height: 40px; padding: 9px 12px; border-color: var(--border-strong); border-radius: var(--radius-control); background: var(--field); color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: #718279; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #83ceb11f; }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 16px; accent-color: var(--primary); }
input[type="range"] { accent-color: var(--primary); }
select:not([multiple]) { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b2bdb7' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select option, select optgroup { color: var(--ink); background: var(--surface-2); }
button { min-height: 38px; padding: 9px 14px; border-radius: var(--radius-control); transition: background-color .15s, border-color .15s, color .15s; }
.primary { background: var(--primary); color: #fff; border: 1px solid #49977c; box-shadow: inset 0 1px 0 #ffffff0a, 0 2px 3px #0002; }
.primary:hover { background: var(--primary-dark); border-color: #6bb497; }
.secondary { background: #ffffff04; border: 1px solid var(--border-strong); color: var(--ink); }
.secondary:hover { background: var(--surface-hover); border-color: #718279; }
.ghost { color: var(--muted); }
.ghost:hover { color: var(--ink); background: var(--surface-2); }
.danger-button { background: #a63646; border: 1px solid #ce5968; color: #fff; }
.danger-button:hover { background: #bc4051; }
.small-button { min-height: 32px; padding: 6px 10px; font-size: var(--font-caption); }
.compact-actions { gap: 6px; }
.field-note, .schedule-preview { color: var(--muted); background: var(--inset-gradient); }
.field-note strong { color: var(--ink); }
.filter-row { gap: 12px; }
.filter-row label { min-width: 160px; }
.filter-primary-row, .filter-secondary-row { gap: 12px; }
.filter-primary-row label, .filter-secondary-row label { min-width: 150px; }
.filter-primary-row .search-field { min-width: 220px; }
.filter-primary-row + .filter-secondary-row { margin-top: 16px; padding-top: 16px; }
.player-workspace { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-gradient); }
.player-filter-panel { margin: 0; padding: 20px; }
.player-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.player-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); }
.player-results-toolbar .result-summary { flex: 1; flex-wrap: wrap; justify-content: flex-start; gap: 8px 16px; min-height: 0; padding: 0; font-size: var(--font-caption); }
.player-results-toolbar .table-settings { margin-left: auto; }
.player-workspace > .filter-pending { margin: 0 20px 16px; }
.player-workspace > .applied-filters { margin: 0; padding: 0 20px 16px; }
.player-workspace > .table-wrap { border-top: 1px solid var(--line); }
.player-workspace > .pagination { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); }
.player-workspace .data-table { margin: 0; }
.saved-view-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.saved-view-picker { display: flex; align-items: center; gap: 10px; }
.saved-view-picker > span:first-child { color: var(--subtle); font-size: var(--font-caption); white-space: nowrap; }
.saved-view-picker > select, .saved-view-picker > .ops-select { width: 200px; }
.table-settings { position: relative; flex: 0 0 auto; }
.table-settings > summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; color: var(--muted); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--font-caption); }
.table-settings > summary::-webkit-details-marker, .advanced-settings > summary::-webkit-details-marker { display: none; }
.table-settings > summary:hover, .table-settings[open] > summary { background: var(--surface-2); color: var(--ink); }
.table-settings-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; z-index: 15; display: grid; gap: 16px; padding: 18px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel-gradient); box-shadow: var(--shadow-lg); }
.table-settings fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.table-settings legend { padding: 0; margin-bottom: 10px; color: var(--subtle); font-size: var(--font-caption); }
.density-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.density-options label { display: flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--font-caption); cursor: pointer; }
.density-options label:has(input:checked) { border-color: var(--accent); background: var(--primary-soft); color: var(--ink); }
#playerColumnChoices { display: grid; gap: 2px; }
#playerColumnChoices .column-choice { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: var(--font-caption); font-weight: 400; cursor: pointer; }
.column-choice:has(input:disabled) { color: var(--subtle); cursor: default; }
.column-choice input, .density-options input { margin: 0; flex-shrink: 0; }
.filter-pending { margin: -8px 0 16px; padding: 9px 12px; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; color: var(--accent); background: var(--primary-soft); font-size: var(--font-caption); }
.applied-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-2); font-size: var(--font-caption); }
.filter-chip > span:first-child { overflow: hidden; max-width: 320px; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.filter-chip > span:last-child { font-size: 16px; line-height: 1; color: var(--subtle); }
#playerList[aria-busy="true"] { opacity: .55; pointer-events: none; }
#playerList[data-density="compact"] td { padding: 8px 16px; }
#playerList[data-density="compact"] .player-avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: var(--font-caption); }
#playerList[data-density="compact"] .muted, #playerList[data-density="compact"] .uid { line-height: 1.4; margin-top: 1px; }
.save-view-dialog { width: min(460px,calc(100vw - 32px)); }
.save-view-dialog .form-actions { justify-content: flex-end; padding-top: 8px; }
.result-summary { margin: 4px 0 8px; font-size: var(--font-caption); }
.data-table th { padding: 14px 18px; background: var(--surface-2); color: var(--muted); font-weight: 550; }
.data-table td { padding: 17px 18px; border-color: var(--line); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:not(.selected):hover td { background: #ffffff06; }
.data-table tbody tr.clickable-row:not(.selected):hover td { background: var(--surface-2); }
.data-table tbody tr.selected td { background: var(--primary-soft); }
.data-table { font-variant-numeric: tabular-nums; }
.data-table .muted, .data-table .uid { font-size: var(--font-caption); margin-top: 3px; }
.table-wrap { scrollbar-width: thin; scrollbar-color: #49564f transparent; }
.panel.table-wrap { padding: 0; }
.pagination { padding: 14px 4px 0; font-size: var(--font-caption); }
.status, .status-pill, .tag-chip, .runtime-badge, .read-only-badge { font-size: var(--font-caption); font-weight: 500; padding: 3px 7px; border-radius: 5px; }
.player-avatar { border-radius: 8px; background: var(--primary-soft); color: #bce5cf; }
.page-tabs { margin-bottom: 20px; gap: 8px; }
.page-tab { font-weight: 500; padding: 12px 12px; font-size: var(--font-caption); }
.page-tab.active { color: var(--accent); }
.page-tab.active::after { background: var(--accent); right: 8px; left: 8px; }
.page-tab:hover { background: var(--surface-2); }
.context-help-button { width: 22px; height: 22px; min-height: 22px; margin-left: 8px; padding: 0; font-size: var(--font-caption); font-weight: 500; border: 1px solid var(--border-strong); color: var(--muted); background: transparent; }
.context-help-button:hover, .context-help-button:focus-visible { background: var(--primary-soft); color: var(--accent); outline-color: var(--accent); }
#contextHelpText { color: var(--ink); font-size: 14px; line-height: 1.85; }
.health-grid { stroke: var(--line); }
#healthTrend svg text { fill: var(--muted); }
.health-line-0, .telemetry-line-chart svg .series.events { stroke: var(--chart-primary); }
.health-line-1, .telemetry-line-chart svg .series.players { stroke: var(--chart-secondary); }
.health-line-2 { stroke: var(--warning); }
.telemetry-line-chart svg .series.crashes { stroke: var(--chart-danger); }
.chart-key::before, .telemetry-event-dot { background: var(--chart-primary); }
.memory-key::before, .telemetry-player-dot { background: var(--chart-secondary); }
.disk-key::before { background: var(--warning); }
.telemetry-crash-dot { background: var(--chart-danger); }
.host-meter:not(.meter-warning)::-webkit-progress-value { background: var(--chart-primary); }
.host-meter:not(.meter-warning)::-moz-progress-bar { background: var(--chart-primary); }
.distribution-fill, .telemetry-funnel-row:not(.failure) .telemetry-funnel-bar > span, .request-progress { background: linear-gradient(90deg, #3d9878, #83ceb1); }
.status-info::before { background: var(--accent); box-shadow: 0 0 0 4px #83ceb11a; }
.tag-chip, .player-tag-toggle.assigned { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.custom-config-multiselect { border-color: var(--border-strong); background: var(--field); border-radius: 6px; }
.custom-config-toggle-track { background: var(--border-strong); }
.custom-config-toggle-track::after { background: #f2f5f3; }
.custom-config-toggle input:focus-visible + .custom-config-toggle-track { outline-color: var(--accent); }
.json-panel pre, .diagnostic-report-preview textarea { background: var(--field); color: var(--ink); border-color: var(--line); }
.payment-event-list pre, .payment-provider-response pre, .telemetry-occurrence-body pre, .telemetry-sample-card pre, .telemetry-context-grid pre { background: var(--field); }
#notificationsView > .panel + .panel, #invitationsView > .panel + .panel { margin-top: 16px; }

/* Modal surfaces follow the same layer order as the rest of the console. */
.modal-dialog { color: var(--ink); background: var(--panel-gradient); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.modal-dialog::backdrop, .drawer-dialog::backdrop, .editor-dialog::backdrop { background: #080a09b3; backdrop-filter: blur(3px); }
.layer-topbar { background: var(--surface-2); }
.layer-context { color: var(--ink); font-size: var(--font-caption); font-weight: 500; }
.editor-frame { background: var(--panel-gradient); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.editor-dialog-body { padding: 24px; }
.editor-content > .form-actions:last-child { position: sticky; bottom: -24px; margin: 8px -24px -24px; padding: 16px 24px; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px #00000014; z-index: 2; }
.editor-content .configuration-callout { border: 1px solid var(--line); border-radius: 8px; }
.editor-content .configuration-callout .form-actions { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-dialog-body { scroll-padding-block: 16px 88px; }
.draft-indicator { margin-left: auto; color: var(--warning); font-size: var(--font-caption); white-space: nowrap; }
.draft-indicator:not([hidden]) + .layer-close { margin-left: 0; }
#frameRoomConfigSection.advanced-settings, #gameAuthPolicySection.advanced-settings { display: block; padding: 0; margin: 0; overflow: hidden; background: var(--panel-gradient); }
.advanced-settings > summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; list-style: none; cursor: pointer; }
.advanced-settings > summary > span:first-child { display: grid; gap: 3px; min-width: 0; }
.advanced-settings > summary strong { color: var(--ink); font-weight: 550; }
.advanced-settings > summary small { font-size: var(--font-caption); color: var(--muted); font-weight: 400; }
.advanced-settings > summary .disclosure-chevron { margin-left: auto; }
.advanced-settings[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.advanced-settings[open] > summary .disclosure-chevron { transform: rotate(180deg); }
#frameRoomConfigSection > .advanced-settings-body, #gameAuthPolicySection > .advanced-settings-body { display: grid; gap: 16px; padding: 18px; background: var(--inset-gradient); }
#gameAuthPolicyList { background: var(--inset-gradient); }
.advanced-settings-body > div:first-child { display: grid; gap: 6px; }
.advanced-settings.has-unsaved-changes { border-color: var(--warning-line); }
.advanced-settings > summary .section-draft-status { font-size: var(--font-caption); color: var(--warning); white-space: nowrap; }
.advanced-settings .form-actions { flex-wrap: wrap; }
.form-section-heading { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-section-heading strong { color: var(--ink); font-size: 14px; font-weight: 550; }
.form-section-heading span { color: var(--subtle); font-size: var(--font-caption); }
/* Game settings keep one section in view while retaining drafts across sections. */
.game-settings-layout { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 28px; align-items: start; }
.game-settings-nav { position: sticky; top: 0; padding: 4px 16px 4px 0; border-right: 1px solid var(--line); }
#gameSettingsTabs { display: grid; gap: 6px; }
#gameSettingsTabs > button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; font-weight: 500; }
#gameSettingsTabs > button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
#gameSettingsTabs > button[aria-selected="true"] { color: var(--accent); border-color: var(--border-strong); background: var(--success-soft); }
#gameSettingsTabs > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#gameSettingsTabs > button:disabled { opacity: .45; cursor: not-allowed; }
.game-settings-dirty { font-size: var(--font-caption); font-weight: 400; color: var(--warning); white-space: nowrap; }
#gameSettingsCreateHint { margin: 14px 12px 0; font-size: var(--font-caption); line-height: 1.7; }
.game-settings-panes { min-width: 0; min-height: 410px; }
.game-settings-pane { display: grid; gap: 22px; min-width: 0; padding: 4px 0 16px; }
.game-settings-heading { display: grid; gap: 6px; }
.game-settings-heading h3 { margin: 0; font-size: 18px; }
.game-settings-heading p { margin: 0; color: var(--muted); font-size: 14px; }
#gameForm .game-settings-pane label { font-size: 14px; }
#gameForm .game-settings-pane input, #gameForm .game-settings-pane textarea, #gameForm .game-settings-pane select { font-size: 14px; }
#gameForm .game-settings-pane > .configuration-callout, #gameForm .game-settings-pane > .game-icon-editor { display: block; min-width: 0; border: 0; border-radius: 0; padding: 0; background: none; overflow: visible; }
#gameForm .game-settings-pane .advanced-settings-body { display: grid; min-width: 0; gap: 22px; padding: 0; background: none; }
#identityDefinitionList { min-width: 0; }
#identityDefinitionList table { table-layout: fixed; }
#identityDefinitionList th:nth-child(3) { width: 112px; }
#identityDefinitionList th:nth-child(4) { width: 64px; }
#identityDefinitionList th:nth-child(5) { width: 80px; }
#identityDefinitionList td { white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
#identityDefinitionList td:nth-child(3) { font-variant-numeric: tabular-nums; }
#identityDefinitionList td:last-child { text-align: right; }
#playerIdentityChoices .check-label { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#playerIdentityChoices input { flex-shrink: 0; }
#gameForm .game-settings-pane .advanced-settings-body > .panel-heading { display: flex; }
#gameForm .game-settings-pane .section-draft-status { margin-left: 8px; font-size: var(--font-caption); font-weight: 400; color: var(--warning); }
#gameForm .game-settings-pane .form-actions { padding-top: 18px; }
.game-settings-footer { gap: 12px; }
.game-settings-save-hint { margin-right: auto; color: var(--muted); font-size: var(--font-caption); }
@media (max-width: 900px) {
  .game-settings-layout { grid-template-columns: 150px minmax(0,1fr); gap: 20px; }
  #gameSettingsTabs > button { padding-inline: 8px; }
  .game-settings-dirty { font-size: var(--font-caption); }
  #gameForm .form-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  #identityDefinitionList table, #identityDefinitionList tbody { display: block; }
  #identityDefinitionList thead { display: none; }
  #identityDefinitionList tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding: 12px 0; border-bottom: 1px solid var(--line); }
  #identityDefinitionList td { display: block; min-width: 0; padding: 6px 4px; border: 0; }
  #identityDefinitionList td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--font-caption); }
  #identityDefinitionList td:nth-child(1), #identityDefinitionList td:nth-child(2), #identityDefinitionList td:last-child { grid-column: 1 / -1; }
  #identityDefinitionList td:last-child::before { display: none; }
  .game-settings-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .game-settings-nav { z-index: 3; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--panel); }
  #gameSettingsTabs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  #gameSettingsTabs > button { justify-content: center; flex-wrap: wrap; gap: 2px 6px; padding: 8px 4px; }
  .game-settings-panes { min-height: 300px; }
  #gameForm .form-grid.two { grid-template-columns: minmax(0,1fr); }
  .game-settings-save-hint { flex-basis: 100%; order: -1; }
  #gameForm .game-settings-footer { flex-wrap: wrap; }
  #recycleEditingGame { margin-right: auto; }
}
.form-grid { gap: 18px; }
.drawer-frame { background: var(--panel-gradient); border-left: 1px solid var(--border-strong); }
.toast { border-color: var(--border-strong); background: var(--surface-2); color: var(--ink); }
.toast::before { background: var(--subtle); }
.toast.success { background: var(--success-soft); border-color: var(--success-line); }
.toast.error { background: var(--danger-soft); border-color: var(--danger-line); }
.toast.has-action { grid-template-columns: auto minmax(0,1fr) auto auto; }
.toast .toast-action { font-size: var(--font-caption); white-space: nowrap; text-decoration: underline; }
.request-diagnostics-dialog { width: min(780px,calc(100vw - 32px)); padding: 24px; }
.request-diagnostics-dialog textarea { width: 100%; margin-top: 16px; font: var(--font-caption)/1.6 Consolas,monospace; }

/* Select enhancement keeps the native element as the form/API source of truth. */
.ops-select { position: relative; display: inline-grid; width: 100%; min-width: 0; color: var(--ink); font-weight: 400; }
.ops-native-select { position: absolute !important; inset: 0 auto auto 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.ops-select-input { width: 100%; text-overflow: ellipsis; padding-right: 34px; cursor: pointer; }
.ops-select.has-game-icon .ops-select-input { padding-left: 44px; }
.ops-select-game-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ops-select-game-icon .game-icon { width: 26px; height: 26px; border-radius: 7px; font-size: var(--font-caption); }
.ops-select-game-option .game-icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.ops-select-game-option .ops-select-option-copy { flex: 1; }
.ops-select-input:not([readonly]) { cursor: text; }
.ops-select-input[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px #83ceb11f; }
.ops-select-input[aria-invalid="true"] { border-color: var(--danger); }
.ops-select-chevron { position: absolute; right: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ops-select:has([aria-expanded="true"]) .ops-select-chevron { transform: translateY(-50%) rotate(180deg); }
.ops-select-menu { position: fixed; inset: auto; margin: 0; padding: 5px; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--ink); box-shadow: 0 12px 36px #0007; font: 13px/1.5 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; }
.ops-select-menu::backdrop { background: transparent; }
.ops-select-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; min-height: 36px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; white-space: normal; }
.ops-select-option-copy { display: grid; min-width: 0; gap: 3px; }
.ops-select-option-title { font-size: var(--font-caption); line-height: 1.5; }
.ops-select-option-description { color: var(--muted); font: var(--font-caption)/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.ops-select-option mark { padding: 0; background: transparent; color: #c8ebd8; font-weight: 650; text-decoration: underline; text-decoration-color: #83ceb180; text-underline-offset: 3px; }
.ops-select-option[aria-selected="true"] { color: #c8ebd8; }
.ops-select-option[aria-selected="true"]::after { content: "✓"; color: var(--accent); flex-shrink: 0; }
.ops-select-option.is-active { background: #2b4035; color: #eff5f1; }
.ops-select-option:not([aria-disabled="true"]):hover { background: #2b4035; color: #eff5f1; }
.ops-select-option[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.ops-select-group { padding: 10px 10px 4px; color: var(--subtle); font-size: var(--font-caption); }
.ops-select-empty { margin: 0; padding: 18px 10px; text-align: center; color: var(--muted); font-size: var(--font-caption); }
.ops-select-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px 9px; color: var(--subtle); font-size: var(--font-caption); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ops-select-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ops-select-hint > span:first-child { white-space: normal; }
.ops-select .form-error { margin: 6px 0 0; font-size: var(--font-caption); }
.inline-select .ops-select { width: auto; min-width: 140px; }
.health-chart-controls .ops-select { width: 156px; }

.login-shell { background: transparent; }
.login-card { width: min(420px,100%); background: linear-gradient(145deg, #29372e 0%, var(--panel) 62%); border: 1px solid #4b6255; padding: 36px; border-radius: 14px; box-shadow: inset 0 1px 0 #e1eee512, 0 28px 90px #00000066; }
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 26px; box-shadow: none; }
.login-card h1 { font-size: 24px; }
.login-card > .muted { margin-bottom: 26px; }
.login-card .stack-form { gap: 20px; }
.login-card input { min-height: 42px; }
.login-card .wide { margin-top: 4px; min-height: 42px; }
.login-caption { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--subtle); font-size: var(--font-caption); text-align: center; letter-spacing: .05em; }

.server-detail-panel { margin-block: 24px; min-width: 0; }
.server-detail-panel > summary { cursor: pointer; font-size: 15px; font-weight: 650; }
.server-detail-panel > summary > span { margin-left: 14px; font-size: var(--font-caption); font-weight: 400; }
.server-detail-panel[open] > summary { margin-bottom: 20px; }
.server-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.server-facts > div, .health-database-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset-gradient); }
.server-facts dt { margin-bottom: 7px; color: var(--muted); font-size: var(--font-caption); }
.server-facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.server-settings-fields { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; padding: 0; margin: 20px 0; border: 0; min-width: 0; }
.server-settings-fields label, .server-log-filters label { display: grid; gap: 8px; min-width: 0; color: var(--muted); font-size: var(--font-caption); }
.server-settings-fields input { width: 100%; }
.server-log-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.server-log-filters label { flex: 1 1 130px; }
.server-log-filters .server-log-search { flex: 2 1 240px; }
.server-log-filters input, .server-log-filters select { width: 100%; }
.server-log-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.server-log-toolbar .checkbox-row { font-size: var(--font-caption); white-space: nowrap; }
.server-log-entries { min-width: 0; max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--inset-gradient); }
.server-log-line { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.server-log-line:last-child { border-bottom: 0; }
.server-log-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--font-caption); }
.server-log-line pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--font-caption)/1.8 Consolas,"Microsoft YaHei",monospace; color: var(--ink); }
.server-log-level { color: var(--subtle); font-weight: 600; }
.server-log-level.log-error { color: var(--danger); }
.server-log-level.log-warn { color: var(--warning); }
.server-log-level.log-info { color: var(--accent); }
@media (max-width:1100px) {
  .server-facts, .server-settings-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .server-identity { min-width: 0; max-width: calc(100vw - 120px); }
  .server-identity-label { max-width: min(180px, calc(100vw - 160px)); font-size: var(--font-caption); }
  .topbar-main { flex-wrap: wrap; }
  .topbar-main .page-location { display: none; }
  .server-detail-panel > summary > span { display: block; margin: 6px 0 0 18px; }
  .server-facts { gap: 20px 16px; }
  .server-settings-fields { grid-template-columns: minmax(0,1fr); }
  .server-log-filters > button { width: 100%; }
}

/* Give the metrics a full row before the desktop columns become cramped. */
@media (max-width:1400px) {
  .game-row-main { grid-template-columns: minmax(0,1fr) auto; gap: 16px; }
  .game-row-main .workspace-enter { grid-column: 2; grid-row: 1; }
  .game-row-metrics { grid-column: 1 / -1; text-align: left; padding-top: 12px; border-top: 1px solid var(--line); }
}
@media (min-width:761px) and (max-width:1350px) {
  .page-location { display: flex; }
  .topbar { padding-right: 20px; gap: 16px; }
  .topbar-main { gap: 20px; }
  .topbar-right { gap: 10px; }
  .user-badge { max-width: 120px; }
  .content { padding: 26px 24px 48px; }
  .workspace-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:1250px) {
  .workspace-main-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "secondary" "primary"; }
}
@media (min-width:761px) and (max-width:1250px) {
  .workspace-secondary { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (min-width:761px) and (max-width:1100px) {
  .user-badge, .version-badge { display: none; }
  .brand, .sidebar { width: 220px; }
  .sidebar { flex-basis: 220px; }
  .page-location span { max-width: 150px; }
}
@media (max-width:760px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 10px 12px; align-items: center; gap: 8px 12px; }
  .topbar-main { grid-column: 1; gap: 10px; }
  .topbar .brand { display: none; }
  .page-location { display: flex; gap: 4px; }
  .page-location span, .page-location strong { font-size: var(--font-caption); }
  .page-location span { max-width: 140px; }
  .page-location strong::before { margin-right: 4px; }
  .topbar-right { display: contents; }
  .topbar .user-badge { display: none; }
  .game-picker select, .game-picker .ops-select { max-width: none; width: 100%; }
  .timezone-picker { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .timezone-picker select, .timezone-picker .ops-select { width: 100%; }
  .timezone-picker { min-width: 0; }
  #logoutButton { grid-column: 2; grid-row: 1; }
  .mobile-menu-button { width: 32px; height: 32px; min-height: 32px; }
  .sidebar, .sidebar-collapsed .sidebar { top: 0; height: 100dvh; width: min(300px,calc(100vw - 48px)); border-right: 1px solid var(--line); }
  .sidebar-collapsed .nav-search { display: flex; }
  .sidebar-collapsed .nav-search-empty:not([hidden]) { display: block; }
  .sidebar .sidebar-game-scope { display: block; }
  .sidebar .sidebar-game-switch { display: none; }
  .sidebar .nav-section:not(.collapsed) .nav-section-items { margin: 2px 0 4px 18px; padding-left: 9px; border-left: 1px solid var(--line); }
  .sidebar .nav-button { min-height: 40px; }
  .content { padding: 24px 16px 40px; }
  .page-heading { align-items: stretch; gap: 16px; }
  .page-heading .action-row { flex-wrap: wrap; }
  h1, h2 { font-size: 23px; }
  .workspace-stats, .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .workspace-stats { margin-bottom: 24px; }
  .workspace-stats .stat-card, .workspace-stats .stat-card:first-child { padding: 15px; }
  .stat-card { padding: 15px; }
  .stat-card .value { font-size: 25px; }
  #paymentSummaryCards .value { font-size: 24px; }
  .workspace-main-grid, .workspace-secondary { grid-template-columns: minmax(0,1fr); }
  .workspace-games-section .section-heading { align-items: stretch; flex-direction: column; }
  .workspace-games-section .search-compact input { width: 100%; }
  .game-operation-row { padding: 16px; }
  .game-icon-editor-body { align-items: flex-start; }
  .game-icon-presets { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .game-icon-preview-wrap { flex-basis: 56px; }
  .game-icon-preview .game-icon { width: 56px; height: 56px; border-radius: 12px; font-size: 24px; }
  .game-row-detail-body dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .game-row-meta .game-health { font-size: var(--font-caption); }
  .panel { padding: 16px; }
  .workspace-primary .chart-panel { padding: 16px; }
  .panel.table-wrap { padding: 0; }
  .workspace-health-summary { grid-template-columns: minmax(0,1fr); }
  .attention-panel { min-height: 0; }
  .healthy-state { min-height: 100px; }
  .section-heading { align-items: stretch; }
  .search-compact { flex-direction: row; }
  .search-compact input { width: 100%; min-width: 0; }
  .search-compact .muted { white-space: nowrap; }
  .filter-primary-row, .filter-secondary-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-primary-row .search-field, .filter-primary-row > button[type="submit"] { grid-column: 1 / -1; }
  .filter-primary-row label, .filter-secondary-row label, .filter-primary-row .search-field { min-width: 0; }
  .filter-row label { min-width: 0; width: 100%; }
  .player-filter-heading { align-items: stretch; flex-direction: column; }
  .player-filter-heading, .player-filter-panel { padding: 16px; }
  .player-results-toolbar { flex-wrap: wrap; padding-inline: 16px; gap: 8px; }
  .player-workspace > .pagination { flex-wrap: wrap; padding: 12px 16px; }
  .player-workspace > .filter-pending { margin-inline: 16px; }
  .player-workspace > .applied-filters { padding-inline: 16px; }
  .saved-view-controls { gap: 6px; }
  .saved-view-picker { width: 100%; }
  .saved-view-picker > select, .saved-view-picker > .ops-select { width: 100%; min-width: 0; }
  .table-settings { align-self: flex-start; }
  .table-settings-panel { left: auto; right: 0; width: min(280px,calc(100vw - 68px)); }
  .form-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .draft-indicator { font-size: var(--font-caption); }
  .panel-heading { flex-wrap: wrap; }
  .editor-frame { border: 0; border-radius: 0; }
  .editor-dialog-body { padding: 20px 16px; }
  .editor-content > .form-actions:last-child { bottom: -20px; margin: 8px -16px -20px; padding: 14px 16px; flex-wrap: wrap; }
  .form-grid.two, .form-grid.three { grid-template-columns: minmax(0,1fr); }
  .modal-dialog > form, .login-card { padding: 26px; }
}
@media (pointer:coarse) {
  .ops-select-option { min-height: 44px; padding-block: 10px; }
  .ops-select-input { min-height: 44px; }
  .search-clear { min-width: 32px; min-height: 32px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Compact game rows; secondary information expands within its own row. */
.game-management-table { table-layout: fixed; }
.game-management-table th:first-child { width: 36%; }
.game-management-table th:nth-child(2) { width: 10%; }
.game-management-table th:nth-child(3) { width: 27%; }
.game-management-table th:nth-child(4) { width: 27%; }
.game-management-table :is(th,td) { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.game-management-table .game-identity { align-items: flex-start; }
.game-management-table .game-identity-copy { flex: 1; }
.game-configuration-details { margin-top: 8px; }
.game-configuration-details summary, .game-configuration-more summary { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; list-style: none; cursor: pointer; color: var(--muted); font-size: var(--font-caption); }
.game-configuration-details summary::-webkit-details-marker, .game-configuration-more summary::-webkit-details-marker { display: none; }
.game-configuration-details summary::after, .game-configuration-more summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.game-configuration-details[open] > summary::after, .game-configuration-more[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.game-configuration-details summary:hover, .game-configuration-more summary:hover { color: var(--ink); }
.game-configuration-more summary { padding: 6px 8px; border-radius: var(--radius-control); }
.game-configuration-more summary:hover { background: var(--surface-hover); }
.game-configuration-details dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; margin: 12px 0 0; }
.game-configuration-details dl > div { min-width: 0; }
.game-configuration-details dt { color: var(--muted); font-size: var(--font-caption); }
.game-configuration-details dd { margin: 2px 0 0; }
.game-configuration-details p { margin: 12px 0 0; }
.game-configuration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.game-configuration-more[open] { flex-basis: 100%; }
.game-configuration-more .action-row { margin-top: 10px; }
@media(max-width:900px) {
  .game-management-table, .game-management-table tbody, .game-management-table tr, .game-management-table td { display: block; width: 100%; }
  .game-management-table thead { display: none; }
  .game-management-table tr { padding: 16px; border-bottom: 1px solid var(--line); }
  .game-management-table td { padding: 6px 0; border: 0; }
  .game-management-table td[data-label]::before { content: attr(data-label); display: inline-block; margin-right: 12px; color: var(--muted); }
  .game-management-table .game-configuration-actions { margin-top: 6px; }
}
