/* Readable type scale and shared light/dark surfaces. Loaded after app.css. */
:root {
  --surface: #fff;
  --surface-soft: #f5eff8;
  --reading-muted: #64748b;
}
.theme-toggle { background: var(--surface); color: var(--primary-dark); border: 1px solid var(--line); width:44px; height:44px; min-width:44px; min-height:44px; padding:10px; flex-shrink:0; }
[data-toggle-password] { min-width:48px; padding:10px; }
[data-toggle-password] .password-eye-off { display:none; }
[data-toggle-password][aria-pressed="true"] .password-eye { display:none; }
[data-toggle-password][aria-pressed="true"] .password-eye-off { display:inline-flex; }
.theme-toggle:hover { background: var(--surface-soft); color: var(--primary-dark); border-color: var(--primary); }
.theme-toggle .theme-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .theme-sun { display: inline-flex; }
[data-bs-theme="dark"] .theme-toggle .theme-moon { display: none; }
.theme-floating { position: fixed; top: 20px; right: 24px; z-index: 1040; box-shadow: 0 3px 16px #00000012; }

@media screen {
  body { font-size: 16px; }
  .btn, .btn-sm, .form-label, .breadcrumb-label, .today-label { font-size: 14px; }
  .btn-lg, .auth-form-panel .btn-lg, .form-control, .form-select, .auth-form-panel .form-control-lg { font-size: 16px; }
  .form-control, .form-select { min-height: 46px; }
  .btn-sm { min-height: 40px; }
  .nav-item-link { font-size: 15px; padding: 13px 12px; }
  .brand-caption { font-size: 10px; letter-spacing: 1px; }
  .sidebar-label, .eyebrow, .room-switcher .eyebrow, .detail-label, .auth-form-panel .eyebrow, .modal-header .eyebrow { font-size: 12px; letter-spacing: 1px; }
  .page-heading h1 { font-size: 34px; }
  .page-heading p, .auth-form-panel > p, .auth-art p { font-size: 16px; }
  .room-switcher h2, .panel-header h2, .room-manage-card h2, .empty-state h3 { font-size: 18px; }
  .room-select-form { flex-basis: 520px; }
  .room-select-form .form-select { font-size: 15px; }
  .stat-label { font-size: 14px; }
  .stat-value { font-size: 38px; }
  .stat-card p, .form-text, .account-card small, .role-pill, .status-pill, .mode-pill, .count-badge { font-size: 13px; }
  .stat-card p { margin-top: 7px; }
  .account-card strong, .logout-button, .event-note, .event-note p { font-size: 14px; }
  .sidebar-bottom { padding-top: 24px; }
  .room-people strong, .leader-row strong, .presenter-name { font-size: 16px; }
  .room-people { gap: 22px 26px; }
  .progress-caption, .progress-caption strong, .panel-body p.small, .leader-row small, .leader-empty p, .empty-state p { font-size: 14px !important; }
  .leader-empty strong { font-size: 16px; }
  .leader-score, .final-score { font-size: 22px; }
  .leader-score small { font-size: 12px; }
  .rank-medal, .participant-avatar { font-size: 15px; width: 38px; height: 38px; }
  .table { font-size: 15px; }
  .table th { font-size: 12px; letter-spacing: .3px; }
  .participant-table small, .participant-meta { font-size: 13px !important; }
  .table-footer, .app-footer, .rubric-legend, .audit-detail { font-size: 13px; }
  .search-field input, .filter-select { font-size: 14px; min-height: 44px; }
  .search-field input { width: 250px; }
  .search-field .icon { top: 14px; }
  .filter-select { width: 165px; }
  .score-intro, .rubric-description, .criterion-number { font-size: 14px; }
  .score-number { font-size: 20px; width: 82px; }
  .rubric-item .form-label { font-size: 16px; }
  .score-preview { font-size: 32px; }
  .auth-footer { font-size: 13px !important; }
  .login-help, .glass-label, .art-footnote { font-size: 14px; }
  .print-meta, .signature { font-size: 15px; }
  .print-table th, .print-table td, .print-brand span { font-size: 13px; }
  .page-heading p, .stat-card p, .stat-label, .table th, .table-footer, .app-footer,
  .participant-meta, .detail-label, .sidebar-label, .today-label, .breadcrumb-label,
  .login-help, .auth-footer, .empty-state, .empty-state p, .leader-empty p,
  .progress-caption, .rubric-legend { color: var(--reading-muted); }

  [data-bs-theme="dark"] {
    color-scheme: dark;
    --primary: #be94d5;
    --primary-dark: #d9b8eb;
    --primary-soft: #30263e;
    --secondary: #96b8f4;
    --accent: #8bb4ff;
    --canvas: #111622;
    --ink: #ecedf5;
    --muted: #abb6c9;
    --reading-muted: #abb6c9;
    --line: #344055;
    --surface: #1b2332;
    --surface-soft: #30263e;
    --bs-body-bg: #111622;
    --bs-body-color: #ecedf5;
    --bs-secondary-color: #abb6c9;
    --bs-heading-color: #f0edf7;
    --bs-border-color: #344055;
    --bs-link-color: #d9b8eb;
    --bs-link-color-rgb: 217,184,235;
    --bs-link-hover-color: #eed8fb;
    --bs-link-hover-color-rgb: 238,216,251;
    --bs-tertiary-bg: #242e40;
  }
  [data-bs-theme="dark"] body { background: var(--canvas); color: var(--ink); }
  [data-bs-theme="dark"] :is(.sidebar,.topbar,.panel,.stat-card,.modal-content,.auth-page,.print-page) { background: var(--surface); color: var(--ink); }
  [data-bs-theme="dark"] :is(.panel-header,.modal-header,.modal-footer,.table-footer,.leader-row) { border-color: var(--line); }
  [data-bs-theme="dark"] :is(.form-control,.form-select) { background-color: #151d2b; color: var(--ink); border-color: #46516a; }
  [data-bs-theme="dark"] .form-control::placeholder { color: #a1abc0; }
  [data-bs-theme="dark"] :is(.form-control,.form-select):focus { border-color: #be94d5; box-shadow: 0 0 0 3px #be94d52b; }
  [data-bs-theme="dark"] :is(.form-control,.form-select):disabled { background-color: #283144; color: #b3bdd0; }
  [data-bs-theme="dark"] :is(.form-label,.room-people strong,.presenter-name,.breadcrumb-label strong,.leader-empty strong,.empty-state h3) { color: #e1e6f1; }
  [data-bs-theme="dark"] :is(.nav-item-link,.logout-button,.account-card small,.event-note p) { color: #b5bfd2; }
  [data-bs-theme="dark"] :is(.nav-item-link:hover,.nav-item-link.active) { background: var(--primary-soft); color: #dfbdf2; }
  [data-bs-theme="dark"] :is(.room-switcher,.event-note) { background: linear-gradient(110deg,#282338,#222b40); border-color: #51405f; }
  [data-bs-theme="dark"] :is(.room-switcher h2,.event-note) { color: #dfbdf2; }
  [data-bs-theme="dark"] :is(.room-symbol,.participant-avatar,.avatar,.purple,.count-badge,.score-intro,.btn-text) { background: #352944; color: #dfbdf2; }
  [data-bs-theme="dark"] .role-pill { background: #30263e; border-color: #655074; color: #dfbdf2; }
  [data-bs-theme="dark"] .btn-primary { --bs-btn-bg:#9463ae; --bs-btn-border-color:#aa7dc2; --bs-btn-hover-bg:#a574bf; --bs-btn-hover-border-color:#be94d5; --bs-btn-active-bg:#7f4e9a; --bs-btn-active-border-color:#be94d5; }
  [data-bs-theme="dark"] .btn-outline-primary { background: transparent; --bs-btn-color:#dfbdf2; --bs-btn-border-color:#77558c; --bs-btn-hover-bg:#392b48; --bs-btn-hover-color:#f0dafa; --bs-btn-hover-border-color:#be94d5; }
  [data-bs-theme="dark"] :is(.btn-white,.btn-light) { background: #273247; border-color: #46516a; color: #e1e6f1; }
  [data-bs-theme="dark"] :is(.btn-white,.btn-light):hover { background: #35415a; color: #fff; }
  [data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color:#ffa6ae; --bs-btn-border-color:#a55d67; }
  [data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color:#c2ccdf; --bs-btn-border-color:#56627a; }
  [data-bs-theme="dark"] .table { --bs-table-bg:var(--surface); --bs-table-color:#dce2ef; --bs-table-border-color:var(--line); }
  [data-bs-theme="dark"] .table thead { --bs-table-bg:#252a3c; }
  [data-bs-theme="dark"] .table tbody tr:hover > * { --bs-table-bg:#252e40; }
  [data-bs-theme="dark"] :is(.green,.status-pill.green) { background:#1d3c34; color:#91dfb8; }
  [data-bs-theme="dark"] :is(.orange,.status-pill.pending) { background:#403624; color:#f4cb83; }
  [data-bs-theme="dark"] .blue { background:#233758; color:#a5c4fb; }
  [data-bs-theme="dark"] .status-pill.neutral { background:#343c50; color:#c2cbdc; }
  [data-bs-theme="dark"] .mode-pill { color:#b0c8f0; }
  [data-bs-theme="dark"] .mode-pill.onsite { color:#91dfb8; }
  [data-bs-theme="dark"] .rank-1 { background:#443921; color:#f3d082; }
  [data-bs-theme="dark"] .rank-2 { background:#354055; color:#d6dfef; }
  [data-bs-theme="dark"] .rank-3 { background:#45352c; color:#edba97; }
  [data-bs-theme="dark"] :is(.leader-score,.final-score) { color:#d7acec; }
  [data-bs-theme="dark"] .progress { background:#3c304b; }
  [data-bs-theme="dark"] :is(.asset-preview,.audit-detail) { background:#151d2b; border-color:#51405f; }
  [data-bs-theme="dark"] .rubric-description { background:#292438; color:#c6b4d5; border-color:#9775ae; }
  [data-bs-theme="dark"] .rubric-description[data-level="3"] { background:#1d352f; color:#a2debd; border-color:#74b794; }
  [data-bs-theme="dark"] .rubric-description[data-level="4"] { background:#23324b; color:#b4cdf4; border-color:#83a6d9; }
  [data-bs-theme="dark"] .form-range::-webkit-slider-runnable-track { background:#51405f; }
  [data-bs-theme="dark"] .auth-art { background:linear-gradient(145deg,#3d284d,#50335f 48%,#293e63); }
  [data-bs-theme="dark"] :is(.brand img,.auth-logo,.print-brand img) { background:#f8fafc; padding:8px; border-radius:8px; }
  [data-bs-theme="dark"] .swal2-popup { background:var(--surface); color:var(--ink); border:1px solid var(--line); }
  [data-bs-theme="dark"] :is(.swal2-title,.swal2-html-container) { color:var(--ink); }
  [data-bs-theme="dark"] .swal2-footer { border-color:var(--line); color:var(--muted); }
  [data-bs-theme="dark"] .swal2-success-circular-line-left,
  [data-bs-theme="dark"] .swal2-success-circular-line-right,
  [data-bs-theme="dark"] .swal2-success-fix { background-color:var(--surface) !important; }
}
@media screen and (min-width:992px) {
  .sidebar { width:280px; }
  .main-shell { margin-left:280px; }
  .account-card strong { max-width:150px; }
}
@media screen and (max-width:1199px) {
  .room-switcher { flex-wrap:wrap; }
  .room-select-form { flex:1 1 360px; }
  .topbar-actions .role-pill { display:none; }
}
@media screen and (max-width:767px) {
  .topbar { gap:10px; padding:0 14px; }
  .topbar > div { min-width:0; }
  .topbar-actions { flex-shrink:0; gap:8px !important; }
  .breadcrumb-label { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .theme-toggle { padding:10px; }
  .topbar .theme-label { display:none; }
  .theme-floating { top:12px; right:14px; }
  .theme-floating .theme-label { font-size:13px; }
  .auth-form-panel { padding-top:85px; }
  .page-heading h1 { font-size:28px; }
  .page-heading p { font-size:15px; }
  .stat-label { font-size:13px; }
  .stat-value { font-size:32px; }
  .stat-card p { font-size:12px; }
  .room-select-form { flex-basis:auto; width:100%; }
  .room-select-form .form-select { font-size:14px; }
  .room-people { grid-template-columns:1fr; }
  .panel-header { flex-wrap:wrap; }
  .panel-header > div, .panel-header form { min-width:0; max-width:100%; }
  .panel-header form .form-select { min-width:0; }
  .search-field { max-width:100%; }
  .search-field input { width:230px; max-width:100%; }
  .score-number { width:72px; flex-shrink:0; }
  .rubric-item .form-label { font-size:15px; }
  .modal-footer { gap:16px; }
  .app-footer { font-size:12px; }
}
/* Larger event identity on the login page, with uncropped responsive images. */
@media screen {
  .login-page { grid-template-columns:42% 58%; }
  .login-page .auth-form-panel { padding:70px clamp(28px,3.5vw,64px); }
  .login-page .auth-logo { display:block; width:480px; max-width:100%; max-height:180px; height:auto; }
  .login-page .auth-art { padding:80px 28px 48px; }
  .login-page .auth-art-content { width:100%; max-width:1100px; }
  .login-page .event-banner { display:block; width:100%; height:auto; max-height:80vh; object-fit:contain; }
}
@media screen and (max-width:991px) {
  .login-page { grid-template-columns:44% 56%; }
  .login-page .auth-form-panel { padding-left:24px; padding-right:24px; }
  .login-page .auth-art { padding-left:20px; padding-right:20px; }
}
@media screen and (max-width:767px) {
  .login-page { grid-template-columns:minmax(0,1fr); }
  .login-page .auth-form-panel { max-width:560px; min-height:auto; padding:85px 24px 40px; }
  .login-page .auth-logo { width:100%; max-height:150px; }
  .login-page .auth-art { display:flex; padding:36px 16px; }
  .login-page .event-banner { max-height:none; }
}
@media print {
  .theme-toggle { display:none !important; }
  :root, [data-bs-theme="dark"] { color-scheme:light; --bs-body-color:#0f172a; --bs-body-bg:#fff; --bs-heading-color:#0f172a; --bs-border-color:#d5dbe5; }
  body, .print-page { color:#0f172a !important; background:#fff !important; }
}
