@import url('/assets/bot-test-lab.css?v=6');

/* Shared colors, type, radii and control geometry live in proryv-ui.css. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .48; cursor: not-allowed; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--prv-blue-600) 18%, transparent); outline-offset: 2px; }

.bot-control-body {
  min-height: 100vh;
  color: var(--prv-gray-950);
  background: var(--prv-background);
  font-family: var(--prv-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bot-topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--prv-gray-200);
  background: var(--prv-white);
  backdrop-filter: blur(12px);
}

.bot-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--prv-gray-950);
  text-decoration: none;
}
.bot-brand img {
  width: 122px;
  height: auto;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}
.bot-brand span {
  min-width: 0;
  display: grid;
  line-height: 1.1;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.025em;
}
.bot-brand small {
  margin-bottom: 4px;
  color: var(--prv-gray-500);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.bot-topbar nav { display: flex; align-items: center; gap: 8px; }
.bot-topbar nav form { margin: 0; }
.bot-topbar button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--prv-gray-500);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.bot-topbar button:hover { color: var(--prv-blue-600); background: var(--prv-blue-100); }

.bot-shell {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

 /* Applied only to the actual Bot product surface, not Work/login/sales. */
.workspace-bot-active .workspace-shell {
  width: min(1280px, calc(100% - 48px));
  max-width: none;
  padding: var(--prv-space-5) 0 calc(96px + env(safe-area-inset-bottom));
}
.workspace-bot-active .workspace-panel[data-panel="monitor"] {
  min-width: 0;
}
.workspace-bot-active .workspace-panel[data-panel="monitor"] .bot-status {
  margin-top: 0;
}
@media (max-width: 760px) {
  .workspace-bot-active .workspace-shell {
    width: calc(100% - 24px);
    padding-top: var(--prv-space-3);
  }
}

.bot-status {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: var(--prv-space-4);
  padding: var(--prv-space-3) var(--prv-space-4);
  border: var(--prv-border);
  border-radius: var(--prv-radius-md);
  background: var(--prv-white);
  box-shadow: var(--prv-shadow-sm);
  color: var(--prv-gray-500);
  font-size: 13px;
}
.bot-status > div:first-child { min-width: 0; }
.bot-status strong {
  display: block;
  margin-bottom: 2px;
  color: var(--prv-gray-950);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.015em;
}
.bot-status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
}
.bot-status-actions > span { font-size: 12px; }

.secondary,
.bot-primary,
.bot-status button,
.rule-actions button,
.test-start {
  min-height: var(--prv-hit-area);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border-radius: var(--prv-radius-sm);
  font-size: var(--prv-type-control-size);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.secondary,
.bot-status button {
  border: 1px solid var(--prv-gray-300);
  color: var(--prv-gray-700);
  background: var(--prv-white);
}
.secondary:hover,
.bot-status button:hover { border-color: color-mix(in srgb, var(--prv-blue-600) 25%, var(--prv-white)); color: var(--prv-blue-600); background: var(--prv-blue-100); }
.bot-primary {
  border: 1px solid var(--prv-blue-600);
  color: var(--prv-white);
  background: var(--prv-blue-600);
}
.bot-primary:hover { background: var(--prv-blue-700); border-color: var(--prv-blue-700); }
.secondary:hover:not(:disabled),
.bot-primary:hover:not(:disabled),
.rule-actions button:hover:not(:disabled),
.test-start:hover:not(:disabled) { transform: translateY(-1px); }

 .monitor-layout {
  display: grid;
  grid-template-columns: minmax(218px, 240px) minmax(0, 1fr);
  gap: var(--prv-space-4);
  align-items: start;
}
.monitor-sidebar,
.monitor-panel { min-width: 0; }
 .monitor-sidebar {
  position: sticky;
  top: var(--prv-space-4);
  padding: var(--prv-space-4);
  border: var(--prv-border);
  border-radius: var(--prv-radius-md);
  background: var(--prv-white);
  box-shadow: var(--prv-shadow-sm);
}
.sidebar-heading { padding: 0 0 var(--prv-space-3); }
.sidebar-heading h1,
.profile-header h1,
.section-heading h2 { margin: 0; }
.sidebar-heading h1 {
  font-size: var(--prv-type-section-title-size);
  line-height: 1.2;
  letter-spacing: -.035em;
}
.sidebar-heading p:last-child,
.profile-header p,
.section-heading p {
  margin: 9px 0 0;
  color: var(--prv-gray-500);
  line-height: 1.5;
}
.sidebar-heading p:last-child { font-size: 13px; }

.section-kicker {
  margin: 0 0 8px !important;
  color: var(--prv-blue-600) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .13em !important;
  text-transform: uppercase;
}

.profile-list { display: grid; gap: var(--prv-space-1); max-height: min(56vh, 620px); overflow-y: auto; scrollbar-width: thin; }
.profile-card {
  width: 100%;
  min-height: 58px;
  padding: var(--prv-space-3);
  border: 1px solid transparent;
  border-radius: var(--prv-radius-sm);
  color: var(--prv-gray-950);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.profile-card:hover { background: var(--prv-background); }
.profile-card.active { color: var(--prv-blue-700); border-color: color-mix(in srgb, var(--prv-blue-600) 22%, var(--prv-white)); background: var(--prv-blue-100); }
.profile-card-title {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.015em;
}
.profile-card-meta {
  display: block;
  color: var(--prv-gray-500);
  font-size: 11px;
  line-height: 1.35;
}
.profile-card.active .profile-card-meta { color: var(--prv-blue-700); }

.monitor-panel { display: grid; gap: var(--prv-space-4); min-width: 0; }
 .profile-header {
  padding: var(--prv-space-5) var(--prv-space-6);
  border: var(--prv-border);
  border-radius: var(--prv-radius-md);
  background: var(--prv-white);
  box-shadow: var(--prv-shadow-sm);
}
.profile-header h1 {
  max-width: 900px;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.17;
  letter-spacing: -.035em;
}
.profile-header p {
  max-width: 760px;
  font-size: var(--prv-type-body-size);
}
.monitor-section {
  min-width: 0;
  padding: var(--prv-space-5) var(--prv-space-6);
  border: var(--prv-border);
  border-radius: var(--prv-radius-md);
  background: var(--prv-white);
  box-shadow: var(--prv-shadow-sm);
}
.monitor-section:last-child { border-bottom: var(--prv-border); }
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: var(--prv-space-4);
}
.section-heading > div { min-width: 0; }
.section-heading h2 {
  font-size: var(--prv-type-section-title-size);
  line-height: 1.2;
  letter-spacing: -.03em;
}
.section-heading p { max-width: 720px; font-size: var(--prv-type-body-size); }

.destination-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
}
.destination-row input,
.source-toolbar input,
.source-toolbar select,
.rule-row select,
.rule-row input,
.test-config-grid select,
.test-config-grid input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--prv-gray-300);
  border-radius: 10px;
  color: var(--prv-gray-950);
  background: var(--prv-white);
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.destination-row input,
.source-toolbar input,
.source-toolbar select,
.test-config-grid select,
.test-config-grid input { padding: 0 12px; }
.rule-row select,
.rule-row input { padding: 9px 10px; }
.destination-row input:focus,
.source-toolbar input:focus,
.source-toolbar select:focus,
.rule-row select:focus,
.rule-row input:focus,
.test-config-grid select:focus,
.test-config-grid input:focus {
  outline: 0;
  border-color: var(--prv-blue-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--prv-blue-600) 12%, transparent);
}

.source-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.source-toolbar input { flex: 1 1 360px; }
.source-toolbar select { min-width: 190px; }
.source-list {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  border: var(--prv-border);
  border-radius: var(--prv-radius-sm);
  scrollbar-width: thin;
}
.source-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: var(--prv-space-3) var(--prv-space-4);
  border-bottom: var(--prv-border);
  background: var(--prv-white);
}
.source-row:last-child { border-bottom: 0; }
.source-row:hover { background: var(--prv-background); }
.source-row:focus-within { background: var(--prv-blue-100); }
.source-row.unavailable { background: color-mix(in srgb, var(--prv-gray-100) 42%, var(--prv-white)); }
.source-main { min-width: 0; }
.source-title {
  margin-bottom: var(--prv-space-1);
  overflow: hidden;
  color: var(--prv-gray-950);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--prv-gray-500);
  font-size: 11px;
}
.source-error { margin-top: 7px; color: var(--prv-danger); font-size: 11px; }
.source-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--prv-gray-500);
  font-size: 11px;
  font-weight: 750;
}

.bot-badge {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--prv-radius-sm);
  color: var(--prv-gray-700);
  background: var(--prv-gray-100);
  font-size: 10px;
  font-weight: 800;
}
.bot-badge.ok { color: var(--prv-success); background: color-mix(in srgb, var(--prv-success) 10%, var(--prv-white)); }
.bot-badge.warn { color: var(--prv-warning); background: color-mix(in srgb, var(--prv-warning) 10%, var(--prv-white)); }
.bot-badge.new { color: var(--prv-blue-700); background: var(--prv-blue-100); }

.bot-switch {
  width: 46px;
  height: 26px;
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--prv-gray-300);
  cursor: pointer;
  transition: background .18s ease;
}
.bot-switch::before {
  content: "";
  width: 46px;
  height: 44px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.bot-switch::after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--prv-white);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--prv-gray-950) 20%, transparent);
  transition: transform .18s ease;
}
.bot-switch.on { background: var(--prv-blue-600); }
.bot-switch:focus-visible {
  outline: none;
  box-shadow: var(--prv-focus);
}
.bot-badge.ok, .bot-badge.warn, .bot-badge.new { font-weight: 700; }
.bot-switch.on::after { transform: translateX(20px); }

 .rules-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--prv-space-3);
}
.rule-box {
  min-width: 0;
  padding: var(--prv-space-4);
  border: var(--prv-border);
  border-radius: var(--prv-radius-md);
  background: var(--prv-white);
}
.rule-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.rule-box-head h3 {
  display: flex;
  align-items: center;
  gap: var(--prv-space-2);
  margin: 0 0 var(--prv-space-1);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.rule-grade-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--prv-danger);
}
.rule-box[data-grade="warm"] .rule-grade-dot,
.rule-box[data-test-grade="warm"] .rule-grade-dot {
  background: var(--prv-warning);
}

.rule-box-head p { margin: 0; color: var(--prv-gray-500); font-size: 12px; }
.rule-box-head > span {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--prv-gray-500);
  background: var(--prv-gray-100);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}
.rule-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}
.rule-row {
  display: grid;
  grid-template-columns: 94px minmax(180px, 1fr) minmax(120px, 180px) 36px;
  gap: 7px;
  margin-bottom: 7px;
}
.rule-row .remove {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: var(--prv-danger);
  background: color-mix(in srgb, var(--prv-danger) 8%, var(--prv-white));
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.rule-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.rule-actions .save { border: 1px solid var(--prv-blue-600); color: var(--prv-white); background: var(--prv-blue-600); }
.rule-actions .add { border: 1px solid transparent; color: var(--prv-blue-600); background: var(--prv-blue-100); }
.rule-actions .reset { border: 1px solid transparent; color: var(--prv-gray-700); background: var(--prv-gray-100); }

.bot-empty {
  padding: var(--prv-space-6);
  border: 1px dashed var(--prv-gray-300);
  border-radius: 16px;
  color: var(--prv-gray-500);
  background: var(--prv-white);
  text-align: center;
  font-size: 13px;
}
.bot-empty.compact { padding: var(--prv-space-6); }
.bot-toast {
  max-width: min(420px, calc(100vw - 32px));
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--prv-layer-modal);
  padding: 12px 15px;
  border-radius: 11px;
  color: var(--prv-white);
  background: var(--prv-gray-950);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--prv-gray-950) 20%, transparent);
  font-size: 13px;
  font-weight: 700;
}
.bot-toast.error { background: var(--prv-danger); }

.bot-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--prv-white);
}
.bot-login-card {
  width: min(430px, 100%);
  padding: 36px 0;
}
.bot-login-card img {
  width: 132px;
  max-width: 60%;
  height: auto;
  display: block;
  margin-bottom: 34px;
}
.bot-kicker {
  margin: 0 0 12px;
  color: var(--prv-blue-600);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bot-login-card h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.055em;
}
.bot-login-card > p {
  margin: 16px 0 0;
  color: var(--prv-gray-500);
  font-size: 15px;
  line-height: 1.55;
}
.bot-login-card form {
  display: grid;
  gap: 15px;
  margin-top: 30px;
}
.bot-login-card label {
  display: grid;
  gap: 7px;
  color: var(--prv-gray-700);
  font-size: 12px;
  font-weight: 800;
}
.bot-login-card input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--prv-gray-300);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--prv-gray-950);
  background: var(--prv-white);
  font-size: 14px;
}
.bot-login-card input:focus {
  outline: 0;
  border-color: var(--prv-blue-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--prv-blue-600) 12%, transparent);
}
.bot-login-card button {
  height: 48px;
  border: 0;
  border-radius: 10px;
  color: var(--prv-white);
  background: var(--prv-blue-600);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.bot-login-card button:hover { background: var(--prv-blue-700); }
.bot-login-error {
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--prv-danger);
  background: color-mix(in srgb, var(--prv-danger) 8%, var(--prv-white));
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .bot-shell { width: min(1180px, calc(100% - 48px)); }
  .monitor-layout { grid-template-columns: 212px minmax(0, 1fr); gap: var(--prv-space-3); }
  .monitor-sidebar { padding: var(--prv-space-3); }
  .rules-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .bot-topbar {
    height: 60px;
    padding: 0 16px;
  }
  .bot-brand { gap: 10px; }
  .bot-brand img { width: 104px; }
  .bot-brand span { font-size: 12px; }
  .bot-brand small { display: none; }
  .bot-topbar button { min-height: 44px; padding: 0 10px; font-size: 12px; }

  .bot-shell {
    width: min(100% - 28px, 680px);
    padding: 24px 0 56px;
  }
  .bot-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  .bot-status-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }
  .bot-status-actions button { width: 100%; }

  .monitor-layout { grid-template-columns: 1fr; gap: var(--prv-space-3); }
  .monitor-sidebar {
    position: static;
    padding: var(--prv-space-3);
    border: var(--prv-border);
  }
  .sidebar-heading { padding: 0 0 14px; }
  .sidebar-heading h1 { font-size: 18px; }
  .sidebar-heading p:last-child { max-width: 520px; }
  .profile-list {
    max-height: none;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0;
    padding: 0 0 var(--prv-space-1);
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .profile-card {
    min-width: 170px;
    min-height: 58px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--prv-gray-200);
    background: var(--prv-white);
  }
  .profile-card.active { border-color: color-mix(in srgb, var(--prv-blue-600) 35%, var(--prv-white)); }

  .profile-header { padding: var(--prv-space-4); }
  .profile-header h1 { font-size: clamp(22px, 6vw, 28px); }
  .profile-header p { margin-top: var(--prv-space-2); font-size: var(--prv-type-body-size); }
  .monitor-section { padding: var(--prv-space-4); }
  .section-heading { display: grid; gap: 12px; margin-bottom: 17px; }
  .section-heading h2 { font-size: 18px; }

  .destination-row { grid-template-columns: 1fr; }
  .destination-row > * { width: 100%; }
  .source-toolbar { display: grid; grid-template-columns: 1fr; }
  .source-toolbar input,
  .source-toolbar select { width: 100%; min-width: 0; }
  .source-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: var(--prv-space-3);
  }
  .source-title {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.3;
  }
  .source-toggle { align-self: center; }
  .source-toggle > span { display: none; }
  .source-meta { line-height: 1.4; }

  .rule-box { padding: 15px; }
  .rule-list { max-height: none; }
  .rule-row { grid-template-columns: 86px minmax(0, 1fr) 38px; }
  .rule-row .rule-label { grid-column: 1 / 3; }
  .rule-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .rule-actions .save { grid-column: 1 / -1; }
  .rule-actions button { width: 100%; }

  .bot-toast { right: var(--prv-space-3); bottom: calc(80px + env(safe-area-inset-bottom)); }
  .bot-login-shell { padding: 22px; }
  .bot-login-card { padding: 22px 0; }
  .bot-login-card img { width: 118px; margin-bottom: 30px; }
  .bot-login-card h1 { font-size: 42px; }
}

@media (max-width: 480px) {
  .bot-brand span { display: none; }
  .bot-shell { width: calc(100% - 24px); padding-top: var(--prv-space-3); }
  .profile-header h1 { font-size: 24px; }
  .section-heading h2 { font-size: 18px; }
  .profile-card { min-width: 156px; }

  .rule-row {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 7px;
  }
  .rule-row .rule-kind,
  .rule-row .rule-pattern,
  .rule-row .rule-label { grid-column: 1; }
  .rule-row .remove { grid-column: 2; grid-row: 1 / span 3; height: 100%; }
  .rule-actions { grid-template-columns: 1fr; }
  .rule-actions .save { grid-column: auto; }

  .source-meta span:not(.bot-badge) { font-size: 11px; }
  .bot-login-card h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}