/* =============================================================================
   SPAM NUKE — COMPONENT STYLES
   components.css — v2.0 — Tactical Operations Console
   Requires: theme.css (design tokens must be loaded first)
   ============================================================================= */


/* ---------------------------------------------------------------------------
   APP SHELL — Header
   --------------------------------------------------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-t)) var(--sp-2) 12px;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(6,8,12,0.95) 100%);
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Animated accent line under header */
.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--red-glow) 20%, var(--red) 50%, var(--red-glow) 80%, transparent 100%);
  background-size: 200% 100%;
  animation: header-sweep 8s ease-in-out infinite;
  opacity: 0.6;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 16px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* Corner bracket accents on logo */
.logo-icon::before,
.logo-icon::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: rgba(255,255,255,0.3);
  border-style: solid;
}
.logo-icon::before {
  top: 2px;
  left: 2px;
  border-width: 1px 0 0 1px;
}
.logo-icon::after {
  bottom: 2px;
  right: 2px;
  border-width: 0 1px 1px 0;
}

.logo-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.status-pill.online {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-glow);
}

.status-pill.offline {
  color: var(--muted);
  background: var(--muted-dim);
  border: 1px solid var(--muted-glow);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill.online .status-dot {
  background: var(--green);
  animation: pulse 2s infinite;
  box-shadow: 0 0 4px var(--green);
}

.status-pill.offline .status-dot {
  background: var(--muted);
}


/* ---------------------------------------------------------------------------
   APP SHELL — Main scroll area
   --------------------------------------------------------------------------- */

.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  position: relative;
  z-index: 10;
  scroll-behavior: smooth;
}


/* ---------------------------------------------------------------------------
   APP SHELL — Bottom nav
   --------------------------------------------------------------------------- */

.bottom-nav {
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0 0 16px 0;
  min-height: var(--nav-base-h);
  height: auto;
  position: relative;
  z-index: 60;
  flex-shrink: 0;
}

.bnav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
  position: relative;
}

.bnav:active { opacity: 0.6; }

.bnav svg {
  width: 20px;
  height: 20px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  transition: all 0.2s;
}

.bnav span {
  font-size: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.bnav.active svg  { stroke: var(--red); filter: drop-shadow(0 0 4px var(--red-glow)); }
.bnav.active span { color: var(--red); }

/* Active indicator dot */
.bnav.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--red);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0 8px var(--red-glow);
}


/* ---------------------------------------------------------------------------
   APP SHELL — Page containers
   --------------------------------------------------------------------------- */

.page { display: none; padding: var(--sp-2); min-height: 100%; }
.page.active { display: block; }


/* ---------------------------------------------------------------------------
   CARDS & SECTIONS
   --------------------------------------------------------------------------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-2); }

/* HUD-style corner brackets for important cards */
.card-hud {
  position: relative;
}
.card-hud::before,
.card-hud::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.35;
  pointer-events: none;
}
.card-hud::before {
  top: 4px;
  left: 4px;
  border-top: 1px solid var(--red);
  border-left: 1px solid var(--red);
}
.card-hud::after {
  bottom: 4px;
  right: 4px;
  border-bottom: 1px solid var(--red);
  border-right: 1px solid var(--red);
}

.card-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
}

.sec-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.2px;
  margin-bottom: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
}


/* ---------------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.96); }

/* Subtle sweep effect on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}
.btn:hover::after { transform: translateX(100%); }

/* Red / danger */
.btn-red {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red-dim);
}
.btn-red:hover { box-shadow: 0 0 20px var(--red-glow); }
.btn-red:disabled {
  background: var(--border);
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
}

/* Outline / secondary */
.btn-outline {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-2);
}
.btn-outline:hover {
  border-color: var(--text-3);
  background: rgba(255,255,255,0.02);
}

/* Green / confirm */
.btn-green {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green-dim);
}
.btn-green:hover { box-shadow: 0 0 20px var(--green-glow); }

/* Cyan / info */
.btn-cyan {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-dim);
}

/* Primary */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 20px;
  cursor: pointer;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text); }

/* Size modifier */
.btn-sm { padding: 7px 14px; font-size: 11px; }

/* Full-width modifier */
.btn-block { width: 100%; }

/* The signature nuke button */
.btn-nuke {
  background: linear-gradient(180deg, var(--red-hot) 0%, var(--red) 100%);
  color: #fff;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--red);
  box-shadow: 0 0 24px var(--red-glow), 0 0 60px rgba(255,45,45,0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: nuke-pulse 3s ease-in-out infinite;
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
}

.btn-nuke:active {
  transform: scale(0.97);
  box-shadow: 0 0 40px var(--red-glow);
}

/* Corner accents on nuke button */
.btn-nuke::before,
.btn-nuke::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(255,255,255,0.25);
  border-style: solid;
  animation: bracket-flash 3s ease-in-out infinite;
}
.btn-nuke::before { top: 4px; left: 4px; border-width: 1px 0 0 1px; }
.btn-nuke::after  { bottom: 4px; right: 4px; border-width: 0 1px 1px 0; }


/* ---------------------------------------------------------------------------
   BADGES
   --------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: var(--font-head);
}

.badge-del     { background: var(--red-dim);   color: var(--red);   border: 1px solid var(--red-glow); }
.badge-safe    { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-glow); }
.badge-promo   { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-glow); }
.badge-news    { background: var(--muted-dim); color: var(--muted); border: 1px solid var(--muted-glow); }
.badge-pending { background: rgba(255, 255, 255, 0.03); color: var(--text-3); border: 1px solid var(--border); }
.badge-smart   { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-glow); }


/* ---------------------------------------------------------------------------
   FORM CONTROLS — Toggle rows
   --------------------------------------------------------------------------- */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--text-2);
}

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

.toggle-label { font-size: 12px; color: var(--text-2); }
.toggle-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.toggle.on { background: var(--green-glow); border: 1px solid var(--green); }

.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  top: 3px;
  left: 3px;
  transition: all 0.2s;
}

.toggle.on::after { left: 21px; background: var(--green); }


/* ---------------------------------------------------------------------------
   FORM CONTROLS — Inputs & selects
   --------------------------------------------------------------------------- */

.num-input {
  width: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  text-align: center;
  outline: none;
}

.num-input:focus { border-color: var(--red); }

select.styled-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

select.styled-select:focus { border-color: var(--cyan); }

.text-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-dim), inset 0 0 0 1px var(--cyan-dim);
}

.text-input::placeholder { color: var(--text-3); }

.rule-textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 11px;
  outline: none;
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}

.rule-textarea:focus {
  border-color: var(--cyan);
}


/* ---------------------------------------------------------------------------
   FILTER CHIPS
   --------------------------------------------------------------------------- */

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 12px;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover { border-color: var(--border-2); }

.chip.active {
  background: var(--red-dim);
  border-color: var(--red-glow);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-dim);
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  font-size: 9px;
  color: var(--text-3);
}

.chip.active .chip-count {
  background: var(--red-dim);
  color: var(--red);
}


/* ---------------------------------------------------------------------------
   DOMAIN CARDS
   --------------------------------------------------------------------------- */

.domain-card-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  animation: card-enter 0.3s ease-out both;
}

/* Stagger domain card entrance */
.domain-card-wrap:nth-child(1)  { animation-delay: 0.00s; }
.domain-card-wrap:nth-child(2)  { animation-delay: 0.03s; }
.domain-card-wrap:nth-child(3)  { animation-delay: 0.06s; }
.domain-card-wrap:nth-child(4)  { animation-delay: 0.09s; }
.domain-card-wrap:nth-child(5)  { animation-delay: 0.12s; }
.domain-card-wrap:nth-child(6)  { animation-delay: 0.15s; }
.domain-card-wrap:nth-child(7)  { animation-delay: 0.18s; }
.domain-card-wrap:nth-child(8)  { animation-delay: 0.21s; }
.domain-card-wrap:nth-child(9)  { animation-delay: 0.24s; }
.domain-card-wrap:nth-child(10) { animation-delay: 0.27s; }

/* Swipe-reveal action tray behind card */
.dc-tray {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.tray-btn {
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s;
}

.tray-btn:active { filter: brightness(1.3); }

.tray-btn svg { width: 18px; height: 18px; stroke-width: 2; fill: none; }

.tray-btn.act-smart {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.tray-btn.act-news  { background: var(--muted-dim); color: var(--muted); }
.tray-btn.act-promo { background: var(--amber-dim); color: var(--amber); }
.tray-btn.act-inbox { background: var(--green-dim); color: var(--green); }
.tray-btn.act-del   {
  background: var(--red-dim);
  color: var(--red);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.tray-btn.act-qwen  {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

/* Inbox SELECT/CANCEL toggle — active state uses cyan to signal mode */
.select-toggle.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

.domain-card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, background 0.15s;
  z-index: 2;
  touch-action: pan-y;
}

.domain-card:active { background: var(--surface-2); }

.domain-card-wrap.selected {
  outline: 1px solid var(--green-glow);
  outline-offset: -1px;
}

/* Spam-level indicator bar */
.dc-indicator {
  width: 4px;
  border-radius: 2px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 32px;
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.3s;
}

/* Widen tap target to 44px */
.dc-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -20px;
  width: 44px;
}

.dc-indicator.high {
  background: var(--red);
  animation: threat-pulse 2s ease-in-out infinite;
}
.dc-indicator.med  { background: var(--amber); }
.dc-indicator.low  { background: var(--green); }

.dc-info { flex: 1; min-width: 0; }

.dc-domain {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}

.dc-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.dc-chevron { color: var(--text-3); font-size: 16px; }


/* ---------------------------------------------------------------------------
   MODAL / BOTTOM SHEET
   --------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background: var(--surface-2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border-2);
  border-bottom: none;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 20px calc(20px + var(--nav-offset));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.modal-section { margin-top: 16px; }
.modal-section-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.modal-done {
  margin-top: 16px;
  width: 100%;
}

.sample-list {
  list-style: none;
  padding: 0;
}
.sample-list li {
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}
.sample-list li:last-child { border-bottom: none; }


/* ---------------------------------------------------------------------------
   TOAST
   --------------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toolbar-up { bottom: calc(140px + var(--safe-b)); }


/* ---------------------------------------------------------------------------
   PROGRESS BAR
   --------------------------------------------------------------------------- */

.prog-wrap { margin-bottom: 12px; }

.prog-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prog-label span { font-size: 11px; }

.prog-title {
  color: var(--red);
  letter-spacing: 1.5px;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
}

.prog-count {
  color: var(--muted);
  font-family: var(--font-body);
}

.prog-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.prog-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.3s;
}

.prog-fill.active {
  box-shadow: 0 0 8px var(--red-glow);
  background: linear-gradient(90deg, var(--red), var(--red-hot));
}

/* Sweeping glow effect on active progress */
.prog-fill.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 68, 68, 0.6), transparent);
  animation: prog-glow 1.5s ease-in-out infinite;
}

@keyframes prog-glow {
  0%   { left: -40px; }
  100% { left: 100%; }
}


/* ---------------------------------------------------------------------------
   LOG PANE
   --------------------------------------------------------------------------- */

.log-pane {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.9;
  -webkit-overflow-scrolling: touch;
}

.log-line { white-space: pre-wrap; word-break: break-all; }
.log-line.info { color: var(--text-3); }
.log-line.move { color: var(--green); }
.log-line.dry  { color: var(--amber); }
.log-line.err  { color: var(--red); }
.log-line.head { color: var(--text); font-weight: 500; }


/* ---------------------------------------------------------------------------
   BATCH TOOLBAR
   --------------------------------------------------------------------------- */

.batch-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--nav-offset);
  z-index: 21;
  background: var(--surface-2);
  border-top: 1px solid var(--green-glow);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  touch-action: none;
  animation: slide-up 0.2s ease-out;
}

.batch-count {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-head);
  color: var(--green);
  white-space: nowrap;
  min-width: 68px;
  letter-spacing: 0.5px;
}

.batch-actions { display: flex; gap: 4px; flex: 1; }

.batch-actions .tray-btn {
  width: 44px;
  border-radius: var(--radius-md);
  padding: 6px 0;
}

.batch-meta { display: flex; gap: 4px; }


/* ---------------------------------------------------------------------------
   STICKY SAVE BAR
   --------------------------------------------------------------------------- */

.sticky-save {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-2);
  border-top: 1px solid var(--green-glow);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}

.sticky-save-count {
  font-size: 12px;
  color: var(--green);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.5px;
}


/* ---------------------------------------------------------------------------
   ACCORDION
   --------------------------------------------------------------------------- */

.accordion {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.accordion.open { border-color: var(--border-2); }

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.8px;
}

.accordion-header:active { background: var(--surface-2); }

.accordion-header .acc-right { display: flex; align-items: center; gap: 8px; }

.accordion-chevron {
  transition: transform 0.2s;
  font-size: 14px;
  color: var(--text-3);
}

.accordion.open .accordion-chevron { transform: rotate(180deg); }

.accordion-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.accordion.open .accordion-body { display: block; }


/* ---------------------------------------------------------------------------
   RULES LIST ROWS
   --------------------------------------------------------------------------- */

.rules-row {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.2s;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.8px;
}

.rules-row:active { background: var(--surface-2); }

/* ---------------------------------------------------------------------------
   RULES SUB-PAGE HEADER
   --------------------------------------------------------------------------- */

.rules-subpage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.rules-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 4px 8px 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.rules-back-btn:active { color: var(--text-2); }

.rules-subpage-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
}

/* ---------------------------------------------------------------------------
   CHIPS / PILLS (rules editor)
   --------------------------------------------------------------------------- */

.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }

.chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--font-body);
  animation: card-enter 0.2s ease-out both;
}

.chip-pill .pill-remove {
  width: 14px;
  height: 14px;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.1s;
  flex-shrink: 0;
}

.chip-pill .pill-remove:hover {
  background: var(--red-dim);
  color: var(--red);
}


/* ---------------------------------------------------------------------------
   INBOX HEALTH BAR
   --------------------------------------------------------------------------- */

.health-bar-wrap { margin-bottom: 14px; }

.health-bar {
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 0;
}

.health-segment {
  height: 100%;
  transition: flex 0.4s ease;
  cursor: pointer;
  border-radius: 0;
  position: relative;
}

.health-segment:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.health-segment:last-child  { border-radius: 0 var(--radius-full) var(--radius-full) 0; }

.health-segment.seg-del   { background: var(--red); }
.health-segment.seg-promo { background: var(--amber); }
.health-segment.seg-news  { background: var(--muted); }
.health-segment.seg-inbox { background: var(--green); }

.health-counts {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.health-count {
  font-size: 10px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.health-count-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ---------------------------------------------------------------------------
   PIPELINE OVERLAY
   --------------------------------------------------------------------------- */

.pipeline-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: all 0.3s ease;
}

.pipeline-overlay.open { pointer-events: all; }

.pipeline-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pipeline-overlay.open .pipeline-backdrop { opacity: 1; }

.pipeline-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 82vh;
  background: var(--surface-1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border-2);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.pipeline-overlay.open .pipeline-sheet { transform: translateY(0); }

/* Minimized — slide sheet down, peeking handle + header above bottom nav */
.pipeline-overlay.open.minimized {
  pointer-events: none;
}
.pipeline-overlay.minimized .pipeline-backdrop {
  opacity: 0;
  pointer-events: none;
}
.pipeline-overlay.minimized .pipeline-sheet {
  transform: translateY(calc(100% - 56px - var(--nav-offset)));
  pointer-events: all;
}

.pipeline-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  z-index: 2;
  cursor: grab;
}

.pipeline-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pipeline-header.running {
  background: var(--red);
  border-bottom-color: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.pipeline-header.clickable { cursor: pointer; }
.pipeline-header.running.clickable:active { background: #b91c1c; }

.pipeline-chevron,
.pipeline-header-x {
  width: 30px;
  flex-shrink: 0;
}

.pipeline-header-x {
  background: none;
  border: none;
  padding: 4px 6px;
  line-height: 1;
  color: currentColor;
  cursor: pointer;
  opacity: 0.85;
}

.pipeline-header-x:active {
  opacity: 1;
}

.pipeline-header-text {
  flex: 1;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: inherit;
}

.pipeline-chevron {
  background: none;
  border: none;
  padding: 4px 6px;
  line-height: 1;
  color: currentColor;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.pipeline-overlay.minimized .pipeline-chevron {
  transform: rotate(180deg);
}

.pipeline-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pipeline-footer {
  padding: 12px 16px calc(12px + var(--nav-offset));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Minimized status bar */
.pipeline-minbar {
  position: fixed;
  bottom: var(--nav-offset);
  left: 0;
  right: 0;
  height: 44px;
  background: var(--surface-2);
  border-top: 1px solid var(--red-glow);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  z-index: 30;
  cursor: pointer;
  animation: slide-up 0.2s ease-out;
}

.pipeline-minbar-label {
  flex: 1;
  font-size: 12px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--red);
  text-transform: uppercase;
}


/* ---------------------------------------------------------------------------
   ACTION GRID (in modals)
   --------------------------------------------------------------------------- */

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.action-opt {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.action-opt:active { transform: scale(0.97); }

.action-opt.active.sel-del,
.action-opt.sel-del   { border-color: var(--red);   color: var(--red);   background: var(--red-dim); }
.action-opt.active.sel-inbox,
.action-opt.sel-inbox { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.action-opt.active.sel-promo,
.action-opt.sel-promo { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.action-opt.active.sel-news,
.action-opt.sel-news  { border-color: var(--muted); color: var(--muted); background: var(--muted-dim); }
.action-opt.active.sel-smart,
.action-opt.sel-smart { border-color: var(--cyan);  color: var(--cyan);  background: var(--cyan-dim); grid-column: 1 / -1; }
.action-opt.sel-qwen  { border-color: var(--cyan);  color: var(--cyan);  background: transparent; }
.action-opt.sel-qwen:not(:disabled):hover { background: var(--cyan-dim); }
.action-opt.sel-qwen:disabled { opacity: 0.55; cursor: default; }


/* ---------------------------------------------------------------------------
   HISTORY / ACTIVITY
   --------------------------------------------------------------------------- */

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  animation: card-enter 0.3s ease-out both;
}

.activity-item:last-child { border-bottom: none; }

.activity-item:active {
  background: var(--surface-2);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.success { background: var(--green-dim); }
.activity-icon.success svg { stroke: var(--green); }
.activity-icon.dry  { background: var(--amber-dim); }
.activity-icon.dry svg { stroke: var(--amber); }
.activity-icon.error { background: var(--red-dim); }
.activity-icon.error svg { stroke: var(--red); }
.activity-icon.scan { background: var(--cyan-dim); }
.activity-icon.scan svg { stroke: var(--cyan); }

.activity-info { flex: 1; min-width: 0; }

.activity-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-head);
  letter-spacing: 0.3px;
}

.activity-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.activity-time {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
  font-family: var(--font-body);
}


/* ---------------------------------------------------------------------------
   LOGIN SCREEN
   --------------------------------------------------------------------------- */

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  overflow: hidden;
}

/* Animated grid background */
.login-screen::before {
  content: '';
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-scroll 4s linear infinite;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
}

/* Red glow spot behind card */
.login-screen::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--red-dim) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: glow-breathe 4s ease-in-out infinite;
  pointer-events: none;
}

.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: var(--sp-4);
  width: 100%;
  max-width: 360px;
  position: relative;
  z-index: 1;
  animation: card-enter 0.5s ease-out;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* Corner brackets on login card */
.login-card::before,
.login-card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--red-glow);
  border-style: solid;
  animation: bracket-flash 4s ease-in-out infinite;
}
.login-card::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}
.login-card::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--sp-3);
}

.login-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--red);
  text-shadow: 0 0 30px var(--red-glow);
}

.login-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-field { display: flex; flex-direction: column; gap: 6px; }

.login-label {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}


/* ---------------------------------------------------------------------------
   PULL-TO-REFRESH
   --------------------------------------------------------------------------- */

.ptr-wrap { position: relative; }

.ptr-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  transform: translateY(-100%);
  transition: opacity 0.2s;
  pointer-events: none;
}

.ptr-icon { color: var(--text-3); transition: transform 0.2s; }
.ptr-icon.pulling { color: var(--cyan); }
.ptr-icon.refreshing { animation: spin 0.8s linear infinite; color: var(--cyan); }


/* ---------------------------------------------------------------------------
   EMPTY STATES
   --------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--border-2);
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.6;
  font-family: var(--font-head);
  font-weight: 500;
}


/* ---------------------------------------------------------------------------
   CONNECTION BANNER
   --------------------------------------------------------------------------- */

.conn-banner {
  background: var(--red-dim);
  border: 1px solid var(--red-glow);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ---------------------------------------------------------------------------
   STAT CELL (dashboard)
   --------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-cell:hover { border-color: var(--border-2); }

/* Left accent line */
.stat-cell::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--stat-color, var(--text-3));
}

.stat-value {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  animation: count-up 0.4s ease-out both;
}

.stat-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}


/* ---------------------------------------------------------------------------
   QUICK ACTION BUTTONS (dashboard)
   --------------------------------------------------------------------------- */

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Slice 11: Scan button removed — single-column layout for Nuke-only */
.qa-grid.qa-grid-single {
  grid-template-columns: 1fr;
}

/* Slice 11: inline "Scanning…" pill pulsing dot */
@keyframes scan-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.qa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.qa-btn:active { transform: scale(0.97); }

.qa-btn.qa-scan {
  background: var(--surface-2);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-dim);
}

.qa-btn.qa-scan:hover { box-shadow: 0 0 20px var(--cyan-glow); }

.qa-btn.qa-nuke {
  background: linear-gradient(180deg, rgba(255,45,45,0.15) 0%, rgba(255,45,45,0.05) 100%);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 12px var(--red-dim);
}

.qa-btn.qa-nuke:hover { box-shadow: 0 0 24px var(--red-glow); }

.qa-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.qa-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  fill: none;
}


/* ─── Scheduler ─── */

/* Bottom sheet backdrop */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* Bottom sheet panel */
.sheet {
  width: 100%;
  max-height: 90dvh;
  background: var(--surface-1);
  border-top: 1px solid var(--border-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 20px calc(20px + var(--safe-b));
  overflow-y: auto;
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sheet header */
.sheet-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sheet-ttl {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
}

.sheet-x {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.sheet-x:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Field label */
.f-lbl {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: -6px;
}

/* Segmented control group */
.seg-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seg {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}

.seg:hover {
  border-color: var(--border-2);
  color: var(--text);
}

/* Cyan selected state (scan, cadence) */
.seg.sel-cy {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Red selected state (nuke) */
.seg.sel-rd {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
  box-shadow: 0 0 8px var(--red-glow);
}

/* Number / text input */
.num-input {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}

.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button {
  opacity: 0.3;
}

.num-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
}

/* Day-of-week chip row */
.day-row {
  display: flex;
  gap: 6px;
}

.day-chip {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.day-chip.on {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 6px var(--cyan-glow);
}

/* Primary cyan action button */
.btn-cyan {
  margin-top: 8px;
  padding: 12px;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: var(--bg);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 12px var(--cyan-glow);
}

.btn-cyan:hover {
  opacity: 0.9;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.btn-cyan:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Summary card on dashboard */
.sched-card {
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 14px 16px; position: relative; cursor: pointer; overflow: hidden;
  transition: all 0.2s;
}
.sched-card::before, .sched-card::after {
  content: ''; position: absolute; width: 10px; height: 10px; opacity: 0.5; pointer-events: none;
}
.sched-card::before { top: 4px; left: 4px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.sched-card::after { bottom: 4px; right: 4px; border-bottom: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }
.sched-card:hover { border-color: var(--cyan); box-shadow: 0 0 16px var(--cyan-dim); }
.sched-card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sched-card .lbl {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--cyan);
  display: flex; align-items: center; gap: 6px;
}
.sched-card .lbl svg { width: 12px; height: 12px; stroke: var(--cyan); stroke-width: 2; fill: none; }
.sched-card .count { font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: var(--text-3); text-transform: uppercase; }
.sched-card .hero { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0; }
.sched-card .hero-job { font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: 1.5px; color: var(--red); }
.sched-card .hero-job.scan { color: var(--cyan); }
.sched-card .hero-eta { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1; color: #fff; }
.sched-card .hero-eta .sm { font-size: 14px; color: var(--text-2); margin-left: 2px; }
.sched-card .tail { color: var(--text-3); font-size: 11px; font-family: var(--font-body); padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 2px; }

/* List row */
.sched-row {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 8px; transition: all 0.15s;
}
.sched-row:hover { border-color: var(--border-2); }
.sched-row.off { opacity: 0.6; }
.sched-row .left { flex: 1; min-width: 0; cursor: pointer; }
.sched-name { font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.8px; color: var(--text); }
.sched-tag {
  font-family: var(--font-head); font-weight: 700; font-size: 10px; letter-spacing: 1.5px;
  padding: 2px 6px; border-radius: 3px; margin-right: 8px; vertical-align: 1px;
}
.tag-scan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-glow); }
.tag-nuke { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-glow); }
.sched-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; font-family: var(--font-body); }
.sched-meta .next { color: var(--cyan); }

/* Slide-in page */
.schedules-overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 250;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.schedules-overlay.open { transform: translateX(0); }
.overlay-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.overlay-header .back {
  background: none; border: 0; cursor: pointer; color: var(--text-3);
  font-family: var(--font-head); font-size: 13px; letter-spacing: 0.5px;
  padding: 4px 8px 4px 0; display: flex; align-items: center; gap: 4px;
}
.overlay-header .title { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; flex: 1; }
.overlay-body { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: none; }
.overlay-body::-webkit-scrollbar { display: none; }
