:root {
  --bg: #04070f;
  --panel: rgba(12, 22, 40, 0.72);
  --panel-solid: #0a1424;
  --line: rgba(80, 150, 230, 0.18);
  --blue: #4db1ff;
  --blue-bright: #8fd0ff;
  --text: #dce8f7;
  --muted: #7d93ad;
  --danger: #ff6b6b;
  --ok: #57d9a3;
  --warn: #ffcf6b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-bright); }

/* ---- nav ---- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  position: relative; z-index: 10;
  background: rgba(4, 7, 15, 0.6); backdrop-filter: blur(6px);
}
.brand {
  font-weight: 700; font-size: 1.2rem; letter-spacing: 0.5px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
/* ---- "SI" wordmark gag: hand-drawn S, A struck out ----
   Everything is sized in em so the one markup works at nav size (1.2rem) and
   hero size (up to 5rem). non-scaling-stroke keeps the marker weight even
   where the strike SVG is stretched to fit the letter. */
.sibrand { position: relative; white-space: nowrap; }
.sibrand-s {
  display: inline-block; width: 0.58em; height: 0.82em;
  vertical-align: -0.09em; margin-right: 0.02em; overflow: visible;
}
.sibrand-a { position: relative; display: inline-block; }
.sibrand-strike {
  position: absolute; left: -26%; top: 50%; width: 152%; height: 1.15em;
  transform: translateY(-50%); overflow: visible; pointer-events: none;
}
.sibrand-s path, .sibrand-strike path {
  stroke: #ff2525; stroke-linecap: round; stroke-linejoin: round;
  /* Glow matches the site's neon treatment so the marker doesn't look pasted on. */
  filter: drop-shadow(0 0 0.06em rgba(255, 37, 37, 0.55));
}
.sibrand-s path { stroke-width: 0.085em; }
.sibrand-strike path { stroke-width: 0.075em; }
@media (prefers-reduced-motion: reduce) {
  .sibrand-s path, .sibrand-strike path { filter: none; }
}

.brand-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 12px 2px var(--blue);
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-user { color: var(--muted); font-size: 0.85rem; }
.btn-ghost {
  border: 1px solid var(--line); padding: 6px 14px; border-radius: 8px;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--blue); }

/* ---- flash ---- */
.flash-wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.flash {
  margin-top: 14px; padding: 11px 16px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel);
}
.flash-error { border-color: var(--danger); color: #ffd5d5; }
.flash-success { border-color: var(--ok); color: #c8f6e4; }
.flash-warning { border-color: var(--warn); color: #ffeec4; }

.main { position: relative; z-index: 5; }

/* ---- landing ---- */
#entity-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  display: block;
}
.hero {
  position: relative; z-index: 2;
  min-height: calc(100vh - 58px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 40px 20px; pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem); margin: 0; font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #eaf4ff, var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 50px rgba(77, 177, 255, 0.25);
}
.hero p.tag { color: var(--blue-bright); font-size: 1.15rem; margin: 10px 0 6px; }
.hero p.sub { color: var(--muted); max-width: 560px; line-height: 1.6; }
.hero .cta { margin-top: 30px; pointer-events: auto; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px;
  background: linear-gradient(135deg, #1e6fd0, var(--blue));
  color: #021019; font-weight: 700; border: none; cursor: pointer;
  box-shadow: 0 0 26px rgba(77, 177, 255, 0.4); font-size: 1rem;
}
.btn:hover { color: #021019; filter: brightness(1.1); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--blue); box-shadow: none; margin-left: 12px;
}

/* ---- cards / forms ---- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px; backdrop-filter: blur(8px);
}
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 20px; }
.auth-wrap h2 { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: #060c18; color: var(--text);
  font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--blue); }
.muted { color: var(--muted); font-size: 0.85rem; }
.center { text-align: center; }

/* ---- content sections ---- */
.section { max-width: 980px; margin: 36px auto; padding: 0 20px; }
.section h2 { font-weight: 700; }
.site-footer {
  max-width: 980px; margin: 8px auto 36px; padding: 8px 20px 12px;
  display: flex; flex-wrap: wrap; gap: 18px;
  color: var(--muted); font-size: 0.85rem;
}

/* ---- upload ---- */
.dropzone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 40px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(77,177,255,0.05); }
.dropzone .big { font-size: 1.1rem; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tr:hover td { background: rgba(77,177,255,0.04); }

/* ---- job rows ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; border: 1px solid var(--line);
}
.badge.queued { color: var(--warn); border-color: var(--warn); }
.badge.running { color: var(--blue); border-color: var(--blue); }
.badge.completed { color: var(--ok); border-color: var(--ok); }
.badge.error { color: var(--danger); border-color: var(--danger); }
.badge.cancelled { color: var(--muted); }

.progress {
  height: 8px; background: #0a1526; border-radius: 6px; overflow: hidden;
  margin-top: 6px;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #1e6fd0, var(--blue)); width: 0%;
  transition: width .4s;
}
/* Upload finished sending but the server is still relaying it onward, so the
   real remaining time is unknown — sweep instead of implying a percentage. */
.progress > span.indeterminate {
  background: linear-gradient(90deg, #1e6fd0, var(--blue), #1e6fd0);
  background-size: 200% 100%;
  animation: progress-sweep 1.1s linear infinite;
}
@keyframes progress-sweep {
  from { background-position: 200% 0; }
  to   { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .progress > span.indeterminate { animation: none; }
}
.row-actions button, .row-actions a {
  font-size: 0.8rem; padding: 5px 11px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  cursor: pointer; margin-right: 6px;
}
.row-actions button:hover { border-color: var(--blue); }
.row-actions .danger:hover { border-color: var(--danger); color: var(--danger); }
.transcript-box {
  white-space: pre-wrap; background: #060c18; border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; max-height: 360px; overflow: auto;
  font-family: "Consolas", monospace; font-size: 0.85rem; margin-top: 10px;
}
.tabbar { display: flex; gap: 10px; margin-bottom: 18px; }
.tabbar button, .tabbar a {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 8px 16px; border-radius: 9px; cursor: pointer;
  font: inherit; display: inline-block; line-height: 1.2;
}
.tabbar button.active, .tabbar a.active { color: var(--text); border-color: var(--blue); }
.tabbar a:hover { color: var(--text); }

/* ---- cost banner ---- */
.cost-banner {
  display: flex; flex-wrap: wrap; gap: 22px; align-items: center;
  background: linear-gradient(135deg, rgba(30,111,208,0.12), rgba(77,177,255,0.06));
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px;
  margin-bottom: 8px;
}
.cost-banner .total { font-size: 1.6rem; font-weight: 800; color: var(--blue-bright); }
.cost-banner .total small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.cost-banner .stat { color: var(--muted); font-size: .85rem; }
.cost-banner .stat b { color: var(--text); font-size: 1.05rem; }
.cost-note { color: var(--muted); font-size: .8rem; margin-top: 4px; }

/* ---- minutes paper view ---- */
.paper {
  background: #fbfaf6; color: #1a1a1a; max-width: 820px; margin: 24px auto;
  padding: 50px 60px; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.4);
  font-family: Georgia, 'Times New Roman', serif; line-height: 1.6;
}
.paper h1 { color: #0a2a4a; border-bottom: 2px solid #4db1ff; padding-bottom: 8px; }
.paper h2 { color: #0a2a4a; margin-top: 26px; }
.paper h3 { color: #214a73; }
.paper table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.paper th, .paper td { border: 1px solid #bbb; padding: 6px 10px; }
.paper th { background: #eef5ff; }
.paper blockquote { border-left: 3px solid #4db1ff; margin: 10px 0; padding: 4px 14px; color: #444; }

/* ---- about page diagram ---- */
.flow { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; margin: 22px 0; }
.flow .node {
  flex: 1; min-width: 200px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
}
.flow .node h4 { margin: 0 0 6px; color: var(--blue-bright); }
.flow .arrow { display: flex; align-items: center; color: var(--blue); font-size: 1.6rem; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; padding: 12px 12px 12px 52px; margin: 10px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 14px; top: 12px; width: 26px; height: 26px;
  background: var(--blue); color: #021019; border-radius: 50%; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
