:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --ink: #1b2233;
  --muted: #8088a0;
  --line: #ebedf4;
  --accent: #4f56e0;
  --accent-soft: #ecedfd;
  --green: #2bb673;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(27, 34, 64, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, also over elements that set their own
   display (.login-wrap, .app, .raw-bar use display: grid/flex). Without this,
   toggling .hidden in JS does not actually hide them. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 24px; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.wave { display: inline-block; }

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(79,86,224,.25); }
.btn-primary:hover { background: #424ad6; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #e0e2fb; }
.btn-small { padding: 8px 13px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 18px; height: 18px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #8f95ff);
}
.brand-logo {
  width: 22px; height: 22px; border-radius: 6px;
  object-fit: cover; display: block;
}
.view-brand { margin-bottom: 14px; }
.brand-name { font-weight: 700; letter-spacing: -.2px; font-size: 15px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--card);
  width: 100%; max-width: 360px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-sub { color: var(--muted); font-size: 14px; margin: 2px 0 4px; }
.login-card input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.error { color: #d8473b; font-size: 13px; margin: 0; }

/* App shell */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex; flex-direction: column;
}
.sidebar-brand { padding: 4px 8px 22px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: #aab0c4;
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; text-decoration: none;
}
.nav-ico { width: 16px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.disabled { opacity: .45; cursor: default; pointer-events: none; }
.badge {
  margin-left: auto;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.profile { display: flex; align-items: center; gap: 11px; padding: 6px 8px 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8f95ff);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.profile-name { font-size: 14px; font-weight: 700; }
.profile-role { font-size: 12px; color: var(--muted); }

.main { padding: 26px 34px 48px; min-width: 0; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb span { margin: 0 6px; opacity: .6; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }

/* Stat cards */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px;
}
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat-chip {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
}
.chip-indigo { background: #ecedfd; color: #4f56e0; }
.chip-green { background: #e3f6ed; color: #2bb673; }
.chip-amber { background: #fdf0dd; color: #e09b2d; }
.chip-rose { background: #fde6ea; color: #e0506e; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Runs */
.runs { display: flex; flex-direction: column; gap: 14px; }
.run-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.run-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.run-title { font-weight: 700; font-size: 15px; }
.run-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.run-pill {
  font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
}
.run-pill.done { background: #e3f6ed; color: var(--green); }

/* Stage checklist */
.stages { display: flex; flex-wrap: wrap; gap: 8px; }
.stage {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.stage .tick {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid #d6dae6;
  display: grid; place-items: center; font-size: 10px;
}
.stage.done { color: var(--ink); }
.stage.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.stage.current { background: var(--accent-soft); color: var(--accent); }
.stage.current .tick { border-color: var(--accent); }

.run-actions { display: flex; gap: 8px; margin-top: 16px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* Run detail (rich layout) */
.run-detail {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  min-width: 0;
}
.rd-head { margin-bottom: 20px; }
.rd-title { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 11px; }

/* Carousel header with arrows */
.carousel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.carousel-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.carousel-nav { display: flex; gap: 8px; }
.cnav {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.cnav:hover { background: var(--bg); border-color: #d6dae6; }

.stage-carousel {
  position: relative;
  min-width: 0;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding-bottom: 10px;
}
.stage-carousel::-webkit-scrollbar { height: 8px; }
.stage-carousel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; }
.scard {
  flex: 0 0 324px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 22px 24px;
  display: flex; flex-direction: column;
}
.scard.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scard.locked { background: #fbfbfd; }
.scard-top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.scard-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #e3f6ed; color: var(--green);
}
.scard.current .scard-ico { background: var(--accent-soft); color: var(--accent); }
.scard.locked .scard-ico { background: var(--bg); color: #aab0c4; }
.scard-ico svg { width: 22px; height: 22px; }
.scard-name { font-size: 15px; font-weight: 700; line-height: 1.25; }
.scard-status {
  align-self: flex-start; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px; margin-bottom: 14px;
}
.s-done { background: #e3f6ed; color: var(--green); }
.s-current { background: var(--accent-soft); color: var(--accent); }
.s-locked { background: var(--bg); color: var(--muted); }
.scard-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; flex: 1; }
.scard-output { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.scard-output-label { font-size: 11px; color: #aab0c4; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.scard-output-val { font-size: 15px; font-weight: 700; }
.scard-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-finish { background: var(--green); color: #fff; }
.btn-finish:hover { background: #25a065; }
.scard-actions .btn { width: 100%; text-align: center; }
.scard-locked[disabled] { background: var(--bg); color: var(--muted); }

/* Progress timeline */
.timeline { display: flex; align-items: center; margin: 24px 6px 26px; }
.tl-node {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 2px solid var(--line); background: #fff; color: var(--muted);
}
.tl-node.done { background: var(--green); border-color: var(--green); color: #fff; }
.tl-node.current { border-color: var(--accent); color: var(--accent); }
.tl-line { flex: 1; height: 2px; background: var(--line); }
.tl-line.on { background: var(--green); }

/* Lower panels */
.run-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rs-panel { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.rs-panel h3 { font-size: 14px; margin: 0 0 14px; }
.rs-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.rs-row:last-child { border-bottom: none; }
.rs-row span { color: var(--muted); }
.qa-row { display: flex; gap: 8px; flex-wrap: wrap; }
.qa-del { color: #d8473b; }
.qa-del.armed { background: #fde6ea; color: #d8473b; }

/* Archived runs */
.run-pill.arch { background: var(--bg); color: var(--muted); }
.arch-bar { display: flex; justify-content: center; margin: 2px 0; }

/* ============================================================
   Dark, high-tech runs box + run summary
   ============================================================ */
.run-block { display: flex; flex-direction: column; gap: 16px; }
.run-block.archived { opacity: .6; transition: opacity .2s; }
.run-block.archived:hover { opacity: 1; }

.run-detail.dark {
  position: relative;
  overflow: hidden;
  padding: 32px 36px;
  background: radial-gradient(130% 150% at 100% 0%, #14233f 0%, #0b1220 55%);
  border: 1px solid rgba(120, 140, 200, .14);
  box-shadow: 0 12px 44px rgba(5, 10, 25, .42);
}
.run-detail.dark > *:not(.particles) { position: relative; z-index: 1; }
.run-detail.dark .rd-title { color: #fff; font-size: 20px; }
.run-detail.dark .run-meta { color: #8693ad; }
.run-detail.dark .rd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rd-tools { display: flex; align-items: center; gap: 10px; }
.run-detail.dark .cnav {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
  color: #cfd8ea;
}
.run-detail.dark .cnav:hover { background: rgba(255, 255, 255, .1); }
.run-detail.dark .run-pill { background: rgba(91, 140, 255, .16); color: #9bb8ff; }
.run-detail.dark .run-pill.done { background: rgba(52, 210, 123, .15); color: #34d27b; }
.run-detail.dark .run-pill.arch { background: rgba(255, 255, 255, .07); color: #8693ad; }

/* Floating particles */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; border-radius: 50%;
  background: rgba(120, 180, 255, .55);
  box-shadow: 0 0 6px rgba(120, 180, 255, .55);
  animation-name: drift; animation-timing-function: ease-in-out; animation-iteration-count: infinite;
}
.particle:nth-child(3n) { background: rgba(52, 210, 123, .55); box-shadow: 0 0 6px rgba(52, 210, 123, .55); }
.particle:nth-child(4n) { background: rgba(180, 200, 255, .5); box-shadow: 0 0 5px rgba(180, 200, 255, .5); }
@keyframes drift {
  0% { transform: translateY(0); opacity: .12; }
  50% { opacity: .7; }
  100% { transform: translateY(-26px); opacity: .12; }
}

/* Flowing glow timeline */
.run-detail.dark .timeline { margin: 16px 8px 32px; }
.run-detail.dark .tl-node {
  background: #0e1830; border: 2px solid rgba(255, 255, 255, .12); color: #5b6680;
}
.run-detail.dark .tl-node.done {
  background: rgba(52, 210, 123, .16); border-color: #34d27b; color: #34d27b;
  box-shadow: 0 0 12px rgba(52, 210, 123, .55);
}
.run-detail.dark .tl-node.current {
  background: #16223f; border-color: #7fb0ff; color: #fff;
  box-shadow: 0 0 16px rgba(120, 170, 255, .75);
}
.run-detail.dark .tl-line { background: rgba(255, 255, 255, .08); }
.run-detail.dark .tl-line.on {
  background: linear-gradient(90deg, rgba(52, 210, 123, .2), #34d27b, rgba(52, 210, 123, .2));
  background-size: 200% 100%;
  box-shadow: 0 0 9px rgba(52, 210, 123, .5);
  animation: flow 2.4s linear infinite;
}
@keyframes flow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* Dark stage cards */
.run-detail.dark .scard { background: rgba(255, 255, 255, .025); border-color: rgba(255, 255, 255, .07); }
.run-detail.dark .scard.current {
  border-color: #5b8cff; background: rgba(91, 140, 255, .07);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .16), 0 0 24px rgba(91, 140, 255, .14);
}
.run-detail.dark .scard.locked { background: rgba(255, 255, 255, .012); }
.run-detail.dark .scard-name { color: #e7edf7; }
.run-detail.dark .scard-desc { color: #8693ad; }
.run-detail.dark .scard-output-label { color: #6b7793; }
.run-detail.dark .scard-output-val { color: #e7edf7; }
.run-detail.dark .scard-ico { background: rgba(52, 210, 123, .14); color: #34d27b; }
.run-detail.dark .scard.current .scard-ico { background: rgba(91, 140, 255, .18); color: #9bb8ff; }
.run-detail.dark .scard.locked .scard-ico { background: rgba(255, 255, 255, .05); color: #5b6680; }
.run-detail.dark .s-done { background: rgba(52, 210, 123, .14); color: #34d27b; }
.run-detail.dark .s-current { background: rgba(91, 140, 255, .18); color: #9bb8ff; }
.run-detail.dark .s-locked { background: rgba(255, 255, 255, .05); color: #7a8298; }
.run-detail.dark .scard .btn-soft,
.run-detail.dark .scard .btn-ghost {
  background: transparent; border: 1px solid rgba(255, 255, 255, .13); color: #cfd8ea;
}
.run-detail.dark .scard .btn-soft:hover,
.run-detail.dark .scard .btn-ghost:hover { background: rgba(255, 255, 255, .06); }
.run-detail.dark .scard .btn-primary { background: #4f6ef2; color: #fff; box-shadow: 0 0 18px rgba(79, 110, 242, .35); }
.run-detail.dark .scard .scard-locked[disabled] { background: rgba(255, 255, 255, .04); color: #5b6680; border-color: rgba(255, 255, 255, .08); }

/* Lower row: dark summary + radar, light quick actions */
.run-lower { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.rs-panel.dark {
  position: relative; overflow: hidden;
  border: 1px solid rgba(120, 140, 200, .14);
  background: radial-gradient(130% 130% at 78% 35%, #14233f 0%, #0b1220 62%);
  border-radius: 16px; padding: 28px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
}
.rs-info { flex: 1; min-width: 0; }
.rs-panel.dark h3 { color: #fff; }
.rs-panel.dark .rs-row { border-bottom-color: rgba(255, 255, 255, .07); color: #dbe3f1; }
.rs-panel.dark .rs-row span { color: #8693ad; }
.rs-panel.dark .run-pill { background: rgba(52, 210, 123, .15); color: #34d27b; }
.rs-progress { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 20px; overflow: hidden; margin: 2px 0 8px; }
.rs-progress-fill { height: 100%; background: linear-gradient(90deg, #2bb673, #34d27b); box-shadow: 0 0 10px rgba(52, 210, 123, .65); }

/* Radar / orbital visualization */
.radar { position: relative; width: 176px; height: 176px; flex-shrink: 0; }
.radar-ring {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid rgba(52, 210, 123, .2);
  animation: ringpulse 3.2s ease-in-out infinite;
}
.radar-ring.r1 { width: 64px; height: 64px; }
.radar-ring.r2 { width: 116px; height: 116px; animation-delay: .5s; }
.radar-ring.r3 { width: 168px; height: 168px; animation-delay: 1s; }
@keyframes ringpulse { 0%, 100% { opacity: .25; } 50% { opacity: .65; } }
.radar-sweep {
  position: absolute; top: 50%; left: 50%; width: 168px; height: 168px;
  margin: -84px 0 0 -84px; border-radius: 50%; transform-origin: center center;
  background: conic-gradient(from 0deg, rgba(52, 210, 123, .26), transparent 70deg);
  animation: spin-self 4s linear infinite;
}
.radar-orbit {
  position: absolute; top: 50%; left: 50%; border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin-orbit linear infinite;
}
.radar-orbit.o1 { width: 64px; height: 64px; animation-duration: 6s; }
.radar-orbit.o2 { width: 116px; height: 116px; animation-duration: 9s; animation-direction: reverse; }
.radar-orbit.o3 { width: 168px; height: 168px; animation-duration: 13s; }
.radar-dot {
  position: absolute; top: -3px; left: 50%; margin-left: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #9bf0c0; box-shadow: 0 0 9px #34d27b;
}
.radar-core {
  position: absolute; top: 50%; left: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: radial-gradient(circle, #34d27b, #1c9e5b);
  color: #06160c; display: grid; place-items: center; font-size: 21px; font-weight: 800;
  animation: corepulse 2.6s ease-in-out infinite;
}
@keyframes corepulse {
  0%, 100% { box-shadow: 0 0 18px rgba(52, 210, 123, .5); }
  50% { box-shadow: 0 0 32px rgba(52, 210, 123, .85); }
}
@keyframes spin-self { to { transform: rotate(360deg); } }
@keyframes spin-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Quick actions as big buttons (light) */
.qa-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; }
.qa-panel h3 { font-size: 14px; margin: 0 0 16px; }
.qa-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.qa-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px 18px; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .15s, background .15s, transform .05s;
}
.qa-card:hover { border-color: var(--accent); background: var(--bg); }
.qa-card:active { transform: translateY(1px); }
.qa-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.qa-ico svg { width: 20px; height: 20px; }
.qa-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.qa-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.qa-card.danger .qa-ico { background: #fde6ea; color: #d8473b; }
.qa-card.danger .qa-title { color: #d8473b; }
.qa-card.danger:hover { border-color: #f0a8b4; background: #fdeff1; }
.qa-card.danger.armed { background: #fde6ea; border-color: #ef9aa8; }
.qa-card.accent { background: var(--accent-soft); border-color: rgba(79, 86, 224, .3); }
.qa-card.accent .qa-ico { background: var(--accent); color: #fff; }
.qa-card.accent .qa-title { color: var(--accent); }
.qa-card.accent:hover { border-color: var(--accent); background: #e6e8fc; }

/* Lock icon in the locked stage button */
.lock-wrap { display: inline-flex; align-items: center; gap: 6px; }
.lock-ico { width: 14px; height: 14px; }

/* Empty state (no active runs) */
.empty-state {
  position: relative; overflow: hidden; text-align: center;
  background: radial-gradient(130% 150% at 50% -10%, #14233f 0%, #0b1220 60%);
  border: 1px solid rgba(120, 140, 200, .14);
  border-radius: var(--radius);
  box-shadow: 0 12px 44px rgba(5, 10, 25, .42);
  padding: 72px 32px 78px;
}
.empty-state > *:not(.particles) { position: relative; z-index: 1; }
.empty-orb { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.empty-orb-ring {
  position: absolute; top: 50%; left: 50%; border-radius: 50%;
  border: 1px solid rgba(91, 140, 255, .4); transform: translate(-50%, -50%);
  animation: ringpulse 3s ease-in-out infinite;
}
.empty-orb-ring:nth-child(1) { width: 84px; height: 84px; }
.empty-orb-ring:nth-child(2) { width: 120px; height: 120px; animation-delay: .6s; }
.empty-orb-core {
  position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #6f86ff, #3a44c8);
  color: #fff; font-size: 30px; line-height: 1;
  box-shadow: 0 0 26px rgba(79, 110, 242, .6);
  animation: orbpulse 2.6s ease-in-out infinite;
}
@keyframes orbpulse {
  0%, 100% { box-shadow: 0 0 20px rgba(79, 110, 242, .5); }
  50% { box-shadow: 0 0 38px rgba(79, 110, 242, .85); }
}
.empty-state h2 { color: #fff; font-size: 22px; margin: 30px 0 10px; }
.empty-state p { color: #8693ad; font-size: 14px; line-height: 1.6; max-width: 440px; margin: 0 auto 28px; }
.empty-cta { padding: 12px 24px; font-size: 15px; box-shadow: 0 0 26px rgba(79, 110, 242, .45); }
.empty-arch {
  display: block; margin: 22px auto 0; background: transparent; border: none;
  color: #9bb8ff; font-weight: 600; font-size: 13px; cursor: pointer;
}
.empty-arch:hover { color: #bcd0ff; text-decoration: underline; }

@media (max-width: 980px) {
  .rs-panel.dark .radar { display: none; }
}

@media (max-width: 980px) {
  .run-lower { grid-template-columns: 1fr; }
}

/* Views and nav active state set from JS */
.view { animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Panels and forms */
.grid-2 { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.panel h2 { margin-bottom: 14px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input, .form select, .form textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--ink); outline: none;
  background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form textarea { resize: vertical; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
.field-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink);
  outline: none; background: #fff; margin-bottom: 10px;
}
.field-input:focus { border-color: var(--accent); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }
#src-scrape { display: flex; flex-direction: column; gap: 12px; }
.src-scrape-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#csv-file { font-size: 13px; margin-bottom: 10px; display: block; }
.inline { flex-direction: row !important; align-items: center; gap: 8px !important; }
.inline select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; }

/* Source rows */
.src-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.src-row:last-child { border-bottom: none; }
.type-badge {
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.type-badge.manual { background: #e3f6ed; color: var(--green); }
.type-badge.url { background: #ecedfd; color: var(--accent); }
.type-badge.reddit { background: #fde9e0; color: #d2622b; }
.type-badge.apify_fb { background: #e1ebfd; color: #2f6fe0; }
.src-main { flex: 1; min-width: 0; }
.src-label { font-weight: 600; font-size: 14px; }
.src-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-actions { display: flex; align-items: center; gap: 10px; }

/* Toggle */
.toggle { position: relative; width: 38px; height: 22px; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { position: absolute; inset: 0; background: #d6dae6; border-radius: 20px; transition: background .15s; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track + .knob { transform: translateX(16px); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px; border-radius: 8px; }
.icon-btn:hover { color: #d8473b; background: var(--bg); }

/* Raw review */
.raw-pick { display: flex; align-items: center; }
.raw-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 18px; margin-bottom: 16px;
}
.raw-counts { display: flex; gap: 16px; font-size: 13px; }
.raw-counts b { font-weight: 700; }
.raw-counts .c-kept { color: var(--green); }
.raw-counts .c-del { color: #d8473b; }
.raw-bulk { display: flex; gap: 8px; }

.raw-item {
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: flex-start;
}
.raw-item.is-deleted { opacity: .5; }
.raw-item.is-kept { border-left: 3px solid var(--green); }
.raw-check { margin-top: 3px; }
.raw-body { flex: 1; min-width: 0; }
.raw-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.raw-meta a { color: var(--accent); text-decoration: none; }
.raw-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.raw-row-actions { display: flex; flex-direction: column; gap: 6px; }
.status-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; align-self: flex-start; }
.status-tag.pending { background: var(--bg); color: var(--muted); }
.status-tag.kept { background: #e3f6ed; color: var(--green); }
.status-tag.deleted { background: #fde6ea; color: #d8473b; }

/* Swipe review */
.swipe-item {
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px;
}
.swipe-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.swipe-bron { font-size: 12px; color: var(--muted); font-weight: 600; }
.swipe-citaat {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--ink);
  resize: vertical; outline: none; line-height: 1.45;
}
.swipe-citaat:focus { border-color: var(--accent); }
.swipe-controls { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.swipe-field { display: flex; flex-direction: column; gap: 3px; }
.swipe-field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.swipe-field select, .swipe-field input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); outline: none;
}
.swipe-field select:focus, .swipe-field input:focus { border-color: var(--accent); }
.swipe-field.grow { flex: 1; min-width: 120px; }
.swipe-field.grow input { width: 100%; }
.swipe-del { margin-left: auto; align-self: flex-end; }
.bucket-chip {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.b-Pijn { background: #fde6ea; color: #d8473b; }
.b-Benefit { background: #e3f6ed; color: var(--green); }
.b-Failed { background: #fdf0dd; color: #e09b2d; }
.b-Objection { background: #ecedfd; color: var(--accent); }
.conf { font-size: 11px; color: var(--muted); }

/* Hoeken (message map) */
.map-item {
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 12px;
}
.map-hoek {
  width: 100%; border: none; border-bottom: 2px solid transparent;
  font-size: 16px; font-weight: 700; color: var(--ink); font-family: inherit;
  padding: 2px 0 6px; outline: none; background: transparent;
}
.map-hoek:focus { border-bottom-color: var(--accent); }
.map-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 10px 0 3px; }
.map-kernzin, .map-bewijs {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--ink);
  resize: vertical; outline: none; line-height: 1.45;
}
.map-kernzin:focus, .map-bewijs:focus { border-color: var(--accent); }
.map-bewijs { color: var(--muted); font-size: 13px; }
.map-controls { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* Aanbevelingen */
.laag-group { margin-bottom: 22px; }
.laag-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.laag-tag {
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
}
.laag-sub { font-size: 12px; color: var(--muted); }
.rec-item {
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px; display: flex; gap: 13px; align-items: flex-start;
}
.rec-item.is-done { opacity: .62; }
.rec-check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid #d6dae6;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0; margin-top: 2px;
  font-size: 13px; color: #fff; background: #fff; transition: background .12s, border-color .12s;
}
.rec-item.is-done .rec-check { background: var(--green); border-color: var(--green); }
.rec-body { flex: 1; min-width: 0; }
.rec-hook { font-size: 15px; font-weight: 700; line-height: 1.4; }
.rec-item.is-done .rec-hook { text-decoration: line-through; }
.rec-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 6px; }
.rec-pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  background: var(--bg); color: var(--muted);
}
.rec-pill.fmt { background: #ecedfd; color: var(--accent); }
.rec-pill.cnt { background: #fdf0dd; color: #e09b2d; }
.rec-pain { font-size: 13px; color: var(--ink); margin-bottom: 3px; }
.rec-rationale { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Kennis */
.kn-proposals {
  background: #fbfaf4; border: 1px solid #efe7cf; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.kn-proposals h3 { margin: 0 0 10px; font-size: 14px; }
.kn-prop {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.kn-prop:last-child { margin-bottom: 0; }
.kn-prop-body { flex: 1; min-width: 0; font-size: 13px; }
.kn-group { margin-bottom: 20px; }
.kn-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.kn-rule {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 8px;
}
.kn-rule.off { opacity: .5; }
.kind-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.k-dont { background: #fde6ea; color: #d8473b; }
.k-do { background: #e3f6ed; color: var(--green); }
.k-example { background: #fdf0dd; color: #e09b2d; }
.kn-rule-body { flex: 1; min-width: 0; }
.kn-rule-title { font-weight: 700; font-size: 14px; }
.kn-rule-text { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.kn-src { font-size: 11px; color: #aab0c4; font-weight: 600; }

/* Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
