/* ===== screens.css ===== */
.android-tv-title b{font-size:15px;color:var(--android-tv-text);}
.android-tv-title small{display:block;margin-top:2px;font-size:11px;color:var(--android-tv-muted);}
.android-tv-top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.android-tv-token-pill{font-size:11px;padding:5px 10px;border-radius:999px;border:1px solid var(--android-tv-border-strong);font-weight:700;}
.android-tv-token-pill.ok{background:var(--android-tv-green-soft);border-color:#bfe7d6;color:var(--android-tv-green);}
.android-tv-token-pill.warn{background:var(--android-tv-amber-soft);border-color:#f1d39b;color:var(--android-tv-amber);}
.android-tv-top-actions .btn.soft{background:#fff;border:1px solid var(--android-tv-border);color:var(--android-tv-blue);}

.android-tv-section{padding:12px;border:1px solid var(--android-tv-border);border-radius:16px;background:var(--android-tv-soft);}
.android-tv-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.android-tv-section-head b{display:inline-flex;align-items:center;gap:8px;color:var(--android-tv-text);font-size:13px;}
.android-tv-section-head small{font-size:11px;color:var(--android-tv-muted);}

.android-tv-status-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0;}
.android-tv-status-grid span{
  position:relative;padding:10px 10px 10px 12px;border-radius:14px;background:#fff;border:1px solid var(--android-tv-border);
  box-shadow:0 4px 12px rgba(15,23,42,.035);
}
.android-tv-status-grid span::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:14px 0 0 14px;background:linear-gradient(180deg,var(--android-tv-blue),var(--android-tv-blue-2));
}
.android-tv-status-grid .icon{grid-row:1/3;color:var(--android-tv-blue);width:16px;height:16px;}
.android-tv-status-grid b{font-size:9px;color:var(--android-tv-muted);text-transform:uppercase;letter-spacing:.08em;}
.android-tv-status-grid em{font-size:11px;line-height:1.35;max-height:none;color:#102130;font-weight:600;}

.android-tv-two-col{display:grid;grid-template-columns:1.1fr 1.35fr;gap:10px;margin-top:10px;}
.android-tv-watchdog-card,
.android-tv-set-url-card{
  margin:0;padding:12px;border-radius:16px;background:#fff;border:1px solid var(--android-tv-border);box-shadow:0 6px 16px rgba(15,23,42,.04);
}
.android-tv-watchdog-main{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:start;}
.android-tv-watchdog-main>span{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:var(--android-tv-green-soft);color:var(--android-tv-green);}
.android-tv-watchdog-main b{display:block;font-size:13px;color:var(--android-tv-text);margin-bottom:2px;}
.android-tv-watchdog-main small{display:block;font-size:11px;line-height:1.5;color:var(--android-tv-muted);}
.android-tv-watchdog-card .btn{margin-top:10px;}
.android-tv-set-url-card{display:flex;flex-direction:column;justify-content:space-between;gap:10px;}
.android-tv-url-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
.android-tv-url-head b{display:inline-flex;align-items:center;gap:7px;color:var(--android-tv-text);font-size:13px;}
.android-tv-url-head small{font-size:11px;color:var(--android-tv-muted);text-align:right;max-width:220px;}
.android-tv-set-url-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;}
.android-tv-set-url-row .input{height:38px;background:#fbfdfe;border-color:var(--android-tv-border);border-radius:12px;font-size:12px;}

.android-tv-controls-section{margin-top:10px;}
.android-tv-control-actions{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:0;}
.android-tv-control-actions .btn{
  min-height:42px;padding:9px 8px;border-radius:14px;font-size:11px;font-weight:700;justify-content:center;
  border-width:1px;box-shadow:none;
}
.android-tv-control-actions .btn.small .icon{width:14px;height:14px;}
.android-tv-control-actions .btn.warning{background:#fff4e5;border-color:#f1d39b;color:var(--android-tv-amber);}
.android-tv-control-actions .btn.ghost{background:#f8fbfd;border-color:var(--android-tv-border);color:var(--android-tv-text);}
.android-tv-control-actions .btn.primary.soft{background:var(--android-tv-blue-soft);border-color:#bfd4df;color:var(--android-tv-blue);}
.android-tv-control-actions .btn.danger{background:var(--android-tv-red-soft);border-color:#f2c1b9;color:var(--android-tv-red);}
.android-tv-last-command{display:block;padding:9px 12px;border-radius:12px;background:#f8fbfd;border:1px dashed var(--android-tv-border);color:var(--android-tv-muted);}
.android-tv-last-command b{color:var(--android-tv-text);}

/* Operating schedule light-theme reference */
.android-tv-schedule-modal{padding:0;gap:0;overflow:hidden;}
.android-tv-schedule-shell{padding:0;border:1px solid var(--android-tv-border);border-radius:18px;background:#fff;overflow:hidden;box-shadow:0 10px 28px rgba(15,23,42,.05);}
.android-tv-schedule-device{padding:11px 14px;background:#f8fbfd;border-bottom:1px solid #edf3f6;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.android-tv-schedule-device b{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#314554;}
.android-tv-schedule-device .badge{font-size:11px;padding:4px 9px;border-radius:999px;background:var(--android-tv-blue-soft);border:1px solid #bfd4df;color:var(--android-tv-blue);font-weight:700;}
.android-tv-schedule-inner{padding:12px 14px;}
.android-tv-schedule-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;}
.android-tv-schedule-row{
  grid-template-columns:1fr;gap:6px;padding:9px 7px;border-radius:14px;background:#fff;border:1.5px solid #e5edf2;min-height:0;align-content:start;
}
.android-tv-schedule-row.enabled{background:#f7fbfe;border-color:#c8dcea;box-shadow:0 3px 10px rgba(15,23,42,.03);}
.android-tv-schedule-row.disabled{background:#fafcfd;border-color:#edf3f6;opacity:.78;}
.android-tv-schedule-row label.android-tv-schedule-day{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;}
.android-tv-schedule-day input{width:16px;height:16px;accent-color:var(--android-tv-blue);}
.android-tv-day-badge{display:inline-flex;align-items:center;justify-content:center;padding:3px 9px;border-radius:999px;background:#eff6ff;border:1px solid #cfe1f8;color:#2563eb;font-weight:600;font-size:10px;min-width:44px;}
.android-tv-day-name b{display:block;font-size:11px;color:#3c5060;line-height:1.2;}
.android-tv-day-name small{display:block;font-size:10px;color:#8795a1;margin-top:1px;}
.android-tv-time-pair{display:grid;grid-template-columns:1fr;gap:5px;}
.android-tv-schedule-row .form-row{gap:3px;margin:0;}
.android-tv-schedule-row .form-row label{font-size:9px;text-align:center;letter-spacing:.08em;text-transform:uppercase;color:#92a1ac;}
.android-tv-schedule-row .input{height:31px;min-height:31px;border-radius:8px;border-color:#dde7ed;background:#fff;font-size:11px;text-align:center;padding:4px 6px;}
.android-tv-schedule-row.disabled .input{display:none;}
.android-tv-schedule-row.disabled .android-tv-day-name small{color:#bcc8cf;}
.android-tv-schedule-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px;}
.android-tv-schedule-summary .sum{
  padding:9px 10px;border-radius:12px;background:#f8fbfd;border:1px solid #edf3f6;
}
.android-tv-schedule-summary .sum b{display:block;font-size:10px;color:#93a1ac;text-transform:uppercase;letter-spacing:.08em;margin-bottom:4px;}
.android-tv-schedule-summary .sum span{font-size:13px;color:var(--android-tv-text);font-weight:600;}
.android-tv-schedule-actions{padding:11px 14px;border-top:1px solid #edf3f6;background:#fafcfd;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.android-tv-schedule-actions .hint{font-size:11px;color:#8795a1;display:flex;align-items:center;gap:6px;}
.android-tv-schedule-actions .btn-row{margin:0;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;}
.android-tv-schedule-actions .btn{min-height:36px;padding:8px 12px;font-size:12px;border-radius:12px;}

@media (max-width: 980px){
  .modal:has(.android-tv-control-modal),
  .modal:has(.android-tv-schedule-modal){width:min(95vw, 900px);max-height:min(88vh, 760px);overflow:auto;}
  .android-tv-status-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .android-tv-two-col{grid-template-columns:1fr;}
  .android-tv-control-actions{grid-template-columns:repeat(3,minmax(0,1fr));}
  .android-tv-schedule-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width: 720px){
  .android-tv-topbar{grid-template-columns:1fr;}
  .android-tv-top-actions{justify-content:flex-start;}
  .android-tv-status-grid,
  .android-tv-control-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  .android-tv-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .android-tv-schedule-summary{grid-template-columns:1fr;}
  .android-tv-schedule-actions{flex-direction:column;align-items:stretch;}
}
@media (max-width: 520px){
  .android-tv-status-grid,
  .android-tv-control-actions,
  .android-tv-schedule-grid{grid-template-columns:1fr;}
}

/* TV Health Monitor readability compatibility layer */
.modal:has(.screen-health-modal),
.modal:has(.screen-health-modal),
.modal:has(.screen-health-modal){
  width:min(900px, calc(100vw - 28px));
  max-height:min(780px, calc(100vh - 24px));
  overflow:auto;
}

.screen-health-modal,
.screen-health-modal,
.screen-health-modal{
  padding:16px 18px 18px !important;
  gap:14px !important;
  overflow:visible !important;
}

.screen-health-modal .android-tv-control-title,
.screen-health-modal .android-tv-control-title,
.screen-health-modal .android-tv-control-title{
  padding:12px 14px !important;
  border-radius:16px !important;
  background:#f8fbfc !important;
  border:1px solid rgba(44,92,113,.14) !important;
}
.screen-health-modal .android-tv-control-title b,
.screen-health-modal .android-tv-control-title b,
.screen-health-modal .android-tv-control-title b{
  font-size:16px !important;
  line-height:1.3 !important;
  color:#0f172a !important;
}
.screen-health-modal .android-tv-control-title small,
.screen-health-modal .android-tv-control-title small,
.screen-health-modal .android-tv-control-title small{
  font-size:13px !important;
  line-height:1.4 !important;
  color:#64748b !important;
}

.screen-health-modal .screen-health-panel,
.screen-health-modal .screen-health-panel,
.screen-health-modal .screen-health-panel{
  padding:14px !important;
  border-radius:18px !important;
}
.screen-health-modal .screen-health-head,
.screen-health-modal .screen-health-head,
.screen-health-modal .screen-health-head{
  margin-bottom:12px !important;
  gap:12px !important;
}
.screen-health-modal .screen-health-head > span,
.screen-health-modal .screen-health-head > span,
.screen-health-modal .screen-health-head > span{
  width:42px !important;
  height:42px !important;
  border-radius:14px !important;
}
.screen-health-modal .screen-health-head > span .icon,
.screen-health-modal .screen-health-head > span .icon,
.screen-health-modal .screen-health-head > span .icon{
  width:21px !important;
  height:21px !important;
}
.screen-health-modal .screen-health-head b,
.screen-health-modal .screen-health-head b,
.screen-health-modal .screen-health-head b{
  font-size:15px !important;
  line-height:1.3 !important;
}
.screen-health-modal .screen-health-head small,
.screen-health-modal .screen-health-head small,
.screen-health-modal .screen-health-head small{
  font-size:12.5px !important;
  line-height:1.45 !important;
}

.screen-health-modal .screen-health-grid,
.screen-health-modal .screen-health-grid,
.screen-health-modal .screen-health-grid,
.screen-health-modal .dashboard-tv-health-grid,
.screen-health-modal .dashboard-tv-health-grid,
.screen-health-modal .dashboard-tv-health-grid{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:10px !important;
}
.screen-health-modal .screen-health-grid span,
.screen-health-modal .screen-health-grid span,
.screen-health-modal .screen-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span{
  min-height:82px !important;
  padding:12px 13px !important;
  border-radius:15px !important;
  background:#fff !important;
  border:1px solid rgba(44,92,113,.13) !important;
  box-shadow:0 8px 18px rgba(15,23,42,.035) !important;
}
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon{
  width:20px !important;
  height:20px !important;
  color:#2C5C71 !important;
}
.screen-health-modal .screen-health-grid b,
.screen-health-modal .screen-health-grid b,
.screen-health-modal .screen-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b{
  font-size:11.5px !important;
  line-height:1.25 !important;
  letter-spacing:.045em !important;
  color:#64748b !important;
}
.screen-health-modal .screen-health-grid em,
.screen-health-modal .screen-health-grid em,
.screen-health-modal .screen-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em{
  font-size:14px !important;
  line-height:1.35 !important;
  color:#0f172a !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:break-word !important;
}

.screen-health-modal .dashboard-android-tv-mini,
.screen-health-modal .dashboard-android-tv-mini,
.screen-health-modal .dashboard-android-tv-mini{
  margin-top:10px !important;
  padding:13px !important;
  border-radius:18px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head b,
.screen-health-modal .dashboard-android-tv-mini-head b,
.screen-health-modal .dashboard-android-tv-mini-head b{
  font-size:15px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head small,
.screen-health-modal .dashboard-android-tv-mini-head small,
.screen-health-modal .dashboard-android-tv-mini-head small{
  font-size:12px !important;
}
.screen-health-modal .android-tv-grid span b,
.screen-health-modal .android-tv-grid span b,
.screen-health-modal .android-tv-grid span b{
  font-size:11.5px !important;
}
.screen-health-modal .android-tv-grid span em,
.screen-health-modal .android-tv-grid span em,
.screen-health-modal .android-tv-grid span em{
  font-size:13.5px !important;
}

@media (max-width: 920px){
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width: 560px){
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid{
    grid-template-columns:1fr !important;
  }
}

/* TV Health Monitor compact fit compatibility layer */
.modal:has(.screen-health-modal),
.modal:has(.screen-health-modal),
.modal:has(.screen-health-modal){
  width:min(760px, calc(100vw - 32px)) !important;
  max-height:min(570px, calc(100vh - 28px)) !important;
  overflow:hidden !important;
}

.modal:has(.screen-health-modal) .android-tv-modal-head,
.modal:has(.screen-health-modal) .android-tv-modal-head,
.modal:has(.screen-health-modal) .android-tv-modal-head{
  min-height:44px !important;
  padding:10px 14px !important;
}
.modal:has(.screen-health-modal) .android-tv-modal-head h2,
.modal:has(.screen-health-modal) .android-tv-modal-head h2,
.modal:has(.screen-health-modal) .android-tv-modal-head h2{
  font-size:16px !important;
}
.modal:has(.screen-health-modal) .android-tv-modal-head .close-btn,
.modal:has(.screen-health-modal) .android-tv-modal-head .close-btn,
.modal:has(.screen-health-modal) .android-tv-modal-head .close-btn{
  width:32px !important;
  height:32px !important;
  border-radius:11px !important;
}

.screen-health-modal,
.screen-health-modal,
.screen-health-modal{
  padding:10px 12px 12px !important;
  gap:8px !important;
  overflow:hidden !important;
  max-height:calc(570px - 52px) !important;
}

.screen-health-modal .android-tv-control-title,
.screen-health-modal .android-tv-control-title,
.screen-health-modal .android-tv-control-title{
  padding:8px 11px !important;
  border-radius:13px !important;
}
.screen-health-modal .android-tv-control-title b,
.screen-health-modal .android-tv-control-title b,
.screen-health-modal .android-tv-control-title b{
  font-size:14px !important;
}
.screen-health-modal .android-tv-control-title small,
.screen-health-modal .android-tv-control-title small,
.screen-health-modal .android-tv-control-title small{
  font-size:11.5px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.screen-health-modal .screen-health-panel,
.screen-health-modal .screen-health-panel,
.screen-health-modal .screen-health-panel{
  padding:9px !important;
  border-radius:15px !important;
}
.screen-health-modal .screen-health-head,
.screen-health-modal .screen-health-head,
.screen-health-modal .screen-health-head{
  margin-bottom:7px !important;
  gap:8px !important;
}
.screen-health-modal .screen-health-head > span,
.screen-health-modal .screen-health-head > span,
.screen-health-modal .screen-health-head > span{
  width:34px !important;
  height:34px !important;
  border-radius:12px !important;
}
.screen-health-modal .screen-health-head > span .icon,
.screen-health-modal .screen-health-head > span .icon,
.screen-health-modal .screen-health-head > span .icon{
  width:18px !important;
  height:18px !important;
}
.screen-health-modal .screen-health-head b,
.screen-health-modal .screen-health-head b,
.screen-health-modal .screen-health-head b{
  font-size:13.5px !important;
}
.screen-health-modal .screen-health-head small,
.screen-health-modal .screen-health-head small,
.screen-health-modal .screen-health-head small{
  font-size:11px !important;
  line-height:1.3 !important;
}

.screen-health-modal .screen-health-grid,
.screen-health-modal .screen-health-grid,
.screen-health-modal .screen-health-grid,
.screen-health-modal .dashboard-tv-health-grid,
.screen-health-modal .dashboard-tv-health-grid,
.screen-health-modal .dashboard-tv-health-grid{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:6px !important;
}
.screen-health-modal .screen-health-grid span,
.screen-health-modal .screen-health-grid span,
.screen-health-modal .screen-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span,
.screen-health-modal .dashboard-tv-health-grid span{
  min-height:58px !important;
  padding:7px 8px !important;
  border-radius:11px !important;
  box-shadow:0 4px 12px rgba(15,23,42,.03) !important;
}
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .screen-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon,
.screen-health-modal .dashboard-tv-health-grid .icon{
  width:16px !important;
  height:16px !important;
}
.screen-health-modal .screen-health-grid b,
.screen-health-modal .screen-health-grid b,
.screen-health-modal .screen-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b,
.screen-health-modal .dashboard-tv-health-grid b{
  font-size:9.5px !important;
  line-height:1.2 !important;
  letter-spacing:.045em !important;
}
.screen-health-modal .screen-health-grid em,
.screen-health-modal .screen-health-grid em,
.screen-health-modal .screen-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em,
.screen-health-modal .dashboard-tv-health-grid em{
  font-size:11.5px !important;
  line-height:1.25 !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  word-break:break-word !important;
}

.screen-health-modal .screen-health-error,
.screen-health-modal .screen-health-error,
.screen-health-modal .screen-health-error,
.screen-health-modal .dashboard-tv-health-error,
.screen-health-modal .dashboard-tv-health-error,
.screen-health-modal .dashboard-tv-health-error{
  padding:7px 9px !important;
  border-radius:12px !important;
  font-size:11px !important;
  margin-top:6px !important;
  max-height:40px !important;
  overflow:hidden !important;
}

.screen-health-modal .dashboard-android-tv-mini,
.screen-health-modal .dashboard-android-tv-mini,
.screen-health-modal .dashboard-android-tv-mini{
  margin-top:0 !important;
  padding:9px !important;
  border-radius:15px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head,
.screen-health-modal .dashboard-android-tv-mini-head,
.screen-health-modal .dashboard-android-tv-mini-head{
  margin-bottom:7px !important;
  gap:8px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head > span,
.screen-health-modal .dashboard-android-tv-mini-head > span,
.screen-health-modal .dashboard-android-tv-mini-head > span{
  width:32px !important;
  height:32px !important;
  border-radius:11px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head b,
.screen-health-modal .dashboard-android-tv-mini-head b,
.screen-health-modal .dashboard-android-tv-mini-head b{
  font-size:13px !important;
}
.screen-health-modal .dashboard-android-tv-mini-head small,
.screen-health-modal .dashboard-android-tv-mini-head small,
.screen-health-modal .dashboard-android-tv-mini-head small{
  font-size:10.5px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.screen-health-modal .android-tv-grid span b,
.screen-health-modal .android-tv-grid span b,
.screen-health-modal .android-tv-grid span b{
  font-size:9.5px !important;
}
.screen-health-modal .android-tv-grid span em,
.screen-health-modal .android-tv-grid span em,
.screen-health-modal .android-tv-grid span em{
  font-size:11.3px !important;
}

@media (max-width: 760px){
  .modal:has(.screen-health-modal),
  .modal:has(.screen-health-modal),
  .modal:has(.screen-health-modal){
    width:min(96vw, 760px) !important;
    max-height:calc(100vh - 20px) !important;
    overflow:auto !important;
  }
  .screen-health-modal,
  .screen-health-modal,
  .screen-health-modal{
    overflow:auto !important;
    max-height:none !important;
  }
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width: 520px){
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .screen-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid,
  .screen-health-modal .dashboard-tv-health-grid{
    grid-template-columns:1fr !important;
  }
}


:root {


/* ===== emergency.css ===== */
--primary: #2C5C71;
  --primary-dark: #244d60;
  --primary-light: #3a738a;
  --primary-soft: #e9f2f5;
  --primary-soft-2: #dbeaf0;
  --primary-border: #aac8d3;

  --admin-bg: #f3f7f9;
  --admin-card: #ffffff;
  --admin-card-soft: #f8fbfc;
  --admin-border: #dce8ee;
  --admin-border-strong: #bfd4df;
  --admin-text: #102838;
  --admin-text-soft: #334d5d;
  --admin-muted: #607685;
  --admin-muted-2: #8da1ad;

  --admin-shadow-xs: 0 1px 2px rgba(15, 23, 42, .045);
  --admin-shadow-card: 0 3px 12px rgba(15, 23, 42, .055);
  --admin-shadow-hover: 0 6px 18px rgba(15, 23, 42, .075);
  --admin-shadow-modal: 0 14px 42px rgba(15, 23, 42, .14);
  --admin-focus: 0 0 0 3px rgba(44, 92, 113, .18);

  --font-page-title: clamp(22px, 2vw, 27px);
  --font-card-title: 15.5px;
  --font-body: 13.5px;
  --font-small: 12px;
  --font-button: 12.5px;
}

.health-centre-page { display: grid; gap: 14px; }
.health-centre-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; }
.health-summary-grid .metric { min-height: 92px; }
.health-table-card { overflow: visible; }
.health-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.health-table { display: grid; gap: 10px; }
.health-row { display: grid; grid-template-columns: minmax(210px,1.3fr) repeat(4,minmax(130px,1fr)) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-xs); }
.health-row > div:not(.health-row-actions):not(.health-main-cell) { display: grid; gap: 2px; min-width: 0; }
.health-row span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.health-row b { color: var(--text); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-row small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-main-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.health-status-dot { width: 11px; height: 11px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,.12); flex: 0 0 auto; }
.health-row.online .health-status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,.14); }
.health-row.disabled { opacity: .68; }
.health-row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.health-action-btn { min-height: 34px; min-width: 110px; padding: 0 12px; border-radius: 12px; justify-content: center; }
.health-action-btn .icon { width: 14px; height: 14px; }
.health-search-wrap { min-width: min(360px, 100%); }
@media (max-width: 1100px) { .health-row { grid-template-columns: 1fr 1fr; } .health-row-actions { justify-content: flex-start; } }
@media (max-width: 720px) { .health-centre-hero { flex-direction: column; align-items: stretch; } .health-row { grid-template-columns: 1fr; } }

.health-label { display:inline-flex !important; align-items:center; gap:6px; }
.health-label .icon { width:14px; height:14px; color:#2C5C71; }
.health-action-btn { box-shadow: 0 1px 0 rgba(15,23,42,.03); }
.health-action-btn.btn.primary, .health-action-btn.btn.primary span { color:#fff; }
.health-action-btn.btn.primary .icon { color:#fff; }
.health-action-btn.btn:not(.primary) { color:#1f2937; background:#fff; }
.health-action-btn.btn:not(.primary) .icon { color:#2C5C71; }
.health-row-actions .health-action-btn span { font-weight:700; }


.screen-live-preview-modal { display:grid; gap:12px; }
.screen-live-preview-frame { width:100%; height:min(62vh, 620px); border:1px solid var(--line); border-radius:18px; background:#0f172a; box-shadow:var(--shadow-lg); }
.screen-live-preview-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.screen-preview-modal-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }

/* ── Offline TV Package Status ───────────────────────────────────── */
.offline-cache-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(44, 92, 113, .12), rgba(255,255,255,.96));
  border: 1px solid rgba(44, 92, 113, .16);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
}
.offline-cache-hero h2 { margin: 4px 0 6px; display:flex; align-items:center; gap:10px; font-size: 26px; color: #12313e; }
.offline-cache-hero p { margin: 0; color: #577080; max-width: 760px; }
.offline-cache-hero-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.offline-cache-summary-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.offline-cache-metric {
  background:#fff;
  border:1px solid #e4edf2;
  border-radius: 20px;
  padding: 16px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.offline-cache-metric > span {
  width:46px; height:46px; border-radius:16px; display:grid; place-items:center;
  background:#eef6f8; color:#2C5C71; flex: 0 0 auto;
}
.offline-cache-metric b { display:block; font-size:26px; color:#0f172a; line-height:1; }
.offline-cache-metric small { display:block; margin-top:5px; color:#334155; font-weight:700; }
.offline-cache-metric em { display:block; margin-top:4px; color:#64748b; font-style:normal; font-size:12px; }
.offline-cache-metric.ready > span { background:#ecfdf5; color:#15803d; }
.offline-cache-metric.almost > span { background:#fffbeb; color:#b45309; }
.offline-cache-metric.attention > span { background:#fef2f2; color:#b91c1c; }
.offline-cache-toolbar {
  display:grid;
  grid-template-columns: minmax(240px, 1fr) 220px minmax(260px, 1.2fr);
  gap: 12px;
  align-items:center;
  margin-bottom: 18px;
}
.offline-cache-tip { color:#526979; font-size:13px; display:flex; gap:8px; align-items:flex-start; }
.offline-cache-tip .icon { width:18px; height:18px; flex:0 0 auto; color:#2C5C71; }
.offline-cache-grid {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.offline-cache-card {
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:24px;
  padding:18px;
  box-shadow:0 12px 34px rgba(15,23,42,.07);
  position:relative;
  overflow:hidden;
}
.offline-cache-card::before {
  content:""; position:absolute; inset:0 0 auto 0; height:4px; background:#94a3b8;
}
.offline-cache-card.ready::before { background:#16a34a; }
.offline-cache-card.almost::before { background:#f59e0b; }
.offline-cache-card.partial::before { background:#0ea5e9; }
.offline-cache-card.attention::before { background:#dc2626; }
.offline-cache-card.disabled::before { background:#64748b; }
.offline-cache-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.offline-cache-card h3 { margin:0; color:#0f172a; font-size:19px; }
.offline-cache-card-head p { margin:4px 0 0; color:#64748b; font-size:13px; }
.offline-cache-status { border-radius:999px; padding:7px 10px; font-size:12px; font-weight:600; white-space:nowrap; background:#f1f5f9; color:#475569; }
.offline-cache-status.ready { background:#dcfce7; color:#166534; }
.offline-cache-status.almost { background:#fef3c7; color:#92400e; }
.offline-cache-status.partial { background:#e0f2fe; color:#075985; }
.offline-cache-status.attention { background:#fee2e2; color:#991b1b; }
.offline-cache-progress-row { display:grid; grid-template-columns:78px 1fr; gap:14px; align-items:center; margin:18px 0; }
.offline-cache-ring {
  --pct:0;
  width:76px; height:76px; border-radius:50%; display:grid; place-items:center;
  background: conic-gradient(#2C5C71 var(--pct), #e5edf2 0);
  position:relative; color:#12313e; font-weight:600;
}
.offline-cache-ring::after { content:""; position:absolute; inset:8px; border-radius:50%; background:#fff; }
.offline-cache-ring span { position:relative; z-index:1; font-size:16px; }
.offline-cache-progress-copy b { display:block; color:#0f172a; }
.offline-cache-progress-copy span { display:block; color:#64748b; font-size:13px; margin-top:3px; }
.offline-cache-bar { height:9px; border-radius:999px; overflow:hidden; background:#e5edf2; margin-top:10px; }
.offline-cache-bar i { display:block; height:100%; background:#2C5C71; border-radius:999px; }
.offline-cache-facts { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.offline-cache-facts span { background:#f8fafc; border:1px solid #e2e8f0; border-radius:14px; padding:9px 10px; color:#526979; font-size:12px; display:flex; gap:7px; align-items:center; min-width:0; }
.offline-cache-facts b { color:#1e293b; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.offline-cache-facts .icon { width:16px; height:16px; flex:0 0 auto; color:#2C5C71; }
.offline-cache-warning { margin:10px 0; padding:10px 12px; border-radius:14px; background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; display:flex; gap:8px; align-items:center; font-size:13px; }
.offline-cache-missing, .offline-cache-external { border-top:1px solid #e2e8f0; padding-top:13px; margin-top:12px; }
.offline-cache-subhead { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#0f172a; }
.offline-cache-subhead span { color:#64748b; font-size:12px; }
.offline-cache-missing ul { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:7px; }
.offline-cache-missing li { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-radius:12px; background:#fef2f2; color:#7f1d1d; }
.offline-cache-missing li span { display:flex; align-items:center; gap:7px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.offline-cache-missing li em { color:#991b1b; font-style:normal; font-size:11px; text-transform:uppercase; }
.offline-cache-ok { margin:10px 0 0; color:#166534; display:flex; gap:8px; align-items:center; }
.offline-cache-external { color:#526979; font-size:13px; }
.offline-cache-external b { display:flex; align-items:center; gap:7px; color:#334155; }
.offline-cache-external p { margin:6px 0 0; }
@media (max-width: 1100px) {
  .offline-cache-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offline-cache-grid { grid-template-columns: 1fr; }
  .offline-cache-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .offline-cache-hero { flex-direction:column; }
  .offline-cache-summary-grid { grid-template-columns: 1fr; }
  .offline-cache-facts { grid-template-columns: 1fr; }
}


.screens-hero-actions .btn.success{background:#16a34a;border-color:#12813b;color:#fff;box-shadow:0 14px 28px rgba(22,163,74,.18)}
.pair-modal-head p{margin:4px 0 0;color:#64748b;font-size:13px;line-height:1.45}.pair-wizard-shell{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(420px,1.15fr);gap:18px;padding:0 2px 8px}.pair-setup-panel{display:grid;gap:13px;align-content:start}.pair-setup-card{border:1px solid rgba(44,92,113,.14);background:#f8fbfc;border-radius:18px;padding:14px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center}.pair-setup-card.primary{background:linear-gradient(135deg,#eef7fa,#fff);border-color:#cfe0e8}.pair-setup-card>span{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:#e4f0f4;color:#2C5C71}.pair-setup-card b{display:block;font-size:13px;color:#0f172a}.pair-setup-card code{display:block;margin:5px 0;padding:7px 9px;border-radius:10px;background:#fff;border:1px solid #dbe7ee;color:#21485a;font-size:12px;white-space:normal;word-break:break-all}.pair-setup-card small{display:block;color:#64748b;font-size:11px;line-height:1.35}.pair-steps-list{display:grid;gap:8px}.pair-steps-list article{display:grid;grid-template-columns:auto 1fr;gap:9px;align-items:center;padding:10px 12px;background:#fff;border:1px solid #e5edf2;border-radius:14px}.pair-steps-list b{width:26px;height:26px;border-radius:9px;background:#e9f3f7;color:#2C5C71;display:grid;place-items:center;font-size:12px}.pair-steps-list span{font-size:12.5px;color:#334155;line-height:1.35}.pair-active-list{background:#fff;border:1px solid #e5edf2;border-radius:18px;padding:12px;display:grid;gap:9px}.pair-active-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.pair-active-title b{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:#0f172a}.pair-session-card{width:100%;border:1px solid #dbe7ee;background:#f8fbfc;border-radius:15px;padding:10px;text-align:left;display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:center;cursor:pointer;transition:.18s ease}.pair-session-card:hover{background:#eef7fa;border-color:#bdd7e3;transform:translateY(-1px)}.pair-session-code{font-weight:600;letter-spacing:.11em;font-size:20px;color:#2C5C71;padding:8px 10px;background:#fff;border:1px solid #dbe7ee;border-radius:12px;font-variant-numeric:tabular-nums}.pair-session-card b{display:flex;align-items:center;gap:6px;color:#0f172a;font-size:12px}.pair-session-card small{display:block;color:#64748b;font-size:11px;line-height:1.35}.pair-empty{display:grid;place-items:center;text-align:center;padding:22px 12px;border:1px dashed #cbdce5;border-radius:15px;color:#64748b}.pair-empty .icon{width:26px;height:26px;margin-bottom:6px;color:#2C5C71}.pair-empty b{display:block;color:#0f172a}.pair-empty small{display:block;margin-top:3px}.pair-form-card{display:grid;gap:13px;min-width:0}.pair-form-section{background:#fff;border:1px solid #e2eaf0;border-radius:18px;padding:14px;box-shadow:0 12px 26px rgba(15,23,42,.035)}.pair-form-section.highlighted{background:linear-gradient(135deg,#f0f9ff,#fff);border-color:#bddbe8}.pair-form-section.optional{background:#fbfdfe}.pair-form-title{display:flex;align-items:center;gap:10px;margin-bottom:12px}.pair-form-title>span{width:38px;height:38px;border-radius:13px;background:#e9f3f7;color:#2C5C71;display:grid;place-items:center;flex:0 0 auto}.pair-form-title b{display:block;font-size:13px;color:#0f172a}.pair-form-title small{display:block;color:#64748b;font-size:11.5px;margin-top:2px}.pair-code-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.pair-code-input{font-size:26px!important;font-weight:600!important;letter-spacing:.18em;text-align:center;font-variant-numeric:tabular-nums;height:56px!important;color:#21485a!important}.pair-toggle{height:100%;align-items:center;background:#f8fbfc;border:1px solid #e2eaf0;border-radius:14px;padding:12px}.pair-submit-row{display:flex;justify-content:flex-end;gap:10px;background:#fff;border-top:1px solid #e5edf2;padding:12px 0 0;margin-top:2px}.pair-success-modal{display:grid;gap:16px}.pair-success-hero{display:flex;align-items:center;gap:13px;padding:16px;border-radius:18px;background:linear-gradient(135deg,#ecfdf5,#fff);border:1px solid #bbf7d0}.pair-success-hero>span{width:52px;height:52px;border-radius:18px;background:#16a34a;color:#fff;display:grid;place-items:center}.pair-success-hero b{display:block;font-size:20px;color:#0f172a}.pair-success-hero small{display:block;color:#64748b}.pair-final-url{display:grid;gap:7px;padding:14px;border-radius:16px;background:#f8fbfc;border:1px solid #e2eaf0}.pair-final-url b{display:flex;align-items:center;gap:7px;color:#0f172a}.pair-final-url code{background:#fff;border:1px solid #dbe7ee;border-radius:11px;padding:10px;color:#21485a;word-break:break-all}.pair-success-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pair-success-grid span{display:grid;gap:4px;padding:12px;border-radius:15px;background:#fff;border:1px solid #e2eaf0}.pair-success-grid .icon{color:#2C5C71}.pair-success-grid b{font-size:12px;color:#0f172a}.pair-success-grid em{font-style:normal;font-size:12px;color:#64748b;line-height:1.35}@media(max-width:980px){.pair-wizard-shell{grid-template-columns:1fr}.pair-code-row{grid-template-columns:1fr}.pair-success-grid{grid-template-columns:1fr}}


body:not(.tv-body) .modal:has(.pair-wizard-shell) {
  width: min(1180px, calc(100vw - 28px));
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
body:not(.tv-body) .modal:has(.pair-wizard-shell) .pair-modal-head {
  flex: 0 0 auto;
  margin-bottom: 0;
}
body:not(.tv-body) .pair-wizard-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 2px 0;
  align-items: start;
}
body:not(.tv-body) .pair-form-card {
  min-height: 0;
  padding-bottom: 0;
}
body:not(.tv-body) .pair-submit-row.modal-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin: 6px -2px 0;
  padding: 13px 2px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.78), #fff 38%);
  border-top: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 -12px 28px rgba(15,23,42,.08);
  border-radius: 0 0 18px 18px;
}
body:not(.tv-body) .pair-session-card.is-stale {
  opacity: .65;
  cursor: not-allowed;
}
@media(max-width:980px){
  body:not(.tv-body) .modal:has(.pair-wizard-shell){overflow-y:auto;padding-bottom:20px;}
  body:not(.tv-body) .pair-wizard-shell{overflow:visible;}
  body:not(.tv-body) .pair-submit-row.modal-sticky-actions{margin-left:-20px;margin-right:-20px;padding-left:20px;padding-right:20px;}
}


/* TV Screens card secure URL layout fix
   Keeps the masked heartbeat-token notice under the URL instead of squeezing it into the icon column. */
body:not(.tv-body) .screen-card .screen-card-url {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 4px 8px;
  margin: 10px 0;
  padding: 9px 10px;
  overflow: hidden;
}
body:not(.tv-body) .screen-card .screen-card-url > span {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
}
body:not(.tv-body) .screen-card .screen-card-url > code {
  grid-column: 2;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}
body:not(.tv-body) .screen-card .screen-card-url > small {
  grid-column: 2;
  min-width: 0;
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  word-break: normal;
}
@media (max-width: 520px) {
  body:not(.tv-body) .screen-card .screen-card-url {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 3px 7px;
  }
  body:not(.tv-body) .screen-card .screen-card-url > small {
    font-size: 10px;
  }
}


body:not(.tv-body) .pair-auto-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2C5C71;
  background: #eef7fa;
  border: 1px solid #d4e6ee;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 600;
  line-height: 1.25;
}
body:not(.tv-body) .pair-session-app-url {
  color: #21485a;
  background: #fff;
  border: 1px solid #dbe7ee;
  border-radius: 9px;
  margin-top: 4px;
  padding: 4px 6px;
  word-break: break-all;
}


/* TV Screens cards: compact and balanced */
.screen-card {
  padding: 11px;
  border-radius: 16px;
  overflow: hidden;
}
.screen-card-top { align-items: center; }
.screen-card-title b { font-size: 14px; }
.screen-card-title small { font-size: 11px; }
.screen-card-url { margin: 8px 0; padding: 7px 9px; border-radius: 11px; }
.screen-card-info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.screen-card-info-grid span { padding: 7px 8px; border-radius: 10px; grid-template-columns: 18px 1fr; gap: 1px 6px; }
.screen-card-info-grid .icon { width: 14px; height: 14px; }
.screen-card-info-grid b { font-size: 9px; }
.screen-card-info-grid em { font-size: 11px; }
.screen-card-action-row { gap: 6px; margin-top: 9px; padding-top: 8px; }
.screen-card-action-row .btn { min-height: 29px; padding: 5px 8px; font-size: 10.5px; }
