/* Role panels are embedded in the cabinet. The cabinet owns authorization. */
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) {
  --role-bg: var(--p-bg, #0d0e11);
  --role-card: var(--p-surface, #15161b);
  --role-border: var(--p-line, rgba(255,255,255,.08));
  --role-text: var(--p-text, #f2f2f4);
  --role-muted: var(--p-muted, #999ba6);
  --role-accent: var(--p-accent, #b0a1ed);
  font-family: var(--p-font, Inter, 'Segoe UI', sans-serif);
  color: var(--role-text);
  font-size: 14px;
  line-height: 1.65;
}
:is(#adminPanel, #mediaPanel) { margin-top: 54px; padding-top: 0; scroll-margin-top: 120px; }
:is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin: 0 0 24px; padding: 0;
}
:is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) p {
  margin: 0 0 10px; color: var(--role-accent); font-size: 13px;
  font-weight: 500; letter-spacing: 0; text-transform: none;
}
:is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) h2 {
  margin: 0; font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.035em;
}
:is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) > span { color: var(--role-muted); font-size: 13px; }
:is(#adminPanel, #mediaPanel) :is(.card, .role-card) {
  border: 1px solid var(--role-border); border-radius: 12px;
  background: var(--role-card); box-shadow: none;
}
#mediaPanel > .role-card, #adminPanel > .role-card { margin-top: 16px; padding: 28px; }
#adminPanel .admin-quick-note {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 0 0 16px; padding: 16px 20px; border: 1px solid var(--role-border);
  border-radius: 10px; background: var(--role-card); box-shadow: none;
  color: var(--role-muted); font-size: 13px;
}
#adminPanel .realtime-dot { color: var(--role-muted); white-space: nowrap; }
#adminPanel .realtime-dot::before { background: var(--role-accent); box-shadow: none; }
#adminPanel .admin-shell { padding: 0; overflow: hidden; }
#adminPanel .admin-tabs-nav {
  display: flex; gap: 4px; padding: 8px; overflow-x: auto;
  border: 0; border-bottom: 1px solid var(--role-border); border-radius: 0;
  background: var(--role-card); scrollbar-width: thin; scrollbar-color: #36333e transparent;
}
#adminPanel .tab-btn {
  min-height: 42px; padding: 10px 16px; border: 1px solid transparent;
  border-radius: 7px; background: transparent; box-shadow: none;
  color: var(--role-muted); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
#adminPanel .tab-btn:hover { color: var(--role-text); background: #202027; }
#adminPanel .tab-btn.active { border-color: #b0a1ed26; background: #b0a1ed13; color: var(--role-accent); }
#adminPanel .admin-tabs-content { padding: 28px; overflow: visible; }
#adminPanel .admin-section { min-width: 0; }
#adminPanel .collapsible-head { gap: 20px; padding: 0; }
#adminPanel .collapsible-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
#adminPanel .collapsible-body { padding-top: 24px; }
:is(#adminPanel, #mediaPanel) .admin-divider { height: 1px; margin: 24px 0; background: var(--role-border); }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) h3,
#adminPanel > .role-card h2 { margin: 0 0 16px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
#mediaPanel .role-section-heading { margin-bottom: 24px; }
#mediaPanel .role-section-heading h3 { margin-bottom: 8px; font-size: 21px; }
#mediaPanel .role-section-heading p { margin: 0; color: var(--role-muted); }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) :is(.file-hint, .detail-muted, .section-copy) {
  color: var(--role-muted); font-size: 13px; line-height: 1.7;
}
:is(#adminPanel, #mediaPanel) .file-hint + .file-hint { margin-top: 10px; }
:is(#adminPanel, #mediaPanel) .section-note { margin-top: 18px; }
:is(#adminPanel, #mediaPanel) :is(.form-grid, .two-column-form) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px;
}
:is(#adminPanel, #mediaPanel, #adminUserModal) label {
  display: block; margin: 0 0 16px; color: #c1c0c9; font-size: 13px; font-weight: 400;
}
:is(#adminPanel, #mediaPanel) :is(.form-grid, .two-column-form) > label { margin-bottom: 0; }
:is(#adminPanel, #mediaPanel, #adminUserModal) :is(input, select, textarea) {
  max-width: 100%; border: 1px solid #ffffff14; border-radius: 8px;
  background: var(--role-bg); color: var(--role-text); font-family: inherit; font-size: 14px; box-shadow: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
:is(#adminPanel, #mediaPanel, #adminUserModal) :is(input:not([type=checkbox]):not([type=file]), select) {
  width: 100%; min-height: 46px; margin-top: 8px; padding: 10px 13px;
}
:is(#adminPanel, #mediaPanel, #adminUserModal) :is(input, select, textarea):focus {
  border-color: var(--role-accent); box-shadow: 0 0 0 3px #b0a1ed0d;
}
:is(#adminPanel, #mediaPanel, #adminUserModal) input::placeholder { color: #6f707b; }
:is(#adminPanel, #mediaPanel, #adminUserModal) input[type=checkbox] {
  width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: var(--role-accent);
}
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; width: auto; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 8px; background: var(--role-accent); color: #16121f;
  font-size: 14px; font-weight: 500; line-height: 1.4; box-shadow: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn:hover { background: #c2b5f3; transform: translateY(-1px); box-shadow: none; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn:active { transform: translateY(0) scale(.98); }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn.ghost { border-color: #ffffff14; background: #ffffff04; color: var(--role-text); }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn.ghost:hover { border-color: #b0a1ed4d; background: #b0a1ed0d; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .btn.small { min-height: 38px; padding: 8px 14px; font-size: 13px; }
#adminPanel .collapsible-toggle { flex: 0 0 auto; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) .table-wrap {
  max-width: 100%; overflow-x: auto; border: 1px solid var(--role-border); border-radius: 8px;
  background: var(--role-bg); box-shadow: none; scrollbar-width: thin; scrollbar-color: #36333e transparent;
}
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13px; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) :is(th, td) { padding: 13px 16px; border-bottom: 1px solid #ffffff0a; line-height: 1.55; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) th {
  background: #ffffff03; color: var(--role-muted); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0;
}
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) td { color: #c8c7d0; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) td small { font-size: 12px; color: var(--role-muted); }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) tbody tr:last-child td { border-bottom: 0; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) td .btn { min-height: 34px; margin-top: 2px; padding: 6px 10px; font-size: 12px; }
#mediaPanel .media-keys-table table { min-width: 0; }
#mediaPanel .media-keys-table td:first-child { overflow-wrap: anywhere; }
#mediaPanel .media-promo-box {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
}
#mediaPanel .media-promo-box p { margin: 0; font-size: 13px; color: var(--role-muted); }
#mediaPanel .media-promo-box > .file-hint { max-width: 330px; }
#mediaPanel .media-promo-box .promo-code {
  display: block; margin-top: 9px; color: var(--role-accent); font-family: inherit;
  font-size: 26px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere;
}
#mediaPanel .finance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
#mediaPanel .finance-card { padding: 20px; border: 1px solid var(--role-border); border-radius: 9px; background: var(--role-bg); box-shadow: none; }
#mediaPanel .finance-card small { color: var(--role-muted); font-size: 13px; }
#mediaPanel .finance-card strong { margin-top: 10px; color: var(--role-accent); font-size: 30px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
#mediaPanel .payout-box { margin: 0 0 28px; padding: 24px 0; border: 0; border-top: 1px solid var(--role-border); border-bottom: 1px solid var(--role-border); border-radius: 0; background: none; box-shadow: none; }
#mediaPanel .remember-payment { align-items: flex-start; gap: 10px; margin: 18px 0; }
#mediaPanel .remember-payment input { margin-top: 3px; }
#mediaPanel .remember-payment label { margin: 0; color: var(--role-muted); }
#mediaPanel .revenue-value { color: var(--role-accent); font-weight: 500; }
#adminPanel .check-row {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 50px;
  padding: 12px 14px; border: 1px solid var(--role-border); border-radius: 8px; background: var(--role-bg); box-shadow: none;
}
#adminPanel .version-access-row { grid-template-columns: minmax(0,1fr) minmax(170px,240px); gap: 20px; border-color: var(--role-border); }
#adminPanel .version-access-row .check-row, #adminPanel .version-access-row > label { margin-bottom: 0; }
#adminPanel .update-dropzone { border-color: #ffffff24; border-radius: 9px; background: var(--role-bg); box-shadow: none; }
#adminPanel .update-dropzone:hover, #adminPanel .update-dropzone.is-dragging { border-color: var(--role-accent); background: #b0a1ed08; }
#adminPanel .update-dropzone.has-file { border-color: #b0a1ed55; background: #b0a1ed0a; }
#adminPanel .update-dropzone.is-invalid { border-color: #ef9292; background: #ef929208; }
#adminPanel .update-dropzone-icon { background: #b0a1ed0d; color: var(--role-accent); box-shadow: none; }
#adminPanel .update-dropzone-copy strong { font-size: 14px; font-weight: 500; }
#adminPanel .update-dropzone-copy small { font-size: 13px; color: var(--role-muted); }
:is(#adminUserModal, #adminDetectionModal) .overlay-modal-panel { border: 1px solid var(--role-border); border-radius: 12px; background: var(--role-card); }
:is(#adminUserModal, #adminDetectionModal) .overlay-modal-panel h2 { font-size: 27px; }
:is(#adminUserModal, #adminDetectionModal) .overlay-modal-lead { font-size: 14px; color: var(--role-muted); }
:is(#adminUserModal, #adminDetectionModal) .badge { color: var(--role-accent); font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
:is(#adminUserModal, #adminDetectionModal) :is(.user-detail-control, .user-detail-item, .detail-row, .user-detail-json) { border-color: var(--role-border); border-radius: 8px; background: var(--role-bg); box-shadow: none; }
:is(#adminUserModal, #adminDetectionModal) :is(.user-detail-control p, .user-detail-item small) { color: var(--role-muted); font-size: 13px; }
:is(#adminUserModal, #adminDetectionModal) .user-detail-item { padding: 16px; }
:is(#adminUserModal, #adminDetectionModal) .user-detail-item strong { font-size: 14px; font-weight: 500; }
:is(#adminUserModal, #adminDetectionModal) .detail-row { font-size: 13px; }
:is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) :is(.event-type-pill, .beta-chip, .password-reset-chip) { border-color: #b0a1ed26; background: #b0a1ed0d; color: var(--role-accent); font-size: 11px; font-weight: 500; }
@media (max-width: 760px) {
  :is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) { display: block; }
  :is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) > span { display: block; margin-top: 12px; }
  #adminPanel .admin-quick-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  #mediaPanel .media-promo-box { align-items: flex-start; flex-direction: column; gap: 18px; }
  #mediaPanel .media-promo-box > .file-hint { max-width: none; }
  :is(#adminUserModal, #adminDetectionModal) :is(.user-detail-controls, .user-detail-summary) { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :is(#adminPanel, #mediaPanel) { margin-top: 40px; }
  :is(#adminPanel, #mediaPanel) :is(.admin-heading, .role-heading) h2 { font-size: 27px; }
  #mediaPanel > .role-card, #adminPanel > .role-card, #adminPanel .admin-tabs-content { padding: 20px; }
  #adminPanel .admin-tabs-nav { padding: 6px; }
  #adminPanel .tab-btn { padding: 10px 13px; font-size: 13px; }
  #adminPanel .collapsible-head { align-items: flex-start; gap: 16px; }
  #adminPanel .collapsible-head h2 { padding-top: 8px; font-size: 16px; line-height: 1.35; }
  #adminPanel .collapsible-toggle { min-height: 38px; padding-inline: 10px; font-size: 12px; }
  :is(#adminPanel, #mediaPanel) :is(.form-grid, .two-column-form), #adminPanel .version-access-row { grid-template-columns: 1fr; gap: 14px; }
  #adminPanel .search-row { align-items: stretch; flex-direction: column; }
  #adminPanel .search-row .btn { align-self: flex-start; }
  #mediaPanel .finance-grid { grid-template-columns: 1fr; gap: 12px; }
  #mediaPanel .finance-card { padding: 18px; }
  #mediaPanel .payout-box .btn { width: 100%; }
  :is(#adminPanel, #mediaPanel, #adminUserModal) :is(input:not([type=checkbox]):not([type=file]), select) { font-size: 16px; }
  :is(#adminUserModal, #adminDetectionModal) .detail-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#adminPanel, #mediaPanel, #adminUserModal, #adminDetectionModal) * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
