:root {
  --bg: #05070d;
  --panel: rgba(16, 20, 34, 0.82);
  --line: rgba(140, 160, 220, 0.16);
  --text: #e6e9f2;
  --muted: #8d95ad;
  --accent: #f5c26b;
  --accent2: #7aa2ff;
  font-family: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { display: grid; grid-template-rows: auto 1fr auto; }

header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 26, 46, 0.9), rgba(8, 10, 18, 0.9));
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 28px; color: var(--accent); text-shadow: 0 0 18px rgba(245, 194, 107, 0.7); }
h1 { margin: 0; font-size: 18px; letter-spacing: 0.02em; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: #0b0e18;
  background: var(--accent); border-radius: 4px; padding: 1px 6px; vertical-align: middle; }
header p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent); }

nav button, footer button, .buttons button {
  background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
nav button:hover, footer button:hover, .buttons button:hover { background: rgba(255, 255, 255, 0.09); }
nav button.active, .speeds button.active, .buttons button.active {
  background: rgba(245, 194, 107, 0.16); border-color: rgba(245, 194, 107, 0.55); color: #ffe2a8;
}
nav { display: flex; gap: 6px; }

main { display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
#view { position: relative; min-width: 0; min-height: 0; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#caption { position: absolute; left: 18px; top: 14px; font-size: 13px; color: var(--muted);
  pointer-events: none; max-width: 60%; line-height: 1.5; }
#caption b { color: var(--text); font-weight: 600; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
#tooltip {
  position: absolute; pointer-events: none; background: rgba(10, 13, 24, 0.92);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px;
  line-height: 1.5; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
#tooltip b { color: var(--accent); }

aside {
  border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto;
  padding: 16px 18px 24px; backdrop-filter: blur(8px);
}
h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  margin: 20px 0 8px; font-weight: 600; }
.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
select, input[type=date] {
  background: rgba(255, 255, 255, 0.05); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font: inherit; font-size: 13.5px; color-scheme: dark;
}
.coords { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.card { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.card.column { flex-direction: column; align-items: stretch; gap: 6px; font-size: 13px; line-height: 1.5; }
.big { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; }
table.events { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.events td { padding: 4px 0; border-bottom: 1px solid rgba(140, 160, 220, 0.07); vertical-align: top; }
table.events td:last-child { text-align: right; color: #f1f3f9; white-space: nowrap; padding-left: 10px; }
table.events td.sub { color: var(--muted); font-size: 11.5px; }
.pill { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 99px; margin-left: 6px;
  border: 1px solid var(--line); color: var(--muted); }
.pill.total { color: #ffcf7a; border-color: rgba(255, 207, 122, 0.5); }
.pill.annular { color: #ff9e6b; border-color: rgba(255, 158, 107, 0.5); }
.pill.hybrid { color: #e7a0ff; border-color: rgba(231, 160, 255, 0.5); }
.hint { margin-top: 20px; font-size: 11.5px; color: var(--muted); text-align: center; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; }

footer {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.95); flex-wrap: wrap;
}
#play { width: 44px; }
.speeds, .jumps { display: flex; gap: 4px; align-items: center; }
.speeds button { padding: 6px 9px; font-size: 12px; }
#clock { min-width: 210px; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.25; }
#clock-local { font-size: 15px; font-weight: 600; }
#clock-utc { font-size: 11.5px; }
#date-input { margin-left: auto; }

@media (max-width: 980px) {
  main { grid-template-columns: 1fr; grid-template-rows: 1fr 260px; }
  aside { border-left: 0; border-top: 1px solid var(--line); }
}
