*{
  box-sizing:border-box;
}

.upload-hub{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);
  gap:18px;
  margin-bottom:18px;
}

.upload-mode-grid,
.source-mode-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.source-mode-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.choice-card{
  position:relative;
  display:grid;
  gap:6px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(255,255,255,.035);
  cursor:pointer;
}

.choice-card:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.22);
}

.choice-card input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.choice-card strong{
  font-size:16px;
}

.choice-card span{
  color:var(--muted);
  font-size:13px;
}

.choice-card:has(input:checked){
  border-color:var(--accent);
  background:rgba(255,47,63,.12);
  box-shadow:inset 0 0 0 1px rgba(255,47,63,.28);
}

.drop-zone{
  display:grid;
  gap:8px;
  place-items:center;
  min-height:152px;
  border:1px dashed rgba(255,255,255,.28);
  border-radius:8px;
  background:rgba(255,255,255,.025);
  padding:18px;
  text-align:center;
}

.drop-zone input{
  width:100%;
}

.upload-summary{
  display:grid;
  gap:10px;
  align-self:start;
}

.summary-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  padding-bottom:9px;
}

.summary-row span{
  color:var(--muted);
}

.summary-row strong{
  text-align:right;
  word-break:break-word;
}

.progress-shell{
  display:none;
  gap:8px;
  margin-top:10px;
}

.progress-shell.show{
  display:grid;
}

.progress-track{
  height:10px;
  background:rgba(255,255,255,.1);
  border-radius:999px;
  overflow:hidden;
}

.progress-fill{
  width:0%;
  height:100%;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  transition:width .18s ease;
}

.progress-text{
  font-size:13px;
  color:var(--muted);
}

.job-grid,
.serial-grid,
.file-card-list{
  display:grid;
  gap:10px;
}

.jobs-fab{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:32;
  width:auto;
  min-height:46px;
  gap:10px;
  padding:10px 14px;
  border:1px solid rgba(255,47,63,.35);
  background:#191c23;
  box-shadow:0 16px 42px rgba(0,0,0,.38);
}

.jobs-fab strong{
  min-width:24px;
  min-height:24px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--accent);
  font-size:12px;
}

.jobs-backdrop{
  position:fixed;
  inset:0;
  z-index:41;
  display:block;
  width:100%;
  min-height:100%;
  padding:0;
  border:0;
  border-radius:0;
  background:rgba(0,0,0,.56);
  backdrop-filter:blur(4px);
}

.jobs-drawer{
  position:fixed;
  inset:0 0 0 auto;
  z-index:42;
  width:min(520px,94vw);
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:14px;
  padding:18px;
  background:#151820;
  border-left:1px solid var(--line);
  box-shadow:-20px 0 60px rgba(0,0,0,.42);
  transform:translateX(105%);
  transition:transform .2s ease;
}

.jobs-drawer.open{
  transform:translateX(0);
}

.jobs-drawer-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.jobs-drawer-head h2{
  margin:0;
}

.jobs-drawer .job-grid{
  overflow:auto;
  padding-right:4px;
}

.job-card,
.serial-card,
.file-card{
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(255,255,255,.03);
  padding:14px;
}

.job-cancel-button{
  margin-top:8px;
  width:auto;
  min-height:36px;
  padding:8px 12px;
}

.job-head,
.folder-head,
.media-toolbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.media-toolbar{
  align-items:center;
  margin-bottom:14px;
}

.media-search{
  width:min(380px,100%);
}

.library-layout{
  display:grid;
  gap:18px;
}

.serial-create{
  display:flex;
  gap:10px;
  align-items:end;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.serial-create label{
  min-width:260px;
  flex:1;
}

.bulk-import-card{
  margin:12px 0;
}

.bulk-import-textarea{
  min-height:190px;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
  line-height:1.45;
}

.serial-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto auto;
  align-items:center;
  gap:12px;
}

.serial-card h3{
  margin:0;
  font-size:17px;
}

.file-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
}

.file-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}

.file-meta span{
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  font-size:12px;
}

.media-url{
  width:min(520px,100%);
  font-size:12px;
  margin-top:10px;
}

.action-menu{
  position:relative;
  align-self:start;
}

.action-menu summary{
  list-style:none;
  width:40px;
  min-height:40px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#282d37;
  cursor:pointer;
  font-size:22px;
  line-height:1;
}

.action-menu summary::-webkit-details-marker{
  display:none;
}

.action-menu[open] summary{
  background:#363d49;
}

.action-menu-panel{
  position:absolute;
  right:0;
  top:46px;
  z-index:4;
  width:min(360px,86vw);
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#17191f;
  box-shadow:0 18px 60px rgba(0,0,0,.45);
}

.action-menu-panel .button,
.action-menu-panel button{
  width:100%;
}

.media-actions,
.inline-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.inline-form input{
  min-width:150px;
  flex:1;
}

.hint{
  color:var(--muted);
  font-size:13px;
  margin:6px 0 0;
}

.legacy-url{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-break:anywhere;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:11px;
  line-height:1.35;
}

@media(max-width:1100px){
  .upload-hub{
    grid-template-columns:1fr;
  }

  .upload-mode-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:900px){
  .upload-hub,
  .upload-mode-grid,
  .source-mode-grid,
  .file-card,
  .serial-card{
    grid-template-columns:1fr;
  }
}

:root{
  --bg:#0b0c0f;
  --panel:#17191f;
  --panel-2:#1f222a;
  --line:#2b303a;
  --muted:#aeb4c1;
  --text:#f6f7fb;
  --accent:#ff2f3f;
  --accent-2:#16b38a;
  --shadow:0 18px 60px rgba(0,0,0,.28);
}

body{
  min-height:100vh;
  margin:0;
  background:
    linear-gradient(135deg,rgba(255,47,63,.08),transparent 32%),
    radial-gradient(circle at 82% 0,rgba(22,179,138,.1),transparent 28%),
    var(--bg);
  color:var(--text);
  font-family:Arial,sans-serif;
  line-height:1.45;
}

a{
  color:#ff6570;
  text-decoration:none;
}

a:hover{
  color:#fff;
}

.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:240px;
  background:linear-gradient(180deg,#181b22,#101116);
  border-right:1px solid var(--line);
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:18px;
  box-shadow:10px 0 40px rgba(0,0,0,.18);
}

.mobile-menu-button,
.menu-close,
.menu-backdrop{
  display:none;
}

.brand{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px 10px 14px;
  border-bottom:1px solid var(--line);
}

.brand strong{
  font-size:22px;
  letter-spacing:.2px;
}

.brand span,
.page-head p,
.metric span,
.mini-list span,
label span{
  color:var(--muted);
}

nav{
  display:grid;
  gap:6px;
}

nav a,
.logout{
  color:var(--text);
  border-radius:8px;
  padding:11px 12px;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}

nav a:hover,
nav a.active,
.logout:hover{
  background:rgba(255,255,255,.08);
  transform:translateX(2px);
}

nav a.active{
  color:#fff;
  box-shadow:inset 3px 0 0 var(--accent);
}

.logout{
  margin-top:auto;
  color:#ff838b;
}

.main{
  margin-left:240px;
  padding:30px;
}

.page-head{
  margin-bottom:22px;
}

.page-head h1{
  margin:0;
  font-size:30px;
}

.page-head p{
  margin:6px 0 0;
}

.metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}

.metric,
.card{
  background:linear-gradient(180deg,rgba(255,255,255,.035),transparent),var(--panel);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:var(--shadow);
}

.metric{
  padding:18px;
  display:grid;
  gap:8px;
}

.metric strong{
  font-size:28px;
  color:#fff;
}

.card{
  padding:20px;
}

.card h2,
.card h3{
  margin:0 0 14px;
}

.grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.form-stack{
  display:grid;
  gap:14px;
}

.player-editor{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(340px,.9fr);
  gap:18px;
  align-items:start;
}

.player-preview-card{
  position:sticky;
  top:18px;
}

.color-field{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--panel-2);
  border:1px solid #353a46;
  border-radius:8px;
  padding:8px 10px;
}

.color-field input[type="color"]{
  width:46px;
  height:34px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
}

.color-value{
  color:#f5f5f5;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
}

.color-presets{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.color-preset{
  width:30px;
  min-height:30px;
  border:2px solid rgba(255,255,255,.22);
  border-radius:50%;
  padding:0;
}

.compact-grid{
  align-items:end;
}

.admin-player-preview{
  --demo-color:#ff0000;
  display:grid;
  gap:12px;
}

.admin-preview-video{
  position:relative;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:10px;
  background:
    linear-gradient(135deg,rgba(255,255,255,.1),transparent 36%),
    radial-gradient(circle at 75% 20%,rgba(255,47,63,.2),transparent 28%),
    #050505;
  border:1px solid rgba(255,255,255,.1);
}

.admin-preview-logo{
  position:absolute;
  left:12px;
  top:12px;
  max-width:60%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:6px 10px;
  border-radius:8px;
  background:rgba(0,0,0,.48);
}

.admin-preview-center{
  position:absolute;
  left:50%;
  top:50%;
  width:68px;
  min-height:68px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:rgba(0,0,0,.58);
  font-size:22px;
}

.admin-preview-controls{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:42px 12px 10px;
  background:linear-gradient(transparent,rgba(0,0,0,.9));
}

.admin-preview-progress{
  height:5px;
  overflow:hidden;
  border-radius:20px;
  background:rgba(255,255,255,.22);
  margin-bottom:10px;
}

.admin-preview-progress span{
  display:block;
  width:38%;
  height:100%;
  background:var(--demo-color);
}

.admin-preview-row{
  display:flex;
  align-items:center;
  gap:8px;
}

.admin-preview-row button{
  width:34px;
  min-height:34px;
  padding:0;
  border-radius:50%;
  background:transparent;
}

.admin-preview-row span{
  margin-right:auto;
  font-size:12px;
  color:#fff;
}

.admin-player-preview.qp-icons-youtube button{
  background:transparent;
}

.admin-player-preview.qp-icons-round button{
  background:rgba(255,255,255,.14);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.2);
}

.admin-player-preview.qp-icons-minimal button{
  background:transparent;
  box-shadow:none;
}

.admin-player-preview.qp-icons-glass button{
  background:rgba(255,255,255,.16);
  backdrop-filter:blur(10px);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18),0 8px 22px rgba(0,0,0,.24);
}

.preview-flags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.preview-flags span{
  padding:5px 8px;
  border-radius:999px;
  background:var(--panel-2);
  color:#c8cbd3;
  font-size:12px;
}

label{
  display:grid;
  gap:6px;
}

input,
select,
textarea{
  width:100%;
  background:var(--panel-2);
  color:#fff;
  border:1px solid #353a46;
  border-radius:8px;
  padding:11px 12px;
  font:inherit;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

textarea{
  resize:vertical;
}

input[readonly]{
  opacity:.75;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button:focus{
  outline:0;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(255,47,63,.2);
}

button,
.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  background:var(--accent);
  color:white;
  border:0;
  border-radius:8px;
  padding:10px 14px;
  font:inherit;
  cursor:pointer;
  transition:background .16s ease,transform .16s ease,box-shadow .16s ease;
}

button:hover,
.button:hover{
  background:#df2635;
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(255,47,63,.18);
}

.button.secondary{
  background:#282d37;
}

.button.secondary:hover{
  background:#363d49;
  box-shadow:none;
}

.danger-button{
  background:#e03645;
}

.danger-button:hover{
  background:#bf2634;
}

.toolbar,
.actions,
.quick-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}

.checkbox-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:10px;
}

.checkbox-grid label{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--panel-2);
  border:1px solid #353a46;
  border-radius:8px;
  padding:11px 12px;
}

.checkbox-grid input{
  width:auto;
  accent-color:var(--accent);
}

.table-wrap{
  width:100%;
  max-height:620px;
  overflow:auto;
}

table{
  width:100%;
  min-width:860px;
  border-collapse:collapse;
}

th,
td{
  border-bottom:1px solid var(--line);
  padding:12px;
  text-align:left;
  vertical-align:top;
  word-break:break-word;
}

th{
  position:sticky;
  top:0;
  background:#1b1e25;
  color:#c8cbd3;
  z-index:1;
}

tr:hover td{
  background:rgba(255,255,255,.025);
}

.row-actions{
  white-space:nowrap;
}

.row-actions a{
  margin-right:10px;
}

.mini-action{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:6px 9px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:7px;
  background:rgba(255,255,255,.04);
  color:#f5f7fb;
  font-size:13px;
}

.mini-action:hover{
  background:rgba(255,255,255,.1);
}

.danger{
  color:#ff8585;
}

.swatch{
  width:14px;
  height:14px;
  border-radius:50%;
  display:inline-block;
  margin-right:8px;
  vertical-align:-2px;
}

.mini-list{
  display:grid;
  gap:10px;
}

.mini-list > div{
  display:grid;
  gap:5px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(255,255,255,.025);
}

.mini-list > div:last-child{
  border-bottom:1px solid var(--line);
}

.list-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.list-head strong{
  font-size:15px;
}

.muted-line{
  display:block;
  color:var(--muted);
  font-size:13px;
}

.break-line{
  max-width:100%;
  overflow-wrap:anywhere;
}

.id-pill{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 8px;
  border-radius:7px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  color:#e8ebf2;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
}

.badge-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.badge{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
  color:#d9deea;
  font-size:12px;
  line-height:1;
}

.badge.ok{
  background:rgba(22,179,138,.13);
  border-color:rgba(22,179,138,.32);
  color:#7df0cf;
}

.badge.off{
  background:rgba(255,255,255,.045);
  color:#9aa3b4;
}

.badge.player{
  background:rgba(90,140,255,.13);
  border-color:rgba(90,140,255,.32);
  color:#a9c3ff;
}

.item-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:6px;
}

.ad-list{
  max-height:690px;
  overflow:auto;
  padding-right:2px;
}

.ad-item{
  position:relative;
}

.ad-item::before{
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:3px;
  border-radius:999px;
  background:var(--accent);
}

.ad-item > *{
  margin-left:10px;
}

.stat-list .stat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.stats-filter{
  display:grid;
  grid-template-columns:minmax(190px,1fr) minmax(180px,1fr) minmax(220px,1.35fr) auto auto;
  gap:12px;
  align-items:end;
  margin-bottom:18px;
}

.stats-filter label{
  display:grid;
  gap:7px;
}

.stats-filter button,
.stats-filter .button{
  min-height:44px;
}

.ad-metrics .metric:first-child{
  border-top:3px solid var(--accent);
}

.ad-metrics .metric:nth-child(2){
  border-top:3px solid #5a8cff;
}

.ad-metrics .metric:nth-child(3){
  border-top:3px solid #f1a33c;
}

.ad-metrics .metric:nth-child(4){
  border-top:3px solid var(--accent-2);
}

.stats-overview,
.stats-bottom{
  margin-bottom:18px;
}

.card-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.card-title-row h2{
  margin-bottom:4px;
}

.card-title-row p{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.weekly-chart{
  height:255px;
  display:grid;
  grid-template-columns:repeat(7,minmax(36px,1fr));
  gap:10px;
  align-items:end;
  padding-top:10px;
}

.chart-day{
  min-width:0;
  height:100%;
  display:grid;
  grid-template-rows:24px 1fr 24px;
  gap:7px;
  text-align:center;
}

.chart-value{
  overflow:hidden;
  color:var(--muted);
  font-size:11px;
  text-overflow:ellipsis;
}

.chart-track{
  position:relative;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:5px 5px 2px 2px;
  background:rgba(255,255,255,.035);
}

.chart-track span{
  position:absolute;
  inset:auto 0 0;
  min-height:3px;
  background:linear-gradient(180deg,#ff5a67,var(--accent));
}

.chart-day strong{
  color:#c9ced8;
  font-size:12px;
}

.domain-bars{
  display:grid;
  gap:14px;
}

.domain-bars > div{
  min-width:0;
}

.domain-bars header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:7px;
}

.domain-bars header strong{
  overflow:hidden;
  font-size:13px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.domain-bars header span{
  color:var(--muted);
  font-size:12px;
}

.domain-bars i{
  height:7px;
  display:block;
  overflow:hidden;
  border-radius:99px;
  background:#252934;
}

.domain-bars b{
  height:100%;
  display:block;
  border-radius:inherit;
  background:linear-gradient(90deg,#5a8cff,#16b38a);
}

.ad-performance{
  margin-bottom:18px;
  padding:0;
}

.table-title{
  padding:20px 20px 0;
}

.ad-performance td strong{
  color:#fff;
}

.stats-action{
  border-color:rgba(22,179,138,.42);
  color:#83dfc5;
}

.stats-latest{
  max-height:360px;
  overflow:auto;
}

.stats-latest > div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.stats-latest > div > div{
  min-width:0;
  display:grid;
}

.stats-latest strong,
.stats-latest span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.stats-latest time{
  flex:0 0 auto;
  color:var(--muted);
  font-size:11px;
}

.code-box{
  min-height:310px;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:13px;
}

.install-card{
  margin-top:18px;
}

.install-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}

.install-head h2{
  margin-bottom:6px;
}

.install-head p,
.install-method p{
  margin:0;
  color:var(--muted);
}

.install-head .quick-actions{
  flex-shrink:0;
  margin-bottom:0;
}

.install-methods{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.install-method{
  min-width:0;
  padding:16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}

.install-method-head{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-height:78px;
  margin-bottom:12px;
}

.install-method h3{
  margin:0 0 5px;
  font-size:16px;
}

.install-method p{
  font-size:13px;
}

.install-number{
  flex:0 0 34px;
  min-height:28px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,47,63,.35);
  border-radius:7px;
  background:rgba(255,47,63,.1);
  color:#ff838b;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
}

.code-box.install-code{
  min-height:0;
  resize:vertical;
  white-space:pre;
}

.copy-button{
  width:100%;
  margin-top:10px;
}

.login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:18px;
}

.login-card{
  width:min(420px,100%);
  background:#191a1e;
  border:1px solid #2b2d33;
  border-radius:12px;
  padding:22px;
  display:grid;
  gap:12px;
}

.login-card h1{
  margin:0 0 8px;
}

.alert{
  margin:0;
  color:#ff9b9b;
}

.confirm-modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.66);
  backdrop-filter:blur(8px);
}

.confirm-modal.show{
  display:flex;
}

.confirm-dialog{
  width:min(420px,100%);
  padding:24px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(255,255,255,.05),transparent),#191c23;
  box-shadow:0 30px 80px rgba(0,0,0,.45);
  text-align:center;
}

.confirm-icon{
  width:48px;
  height:48px;
  margin:0 auto 14px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:rgba(255,47,63,.16);
  border:1px solid rgba(255,47,63,.42);
  color:#ff737d;
  font-size:24px;
  font-weight:700;
}

.confirm-dialog h2{
  margin:0 0 8px;
  font-size:22px;
}

.confirm-dialog p{
  margin:0;
  color:var(--muted);
}

.confirm-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:20px;
}

@media(max-width:900px){
  .sidebar{
    position:static;
    width:auto;
    border-right:0;
    border-bottom:1px solid #282a2f;
  }

  nav{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .logout{
    margin-top:0;
  }

  .main{
    margin-left:0;
    padding:18px;
  }

  .install-head{
    display:grid;
  }

  .install-methods{
    grid-template-columns:1fr;
  }

  .metrics,
  .grid-2,
  .grid-3,
  .player-editor{
    grid-template-columns:1fr;
  }

  .stats-filter{
    grid-template-columns:1fr;
  }

  .weekly-chart{
    height:220px;
    gap:5px;
  }

  .chart-value{
    font-size:9px;
  }

  .player-preview-card{
    position:static;
  }
}

@media(max-width:760px){
  body{
    overflow-x:hidden;
  }

  .mobile-menu-button{
    position:sticky;
    top:0;
    z-index:30;
    display:inline-flex;
    width:auto;
    min-height:44px;
    margin:10px 0 0 10px;
    padding:10px 14px;
    border:1px solid var(--line);
    background:#191c23;
    box-shadow:0 10px 28px rgba(0,0,0,.28);
  }

  .menu-backdrop{
    position:fixed;
    inset:0;
    z-index:39;
    display:block;
    width:100%;
    min-height:100%;
    padding:0;
    border:0;
    border-radius:0;
    background:rgba(0,0,0,.56);
    backdrop-filter:blur(4px);
  }

  .sidebar{
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    z-index:40;
    width:min(310px,86vw);
    padding:14px;
    gap:12px;
    border-right:1px solid var(--line);
    border-bottom:0;
    box-shadow:18px 0 48px rgba(0,0,0,.42);
    transform:translateX(-105%);
    transition:transform .2s ease;
    overflow:auto;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .brand{
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:4px 2px 10px;
  }

  .menu-close{
    display:inline-flex;
    width:38px;
    min-height:38px;
    margin-left:auto;
    padding:0;
    border-radius:8px;
    background:#282d37;
    font-size:24px;
    line-height:1;
  }

  .brand strong{
    font-size:18px;
  }

  .brand span{
    font-size:12px;
  }

  nav{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  nav a,
  .logout{
    min-height:42px;
    padding:10px 9px;
    text-align:center;
    justify-content:center;
    font-size:14px;
  }

  nav a:hover,
  nav a.active,
  .logout:hover{
    transform:none;
  }

  nav a.active{
    box-shadow:inset 0 -3px 0 var(--accent);
  }

  .main{
    width:100%;
    margin-left:0;
    padding:12px 14px 14px;
  }

  .page-head{
    margin-bottom:14px;
  }

  .page-head h1{
    font-size:24px;
  }

  .page-head p{
    font-size:13px;
  }

  .card{
    padding:14px;
    box-shadow:0 12px 32px rgba(0,0,0,.18);
  }

  .card h2{
    font-size:19px;
  }

  .upload-hub{
    grid-template-columns:1fr;
    gap:12px;
    margin-bottom:14px;
  }

  .upload-mode-grid,
  .source-mode-grid{
    grid-template-columns:1fr;
    gap:8px;
  }

  .choice-card{
    min-height:58px;
    padding:12px;
  }

  .drop-zone{
    min-height:118px;
    padding:14px;
  }

  .summary-row{
    display:grid;
    gap:4px;
  }

  .summary-row strong{
    text-align:left;
  }

  .media-toolbar,
  .folder-head,
  .job-head{
    display:grid;
    grid-template-columns:1fr;
    align-items:start;
  }

  .media-search{
    width:100%;
  }

  .serial-create{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }

  .bulk-import-card{
    margin:10px 0;
  }

  .bulk-import-textarea{
    min-height:160px;
    font-size:11px;
  }

  .serial-create label{
    min-width:0;
  }

  .serial-card,
  .file-card{
    gap:10px;
    padding:10px;
  }

  .file-card{
    grid-template-columns:minmax(0,1fr) 38px;
    align-items:start;
  }

  .serial-card{
    grid-template-columns:1fr;
  }

  .file-card strong,
  .serial-card h3{
    display:block;
    font-size:14px;
    line-height:1.25;
    overflow-wrap:anywhere;
  }

  .file-meta{
    gap:5px;
    margin-top:6px;
  }

  .file-meta span{
    max-width:100%;
    padding:3px 6px;
    font-size:10.5px;
    overflow-wrap:anywhere;
  }

  .media-url{
    width:100%;
    min-width:0;
    min-height:34px;
    margin-top:7px;
    padding:7px 8px;
    font-size:10.5px;
  }

  .legacy-url{
    display:block;
    max-width:100%;
    padding:6px 7px;
    border-radius:7px;
    background:rgba(255,255,255,.035);
    font-size:10px;
    line-height:1.35;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  .action-menu{
    width:auto;
    justify-self:end;
  }

  .action-menu summary{
    width:38px;
    min-height:38px;
    border-radius:50%;
    font-size:20px;
  }

  .action-menu-panel{
    position:static;
    width:calc(100vw - 48px);
    max-width:320px;
    margin-top:8px;
    margin-left:auto;
    padding:10px;
    gap:8px;
    box-shadow:none;
  }

  .action-menu-panel .button,
  .action-menu-panel button{
    min-height:38px;
    padding:8px 10px;
    font-size:13px;
  }

  .jobs-fab{
    right:12px;
    bottom:12px;
    min-height:44px;
  }

  .jobs-drawer{
    width:100%;
    padding:14px;
  }

  .media-actions,
  .inline-form{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .inline-form input{
    min-width:0;
  }

  button,
  .button{
    width:100%;
    min-height:44px;
    padding:11px 12px;
  }

  input,
  select,
  textarea{
    min-height:44px;
    font-size:16px;
  }
}

@media(max-width:420px){
  .main{
    padding:10px;
  }

  .sidebar{
    width:min(292px,88vw);
    padding:12px;
  }

  nav{
    grid-template-columns:1fr;
  }

  nav a,
  .logout{
    font-size:13px;
    padding:9px 7px;
  }

  .card{
    padding:12px;
  }

  .page-head h1{
    font-size:22px;
  }

  .file-meta span{
    font-size:11px;
  }

  .file-card{
    grid-template-columns:minmax(0,1fr) 34px;
    padding:9px;
  }

  .action-menu summary{
    width:34px;
    min-height:34px;
    font-size:18px;
  }

  .action-menu-panel{
    width:calc(100vw - 36px);
    max-width:none;
    padding:9px;
  }

  .action-menu-panel .button,
  .action-menu-panel button{
    min-height:36px;
    font-size:12.5px;
  }
}
