:root {
  --bg: #0b0e14;
  --fg: #e6e1cf;
  --muted: #a6accd;
  --brand: #7aa2f7;
  --panel: #11151f;
  --border: #1f2430;
  --accent: #8bd5ca;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --shadow: 0 12px 28px rgba(0,0,0,.35);
  --radius: 16px;
}

/* Base */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 960px; margin: 0 auto; padding: 24px; }

/* Header */
header { text-align: center; padding-top: 32px; padding-bottom: 8px; }
h1 { margin: 0; font-size: clamp(28px, 4.2vw, 40px); letter-spacing: 0.5px; }
.subtitle { margin: 8px 0 16px; color: var(--muted); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: linear-gradient(180deg, #121826, #0e1420);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.btn:hover { border-color: var(--brand); box-shadow: 0 0 0 2px #1a2333 inset, var(--shadow); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Panels & Sections */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin: 18px 0; box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; }
.panel h3 { margin-bottom: 8px; }

.note { color: var(--muted); }
.code {
  background: #0f1623; border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  overflow: auto;
}

/* Pills / Badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #0f1623; border: 1px solid var(--border); color: var(--muted); }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; background:#0f1623; border:1px solid var(--border); border-radius:6px; padding:2px 6px; }

/* Picker */
.picker { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; margin: 12px 0 18px; }
.picker button {
  padding: 10px 0; background: #0f1623; color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: transform .1s ease, border-color .15s ease, box-shadow .2s ease;
}
.picker button:hover { transform: translateY(-1px); border-color: var(--brand); }
.picker button.active { outline: 2px solid var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px #0f1a26 inset; }

/* Grid & Raw */
.grid-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-section, .raw-section { display: grid; gap: 10px; }
.grid {
  width: 320px; height: 320px; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  background: #0f1623; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.cell { border: 1px solid #151b28; transition: background-color .1s ease; }
.cell.on { background: var(--accent); }
.raw { background: #0f1623; border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 320px; overflow: auto; }
.note-wrap { display:grid; gap:10px; }

/* Tables (optional sections you might add later) */
.table { width:100%; border-collapse: separate; border-spacing:0; background:#0f1623; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.table th, .table td { padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; }
.table th { background:#0e1420; }
.table tr:last-child td { border-bottom:0; }

/* Alerts */
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }

/* Footer */
.footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; gap:12px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 760px) {
  .grid-wrap { grid-template-columns: 1fr; }
  .grid { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* Focus visible for accessibility */
:where(a, button, [role="button"]) :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
