/* Shared scroll lock for application dialogs (all roles). */
body.modal-open { overflow: hidden; }

/* Shared application chrome: consistent with tournament glass navigation. */
  .header-bar {
    --chrome-accent: #0f766e;
    --chrome-accent-bg: rgba(13,148,136,.12);
    --chrome-accent-border: rgba(13,148,136,.30);
    --chrome-admin: #5145cd;
    --chrome-admin-bg: rgba(99,102,241,.10);
    --chrome-tool-bg: rgba(100,116,139,.08);
    gap: 12px;
  }
  [data-theme="dark"] .header-bar {
    --chrome-accent: #5eead4;
    --chrome-accent-bg: rgba(45,212,191,.12);
    --chrome-accent-border: rgba(45,212,191,.32);
    --chrome-admin: #c4b5fd;
    --chrome-admin-bg: rgba(129,140,248,.15);
    --chrome-tool-bg: rgba(148,163,184,.10);
  }
  .header-bar .header-title { min-width: 0; }
  .header-bar .header-actions {
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }
  .header-bar .header-actions .header-btn,
  .header-bar .header-actions > #e_referee {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: none;
    font-size: 13px;
    transition: background-color .18s, color .18s, border-color .18s;
  }
  .header-bar .header-actions .create-dropdown .header-btn {
    background: #0f766e;
    color: #fff;
  }
  .header-bar .header-actions > #e_referee {
    background: var(--chrome-accent-bg);
    border-color: var(--chrome-accent-border);
    color: var(--chrome-accent);
    font-weight: 700;
  }
  .header-bar .header-actions .admin-dropdown .header-btn {
    background: var(--chrome-admin-bg);
    color: var(--chrome-admin);
  }
  .header-bar .header-actions .header-btn--root {
    background: #dc2626;
    color: #fff;
  }
  .header-bar .header-actions .header-btn--bell,
  .header-bar .header-actions .pr-header-theme {
    width: 40px;
    min-width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: var(--chrome-tool-bg);
    color: var(--text-muted);
    box-shadow: none;
  }
  .header-bar .header-actions .header-btn:hover,
  .header-bar .header-actions > #e_referee:hover,
  .header-bar .header-actions .pr-header-theme:hover {
    transform: none;
    box-shadow: none;
    filter: none;
    border-color: currentColor;
  }
  .header-bar .header-actions .header-btn--bell:hover,
  .header-bar .header-actions .pr-header-theme:hover {
    background: var(--chrome-accent-bg);
    color: var(--chrome-accent);
  }
  .header-bar .header-actions .create-dropdown .header-btn:hover { background: #115e59; }
  .header-bar .header-actions .header-btn--root:hover { background: #b91c1c; }
  .header-bar .header-actions .header-btn .rin-navlink-description,
  .header-bar .header-actions > #e_referee .rin-navlink-description { color: inherit; }
  .header-bar .header-actions :is(.create-dropdown, #e_referee) + .notif-dropdown {
    padding-left: 9px;
    border-left: 1px solid var(--surface-border);
  }
  .header-bar .header-actions :is(.header-btn,.pr-header-theme):focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
  }
  html[data-theme="dark"] .header-bar .pr-header-theme .pr-theme-sun { color: inherit; }

@media (min-width: 981px) {
  @media (max-width: 1200px) {
    .header-bar .header-actions { gap: 6px; }
    .header-bar .header-actions .header-btn,
    .header-bar .header-actions > #e_referee { padding-inline: 9px; }
    .header-bar .header-actions .header-btn--bell { padding: 0; }
  }
}
.header-bar .header-btn--bell svg { width: 19px; height: 19px; display: block; }
@media (prefers-reduced-motion: reduce) {
  .header-bar .header-actions :is(.header-btn,.pr-header-theme) { transition: none; }
}

/* Global search: anchored panel outside the scrolling navigation. */
.pr-global-search {
  position: fixed;
  z-index: 1210;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  padding: 14px;
  gap: 12px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 16px;
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(15,23,42,.14));
  --search-accent: #0f766e;
  --search-accent-bg: rgba(13,148,136,.09);
  --search-muted: #475569;
}
[data-theme="dark"] .pr-global-search {
  --search-accent: #5eead4;
  --search-accent-bg: rgba(45,212,191,.12);
  --search-muted: #cbd5e1;
}
.pr-global-search[hidden], .pr-global-search [hidden] { display: none !important; }
.pr-search-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.pr-search-heading { display: flex; flex-direction: column; gap: 3px; }
.pr-search-heading strong { color: var(--text); font-size: 16px; line-height: 1.3; font-weight: 700; }
.pr-search-heading span { color: var(--search-muted); font-size: 12px; }
.pr-global-search svg { width: 19px; height: 19px; display: block; flex-shrink: 0; }
.pr-search-close, .pr-search-clear {
  display: inline-flex; justify-content: center; align-items: center;
  flex: 0 0 32px; width: 32px; height: 32px; padding: 0;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--search-muted); cursor: pointer;
}
.pr-search-close:hover, .pr-search-clear:hover { background: var(--surface-hover); color: var(--text); }
.pr-search-field {
  display: flex; align-items: center; flex-shrink: 0; gap: 9px;
  padding: 5px 9px 5px 12px; min-height: 46px; box-sizing: border-box;
  border-radius: 11px; border: 1px solid var(--surface-border);
  background: var(--surface-hover); color: var(--search-muted);
}
.pr-search-field:focus-within { border-color: var(--search-accent); box-shadow: 0 0 0 3px var(--search-accent-bg); }
.pr-global-search .pr-search-input {
  display: block; width: 100%; min-width: 0; flex: 1 1 0;
  padding: 6px 0; border: 0; outline: 0; box-shadow: none;
  background: transparent; color: var(--text); font: inherit; font-size: 13px;
}
.pr-search-input::placeholder { color: var(--search-muted); opacity: .9; }
.pr-search-input::-webkit-search-cancel-button { display: none; }
.pr-search-status { padding: 14px 9px; color: var(--search-muted); font-size: 13px; line-height: 1.45; text-align: center; }
.pr-search-status[data-state="count"] { padding: 0 3px; font-size: 11px; text-align: left; }
.pr-search-status[data-state="error"] { color: var(--warn-text); }
.pr-search-results { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 10px; }
.pr-search-results:empty { display: none; }
.pr-search-group { display: flex; flex-direction: column; gap: 2px; }
.pr-search-group-title { padding: 6px 7px; font-size: 11px; font-weight: 650; color: var(--search-muted); text-transform: uppercase; letter-spacing: .055em; }
.pr-search-group + .pr-search-group { padding-top: 6px; border-top: 1px solid var(--surface-border); }
.pr-global-search .pr-search-result {
  display: flex; align-items: center; gap: 10px; padding: 8px 7px; min-height: 52px;
  box-sizing: border-box; border-radius: 10px; color: var(--text); text-decoration: none;
}
.pr-global-search .pr-search-result:hover, .pr-global-search .pr-search-result:focus-visible {
  background: var(--search-accent-bg); text-decoration: none; color: var(--text);
}
.pr-search-avatar {
  position: relative; display: flex; align-items: center; justify-content: center;
  flex: 0 0 36px; height: 36px; border-radius: 10px; overflow: hidden;
  background: var(--search-accent-bg); color: var(--search-accent);
}
.pr-search-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-search-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.pr-search-result-body strong { font-size: 13px; font-weight: 600; line-height: 1.35; }
.pr-search-result-body small { color: var(--search-muted); font-size: 12px; line-height: 1.35; }
.pr-search-result-arrow { color: var(--search-muted); }
.pr-search-result-arrow svg { width: 16px; height: 16px; }
.pr-search-footer { flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding-top: 10px; border-top: 1px solid var(--surface-border); font-size: 11px; color: var(--search-muted); }
.pr-search-footer kbd { background: var(--surface-hover); border: 1px solid var(--surface-border); border-radius: 5px; color: inherit; font: inherit; padding: 2px 5px; }
.pr-global-search :is(button,a):focus-visible { outline: 2px solid var(--search-accent); outline-offset: -2px; }
.pr-unified-header .header-actions .pr-header-search[aria-expanded="true"] { background: var(--chrome-accent-bg); color: var(--chrome-accent); border-color: var(--chrome-accent-border); }
@media (max-width: 980px) { .pr-global-search { display: none !important; } }

/* Shared profile presentation selector — mobile avatar and full-view avatar menus. */
.pr-layout-menu-section { border-top: 1px solid var(--surface-border); margin: 5px 0; padding-top: 5px; }
.pr-layout-options { display: grid; gap: 3px; padding: 4px; }
.pr-layout-caption { color: var(--text-muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; padding: 5px 8px; }
.pr-layout-option, .pr-layout-guest-back {
  display: flex; align-items: center; gap: 10px; min-height: 44px; width: 100%; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 9px; padding: 8px 10px;
  background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 550;
  text-align: left; cursor: pointer; white-space: nowrap;
}
.pr-layout-option svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pr-layout-option:hover, .pr-layout-guest-back:hover { background: var(--surface-hover); }
.pr-layout-option[aria-pressed="true"] { color: #0f766e; background: rgba(13,148,136,.12); border-color: rgba(13,148,136,.15); font-weight: 650; }
[data-theme="dark"] .pr-layout-option[aria-pressed="true"] { color: #5eead4; background: rgba(45,212,191,.12); border-color: rgba(45,212,191,.18); }
.pr-layout-option[aria-pressed="true"]::after { content: ''; width: 8px; height: 13px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-left: auto; margin-right: 3px; }
.pr-layout-guest-back { width: auto; border-color: var(--surface-border); }
.pr-layout-option:focus-visible, .pr-layout-guest-back:focus-visible, .mobile-profile-trigger:focus-visible, .mobile-hamburger:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 980px) {
  .mobile-navbar {
    padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
    box-shadow: none; gap: 12px; box-sizing: border-box;
  }
  .mobile-navbar .mobile-brand { gap: 9px; min-width: 0; }
  .mobile-navbar .mobile-profile-trigger {
    display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 3px;
    border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); cursor: pointer;
  }
  .mobile-profile-trigger::after { display: none; }
  .mobile-profile-trigger > svg { width: 13px; height: 13px; flex: none; }
  .mobile-navbar .mobile-avatar-wrap { width: 36px; height: 36px; border-radius: 50%; position: relative; display: grid; place-items: center; background: var(--surface-hover); border: 1px solid var(--surface-border); overflow: hidden; }
  .mobile-navbar .mobile-avatar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
  .mobile-avatar-placeholder svg { display: block; width: 19px; height: 19px; color: var(--text-muted); }
  .mobile-navbar .brand-text-small h3 { font-size: 17px; line-height: 1.15; }
  .mobile-navbar .mobile-hamburger {
    width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center;
    border: 1px solid var(--surface-border); border-radius: 10px; background: var(--surface-hover);
  }
  .mobile-navbar .mobile-hamburger span { width: 19px; }
  .mobile-navbar .mobile-user-dropdown .dropdown-menu {
    left: 0 !important; right: auto !important; min-width: 0; width: min(258px, calc(100vw - 28px)); max-height: calc(100dvh - 84px);
    overflow-y: auto; border-radius: 14px; padding: 6px !important; margin-top: 8px;
  }
  .mobile-navbar .mobile-user-dropdown .dropdown-item { min-height: 44px; box-sizing: border-box; }
  .mobile-navbar .mobile-user-dropdown .dropdown-item svg,
  .mobile-drawer .mobile-nav-item svg { width: 19px; height: 19px; flex: none; }
  .mobile-drawer { max-height: calc(100vh - 64px - env(safe-area-inset-top,0px)); max-height: calc(100dvh - 64px - env(safe-area-inset-top,0px)); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-drawer .mobile-nav-item { border-radius: 9px; min-height: 44px; }
  .mobile-drawer .pr-layout-options { border-top: 1px solid var(--surface-border); margin-top: 8px; }
  /* One brand/avatar in the fixed mobile bar; the existing action buttons live directly below it. */
  .app-shell .main-content > .header-bar { position: relative; flex-direction: row; gap: 6px; padding: 10px 12px; margin-bottom: 14px; }
  .app-shell .main-content > .header-bar > .header-title { display: none; }
  .header-bar .header-actions { width: 100%; flex: 1 1 100%; justify-content: flex-start; gap: 6px; }
  .header-bar .header-actions .header-btn,
  .header-bar .header-actions > #e_referee { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .header-bar .header-actions .header-btn .rin-navlink-description,
  .header-bar .header-actions > #e_referee .rin-navlink-description { font-size: 12px; }
  .header-bar .header-actions .header-btn--bell,
  .header-bar .header-actions .pr-header-theme { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; flex: 0 0 44px; padding: 0; }
  .header-bar .header-actions :is(.create-dropdown, #e_referee) + .notif-dropdown { border-left: 0; padding-left: 0; }
  .header-bar .header-actions .dropdown { position: static; }
  .header-bar .header-actions .dropdown-menu:not(.notif-panel),
  .header-bar .header-actions .notif-dropdown .notif-panel {
    position: absolute; top: 100%; bottom: auto; left: 10px !important; right: 10px !important;
    width: auto; min-width: 0; max-width: none; max-height: min(60vh,480px); margin-top: 5px; border-radius: 14px;
  }
  .header-bar .header-actions .dropdown-menu:not(.notif-panel) { overflow-y: auto; }
}
@media (max-width: 360px) {
  .app-shell .main-content > .header-bar { padding-inline: 8px; }
  .header-bar .header-actions { gap: 5px; }
  .header-bar .header-actions .header-btn, .header-bar .header-actions > #e_referee { padding-inline: 8px; }
  .header-bar .header-actions .header-btn--bell { padding: 0; }
}

/* Universal chrome: single real header and role-filtered action set. */
.pr-unified-header { position:relative; z-index:200; }
.pr-unified-header .header-title { display:flex; align-items:center; gap:10px; min-width:0; }
.pr-unified-header .mobile-brand { display:flex; align-items:center; min-width:0; }
.pr-unified-header #header-avatar-block { display:none!important; }
.pr-unified-header .mobile-profile-trigger { display:flex; align-items:center; gap:3px; background:transparent; border:0; padding:2px; min-height:44px; color:var(--text-muted); cursor:pointer; }
.pr-unified-header .mobile-profile-trigger > svg { width:13px; height:13px; flex:none; }
.pr-unified-header .mobile-avatar-wrap { position:relative; width:36px; height:36px; border-radius:50%; display:grid; place-items:center; overflow:hidden; background:var(--surface-hover); border:1px solid var(--surface-border); }
.pr-unified-header .mobile-avatar { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border:0; }
.pr-unified-header .mobile-profile-trigger::after { display:none; }
.pr-unified-header .mobile-user-dropdown .dropdown-menu { left:0!important; right:auto!important; min-width:0; width:min(265px,calc(100vw - 24px)); max-height:var(--pr-profile-menu-height,calc(100dvh - 84px)); overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; border-radius:14px; padding:6px!important; box-sizing:border-box; }
.pr-unified-header .mobile-user-dropdown .dropdown-item { min-height:40px; box-sizing:border-box; white-space:normal; line-height:1.35; }
.pr-unified-header .pr-profile-menu-heading { padding:10px 12px; color:var(--text); font-size:14px; font-weight:700; overflow-wrap:anywhere; border-bottom:1px solid var(--surface-border); margin-bottom:4px; }
.pr-unified-header .pr-profile-menu-divider { margin-top:4px; padding-top:4px; border-top:1px solid var(--surface-border); }
.pr-unified-header .pr-profile-menu .pr-profile-link.active { background:var(--chrome-accent-bg); color:var(--chrome-accent)!important; }
.pr-unified-header .pr-profile-menu .dropdown-item:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.pr-unified-header .header-actions .pr-header-quick { display:inline-flex; align-items:center; justify-content:center; gap:7px; text-decoration:none; background:var(--chrome-tool-bg); border-color:var(--surface-border); color:var(--text-muted); white-space:nowrap; }
.pr-unified-header .header-actions .pr-header-quick:hover { background:var(--chrome-accent-bg); color:var(--chrome-accent); }
.pr-unified-header .header-actions .pr-header-quick svg { width:18px; height:18px; flex:none; }
.pr-unified-header .header-actions .pr-header-search { width:40px; min-width:40px; padding:0; }
@media (min-width:981px) and (max-width:1200px) { .pr-unified-header .pr-header-quick span { display:none; } }
@media (max-width:980px) { .pr-unified-header .header-actions .pr-header-quick { display:none!important; } .pr-unified-header .mobile-user-dropdown .dropdown-item { min-height:44px; } }
.pr-unified-header .mobile-user-dropdown .dropdown-item svg,.pr-unified-header .pr-profile-theme svg { width:18px; height:18px; flex:none; }
.pr-unified-header .pr-profile-theme { display:flex; align-items:center; gap:10px; min-height:44px; width:100%; padding:8px 12px; border:0; border-radius:9px; background:transparent; color:var(--text-muted); font:inherit; font-size:13px; cursor:pointer; text-align:left; }
.pr-unified-header .pr-profile-theme:hover { background:var(--surface-hover); color:var(--teal); }
.pr-unified-header .mobile-hamburger { display:none; }
@media (min-width:981px) {
  .pr-unified-header .mobile-brand { display:flex; gap:10px; }
  .pr-unified-header .brand-text-small h3 { font-size:20px; line-height:1.12; white-space:nowrap; }
  .pr-unified-header .brand-text-small span { font-size:10px; }
  .pr-unified-header .mobile-profile-trigger { min-height:40px; }
  .pr-unified-header .header-title { overflow:visible; }
  .pr-unified-header .pr-profile-theme-row { display:none; }
  .pr-unified-header .header-actions { flex-wrap:wrap; }
  .pr-unified-header .header-actions .header-btn { white-space:nowrap; }
  .pr-unified-header .header-title { flex:1 1 auto; }
  /* Desktop action menus stay inside the visible header/content bounds.
     Navigation supplies the available viewport geometry on open/resize. */
  .pr-unified-header .header-actions > :is(.create-dropdown,.admin-dropdown) > .dropdown-menu {
    box-sizing:border-box;
    top:calc(100% + 10px);
    right:var(--pr-header-menu-right,0px);
    left:auto;
    margin-top:0;
    width:max-content;
    max-width:var(--pr-header-menu-width,calc(100vw - 24px));
    max-height:var(--pr-header-menu-height,calc(100vh - 100px));
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
  }
  .pr-unified-header .header-actions > .create-dropdown > .dropdown-menu {
    min-width:min(220px,var(--pr-header-menu-width,calc(100vw - 24px)));
  }
  .pr-unified-header .header-actions > .admin-dropdown > .dropdown-menu {
    min-width:min(260px,var(--pr-header-menu-width,calc(100vw - 24px)));
  }
  .pr-unified-header .header-actions > :is(.create-dropdown,.admin-dropdown) > .dropdown-menu li a {
    white-space:normal;
    overflow-wrap:anywhere;
  }
}
.pr-drawer-admin-slot:empty,.pr-drawer-referee-slot:empty { display:none; }
.pr-drawer-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 4px 12px; margin-bottom:10px; border-bottom:1px solid var(--surface-border); }
.pr-drawer-heading strong { font-size:17px; color:var(--text); }
.pr-drawer-close { width:44px; height:44px; flex:none; display:grid; place-items:center; border:1px solid var(--surface-border); border-radius:10px; background:var(--surface-hover); color:var(--text-muted); cursor:pointer; }
.pr-drawer-close svg { width:20px; height:20px; }
.pr-drawer-admin-label { display:flex; align-items:center; gap:8px; padding:10px 12px; margin:8px 0 5px; border-radius:9px; color:#5145cd; background:rgba(99,102,241,.10); font-weight:650; font-size:13px; }
[data-theme="dark"] .pr-drawer-admin-label { color:#c4b5fd; background:rgba(129,140,248,.15); }
.pr-drawer-admin-label svg { width:18px; height:18px; }
.pr-drawer-admin-slot .admin-dropdown > .dropdown-toggle { display:none!important; }
.pr-drawer-admin-slot .admin-dropdown > .dropdown-menu { position:static!important; display:block!important; visibility:visible!important; opacity:1!important; transform:none!important; width:100%!important; max-width:none!important; min-width:0!important; max-height:none!important; overflow:visible!important; box-shadow:none!important; border:0!important; border-radius:0!important; background:transparent!important; padding:0!important; margin:0!important; }
.pr-drawer-admin-slot .dropdown-menu li a { display:flex; align-items:center; min-height:44px; padding:9px 12px; border-radius:9px; white-space:normal; overflow-wrap:anywhere; font-size:14px; line-height:1.35; }
.pr-drawer-admin-slot .dropdown-menu li a > svg { width:18px; height:18px; flex:none; color:var(--text-muted); }
.pr-drawer-referee-slot .mobile-nav-item { color:var(--teal); font-weight:700; background:var(--teal-glow); }
#pr-drawer-search { border:0; text-align:left; width:100%; background:transparent; }
#pr-drawer-search:hover { background:var(--surface-hover); color:var(--teal); }
@media (max-width:980px) {
  .app-shell .main-content > .pr-unified-header {
    position:fixed!important; inset:0 0 auto 0; z-index:210; box-sizing:border-box;
    min-height:calc(64px + env(safe-area-inset-top,0px)); height:calc(64px + env(safe-area-inset-top,0px));
    margin:0!important; padding:env(safe-area-inset-top,0px) max(10px,env(safe-area-inset-right,0px)) 0 max(10px,env(safe-area-inset-left,0px))!important;
    display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important; align-items:center!important; justify-content:space-between;
    gap:6px; background:var(--surface); border:0; border-bottom:1px solid var(--surface-border); border-radius:0; box-shadow:none;
  }
  .app-shell .main-content > .pr-unified-header > .header-title { display:flex!important; flex:1 1 auto; overflow:visible; gap:0; }
  .pr-unified-header .mobile-brand { gap:5px; flex:1; }
  .pr-unified-header .mobile-brand-link { min-width:0; display:flex; align-items:center; gap:4px; }
  .pr-unified-header .brand-text-small h3 { font-size:16px; line-height:1.1; white-space:nowrap; }
  .pr-unified-header .brand-text-small span { font-size:10px; }
  .pr-unified-header .header-actions { display:flex!important; width:auto; flex:0 0 auto; align-items:center; flex-wrap:nowrap; justify-content:flex-end; gap:6px; }
  .pr-unified-header .header-actions .create-dropdown .header-btn { width:44px; height:44px; min-width:44px; padding:0; border-radius:10px; }
  .pr-unified-header .create-dropdown .header-btn .rin-navlink-description,.pr-unified-header .create-dropdown .header-btn > .icon,.pr-unified-header .create-dropdown .header-btn::after { display:none!important; }
  .pr-unified-header .create-dropdown .header-btn::before { content:'+'; font-size:28px; line-height:1; font-weight:400; }
  .pr-unified-header .header-actions .admin-dropdown,.pr-unified-header .header-actions #pr-header-theme,.pr-unified-header .header-actions > #e_referee { display:none!important; }
  .pr-unified-header .mobile-hamburger { display:flex!important; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; border:1px solid var(--surface-border); border-radius:10px; background:var(--surface-hover); padding:0; }
  .pr-unified-header .mobile-hamburger span { width:19px; }
  .pr-unified-header .header-actions .notif-dropdown { padding-left:0!important; border-left:0!important; }
  .pr-unified-header .header-actions .dropdown-menu { top:100%!important; max-height:calc(100dvh - 84px); }
  .pr-unified-header .mobile-user-dropdown .dropdown-menu { top:100%; }
  .mobile-drawer-backdrop { inset:0!important; z-index:1300!important; }
  #mobile-drawer { position:fixed!important; inset:0 0 0 auto!important; width:min(360px,100%)!important; max-width:100%; height:100dvh; max-height:100dvh!important; z-index:1310!important; padding:max(12px,env(safe-area-inset-top,0px)) 14px max(16px,env(safe-area-inset-bottom,0px)); box-sizing:border-box; background:var(--surface); overflow-y:auto; overscroll-behavior:contain; border:0; border-left:1px solid var(--surface-border); border-radius:14px 0 0 14px; }
  #mobile-drawer .mobile-nav-item { padding:9px 12px; font-size:14px; }
  #mobile-drawer .mobile-nav-section-label { padding-inline:12px; }
  .pr-global-search.pr-search-mobile:not([hidden]) { display:flex!important; z-index:1320; }
  .pr-global-search.pr-search-mobile .pr-search-input { font-size:16px; }
}
@media (max-width:360px) {
  .pr-unified-header .header-actions { gap:4px; }
  .pr-unified-header .mobile-brand { gap:3px; }
  .pr-unified-header .brand-text-small h3 { font-size:15px; }
}
@media (max-width:980px) and (orientation:landscape), (min-width:769px) and (max-width:980px) {
  .pr-unified-header .header-actions > #e_referee { display:inline-flex!important; min-width:44px; width:44px; height:44px; padding:0; justify-content:center; }
  .pr-unified-header .header-actions > #e_referee .rin-navlink-description { display:none; }
  .pr-unified-header .header-actions > #e_referee .icon { margin:0; }
}
@media (max-width:768px) {
  .mobile-bottom-nav .mbn-ico svg { width:21px; height:21px; display:block; }
  .mobile-bottom-nav .mbn-item { min-height:44px; }
  .mobile-bottom-nav .mbn-judge { color:var(--teal); }
}
@media (min-width:981px) {
  #mobile-drawer,#pr-mobile-drawer-backdrop { display:none!important; }
}
.pr-unified-header .dropdown-menu li a > svg { width:18px; height:18px; flex:none; color:var(--text-muted); }

/* Mobile content must fit the actual layout viewport, not the nominal device width.
   Leave a small safe gutter for overlay scrollbars and rounded card edges.
   Keep fixed chrome and component-local horizontal scrollers independent. */
@media (max-width:980px) {
  #app-shell-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #app-shell-container > .main-content {
    min-width: 0;
    max-width: 100%;
  }
  #app-shell-container > .main-content > .page-content-wrapper:not(:has(> .pr-home-hero)) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: max(8px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(8px, env(safe-area-inset-right, 0px)) !important;
  }
}

/* Real links only, compact footer for all roles. */
.site-footer.pr-footer-compact .footer-inner { padding:18px 24px 12px; }
.pr-footer-compact .pr-footer-main { display:flex; align-items:center; flex-wrap:wrap; gap:10px 24px; }
.pr-footer-compact .footer-brand { align-items:center; gap:8px; text-decoration:none; }
.pr-footer-compact .footer-brand strong { margin:0; }
.pr-footer-compact .brand-logo-small { width:30px; height:30px; display:grid; place-items:center; font-size:12px; }
.pr-footer-compact .pr-footer-links { display:flex; flex-wrap:wrap; align-items:center; gap:4px 18px; }
.pr-footer-compact .pr-footer-links a { display:inline-flex; align-items:center; min-height:32px; color:var(--text-muted); text-decoration:none; font-size:13px; }
.pr-footer-compact .pr-footer-links a:hover { color:var(--teal); }
.pr-footer-compact a:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.pr-footer-compact .footer-bottom { margin-top:10px; padding-top:8px; }
.pr-footer-compact .footer-bottom p { font-size:12px; }
/* Android download: a permanent, recognizable action, not a store badge. */
.pr-footer-compact .pr-footer-android {
  --pr-android-bg:#166534;
  --pr-android-fg:#fff;
  --pr-android-sub:#dcfce7;
  --pr-android-icon:#86efac;
  --pr-android-border:#166534;
  --pr-android-hover:#14532d;
  display:inline-flex; align-items:center; gap:10px; margin-inline-start:auto;
  min-height:54px; max-width:100%; box-sizing:border-box; padding:8px 12px;
  border:1px solid var(--pr-android-border); border-radius:12px;
  background:var(--pr-android-bg); color:var(--pr-android-fg); text-decoration:none;
  flex:0 1 auto;
}
[data-theme="dark"] .pr-footer-compact .pr-footer-android {
  --pr-android-bg:#123a28;
  --pr-android-fg:#e8fff0;
  --pr-android-sub:#b7e4c6;
  --pr-android-icon:#86efac;
  --pr-android-border:#4d9467;
  --pr-android-hover:#1b4c34;
}
.pr-footer-compact .pr-footer-android:hover { background:var(--pr-android-hover); color:var(--pr-android-fg); }
.pr-footer-compact .pr-footer-android:focus-visible { outline:2px solid var(--teal); outline-offset:3px; }
.pr-footer-android-logo { color:var(--pr-android-icon); flex:none; }
.pr-footer-android-download { color:var(--pr-android-sub); flex:none; margin-inline-start:4px; }
.pr-footer-android-copy { display:flex; flex-direction:column; gap:2px; min-width:0; }
.pr-footer-android-copy strong { font-size:14px; font-weight:700; line-height:1.2; color:var(--pr-android-fg); }
.pr-footer-android-copy > span { font-size:11px; line-height:1.25; color:var(--pr-android-sub); }
@media(max-width:768px) {
  .site-footer.pr-footer-compact .footer-inner { padding:12px max(12px,env(safe-area-inset-left,0px)) 10px; }
  .pr-footer-compact .pr-footer-main { gap:5px 12px; align-items:flex-start; }
  .pr-footer-compact .pr-footer-links { flex:1 1 100%; gap:2px 12px; }
  .pr-footer-compact .pr-footer-links a { min-height:32px; font-size:12px; }
  .pr-footer-compact .footer-bottom { margin-top:5px; padding-top:6px; }
  .pr-footer-compact .pr-footer-android { margin:5px 0 0; }
}
