:root {
  --bg: #07111c;
  --bg-elev: #0d1a28;
  --panel: rgba(14, 28, 42, 0.88);
  --text: #e8f1f8;
  --muted: #8fa6bb;
  --line: rgba(145, 180, 210, 0.18);
  --accent: #2eb8a2;
  --accent-2: #d7a35a;
  --danger: #e26d6d;
  --ok: #3fbf8f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(46, 184, 162, 0.16), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(215, 163, 90, 0.12), transparent 50%),
    linear-gradient(180deg, #0a1624 0%, var(--bg) 45%, #081018 100%);
}
body.page-login { overflow-x: hidden; }
body.page-login .bg-glow { opacity: 0.28; }
body.page-login .top-guest {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
  opacity: 0.5;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(14px);
  background: rgba(7, 17, 28, 0.72);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand strong { display: block; font-size: 1rem; letter-spacing: 0.02em; }
.brand small { color: var(--muted); font-size: 0.78rem; }
.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.85rem;
  background:
    radial-gradient(circle at 30% 30%, #7af0d8, transparent 45%),
    linear-gradient(145deg, #1d7f72, #0e3d4a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.top-right { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lang-switch {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
}
.lang-switch a.active {
  color: #042018;
  background: var(--accent);
}
nav { display: flex; gap: 0.85rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
nav a:hover, .nav-logout { color: var(--text); }

main {
  width: min(1080px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}
.main-login {
  width: min(1120px, calc(100% - 2rem));
  margin: 1rem auto 2.5rem;
  min-height: calc(100vh - 5.5rem);
  display: grid;
  align-items: center;
}
.brand-static {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}
h1 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
}
.lead, .muted { color: var(--muted); line-height: 1.55; }
.lead { font-size: 1.05rem; max-width: 42rem; }

.panel, .hero-panel, .source-card, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.panel, .hero-panel { padding: 1.4rem 1.5rem 1.6rem; }
.panel-head { margin-bottom: 1.2rem; }

.chip-row { margin: 1rem 0 1.4rem; }
.chip {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(255,255,255,0.03);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 8.5rem;
  padding: 1.1rem;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(46,184,162,0.16), transparent 55%),
    rgba(255,255,255,0.03);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.tile:hover { transform: translateY(-2px); border-color: rgba(46,184,162,0.45); }
.tile-soft {
  background:
    linear-gradient(160deg, rgba(215,163,90,0.14), transparent 55%),
    rgba(255,255,255,0.03);
}
.tile-kicker { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tile strong { font-size: 1.05rem; line-height: 1.35; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stack-form { display: grid; gap: 1rem; }
.form-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 0.9rem;
}
label { display: block; color: var(--muted); font-size: 0.9rem; }
input[type=number],
input[type=text],
input[type=password],
input[type=email],
input[type=search],
input:not([type]),
select {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a1520;
  color: var(--text);
  font: inherit;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder { color: rgba(143, 166, 187, 0.55); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #0a1520 inset;
  transition: background-color 99999s ease-out;
}
fieldset.source-card {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 0.75rem;
}
fieldset.source-card legend {
  padding: 0 0.4rem;
  color: var(--text);
  font-weight: 650;
}

.dropzone {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  text-align: center;
  padding: 1.1rem 0.9rem;
  border-radius: 16px;
  border: 1.5px dashed rgba(46, 184, 162, 0.35);
  background: rgba(8, 20, 30, 0.65);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(46, 184, 162, 0.08);
  transform: translateY(-1px);
}
.dropzone.has-files {
  border-style: solid;
  border-color: rgba(46, 184, 162, 0.55);
}
.dropzone-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.2rem;
  border-radius: 0.7rem;
  background:
    linear-gradient(135deg, transparent 42%, rgba(215,163,90,0.9) 43% 57%, transparent 58%),
    linear-gradient(45deg, transparent 42%, rgba(46,184,162,0.95) 43% 57%, transparent 58%),
    rgba(255,255,255,0.06);
}
.dropzone-title { color: var(--text); font-weight: 650; font-size: 0.92rem; }
.dropzone-hint { color: var(--muted); font-size: 0.82rem; }
.dropzone-meta { color: rgba(143,166,187,0.8); font-size: 0.75rem; }
.dropzone-files {
  margin-top: 0.35rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 1.1em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  background: linear-gradient(135deg, #39cbb4, #1f9a88);
  color: #042018;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(46, 184, 162, 0.25);
}
.btn:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn.secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line);
}

.alert {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid;
}
.alert.error { background: rgba(226, 109, 109, 0.12); border-color: rgba(226,109,109,0.45); }
.alert.ok { background: rgba(63, 191, 143, 0.12); border-color: rgba(63,191,143,0.45); }

.result-box, pre {
  overflow: auto;
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #07121c;
  font-size: 0.84rem;
  line-height: 1.45;
}
.status-line { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

/* Login composition */
.login-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.35rem;
  align-items: stretch;
  min-height: 620px;
  animation: rise-in 0.7s ease both;
}
.login-visual {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(146, 210, 190, 0.22);
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(46, 184, 162, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(215, 163, 90, 0.18), transparent 50%),
    linear-gradient(155deg, #0b2430 0%, #07111c 48%, #0a1a22 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 2.4rem;
  display: flex;
  align-items: flex-end;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.login-orb-a {
  width: 320px;
  height: 320px;
  right: -60px;
  top: -80px;
  background: radial-gradient(circle at 35% 35%, rgba(122,240,216,0.6), rgba(46,184,162,0.1) 55%, transparent 72%);
  animation: floaty 8s ease-in-out infinite;
}
.login-orb-b {
  width: 180px;
  height: 180px;
  left: 12%;
  top: 28%;
  background: radial-gradient(circle at 40% 40%, rgba(215,163,90,0.35), transparent 70%);
  animation: floaty 11s ease-in-out infinite reverse;
  opacity: 0.7;
}
.login-wave {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 18%;
  height: 120px;
  background:
    radial-gradient(ellipse 40% 70% at 20% 50%, rgba(122,240,216,0.18), transparent 70%),
    radial-gradient(ellipse 35% 60% at 55% 55%, rgba(46,184,162,0.22), transparent 70%),
    radial-gradient(ellipse 30% 55% at 85% 45%, rgba(122,240,216,0.14), transparent 70%);
  filter: blur(8px);
  animation: pulse-soft 5.5s ease-in-out infinite;
}
.login-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(122, 240, 216, 0.07) 48%,
    transparent 52%
  );
  background-size: 100% 220%;
  animation: scan 6.5s linear infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  mask-image: linear-gradient(180deg, black, transparent 88%);
}
.login-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  margin: 0;
  color: var(--text);
}
.login-brand {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--font);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(120deg, #e8f1f8 20%, #7af0d8 70%, #d7a35a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-visual-copy > p {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.3;
  color: rgba(232, 241, 248, 0.92);
}
.login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.login-points li {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(46, 184, 162, 0.55);
}
.login-card {
  padding: 2.2rem 1.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise-in 0.85s ease 0.08s both;
}
.login-card h1 {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}
.login-form { display: grid; gap: 1rem; margin-top: 1.35rem; }
.login-form input {
  background: #07131d;
  border-color: rgba(145, 180, 210, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-form input:focus {
  outline: none;
  border-color: rgba(46, 184, 162, 0.65);
  box-shadow: 0 0 0 3px rgba(46, 184, 162, 0.18);
}
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #07131d inset;
}
.login-form .btn {
  margin-top: 0.35rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.login-form .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(46, 184, 162, 0.28);
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(14px); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 0.65; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(1.04); }
}
@keyframes scan {
  0% { background-position: 0 -40%; }
  100% { background-position: 0 140%; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result viewer */
.job-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.job-status-pill {
  margin: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: 0.9rem;
}
.job-status-pill[data-status="succeeded"] { border-color: rgba(63, 191, 143, 0.45); color: var(--ok); }
.job-status-pill[data-status="failed"] { border-color: rgba(226, 109, 109, 0.45); color: var(--danger); }
.job-status-pill[data-status="running"],
.job-status-pill[data-status="queued"] { border-color: rgba(46, 184, 162, 0.4); }
.waiting-line { margin: 1.2rem 0 0; }
.result-view { margin-top: 1.4rem; animation: rise-in 0.45s ease both; }
.result-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.metric-card {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(16, 34, 48, 0.95), rgba(8, 18, 28, 0.9));
  display: grid;
  gap: 0.25rem;
}
.metric-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
}
.metric-value {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 650;
  color: var(--text);
  line-height: 1.15;
  word-break: break-word;
}
.metric-hint {
  color: rgba(143,166,187,0.85);
  font-size: 0.78rem;
}
.series-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.series-panel {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 28, 0.55);
}
.series-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.series-head h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.series-head .muted { margin: 0; font-size: 0.82rem; }
.series-cands {
  margin: 0;
  max-width: 16rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
}
.series-cands span {
  display: block;
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 0.15rem;
}
.chart-block { margin-top: 0.75rem; }
.chart-title {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  font-weight: 650;
}
.series-chart {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(4, 12, 20, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(145, 180, 210, 0.12);
}
.chart-axis { stroke: rgba(145, 180, 210, 0.25); stroke-width: 1; }
.chart-axis-label { fill: rgba(143,166,187,0.75); font-size: 10px; font-family: var(--font); }
.chart-line { stroke: #2eb8a2; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-marker-es { fill: #e26d6d; }
.chart-marker-ed { fill: #d7a35a; }
.chart-marker-label { fill: var(--text); font-size: 10px; font-family: var(--font); font-weight: 700; }
.chart-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border-radius: 12px;
  border: 1px dashed var(--line);
}
.cycle-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0.55rem;
  border-radius: 12px;
  background: rgba(4, 12, 20, 0.55);
  border: 1px solid rgba(145, 180, 210, 0.12);
}
.cycle-cell {
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: rgba(145, 180, 210, 0.18);
}
.cycle-cell.is-min { background: rgba(226, 109, 109, 0.55); }
.cycle-cell.is-max { background: rgba(215, 163, 90, 0.55); }
.cycle-cell.is-selected-min { background: #e26d6d; box-shadow: 0 0 0 1px rgba(255,255,255,0.35); }
.cycle-cell.is-selected-max { background: #d7a35a; box-shadow: 0 0 0 1px rgba(255,255,255,0.35); }
.cycle-cell.is-invalid { opacity: 0.35; }
.cycle-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.cycle-legend .swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.cycle-legend .swatch.min { background: #e26d6d; }
.cycle-legend .swatch.max { background: #d7a35a; }
.raw-json {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.raw-json summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  user-select: none;
}
.raw-json[open] summary { color: var(--text); margin-bottom: 0.55rem; }
.kv-card {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 28, 0.55);
}
.kv-card h3 { margin: 0 0 0.55rem; font-size: 0.92rem; color: var(--muted); }
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(145, 180, 210, 0.1);
  font-size: 0.9rem;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span { color: var(--muted); }
.tool-result { margin-top: 1rem; }

.overlays-section { margin: 0 0 1.25rem; }
.overlays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.overlay-card {
  margin: 0;
  padding: 0.65rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 28, 0.7);
  display: grid;
  gap: 0.45rem;
}
.overlay-card figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.overlay-card img,
.overlay-card video {
  width: 100%;
  border-radius: 10px;
  background: #040c14;
  display: block;
}
.overlay-card-video { grid-column: 1 / -1; }
.overlay-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.frame-player { display: grid; gap: 0.55rem; }
.frame-stage {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.frame-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
}
.frame-controls input[type="range"] { width: 100%; }
.frame-btn {
  min-width: 2.6rem;
  padding: 0.45rem 0.7rem;
}
.frame-pos {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.overlay-lightbox[hidden] { display: none !important; }
.overlay-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 8, 14, 0.82);
  cursor: pointer;
}
.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #07111c;
  box-shadow: var(--shadow);
}
.lightbox-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}
.lightbox-dialog img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  background: #040c14;
}
body.lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
  .tile-grid, .split, .form-row, .login-shell, .series-grid { grid-template-columns: 1fr; }
  .login-visual { min-height: 280px; padding: 1.6rem; }
  .login-points { display: none; }
  .top { align-items: flex-start; flex-direction: column; }
  .main-login { min-height: auto; margin-top: 0.5rem; }
  .series-cands { text-align: left; max-width: none; }
}
