:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --border: rgba(255,255,255,0.12);
  --accent: #2d6cdf;
  --accent2:#1f5ad1;
  --ok:#2ecc71;
  --warn:#f1c40f;
  --bad:#ff5a5f;
  --shadow: 0 12px 35px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: light) {
  :root{
    --bg:#f6f7fb;
    --card:#ffffff;
    --card2:#f3f5ff;
    --text: rgba(0,0,0,0.88);
    --muted: rgba(0,0,0,0.55);
    --border: rgba(0,0,0,0.10);
    --shadow: 0 10px 24px rgba(16,24,40,0.10);
  }
}

*{ box-sizing: border-box; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(45,108,223,0.25), transparent 60%),
              radial-gradient(900px 500px at 80% 10%, rgba(46,204,113,0.16), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

.app{
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 18px 32px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 14px;
}

.logo{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #10b981);
  box-shadow: var(--shadow);
}

h1{
  margin:0;
  font-size: 22px;
  line-height: 1.2;
}
.sub{
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.dot{
  width: 10px; height:10px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(241,196,15,0.16);
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h2{
  margin: 2px 0 6px;
  font-size: 16px;
}
.muted{
  color: var(--muted);
}

.form{
  margin-top: 10px;
}

.row{
  margin: 12px 0;
}
label{
  display:block;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 8px;
}
.file{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--card2);
}
input[type="file"]{
  max-width: 60%;
}
.fileMeta{
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 40%;
  text-align:right;
}

.actions{
  display:flex;
  gap: 10px;
  margin-top: 14px;
}

.btn{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 650;
}
.btn:hover{
  background: rgba(127,127,127,0.08);
}
.btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover{
  filter: brightness(1.05);
}

.btn.small{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.hint{
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.status{
  margin-top: 6px;
}

.statusTop{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.label{
  color: var(--muted);
  font-size: 12px;
}
.value{
  font-weight: 750;
  font-size: 13px;
}

.badge{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card2);
  font-weight: 750;
  font-size: 12px;
}

.progress{
  margin: 12px 0 10px;
  height: 10px;
  width:100%;
  border-radius: 999px;
  background: rgba(127,127,127,0.18);
  overflow:hidden;
  border: 1px solid var(--border);
}
.bar{
  height:100%;
  width:0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 220ms ease;
}

.statusMsg{
  font-size: 13px;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card2);
}

.divider{
  margin: 14px 0;
  height:1px;
  background: var(--border);
}

.downloads h3, .logs h3{
  margin: 0 0 10px;
  font-size: 14px;
}

.dlGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.dl{
  display:block;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card2);
  text-decoration: none;
  color: var(--text);
}
.dl:hover{
  filter: brightness(1.05);
}
.dlTitle{
  display:block;
  font-weight: 800;
  margin-bottom: 3px;
}
.dlMeta{
  display:block;
  color: var(--muted);
  font-size: 12px;
}

.logsTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.logBox{
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.22);
  max-height: 240px;
  overflow:auto;
  font-size: 12px;
  line-height: 1.45;
}

@media (prefers-color-scheme: light) {
  .logBox{ background: rgba(0,0,0,0.06); }
}

.smallText{ font-size: 12px; }

.footer{
  margin-top: 16px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.tabs{
  display:flex;
  gap:10px;
  margin: 10px 0 16px;
}
.tab{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 750;
  font-size: 13px;
}
.tab.active{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
}
.tabPanel{ display:none; }
.tabPanel.active{ display:block; }

.summary{
  display:grid;
  gap: 8px;
  margin-bottom: 14px;
}
.summaryRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card2);
}
.okBox{ border-color: rgba(46,204,113,0.35) !important; }
.warnBox{ border-color: rgba(241,196,15,0.45) !important; }
.callout{
  border: 1px solid var(--border);
  background: var(--card2);
  border-radius: 14px;
  padding: 12px 12px;
  margin-top: 12px;
}

.callout-title{
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.callout-body{
  color: var(--muted);
  line-height: 1.55;
}

.callout code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.callout-warn{
  border-color: rgba(241,196,15,0.45);
  box-shadow: 0 0 0 4px rgba(241,196,15,0.10);
}

.callout-warn .callout-title{
  color: var(--text);
}
