:root { color-scheme: light; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f6f7fb; }
.wrap { max-width: 920px; margin: 28px auto; padding: 0 16px; }
.top h1 { margin: 0 0 6px 0; font-size: 22px; }
.sub { margin: 0 0 18px 0; color: #444; }

.card { background: #fff; border: 1px solid #e7e7ef; border-radius: 14px; padding: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.04); margin-bottom: 14px; }
.drop { border: 2px dashed #c9ccdb; border-radius: 14px; padding: 28px; text-align: center; background: #fafbff; }
.drop.hover { border-color: #6b77ff; background: #f2f4ff; }
.hint { margin: 6px 0; color: #666; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; color: #333; }

button { border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #1f2a44; color: #fff; }
button:hover { opacity: .92; }

.log { margin: 12px 0 0; background: #0f172a; color: #dbeafe; border-radius: 12px; padding: 12px; min-height: 90px; overflow: auto; }
.outlist { display: grid; gap: 8px; margin-top: 8px; }
.outitem { padding: 10px 12px; background: #f7f8fc; border: 1px solid #ececf6; border-radius: 12px; color: #222; }

/* Outputs toolbar */
.outtools {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  padding: 8px 10px;
  margin: 10px 0 8px 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.outtools a {
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.35);
  padding-bottom: 1px;
}

.outtools a:hover {
  border-bottom-color: rgba(255,255,255,0.8);
}

/* Output list */
.outlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.outitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.outitem:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}

.outitem input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.outitem a {
  text-decoration: none;
}

.outitem a:hover {
  text-decoration: underline;
}

.outmeta {
  opacity: 0.65;
  font-size: 13px;
}

/* push download icon to the far right */
.outitem a[title="Download"] {
  margin-left: auto;
  font-size: 16px;
  text-decoration: none;
  opacity: 0.85;
}

.outitem a[title="Download"]:hover {
  opacity: 1;
  text-decoration: none;
}


.layout3 {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 14px;
  align-items: start;
}

.maincol { min-width: 0; }

.panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  padding: 10px;
}

.panelhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 6px 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}

.paneltitle { font-weight: 600; }

.panelmeta {
  opacity: 0.7;
  font-size: 13px;
  text-align: right;
}

.filelist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow: auto;
  padding: 2px;
}

.fileitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.fileitem:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}

.fileitem input[type="checkbox"] { width: 16px; height: 16px; }

.fileitem .meta { opacity: 0.65; font-size: 13px; }

.fileitem .dl {
  margin-left: auto;
  text-decoration: none;
  opacity: 0.85;
  font-size: 16px;
}

.fileitem .dl:hover { opacity: 1; }

.panelactions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

.btn:hover { background: rgba(255,255,255,0.10); }

.panelhint { margin-top: 8px; opacity: 0.65; font-size: 13px; }


/* --- layout3 overrides (fix wrap/max-width collision) --- */
.layout3{
  width: min(1600px, calc(100% - 32px));
  margin: 18px auto;
}

.wrap.maincol{
  max-width: none !important;
  width: 100%;
}

.layout3{
  grid-template-columns: 360px minmax(520px, 1fr) 360px;
}

/* make side panels visually consistent with cards */
.panel{
  background: rgba(255,255,255,0.03);
}

/* archive/upload filelist links should look like links */
.fileitem a{
  text-decoration: none;
}
.fileitem a:hover{
  text-decoration: underline;
}

/* --- buttons: readable on light background --- */
.btn{
  color: rgba(255,255,255,0.92);
  background: rgba(10,16,28,0.95);
  border: 1px solid rgba(10,16,28,0.95);
}

.btn:hover{
  background: rgba(10,16,28,0.88);
}

.btn.secondary{
  color: rgba(10,16,28,0.90);
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.10);
}

.btn.secondary:hover{
  background: rgba(255,255,255,0.95);
}

/* --- panels look like cards --- */
.panel{
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.panelhead{
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.paneltools{
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
}

.paneltools a{
  color: inherit;
}

.filecol{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.filecol a, .filecol div{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fileitem .meta{
  opacity: 0.60;
  font-size: 12px;
  line-height: 1.2;
}


select#outfmt{
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
}
