:root{
  --ibero-red:#E00034;
  --ibero-red-dark:#b10029;
  --bg:#0b0f18;
  --panel:#121826;
  --text:#e6edf3;
  --muted:#94a3b8;
  --divider:#1f2937;
  --line:#334155;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Topbar with IBERO colors */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:var(--ibero-red); color:white;
}
.topbar .brand{ display:flex; align-items:center; gap:10px; }
.topbar .logo{ height:28px; width:auto; }
.topbar h1{ margin:0; font-size:18px; font-weight:700; letter-spacing:.2px; }
.topbar .actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.chk{ font-size:13px; display:flex; align-items:center; gap:6px; }

/* Layout */
.container{
  display:grid; grid-template-columns: 1fr 340px;
  height: calc(100vh - 60px);
}
#viewer{ position:relative; background:#0a0f1a; }
#stats{
  background:var(--panel); border-left:1px solid var(--divider);
  padding:16px; overflow:auto;
}
.hintbar{
  position:absolute; left:8px; bottom:8px; right:auto;
  background: rgba(0,0,0,.35); padding:6px 10px; border-radius:10px;
  font-size:12px; color:#cbd5e1;
}

/* Buttons */
.btn{
  background:#1f2937; color:var(--text); padding:8px 12px;
  border:1px solid #263244; border-radius:12px; cursor:pointer; font-weight:600;
}
.btn:hover{ border-color:var(--line); }
.btn.primary{ background:var(--ibero-red); border-color:var(--ibero-red-dark); }
.btn.primary:hover{ background:var(--ibero-red-dark); }

.file{ display:none; }

/* Dropzone */
.dropzone{
  border:2px dashed var(--line); border-radius:12px; padding:14px;
  text-align:center; color:var(--muted); transition:.2s; margin-bottom:12px;
}
.dropzone.dragover{ border-color: var(--ibero-red); color: var(--ibero-red); background: rgba(224,0,52,.08); }

/* Stats */
.kv{ margin:0; }
.kv dt{ color:var(--muted); font-size:12px; }
.kv dd{ margin:0 0 10px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size:14px; }

.controls-block{ margin:14px 0 8px; border-top:1px solid var(--divider); padding-top:10px; }
.row{ display:flex; gap:8px; align-items:center; }
.row.wrap{ flex-wrap:wrap; }
.row.between{ justify-content:space-between; width:100%; }
.axis{ width:24px; font-size:12px; color:var(--muted); }
.small{ font-size:13px; color:var(--muted); }
.note{ font-size:12px; color:var(--muted); margin-top:10px; }

/* Inputs */
input[type="number"]{
  width:80px; padding:6px; border-radius:10px; outline:none;
  background:#0b1220; border:1px solid var(--line); color:#e2e8f0;
}

/* Responsive */
@media (max-width: 980px){
  .container{ grid-template-columns: 1fr; height:auto; }
  #viewer{ height: 64vh; min-height: 320px; }
  .topbar{ align-items:flex-start; gap:10px; }
}
