:root {
  --bg: #f4f8fc;
  --ink: #0b1f33;
  --ink-soft: #35506a;
  --muted: #6b8298;
  --line: rgba(11, 31, 51, 0.1);
  --line-strong: rgba(11, 31, 51, 0.16);
  --paper: rgba(255, 255, 255, 0.86);
  --paper-solid: #ffffff;
  --accent: #1569d2;
  --accent-deep: #0e4ea3;
  --accent-soft: rgba(21, 105, 210, 0.1);
  --accent-line: rgba(21, 105, 210, 0.28);
  --ok: #0f7a4d;
  --ok-soft: rgba(15, 122, 77, 0.1);
  --err: #c0392b;
  --err-soft: rgba(192, 57, 43, 0.08);
  --running: #1569d2;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", "Segoe UI", sans-serif;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 16px 36px rgba(11, 31, 51, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(165deg, #ffffff 0%, #f2f7fc 42%, #e7f0fa 100%);
}

.atmosphere-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 45% at 8% 0%, rgba(21, 105, 210, 0.14), transparent 62%),
    radial-gradient(ellipse 45% 35% at 92% 8%, rgba(70, 130, 200, 0.1), transparent 58%);
}

.atmosphere-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.5;
  animation: drift 12s var(--ease) infinite alternate;
}

.atmosphere-orb-a {
  width: min(420px, 44vw);
  height: min(420px, 44vw);
  left: -6%;
  top: 6%;
  background: rgba(21, 105, 210, 0.18);
}

.atmosphere-orb-b {
  width: min(340px, 36vw);
  height: min(340px, 36vw);
  right: -4%;
  top: 30%;
  background: rgba(120, 170, 220, 0.16);
  animation-delay: -3s;
}

.atmosphere-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(11, 31, 51, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 51, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 72%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 0;
  animation: rise 0.55s var(--ease) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid var(--accent);
  border-radius: 3px;
  transform: rotate(45deg);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 1px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
  line-height: 1;
  display: block;
  color: var(--ink);
}

.brand-tag {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pulse-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
}

.pulse-dot[data-state="running"] {
  background: var(--accent);
  animation: pulse-ring 1.7s ease-out infinite;
}

.topbar-status {
  margin: 0;
  max-width: 38ch;
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.25rem 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 0.7fr;
  gap: 1.4rem;
  align-items: end;
  padding: 2.2rem 0 1.85rem;
  border-bottom: 1px solid var(--line);
  animation: rise 0.65s var(--ease) 0.04s both;
}

.hero-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--ink);
}

.hero-line {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 38ch;
  font-weight: 500;
}

.hero-stat {
  justify-self: end;
  min-width: 190px;
  padding: 1.15rem 1.2rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-solid);
  box-shadow: var(--shadow);
  text-align: right;
  animation: rise 0.7s var(--ease) 0.1s both;
}

.hero-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent-deep);
}

.hero-stat-label {
  display: block;
  margin: 0.3rem 0 0.7rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.section {
  margin-top: 1.5rem;
  padding: 1.4rem 1.35rem 1.45rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.7s var(--ease) 0.12s both;
}

.section-history { animation-delay: 0.16s; }

.section-manual {
  animation-delay: 0.1s;
}

.section-manual .start-panel {
  margin-top: 0.35rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.section-manual .manual-copy {
  margin: 0.85rem 0 0;
}

.section-manual code {
  font-size: 0.82em;
  color: var(--accent-deep);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.history-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.history-search {
  display: block;
  margin: 0;
}

.history-search input {
  width: min(16.5rem, 42vw);
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

.history-search input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.history-search input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(21, 105, 210, 0.12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-lead {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 50ch;
  font-weight: 500;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(11, 31, 51, 0.06);
  color: var(--ink-soft);
  border: 1px solid transparent;
}

.status[data-state="running"] {
  background: var(--accent-soft);
  color: var(--running);
  border-color: var(--accent-line);
}

.status[data-state="ok"],
.status[data-state="finished"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.status[data-state="failed"],
.status[data-state="error"] {
  background: var(--err-soft);
  color: var(--err);
}

.bots-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.95rem;
}

.bots-empty {
  grid-column: 1 / -1;
  padding: 2.6rem 1.4rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(165deg, #fff, rgba(21, 105, 210, 0.04));
}

.bots-empty-visual {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  border: 2px solid var(--accent-line);
  background: radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 70%);
  animation: soft-glow 2.2s ease-in-out infinite;
}

.bots-empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bots-empty-copy {
  margin: 0.5rem auto 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.bot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.bot-card.is-new {
  animation: rise 0.45s var(--ease) both;
}

.bot-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--muted);
  opacity: 0.35;
}

.bot-card[data-state="running"]::before {
  background: var(--accent);
  opacity: 1;
  animation: pulse-bar 1.7s ease-in-out infinite;
}

.bot-card[data-state="finished"]::before { background: var(--ok); opacity: 1; }
.bot-card[data-state="failed"]::before { background: var(--err); opacity: 1; }

.bot-card[data-state="finished"] {
  border-color: rgba(15, 122, 77, 0.28);
  background: linear-gradient(165deg, #ffffff 0%, #f1faf5 100%);
  box-shadow: 0 12px 28px rgba(15, 122, 77, 0.08);
}

.bot-card[data-state="finished"] .bot-metric-value em {
  color: var(--ok);
}

.bot-card[data-state="running"]:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}

.bot-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.bot-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.bot-id {
  margin: 0.32rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  word-break: break-all;
}

.bot-metrics {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.7fr;
  gap: 0.5rem;
}

.bot-metric-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bot-metric-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.25;
  word-break: break-word;
}

.bot-metric-value em {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
}

.bot-metric-value.mono { font-variant-numeric: tabular-nums; }

.bot-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(11, 31, 51, 0.08);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.bot-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #3b8ef0);
  transition: width 0.4s var(--ease);
}

.bot-card[data-state="failed"] .bot-progress-fill {
  background: linear-gradient(90deg, #d35448, var(--err));
}

.bot-card[data-state="finished"] .bot-progress-fill {
  background: linear-gradient(90deg, var(--ok), #22a066);
}

.stage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.26rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}

.stage-chip.is-done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: rgba(15, 122, 77, 0.16);
}

.stage-chip.is-current {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: var(--accent-line);
  animation: soft-glow 2s ease-in-out infinite;
}

.stage-chip.is-pending,
.stage-chip.is-more {
  background: rgba(11, 31, 51, 0.05);
  color: var(--muted);
}

.bot-fail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--err);
}

.bot-fail a {
  color: var(--accent-deep);
  text-decoration: none;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.7rem;
  word-break: break-all;
}

.bot-fail a:hover { text-decoration: underline; }

.idme-alerts:empty {
  display: none;
}

.idme-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(196, 120, 28, 0.38);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 243, 224, 0.95), rgba(255, 250, 242, 0.88));
}

.idme-alert-kicker {
  margin: 0 0 0.18rem;
  color: #9a5b12;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.idme-alert h3 {
  margin: 0 0 0.35rem;
  color: #59350a;
  font-size: 0.96rem;
}

.idme-alert a {
  color: var(--accent-deep);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.bot-reason {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(176, 42, 55, 0.18);
  font-size: 0.78rem;
}

.bot-reason-label {
  font-weight: 700;
  color: #9a2330;
  letter-spacing: 0.01em;
}

.bot-reason-value {
  color: var(--err);
  word-break: break-word;
}

.reason-text {
  color: var(--err);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-idme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(196, 120, 28, 0.22);
  font-size: 0.78rem;
}

.bot-idme-label {
  font-weight: 650;
  color: #9a5b12;
  letter-spacing: 0.01em;
}

.bot-idme-url {
  color: var(--accent-deep);
  text-decoration: none;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.7rem;
  word-break: break-all;
  flex: 1 1 12rem;
}

.bot-idme-url:hover { text-decoration: underline; }

.bot-idme-copy {
  flex: 0 0 auto;
}

.idme-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.idme-cell .idme-link {
  color: #9a5b12;
  font-weight: 600;
}

.run-detail-idme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(196, 120, 28, 0.28);
  border-radius: 8px;
  background: rgba(196, 120, 28, 0.06);
  font-size: 0.82rem;
}

.run-detail-idme .label {
  font-weight: 650;
  color: #9a5b12;
}

.run-detail-idme a {
  color: var(--accent-deep);
  word-break: break-all;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
  flex: 1 1 14rem;
}

.bot-success {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(15, 122, 77, 0.18);
  font-size: 0.78rem;
  color: var(--ok);
  font-weight: 650;
}

.bot-success a {
  color: var(--ok);
  text-decoration: none;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.7rem;
  word-break: break-all;
  font-weight: 500;
}

.bot-success a:hover { text-decoration: underline; }

.manual-panel {
  margin-top: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  animation: rise 0.7s var(--ease) 0.2s both;
}

.manual-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.2rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.manual-panel summary::-webkit-details-marker { display: none; }

.manual-panel[open] summary {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.start-panel { padding: 1.1rem 1.2rem 1.2rem; }

.manual-copy {
  margin: 0 0 0.95rem;
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 52ch;
  font-weight: 500;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input[type="text"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper-solid);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.btn-primary,
.btn-ghost {
  font: inherit;
  font-weight: 750;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 0.78rem 1.15rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: #fff;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

.btn-danger {
  background: #fff;
  color: var(--err);
  border-color: rgba(196, 74, 58, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: var(--err-soft);
  border-color: var(--err);
  color: var(--err);
}

.btn-small {
  padding: 0.4rem 0.72rem;
  font-size: 0.76rem;
}

.bot-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.bot-card[data-state="paused"]::before {
  background: #c48a1a;
  opacity: 1;
}

.bot-card[data-state="paused"] {
  background: linear-gradient(165deg, #ffffff 0%, #fff8eb 100%);
}

.status[data-state="paused"] {
  background: rgba(196, 138, 26, 0.12);
  color: #8a620f;
}

.history-wrap {
  max-height: min(28rem, 55vh);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  scrollbar-gutter: stable;
}

.runs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.runs-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.75rem 0.9rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
}

.runs-table tbody td {
  padding: 0.85rem 0.9rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.runs-table tbody tr {
  cursor: pointer;
  transition: background 0.14s var(--ease);
}

.runs-table tbody tr:last-child td { border-bottom: none; }
.runs-table tbody tr:hover { background: rgba(21, 105, 210, 0.04); }
.runs-table tbody tr.is-failed td:first-child {
  box-shadow: inset 3px 0 0 var(--err);
}
.runs-table tbody tr.is-success {
  background: rgba(15, 122, 77, 0.04);
}
.runs-table tbody tr.is-success:hover {
  background: rgba(15, 122, 77, 0.08);
}
.runs-table tbody tr.is-success td:first-child {
  box-shadow: inset 3px 0 0 var(--ok);
}
.runs-table tbody tr.is-success .url-link {
  color: var(--ok);
}

.col-lead .lead-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.col-lead .lead-id {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.col-url { max-width: 280px; }

.col-shot {
  width: 72px;
  vertical-align: middle;
}

.shot-link {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(21, 105, 210, 0.18);
  background: #f4f7fb;
}

.shot-thumb {
  display: block;
  width: 56px;
  height: 40px;
  object-fit: cover;
}

.shot-link:hover {
  border-color: rgba(21, 105, 210, 0.45);
  box-shadow: 0 0 0 2px rgba(21, 105, 210, 0.12);
}

.url-link {
  display: inline-block;
  max-width: 100%;
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 0.76rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  word-break: break-all;
}

.url-link:hover { text-decoration: underline; }
.url-empty { color: var(--muted); }

.col-when {
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty {
  margin: 0;
  padding: 1.4rem 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.footer {
  max-width: 1120px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-bar {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes soft-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21, 105, 210, 0); }
  50% { box-shadow: 0 0 0 4px rgba(21, 105, 210, 0.12); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(21, 105, 210, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(21, 105, 210, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 105, 210, 0); }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(14px, 18px, 0); }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stat {
    justify-self: stretch;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .bots-board { grid-template-columns: 1fr; }
  .bot-metrics { grid-template-columns: 1fr; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-status { text-align: left; }
  .section-head { flex-direction: column; }
  .history-tools {
    width: 100%;
    flex-wrap: wrap;
  }
  .history-search {
    flex: 1 1 auto;
    min-width: 0;
  }
  .history-search input {
    width: 100%;
  }
}

/* �� Live preview + replay (board only; no enrollment logic) �� */
.bot-media {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding-top: 0.15rem;
  border-top: 1px solid var(--line);
}

.bot-preview-thumb {
  display: block;
  width: 88px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0b1f33;
  cursor: pointer;
}

.bot-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bot-preview-thumb.is-empty {
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(11, 31, 51, 0.04);
}

.bot-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.shot-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.col-replay {
  white-space: nowrap;
  vertical-align: middle;
}

.media-modal[hidden] { display: none !important; }

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 51, 0.55);
  backdrop-filter: blur(2px);
}

.media-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 60px rgba(11, 31, 51, 0.28);
  overflow: hidden;
}

.media-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.media-modal-kicker {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.media-modal-head h3 {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.media-modal-body {
  flex: 1;
  min-height: 280px;
  display: grid;
  place-items: center;
  background: #0b1f33;
  padding: 0.75rem;
}

.media-frame {
  max-width: 100%;
  max-height: min(68vh, 620px);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.media-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  text-align: center;
  max-width: 36ch;
}

.media-modal-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: #f7fafc;
}

.media-modal-foot input[type="range"] {
  width: 100%;
}

.media-replay-meta {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.run-detail-panel {
  width: min(720px, 100%);
  max-height: min(92vh, 860px);
}

.run-detail-body {
  flex: 1;
  overflow: auto;
  background: #fff;
  padding: 0.85rem 1rem 1.1rem;
}

.run-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.run-detail-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #f7f9fc;
}

.run-detail-stat .label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.run-detail-stat .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.run-detail-section-title {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.run-timing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.run-timing-table th,
.run-timing-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.run-timing-table th {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f4f7fb;
  position: sticky;
  top: 0;
}

.run-timing-table td.col-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
  width: 4.5rem;
}

.run-timing-table tr.is-slow td {
  background: rgba(196, 74, 58, 0.06);
}

.run-timing-table tr.is-slow td.col-time {
  color: var(--err);
}

.run-timing-table .stage-url {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}

.run-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

@media (max-width: 640px) {
  .run-detail-meta {
    grid-template-columns: 1fr;
  }
}
