* {
  box-sizing: border-box;
}
strong,
b,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
}
small {
  font-weight: 400;
}
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  background: var(--canvas);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.summary-grid strong,
.summary-grid small,
.chart-y,
.chart-x,
.chart-tooltip,
.table-row {
  font-variant-numeric: tabular-nums;
}

button,
input {
  font: inherit;
}
button {
  color: inherit;
  border-radius: 8px;
  font-weight: 500;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.prototype-note {
  display: flex;
  justify-content: center;
  gap: 18px;
  height: 28px;
  align-items: center;
  color: var(--text-neutral-status);
  background: var(--surface-prototype);
  border-bottom: 1px solid var(--border-prototype);
  font-size: 12px;
}
.prototype-note strong {
  color: var(--text-chip);
}

.app-shell {
  display: grid;
  height: calc(100vh - 28px);
  grid-template: 64px minmax(0, 1fr) / var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 0.18s ease;
}

.topbar {
  position: relative;
  z-index: 10;
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns:
    calc(var(--sidebar-width) - 22px) 250px minmax(320px, 650px)
    1fr;
  gap: 16px;
  align-items: center;
  height: 64px;
  padding: 0 22px 0 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.topbar::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sidebar-width) - 1px);
  width: 1px;
  background: var(--border);
  content: "";
}

.account-control {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  height: 64px;
  padding-right: 12px;
}
.brand-home {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 40px;
  border-radius: 8px;
  place-items: center;
}
.account-switcher {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px 0 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.account-switcher strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-switcher .selector-chevrons {
  margin-left: auto;
}
.brand-mark {
  position: relative;
  display: grid;
  width: 39px;
  height: 40px;
  place-items: center;
}
.brand-mark img {
  display: block;
  width: auto;
  height: 22px;
  max-width: none;
  object-fit: contain;
}

.scope,
.search,
.support-button,
.account-icon {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.scope {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  text-align: left;
}
.scope strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selector-chevrons {
  flex: 0 0 auto;
  width: 14px;
  height: 18px;
  fill: none;
  stroke: var(--text-faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
  transform: translateY(1px);
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}
.search span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.search kbd {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 2px 6px;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.support-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.support-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}
.account-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.account-icon {
  display: grid;
  width: 41px;
  height: 38px;
  padding: 0 12px;
  place-items: center;
  color: var(--text-soft);
  border-radius: 8px;
  font-weight: 500;
}
.support-button:hover,
.account-icon:hover,
.account-switcher:hover,
.scope:hover {
  background: var(--surface-hover);
}
.account-menu-wrap {
  position: relative;
}
.account-icon[aria-expanded="true"] {
  color: var(--text);
  background: var(--surface-hover);
}
.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 228px;
  padding: 5px 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
}
.account-menu-email {
  overflow: hidden;
  margin: -5px 0 5px;
  padding: 10px 12px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu-group {
  padding: 0 5px 5px;
}
.account-menu-group > button,
.account-submenu > button,
.account-menu-logout {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.account-menu-group > button:hover,
.account-submenu > button:hover {
  background: var(--surface-hover);
}
.account-menu-group > button > svg,
.account-submenu-back > svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.account-menu-group > button[aria-expanded="true"] {
  background: var(--surface-active);
}
.account-submenu {
  position: absolute;
  right: calc(100% + 8px);
  width: 204px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
}
.account-submenu > button i {
  color: var(--text);
  font-size: 17px;
  font-style: normal;
  opacity: 0;
}
.account-submenu > button[aria-checked="true"] i {
  opacity: 1;
}
.account-submenu-back {
  display: none !important;
}
.account-menu-logout {
  margin-top: 0;
  padding-inline: 14px;
  color: var(--error);
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.account-menu-logout:hover {
  background: var(--error-bg);
}

.sidebar {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar-surface);
  border-right: 1px solid var(--border);
}
.sidebar nav {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
}
.nav-item.mobile-nav-more,
.mobile-nav-menu {
  display: none;
}
.nav-label {
  margin: 23px 11px 7px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 400;
}
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  margin: 2px 0;
  padding: 0 10px;
  color: var(--text-icon);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.nav-item svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}
.nav-item > span {
  color: #202124;
}
html[data-theme="dark"] .nav-item > span {
  color: var(--text);
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-item.is-active {
  color: var(--text-selection);
  background: var(--surface-selection);
  font-weight: 500;
}
.nav-item.is-active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -12px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  content: "";
}
.workspace {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 38px 42px 64px;
  background: var(--surface-muted);
  overflow: auto;
}
.sidebar-collapse {
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  padding: 0 16px;
  border-top: 1px solid var(--border);
}
.sidebar-collapse-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  place-items: center;
  cursor: pointer;
}
.sidebar-collapse-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.sidebar-collapse-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
  transition: transform 0.16s ease;
}
.app-shell.is-sidebar-collapsed .sidebar-collapse-button svg {
  transform: scaleX(-1);
}
.app-footer-links {
  display: flex;
  gap: 0;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.workspace-footer {
  width: auto;
  margin: auto -42px -64px;
  padding-top: 56px;
}
.workspace-footer-bar {
  position: relative;
  display: flex;
  height: 48px;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--border);
}
.workspace-footer-bar > small {
  position: absolute;
  right: 42px;
  color: #858b94;
  font-size: 13px;
  font-weight: 400;
}
.footer-link-short {
  display: none;
}
.app-footer-links a,
.app-footer-links button {
  position: relative;
  min-height: 32px;
  padding: 0 24px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 32px;
  text-decoration: none;
  cursor: pointer;
}
.app-footer-links > * + *::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 14px;
  background: var(--border);
  transform: translateY(-50%);
  content: "";
}
.app-footer-links a:hover,
.app-footer-links button:hover {
  color: var(--accent-ink, var(--accent));
}
@media (min-width: 761px) {
  .app-shell.is-sidebar-collapsed {
    --sidebar-width: 72px;
  }
  .app-shell.is-sidebar-collapsed .account-control {
    justify-content: flex-start;
    padding-left: 2px;
    padding-right: 0;
  }
  .app-shell.is-sidebar-collapsed .brand-home {
    width: 24px;
  }
  .app-shell.is-sidebar-collapsed .account-switcher,
  .app-shell.is-sidebar-collapsed .nav-label,
  .app-shell.is-sidebar-collapsed .nav-item > span {
    display: none;
  }
  .app-shell.is-sidebar-collapsed .sidebar nav {
    padding-inline: 12px;
  }
  .app-shell.is-sidebar-collapsed .nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }
  .app-shell.is-sidebar-collapsed .nav-item svg {
    width: 19px;
  }
  .app-shell.is-sidebar-collapsed .sidebar-collapse {
    justify-content: center;
    padding: 0;
  }
}
.screen {
  display: none;
  width: min(1380px, 100%);
  margin: 0 auto;
}
.screen.is-visible {
  display: block;
  animation: screen-in 0.18s ease-out;
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-end;
  margin-bottom: 48px;
}
.breadcrumb {
  margin: 0 0 11px;
  color: var(--text-faint);
  font-size: 12px;
}
.breadcrumb span {
  margin: 0 7px;
  color: #b1bac7;
}
.page-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}
.title-line {
  display: flex;
  gap: 13px;
  align-items: center;
}
.domain-state {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 9px;
  color: var(--text-status-success);
  background: var(--allow-bg);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.domain-state i {
  width: 6px;
  height: 6px;
  background: var(--allow);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 138, 104, 0.1);
}
.page-header > div:first-child > p:last-child,
.page-header .page-subtitle {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}
.page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
}
.freshness {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--text-soft);
  font-size: 12px;
}
.freshness i {
  width: 7px;
  height: 7px;
  background: var(--allow);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 138, 104, 0.12);
}

.primary-button,
.secondary-button,
.filter-button,
.columns-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.primary-button,
.secondary-button {
  font-weight: 500;
}
.filter-button,
.columns-button {
  font-weight: 400;
}
.primary-button {
  color: white;
  background: linear-gradient(180deg, #1680ff 0%, var(--accent) 100%);
  border: 1px solid var(--accent);
  box-shadow:
    0 1px 2px rgba(8, 103, 242, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.primary-button:hover {
  background: var(--accent-hover);
}
.secondary-button,
.filter-button,
.columns-button {
  color: var(--text-detail);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.secondary-button:hover,
.filter-button:hover,
.columns-button:hover {
  background: var(--surface-hover);
}

.toolbar {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  margin-bottom: 18px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(32, 33, 36, 0.04);
}
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-control);
  border-radius: 8px;
}
.segmented button {
  min-height: 32px;
  padding: 0 13px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.segmented button.is-selected {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(25, 39, 58, 0.12);
  font-weight: 400;
}
.toolbar-divider {
  width: 1px;
  height: 25px;
  margin: 0 3px;
  background: var(--border);
}
.filter-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}
.filter-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.filter-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 32px;
  padding: 0 6px 0 10px;
  color: var(--text-chip);
  background: var(--surface-active);
  border: 1px solid var(--border-chip);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
}
.filter-chip strong {
  color: var(--text-selection);
  font-weight: 400;
}
.filter-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--text-chip-remove);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.filter-chip button:hover {
  background: rgba(37, 99, 235, 0.1);
}
.clear-filters {
  margin-left: auto;
  padding: 0 10px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.filter-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 190px;
  width: min(680px, calc(100vw - 310px));
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
}
.popover-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 14px;
}
.popover-heading > div {
  display: grid;
  gap: 3px;
}
.popover-heading strong {
  font-size: 13px;
}
.popover-heading small {
  color: var(--text-faint);
  font-size: 12px;
}
.popover-heading > button,
.drawer-header > button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
}
.popover-heading > button:hover,
.drawer-header > button:hover {
  background: var(--surface-hover);
}
.filter-fields {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.35fr;
  gap: 8px;
}
.filter-fields label {
  display: grid;
  gap: 5px;
}
.filter-fields label > span,
.drawer-field > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 400;
}
.filter-fields label > button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.filter-fields b {
  color: var(--text-faint);
}
.popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(32, 33, 36, 0.035);
}
.screen[data-screen="events"] .summary-grid,
.screen[data-screen="events"] .chart-panel,
.screen[data-screen="events"] .table-panel {
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.summary-grid > :is(article, button) {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}
.summary-grid > :is(article, button):last-child {
  border-right: 0;
}
.summary-grid span {
  color: var(--text-soft);
  font-size: 12px;
}
.screen[data-screen="events"] .summary-grid span {
  min-height: 24px;
  font-weight: 500;
}
.summary-grid strong {
  font-size: 25px;
}
.summary-grid small {
  color: var(--text-faint);
  font-size: 12px;
}
.summary-grid small b {
  margin-right: 3px;
}
.trend-up {
  color: var(--block);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(32, 33, 36, 0.04);
}
.chart-panel {
  margin-bottom: 18px;
  padding: 20px 20px 14px;
  background: var(--surface);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.panel-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.panel-heading p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}
.chart-legend {
  display: flex;
  gap: 5px;
}
.chart-legend button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.chart-legend button:hover {
  background: var(--surface-hover);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot.block {
  background: var(--block);
}
.dot.challenge {
  background: #c78516;
}
.dot.error {
  background: #7e8793;
}
.chart-wrap {
  position: relative;
  display: grid;
  grid-template: 230px 25px / 34px minmax(0, 1fr);
  margin-top: 13px;
}
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 210px;
  padding: 0 7px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  text-align: right;
}
.line-chart {
  width: 100%;
  height: 230px;
  overflow: visible;
}
.grid-lines path {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}
.line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}
.chart-x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 12px;
}
.chart-tooltip {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 61%;
  display: grid;
  gap: 7px;
  width: 205px;
  padding: 12px;
  color: #eef3f8;
  background: #172230;
  border-radius: 8px;
  box-shadow: var(--shadow-popover);
  font-size: 12px;
  transform: translateX(-50%);
}
.chart-tooltip::after {
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #172230;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}
.chart-tooltip > span {
  color: #9fabb9;
}
.chart-tooltip strong {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 7px;
  align-items: center;
  font-weight: 600;
}
.chart-tooltip b {
  color: white;
}
.events-chart-panel .chart-tooltip {
  width: 235px;
  pointer-events: none;
}
.events-chart-panel rect:focus-visible {
  outline: 1px solid var(--accent);
  fill: #0867f208;
}

.table-panel {
  overflow: hidden;
  background: var(--surface);
}
.table-heading {
  padding: 17px 20px;
}
.columns-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.event-table {
  position: relative;
  z-index: 1;
  display: grid;
  margin: -1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.table-row {
  display: grid;
  grid-template-columns:
    105px 165px minmax(280px, 1.45fr) minmax(190px, 1fr)
    65px 20px;
  gap: 14px;
  align-items: center;
  min-height: 60px;
  padding: 0 18px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
button.table-row {
  border-radius: 0;
  cursor: pointer;
}
button.table-row:hover {
  background: var(--surface-hover);
}
.table-header {
  min-height: 38px;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 600;
}
.table-row:last-child {
  border-bottom: 0;
}
.table-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.table-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-row small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.request strong {
  display: flex;
  gap: 8px;
}
.request em {
  width: 34px;
  color: var(--text-request-method);
  font-size: 13px;
  font-style: normal;
}
.action-badge {
  display: inline-flex;
  justify-self: start;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.action-block {
  color: var(--block);
  background: var(--block-bg);
  border-color: transparent;
}
.action-challenge {
  color: var(--challenge);
  background: var(--challenge-bg);
  border-color: transparent;
}
.action-allow {
  color: var(--allow);
  background: var(--allow-bg);
  border-color: transparent;
}
.action-rate {
  color: var(--rate);
  background: var(--rate-bg);
  border-color: transparent;
}
.action-error {
  color: var(--error);
  background: var(--error-bg);
  border-color: transparent;
}
.action-disabled {
  color: var(--text-soft);
  background: var(--surface-subtle);
  border-color: transparent;
}
.http-error {
  color: var(--error);
}
.row-arrow {
  color: #a6b0bd;
  font-size: 22px;
}

.bots-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}
.bots-toolbar > small {
  padding-right: 7px;
  color: var(--text-faint);
  font-size: 12px;
}
.actor-summary-panel {
  margin-bottom: 18px;
  overflow: hidden;
  padding: 0;
}
.actor-summary-body {
  position: relative;
  z-index: 1;
  margin: -1px -1px 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.actor-total {
  font-size: 14px;
  font-weight: 500;
}
.actor-distribution {
  display: flex;
  height: 9px;
  margin-top: 19px;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: 999px;
}
.actor-distribution i {
  display: block;
  min-width: 3px;
  border-right: 2px solid white;
}
.actor-distribution i:last-child {
  border-right: 0;
}
.is-search {
  background: #2874c6;
}
.is-ai {
  background: #7656bf;
}
.is-automation {
  background: #c47a18;
}
.is-unclassified {
  background: #b7bec8;
}
.actor-class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 15px -8px 0;
}
.actor-class-grid button {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.actor-class-grid button:hover,
.actor-class-grid button.is-selected {
  background: var(--surface-hover);
}
.actor-class-grid button.is-selected {
  box-shadow: inset 0 0 0 1px var(--border);
}
.actor-class-grid span {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.3;
}
.actor-class-grid strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.actor-class-grid small {
  color: var(--text-faint);
  font-size: 12px;
}
.actor-key {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.actor-note {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  margin: 0;
  padding: 13px 20px;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 0;
  border-radius: 0;
}
.actor-note svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}
.actor-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}
.actor-note strong {
  color: var(--text);
}
.bots-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}
.actor-sources-panel,
.actor-method-panel {
  overflow: hidden;
}
.actor-sources-panel > .panel-heading,
.actor-method-panel > .panel-heading {
  min-height: 74px;
  padding: 16px 18px;
  background: var(--surface);
}
.actor-method-panel > .panel-heading {
  border-bottom: 1px solid var(--border);
}
.clear-actor-filter {
  padding: 7px 8px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.clear-actor-filter:hover {
  background: var(--surface-hover);
}
.actor-source-list {
  position: relative;
  z-index: 1;
  display: grid;
  margin: -1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.actor-source-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 55px;
  padding: 8px 18px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}
.actor-source-list button:nth-child(even) {
  background: var(--surface-muted);
}
.actor-source-list button:last-child {
  border-bottom: 0;
}
.actor-source-list button:hover {
  background: var(--surface-hover);
}
.actor-source-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.actor-source-list strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actor-source-list small {
  color: var(--text-faint);
  font-size: 12px;
}
.actor-source-list b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.actor-method-list {
  margin: 0;
}
.actor-method-list > div {
  padding: 17px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.actor-method-list > div:last-child {
  border-bottom: 0;
}
.actor-method-list dt {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.actor-method-list dd {
  margin: 0 0 0 16px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}
.actor-events-panel {
  overflow: hidden;
}
.actor-events-table {
  position: relative;
  z-index: 1;
  display: grid;
  margin: -1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.actor-event-row {
  display: grid;
  grid-template-columns:
    100px minmax(180px, 1.1fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr)
    145px 95px;
  gap: 13px;
  align-items: center;
  min-height: 60px;
  padding: 0 18px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  text-align: left;
}
button.actor-event-row {
  cursor: pointer;
}
button.actor-event-row:nth-child(odd) {
  background: var(--surface-muted);
}
button.actor-event-row:hover {
  background: var(--surface-hover);
}
.actor-event-row:last-child {
  border-bottom: 0;
}
button.actor-event-row:last-of-type {
  border-bottom: 0;
}
.actor-event-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--text-detail);
  font-size: 13px;
  font-weight: 400;
}
.actor-event-row strong,
.actor-event-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actor-event-row strong {
  color: var(--text);
  font-size: 13px;
}
.actor-event-row small {
  color: var(--text-faint);
  font-size: 12px;
}
.actor-event-row code {
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
}
.actor-event-header {
  min-height: 39px;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 600;
}
.actor-event-header > span {
  color: var(--text);
  font-weight: 600;
}
.actor-events-empty {
  margin: 0;
  padding: 28px 18px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.mode-title {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mode-title h2,
.mode-title h3 {
  margin: 0;
  font-size: 17px;
}
.status-off {
  padding: 3px 7px;
  color: var(--text-neutral-status);
  background: var(--surface-neutral-status);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.rules-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.firewall-toolbar {
  margin-bottom: 16px;
}
.firewall-tabs {
  flex: 0 0 auto;
}
.firewall-tabs button {
  min-height: 34px;
}
.rules-count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
}
.rules-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rules-table {
  position: relative;
  z-index: 1;
  margin: -1px -1px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rule-row {
  display: grid;
  grid-template-columns:
    24px minmax(180px, 0.85fr) minmax(330px, 1.55fr)
    145px 168px 72px 34px;
  gap: 13px;
  align-items: center;
  min-height: 60px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.rule-row:not(.rules-header):nth-child(even) {
  background: var(--surface);
}
.rule-row:not(.rules-header):nth-child(odd) {
  background: var(--surface-striped);
}
.rule-row:last-child {
  border-bottom: 0;
}
.rules-header {
  position: relative;
  z-index: 2;
  min-height: 39px;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
}
.rule-row > span {
  display: grid;
  gap: 4px;
}
.rule-row > span:nth-child(2) {
  grid-template-columns: 26px 1fr;
}
.rule-row > span:nth-child(2) strong,
.rule-row > span:nth-child(2) small {
  grid-column: 2;
}
.rule-row strong {
  font-size: 14px;
  font-weight: 600;
}
.rule-row small {
  color: var(--text-faint);
  font-size: 12px;
}
.table-heading-with-info {
  display: inline-flex !important;
  grid-auto-flow: column;
  gap: 6px !important;
  align-items: center;
  justify-content: start;
  width: max-content;
}
.context-info {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  border-radius: 5px;
  cursor: help;
  place-items: center;
}
.context-info:focus-visible {
  color: var(--text-soft);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.context-info > svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.context-info > [role="tooltip"] {
  position: absolute;
  z-index: 20;
  top: calc(100% + 9px);
  left: 50%;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-popover);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-3px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.context-info > [role="tooltip"]::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}
.context-info:hover > [role="tooltip"],
.context-info:focus-visible > [role="tooltip"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.rule-events {
  display: grid !important;
  grid-template-columns: 88px auto;
  gap: 9px !important;
  align-items: center;
  width: max-content;
}
.rule-sparkline {
  display: block;
  width: 88px;
  height: 28px;
  overflow: visible;
}
.rule-sparkline .area {
  fill: color-mix(in srgb, var(--accent) 10%, transparent);
  stroke: none;
}
.rule-sparkline .line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.rule-events.is-empty .rule-sparkline {
  opacity: 0.45;
}
.rule-events strong {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.order {
  grid-row: 1 / 3;
  align-self: center;
  color: #98a3b1;
  font-size: 12px;
  font-weight: 400;
}
.drag {
  color: #9ba6b5;
  font-size: 18px;
  cursor: grab;
}
.rule-row > .rule-description {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-detail);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rule-row.is-disabled {
  opacity: 0.58;
}
.switch {
  position: relative;
  width: 32px;
  height: 18px;
  padding: 0;
  background: #c5ccd6;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}
.switch.is-on {
  background: var(--accent);
}
.switch.is-on i {
  transform: translateX(14px);
}
.more {
  align-self: center;
  padding: 7px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.more:hover {
  background: var(--surface-hover);
}
.more[aria-expanded="true"] {
  color: var(--text);
  background: var(--surface-hover);
}
.rule-action-menu {
  position: fixed;
  z-index: 120;
  display: grid;
  width: 190px;
  padding: 6px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
}
.rule-action-menu[hidden] {
  display: none;
}
.rule-action-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.rule-action-menu button:hover,
.rule-action-menu button:focus-visible {
  background: var(--surface-hover);
  outline: 0;
}
.rule-action-menu button:disabled {
  color: var(--text-faint);
  background: transparent;
  cursor: default;
}
.rule-action-menu button.is-danger {
  color: var(--block);
}
.rule-action-menu svg {
  width: 17px;
  height: 17px;
  color: var(--text-icon);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}
.rule-action-menu button:disabled svg {
  color: var(--text-faint);
}
.rule-action-menu button.is-danger:not(:disabled) svg {
  color: color-mix(in srgb, var(--block) 72%, var(--text-faint));
}
.rule-action-menu hr {
  width: 100%;
  height: 1px;
  margin: 5px 0;
  background: var(--border);
  border: 0;
}
.info-strip {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 13px 14px 15px;
  color: var(--text-explanation);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
}
.rules-panel > .info-strip {
  border: 0;
  border-radius: 0;
}
.info-strip svg {
  width: 19px;
  fill: none;
  stroke: var(--text-soft);
  stroke-linecap: round;
  stroke-width: 1.6;
}
.info-strip p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}
.info-strip strong {
  margin-right: 5px;
  color: var(--text);
}
.info-strip button {
  color: var(--accent-ink, var(--accent));
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.ddos-intro {
  margin: 30px 0 20px;
}
.ddos-intro h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.15;
}
.ddos-intro p {
  max-width: 920px;
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}
.ddos-panel {
  overflow: hidden;
}
.ddos-panel-heading {
  padding: 16px 18px;
  background: var(--surface);
}
.ddos-panel-heading h3 {
  margin: 0;
  font-size: 17px;
}
.ddos-panel-heading p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 400;
}
.ddos-table {
  position: relative;
  z-index: 1;
  display: grid;
  margin: -1px -1px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ddos-row {
  display: grid;
  grid-template-columns: 180px minmax(420px, 1fr) 105px;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.ddos-row:nth-child(even) {
  background: var(--surface);
}
.ddos-row:nth-child(odd):not(.ddos-header) {
  background: var(--surface-striped);
}
.ddos-row:last-child {
  border-bottom: 0;
}
.ddos-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ddos-row strong {
  font-size: 14px;
  font-weight: 600;
}
.ddos-row small {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}
.ddos-header {
  min-height: 40px;
  padding-block: 0;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
}
.ddos-note {
  border: 0;
  border-radius: 0;
}

.under-attack-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
  padding: 18px 2px;
  border-bottom: 1px solid var(--border);
}
.under-attack-row p {
  max-width: 820px;
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.drawer-backdrop {
  position: fixed;
  z-index: 80;
  inset: 28px 0 0;
  background: rgba(15, 23, 35, 0.28);
  backdrop-filter: blur(1.5px);
}
.drawer {
  position: fixed;
  z-index: 90;
  top: 28px;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(570px, calc(100vw - 70px));
  height: calc(100vh - 28px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 55px rgba(15, 28, 47, 0.18);
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
}
.drawer.is-open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-header p {
  margin: 0 0 5px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 400;
}
.drawer-header h2 {
  margin: 0;
  font-size: 21px;
}
.drawer-body {
  padding: 20px 24px 32px;
  overflow-y: auto;
}
.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 24px;
  background: var(--surface-drawer-footer);
  border-top: 1px solid var(--border);
}
.decision-hero {
  padding: 17px 18px;
  background: var(--block-bg);
  border: 1px solid var(--danger-border, #f2ceca);
  border-radius: 10px;
}
.decision-hero > div {
  display: flex;
  gap: 9px;
  align-items: center;
}
.decision-hero > div > span {
  color: var(--text-soft);
  font:
    12px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.decision-hero h3 {
  margin: 13px 0 5px;
  font-size: 16px;
}
.decision-hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}
.decision-path {
  margin: 22px 0;
  padding: 0;
  list-style: none;
}
.decision-path li {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 11px;
  min-height: 58px;
}
.decision-path li:not(:last-child)::after {
  position: absolute;
  top: 27px;
  bottom: 1px;
  left: 13px;
  width: 1px;
  background: var(--border);
  content: "";
}
.decision-path i {
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}
.decision-path li.is-terminal i {
  color: var(--danger-icon-ink, white);
  background: var(--danger-icon-bg, var(--block));
  border-color: var(--block);
}
.decision-path li.is-skipped {
  opacity: 0.57;
}
.decision-path li > div {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 4px;
}
.decision-path strong {
  font-size: 12px;
}
.decision-path span {
  color: var(--text-faint);
  font-size: 12px;
}
.detail-section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.detail-section h3,
.builder-section h3 {
  margin: 0;
  font-size: 15px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 10px 0 0;
}
.detail-grid > div {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-detail);
}
.detail-grid dt {
  color: var(--text-faint);
  font-size: 12px;
}
.detail-grid dd {
  margin: 0;
  font-size: 13px;
}
.detail-grid code {
  font:
    12px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.copy-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.copy-icon-button {
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.copy-icon-button:hover {
  color: var(--text);
  background: var(--surface-muted);
}
.copy-icon-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 1px;
}
.copy-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}
.copy-icon-button.is-copied {
  color: var(--text-soft);
  background: transparent;
}
.technical-details {
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}
.technical-details summary {
  color: var(--text-technical-link);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.rule-drawer {
  width: min(650px, calc(100vw - 70px));
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3 3.5-3' fill='none' stroke='%23626d7b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E");
}
.drawer-field {
  display: grid;
  gap: 6px;
}
.drawer-field input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
}
.drawer-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.builder-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.builder-heading,
.action-section,
.placement-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}
.builder-section p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}
.builder-heading > button {
  color: var(--accent-ink, var(--accent));
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.condition-group {
  margin-top: 13px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.condition-groups {
  display: grid;
  gap: 10px;
}
.condition-groups > .condition-group + .condition-group::before {
  display: block;
  width: max-content;
  margin: -24px auto 10px;
  padding: 3px 8px;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  content: "OR";
  font-size: 11px;
}
.condition-row {
  display: grid;
  grid-template-columns:
    minmax(120px, 1fr) minmax(110px, 1fr) minmax(160px, 1.35fr)
    28px;
  gap: 8px;
  align-items: end;
}
.condition-control {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.condition-control > span {
  padding: 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1;
}
.condition-control select,
.condition-control > input,
.action-select,
.placement-controls select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  text-align: left;
  font-size: 13px;
}
.rule-drawer select {
  padding-right: 40px;
  background-color: var(--surface);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  appearance: none;
  -webkit-appearance: none;
}
.condition-control select:focus,
.condition-control > input:focus,
.action-select:focus,
.placement-controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.multi-picker {
  position: relative;
}
.multi-picker summary {
  display: flex;
  min-height: 38px;
  padding: 0 40px 0 10px;
  align-items: center;
  color: var(--text);
  background-color: var(--surface);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.multi-picker summary::-webkit-details-marker {
  display: none;
}
.multi-picker summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-picker[open] summary,
.multi-picker summary:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}
.multi-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  right: 0;
  left: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: max-content;
  min-width: 100%;
  max-width: min(300px, calc(100vw - 70px));
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 28, 47, 0.16);
}
.multi-menu label {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.multi-menu label:hover {
  background: var(--surface-hover);
}
.multi-menu input {
  margin: 0;
}
.remove-condition {
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}
.remove-condition:hover {
  background: var(--surface-hover);
}
.condition-join {
  position: relative;
  height: 24px;
  text-align: center;
}
.condition-join::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  content: "";
}
.condition-join span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 5px 8px;
  color: var(--text-faint);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 400;
}
.add-condition {
  margin-top: 10px;
  padding: 5px 0;
  color: var(--accent-ink, var(--accent));
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.action-select {
  min-width: 190px;
  cursor: pointer;
}
.action-parameters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.action-parameters:empty {
  display: none;
}
.placement-controls {
  display: grid;
  width: 250px;
  gap: 10px;
}
.placement-preview {
  grid-column: 1 / -1;
  display: grid;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.placement-preview div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.placement-preview div:last-child {
  border-bottom: 0;
}
.placement-preview div.is-new {
  color: var(--text-placement);
  background: var(--surface-info);
}
.placement-preview b {
  color: var(--text-faint);
  font-size: 11px;
}
.placement-preview em {
  color: var(--accent-ink, var(--accent));
  font-size: 11px;
  font-style: normal;
}
.placement-explanation {
  grid-column: 1 / -1;
  margin-top: -3px !important;
  color: var(--text-soft) !important;
}
.form-feedback {
  margin-top: 14px;
  padding: 10px 12px;
  color: var(--text-info);
  background: var(--surface-info);
  border-radius: 8px;
  font-size: 12px;
}
.form-feedback.is-error {
  color: var(--text-danger-feedback);
  background: var(--block-bg);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1240px) {
  :root {
    --sidebar-width: 258px;
  }
  body {
    min-width: 980px;
  }
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .topbar {
    grid-template-columns:
      calc(var(--sidebar-width) - 22px) 210px minmax(260px, 1fr)
      auto;
  }
  .workspace {
    padding-inline: 26px;
  }
  .workspace-footer {
    margin-inline: -26px;
  }
  .workspace-footer-bar > small {
    right: 26px;
  }
  .app-footer-links a,
  .app-footer-links button {
    padding-inline: 12px;
  }
  .footer-link-long {
    display: none;
  }
  .footer-link-short {
    display: inline;
  }
  .table-row {
    grid-template-columns:
      90px 150px minmax(230px, 1.4fr) minmax(160px, 1fr)
      50px 16px;
  }
  .rule-row {
    grid-template-columns:
      20px minmax(150px, 0.8fr) minmax(250px, 1.35fr)
      132px 148px 62px 28px;
    gap: 9px;
  }
  .ddos-row {
    grid-template-columns: 155px minmax(360px, 1fr) 95px;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    overflow-x: hidden;
    font-size: 13px;
  }
  .prototype-note {
    display: none;
  }
  .app-shell {
    display: block;
    height: auto;
  }
  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr auto;
    height: 58px;
    padding: 0 14px;
  }
  .topbar::before {
    display: none;
  }
  .account-control {
    height: 58px;
  }
  .account-switcher {
    gap: 8px;
    min-height: 36px;
    padding: 0 12px 0 8px;
  }
  .account-switcher strong {
    max-width: 190px;
    font-size: 13px;
  }
  .account-menu {
    position: fixed;
    top: 66px;
    right: 12px;
    width: min(264px, calc(100vw - 24px));
    max-height: calc(100dvh - 84px);
    overflow: auto;
  }
  .account-submenu {
    top: 0 !important;
    right: 0;
    left: 0;
    width: auto;
    min-height: 100%;
    border: 0;
    box-shadow: none;
  }
  .account-menu-group > button,
  .account-submenu > button,
  .account-menu-logout {
    min-height: 42px;
  }
  .account-submenu-back {
    display: flex !important;
    margin-bottom: 6px;
    color: var(--text-soft) !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
  }
  .brand-mark {
    width: 39px;
    height: 34px;
  }
  .brand-home {
    width: 44px;
    height: 36px;
  }
  .brand-mark img {
    width: auto;
    height: 22px;
  }
  .scope,
  .search,
  .support-button {
    display: none;
  }
  .sidebar {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    border-top: 0;
    border-right: 0;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .sidebar nav {
    display: grid;
    padding: 4px 8px;
    overflow: visible;
  }
  .sidebar .nav-label,
  .sidebar nav > [data-screen-link="bots"],
  .sidebar nav > [data-screen-link="modules"],
  .sidebar nav > [data-screen-link="connection"],
  .sidebar nav > [data-screen-link="tls"],
  .sidebar nav > [data-screen-link="notifications"] {
    display: none;
  }
  .nav-item {
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
    min-height: 50px;
    min-width: 0;
    margin: 0;
    padding: 4px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-item svg {
    width: 20px;
  }
  .sidebar nav > .nav-item > span {
    display: none;
  }
  .nav-item.mobile-nav-more {
    display: grid;
  }
  .mobile-nav-menu {
    position: fixed;
    z-index: 31;
    right: 10px;
    bottom: 68px;
    display: grid;
    width: min(252px, calc(100vw - 20px));
    padding: 6px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-popover);
  }
  .mobile-nav-menu[hidden] {
    display: none;
  }
  .mobile-nav-menu button {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-height: 42px;
    padding: 0 10px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-menu button:hover {
    background: var(--surface-hover);
  }
  .mobile-nav-menu button.is-active {
    color: var(--accent-ink, var(--accent));
    background: var(--surface-active);
  }
  .mobile-nav-menu svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--text-soft);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
  }
  .mobile-nav-menu button.is-active svg {
    stroke: currentColor;
  }
  .nav-item.is-active::before {
    top: auto;
    right: 14px;
    bottom: -5px;
    left: 14px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }
  .workspace {
    width: 100vw;
    max-width: 100vw;
    height: auto;
    padding: 22px 16px 82px;
    overflow: visible;
    overflow-x: hidden;
  }
  .screen {
    width: 100%;
    max-width: 100%;
  }
  .page-header {
    display: grid;
    gap: 15px;
    align-items: start;
    margin-bottom: 32px;
  }
  .page-header > div:first-child {
    min-width: 0;
  }
  .page-header > div:first-child > p:last-child {
    overflow-wrap: anywhere;
  }
  .page-header h1 {
    font-size: 30px;
  }
  .title-line {
    align-items: flex-start;
  }
  .page-actions {
    justify-content: space-between;
  }
  .toolbar {
    align-items: stretch;
    overflow-x: auto;
    border-width: 1px 0;
    border-radius: 0;
    box-shadow: none;
  }
  .filter-chip,
  .clear-filters,
  .toolbar-divider {
    display: none;
  }
  .filter-popover {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 66px;
    left: 0;
    width: 100%;
    border-radius: 14px 14px 0 0;
  }
  .filter-fields {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-grid article:nth-child(2) {
    border-right: 0;
  }
  .summary-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
  .chart-panel {
    overflow: hidden;
  }
  .chart-panel .panel-heading {
    display: grid;
    gap: 9px;
  }
  .chart-legend {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .chart-wrap {
    min-width: 0;
  }
  .table-heading {
    padding-inline: 0;
  }
  .table-header {
    display: none;
  }
  .table-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 8px 12px;
    min-height: 0;
    padding: 15px 2px;
  }
  .table-row > span:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .table-row > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .table-row > span:nth-child(3) {
    grid-column: 1 / 3;
    grid-row: 2;
  }
  .table-row > span:nth-child(4) {
    grid-column: 1 / 3;
    grid-row: 3;
  }
  .table-row > span:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }
  .table-row > span:nth-child(6) {
    grid-column: 3;
    grid-row: 1 / 4;
  }
  .under-attack-row {
    grid-template-columns: 1fr;
  }
  .under-attack-row .secondary-button {
    justify-self: start;
  }
  .firewall-toolbar {
    flex-wrap: wrap;
  }
  .actor-class-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bots-columns {
    grid-template-columns: 1fr;
  }
  .actor-event-header {
    display: none;
  }
  .actor-event-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    padding: 14px 16px;
  }
  .actor-event-row > span:nth-child(3),
  .actor-event-row > span:nth-child(4) {
    grid-column: 1;
  }
  .actor-event-row > span:nth-child(5),
  .actor-event-row > span:nth-child(6) {
    grid-column: 2;
    justify-self: end;
  }
  .firewall-tabs {
    width: 100%;
  }
  .workspace-footer,
  .sidebar-collapse {
    display: none;
  }
  .firewall-tabs button {
    flex: 1;
  }
  .ddos-intro {
    margin-top: 24px;
  }
  .ddos-header {
    display: none;
  }
  .ddos-row {
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    padding: 16px;
  }
  .ddos-row > span:nth-child(2) {
    grid-column: 1 / -1;
  }
  .ddos-row > span:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }
  .drawer,
  .rule-drawer {
    width: 100%;
  }
}

/* Mobile audit: shared readability, touch targets and overflow safeguards. */
@media (min-width: 761px) and (max-width: 980px) {
  :root {
    --sidebar-width: 220px;
  }
  body {
    min-width: 0;
  }
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .topbar {
    grid-template-columns:
      calc(var(--sidebar-width) - 12px) minmax(170px, 1fr)
      auto;
    gap: 10px;
    padding: 0 14px 0 12px;
  }
  .topbar .search {
    display: none;
  }
  .workspace {
    min-width: 0;
    padding-inline: 20px;
  }
  .screen {
    width: 100%;
    max-width: 100%;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .screen[data-screen="bots"] .actor-event-header {
    display: none;
  }
  .screen[data-screen="bots"] .actor-event-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    overflow: hidden;
  }
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(3),
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(4) {
    grid-column: 1;
  }
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(5),
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(6) {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  html:not([data-theme="dark"]) {
    --text-faint: #667085;
  }
  .workspace {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .sidebar {
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .primary-button,
  .secondary-button,
  .filter-button,
  .columns-button {
    min-height: 44px;
  }
  .protection-card footer button {
    min-height: 44px;
    padding-block: 8px;
  }

  .rules-table {
    margin-inline: -1px;
    overflow: visible;
  }
  .rule-row.rules-header {
    display: none;
  }
  .rule-row:not(.rules-header) {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: auto auto;
    gap: 8px 6px;
    min-height: 0;
    padding: 12px;
  }
  .rule-row:not(.rules-header) > .drag,
  .rule-row:not(.rules-header) > .rule-description {
    display: none;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rule-row:not(.rules-header) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
  .rule-row:not(.rules-header) > .rule-events {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: end;
    width: auto;
  }
  .rule-row:not(.rules-header) .rule-sparkline {
    display: none;
  }
  .rule-row:not(.rules-header) > span:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
  }
  .rule-row:not(.rules-header) > .more {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 44px;
    height: 44px;
  }
  .screen[data-screen="bots"] .actor-event-header {
    display: none;
  }
  .screen[data-screen="bots"] .actor-event-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    min-width: 0;
    padding: 14px 16px;
  }
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(3),
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(4) {
    grid-column: 1;
  }
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(5),
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(6) {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 980px) {
  .bots-toolbar .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .bots-toolbar .segmented button {
    min-height: 44px;
    padding-inline: 6px;
  }
}

/* Dense first-layer rows for mobile analytics and firewall lists. */
@media (max-width: 980px) {
  .screen[data-screen="bots"] .actor-events-panel .table-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: start;
    padding: 14px 16px;
  }

  .screen[data-screen="bots"] .actor-events-panel .table-heading h2 {
    font-size: 18px;
    line-height: 1.3;
  }

  .screen[data-screen="bots"] .actor-events-panel .table-heading p {
    grid-column: 1;
    font-size: 12px;
    line-height: 1.4;
  }

  .screen[data-screen="bots"]
    .actor-events-panel
    .table-heading
    .columns-button {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    min-height: 44px;
    white-space: nowrap;
  }

  .screen[data-screen="bots"] .actor-event-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 3px 10px;
    min-height: 64px;
    padding: 10px 14px;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(1) strong,
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(2) strong {
    font-size: 14px;
    line-height: 1.35;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(1) small,
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(2) small,
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(4),
  .screen[data-screen="bots"] .actor-event-row > span:nth-child(6) {
    display: none;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .screen[data-screen="bots"] .actor-event-row > span:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }

  .rule-row:not(.rules-header) {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: auto auto;
  }

  .rule-row:not(.rules-header) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
  }

  .rule-row:not(.rules-header) > span:nth-child(2) small {
    display: none;
  }

  .rule-row:not(.rules-header) > .rule-events {
    display: none !important;
  }

  .rule-row:not(.rules-header) > span:nth-child(6) {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .rule-row:not(.rules-header) > .more {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }
}

@media (max-width: 360px) {
  .screen[data-screen="bots"] .actor-events-panel .table-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .screen[data-screen="bots"]
    .actor-events-panel
    .table-heading
    .columns-button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

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

/* Approved module cards and module detail drawer. */
.cards-screen .page-header {
  margin-bottom: 32px;
}
.protection-context {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 32px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--border);
}
.protection-context-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  background: #eef4ff;
  color: var(--accent-ink, var(--accent));
  border-radius: 10px;
}
.protection-context svg,
.protection-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.protection-context strong {
  font-size: 14px;
}
.protection-context p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 5px 0 0;
}
.protection-period {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--text-soft);
}
.protection-section {
  margin: 0 0 28px;
}
.protection-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.protection-section-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}
.protection-section-heading h2 span {
  font-size: 13px;
  font-weight: 400;
  margin-left: 6px;
  color: var(--text-soft);
}
.protection-section-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}
.protection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.protection-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.protection-card:hover {
  border-color: #c3c8d0;
}
.protection-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
}
.protection-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  color: var(--text-off-icon);
  background: var(--surface-off);
  border-radius: 8px;
}
.protection-card-heading h3 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
}
.protection-card-heading > div > span {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 3px;
}
.protection-mode {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-observe);
  background: var(--surface-observe);
  border-radius: 6px;
  padding: 4px 7px;
}
.protection-mode.is-off {
  background: var(--surface-off);
  color: var(--text-soft);
}
.protection-purpose {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 14px 20px 12px;
  min-height: 42px;
}
.protection-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 20px 17px;
  font-size: 12px;
}
.protection-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9097a0;
  flex: none;
}
.protection-state.ready i {
  background: var(--allow);
}
.protection-state.linked i {
  background: #6e80a0;
}
.protection-state.quiet {
  color: var(--text-soft);
}
.protection-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 20px 19px;
}
.protection-metrics div + div {
  border-left: 1px solid var(--border);
  padding-left: 18px;
}
.protection-metrics dt {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.protection-metrics dd {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.protection-card[data-card="http"] .protection-metrics div + div dd,
.protection-card[data-card="consistency"] .protection-metrics dd {
  font-size: 14px;
  padding-top: 4px;
}
.protection-card footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding: 12px 20px;
  background: var(--surface-footer);
  min-height: 46px;
}
.protection-card footer > span {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-soft);
}
.protection-card footer button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--accent-ink, var(--accent));
  font-size: 12px;
  cursor: pointer;
  flex: none;
}
.protection-card footer button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.secondary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compact-card .protection-card-heading {
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 16px 0;
}
.compact-card .protection-card-heading h3 {
  font-size: 15px;
}
.compact-card .protection-card-heading > div > span {
  display: none;
}
.compact-card .protection-icon {
  width: 29px;
  height: 29px;
  background: none;
}
.compact-card .protection-mode {
  font-size: 10px;
}
.compact-card .protection-purpose {
  margin: 12px 16px;
  font-size: 12px;
  min-height: 39px;
}
.compact-card .protection-state {
  margin: 0 16px 15px;
  font-size: 11px;
}
.compact-card footer {
  padding: 10px 16px;
}
.compact-card footer > span {
  display: none;
}
.compact-card footer button {
  margin-left: auto;
}
.engine-explanation {
  display: flex;
  gap: 24px;
  align-items: baseline;
  padding-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
}
.engine-explanation strong {
  white-space: nowrap;
  color: var(--text);
}
.engine-explanation p {
  margin: 0;
  max-width: 750px;
}
.protection-drawer {
  width: min(580px, 100vw);
}
.protection-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--surface-subtle);
  cursor: pointer;
  font-size: 23px;
}
.protection-detail-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.protection-detail-tabs button {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  border-radius: 0;
  font-size: 14px;
}
.protection-detail-tabs button[aria-pressed="true"] {
  color: var(--accent-ink, var(--accent));
  border-bottom-color: var(--accent);
}
.protection-detail-description,
.protection-detail-section p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}
.protection-detail-state {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  font-size: 13px;
}
.protection-detail-state .protection-mode {
  margin: 0;
}
.protection-detail-section {
  padding: 19px 0;
  border-top: 1px solid var(--border);
}
.protection-detail-section h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
.protection-checks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.protection-checks li {
  font-size: 14px;
  line-height: 1.55;
  margin: 12px 0;
  padding-left: 20px;
  position: relative;
}
.protection-checks li:before {
  content: "·";
  position: absolute;
  left: 3px;
  color: var(--text-soft);
}
.protection-codes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.protection-codes code {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: var(--text-soft);
}
.protection-mode-options {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.protection-mode-options label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.protection-mode-options label:has(input:checked) {
  border-color: var(--selection-border, #9bbce9);
  background: var(--surface-selected-option);
}
.protection-mode-options label:has(input:disabled) {
  color: #858b94;
  cursor: default;
}
.protection-mode-options input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.protection-mode-options strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.protection-mode-options small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 5px;
  color: var(--text-soft);
}
.protection-mode-help {
  font-size: 12px !important;
}
.protection-save-note {
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface-note);
  border: 1px solid var(--border-note);
  border-radius: 8px;
  padding: 14px;
}
@media (min-width: 761px) and (max-width: 1050px) {
  body:has(.cards-screen.is-visible) {
    min-width: 0;
  }
  body:has(.cards-screen.is-visible) .topbar {
    grid-template-columns: 258px 1fr auto;
  }
  body:has(.cards-screen.is-visible) .search {
    display: none;
  }
  .protection-card-heading {
    flex-wrap: wrap;
  }
  .protection-mode {
    font-size: 10px;
  }
  .protection-period {
    display: none;
  }
  .protection-section-heading p {
    display: none;
  }
  .secondary-grid {
    grid-template-columns: 1fr;
  }
  .compact-card .protection-purpose {
    min-height: 0;
  }
}
.protection-drawer .primary-button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
@media (min-width: 761px) and (max-width: 950px) {
  .protection-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .rule-drawer {
    top: 0;
    height: 100dvh;
  }
  .rule-drawer .drawer-header,
  .rule-drawer .drawer-footer {
    padding-inline: 20px;
  }
  .rule-drawer .drawer-body {
    padding-inline: 20px;
  }
  .builder-heading,
  .action-section,
  .placement-section {
    grid-template-columns: 1fr;
  }
  .builder-heading > button {
    justify-self: start;
    padding: 2px 0;
  }
  .condition-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
  }
  .condition-row .condition-value {
    grid-column: 1 / 3;
  }
  .condition-row .remove-condition {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: end;
    min-height: 38px;
  }
  .action-control,
  .placement-controls {
    width: 100%;
  }
  .action-select {
    width: 100%;
  }
  .action-parameters {
    grid-template-columns: 1fr;
  }
  .placement-preview div {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .placement-preview em {
    grid-column: 2;
  }
  .cards-screen .page-header {
    margin-bottom: 24px;
  }
  .protection-context {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 20px;
  }
  .protection-context > div:nth-child(2) {
    flex: 1;
  }
  .protection-period {
    flex: 0 0 calc(100% - 50px);
    margin-left: 50px;
    margin-top: -2px;
  }
  .protection-section-heading {
    align-items: flex-start;
  }
  .protection-section-heading h2 {
    font-size: 16px;
  }
  .protection-section-heading p {
    display: none;
  }
  .protection-grid,
  .secondary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .protection-card-heading {
    padding: 17px 16px 0;
    gap: 9px;
    flex-wrap: wrap;
  }
  .protection-card-heading h3 {
    font-size: 15px;
  }
  .protection-mode {
    font-size: 10px;
  }
  .protection-purpose {
    margin-inline: 16px;
    min-height: 0;
  }
  .protection-state {
    margin-inline: 16px;
  }
  .protection-metrics {
    margin-inline: 16px;
  }
  .protection-card footer {
    padding-inline: 16px;
  }
  .protection-card footer > span {
    font-size: 12px;
  }
  .engine-explanation {
    display: block;
  }
  .engine-explanation p {
    margin-top: 6px;
  }
  .sidebar nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .sidebar [data-screen-link="modules"] {
    display: grid;
  }
  .protection-drawer {
    top: 0;
    height: 100dvh;
    width: 100vw;
  }
  .drawer-backdrop {
    top: 0;
  }
  .protection-drawer .drawer-body {
    padding-inline: 20px;
  }
  .protection-drawer .drawer-footer {
    padding-inline: 20px;
  }
  .protection-save-note {
    margin-bottom: 10px;
  }
}

/* Shared density for rule parameters and module sampling. */
.settings-help {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}
.module-sample {
  margin-top: 16px;
  max-width: 320px;
}
.module-sample[hidden] {
  display: none;
}
.module-sample small {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

/* Audit follow-up: analytics and rule controls stay compact through tablet widths. */
@media (max-width: 980px) {
  .bots-toolbar {
    display: grid;
    gap: 8px;
    overflow: visible;
  }
  .bots-toolbar > .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .bots-toolbar > .segmented button {
    min-height: 44px;
    padding-inline: 6px;
  }
  .bots-toolbar > small {
    display: none;
  }
  .actor-summary-body {
    padding: 16px;
  }
  .actor-summary-body .panel-heading {
    align-items: start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .actor-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .actor-class-grid button,
  .actor-source-list button {
    min-height: 44px;
  }
  .actor-events-panel .table-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
  }
  .actor-events-panel .table-heading .columns-button {
    min-height: 44px;
    white-space: nowrap;
  }
  .protection-mode {
    font-size: 12px;
  }
  .protection-card footer > span {
    font-size: 12px;
  }
  .protection-card footer button {
    min-height: 44px;
    padding-block: 8px;
  }
}

@media (max-width: 340px) {
  .actor-events-panel .table-heading {
    grid-template-columns: minmax(0, 1fr);
  }
  .actor-events-panel .table-heading .columns-button {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .rule-row:not(.rules-header) > span:nth-child(6) .switch {
    width: 44px;
    height: 44px;
    background: transparent;
  }
  .rule-row:not(.rules-header) > span:nth-child(6) .switch::before {
    position: absolute;
    top: 13px;
    left: 6px;
    width: 32px;
    height: 18px;
    background: #c5ccd6;
    border-radius: 999px;
    content: "";
  }
  .rule-row:not(.rules-header) > span:nth-child(6) .switch.is-on::before {
    background: var(--accent);
  }
  .rule-row:not(.rules-header) > span:nth-child(6) .switch i {
    top: 16px;
    left: 9px;
  }
  .rule-row:not(.rules-header) > span:nth-child(6) .switch.is-on {
    background: transparent;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .rules-table {
    margin-inline: -1px;
    overflow: visible;
  }
  .rule-row.rules-header {
    display: none;
  }
  .rule-row:not(.rules-header) {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: auto auto;
    gap: 8px 6px;
    min-height: 0;
    padding: 12px;
  }
  .rule-row:not(.rules-header) > .drag,
  .rule-row:not(.rules-header) > .rule-description {
    display: none;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rule-row:not(.rules-header) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
  .rule-row:not(.rules-header) > .rule-events {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: end;
    width: auto;
  }
  .rule-row:not(.rules-header) .rule-sparkline {
    display: none;
  }
  .rule-row:not(.rules-header) > span:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
  }
  .rule-row:not(.rules-header) > .more {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 44px;
    height: 44px;
  }
}

/* Keep the dense firewall hierarchy after the tablet fallback above. */
@media (max-width: 980px) {
  .rule-row:not(.rules-header) {
    gap: 2px 6px;
    min-height: 68px;
    padding: 8px 10px;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) {
    align-self: end;
  }
  .rule-row:not(.rules-header) > span:nth-child(2) small,
  .rule-row:not(.rules-header) > .rule-events {
    display: none !important;
  }
  .rule-row:not(.rules-header) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding-left: 26px;
  }
  .rule-row:not(.rules-header) > span:nth-child(6),
  .rule-row:not(.rules-header) > .more {
    grid-row: 1 / 3;
    align-self: center;
  }
  .rules-info-strip:not(.is-expanded) [data-rules-help-copy] {
    display: none;
  }
  .rules-info-strip p strong {
    display: block;
  }
  .protection-context {
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  .protection-context p,
  .protection-card .protection-purpose,
  .protection-card footer > span {
    display: none;
  }
  .protection-card footer {
    justify-content: flex-end;
  }
}
