/* Account and administration surfaces share the YunTV paper / ink / orange palette. */
.portal-page { min-height: 100vh; }
.portal-page input, .portal-page select { font: inherit; }
.portal-page fieldset { border: 0; min-width: 0; padding: 0; margin: 0; }
.portal-page button:disabled { opacity: .5; cursor: not-allowed; }
.portal-page :focus-visible { outline: 2px solid #a53e1b; outline-offset: 4px; }
.portal-kicker { font-size: 11px; letter-spacing: .12em; color: var(--muted); margin: 0 0 18px; }
.portal-page .auth-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.portal-page .auth-panel { min-width: 0; padding: 48px 56px; }
.portal-page .auth-panel .portal-kicker { margin-bottom: 12px; }
.portal-page .auth-panel h2 { font-size: 29px; }
.portal-page .auth-panel .field { margin-bottom: 15px; }
.portal-page #account-help { margin: -6px 0 20px; }
.portal-page .auth-panel .auth-preview { margin-top: 20px; }
.portal-page #auth-submit { width: 100%; margin-top: 6px; }
.portal-page #auth-message { margin-top: 20px; }
.portal-page #auth-retry { border: 0; border-bottom: 1px solid; padding: 5px 0; background: transparent; }
.portal-page .admin-poster { background: var(--ink); color: var(--paper); }
.portal-page .admin-poster h1 { font-size: clamp(42px, 5.6vw, 78px); }
.portal-page .admin-poster .poster-line { background: var(--orange); }
.portal-page .admin-poster .eyebrow { color: var(--paper); }
.portal-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 27px 0; color: var(--muted); font-size: 12px; }
.portal-footer .container { display: flex; justify-content: space-between; gap: 20px; }
.portal-main { padding-top: 52px; padding-bottom: 30px; }
.portal-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 36px; }
.portal-heading h1 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.25; letter-spacing: -.05em; margin: 0 0 15px; }
.portal-heading p:not(.portal-kicker) { color: var(--muted); font-size: 14px; line-height: 1.8; }
.portal-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.portal-card { border: 1px solid var(--line); background: var(--paper-light); padding: 32px; min-width: 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.card-heading h2 { font-size: 23px; font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); padding: 4px 8px; font-size: 11px; line-height: 1.5; white-space: nowrap; color: var(--muted); }
.badge-good { background: #e3eadc; color: #395331; border-color: #a5b39a; }
.badge-warning { background: #f5e4cc; color: #79521b; border-color: #d9bd94; }
.badge-danger { background: #f1ded6; color: #8f3824; border-color: #d6ac9d; }
.profile-list { margin: 0; }
.profile-list > div { display: flex; gap: 24px; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 17px 0; font-size: 13px; line-height: 1.7; }
.profile-list dt { color: var(--muted); flex-shrink: 0; }
.profile-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.inline-note { font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 22px; }
.entitlement-card .portal-actions { margin-top: 25px; }
.notice { padding: 14px 17px; border: 1px solid var(--line); font-size: 13px; line-height: 1.8; color: var(--muted); margin-bottom: 20px; background: var(--paper-light); }
.notice-error { color: #8d2d19; border-color: #c89987; background: #f4e3db; }
.notice-warning { color: #76501c; border-color: #d0b390; background: #f2e7d5; }
.notice-success { color: #35532d; border-color: #a5b59c; background: #e5ebdc; }
.loading-state { padding: 35px 0; color: var(--muted); font-size: 14px; }
.device-card { margin-top: 24px; }
.empty-state { text-align: center; color: var(--muted); padding: 45px 24px; font-size: 13px; line-height: 1.9; }
.empty-state strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 8px; font-weight: 500; }
.empty-state .text-link { display: inline-block; margin-top: 16px; }
.device-list { list-style: none; padding: 0; }
.device-item { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 18px 0; font-size: 14px; }
.device-item small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.admin-header { min-height: 92px; padding: 18px 36px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.admin-label { padding-left: 28px; border-left: 1px solid var(--line); font-size: 13px; }
.admin-header-actions { margin-left: auto; display: flex; align-items: center; gap: 26px; font-size: 13px; }
.admin-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - 92px); }
.admin-sidebar { border-right: 1px solid var(--line); padding: 36px 22px; display: flex; flex-direction: column; }
.admin-sidebar nav { display: grid; gap: 9px; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 15px 12px; font-size: 13px; }
.admin-sidebar nav a[aria-current] { background: var(--ink); color: var(--paper); }
.admin-sidebar nav a:hover { background: #171a1810; }
.admin-sidebar nav a[aria-current]:hover { background: #30352f; }
.nav-index { margin-left: auto; opacity: .5; font-size: 10px; }
.sidebar-note { margin-top: auto; padding-top: 50px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.sidebar-note p { margin-top: 12px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #57764a; margin-right: 5px; }
.admin-main { padding: 38px clamp(22px, 3vw, 48px) 55px; min-width: 0; }
.admin-main .portal-heading h1 { font-size: clamp(29px, 3vw, 43px); }
.admin-main .portal-heading { margin-bottom: 30px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 32px; border: 1px solid var(--line); }
.stats-grid article { padding: 22px 24px; min-width: 0; border-right: 1px solid var(--line); }
.stats-grid article:last-child { border-right: 0; }
.stats-grid span { display: block; font-size: 12px; }
.stats-grid strong { display: block; font-size: 42px; font-weight: 600; letter-spacing: -.06em; line-height: 1.5; }
.stats-grid small { font-size: 10px; color: #51574a; }
.stats-grid .stat-accent { background: var(--orange); }
.user-directory { background: var(--paper-light); border: 1px solid var(--line); min-width: 0; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 26px 0; }
.directory-heading h2 { font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.directory-heading p { font-size: 12px; color: var(--muted); }
.filter-form { display: flex; align-items: flex-end; gap: 12px; padding: 25px 26px; flex-wrap: wrap; }
.filter-form label { display: block; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.filter-form input, .filter-form select, .pagination select, .user-dialog select { min-height: 42px; border: 1px solid var(--line); padding: 8px 11px; background: transparent; border-radius: 0; color: var(--ink); font-size: 12px; max-width: 100%; }
.filter-form .search-field { flex: 1; min-width: 180px; }
.filter-form input { width: 100%; }
.filter-form .btn { min-height: 42px; padding: 8px 17px; }
.table-wrap { overflow: auto; max-width: 100%; }
.users-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
.users-table th { background: #e7e1d6; color: var(--muted); font-size: 11px; font-weight: 400; padding: 14px 20px; white-space: nowrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.users-table td { padding: 20px; border-bottom: 1px solid #d9d3c7; vertical-align: middle; line-height: 1.8; }
.users-table th:first-child, .users-table td:first-child { padding-left: 26px; }
.users-table tbody tr:hover { background: #e8e2d744; }
.user-identifier { min-width: 160px; max-width: 280px; overflow-wrap: anywhere; font-size: 13px; }
.user-id { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.date-cell { white-space: nowrap; color: var(--muted); font-size: 11px; }
.role-cell .badge { margin-top: 5px; }
.detail-button { border: 0; background: transparent; border-bottom: 1px solid var(--ink); color: var(--ink); padding: 7px 0; white-space: nowrap; font-size: 12px; }
.pagination { padding: 20px 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); }
.pagination > div { display: flex; gap: 8px; align-items: center; }
.pagination .btn { font-size: 11px; padding: 9px 12px; min-height: 38px; }
.directory-note { padding: 0 26px 22px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.user-dialog { width: min(620px, calc(100% - 32px)); max-height: 88dvh; overflow: auto; margin: auto; padding: 30px; border: 1px solid var(--line); color: var(--ink); background: var(--paper-light); }
.user-dialog::backdrop { background: #171a18aa; }
.user-dialog h2 { font-size: 25px; overflow-wrap: anywhere; }
.user-dialog .dialog-top { margin-bottom: 20px; }
.user-dialog .dialog-top .portal-kicker { margin: 0; }
.entitlement-editor { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.entitlement-editor summary { cursor: pointer; font-size: 14px; margin-bottom: 20px; }
.mfa-enrollment { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 20px; }
.mfa-enrollment summary { cursor: pointer; margin-bottom: 15px; font-size: 14px; }
.auth-panel select, .secret-value { width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--paper-light); padding: 10px; font: inherit; }
.secret-value { font-family: monospace; margin: 12px 0 18px; }
.recovery-codes { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); padding: 16px; background: var(--paper); user-select: all; }
.account-management { margin-top: 24px; }
.account-management .notice { margin-top: 20px; }
.release-directory { margin-top: 32px; }
.release-directory .directory-heading { margin-bottom: 24px; }
.release-directory .notice { margin: 20px 26px; }
.release-directory .file-hash { display: block; font-family: monospace; font-size: 10px; overflow-wrap: anywhere; max-width: 240px; margin-top: 8px; }
.release-action { display: block; margin-bottom: 9px; }
.user-dialog select { width: 100%; }
[data-page="admin"] .portal-footer { margin-top: 0; }
@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 180px minmax(0, 1fr); }
  .admin-sidebar { padding: 30px 14px; }
  .stats-grid article { padding: 18px; }
  .portal-page .auth-panel { padding: 40px 32px; }
}
@media (max-width: 800px) {
  .admin-header { padding: 16px 22px; min-height: 76px; gap: 16px; }
  .admin-label { padding-left: 16px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 20px; }
  .admin-sidebar nav { display: flex; gap: 6px; }
  .admin-sidebar nav a { padding: 12px; }
  .admin-sidebar .portal-kicker, .sidebar-note, .nav-index { display: none; }
  .admin-main { padding: 30px 22px; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .portal-page .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .portal-page .auth-panel { padding: 30px 24px; }
  .portal-page .auth-panel h2 { font-size: 26px; }
  .portal-page .admin-poster h1 { font-size: 13vw; }
  .portal-page .nav-actions { font-size: 11px; gap: 10px; }
  .portal-page .nav-actions .btn { padding: 8px 10px; }
  .portal-heading { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .portal-main { padding-top: 32px; }
  .portal-card { padding: 24px; }
  .portal-footer .container { display: block; line-height: 2; }
  .portal-footer span { display: block; }
  .admin-header { padding: 16px 20px; gap: 10px; flex-wrap: wrap; }
  .admin-label { font-size: 11px; padding-left: 12px; }
  .admin-header-actions { gap: 12px; font-size: 11px; }
  .admin-header-actions > a { display: none; }
  .admin-header-actions .btn { padding: 8px 10px; min-height: 38px; font-size: 11px; }
  .admin-sidebar { padding: 10px 16px; }
  .admin-sidebar nav a { font-size: 12px; padding: 10px; gap: 6px; }
  .admin-main { padding: 28px 20px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid article:nth-child(2) { border-right: 0; }
  .stats-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-grid strong { font-size: 36px; }
  .directory-heading { padding: 22px 18px 0; }
  .filter-form { padding: 20px 18px; gap: 10px; }
  .filter-form .search-field { flex-basis: 100%; }
  .filter-form > div:not(.search-field) { flex: 1; min-width: 90px; }
  .filter-form select { width: 100%; }
  .pagination { flex-direction: column; align-items: flex-start; padding: 18px; }
  .pagination > div { flex-wrap: wrap; }
  .directory-note { padding-left: 18px; padding-right: 18px; }
  .user-dialog { padding: 22px; }
  .profile-list > div { gap: 14px; }
}
