:root {
    color-scheme: light;
    --aib-bg: #f1f1f6;
    --aib-surface: #e1e2ec;
    --aib-ink: #181825;
    --aib-muted: #48485c;
    --aib-border: #c1c1cf;
    --aib-control-border: #77778a;
    --aib-accent: #4430aa;
    --aib-accent-soft: #f0edfc;
    --aib-on-accent: #ffffff;
    --aib-danger: #a23648;
    --aib-danger-soft: #fff0f3;
    --aib-warning: #775019;
    --aib-warning-soft: #fff7e9;
    --aib-info-soft: #eaf1ff;
    --aib-info: #24599b;
    --aib-success: #17623e;
    --aib-success-soft: #def2e6;
    --aib-medal-gold: #73500b;
    --aib-medal-gold-soft: #f5e6af;
    --aib-medal-silver: #4c5665;
    --aib-medal-silver-soft: #e0e5ed;
    --aib-medal-bronze: #794523;
    --aib-medal-bronze-soft: #efdbca;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --aib-bg: #20222d;
    --aib-surface: #303342;
    --aib-ink: #f5f5ff;
    --aib-muted: #d0d0e2;
    --aib-border: #535568;
    --aib-control-border: #7d8094;
    --aib-accent: #c6b8ff;
    --aib-accent-soft: #302b46;
    --aib-on-accent: #262044;
    --aib-danger: #ffa9b7;
    --aib-danger-soft: #3d252f;
    --aib-warning: #e6c28e;
    --aib-warning-soft: #362d23;
    --aib-info-soft: #23344c;
    --aib-info: #acceff;
    --aib-success: #99e2b4;
    --aib-success-soft: #203e31;
    --aib-medal-gold: #f0d47f;
    --aib-medal-gold-soft: #44391f;
    --aib-medal-silver: #d2dbe8;
    --aib-medal-silver-soft: #36404f;
    --aib-medal-bronze: #edbd96;
    --aib-medal-bronze-soft: #493426;
}
body { margin: 0; background: var(--aib-bg); color: var(--aib-ink); font: 14px/1.55 Arial, Helvetica, sans-serif; overflow-wrap: anywhere; }
a { color: var(--aib-accent); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--aib-accent); }
button, input, select, textarea { font: inherit; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--aib-accent); outline-offset: 3px; }
h1, h2, h3, h4 { color: var(--aib-ink); line-height: 1.35; font-weight: 600; }
h1 { margin: 0; font-size: 25px; letter-spacing: -.5px; }
h2 { margin: 0; font-size: 19px; }
h3, h4 { font-size: 16px; }
p { margin: 0 0 12px; }
.app-shell { max-width: 1280px; min-height: 100vh; margin: auto; display: flex; flex-direction: column; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; min-height: 68px; padding: 0 28px; border-bottom: 1px solid var(--aib-border); }
.site-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--aib-ink); white-space: nowrap; font-size: 23px; font-weight: 800; font-style: italic; letter-spacing: -1.3px; }
a.site-brand:hover, a.site-brand:focus { color: var(--aib-ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; transform: skew(-9deg); background: var(--aib-accent); color: var(--aib-on-accent); font: 700 12px/1 Arial, sans-serif; letter-spacing: 0; }
.user-navigation { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-width: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-nav-link { display: inline-flex; align-items: center; min-height: 68px; padding: 0 4px; border-bottom: 2px solid transparent; color: var(--aib-muted); }
.site-nav-link:hover { text-decoration: none; border-bottom-color: var(--aib-border); }
.site-nav-link.is-active { color: var(--aib-ink); border-bottom-color: var(--aib-accent); }
.site-header > :last-child { margin-left: auto; }
.theme-switch { display: inline-flex; flex: none; gap: 3px; align-items: center; padding: 3px; border: 1px solid var(--aib-control-border); border-radius: 8px; background: var(--aib-surface); }
.theme-option { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--aib-muted); cursor: pointer; }
.theme-option svg { width: 18px; height: 18px; }
.theme-option:hover { background: var(--aib-bg); color: var(--aib-ink); }
.theme-option[aria-pressed="true"] { background: var(--aib-accent); color: var(--aib-on-accent); border-color: var(--aib-accent); }
.account-menu { position: relative; min-width: 0; margin-left: auto; font-size: 13px; }
.account-menu-trigger { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 220px; padding: 8px 12px; border: 1px solid var(--aib-control-border); border-radius: 6px; background: var(--aib-bg); color: var(--aib-ink); cursor: pointer; list-style: none; }
.account-menu-trigger::-webkit-details-marker { display: none; }
.account-menu-trigger > span:not(.visually-hidden) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-trigger svg { flex: none; width: 14px; height: 14px; }
.account-menu-trigger:hover, .account-menu[open] .account-menu-trigger { background: var(--aib-surface); }
.account-menu[open] .account-menu-trigger svg { transform: rotate(180deg); }
.account-menu-dropdown { position: absolute; z-index: 1000; top: calc(100% + 8px); right: 0; width: 224px; max-width: calc(100vw - 36px); padding: 6px; border: 1px solid var(--aib-control-border); border-radius: 8px; background: var(--aib-bg); box-shadow: 0 12px 32px #0003; }
.account-menu-link { display: block; padding: 11px 12px; border-radius: 4px; color: var(--aib-ink); }
.account-menu-link:hover, .account-menu-link:focus-visible, .account-menu-link.is-active { background: var(--aib-accent-soft); color: var(--aib-accent); text-decoration: none; }
.account-menu-link:last-child { border-top: 1px solid var(--aib-border); border-radius: 0 0 4px 4px; margin-top: 4px; }
.page-content { padding: 28px 28px 36px; flex: 1; min-width: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--aib-border); padding: 15px 28px; font-size: 11px; color: var(--aib-muted); }
.page-heading, .page-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-actions { justify-content: flex-start; }
.page-actions-end { justify-content: flex-end; }
.page-back a > span { margin-right: 3px; }
.page-back { font-size: 12px; margin-bottom: 16px; }
.tournament-heading h1 { margin-bottom: 20px; }
.heading-detail { display: block; color: var(--aib-muted); font-size: 14px; font-weight: 400; margin-top: 7px; }
.aib-nav-pills::before, .aib-nav-pills::after { display: none; }
.aib-nav-pills { padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 24px; border-bottom: 1px solid var(--aib-border); margin-bottom: 24px; }
.aib-nav-pills > li { float: none; margin: 0; }
.aib-nav-pills > li + li { margin: 0; }
.aib-nav-pills > li > a { color: var(--aib-muted); border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 0; margin-bottom: -1px; }
.aib-nav-pills > li > a:hover, .aib-nav-pills > li > a:focus { background: transparent; color: var(--aib-accent); }
.aib-nav-pills > li > a[aria-current="page"], .aib-nav-pills > li.active > a, .aib-nav-pills > li.active > a:hover, .aib-nav-pills > li.active > a:focus { background: transparent; color: var(--aib-accent); border-bottom-color: var(--aib-accent); }
.home-tournaments > .page-heading { margin-bottom: 24px; }
.home-tournaments h1 { font-size: 30px; }
.tournament-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tournament-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; min-height: 254px; padding: 28px; border: 1px solid transparent; border-radius: 8px; background: var(--aib-surface); color: var(--aib-ink); }
.tournament-entry:hover, .tournament-entry:focus { color: var(--aib-ink); border-color: var(--aib-accent); text-decoration: none; }
.tournament-mark { display: grid; place-items: center; min-width: 46px; height: 36px; padding: 0 8px; border-radius: 4px; background: var(--aib-accent-soft); color: var(--aib-accent); font: 600 13px ui-monospace, Consolas, monospace; letter-spacing: .6px; }
.tournament-summary { display: grid; gap: 10px; }
.tournament-summary h2 { font-size: 24px; font-weight: 600; letter-spacing: -.4px; }
.tournament-summary p { margin: 0; color: var(--aib-muted); font-size: 14px; line-height: 1.65; }
.tournament-open { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 4px; color: var(--aib-accent); font-size: 14px; font-weight: 600; }
.tournament-open svg { display: block; flex: none; }
.home-news { display: grid; grid-template-columns: 160px minmax(0, 760px); gap: 32px; margin-top: 48px; }
.news-heading h2 { font-size: 19px; }
.news-heading .btn { margin-top: 16px; }
.news-list { display: grid; gap: 28px; min-width: 0; }
.news-entry { display: grid; gap: 8px; min-width: 0; font-size: 13px; line-height: 1.75; }
.news-entry > div { min-width: 0; }
.news-entry > div > :last-child { margin-bottom: 0; }
.news-entry time { color: var(--aib-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.news-entry a { text-decoration: underline; }
.news-entry img, .tournament-description img { max-width: 100%; height: auto; }
.description-heading { margin-bottom: 16px; }
.tournament-description a { overflow-wrap: anywhere; text-decoration: underline; }
.tournament-description { max-width: 720px; line-height: 1.8; }
.tournament-description pre { overflow: auto; }
.section-heading { margin: 26px 0 14px; }
.inline-note { margin: 14px 0; color: var(--aib-muted); }
.system-bot-choices { min-width: 0; margin: 0; padding: 0; border: 0; }
.system-bot-choices legend { border: 0; color: var(--aib-ink); }
.system-bot-choices .checkbox label { padding-top: 8px; padding-bottom: 8px; }
.system-bot-choices label .inline-note { display: block; margin: 4px 0 0; }
.system-bot-choice + .system-bot-choice { margin-top: 12px; }
.system-bot-choice .invite-active-choice { align-items: flex-start; }
.run-summary { padding-bottom: 16px; border-bottom: 1px solid var(--aib-border); }
.table-responsive { width: 100%; margin-bottom: 20px; border: 0; overflow: auto; }
.table { margin: 0; font-size: 13px; line-height: 1.4; color: var(--aib-ink); }
.table > thead > tr > th { color: var(--aib-ink); font-weight: 600; background: var(--aib-surface); border-top: 1px solid var(--aib-border); border-bottom: 1px solid var(--aib-border); padding: 7px 10px; }
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td { border-top: 0; border-bottom: 1px solid var(--aib-border); padding: 7px 10px; vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--aib-surface); }
.table-hover > tbody > tr:hover { background: var(--aib-accent-soft); }
.table > tbody > tr.danger > td, .table > tbody > tr > td.danger, .table-hover > tbody > tr.danger:hover > td { background: var(--aib-danger-soft); color: var(--aib-danger); }
.table > tbody > tr.success > td, .table > tbody > tr > td.success { background: var(--aib-accent-soft); color: var(--aib-ink); }
.table > tbody > tr.info > td, .table > tbody > tr > td.info { background: var(--aib-info-soft); color: var(--aib-ink); }
.table-hover > tbody > tr.success:hover > td { background: var(--aib-accent-soft); }
.table-hover > tbody > tr.info:hover > td { background: var(--aib-info-soft); }
.table-cp tbody tr { cursor: pointer; }
.table-responsive > .table > :is(thead, tbody, tfoot) > tr > :is(th, td) { white-space: normal; }
.table .btn { min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.bot-status { display: inline-block; max-width: 100%; padding: 3px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.4; vertical-align: middle; }
.bot-status-new { color: var(--aib-accent); background: var(--aib-accent-soft); }
.bot-status-progress { color: var(--aib-warning); background: var(--aib-warning-soft); }
.bot-status-ready { color: var(--aib-success); background: var(--aib-success-soft); }
.bot-status-error { color: var(--aib-danger); background: var(--aib-danger-soft); }
.bot-status-frozen { color: var(--aib-info); background: var(--aib-info-soft); }
:root:not([data-theme="dark"]) .bot-status { font-size: 13px; }
:root:not([data-theme="dark"]) .bot-status-new { color: #38266b; }
:root:not([data-theme="dark"]) .bot-status-progress { color: #66430f; }
:root:not([data-theme="dark"]) .bot-status-ready { color: #124b2e; }
:root:not([data-theme="dark"]) .bot-status-error { color: #812033; }
:root:not([data-theme="dark"]) .bot-status-frozen { color: #1e467d; }
.run-results { min-width: 0; max-width: 100%; }
.run-results-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
.run-results-progress { flex-basis: 100%; height: 5px; margin-top: 2px; overflow: hidden; border-radius: 4px; background: var(--aib-surface); }
.run-results > section { margin-top: 28px; }
.run-results-progress > .progress-bar { height: 100%; border-radius: 4px; background: var(--aib-accent); box-shadow: none; }
.run-results-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.run-results-section-heading h2 { margin: 0; }
.run-results-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.run-results-filters .form-field { display: flex; flex: 0 1 270px; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 0; font-size: 12px; }
.run-results-filters select.form-control { width: 100%; min-width: 0; height: 36px; padding: 6px 8px; }
.run-results-reset { display: inline-flex; align-items: center; align-self: flex-end; min-height: 36px; white-space: nowrap; }
.run-results-filter-note { margin: -4px 0 12px; }
.run-results .table-responsive { min-width: 0; max-width: 100%; overflow-x: auto; }
.run-results .table > thead > tr > th { font-weight: 400; }
.run-results .table-responsive > .run-results-standings { min-width: 540px; }
.run-results .table-responsive > .run-results-games { min-width: 600px; }
.run-results-identity { display: block; margin-top: 3px; color: var(--aib-muted); font-size: 12px; overflow-wrap: anywhere; }
.run-results-self { margin-left: 7px; color: var(--aib-accent); font-size: 11px; white-space: nowrap; }
.run-results-game-id { white-space: nowrap; font-variant-numeric: tabular-nums; }
.run-results-bot { display: inline; margin: 0 0 0 8px; white-space: nowrap; }
.run-results-match { display: flex; flex-direction: column; gap: 4px; min-width: 240px; max-width: 420px; }
.run-results-player { display: flex; align-items: baseline; gap: 8px; }
.run-results-player-name { min-width: 0; overflow-wrap: anywhere; }
.run-results-player > .run-results-score { flex: none; min-width: 24px; padding: 1px 6px; border-radius: 4px; background: var(--aib-surface); text-align: center; }
.run-results-score { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-results-winner { color: var(--aib-ink); font-weight: 600; }
.run-results-winner-icon { flex: none; align-self: center; display: inline-flex; color: var(--aib-muted); }
.run-results-winner-icon svg { width: 16px; height: 16px; }
.run-results-place { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.run-results-medal { position: relative; width: 24px; border: 1px solid currentColor; border-radius: 50%; margin-bottom: 3px; }
.run-results-medal::after { content: ""; position: absolute; bottom: -3px; left: 7px; width: 8px; height: 4px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 65%, 0 100%); }
.run-results-medal-gold { color: var(--aib-medal-gold); background: var(--aib-medal-gold-soft); }
.run-results-medal-silver { color: var(--aib-medal-silver); background: var(--aib-medal-silver-soft); }
.run-results-medal-bronze { color: var(--aib-medal-bronze); background: var(--aib-medal-bronze-soft); }
.run-results-outcome { max-width: 100%; }
.run-results .table > tbody > tr.run-results-own > td { color: var(--aib-ink); background: var(--aib-accent-soft); }
.run-results .table > tbody > tr > td.run-results-empty { padding: 30px 12px; color: var(--aib-muted); text-align: center; }
.run-results-empty strong { display: block; margin-bottom: 6px; color: var(--aib-ink); font-weight: 400; }
.form-grid { margin-bottom: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; max-width: 900px; }
.form-field { min-width: 0; }
.form-field-wide { grid-column: 1 / -1; }
.form-field > label, label.form-field, .form-field-label { display: block; font-weight: 400; margin-bottom: 6px; }
.form-field label .form-control { margin-top: 6px; }
.form-field > label { width: 100%; }
input.form-control, select.form-control, textarea.form-control, .form-control[disabled], .form-control[readonly] { background: var(--aib-bg); color: var(--aib-ink); border: 1px solid var(--aib-control-border); border-radius: 4px; box-shadow: none; transition: none; min-height: 36px; height: auto; }
.form-control[disabled], .form-control[readonly] { background: var(--aib-surface); opacity: 1; }
.form-control::placeholder { color: var(--aib-muted); opacity: 1; }
.form-control:focus { border-color: var(--aib-accent); box-shadow: none; }
textarea.form-control { resize: vertical; }
input.required, textarea.required { border-left-color: var(--aib-control-border); }
.form-feedback, .feedbackPanelERROR { color: var(--aib-danger); list-style: none; }
.form-feedback:empty, .form-feedback:not(:has(li)) { display: none; }
.form-feedback ul { padding: 0; margin: 8px 0; list-style: none; }
.auth-main { flex: 1; padding: clamp(40px, 9vh, 96px) 24px 64px; }
.auth-content { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-content:has(.auth-register) { max-width: 520px; }
.auth-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--aib-border); margin-bottom: 32px; }
.auth-tabs > * { padding: 0 0 13px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--aib-muted); }
.auth-tabs > [aria-current] { color: var(--aib-accent); border-bottom-color: var(--aib-accent); }
.auth-tabs > a:hover { color: var(--aib-accent); text-decoration: none; border-bottom-color: var(--aib-border); }
.auth-panel h1 { font-size: 28px; margin-bottom: 9px; }
.auth-description { color: var(--aib-muted); margin: 0 0 28px; }
.auth-form, .auth-optional-fields { display: grid; gap: 20px; }
.auth-form .form-field > label { margin: 0; font-size: 14px; }
.auth-form .form-control { min-height: 46px; padding: 10px 12px; font-size: 16px; margin-top: 8px; }
.auth-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.invite-code-input[data-enhanced] .invite-code-fallback { display: none; }
.invite-code-input fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.invite-code-input legend { margin: 0 0 8px; border: 0; color: var(--aib-ink); font-size: 14px; font-weight: 600; }
.invite-code-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 12px repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 420px; align-items: center; }
.auth-form .invite-code-character { width: 100%; min-width: 0; margin: 0; padding: 10px 0; text-align: center; font-family: monospace; font-size: 20px; text-transform: uppercase; }
.invite-code-separator { text-align: center; color: var(--aib-muted); }
.auth-form .auth-submit { min-height: 46px; font-size: 15px; margin-top: 4px; }
.auth-optional { border-top: 1px solid var(--aib-border); padding-top: 16px; }
.auth-optional summary { display: list-item; list-style: disclosure-closed inside; cursor: pointer; min-height: 28px; }
.auth-optional[open] summary { list-style-type: disclosure-open; }
.auth-optional summary span { color: var(--aib-muted); font-size: 12px; margin-left: 6px; }
.auth-optional-fields { padding-top: 16px; }
.auth-feedback { padding: 12px 16px; background: var(--aib-danger-soft); border-left: 3px solid var(--aib-danger); }
.auth-feedback ul { margin: 0; }
.auth-notice { margin-bottom: 24px; }
.btn, .aib-btn { min-height: 36px; border-radius: 4px; padding: 7px 12px; font-size: 13px; font-weight: 400; white-space: normal; box-shadow: none; }
.btn-default, .btn-default:active, .btn-default:focus, .btn-default.active, .open > .dropdown-toggle.btn-default { color: var(--aib-ink); border-color: var(--aib-control-border); background: var(--aib-bg); }
.btn-default:hover { color: var(--aib-ink); border-color: var(--aib-control-border); background: var(--aib-surface); }
.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-success, .btn-success:hover, .btn-success:focus { background: var(--aib-accent); border-color: var(--aib-accent); color: var(--aib-on-accent); }

.btn-link, .btn-link:hover, .btn-link:focus { color: var(--aib-accent); }
.dropdown-menu { color: var(--aib-ink); background: var(--aib-bg); border-color: var(--aib-border); box-shadow: 0 3px 12px #0002; }
.dropdown-menu > li > a { color: var(--aib-ink); }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--aib-accent-soft); color: var(--aib-ink); }
.dropdown-menu .divider { background: var(--aib-border); }
.label-success, .label-primary, .label-info { background: var(--aib-accent-soft); color: var(--aib-accent); }
.label-default { background: var(--aib-surface); color: var(--aib-muted); }
.alert { border-radius: 0; border: 0; border-left: 3px solid; padding: 13px 16px; }
.alert-info, .alert-success { color: var(--aib-accent); background: var(--aib-accent-soft); }
.alert-warning { color: var(--aib-warning); background: var(--aib-warning-soft); }
.alert-danger { color: var(--aib-danger); background: var(--aib-danger-soft); }
.alert a { color: inherit; text-decoration: underline; }
.close { opacity: .8; color: inherit; text-shadow: none; }
.close:hover, .close:focus { opacity: 1; color: inherit; }
.aib-bot-editor-results .alert-dismissible { position: relative; min-height: 48px; padding-right: 56px; }
.aib-bot-editor-results .alert-dismissible > .close { position: absolute; top: 2px; right: 4px; display: grid; place-items: center; float: none; width: 44px; height: 44px; padding: 0; line-height: 1; }
.progress { background: var(--aib-surface); border-radius: 0; box-shadow: none; }
.progress-bar { background: var(--aib-accent); color: var(--aib-on-accent); box-shadow: none; }
pre, code { color: var(--aib-ink); background: var(--aib-surface); border-color: var(--aib-border); }
hr { border-color: var(--aib-border); }
.tbl-row-remove { display: inline-block; }
.settings-list-button { margin-left: 10px; }
.settings-form .row { margin: 0; }
.aib-participant-editor-fields { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.aib-participant-editor-field { flex: 1 1 200px; min-width: 0; }
.aib-participant-editor-field label { font-weight: 400; }
.white-tile { background: var(--aib-bg); padding: 24px; }
.padding-col { padding: 0; }
.copyright { display: block; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--aib-border); font-size: 11px; color: var(--aib-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 10px; top: -100px; z-index: 2000; padding: 10px; background: var(--aib-bg); }
.skip-link:focus { top: 10px; }
.loading { display: none; position: fixed; inset: 0; z-index: 999; background: #10101acc; color: white; text-align: center; padding-top: 45vh; }
.loading::after { content: ''; display: block; width: 28px; height: 28px; margin: 12px auto; border: 3px solid #ffffff55; border-top-color: white; border-radius: 50%; animation: aib-spin .8s linear infinite; }
@keyframes aib-spin { to { transform: rotate(360deg); } }
/* Match Bootstrap's state specificity so controls remain themed during interaction. */
.btn.btn-default:is(:hover, :focus, :active, .active), .open > .btn.btn-default.dropdown-toggle {
    color: var(--aib-ink); background: var(--aib-surface); border-color: var(--aib-control-border); box-shadow: none;
}
.btn.btn-primary:is(:hover, :focus, :active, .active), .btn.btn-success:is(:hover, :focus, :active, .active) {
    color: var(--aib-on-accent); background: var(--aib-accent); border-color: var(--aib-accent); box-shadow: none;
}
.btn:is([disabled], .disabled), .btn:is([disabled], .disabled):is(:hover, :focus, :active) {
    color: var(--aib-muted); background: var(--aib-surface); border-color: var(--aib-border); opacity: 1; cursor: not-allowed;
}
.dropdown-menu { padding: 5px; min-width: 180px; border-radius: 4px; box-shadow: 0 8px 24px #00000018; }
.dropdown-menu > li > a { padding: 9px 12px; border-radius: 2px; }
.dropdown-header { color: var(--aib-muted); padding: 7px 12px; font-size: 12px; }
.dropdown-menu > .active > a, .dropdown-menu > .active > a:is(:hover, :focus) { color: var(--aib-accent); background: var(--aib-accent-soft); }
.aib-pagination-cell { padding: 12px 0 !important; border-bottom: 0 !important; }
.aib-paging { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; margin: 12px 0; font-size: 12px; }
.aib-paging-summary { color: var(--aib-muted); font-variant-numeric: tabular-nums; white-space: normal; text-align: right; }
.aib-paging-controls { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.aib-paging .btn.aib-paging-button { display: inline-flex; justify-content: center; align-items: center; min-width: 32px; min-height: 32px; padding: 4px 8px; font-size: 12px; line-height: 1.5; }
.aib-paging .btn.aib-paging-arrow { width: 32px; padding: 0; font-size: 18px; }
.aib-paging .aib-paging-button[aria-current="page"], .aib-paging .aib-paging-button[aria-current="page"]:is(:hover, :focus, :active) { color: var(--aib-on-accent); background: var(--aib-accent); border-color: var(--aib-accent); }
.aib-paging:focus { outline: none; }
.aib-pagination-cell .aib-paging { margin: 0; }
.text-muted, .help-block { color: var(--aib-muted); }
.text-success, .text-info { color: var(--aib-accent); }
.text-danger { color: var(--aib-danger); }
.page-heading > .dropdown .dropdown-menu, .page-actions-end > .dropdown .dropdown-menu { left: auto; right: 0; }
.run-facts { display: flex; flex-wrap: wrap; gap: 24px 64px; padding: 0 0 22px; margin: 0; border-bottom: 1px solid var(--aib-border); }
.run-facts > div { display: grid; gap: 5px; }
.run-facts dt { color: var(--aib-muted); font-size: 12px; font-weight: 400; }
.run-facts dd { margin: 0; font-size: 14px; }
.table-responsive > .table > thead > tr > th { white-space: nowrap; overflow-wrap: normal; }
.table-scroll-hint { display: none; }
.aib-table td { overflow-wrap: break-word; }
.aib-table td:first-child { font-variant-numeric: tabular-nums; }
.btn:focus-visible { outline: 2px solid var(--aib-accent); outline-offset: 3px; }
.btn:focus:not(:focus-visible) { outline: none; }
.btn .glyphicon { margin-right: 4px; font-size: 11px; }
@media (max-width: 767px) {
    .table-scroll-hint { display: block; font-size: 12px; color: var(--aib-muted); margin: 0 0 10px; }
    .site-header { padding: 14px 18px; gap: 14px; }
    .user-navigation { order: 3; flex-basis: 100%; gap: 8px 16px; }
    .site-nav { flex: 1 1 160px; gap: 0 20px; }
    .site-nav-link { min-height: 44px; padding: 8px 0; }

    .account-menu-dropdown { right: 0; }
    .theme-option { width: 44px; height: 44px; }
    .page-content { padding: 22px 18px; }
    h1 { font-size: 23px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .home-tournaments h1 { font-size: 26px; }
    .tournament-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .tournament-entry { min-height: 224px; padding: 22px; gap: 16px; }
    .tournament-summary h2 { font-size: 22px; }
    .home-news { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 36px; }
    .table-responsive { overflow-y: visible; }
    .table-responsive .table { min-width: 540px; }
    .run-results .table-responsive > .run-results-standings { min-width: 540px; }
    .run-results .table-responsive > .run-results-games { min-width: 600px; }
    .btn, .site-nav-link, .aib-nav-pills > li > a { min-height: 44px; }
    .table .btn { min-height: 44px; }
    .form-control { font-size: 16px; }
    .run-results-filters .form-field { flex: 1 1 100%; }
    .run-results-filters .form-control, .run-results-reset, .run-results .table .btn,
    .run-results-standings a { min-height: 44px; }
    .aib-paging .btn.aib-paging-button { min-width: 44px; min-height: 44px; }
    .aib-pagination-cell .aib-paging { width: calc(100vw - 36px); max-width: 100%; margin-inline: 0; }
    .run-results-standings a { display: inline-flex; align-items: center; }
    .auth-main { padding: 32px 20px 48px; }
    .auth-tabs { margin-bottom: 28px; }
    .auth-tabs > * { padding-top: 6px; min-height: 44px; }
    .auth-panel h1 { font-size: 25px; }
    .auth-description { max-width: 310px; }
    .auth-field-pair { grid-template-columns: minmax(0, 1fr); }
    .auth-optional summary { padding: 8px 0; }
    .site-footer { padding: 15px 18px; }
    .white-tile { padding: 18px; }
    .container { width: 100%; }
}
@media (max-width: 400px) {
    .auth-header { gap: 12px; }
    .auth-header .site-brand { font-size: 20px; }
    .auth-optional summary span { display: block; margin-left: 16px; }
    .site-nav { gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.news-admin-list { display: grid; gap: 20px; max-width: 900px; }
.news-editor, .news-preview { max-width: 900px; }
.news-preview { margin-top: 20px; }
.news-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.news-admin-list .btn { justify-self: start; text-decoration: none; }
.news-feedback { color: var(--aib-danger); overflow-wrap: anywhere; }
.news-feedback ul { padding-left: 20px; }
.markdown-content { overflow-wrap: anywhere; min-width: 0; overflow-x: auto; }
.markdown-content pre { overflow-x: auto; max-width: 100%; }
.markdown-content table { border-collapse: collapse; margin-bottom: 12px; }
.markdown-content th, .markdown-content td { border: 1px solid var(--aib-control-border); padding: 7px 10px; }
.markdown-content th { font-weight: 600; }

.tournament-overview .tournament-overview-about { max-width: 670px; margin-bottom: 30px; }
.tournament-overview .overview-description { margin-bottom: 14px; color: var(--aib-muted); font-size: 15px; line-height: 1.65; }
.tournament-overview .overview-instructions { display: inline-flex; align-items: center; min-height: 28px; }
.tournament-overview .tournament-table-section { min-width: 0; margin-bottom: 28px; }
.tournament-overview .tournament-table-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.tournament-table-section .table-primary { font-weight: 400; }
.tournament-table-section .table > thead > tr > th { font-weight: 400; color: var(--aib-muted); }
.tournament-table-section .table-meta { display: inline; margin-top: 0; color: var(--aib-muted); font-size: 12px; line-height: 1.5; }
.tournament-runs .table-meta { display: block; margin-top: 3px; }
.tournament-table-section .table-version { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--aib-surface); color: var(--aib-muted); font-size: 12px; font-weight: 400; }
.tournament-table-section .table-comment { display: inline; color: var(--aib-muted); font-size: 12px; overflow-wrap: anywhere; }
.tournament-table-section .table-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.tournament-table-section .table-winners { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12px; line-height: 1.5; color: var(--aib-muted); overflow-wrap: anywhere; }
.tournament-table-section .norecords-td { height: 112px; background: var(--aib-surface); text-align: center; color: var(--aib-muted); white-space: normal; }
.tournament-table-section .tournament-run-row { cursor: pointer; }
.tournament-table-section .tournament-run-row:focus-within { background: var(--aib-accent-soft); }
.tournament-table-section .tournament-run-row:focus-visible { outline: 2px solid var(--aib-accent); outline-offset: -2px; }
.tournament-table-section .table-responsive > table { min-width: 620px; }
.tournament-table-section .table-responsive > table:has(.norecords-td) { min-width: 0; table-layout: fixed; }
.tournament-table-section .table-responsive > table:has(.norecords-td) > thead > tr > th { white-space: normal; overflow-wrap: anywhere; }
.tournament-table-section:has(.norecords-td) :is(.table-scroll-hint, .run-row-hint) { display: none; }
.tournament-participants .participant-bot { color: var(--aib-muted); white-space: nowrap; }
.tournament-participants .participant-updated { color: var(--aib-ink); }
.tournament-participants .participant-frozen { margin-left: 6px; }
.tournament-participants td:first-child { width: 48%; }
.tournament-my-bots td:first-child { width: 44%; }
.tournament-my-bots td:last-child { width: 250px; min-width: 250px; }
.tournament-runs td:first-child { min-width: 290px; }
.tournament-runs td:nth-child(2) { min-width: 130px; }
.tournament-runs td:nth-child(3) { min-width: 240px; }
.tournament-overview .tournament-table-heading h2 { margin: 0; font-size: 18px; }
.tournament-overview .tournament-table-heading .form-field { margin: 0; }
.tournament-overview .tournament-runs td a, .tournament-overview .tournament-participants td a { display: inline-flex; align-items: center; min-height: 28px; }
.tournament-overview .bot-create-menu { position: relative; max-width: 100%; }
.tournament-overview .bot-create-menu > summary { display: inline-flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.tournament-overview .bot-create-menu > summary::-webkit-details-marker { display: none; }
.tournament-overview .bot-create-menu[open] > summary .caret { transform: rotate(180deg); }
.tournament-overview .bot-language-menu { position: absolute; z-index: 100; top: calc(100% + 6px); right: 0; width: 260px; max-width: calc(100vw - 80px); padding: 6px; border: 1px solid var(--aib-control-border); border-radius: 6px; background: var(--aib-bg); box-shadow: 0 8px 24px #0002; }
.tournament-overview .bot-language-menu > p { padding: 7px 10px; color: var(--aib-muted); font-size: 12px; }
.tournament-overview .bot-language-menu ul { margin: 0; padding: 0; list-style: none; }
.tournament-overview .bot-language-menu li a { display: block; padding: 9px 10px; border-radius: 4px; color: var(--aib-ink); }
.tournament-overview .bot-language-menu li a:hover, .tournament-overview .bot-language-menu li a:focus-visible { background: var(--aib-accent-soft); color: var(--aib-accent); text-decoration: none; }
.tournament-overview .bot-language-menu li a:focus-visible { outline-offset: -2px; }
@media (max-width: 767px) {
    .tournament-overview .overview-instructions, .tournament-overview .bot-create-menu > summary,
    .tournament-overview .bot-language-menu li a, .tournament-overview .tournament-runs td a,
    .tournament-overview .tournament-participants td a { min-height: 44px; }
}

/* Shared native dialogs for games and bounded event inspection. */
.aib-inspection-dialog { width: min(1120px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 16px; border: 1px solid var(--aib-control-border); border-radius: 8px; background: var(--aib-bg); color: var(--aib-ink); overflow: auto; overscroll-behavior: contain; }
.aib-inspection-dialog::backdrop { background: #0008; }
.aib-inspection-content { min-width: 0; }
.aib-inspection-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.aib-inspection-header > div { min-width: 0; }
.aib-inspection-header h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.aib-inspection-header h3 { margin: 0; font-size: 13px; }
.aib-inspection-header .btn { flex-shrink: 0; }
.aib-inspection-dialog .btn { min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 18px; }
.aib-inspection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 0; }
.aib-inspection-actions:empty { display: none; }
.aib-inspection-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; font-size: 12px; }
.aib-inspection-filters label { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-weight: normal; }
.aib-inspection-filters select, .aib-inspection-filters input.form-control { width: auto; max-width: 260px; min-width: 120px; min-height: 30px; height: 30px; padding: 3px 8px; border: 1px solid var(--aib-control-border); border-radius: 4px; background: var(--aib-bg); color: var(--aib-ink); font-size: 12px; }
.aib-log-type-pages { display: inline-flex; gap: 8px; }
.aib-inspection-dialog p:empty, .aib-inspection-dialog [role="alert"]:empty { display: none; }
.aib-inspection-error { color: var(--aib-danger); }
.aib-inspection-dialog .table-responsive { margin: 8px 0; }
.aib-log-events { width: 100%; table-layout: fixed; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.aib-log-events th:first-child { width: 76px; }
.aib-log-events th:nth-child(2) { width: 170px; }
.aib-log-events.table > tbody > tr.aib-log-event > td { padding: 0 8px; height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aib-log-event { cursor: pointer; }
.aib-log-event:hover, .aib-log-event:focus-within, .aib-log-event:has([aria-expanded="true"]) { background: var(--aib-accent-soft); }
.aib-log-event td:first-child { color: var(--aib-muted); }
.aib-log-event [data-game-log-open] { display: block; padding: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--aib-ink); text-decoration: none; }
.aib-log-event [data-game-log-open]:focus-visible { outline-offset: -2px; }
.aib-log-preview code { padding: 0; background: transparent; color: inherit; font: inherit; }
.aib-log-events.table > tbody > tr.aib-log-expanded > td { padding: 0; white-space: normal; }
.aib-log-detail { padding: 10px; border-left: 2px solid var(--aib-accent); background: var(--aib-surface); overflow-wrap: anywhere; }
.aib-game-log pre { max-height: 420px; overflow: auto; margin: 8px 0 0; padding: 8px; border: 1px solid var(--aib-border); border-radius: 4px; background: var(--aib-bg); color: var(--aib-ink); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; font-size: 12px; }
.aib-game-log .inline-note { margin: 4px 0; font-size: 12px; }
.aib-game-comment { white-space: pre-line; }
.aib-run-history[open] { display: flex; flex-direction: column; overflow: hidden; }
.aib-run-history .aib-inspection-header { flex: none; }
.aib-run-history .aib-history-body { min-height: 0; padding: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.aib-run-history .aib-inspection-filters input { width: 130px; }
.aib-history-result { min-width: 150px; }
.aib-history-result .inline-note { display: block; margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.aib-compact-table { font-size: 12px; }
.aib-compact-table p { margin: 0; }
@media (max-width: 767px) {
    .aib-inspection-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 10px; }
    .aib-inspection-header { flex-wrap: wrap; }
    .aib-inspection-header h2 { font-size: 18px; }
    .aib-inspection-dialog .btn, .aib-inspection-dialog select, .aib-inspection-dialog input.form-control, .aib-inspection-dialog a { min-height: 44px; }
    .aib-inspection-dialog a { display: inline-flex; align-items: center; }
    .aib-inspection-filters label { flex: 1 1 100%; justify-content: space-between; }
    .aib-inspection-filters select { max-width: 185px; }
    .aib-log-event [data-game-log-open] { display: block; line-height: 34px; }
    .aib-log-events.table > tbody > tr.aib-log-event > td { height: 44px; }
}

.invite-section legend { color: var(--aib-ink); border-color: var(--aib-border); font-size: 16px; margin-bottom: 12px; }
.invite-tournament-choice { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 8px; }
.invite-tournament-choice label { margin: 0; padding: 10px 0; min-height: 44px; font-weight: 400; }
.invite-active-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-weight: 400; cursor: pointer; }
.invite-tournament-choice label { cursor: pointer; }
.invite-section input[type="checkbox"] { appearance: none; -webkit-appearance: none; display: inline-grid; place-content: center; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; border: 1px solid var(--aib-control-border); border-radius: 4px; background: var(--aib-bg); cursor: pointer; }
.invite-section input[type="checkbox"]:checked { background: var(--aib-accent); border-color: var(--aib-accent); }
.invite-section input[type="checkbox"]::after { content: ""; width: 6px; height: 11px; border: solid var(--aib-on-accent); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); opacity: 0; }
.invite-section input[type="checkbox"]:checked::after { opacity: 1; }
.invite-section input[type="checkbox"]:disabled { cursor: default; opacity: .6; }

.admin-list-heading { margin-top: 28px; }
.admin-table [data-edit-url] { cursor: pointer; }
.admin-table [data-edit-url]:hover { background: var(--aib-accent-soft); }
.admin-table [data-edit-url]:focus-visible { outline: 2px solid var(--aib-accent); outline-offset: -2px; }
.admin-table .admin-empty { height: 112px; text-align: center; color: var(--aib-muted); }
.admin-editor { max-width: 820px; }
.admin-editor h2 { margin-bottom: 20px; }
.admin-editor-sections { display: grid; gap: 18px; }
.admin-editor-heading { margin: 22px 0 20px; }
.admin-editor-panel { min-width: 0; padding: 20px 22px; border: 1px solid var(--aib-border); border-radius: 8px; }
.admin-editor-panel h2, .admin-editor-panel h3 { margin: 0 0 16px; font-size: 16px; }
.admin-editor-panel > :last-child { margin-bottom: 0; }
.admin-editor-panel .invite-section { margin: 0; }
.admin-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* Administrator status and account pages */
.executor-status { max-width: 960px; }
.executor-status-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 22px 0 20px; }
.executor-health { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 11px; border: 1px solid var(--aib-success); border-radius: 6px; background: var(--aib-success-soft); color: var(--aib-success); font-size: 13px; font-weight: 600; }
.executor-status[data-available="false"] .executor-health { border-color: var(--aib-danger); background: var(--aib-danger-soft); color: var(--aib-danger); }
.executor-updated { color: var(--aib-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.executor-section { margin-top: 16px; padding: 20px 22px; border: 1px solid var(--aib-border); border-radius: 8px; }
.executor-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-bottom: 16px; }
.executor-section-heading h3 { margin: 0; }
.executor-section-heading p { margin: 0; color: var(--aib-muted); font-size: 13px; }
.executor-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.executor-resource { min-width: 0; padding: 16px; border-radius: 6px; background: var(--aib-surface); }
.executor-resource-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 12px; }
.executor-resource-heading span { color: var(--aib-muted); font-size: 13px; }
.executor-resource-heading strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.executor-resource .progress { height: 8px; margin: 0; border-radius: 4px; background: var(--aib-bg); }
.executor-resource .progress-bar { border-radius: 4px; }
.executor-queue { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; }
.executor-queue > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; min-width: 0; padding: 12px 16px 12px 0; border-top: 1px solid var(--aib-border); }
.executor-queue dt { color: var(--aib-muted); font-size: 13px; font-weight: 400; line-height: 1.4; }
.executor-queue dd { margin: 0; font-size: 23px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }

.admin-users-table-wrap { max-width: none; }
.admin-users-table { min-width: 840px; table-layout: fixed; }
.admin-users-table th:nth-child(1) { width: 5%; }
.admin-users-table th:nth-child(2) { width: 18%; }
.admin-users-table th:nth-child(3) { width: 20%; }
.admin-users-table th:nth-child(4) { width: 28%; }
.admin-users-table th:nth-child(5) { width: 29%; }
.admin-users-table .admin-users-id, .admin-users-table .admin-users-role { color: var(--aib-muted); }
.admin-users-table .admin-users-login { font-weight: 600; }
.admin-users-table tr[data-edit-url]:is(:hover, :focus-visible) .admin-users-login { color: var(--aib-accent); }
.admin-users-table tr[data-edit-url]:is(:hover, :focus-visible) td:first-child { box-shadow: inset 3px 0 var(--aib-accent); }
.admin-state { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.admin-state-active { color: var(--aib-success); background: var(--aib-success-soft); }
.admin-state-blocked { color: var(--aib-danger); background: var(--aib-danger-soft); }
.admin-users-scroll-hint { display: none; color: var(--aib-muted); font-size: 12px; }
.admin-users-row-hint { margin: 22px 0 10px; color: var(--aib-muted); font-size: 13px; }

.admin-user-page { max-width: none; margin-top: 22px; }
.admin-user-back { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 20px; font-size: 13px; }
.admin-user-heading { margin-bottom: 20px; }
.admin-user-kicker { margin: 0; color: var(--aib-muted); font-size: 13px; }
.admin-user-heading h2.admin-user-name { margin: 4px 0 0; font-size: 21px; line-height: 1.3; }
.admin-user-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); align-items: start; gap: 18px; }
.admin-user-main { display: grid; gap: 18px; min-width: 0; }
.admin-user-panel { min-width: 0; padding: 20px 22px; border: 1px solid var(--aib-border); border-radius: 8px; }
.admin-user-panel h3 { margin: 0 0 16px; }
.admin-user-panel h4 { margin: 18px 0 8px; color: var(--aib-muted); font-size: 13px; font-weight: 600; }
.admin-user-panel-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px 14px; margin-bottom: 16px; }
.admin-user-panel-heading h3 { margin: 0; }
.admin-user-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-user-role, .admin-user-state { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.admin-user-role { color: var(--aib-accent); background: var(--aib-accent-soft); }
.admin-user-state.admin-state-active { color: var(--aib-success); background: var(--aib-success-soft); }
.admin-user-state.admin-state-blocked { color: var(--aib-danger); background: var(--aib-danger-soft); }
.admin-user-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; }
.admin-user-facts > div { min-width: 0; padding: 10px 0; border-top: 1px solid var(--aib-border); }
.admin-user-facts .admin-user-fact-wide { grid-column: 1 / -1; }
.admin-user-facts dt { color: var(--aib-muted); font-size: 12px; font-weight: 400; }
.admin-user-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.admin-user-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0 0 14px; border-bottom: 1px solid var(--aib-border); }
.admin-user-stats p { margin: 0; color: var(--aib-muted); }
.admin-user-stats strong { color: var(--aib-ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.admin-user-bot-counts { margin: 0; padding: 0; list-style: none; }
.admin-user-bot-counts li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--aib-border); }
.admin-user-bot-counts li:first-child { border-top: 0; }
.admin-user-bot-counts strong { flex: none; font-variant-numeric: tabular-nums; }
.admin-user-empty { margin: 0; color: var(--aib-muted); }
.admin-user-access-note, .admin-user-access-warning { color: var(--aib-muted); font-size: 13px; }
.admin-user-access-note { margin-bottom: 16px; }
.admin-user-access-warning { margin: 16px 0 0; }
.admin-user-access .invite-section { margin: 0; }
.admin-user-access .invite-section legend { font-size: 13px; font-weight: 600; }
.admin-user-access .invite-tournament-choice { border-bottom: 1px solid var(--aib-border); }
.admin-user-access .invite-tournament-choice:last-child { border-bottom: 0; }
.admin-user-access .admin-editor-actions { padding-top: 16px; border-top: 1px solid var(--aib-border); }

@media (max-width: 800px) {
    .admin-user-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .admin-users-scroll-hint { display: block; margin: 0 0 8px; }
    .executor-resources { grid-template-columns: minmax(0, 1fr); }
    .executor-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-user-panel, .admin-editor-panel, .executor-section { padding: 16px; }
    .admin-user-facts { grid-template-columns: minmax(0, 1fr); }
    .admin-user-facts .admin-user-fact-wide { grid-column: auto; }
    .admin-user-back { min-height: 44px; }
    .admin-user-page .admin-editor-actions .btn { min-height: 44px; }
}

/* Navigation focus should reflect keyboard use, without turning Back into a primary action. */
.btn.btn-default:focus:not(:focus-visible):not(:hover) { color: var(--aib-ink); background: var(--aib-bg); border-color: var(--aib-control-border); box-shadow: none; }
.page-back a:focus:not(:focus-visible) { outline: none; }
.aib-action-icon { display: inline-block; width: 17px; height: 17px; flex: 0 0 auto; margin-right: 6px; vertical-align: -3px; }
.tournament-overview .bot-language-menu > p { margin: 0; padding: 3px 10px 5px; }
.tournament-table-section .bot-metadata, .tournament-table-section .bot-comment { display: block; margin-top: 3px; }
.tournament-table-section .bot-comment { max-width: 52ch; overflow-wrap: anywhere; }
.tournament-table-section :is(.tournament-run-row, .tournament-participant-row) { cursor: pointer; }
.tournament-table-section :is(.tournament-run-row, .tournament-participant-row):focus-visible { outline: 2px solid var(--aib-accent); outline-offset: -2px; }
/* Paging toolbars are navigation, separate from selected data rows. */
.table.table-hover > tbody:has(.aib-pagination-row) > tr:hover,
.table.table-hover .aib-pagination-row,
.table.table-hover .aib-pagination-row:hover > td { background: var(--aib-bg); box-shadow: none; }
.aib-pagination-row:focus-within { outline: none; }
.aib-paging .aib-paging-button[aria-current="page"], .aib-paging .aib-paging-button[aria-current="page"]:is(:hover, :focus, :active) { color: var(--aib-accent); background: var(--aib-accent-soft); border-color: var(--aib-control-border); font-weight: 600; }
.aib-paging:focus:not(:focus-visible) { outline: none; }
.aib-source-summary { padding: 16px 18px; margin-bottom: 16px; border: 1px solid var(--aib-border); border-radius: 6px; background: var(--aib-surface); }
.aib-source-identity, .aib-source-metadata, .aib-source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.aib-source-identity strong { font-size: 16px; font-weight: 600; }
.aib-source-metadata { margin-top: 7px; font-size: 13px; color: var(--aib-muted); }
.aib-source-comment { margin: 10px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.aib-source-actions { justify-content: space-between; margin-top: 12px; }
.aib-source-actions .inline-note { margin: 0; flex: 1 1 260px; font-size: 12px; }
.aib-history-opponent { min-width: 150px; max-width: 280px; }
.aib-history-opponent small { display: block; margin-top: 3px; color: var(--aib-muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.aib-verification-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.aib-verification-actions .btn { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-height: 30px; padding: 5px 9px; white-space: normal; text-align: left; font-size: 12px; line-height: 1.4; text-decoration: none; }
.aib-verification-actions .btn:hover, .aib-verification-actions .btn:focus { text-decoration: none; }
.aib-editor-resource-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; margin-bottom: 10px; font-size: 12px; color: var(--aib-muted); }
.aib-editor-resource-note > a { padding: 4px 0; }
.aib-resource-limits { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; font-size: 12px; line-height: 1.5; }
.aib-resource-limits > div { display: flex; flex-wrap: wrap; gap: 4px 7px; }
.aib-resource-limits dt { font-weight: 400; color: var(--aib-muted); }
.aib-resource-limits dd { margin: 0; color: var(--aib-ink); font-variant-numeric: tabular-nums; }
.aib-game-info { padding: 12px 16px; margin: 0 0 14px; border: 1px solid var(--aib-border); border-radius: 6px; background: var(--aib-surface); }
.aib-game-info ul { margin: 0; padding-left: 18px; }
.aib-game-info li { margin: 6px 0; overflow-wrap: anywhere; }
.aib-game-info .inline-note { margin: 3px 0; font-size: 12px; }
.aib-verifier-selector { position: relative; width: 100%; }
.aib-verifier-selector[hidden], [data-verifier-native][hidden] { display: none; }
.aib-verifier-selector > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; width: 100%; padding: 9px 11px; text-align: left; white-space: normal; list-style: none; }
.aib-verifier-selector > summary::-webkit-details-marker { display: none; }
.aib-verifier-selector > summary .caret { align-self: center; }
.aib-verifier-selector[open] > summary .caret { transform: rotate(180deg); }
.aib-verifier-selector small { grid-column: 1 / -1; display: block; font-size: 12px; line-height: 1.4; color: var(--aib-muted); overflow-wrap: anywhere; }
.aib-verifier-selector > summary[aria-disabled="true"] { cursor: not-allowed; color: var(--aib-muted); background: var(--aib-surface); }
.aib-verifier-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 120; padding: 5px; max-height: 300px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--aib-control-border); border-radius: 6px; background: var(--aib-bg); box-shadow: 0 8px 24px #0002; }
.aib-verifier-options button { display: block; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 4px; background: var(--aib-bg); color: var(--aib-ink); text-align: left; }
.aib-verifier-options button[aria-pressed="true"] { border-color: var(--aib-control-border); background: var(--aib-accent-soft); }
.aib-verifier-options button:hover { background: var(--aib-surface); }
.aib-verifier-options button:focus-visible { outline-offset: -2px; }
@media (max-width: 767px) {
    .aib-verification-actions .btn, .aib-verifier-options button, .aib-verifier-selector > summary { min-height: 44px; }
    .aib-source-summary { padding: 12px; }
    .aib-source-actions { align-items: flex-start; }
    .aib-source-actions .btn { width: 100%; }
    .aib-editor-resource-note > a { min-height: 44px; display: inline-flex; align-items: center; }
}
.admin-users-comment { max-width: 34ch; min-width: 150px; overflow-wrap: anywhere; white-space: pre-wrap; }
.password-reset-url { width: 100%; max-width: 100%; overflow-wrap: anywhere; word-break: break-all; }
.btn.btn-danger, .btn.btn-danger:is(:hover, :focus, :active) { color: var(--aib-danger); background: var(--aib-danger-soft); border-color: var(--aib-danger); box-shadow: none; }
