/* ─────────────────────────────────────────────────────────────────────────────
   Scraper ops — enterprise workspace design system.
   Shared by every wwwroot page. Tokens match the KSECO product redesign.
   Bootstrap is still loaded for modals/dropdowns/toasts; everything visual
   below overrides or sidesteps it.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --sc-bg: #f5f7fa;
  --sc-surface: #fff;
  --sc-border: #e6eaf0;
  --sc-divider: #f6f8fa;
  --sc-control: #e2e8f0;
  --sc-ink: #0f172a;
  --sc-ink-2: #475569;
  --sc-ink-3: #64748b;
  --sc-ink-4: #94a3b8;
  --sc-primary: #0ea5e9;
  --sc-primary-hover: #0284c7;
  --sc-link: #0369a1;
  --sc-navy: #101b2e;
  --sc-rail-idle: #aab8cc;
  --sc-rail-section: #5b6b86;
  --sc-sky: #7dd3fc;
  --sc-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.sc-body {
  background: var(--sc-bg);
  color: var(--sc-ink);
  font-family: var(--sc-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.sc-body *,
body.sc-body *::before,
body.sc-body *::after {
  box-sizing: border-box;
}

.sc-body a {
  color: var(--sc-link);
  text-decoration: none;
}

.sc-body a:hover {
  color: var(--sc-primary-hover);
  text-decoration: underline;
}

.mono {
  font-family: var(--sc-mono);
  font-variant-numeric: tabular-nums;
}

.sc-hide {
  display: none !important;
}

/* Component rules set display:flex/grid, which outranks the UA [hidden] rule. */
.sc-body [hidden] {
  display: none !important;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */

.sc-app {
  min-height: 100vh;
  display: flex;
  background: var(--sc-bg);
}

.sc-rail {
  flex: none;
  width: 236px;
  background: var(--sc-navy);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 20px;
}

.sc-rail-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 6px;
  min-height: 30px;
  text-decoration: none;
}

.sc-rail-brand:hover {
  text-decoration: none;
}

.sc-rail-brand svg {
  flex: none;
}

.sc-rail-brand-text {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
}

.sc-rail-brand-text span {
  color: var(--sc-rail-section);
  font-weight: 500;
}

.sc-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sc-rail-section {
  padding: 0 8px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-rail-section);
}

.sc-rail-section + .sc-navlink {
  margin-bottom: 0;
}

.sc-rail-section--spaced {
  padding-top: 16px;
}

.sc-navlink {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sc-rail-idle);
  text-decoration: none;
}

.sc-navlink:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #dbe4f0;
  text-decoration: none;
}

.sc-navlink.is-active {
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
  font-weight: 600;
}

.sc-navlink--register {
  padding: 8px 10px;
  font-size: 13px;
}

.sc-navlink-code {
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-sky);
  width: 18px;
  flex: none;
}

.sc-rail-user {
  margin-top: auto;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 14px 6px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-rail-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #04263a;
  font-size: 12px;
  font-weight: 700;
}

.sc-rail-user-meta {
  min-width: 0;
  flex: 1;
}

.sc-rail-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-rail-user-role {
  font-size: 11px;
  color: #7b8aa3;
}

.sc-rail-signout {
  display: flex;
  border: 0;
  background: none;
  padding: 0;
  color: #64748b;
  cursor: pointer;
}

.sc-rail-signout:hover {
  color: #cbd5e1;
}

.sc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sc-hdr {
  flex: none;
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sc-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--sc-ink-3);
  min-width: 0;
}

.sc-crumbs a {
  color: var(--sc-ink-3);
}

.sc-crumbs .sc-crumb-current {
  color: var(--sc-ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-crumbs i {
  color: #cbd5e1;
  flex: none;
}

.sc-spacer {
  flex: 1;
}

.sc-stamp {
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: var(--sc-ink-4);
  white-space: nowrap;
}

.sc-seg-lang {
  display: flex;
  background: #f1f5f9;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.sc-seg-lang button {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--sc-ink-3);
}

.sc-seg-lang button.is-active {
  background: #e0f2fe;
  color: var(--sc-link);
  font-weight: 600;
}

.sc-content {
  flex: 1;
  min-width: 0;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/*
 * Blocks in the content column keep their own height and let the column scroll.
 *
 * Below 1000px the column is a height-constrained scroller, and a flex item is
 * normally kept at its content height by `min-height: auto` — except that rule
 * is switched off for anything with `overflow` other than visible. Every table
 * card here carries `.sc-card--flush` (overflow: hidden), so without this the
 * flex algorithm is free to crush a whole card to a few pixels, clipping the
 * table inside it, the moment the page is taller than the viewport.
 *
 * flex-shrink rather than `flex: none`, so a block that asks to grow still can.
 */
.sc-content > * {
  flex-shrink: 0;
}

/* ── Layout grids ───────────────────────────────────────────────────────── */

.sc-grid-4 {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 12px;
}

.sc-grid-4--even {
  grid-template-columns: repeat(4, 1fr);
}

.sc-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.sc-split-left {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  align-items: start;
}

.sc-split-right {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}

.sc-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.sc-card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
}

.sc-card--pad {
  padding: 16px;
}

.sc-card--flush {
  overflow: hidden;
}

.sc-card-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.sc-card-hd strong {
  font-size: 13.5px;
}

.sc-card-ft {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fafbfc;
  font-size: 12px;
  color: var(--sc-ink-3);
  flex-wrap: wrap;
}

.sc-card-body {
  padding: 16px;
}

.sc-lead {
  margin: 6px 0 12px;
  font-size: 12.5px;
  color: var(--sc-ink-3);
  line-height: 1.55;
}

.sc-lead:first-child {
  margin-top: 0;
}

/* ── Stat cards ─────────────────────────────────────────────────────────── */

.sc-stat {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-ink-4);
}

.sc-stat-value {
  font-family: var(--sc-mono);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
}

.sc-stat-value--warn {
  color: #b45309;
}

.sc-stat-value--ok {
  color: #047857;
}

.sc-stat-sub {
  font-size: 12px;
  color: var(--sc-ink-3);
}

.sc-stat-sub a,
.sc-stat a {
  font-size: 12px;
  font-weight: 600;
}

.sc-stat--warn {
  background: #fffbeb;
  border-color: #fde68a;
}

/* ── Live band ──────────────────────────────────────────────────────────── */

@keyframes sc-livepulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.4);
  }
}

.sc-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #34d399;
  flex: none;
  animation: sc-livepulse 1.9s ease-in-out infinite;
}

@keyframes sc-bargrow {
  from {
    width: 0;
  }
}

.sc-band {
  background: var(--sc-navy);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-band-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-band-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sc-sky);
}

.sc-band-figure {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sc-band-figure .sc-band-num {
  font-family: var(--sc-mono);
  font-size: 38px;
  line-height: 1;
  font-weight: 500;
  color: #fff;
}

.sc-band-figure--sm .sc-band-num {
  font-size: 22px;
}

.sc-band-figure-sub {
  font-size: 12.5px;
  color: #93a3ba;
  padding-bottom: 5px;
}

.sc-band-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.sc-band-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #38bdf8;
  animation: sc-bargrow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc-band-detail {
  font-family: var(--sc-mono);
  font-size: 11.5px;
  color: #93a3ba;
  word-break: break-word;
}

.sc-band-foot {
  font-size: 11px;
  color: var(--sc-rail-section);
}

.sc-band-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sc-band-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-band-link {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sc-band-link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  text-decoration: none;
}

.sc-band-stop {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: transparent;
  color: #fca5a5;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sc-band-stop:hover {
  background: rgba(248, 113, 113, 0.12);
}

.sc-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 34px;
}

.sc-spark > span {
  flex: 1;
  background: rgba(125, 211, 252, 0.32);
  border-radius: 2px;
  min-height: 2px;
}

.sc-spark > span.is-peak {
  background: var(--sc-sky);
}

/* Quiet variant — nothing running */
.sc-band.is-idle {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  color: var(--sc-ink);
}

.sc-band.is-idle .sc-live-dot {
  background: #cbd5e1;
  animation: none;
}

.sc-band.is-idle .sc-band-label {
  color: var(--sc-ink-4);
}

.sc-band.is-idle .sc-band-num {
  color: var(--sc-ink);
}

.sc-band.is-idle .sc-band-figure-sub,
.sc-band.is-idle .sc-band-detail {
  color: var(--sc-ink-3);
}

.sc-band.is-idle .sc-band-foot {
  color: var(--sc-ink-4);
}

.sc-band.is-idle .sc-band-bar {
  background: #eef2f6;
}

.sc-band.is-idle .sc-band-link {
  border-color: var(--sc-control);
  color: var(--sc-ink-2);
}

/* ── Pills ──────────────────────────────────────────────────────────────── */

.sc-pill {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: #f1f5f9;
  color: var(--sc-ink-2);
}

.sc-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--sc-ink-4);
  flex: none;
}

.sc-pill--nodot::before {
  display: none;
}

.sc-pill--ok {
  background: #ecfdf5;
  color: #047857;
}

.sc-pill--ok::before {
  background: #10b981;
}

.sc-pill--warn {
  background: #fffbeb;
  color: #92400e;
}

.sc-pill--warn::before {
  background: #f59e0b;
}

.sc-pill--bad {
  background: #fef2f2;
  color: #991b1b;
}

.sc-pill--bad::before {
  background: #f43f5e;
}

.sc-pill--info {
  background: #e0f2fe;
  color: var(--sc-link);
}

.sc-pill--info::before {
  background: #0ea5e9;
}

.sc-count {
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: var(--sc-link);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.sc-btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--sc-control);
  background: var(--sc-surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.sc-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
  text-decoration: none;
}

.sc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sc-btn--primary {
  height: 36px;
  padding: 0 14px;
  border: none;
  background: var(--sc-primary);
  color: #fff;
}

.sc-btn--primary:hover {
  background: var(--sc-primary-hover);
  color: #fff;
}

.sc-btn--tall {
  height: 40px;
  width: 100%;
  font-size: 13.5px;
}

.sc-btn--danger {
  border-color: #fecaca;
  color: #dc2626;
}

.sc-btn--danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.sc-btn--warn {
  border: none;
  background: #b45309;
  color: #fff;
}

.sc-btn--warn:hover {
  background: #92400e;
  color: #fff;
}

.sc-btn--sm {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
}

.sc-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Form controls ──────────────────────────────────────────────────────── */

.sc-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-ink-2);
  margin-bottom: 5px;
}

.sc-input,
.sc-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--sc-control);
  border-radius: 9px;
  padding: 0 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--sc-ink);
  background: var(--sc-surface);
}

.sc-input:focus,
.sc-select:focus,
.sc-textarea:focus {
  outline: none;
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.sc-input.mono {
  font-size: 13px;
}

.sc-input--code {
  text-transform: uppercase;
}

.sc-textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--sc-control);
  border-radius: 9px;
  padding: 10px 11px;
  font-family: var(--sc-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--sc-ink);
  background: var(--sc-surface);
  resize: vertical;
}

.sc-field {
  min-width: 0;
}

.sc-hint {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--sc-ink-4);
}

.sc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.sc-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--sc-primary-hover);
  flex: none;
  margin: 0;
}

/* Real switch */
.sc-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--sc-control);
  border-radius: 10px;
  cursor: pointer;
}

.sc-switch {
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.15s ease;
}

.sc-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: left 0.15s ease;
}

.sc-switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sc-switch-row input:checked + .sc-switch {
  background: var(--sc-primary);
}

.sc-switch-row input:checked + .sc-switch::after {
  left: 18px;
}

.sc-switch-row input:focus-visible + .sc-switch {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.sc-switch-text {
  min-width: 0;
}

.sc-switch-title {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.sc-switch-help {
  font-size: 11.5px;
  color: var(--sc-ink-4);
  margin-top: 2px;
}

/* Segmented control */
.sc-seg {
  display: flex;
  background: #f1f5f9;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.sc-seg button {
  flex: 1;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--sc-ink-3);
  white-space: nowrap;
}

.sc-seg button.is-active {
  background: #e0f2fe;
  color: var(--sc-link);
  font-weight: 600;
}

/* Tabs */
.sc-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
}

.sc-tab {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-ink-3);
  padding: 12px 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.sc-tab:hover {
  color: var(--sc-ink);
}

.sc-tab.is-active {
  color: var(--sc-ink);
  border-bottom-color: var(--sc-primary-hover);
}

/* ── Tables (grid rows, card rows on mobile) ────────────────────────────── */

.sc-tscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sc-tgrid {
  min-width: var(--sc-tmin, 940px);
}

.sc-trow {
  display: grid;
  grid-template-columns: var(--sc-cols);
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--sc-divider);
  color: inherit;
  text-decoration: none;
}

a.sc-trow:hover,
.sc-trow.is-clickable:hover {
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
}

.sc-thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--sc-border);
  padding: 9px 16px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-ink-3);
}

.sc-cell {
  font-size: 12.5px;
  padding-right: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-cell--wrap {
  white-space: normal;
  overflow: visible;
}

.sc-cell--num {
  text-align: right;
  font-family: var(--sc-mono);
}

.sc-cell--name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sc-link);
}

.sc-cell--muted {
  color: var(--sc-ink-3);
}

/*
 * The country code was built for the dark rail, where sky-300 reads well. On a
 * white table row it is all but invisible (about 1.7:1 against the card), so
 * inside a cell it takes the muted ink instead. Same markup, same width, only
 * legible — the rail keeps its own colour.
 */
.sc-cell .sc-navlink-code {
  color: var(--sc-ink-3);
}

.sc-cell--chevron {
  display: flex;
  justify-content: flex-end;
  padding-right: 0;
}

.sc-cell--chevron i {
  color: #cbd5e1;
}

.sc-num-running {
  color: var(--sc-link);
  font-weight: 600;
}

.sc-num-failed {
  color: #b45309;
  font-weight: 600;
}

.sc-empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--sc-ink-4);
}

/* ── Active runs list ───────────────────────────────────────────────────── */

.sc-runrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--sc-divider);
  flex-wrap: wrap;
}

.sc-runrow-id {
  min-width: 170px;
  flex: 0 1 210px;
}

.sc-runrow-name {
  font-size: 13px;
  font-weight: 600;
}

.sc-runrow-meta {
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-ink-4);
}

.sc-runrow-prog {
  flex: 1 1 200px;
  min-width: 160px;
}

.sc-runrow-elapsed {
  font-family: var(--sc-mono);
  font-size: 12px;
  color: var(--sc-ink-2);
  flex: none;
  min-width: 64px;
  text-align: right;
}

.sc-bar {
  height: 7px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
  min-width: 70px;
}

.sc-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sc-primary);
  animation: sc-bargrow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc-bar--thick {
  height: 7px;
}

.sc-bar-note {
  font-family: var(--sc-mono);
  font-size: 11px;
  color: var(--sc-ink-3);
  margin-top: 5px;
}

.sc-coverage {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sc-coverage .sc-bar {
  flex: 1 1 70px;
}

/* ── Wells, banners, code blocks ────────────────────────────────────────── */

.sc-well {
  background: #fafbfc;
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 12px;
}

.sc-code {
  background: #fafbfc;
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--sc-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--sc-ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
  margin: 0;
}

.sc-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 12.5px;
  line-height: 1.55;
}

.sc-banner i {
  flex: none;
  margin-top: 1px;
}

.sc-banner--info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
}

.sc-banner--warn {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.sc-banner--danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.sc-toolbar-amber {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 11px 16px;
  font-size: 12.5px;
  color: #92400e;
}

.sc-hairline {
  height: 1px;
  background: #f1f5f9;
}

.sc-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.sc-strip-item {
  min-width: 0;
}

.sc-strip-value {
  font-family: var(--sc-mono);
  font-size: 16px;
  font-weight: 500;
}

.sc-strip-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-ink-4);
  margin-top: 3px;
}

.sc-icon-tile {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-link);
}

/* ── Modals (Bootstrap shell, our skin) ─────────────────────────────────── */

.sc-body .modal-backdrop.show {
  opacity: 1;
  background: rgba(15, 23, 42, 0.45);
}

.sc-body .modal .modal-dialog {
  --bs-modal-width: 620px;
  max-width: min(620px, calc(100vw - 24px));
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.sc-body .modal .modal-dialog--wide {
  --bs-modal-width: 900px;
  max-width: min(900px, calc(100vw - 24px));
}

.sc-body .modal-content {
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  font-family: var(--sc-font);
  color: var(--sc-ink);
  overflow: hidden;
}

.sc-body .modal-header {
  padding: 15px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.sc-body .modal-title {
  font-size: 15px;
  font-weight: 700;
}

.sc-body .modal-body {
  padding: 18px;
  font-size: 13.5px;
}

.sc-body .modal-footer {
  padding: 12px 18px;
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}

.sc-modal-footer-split {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.sc-modal-footer-split .sc-spacer {
  flex: 1;
}

.sc-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

/* ── Toasts (kept from the previous build, restyled container) ──────────── */

.kseco-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.kseco-toast-host .kseco-toast {
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-size: 13px;
  border-radius: 10px;
}

.kseco-toast-host .kseco-toast.kseco-toast-show {
  opacity: 1;
  transform: translateX(0);
}

/* ── Login ──────────────────────────────────────────────────────────────── */

.sc-login {
  min-height: 100vh;
  display: flex;
  background: #fff;
  color: var(--sc-ink);
}

.sc-login-brand {
  flex: 0 0 46%;
  background: var(--sc-navy);
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sc-login-blob {
  position: absolute;
  border-radius: 999px;
}

.sc-login-blob--a {
  top: -120px;
  right: -90px;
  width: 340px;
  height: 340px;
  background: rgba(56, 189, 248, 0.16);
}

.sc-login-blob--b {
  bottom: -140px;
  left: -100px;
  width: 320px;
  height: 320px;
  background: rgba(45, 212, 191, 0.1);
}

.sc-login-brandbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-login-brandbar span {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.sc-login-brandbar > span > span:last-child {
  color: var(--sc-rail-section);
  font-weight: 500;
}

.sc-login-copy {
  position: relative;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sc-login-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sc-sky);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 5px 11px;
}

.sc-login-copy h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 700;
  color: #fff;
}

.sc-login-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #93a3ba;
  max-width: 42ch;
}

.sc-login-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sc-login-point {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: #c8d3e2;
}

.sc-login-point > span:first-child {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-sky);
}

.sc-login-foot {
  position: relative;
  font-size: 11.5px;
  color: var(--sc-rail-section);
}

.sc-login-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.sc-login-form {
  margin: auto;
  width: 100%;
  max-width: 396px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sc-login-form h2 {
  margin: 0 0 7px;
  font-size: 25px;
  font-weight: 700;
}

.sc-login-form p.sc-login-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--sc-ink-3);
}

.sc-google-btn {
  height: 46px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--sc-control);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-ink);
  cursor: pointer;
  text-decoration: none;
}

.sc-google-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--sc-ink);
  text-decoration: none;
}

.sc-login-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--sc-ink-4);
}

.sc-login-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  font-size: 12.5px;
  color: var(--sc-ink-3);
}

.sc-login-status .sc-live-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/*
 * Below 1000px the rail leaves the flow and becomes a slide-over drawer, the
 * same shell the KSECO workspace uses: scrim under it, hamburger in the top
 * bar as the only way in. Tables keep the label-per-cell card stacking this
 * tool already shipped — that reads better on its narrow tables than the
 * frozen-column scroller the workspace tables use.
 */

/* Drawer chrome — inert above 1000px, revealed by the query below. */
.sc-scrim {
  display: none;
}

.sc-mnav-btn {
  display: none;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: -2px;
  padding: 0;
  border: 1px solid var(--sc-control);
  border-radius: 9px;
  background: var(--sc-surface);
  align-items: center;
  justify-content: center;
  color: var(--sc-ink-2);
  cursor: pointer;
}

.sc-mnav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

@media (max-width: 900px) {
  .sc-login {
    min-height: 100dvh;
  }

  .sc-login-brand {
    display: none;
  }

  .sc-login-pane .sc-seg-lang button {
    min-height: 38px;
  }
}

@media (max-width: 559px) {
  .sc-login-pane {
    padding: 16px 16px 20px;
  }

  .sc-login-status {
    flex-wrap: wrap;
  }
}

@media (max-width: 1000px) {
  /* 100dvh so mobile browser chrome can't clip the content column. */
  .sc-app {
    height: 100dvh;
    min-height: 100dvh;
  }

  .sc-main {
    min-height: 0;
  }

  .sc-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 274px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sc-rail.is-open {
    transform: none;
    box-shadow: 26px 0 60px -18px rgba(2, 8, 23, 0.55);
  }

  .sc-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(2, 6, 23, 0.45);
  }

  .sc-scrim.is-on {
    display: block;
  }

  .sc-mnav-btn {
    display: inline-flex;
  }

  /* 44px minimum touch target on everything inside the drawer. */
  .sc-navlink,
  .sc-rail-user,
  .sc-rail-brand {
    min-height: 44px;
  }

  .sc-rail-signout {
    width: 34px;
    height: 34px;
  }

  .sc-hdr {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 14px;
    row-gap: 8px;
  }

  .sc-content {
    padding: 16px 14px;
    overflow-y: auto;
  }

  .sc-grid-4,
  .sc-grid-4--even,
  .sc-grid-3,
  .sc-strip {
    grid-template-columns: 1fr 1fr;
  }

  .sc-grid-2,
  .sc-split-left,
  .sc-split-right {
    grid-template-columns: 1fr;
  }

  /*
   * A card wrapping a table or a tab bar must be free to shrink, otherwise it
   * grows to its content's width and the page clips instead of the scroller
   * inside it panning. Every link in the flex/grid chain needs min-width: 0.
   */
  .sc-content *:has(> .sc-tscroll),
  .sc-content *:has(> .sc-tabs),
  .sc-stack > *,
  .sc-split-left > *,
  .sc-split-right > *,
  .sc-grid-2 > *,
  .sc-grid-3 > *,
  .sc-grid-4 > * {
    min-width: 0;
    max-width: 100%;
  }

  .sc-tgrid {
    min-width: 0 !important;
  }

  .sc-thead {
    display: none !important;
  }

  .sc-trow {
    grid-template-columns: 1fr !important;
    row-gap: 5px;
    padding: 13px 14px;
  }

  .sc-cell {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    text-align: left !important;
    padding-right: 0 !important;
    white-space: normal;
    overflow: visible;
  }

  .sc-cell::before {
    content: attr(data-label);
    color: var(--sc-ink-4);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: none;
  }

  .sc-cell[data-label=""]::before,
  .sc-cell:not([data-label])::before {
    display: none;
  }

  .sc-cell--chevron {
    display: none;
  }

  .sc-body .modal .modal-dialog,
  .sc-body .modal .modal-dialog--wide {
    max-width: calc(100vw - 24px);
  }

  .kseco-toast-host {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
    max-width: none;
  }

  .kseco-toast-host .kseco-toast {
    transform: translateY(1rem);
  }

  .kseco-toast-host .kseco-toast.kseco-toast-show {
    transform: translateY(0);
  }
}

/* The drawer must not animate for operators who ask for reduced motion. */
@media (max-width: 1000px) and (prefers-reduced-motion: reduce) {
  .sc-rail {
    transition: none;
  }
}

@media (max-width: 640px) {
  .sc-grid-4,
  .sc-grid-4--even,
  .sc-grid-3,
  .sc-strip {
    grid-template-columns: 1fr;
  }

  .sc-filter-grid {
    grid-template-columns: 1fr;
  }

  .sc-body .modal .modal-dialog,
  .sc-body .modal .modal-dialog--wide {
    max-width: calc(100vw - 16px);
    margin: 8px auto;
  }
}

@media (max-width: 639px) {
  .sc-content {
    padding: 14px 12px;
  }

  .sc-rail {
    width: min(86vw, 300px);
  }

  /* The breadcrumb is the only thing in the top bar allowed to truncate. */
  .sc-crumbs {
    overflow: hidden;
  }

  .sc-crumbs > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Card headers hold a title plus one or two selects — let them wrap. */
  .sc-card-hd,
  .sc-card-ft,
  .sc-btn-row,
  .sc-sched-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .sc-card-hd .sc-select,
  .sc-hdr-actions .sc-select {
    flex: 1 1 140px;
    min-width: 140px;
  }

  .sc-tabs {
    scrollbar-width: none;
  }

  .sc-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* ── Worker activity: schedule adherence rows ───────────────────────────── */

.sc-sched-row {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-sched-row:last-child {
  border-bottom: none;
}

.sc-sched-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-sched-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sc-ink-1);
  text-decoration: none;
}

.sc-sched-name:hover {
  color: var(--sc-link);
}

.sc-sched-meta,
.sc-sched-nums {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--sc-ink-3);
}

.sc-sched-error {
  font-size: 11.5px;
  color: #b45309;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-num-ok {
  color: #047857;
  font-weight: 600;
}

.sc-num-warn {
  color: #b45309;
  font-weight: 600;
}

/* One tick per cron slot: a run of green with a red gap is a skipped schedule. */
.sc-slots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.sc-slot {
  width: 14px;
  height: 18px;
  border-radius: 3px;
  background: #e2e8f0;
  cursor: help;
}

.sc-slot--ok {
  background: #34d399;
}

.sc-slot--warn {
  background: #fbbf24;
}

.sc-slot--bad {
  background: #f87171;
}

.sc-slot--info {
  background: #bae6fd;
}

/* Fired on time but the run itself did not complete — outline instead of a new colour. */
.sc-slot.is-runfailed {
  box-shadow: inset 0 0 0 2px #b91c1c;
}

/* ── Publication report filter bar ──────────────────────────────────────── */

/*
 * One row of labelled controls above the report table. The date boxes are
 * built from selects rather than <input type="date"> because the grouping
 * decides how much of a date is even meaningful: a yearly report offers years
 * and nothing else, and a native date picker would insist on a day.
 */
.sc-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sc-divider);
}

.sc-filterbar .sc-label {
  white-space: nowrap;
}

.sc-filterbar .sc-select {
  width: auto;
  min-width: 92px;
}

.sc-parts {
  display: flex;
  gap: 6px;
}

/*
 * Sized so the whole bar — grouping, source, both range boxes and Apply — fits
 * one row beside the rail on a 1280 screen. Widths are explicit because a
 * <select> otherwise sizes itself to its longest option, and the source list
 * carries names like "DE · Handelsregister Bekanntmachungen".
 */
.sc-parts .sc-select {
  min-width: 0;
}

.sc-parts .sc-select[data-part="month"] {
  width: 84px;
}

.sc-parts .sc-select[data-part="day"] {
  width: 66px;
}

.sc-filterbar .sc-field--source .sc-select {
  width: 190px;
  min-width: 0;
}

.sc-filterbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 700px) {
  .sc-filterbar {
    gap: 12px;
  }

  .sc-filterbar .sc-field,
  .sc-filterbar-actions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .sc-filterbar .sc-select,
  .sc-filterbar .sc-field--source .sc-select,
  .sc-parts {
    width: 100%;
  }

  /* Beats the fixed month/day widths above, so a range box fills the row. */
  .sc-parts .sc-select,
  .sc-parts .sc-select[data-part="month"],
  .sc-parts .sc-select[data-part="day"] {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}
