:root {
  --bg: #0b1020; --elev: #121735; --card: #121a3b; --muted: #9aa3b2; --text: #eef2ff;
  --accent: #6aa1ff; --accent2: #8ef; --border: #263157; --ok: #27c498; --err: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: linear-gradient(180deg, #0a0f22, #0c1330); color: var(--text); font: 14px/1.5 "Inter", ui-sans-serif, system-ui; }
a { color: white; }
.container { max-width: 1100px; padding: 24px; margin: 0 auto; }
.flex { display:flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.topbar { position: sticky; top: 0; backdrop-filter: blur(10px); background: rgba(10,16,40,.6); border-bottom: 1px solid var(--border); z-index: 10; }
.brand { font-weight: 700; letter-spacing:.3px; color: #fff; text-decoration: none; }
.nav { margin-left: 16px; color: var(--muted); text-decoration: none; }
.nav:hover { color: #fff; }
.card { background: var(--elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-header h1 { margin: 0 0 8px; font-size: 22px; }
.panel { padding: 16px 0 16px 20px; border-top: 1px solid var(--border); width: 501px; }
.hidden { display:none; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
@media (max-width: 920px){ .grid.two { grid-template-columns: 1fr; } }
.row { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.row.inline { flex-direction: row; gap: 10px; align-items: center; }
.row.right, .actions.right { text-align: right; }
label { color: var(--muted); font-size: 12px; }
input, select, button { background: #0c1330; border: 1px solid var(--border); color: #e9eeff; border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn { cursor: pointer; font-weight: 600; }
.btn.primary { background: linear-gradient(180deg, var(--accent), #4d7ff5); border: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); }
.footer { margin-top: 30px; color: var(--muted); font-size: 12px; }

/* Uploader */
.uploader { border: 2px dashed var(--border); border-radius: var(--radius); padding: 0; }
.dropzone { padding: 40px; text-align: center; color: var(--muted); cursor: pointer; border-radius: var(--radius); }
#file-input, #decode-file-input { display:none; }

/* Chips (column selectors) */
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { border:1px solid var(--border); background:#0d1535; padding:6px 10px; border-radius:999px; font-size:12px; display:flex; align-items:center; gap:8px; }
.chip input { width:16px; height:16px; }

/* Table preview */
.table-wrap { overflow:auto; border:1px solid var(--border); border-radius: var(--radius); }
.table-wrap.fullpage { /* expand preview to full page width when content is wider */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-left: none; border-right: none; border-radius: 0;
}
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
.table th { background:#0d1535; position: sticky; top:0; z-index:1; }

.alert { padding: 10px 12px; border-radius: 10px; }
.alert.error { background: rgba(255,107,107,.1); border:1px solid rgba(255,107,107,.4); }
.result { margin-top: 12px; padding: 12px; border:1px solid var(--border); border-radius: var(--radius); background:#0d1535; }
