:root {
  color-scheme: dark;
  --ink: #f2f6f0;
  --muted: #9ca89f;
  --dim: #68736c;
  --canvas: #0b0f0d;
  --panel: #121815;
  --panel-2: #18201c;
  --panel-3: #202a24;
  --line: rgba(221, 235, 221, 0.12);
  --line-strong: rgba(221, 235, 221, 0.22);
  --signal: #ff8a1f;
  --signal-ink: #1b0d00;
  --info: #7eb7ff;
  --warn: #f4bd64;
  --danger: #ff767f;
  --success: #78d39b;
  --radius: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255, 138, 31, .72); outline-offset: 3px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, rgba(255,138,31,.13), transparent 28%), linear-gradient(120deg, #090909 0 60%, #17100b); }
.login-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(18,24,21,.94); box-shadow: var(--shadow); }
.brand-lockup, .staff-card { display: flex; align-items: center; gap: 12px; }
.brand-lockup div, .staff-card div { display: grid; gap: 2px; }
.brand-lockup small, .staff-card small { color: var(--muted); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--signal-ink); background: var(--signal); font-weight: 900; }
.login-card .brand-lockup { margin-bottom: 48px; }
.eyebrow { margin: 0 0 8px; color: var(--signal); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.04; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 23px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
.login-copy { margin-bottom: 28px; color: var(--muted); line-height: 1.55; }
.security-note { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; line-height: 1.5; }
.stack-form { display: grid; gap: 15px; }
label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #0d1210; outline: none; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(255,138,31,.12); }

.button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 14px; background: var(--panel-3); cursor: pointer; font-weight: 720; }
.button:hover { filter: brightness(1.08); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { border-color: transparent; color: var(--signal-ink); background: var(--signal); }
.button.subtle { background: transparent; }
.button.danger { border-color: rgba(255,118,127,.42); color: #ffdadd; background: rgba(255,118,127,.1); }
.button.warn { border-color: rgba(244,189,100,.36); color: #ffdda6; background: rgba(244,189,100,.08); }
.form-status { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 22px 14px 16px; background: #0e1311; }
.sidebar-brand { padding: 0 8px 22px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-group-label { margin: 16px 10px 4px; color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 0; }
.nav-item { display: grid; gap: 2px; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; background: transparent; text-align: left; cursor: pointer; }
.nav-item span { font-weight: 720; }
.nav-item small { color: var(--dim); }
.nav-item:hover { background: var(--panel); }
.nav-item.active { border-color: rgba(255,138,31,.22); color: var(--signal); background: rgba(255,138,31,.08); }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.staff-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--signal-ink); background: var(--signal); font-weight: 850; }
.workspace { min-height: 100vh; margin-left: 248px; padding: 24px 30px 60px; background: radial-gradient(circle at 84% -10%, rgba(126,183,255,.07), transparent 26%), var(--canvas); }
.workspace-topline { min-height: 30px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--dim); font-size: 12px; }
.search-trigger { margin-right: auto; min-height: 34px; padding: 5px 10px; color: var(--muted); }
kbd { border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; color: var(--ink); font-size: 11px; }
.health-pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); }
.health-pill.ok { color: var(--signal); }
.health-pill.error { color: var(--danger); }
.health-section { margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; background: linear-gradient(140deg, rgba(126,183,255,.07), var(--panel)); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.health-grid { margin: 0; }
.health-caption { margin: 12px 0 0; }
.badge.status-healthy { color: var(--success); border-color: rgba(120,211,155,.35); }
.badge.status-degraded { color: var(--warn); border-color: rgba(244,189,100,.35); }
.badge.status-error { color: var(--danger); border-color: rgba(255,118,127,.4); }
.grafana-link::after { content: "↗"; margin-left: 6px; }
.mobile-header { display: none; }

.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 10px; margin-bottom: 22px; }
.metric-card { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); }
.metric-card strong { font-size: 32px; letter-spacing: -.04em; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card small { color: var(--dim); }
.metric-card.signal { border-color: rgba(255,138,31,.3); background: linear-gradient(140deg, rgba(255,138,31,.12), var(--panel)); }
.metric-card small { overflow-wrap: anywhere; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .8fr); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 18px; }
.notice { border-left: 3px solid var(--info); padding: 13px 14px; color: var(--muted); background: rgba(126,183,255,.07); line-height: 1.45; }
.notice.warn { border-color: var(--warn); background: rgba(244,189,100,.07); }
.notice.danger { border-color: var(--danger); background: rgba(255,118,127,.07); }

.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 210px auto; gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--dim); background: #0f1512; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
td { color: #dce4dd; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255,138,31,.045); }
.cell-title { display: grid; gap: 3px; }
.cell-title strong { color: var(--ink); }
.cell-title small { color: var(--dim); }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 11px; }
.badge.role-admin, .badge.role-super { color: var(--warn); border-color: rgba(244,189,100,.3); }
.badge.role-moderator { color: var(--info); border-color: rgba(126,183,255,.3); }
.badge.severity-critical { color: var(--danger); }
.badge.severity-high { color: var(--warn); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.report-filters { display: grid; grid-template-columns: minmax(160px, .8fr) repeat(2, minmax(150px, .7fr)) auto; align-items: end; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.report-filters label > span { margin-bottom: 5px; }
.report-partial { margin-bottom: 18px; }
.report-metrics { margin-bottom: 14px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.report-section { margin: 14px 0; }
.report-section .panel-header small { display: block; margin-top: 4px; color: var(--dim); }
.report-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
.report-stat-grid .metric-card { min-height: 116px; }
.report-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.report-subsection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.report-bars { display: grid; gap: 13px; }
.report-bar { display: grid; gap: 6px; }
.report-bar > div:first-child { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.report-bar > div:first-child span { overflow-wrap: anywhere; }
.report-bar > div:first-child strong { color: var(--ink); }
.report-bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--panel-3); }
.report-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b64f00, var(--signal)); }
.report-error { margin: 14px 0; }
.skeleton { min-height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.feedback-list, .game-list, .audit-list, .provider-list { display: grid; gap: 9px; }
.feedback-item, .game-item, .audit-item, .provider-item { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--panel); }
.feedback-top, .game-top, .provider-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.feedback-item p { margin: 12px 0; color: #d6ded7; line-height: 1.5; white-space: pre-wrap; }
.feedback-meta, .muted { color: var(--dim); font-size: 12px; }
.game-item { display: grid; gap: 12px; }
.game-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-metrics div { padding: 9px; border-radius: 7px; background: var(--panel-2); }
.game-metrics strong, .game-metrics small { display: block; }
.game-metrics small { color: var(--dim); margin-top: 2px; }
.provider-item strong { display: block; }
.provider-item small { color: var(--dim); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: #344039; cursor: pointer; transition: .18s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #d8dfd9; transition: .18s; }
.switch input:checked + span { background: #c55d08; }
.switch input:checked + span::after { transform: translateX(20px); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3,6,4,.74); backdrop-filter: blur(7px); }
.dialog { width: min(720px, 100%); max-height: min(860px, calc(100vh - 40px)); overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.dialog > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); background: rgba(18,24,21,.96); }
.dialog > header h2 { margin: 0; }
#dialogBody { padding: 20px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; font-size: 24px; }
.detail-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-block h3 { margin-bottom: 10px; }
.inline-list { display: grid; gap: 7px; }
.inline-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 7px; background: var(--panel-2); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.danger-zone { margin-top: 22px; border: 1px solid rgba(255,118,127,.25); border-radius: 9px; padding: 15px; background: rgba(255,118,127,.045); }
.danger-zone h3 { color: #ffdadd; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { width: min(390px, calc(100vw - 40px)); border: 1px solid var(--line-strong); border-radius: 9px; padding: 13px 15px; background: var(--panel-3); box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,118,127,.45); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .report-stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 15; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(11,15,13,.94); backdrop-filter: blur(10px); }
  .menu-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: transparent; }
  .mobile-header span { color: var(--muted); font-size: 11px; }
  .workspace { margin-left: 0; padding: 18px 14px 44px; }
  .workspace-topline { display: flex; margin-bottom: 14px; }
  .search-trigger { min-height: 38px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .report-filters { grid-template-columns: 1fr 1fr; }
  .report-filters label:first-child { grid-column: 1 / -1; }
  .report-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .report-two-columns { grid-template-columns: 1fr; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .table-wrap { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 9px; }
  tbody tr { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--panel); }
  tbody td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 7px 0; white-space: normal; }
  tbody td::before { content: attr(data-label); color: var(--dim); font-size: 11px; text-transform: uppercase; }
}
@media (max-width: 440px) {
  .login-card { padding: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; }
  .metric-card strong { font-size: 27px; }
  .report-filters { grid-template-columns: 1fr; }
  .report-filters label:first-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Document layout only. Colours, typography and components use the unmodified
   admin.katka.su stylesheet prepended by render.py. */
.legal-page { display: block; min-width: 0; padding: 0; background-attachment: fixed; }
.site-header, .layout, footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.brand-lockup { color: var(--ink); text-decoration: none; }
.brand-mark { flex: 0 0 auto; }
.site-header .button { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; text-decoration: none; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding-block: 32px 48px; }
.document-nav { position: sticky; top: 24px; align-self: start; display: grid; gap: 4px; font-size: 14px; line-height: 1.5; }
.document-nav a { min-width: 0; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.legal-document { min-width: 0; width: auto; line-height: 1.75; overflow-wrap: anywhere; }
.legal-document h1 { margin-bottom: 28px; line-height: 1.1; }
.legal-document h2 { margin: 40px 0 14px; padding-top: 28px; border-top: 1px solid var(--line); line-height: 1.35; scroll-margin-top: 24px; }
.legal-document h3 { margin: 28px 0 12px; font-size: 18px; line-height: 1.45; }
.legal-document p { margin-bottom: 18px; }
.legal-document .eyebrow { margin-bottom: 12px; }
article { color: #dce4dd; }
article h2, article h3, article strong { color: var(--ink); }
article > p:first-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
article ul, article ol { padding-left: 24px; }
article li { padding-left: 4px; margin-block: 6px; }
article li::marker { color: var(--muted); }
.contents { margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--canvas); font-size: 14px; }
summary { cursor: pointer; font-weight: 650; }
summary::marker { color: var(--signal); }
.toc ul { list-style: none; padding: 0; margin: 14px 0 0; }
.toc li { margin-block: 8px; padding: 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--signal); text-decoration: underline; }
footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-block: 24px 40px; color: var(--muted); font-size: 13px; }
footer a { color: var(--signal); text-underline-offset: 4px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 1; border-radius: 8px; color: var(--signal); background: var(--panel); padding: 12px; }
.skip-link:focus { top: 12px; }
@media (max-width: 760px) {
  .site-header, .layout, footer { width: calc(100% - 32px); }
  .site-header { padding-block: 20px; gap: 12px; }
  .layout { display: block; padding-block: 20px 32px; }
  .document-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
  .document-nav a { padding: 10px; font-size: 13px; }
  .legal-document { padding: 24px; }
  .legal-document h1 { font-size: 30px; }
  .legal-document h2 { font-size: 21px; }
}
@media (max-width: 400px) {
  .brand-lockup small { font-size: 11px; }
  .site-header .button { padding: 9px 10px; font-size: 12px; }
  .document-nav { grid-template-columns: 1fr; gap: 4px; }
  .legal-document { padding: 20px 16px; }
  .legal-document h1 { font-size: 26px; }
}
@media print {
  :root { color-scheme: light; }
  .legal-page { color: black; background: white; font-size: 11pt; }
  .site-header, .document-nav, .contents, .eyebrow, footer, .skip-link { display: none; }
  .layout { display: block; width: 100%; padding: 0; }
  .legal-document { border: 0; border-radius: 0; padding: 0; background: white; box-shadow: none; line-height: 1.5; }
  article, article h2, article h3, article strong, article > p:first-child { color: black; }
  .legal-document h1 { font-size: 22pt; }
  .legal-document h2 { border: 0; padding-top: 0; }
  h2, h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
}
