/* Same tokens and look as the local Galileu panel (web/style.css there). */
:root {
  color-scheme: dark;
  --bg: #0b1322;
  --panel: #111c31;
  --panel-2: #16233d;
  --line: #22324f;
  --text: #e6ecf7;
  --muted: #93a3c0;
  --accent: #f2c14e;
  --blue: #7aa7ff;
  --ok: #3fbf86;
  --bad: #ef6461;
  --warn: #e0a84a;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }

header {
  display: flex; align-items: center; gap: 18px; padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); height: 54px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12px; }
nav { display: flex; gap: 4px; margin-left: 12px; }
nav button {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 12px; cursor: pointer; color: var(--muted);
}
nav button.on { background: var(--panel-2); color: var(--text); border-color: var(--line); }
#status { margin-left: auto; display: flex; gap: 8px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; white-space: nowrap; }
.pill.ok::before { content: "● "; color: var(--ok); }
.pill.bad::before { content: "● "; color: var(--bad); }
.pill.warn::before { content: "● "; color: var(--warn); }

main { display: grid; grid-template-columns: 330px 1fr; height: calc(100% - 54px); }
aside#left { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; }
.pane { display: none; flex-direction: column; gap: 12px; }
.pane.on { display: flex; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12.5px; }
input[type=number], input[type=text], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text); width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 1px solid var(--blue); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
button.primary {
  background: var(--accent); color: #1a1406; border: none; border-radius: 8px; padding: 9px 14px;
  font-weight: 600; cursor: pointer;
}
button.primary:disabled { opacity: .5; cursor: progress; }
button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; cursor: pointer; color: var(--muted); font-size: 12px; }
button.ghost:hover { border-color: var(--blue); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-size: 12px; }
.latex { min-height: 26px; padding: 6px 8px; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; overflow-x: auto; }

.param { display: grid; grid-template-columns: 58px 1fr 74px; gap: 8px; align-items: center; }
.param .name { color: var(--text); font-size: 13px; }
.param input[type=range] { accent-color: var(--accent); width: 100%; }

#center { overflow-y: auto; }
.hilbert {
  min-height: 100%; padding: 18px 22px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(122,167,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122,167,255,.07) 1px, transparent 1px),
    linear-gradient(rgba(122,167,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122,167,255,.035) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
#welcome { text-align: center; margin-top: 18vh; color: var(--muted); }
#welcome h1 { font-weight: 300; font-size: 44px; color: var(--text); margin: 0 0 8px; letter-spacing: 1px; }

.card { background: rgba(17,28,49,.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.card h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.result-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.result-head .meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.plot { height: 360px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.falsify { border-left: 2px solid var(--accent); padding: 2px 0 2px 10px; color: var(--text); font-size: 13px; line-height: 1.5; margin: 0; }
.progress { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--bad); }

@media (max-width: 900px) {
  header { flex-wrap: wrap; height: auto; gap: 8px; padding: 8px 12px; }
  .brand small { display: none; }
  #status { margin-left: auto; }
  nav { margin-left: 0; overflow-x: auto; order: 3; width: 100%; }
  main { display: block; height: auto; }
  aside#left { border-right: none; border-bottom: 1px solid var(--line); }
  #center { min-height: 60vh; }
  .hilbert { padding: 12px; }
  .plots { grid-template-columns: 1fr; }
  .plot { height: 300px; }
  #welcome { margin-top: 8vh; }
  input, select { font-size: 16px; }
}
