/* ===== playlists.css ===== */
@media (max-width: 560px) {
  .dashboard-android-tv-actions,
  .android-tv-status-grid,
  .android-tv-control-actions,
  .screen-health-modal .screen-health-grid { grid-template-columns: 1fr; }
  .dashboard-android-tv-preview-frame { max-height: 96px; min-height: 72px; }
  .android-tv-schedule-row { grid-template-columns: 1fr 1fr; }
  .android-tv-schedule-day { grid-column: 1 / -1; }
}

/* Android TV child modals stay compact and return back to parent panel */
.modal:has(.android-tv-volume-modal),
.modal:has(.android-tv-screenshot-modal){
  width:min(520px,calc(100vw - 28px));
  max-height:min(560px,calc(100vh - 26px));
  overflow:hidden;
  padding:14px;
  border-radius:22px;
}
.android-tv-child-head{margin:-2px -2px 10px;padding:11px 12px 9px;border-radius:18px;background:linear-gradient(135deg,#f8fbfc,#e8f1f4);}
.android-tv-child-head h2{font-size:16px;color:#21485A;}
.android-tv-volume-modal{min-width:0;width:100%;gap:10px;}
.android-tv-volume-compact{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 10px;border:1px solid rgba(44,92,113,.12);border-radius:14px;background:#f8fbfc;}
.android-tv-volume-compact b{display:block;font-size:13px;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.android-tv-volume-compact small{display:block;font-size:10.5px;color:#64748b;}
.android-tv-volume-modal .android-tv-volume-value{margin:0;}
.android-tv-volume-modal .android-tv-volume-value span{font-size:1.8rem;}
.android-tv-volume-card{padding:13px;border-radius:15px;box-shadow:none;}
.android-tv-child-actions{justify-content:flex-end;margin-top:0;}
.android-tv-child-actions .btn{min-height:34px;padding:7px 11px;font-size:12px;}
.android-tv-screenshot-modal{max-width:none;width:100%;gap:10px;}
.android-tv-screenshot-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border:1px solid rgba(44,92,113,.12);border-radius:14px;background:#f8fbfc;}
.android-tv-screenshot-title b{font-size:13px;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.android-tv-screenshot-title small{font-size:10.5px;color:#64748b;white-space:nowrap;}
.android-tv-screenshot-frame{min-height:0;height:250px;max-height:42vh;padding:8px;border-radius:16px;}
.android-tv-screenshot-frame img{width:100%;height:100%;max-height:100%;object-fit:contain;border-radius:10px;}

/* Compact Android TV Control, Schedule and Health popup fit */
.modal:has(.android-tv-control-modal){width:min(720px,calc(100vw - 28px));max-height:min(650px,calc(100vh - 24px));}
.android-tv-control-modal{gap:7px;}
.android-tv-control{padding:8px;}
.screen-android-tv-head{margin-bottom:6px;}
.android-tv-status-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:6px 0;}
.android-tv-status-grid span{padding:6px;border-radius:9px;}
.android-tv-status-grid em{font-size:9.5px;max-height:28px;}
.android-tv-set-url-card{padding:8px;margin:6px 0;}
.android-tv-control-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px;}
.android-tv-control-actions .btn{min-height:29px;font-size:10px;padding:5px 6px;}
.android-tv-last-command{font-size:10px;}
.modal:has(.android-tv-schedule-modal){width:min(660px,calc(100vw - 28px));max-height:min(610px,calc(100vh - 24px));}
.android-tv-schedule-modal{gap:6px;}
.android-tv-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
.android-tv-schedule-row{grid-template-columns:minmax(98px,1fr) 78px 78px;gap:4px;padding:5px 6px;border-radius:10px;}
.android-tv-schedule-day{font-size:10.5px;}
.android-tv-schedule-row .input{height:26px;min-height:26px;font-size:10px;}
.modal:has(.screen-health-modal){width:min(720px,calc(100vw - 28px));max-height:min(610px,calc(100vh - 24px));}
.screen-health-modal{gap:7px;}
.screen-health-modal .screen-health-panel{padding:8px;}
.screen-health-modal .screen-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.screen-health-modal .screen-health-grid span{min-height:62px;padding:6px;border-radius:10px;}
.screen-health-modal .dashboard-android-tv-mini{margin-top:7px;padding:8px;border:1px solid rgba(44,92,113,.12);border-radius:14px;background:#f8fbfc;}
.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.screen-health-modal .dashboard-tv-health-grid span{display:grid;grid-template-columns:16px 1fr;gap:0 5px;padding:6px;border-radius:10px;background:#fff;border:1px solid rgba(44,92,113,.10);}
.screen-health-modal .dashboard-tv-health-grid .icon{grid-row:1/3;width:13px;height:13px;color:#2C5C71;}
.screen-health-modal .dashboard-tv-health-grid b{font-size:8.5px;}
.screen-health-modal .dashboard-tv-health-grid em{font-size:9.5px;}

@media(max-width:900px){
  .android-tv-status-grid,.android-tv-control-actions,.screen-health-modal .screen-health-grid,.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:560px){
  .android-tv-status-grid,.android-tv-control-actions,.screen-health-modal .screen-health-grid,.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:1fr;}
  .android-tv-schedule-grid{grid-template-columns:1fr;}
}

/* Watchdog Guard card */
.android-tv-watchdog-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;margin:10px 0;border:1px solid rgba(44,92,113,.16);border-radius:14px;background:linear-gradient(135deg,#f8fbfc,#eef6f8);box-shadow:0 4px 14px rgba(20,40,50,.06)}
.android-tv-watchdog-main{display:flex;align-items:center;gap:10px;min-width:0}
.android-tv-watchdog-main>span{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:rgba(44,92,113,.12);color:#2C5C71;flex:0 0 auto}
.android-tv-watchdog-main b{display:block;font-size:.9rem;color:#18313c}
.android-tv-watchdog-main small{display:block;font-size:.74rem;color:#60717a;line-height:1.35}
.android-tv-watchdog-card.enabled{border-color:rgba(34,197,94,.22);background:linear-gradient(135deg,#f7fff9,#edfdf3)}
.android-tv-watchdog-card.enabled .android-tv-watchdog-main>span{background:rgba(34,197,94,.14);color:#16803a}
.android-tv-watchdog-card.disabled{border-color:rgba(245,158,11,.24);background:linear-gradient(135deg,#fffaf1,#fff5db)}
.android-tv-watchdog-card.disabled .android-tv-watchdog-main>span{background:rgba(245,158,11,.15);color:#b45309}
@media(max-width:760px){.android-tv-watchdog-card{align-items:stretch;flex-direction:column}.android-tv-watchdog-card .btn{width:100%}}


/* Compact Android TV Control + Schedule UI polish */
.modal:has(.android-tv-control-modal){width:min(780px,calc(100vw - 28px));max-height:min(560px,calc(100vh - 24px));overflow:hidden;}
.android-tv-control-modal{padding:10px 12px 12px;gap:7px;max-height:calc(100vh - 78px);overflow:hidden;display:flex;flex-direction:column;}
.android-tv-control-modal .android-tv-control-title{padding:6px 9px;border-radius:12px;background:#f8fbfc;border:1px solid rgba(44,92,113,.10);}
.android-tv-control-modal .android-tv-control-title b{font-size:14px;}
.android-tv-control-modal .android-tv-control-title small{font-size:11px;}
.android-tv-control{display:flex;flex-direction:column;gap:7px;padding:0;border:none;background:transparent;box-shadow:none;}
.android-tv-topbar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 9px;border:1px solid rgba(44,92,113,.12);border-radius:14px;background:linear-gradient(135deg,#f8fbfc,#eef6f8);}
.android-tv-title{display:flex;align-items:center;gap:9px;min-width:0;}
.android-tv-icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:#2C5C71;color:#fff;box-shadow:0 6px 16px rgba(44,92,113,.18);flex:0 0 auto;}
.android-tv-title b{display:block;font-size:13px;color:#18313c;line-height:1.15;}
.android-tv-title small{display:block;font-size:10.5px;color:#60717a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px;}
.android-tv-top-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto;}
.android-tv-token-pill{font-size:9.5px;font-weight:600;border-radius:999px;padding:4px 7px;white-space:nowrap;border:1px solid transparent;}
.android-tv-token-pill.ok{background:#ecfdf5;color:#047857;border-color:rgba(4,120,87,.16);}
.android-tv-token-pill.warn{background:#fff7ed;color:#b45309;border-color:rgba(180,83,9,.18);}
.android-tv-section{border:1px solid rgba(44,92,113,.10);background:#fff;border-radius:14px;padding:7px;}
.android-tv-section-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px;}
.android-tv-section-head b{display:flex;align-items:center;gap:6px;font-size:11.5px;color:#21485A;}
.android-tv-section-head small{font-size:9.5px;color:#64748b;}
.android-tv-status-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:0;}
.android-tv-status-grid span{min-height:42px;padding:6px 7px;border-radius:10px;grid-template-columns:16px minmax(0,1fr);gap:0 5px;}
.android-tv-status-grid .icon{width:13px;height:13px;align-self:center;}
.android-tv-status-grid b{font-size:8.5px;line-height:1.1;}
.android-tv-status-grid em{font-size:9.6px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%;}
.android-tv-two-col{display:grid;grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr);gap:7px;align-items:stretch;}
.android-tv-two-col .android-tv-watchdog-card{margin:0;padding:7px 8px;border-radius:12px;min-height:62px;}
.android-tv-two-col .android-tv-watchdog-main{gap:7px;}
.android-tv-two-col .android-tv-watchdog-main>span{width:28px;height:28px;border-radius:10px;}
.android-tv-two-col .android-tv-watchdog-main b{font-size:11px;}
.android-tv-two-col .android-tv-watchdog-main small{font-size:9.5px;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.android-tv-two-col .android-tv-watchdog-card .btn{min-height:26px;font-size:9.5px;padding:4px 7px;white-space:nowrap;}
.android-tv-set-url-card{margin:0;padding:7px 8px;border-radius:12px;border:1px solid rgba(44,92,113,.12);background:#f8fbfc;display:flex;flex-direction:column;gap:5px;}
.android-tv-url-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;}
.android-tv-url-head b{display:flex;align-items:center;gap:6px;font-size:11px;color:#21485A;}
.android-tv-url-head small{font-size:9.5px;color:#64748b;}
.android-tv-set-url-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;}
.android-tv-set-url-row .input{height:28px;min-height:28px;font-size:10.5px;padding:5px 8px;}
.android-tv-set-url-row .btn{height:28px;min-height:28px;font-size:10px;padding:4px 8px;}
.android-tv-controls-section{padding:7px;}
.android-tv-control-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin:0;}
.android-tv-control-actions .btn{min-height:29px;height:29px;font-size:9.5px;padding:4px 6px;border-radius:9px;justify-content:center;white-space:nowrap;}
.android-tv-error{margin-top:0;font-size:10px;padding:6px 8px;border-radius:10px;}
.android-tv-last-command{font-size:9.5px;margin-top:0;color:#64748b;text-align:right;}

/* Compact child modals */
.modal:has(.android-tv-volume-modal){width:min(390px,calc(100vw - 28px));max-height:min(330px,calc(100vh - 24px));overflow:hidden;}
.android-tv-volume-modal{padding:11px;gap:8px;}
.android-tv-volume-modal .android-tv-volume-compact{padding:8px;border-radius:12px;}
.android-tv-volume-modal .android-tv-volume-card{padding:10px;border-radius:12px;}
.android-tv-volume-modal .android-tv-child-actions .btn{min-height:30px;padding:6px 10px;font-size:11px;}
.modal:has(.android-tv-screenshot-modal){width:min(520px,calc(100vw - 28px));max-height:min(470px,calc(100vh - 24px));overflow:hidden;}
.android-tv-screenshot-modal{padding:10px;gap:8px;}
.android-tv-screenshot-modal .android-tv-screenshot-frame{height:300px;min-height:0;max-height:300px;border-radius:14px;}
.android-tv-screenshot-modal .android-tv-screenshot-frame img{width:100%;height:100%;object-fit:contain;background:#020617;}
.android-tv-screenshot-modal .android-tv-child-actions .btn{min-height:30px;padding:6px 10px;font-size:11px;}

/* No-scroll weekly schedule editor */
.modal:has(.android-tv-schedule-modal){width:min(820px,calc(100vw - 28px));max-height:min(430px,calc(100vh - 24px));overflow:hidden;}
.android-tv-schedule-modal{padding:10px;gap:7px;overflow:hidden;}
.android-tv-schedule-modal .help{font-size:10px;margin:0;color:#64748b;}
.android-tv-schedule-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;}
.android-tv-schedule-row{display:flex;flex-direction:column;gap:5px;padding:7px 6px;border-radius:12px;min-height:106px;background:linear-gradient(180deg,#ffffff,#f8fbfc);}
.android-tv-schedule-row .android-tv-schedule-day{font-size:10px;line-height:1.15;gap:4px;min-height:25px;align-items:flex-start;}
.android-tv-schedule-row .android-tv-schedule-day input{width:13px;height:13px;margin-top:1px;}
.android-tv-schedule-row .android-tv-schedule-day span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.android-tv-schedule-row .form-row{display:flex;flex-direction:column;gap:2px;margin:0;}
.android-tv-schedule-row .form-row label{font-size:8px;letter-spacing:.04em;color:#64748b;}
.android-tv-schedule-row .input{height:24px;min-height:24px;font-size:9.5px;padding:3px 4px;border-radius:8px;}
.android-tv-schedule-modal .android-tv-schedule-actions{position:static;padding-top:6px;margin-top:0;border-top:1px solid rgba(15,23,42,.08);background:#fff;}
.android-tv-schedule-modal .android-tv-schedule-actions .btn{min-height:30px;padding:5px 10px;font-size:10.5px;}

/* Compact health monitor */
.modal:has(.screen-health-modal){width:min(760px,calc(100vw - 28px));max-height:min(520px,calc(100vh - 24px));overflow:hidden;}
.screen-health-modal{padding:10px;gap:7px;overflow:hidden;}
.screen-health-modal .screen-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.screen-health-modal .screen-health-grid span{min-height:52px;padding:6px;}
.screen-health-modal .screen-health-grid b{font-size:8.5px;}
.screen-health-modal .screen-health-grid em{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.screen-health-modal .dashboard-android-tv-mini{padding:7px;margin-top:4px;}
.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.screen-health-modal .dashboard-tv-health-grid span{min-height:48px;}

@media(max-width:920px){
  .modal:has(.android-tv-control-modal),.modal:has(.android-tv-schedule-modal),.modal:has(.screen-health-modal){max-height:calc(100vh - 18px);overflow:auto;}
  .android-tv-control-modal,.android-tv-schedule-modal,.screen-health-modal{overflow:auto;max-height:none;}
  .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(2,minmax(0,1fr));}
  .android-tv-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .screen-health-modal .screen-health-grid,.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:560px){
  .android-tv-status-grid,.android-tv-control-actions,.android-tv-schedule-grid,.screen-health-modal .screen-health-grid,.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:1fr;}
}


/* Better organized Android TV Control, Schedule, Screenshot and Health popups */
.modal:has(.android-tv-control-modal){
  width:min(760px,calc(100vw - 28px));
  max-height:min(590px,calc(100vh - 24px));
  padding:0;
  overflow:hidden;
  border-radius:24px;
}
.android-tv-modal-head{
  margin:0;
  padding:12px 16px;
  min-height:50px;
  background:linear-gradient(135deg,#edf6f8,#f8fbfc);
  border-bottom:1px solid rgba(44,92,113,.12);
}
.android-tv-modal-head h2{font-size:16px;font-weight:600;color:#143746;}
.android-tv-control-modal{
  padding:10px 14px 14px;
  gap:8px;
  max-height:calc(100vh - 86px);
  overflow:hidden;
}
.android-tv-control-modal .android-tv-control-title{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:7px 10px;
  min-height:34px;
}
.android-tv-control-modal .android-tv-control-title b{font-size:13px;line-height:1.1;}
.android-tv-control-modal .android-tv-control-title small{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.android-tv-control{gap:7px;}
.android-tv-control .android-tv-topbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:7px 9px;
  min-height:46px;
  width:100%;
  border-radius:14px;
}
.android-tv-control .android-tv-icon{width:30px;height:30px;border-radius:11px;}
.android-tv-control .android-tv-title b{font-size:12.5px;}
.android-tv-control .android-tv-title small{font-size:10px;max-width:420px;}
.android-tv-control .android-tv-token-pill{font-size:9px;padding:3px 7px;}
.android-tv-control .android-tv-top-actions .btn{height:28px;min-height:28px;font-size:10px;padding:4px 9px;}
.android-tv-control .android-tv-section{padding:7px;border-radius:13px;}
.android-tv-control .android-tv-section-head{margin-bottom:5px;}
.android-tv-control .android-tv-section-head b{font-size:11px;}
.android-tv-control .android-tv-section-head .btn{height:28px;min-height:28px;font-size:10px;padding:4px 8px;}
.android-tv-control .android-tv-status-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
}
.android-tv-control .android-tv-status-grid span{
  min-height:38px;
  padding:5px 6px;
  border-radius:10px;
  background:linear-gradient(180deg,#fff,#fbfdfe);
}
.android-tv-control .android-tv-status-grid b{font-size:8px;}
.android-tv-control .android-tv-status-grid em{font-size:9.2px;}
.android-tv-control .android-tv-two-col{
  grid-template-columns:.92fr 1.08fr;
  gap:7px;
}
.android-tv-control .android-tv-watchdog-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  padding:7px 8px;
  min-height:56px;
}
.android-tv-control .android-tv-watchdog-main>span{width:26px;height:26px;}
.android-tv-control .android-tv-watchdog-main b{font-size:10.5px;}
.android-tv-control .android-tv-watchdog-main small{font-size:9px;-webkit-line-clamp:1;}
.android-tv-control .android-tv-set-url-card{padding:7px 8px;min-height:56px;}
.android-tv-control .android-tv-url-head b{font-size:10.5px;}
.android-tv-control .android-tv-url-head small{font-size:9px;}
.android-tv-control .android-tv-set-url-row .input,
.android-tv-control .android-tv-set-url-row .btn{height:27px;min-height:27px;}
.android-tv-control .android-tv-control-actions{
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:5px;
}
.android-tv-control .android-tv-control-actions .btn{
  height:28px;
  min-height:28px;
  padding:4px 6px;
  font-size:9.2px;
  border-radius:9px;
}
.android-tv-control .android-tv-last-command{
  display:block;
  text-align:center;
  font-size:9px;
  line-height:1.2;
  max-height:14px;
  overflow:hidden;
}

.modal:has(.android-tv-schedule-modal){
  width:min(800px,calc(100vw - 28px));
  max-height:min(430px,calc(100vh - 24px));
  padding:0;
  overflow:hidden;
  border-radius:24px;
}
.android-tv-schedule-head{
  margin:0;
  padding:12px 16px;
  min-height:50px;
  background:linear-gradient(135deg,#edf6f8,#f8fbfc);
  border-bottom:1px solid rgba(44,92,113,.12);
}
.android-tv-schedule-head h2{font-size:16px;color:#143746;font-weight:600;}
.android-tv-schedule-modal{
  padding:10px 14px 14px;
  gap:8px;
  overflow:hidden;
}
.android-tv-schedule-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:7px 9px;
  border:1px solid rgba(44,92,113,.12);
  border-radius:14px;
  background:#f8fbfc;
}
.android-tv-schedule-summary b{display:block;font-size:12.5px;color:#143746;}
.android-tv-schedule-summary small{display:block;font-size:10px;color:#64748b;}
.android-tv-schedule-summary span{font-size:10px;font-weight:600;color:#2C5C71;background:#e8f1f4;border:1px solid #c7dde5;border-radius:999px;padding:4px 8px;white-space:nowrap;}
.android-tv-schedule-grid{
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:6px;
}
.android-tv-schedule-row{
  min-height:92px;
  padding:7px 6px;
  gap:5px;
  border-radius:14px;
  border:1px solid rgba(44,92,113,.12);
  background:linear-gradient(180deg,#fff,#f8fbfc);
}
.android-tv-schedule-row.enabled{box-shadow:inset 0 0 0 1px rgba(44,92,113,.05);}
.android-tv-schedule-row.disabled{opacity:.72;background:#f8fafc;}
.android-tv-schedule-day{
  display:grid;
  grid-template-columns:14px 30px minmax(0,1fr);
  gap:5px;
  align-items:center;
  min-height:25px;
}
.android-tv-schedule-day input{width:13px;height:13px;margin:0;}
.android-tv-day-badge{display:grid!important;place-items:center;width:28px;height:22px;border-radius:8px;background:#2C5C71;color:white;font-size:9px;font-weight:600;line-height:1;}
.android-tv-day-name{display:block!important;min-width:0;}
.android-tv-day-name b{display:block;font-size:9.5px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.1;}
.android-tv-day-name small{display:block;font-size:8px;color:#64748b;line-height:1.1;}
.android-tv-time-pair{display:grid;grid-template-columns:1fr;gap:4px;}
.android-tv-schedule-row .form-row{margin:0;gap:2px;}
.android-tv-schedule-row .form-row label{font-size:7.5px;letter-spacing:.05em;font-weight:600;text-transform:uppercase;color:#64748b;}
.android-tv-schedule-row .input{height:23px;min-height:23px;font-size:9px;padding:2px 4px;border-radius:8px;background:#fff;}
.android-tv-schedule-modal .android-tv-schedule-actions{
  padding-top:7px;
  margin-top:0;
  border-top:1px solid rgba(15,23,42,.08);
  justify-content:flex-end;
}
.android-tv-schedule-modal .android-tv-schedule-actions .btn{min-height:30px;padding:5px 11px;font-size:10.5px;}

.modal:has(.android-tv-screenshot-modal){
  width:min(540px,calc(100vw - 28px));
  max-height:min(500px,calc(100vh - 24px));
  padding:0;
  overflow:hidden;
  border-radius:24px;
}
.modal:has(.android-tv-screenshot-modal) .android-tv-child-head{
  margin:0;
  padding:11px 15px;
  min-height:48px;
  background:linear-gradient(135deg,#edf6f8,#f8fbfc);
  border-bottom:1px solid rgba(44,92,113,.12);
}
.android-tv-screenshot-modal{padding:10px 12px 12px;gap:9px;overflow:hidden;}
.android-tv-screenshot-modal .android-tv-screenshot-title{padding:7px 9px;border-radius:13px;}
.android-tv-screenshot-modal .android-tv-screenshot-title b{font-size:12px;}
.android-tv-screenshot-modal .android-tv-screenshot-title small{font-size:10px;}
.android-tv-screenshot-modal .android-tv-screenshot-frame{
  height:265px;
  max-height:265px;
  padding:7px;
  border-radius:14px;
  margin:0;
}
.android-tv-screenshot-modal .android-tv-screenshot-frame img{object-fit:contain;}
.android-tv-screenshot-modal .android-tv-child-actions{
  margin-top:0;
  padding-top:8px;
  border-top:1px solid rgba(15,23,42,.08);
  justify-content:flex-end;
}
.android-tv-screenshot-modal .android-tv-child-actions .btn{min-height:30px;padding:5px 11px;font-size:10.5px;}

.modal:has(.screen-health-modal){
  width:min(740px,calc(100vw - 28px));
  max-height:min(500px,calc(100vh - 24px));
  padding:0;
  overflow:hidden;
  border-radius:24px;
}
.modal:has(.screen-health-modal) .android-tv-modal-head{min-height:48px;}
.screen-health-modal{padding:10px 14px 14px;gap:8px;overflow:hidden;}
.screen-health-modal .android-tv-control-title{padding:7px 10px;border-radius:13px;background:#f8fbfc;border:1px solid rgba(44,92,113,.10);}
.screen-health-modal .screen-health-panel{padding:8px;border-radius:14px;}
.screen-health-modal .screen-health-head{margin-bottom:6px;}
.screen-health-modal .screen-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.screen-health-modal .screen-health-grid span{min-height:49px;padding:5px 6px;border-radius:10px;}
.screen-health-modal .dashboard-android-tv-mini{padding:7px;margin-top:5px;border-radius:14px;}
.screen-health-modal .dashboard-tv-health-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}

@media (max-width: 820px){
  .modal:has(.android-tv-control-modal),.modal:has(.android-tv-schedule-modal),.modal:has(.screen-health-modal){max-height:calc(100vh - 18px);overflow:auto;}
  .android-tv-control-modal,.android-tv-schedule-modal,.screen-health-modal{overflow:auto;max-height:none;}
  .android-tv-control .android-tv-status-grid,.android-tv-control .android-tv-control-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  .android-tv-control .android-tv-two-col{grid-template-columns:1fr;}
  .android-tv-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* Android TV Control + Operating Schedule light theme refresh */
:root{
  --android-tv-bg:#ffffff;
  --android-tv-soft:#f8fbfd;
  --android-tv-soft-2:#f1f7fa;
  --android-tv-border:#d7e4ea;
  --android-tv-border-strong:#c6d8e1;
  --android-tv-text:#163042;
  --android-tv-muted:#5f7482;
  --android-tv-blue:#2C5C71;
  --android-tv-blue-2:#3e7890;
  --android-tv-blue-soft:#eaf3f7;
  --android-tv-green:#0f8f63;
  --android-tv-green-soft:#e8f8f1;
  --android-tv-amber:#b86b00;
  --android-tv-amber-soft:#fff4e5;
  --android-tv-red:#c24134;
  --android-tv-red-soft:#fff1ef;
}

.modal:has(.android-tv-control-modal),
.modal:has(.android-tv-schedule-modal){
  width:min(900px, calc(100vw - 28px));
  max-height:min(760px, calc(100vh - 24px));
  border-radius:24px;
  background:linear-gradient(180deg,#fbfdfe 0%, #f5fafc 100%);
  border:1px solid rgba(44,92,113,.14);
  box-shadow:0 24px 70px rgba(15,23,42,.16);
}

.android-tv-modal-head,
.android-tv-schedule-head{
  margin:-2px -2px 0;
  padding:14px 18px;
  border-radius:24px 24px 0 0;
  background:linear-gradient(180deg,#f3f8fb,#edf5f8);
  border-bottom:1px solid var(--android-tv-border);
}
.android-tv-modal-head h2,
.android-tv-schedule-head h2{font-size:18px;font-weight:600;color:var(--android-tv-text);}
.android-tv-modal-head .close-btn,
.android-tv-schedule-head .close-btn{
  width:36px;height:36px;border-radius:12px;background:#fff;border:1px solid var(--android-tv-border);
  color:#607180;box-shadow:0 6px 16px rgba(15,23,42,.06);
}
.android-tv-modal-head .close-btn:hover,
.android-tv-schedule-head .close-btn:hover{background:#f8fbfd;color:var(--android-tv-text);}

.android-tv-control-modal,
.android-tv-schedule-modal{
  display:flex;flex-direction:column;gap:12px;padding:14px;
}
.android-tv-control-title,
.android-tv-schedule-title{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 14px;border-radius:16px;border:1px solid var(--android-tv-border);background:#fff;
}
.android-tv-control-title b,
.android-tv-schedule-title b{font-size:14px;color:var(--android-tv-text);}
.android-tv-control-title small,
.android-tv-schedule-title small{font-size:11px;color:var(--android-tv-muted);}
.android-tv-control-title .meta,
.android-tv-schedule-title .meta{display:flex;flex-direction:column;gap:2px;min-width:0;}
.android-tv-control-title .badge,
.android-tv-schedule-title .badge{font-size:11px;padding:4px 10px;border-radius:999px;border:1px solid #bfd4df;background:var(--android-tv-blue-soft);color:var(--android-tv-blue);font-weight:700;}

.android-tv-control{
  padding:14px;border-radius:18px;background:var(--android-tv-bg);border:1px solid var(--android-tv-border);
  box-shadow:0 10px 28px rgba(15,23,42,.06);
}
.android-tv-topbar{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
  padding:10px 12px;border-radius:16px;background:linear-gradient(180deg,#f8fbfd,#f1f7fa);border:1px solid var(--android-tv-border);
  margin-bottom:12px;
}
.android-tv-title{display:flex;align-items:center;gap:12px;min-width:0;}
.android-tv-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,var(--android-tv-blue),var(--android-tv-blue-2));color:#fff;box-shadow:0 10px 18px rgba(44,92,113,.18);}

.playlist-quality-summary { display: grid; gap: 8px; margin: 12px 0; }
.playlist-quality-item { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 2px; }
.playlist-quality-item b { font-size: 12.5px; color: var(--text); }
.playlist-quality-item small { color: var(--muted); font-size: 11.5px; }
.playlist-quality-item.danger { border-color: #fecdd3; background: #fff1f2; }
.playlist-quality-item.warning { border-color: #fde68a; background: #fffbeb; }
.playlist-quality-item.info { border-color: #bfdbfe; background: #eff6ff; }
.playlist-quality-item.ok { border-color: #bbf7d0; background: #f0fdf4; }
.playlist-quality-modal { display: grid; gap: 12px; }


.modal:has(.simple-playlist-preview) {
  max-width: min(760px, calc(100vw - 28px));
}
.simple-preview-head {
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 10px;
}
.simple-preview-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  letter-spacing: -.02em;
}
.simple-preview-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.simple-playlist-preview {
  display: grid;
  gap: 10px;
  min-width: min(650px, calc(100vw - 42px));
}
.simple-preview-summary-card,
.simple-preview-tv-card,
.simple-preview-sequence-card {
  border: 1px solid rgba(44,92,113,.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.045);
}
.simple-preview-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg,#f8fbfc 0%,#ffffff 75%);
}
.simple-preview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.simple-preview-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eef6f8;
  color: #21485A;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.simple-preview-title b {
  display: block;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simple-preview-title small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simple-preview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.simple-preview-stats span {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon value" "icon label";
  align-items: center;
  column-gap: 8px;
  padding: 10px;
  border: 1px solid rgba(44,92,113,.11);
  border-radius: 14px;
  background: #f8fbfc;
}
.simple-preview-stats .icon { grid-area: icon; width: 17px; height: 17px; color: #21485A; }
.simple-preview-stats b { grid-area: value; color: #0f172a; font-size: 15px; line-height: 1; }
.simple-preview-stats small { grid-area: label; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.simple-preview-tv-card {
  padding: 11px 12px;
  display: grid;
  gap: 8px;
}
.simple-preview-tv-card.warning {
  background: #fff8f1;
  border-color: rgba(245,158,11,.24);
}
.simple-preview-tv-card b { color: var(--text); font-size: 12.5px; }
.simple-preview-tv-card small { display:block; margin-top:2px; color: var(--muted); font-size:11px; line-height:1.35; }
.simple-tv-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.simple-tv-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef6f8;
  color: #21485A;
  font-size: 10.8px;
  font-weight: 600;
}
.simple-tv-chip-row .warning-chip {
  background: #fff;
  border: 1px dashed rgba(245,158,11,.35);
  color: #92400e;
}
.simple-preview-sequence-card {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.simple-preview-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 2px 2px 4px;
}
.simple-preview-section-head b { color: var(--text); font-size: 13px; }
.simple-preview-section-head small { display:block; margin-top:2px; color: var(--muted); font-size: 11px; }
.simple-preview-section-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #21485A;
  background: #eef6f8;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10.5px;
  font-weight: 600;
}
.simple-preview-list {
  display: grid;
  gap: 7px;
  max-height: min(330px, 42vh);
  overflow: auto;
  padding-right: 2px;
}
.simple-preview-row {
  display: grid;
  grid-template-columns: 30px 50px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(15,23,42,.07);
  border-radius: 14px;
  background: linear-gradient(180deg,#ffffff,#fbfdff);
}
.simple-preview-row.disabled { opacity: .62; }
.simple-row-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef6f8;
  color: #21485A;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.simple-row-thumb {
  width: 50px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  display: grid;
  place-items: center;
}
.simple-row-thumb img,
.simple-row-thumb video,
.simple-row-thumb iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.simple-row-copy { min-width: 0; display: grid; gap: 2px; }
.simple-row-copy b {
  color: var(--text);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simple-row-copy small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simple-row-copy small .icon { width: 12px; height: 12px; flex: 0 0 auto; }
.simple-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.simple-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f8fbfc;
  border: 1px solid rgba(44,92,113,.10);
  color: #21485A;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.simple-row-meta .ok { background:#ecfdf5; color:#047857; border-color:rgba(16,185,129,.14); }
.simple-row-meta .warning { background:#fff7ed; color:#b45309; border-color:rgba(245,158,11,.18); }
.simple-preview-actions {
  margin-top: 0;
  padding-top: 8px;
  justify-content: flex-end;
}
.simple-preview-actions .btn {
  min-width: 128px;
  justify-content: center;
}
@media (max-width: 780px) {
  .simple-playlist-preview { min-width: min(100%, calc(100vw - 28px)); }
  .simple-preview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simple-preview-row { grid-template-columns: 28px 46px minmax(0,1fr); }
  .simple-row-meta { grid-column: 3; align-items: flex-start; flex-direction: row; flex-wrap: wrap; margin-top: 3px; }
}
@media (max-width: 560px) {
  .simple-preview-summary-card { align-items: flex-start; }
  .simple-preview-stats { grid-template-columns: 1fr; }
  .simple-preview-section-head { display: grid; justify-items: start; }
  .simple-preview-row { grid-template-columns: 28px minmax(0,1fr); }
  .simple-row-thumb { grid-column: 1 / -1; width: 100%; max-width: 180px; height: 88px; }
  .simple-row-copy { grid-column: 2; }
  .simple-row-meta { grid-column: 1 / -1; }
  .simple-preview-actions { flex-direction: column; }
  .simple-preview-actions .btn { width: 100%; }
}


.playlist-items[aria-busy="true"] { opacity:.75; }
.playlist-item { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease; }
.playlist-item[draggable="true"] { cursor: grab; }
.playlist-item.dragging { opacity:.55; transform: scale(.99); border-color:#2C5C71; box-shadow:0 12px 28px rgba(44,92,113,.16); cursor:grabbing; }
.playlist-item.drag-over { border-color:#2C5C71; box-shadow: inset 0 0 0 2px rgba(44,92,113,.18); }
.drag-handle { display:inline-flex; align-items:center; gap:6px; cursor:grab; user-select:none; }
.drag-handle .icon { width:14px; height:14px; color:#2C5C71; }


body:not(.tv-body) .playlist-workspace,
body:not(.tv-body) .playlist-editor,
body:not(.tv-body) .playlist-selected-summary-card,
body:not(.tv-body) .playlist-timeline-card,
body:not(.tv-body) .add-media-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
body:not(.tv-body) .playlist-workspace {
  grid-template-columns: minmax(250px, 286px) minmax(0, 1fr);
  overflow-x: hidden;
}
body:not(.tv-body) .playlist-editor,
body:not(.tv-body) .playlist-selected-summary-card,
body:not(.tv-body) .playlist-timeline-card { overflow: hidden; }
body:not(.tv-body) .playlist-selected-summary-card > *,
body:not(.tv-body) .playlist-timeline-card > *,
body:not(.tv-body) .add-media-card > * { min-width: 0; }
@media (max-width: 980px) {
  body:not(.tv-body) .playlist-workspace { grid-template-columns: 1fr; }
}

/* ── PDF thumbnail in playlist picker / items ────────────────── */
.picker-thumb .asset-pdf-thumb-wrap,
.item-thumb .asset-pdf-thumb-wrap,
.large-thumb .asset-pdf-thumb-wrap,
.simple-row-thumb .asset-pdf-thumb-wrap {
  width: 100%;
  height: 100%;
  background: #e8f1f4;
}
