:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #146c5f;
  --accent-dark: #0f5148;
  --block: #b42318;
  --allow: #147a44;
  --alert: #b54708;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

body.auth-page {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

.table-link {
  color: var(--accent);
  font-weight: 700;
}

.button-link {
  background: var(--accent);
  border-radius: 6px;
  color: #ffffff;
  display: inline-block;
  font-weight: 700;
  min-height: 34px;
  padding: 8px 11px;
  text-align: center;
}

.button-link:hover {
  background: var(--accent-dark);
}

.button-link.secondary-link {
  background: #eef2f6;
  color: #344054;
}

.button-link.secondary-link:hover {
  background: #d9dee7;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  min-height: 58px;
  padding: 0 28px;
}

.brand {
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.topbar nav a {
  border-radius: 6px;
  color: #344054;
  padding: 9px 11px;
}

.topbar nav a:hover {
  background: #eef6f4;
  color: var(--accent-dark);
}

.topbar nav a.admin-return {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.topbar nav a.admin-return:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.session-form {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.session-form span {
  color: var(--muted);
  font-size: 13px;
}

.session-form button {
  min-height: 32px;
  padding: 6px 10px;
}

.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 auto;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.auth-panel h1 {
  color: var(--accent);
}

.auth-error {
  background: #fff0ed;
  border: 1px solid #ffd0c8;
  border-radius: 6px;
  color: var(--block);
  font-weight: 700;
  margin: 16px 0;
  padding: 10px 12px;
}

.page {
  margin: 0 auto;
  max-width: 1320px;
  padding: 26px;
}

.page-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

h3 {
  font-size: 14px;
  letter-spacing: 0;
  margin: 0 0 10px;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 20px;
}

.metric,
.panel,
.split > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 27px;
  margin-top: 8px;
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin-bottom: 18px;
}

.panel,
.split > div {
  margin-bottom: 18px;
  overflow: hidden;
  padding: 18px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  min-width: 52px;
  padding: 4px 8px;
  text-align: center;
}

.pill.allow,
.decision.allow {
  background: #e8f6ef;
  color: var(--allow);
}

.pill.block,
.decision.block {
  background: #fff0ed;
  color: var(--block);
}

.pill.alert,
.decision.alert {
  background: #fff7ed;
  color: var(--alert);
}

.pill.status-ok {
  background: #e8f6ef;
  color: var(--allow);
}

.pill.status-warning {
  background: #fff7ed;
  color: var(--alert);
}

.pill.status-error {
  background: #fff0ed;
  color: var(--block);
}

.status-text.error {
  color: var(--block);
  font-size: 0.82rem;
}

.pill.safety-flag {
  margin-left: 6px;
  min-width: auto;
  vertical-align: middle;
}

.domain-age-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions form {
  margin: 0;
}

.table-actions button {
  min-height: 32px;
  padding: 6px 9px;
}

.table-actions .button-link {
  min-height: 32px;
  padding: 6px 9px;
}

.policy-management-grid {
  display: grid;
  gap: 14px;
}

.policy-compact-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.policy-compact-row form {
  margin: 0;
}

.section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-actions form {
  margin: 0;
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.compact-inline-form {
  gap: 8px;
  justify-content: flex-end;
}

.compact-inline-form select {
  min-width: 180px;
}

.rule-order-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rule-order-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  min-height: 62px;
  padding: 10px;
}

.rule-order-item.dragging {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgb(20 108 95 / 14%);
  opacity: 0.72;
}

.rule-order-item.rule-disabled {
  background: #f8fafc;
}

.rule-order-item.rule-locked .drag-handle {
  cursor: not-allowed;
  opacity: 0.5;
}

.rule-order-item.rule-disabled .rule-order-main,
.rule-order-item.rule-disabled > .pill {
  opacity: 0.62;
}

.scope-picker {
  gap: 10px;
}

.scope-target-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1px;
  max-height: min(260px, 38vh);
  overflow: auto;
  padding: 4px;
}

.template-create-form {
  display: grid;
  gap: 12px;
}

.template-inline-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.template-type-field {
  display: grid;
  gap: 6px;
}

.template-type-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.template-type-toggle {
  background: #e7edf3;
}

.template-type-toggle .action-toggle-button {
  color: #344054;
}

.template-type-toggle .action-toggle-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.template-enabled-row {
  align-self: end;
}

.template-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.template-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.template-row form {
  margin: 0;
}

.scope-popup-wrap {
  position: relative;
}

.scope-popup {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(16 24 40 / 16%);
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
}

.scope-filter-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.scope-filter-row input {
  min-height: 34px;
}

.scope-client-row {
  align-items: center;
  display: grid;
  gap: 5px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 24px;
  padding: 1px 3px;
}

.scope-client-row input[type="checkbox"] {
  height: 8px;
  margin: 0;
  min-height: 0;
  min-width: 0;
  padding: 0;
  width: 8px;
}

.scope-client-row:hover,
.scope-client-row.scope-selected-row {
  background: #f8fafc;
}

.scope-client-row .pill {
  font-size: 10px;
  min-width: 0;
  padding: 2px 5px;
  white-space: nowrap;
}

.scope-client-row span:not(.pill) {
  overflow-wrap: anywhere;
}

.drag-handle {
  background: #eef2f6;
  border-color: #d9dee7;
  color: #344054;
  cursor: grab;
  min-height: 34px;
  padding: 6px 0;
  width: 34px;
}

.drag-handle:hover {
  background: #d9dee7;
}

.rule-order-main {
  min-width: 0;
}

.rule-order-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-order-title strong {
  overflow-wrap: anywhere;
}

.rule-order-kind {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.default-action-row {
  align-items: end;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}

.danger-button {
  background: var(--block);
  border-color: var(--block);
}

.danger-button:hover {
  background: #8f1b12;
}

.rule-toggle {
  background: #eef2f6;
  border-color: #d9dee7;
  border-radius: 999px;
  color: #475467;
  display: grid;
  gap: 3px;
  grid-template-columns: 1fr 1fr;
  min-height: 32px;
  min-width: 78px;
  padding: 3px;
}

.rule-toggle:hover {
  background: #d9dee7;
}

.rule-toggle[aria-busy="true"] {
  cursor: wait;
  opacity: 0.7;
}

.rule-toggle span {
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  padding: 4px 8px;
}

.rule-toggle.on.allow span:first-child {
  background: var(--allow);
  color: #ffffff;
}

.rule-toggle.on.block span:first-child {
  background: var(--block);
  color: #ffffff;
}

.rule-toggle.on.policy span:first-child {
  background: var(--accent);
  color: #ffffff;
}

.rule-toggle.off span:last-child {
  background: #98a2b3;
  color: #ffffff;
}

.secondary-button {
  background: #eef2f6;
  border-color: #d9dee7;
  color: #344054;
}

.secondary-button:hover {
  background: #d9dee7;
}

.icon-button {
  align-items: center;
  background: #eef2f6;
  border-color: #d9dee7;
  color: #344054;
  display: inline-flex;
  justify-content: center;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.icon-button:hover {
  background: #d9dee7;
}

.modal {
  background: transparent;
  border: 0;
  box-sizing: border-box;
  max-height: calc(100vh - 32px);
  max-width: min(520px, calc(100vw - 32px));
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.modal::backdrop {
  background: rgb(16 24 40 / 42%);
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 22px 60px rgb(16 24 40 / 28%);
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
}

.modal-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.modal-heading h2 {
  margin-bottom: 0;
}

.modal-mode-tabs {
  background: #eef2f6;
  border-radius: 999px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin: 16px 0;
  padding: 4px;
}

.mode-tab {
  background: transparent;
  border-color: transparent;
  color: #344054;
  min-height: 34px;
}

.mode-tab:hover {
  background: #d9dee7;
}

.mode-tab.active {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 1px 2px rgb(16 24 40 / 14%);
  color: var(--accent-dark);
}

.modal-pane {
  margin-top: 0;
}

.modal-pane[hidden] {
  display: none;
}

.action-toggle {
  background: #fff0ed;
  border-radius: 999px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.action-toggle-button {
  background: transparent;
  border-color: transparent;
  color: #7a271a;
  min-height: 38px;
}

.action-toggle-button:hover {
  background: rgb(255 255 255 / 72%);
}

.action-toggle-button.active {
  background: var(--block);
  border-color: var(--block);
  box-shadow: 0 1px 2px rgb(16 24 40 / 14%);
  color: #ffffff;
}

.action-toggle-button[data-action-value="allow"],
.action-toggle-button[data-edit-action-value="allow"] {
  color: var(--allow);
}

.action-toggle-button[data-action-value="allow"].active,
.action-toggle-button[data-edit-action-value="allow"].active {
  background: var(--allow);
  border-color: var(--allow);
  color: #ffffff;
}

.action-toggle:has(.action-toggle-button[data-action-value="allow"].active),
.action-toggle:has(.action-toggle-button[data-edit-action-value="allow"].active) {
  background: #e8f6ef;
}

.modal-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions-split {
  justify-content: space-between;
  margin-top: 14px;
}

.modal-actions-split form {
  margin: 0;
}

.read-only-field {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.read-only-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.read-only-field strong {
  color: var(--ink);
}

.policy-stage-settings {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
}

.policy-stage-settings[hidden] {
  display: none;
}

.policy-stage-settings h3 {
  font-size: 14px;
  margin: 0;
}

.policy-guidance {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.policy-guidance p {
  margin-top: 4px;
}

.policy-guidance ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.policy-guidance li + li {
  margin-top: 5px;
}

.domain-match-input {
  align-items: stretch;
  display: flex;
}

.domain-prefix {
  align-items: center;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  color: #344054;
  display: inline-flex;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 10px;
}

.domain-match-input input,
.domain-match-input textarea {
  border-radius: 0 6px 6px 0;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.domain-match-input textarea {
  min-height: 104px;
}

.domain-prefix {
  align-items: flex-start;
}

.domain-prefix[hidden] + input,
.domain-prefix[hidden] + textarea {
  border-radius: 6px;
}

.modal-switch {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  padding: 10px 12px;
}

.stacked-form {
  display: grid;
  gap: 10px;
}

.modal-card .stacked-form {
  gap: 8px;
}

.section-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.resolver-release-heading {
  margin-bottom: 14px;
}

.resolver-release-heading h2 {
  margin-bottom: 0;
}

.form-alert {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.form-alert.success {
  background: #e8f6ef;
  border-color: #a6d8bd;
  color: var(--allow);
}

.form-alert.error {
  background: #fff0ed;
  border-color: #ffd0c8;
  color: var(--block);
}

.release-details {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 16px;
  overflow: hidden;
}

.release-details > div {
  background: #f8fafc;
  min-width: 0;
  padding: 10px 12px;
}

.release-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.release-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.release-details .release-detail-wide {
  grid-column: 1 / -1;
}

.resolver-installer-upload {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.resolver-installer-file-input {
  flex: 1 1 340px;
}

.resolver-installer-file-input input {
  min-width: 0;
  width: 100%;
}

.release-upload-status {
  font-size: 12px;
  margin-top: 9px;
}

.settings-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.policy-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 190px minmax(0, 1fr);
}

.policy-nav {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 8px;
  position: sticky;
  top: 76px;
}

.policy-nav a {
  border-radius: 6px;
  color: #344054;
  font-weight: 700;
  padding: 8px 10px;
}

.policy-nav a:hover {
  background: #eef6f4;
  color: var(--accent-dark);
}

.policy-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.policy-action-bar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.policy-action-bar span {
  color: var(--muted);
  font-weight: 700;
}

.policy-action-bar button {
  min-width: 170px;
}

.policy-section {
  align-items: start;
  gap: 12px 14px;
  grid-template-columns: 1fr;
  scroll-margin-top: 82px;
}

.policy-section label {
  min-width: 0;
}

.policy-section textarea,
.policy-section input:not([type="checkbox"]),
.policy-section select {
  width: 100%;
}

.policy-section .check-row input {
  flex: 0 0 auto;
  width: auto;
}

.policy-section-compact {
  grid-template-columns: 1fr;
}

.policy-feature {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  scroll-margin-top: 82px;
}

.switch-row {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 12px;
  min-height: 52px;
  padding: 12px;
  text-transform: none;
}

.switch-row .switch-input {
  appearance: none;
  background: #d0d5dd;
  border: 1px solid #c5ccd8;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 44px;
  height: 24px;
  min-height: 24px;
  min-width: 44px;
  padding: 0;
  position: relative;
  width: 44px;
}

.switch-row .switch-input::before {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 24%);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 140ms ease;
  width: 18px;
}

.switch-row .switch-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-row .switch-input:checked::before {
  transform: translateX(20px);
}

.feature-options {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.feature-options:empty,
.policy-feature.feature-off .feature-options {
  display: none;
}

.policy-feature.feature-off {
  background: #fbfcfd;
}

.policy-feature.feature-off .switch-row {
  color: #475467;
}

.blocklist-management {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.table-scroll {
  overflow-x: auto;
}

.table-scroll table {
  min-width: 760px;
}

.page.logs-page {
  max-width: none;
  padding: 20px 24px 24px;
}

.logs-page .page-heading {
  margin-bottom: 12px;
}

.live-log-panel {
  padding-top: 16px;
}

.logs-workspace {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-height: calc(100vh - 148px);
}

.live-log-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: -2px 0 16px;
  min-height: 42px;
  padding-bottom: 12px;
}

.live-log-state {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 24px;
}

.live-log-state strong {
  font-size: 14px;
}

.live-log-dot {
  background: #98a2b3;
  border-radius: 999px;
  height: 9px;
  width: 9px;
}

.live-log-dot[data-state="live"] {
  background: var(--allow);
  box-shadow: 0 0 0 3px rgb(28 125 84 / 13%);
}

.live-log-dot[data-state="connecting"] {
  background: #b7791f;
}

.live-log-dot[data-state="error"] {
  background: var(--block);
}

.live-log-dot.heartbeat {
  animation: live-log-heartbeat 500ms ease-out;
}

@keyframes live-log-heartbeat {
  50% {
    transform: scale(1.45);
  }
}

.live-log-switch {
  flex-direction: row-reverse;
  margin: 0;
}

.log-filter-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(120px, 1fr)) minmax(90px, 0.6fr) auto;
  margin-bottom: 16px;
}

.log-filter-form label {
  min-width: 0;
}

.log-filter-form input,
.log-filter-form select {
  min-width: 0;
  width: 100%;
}

.log-filter-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.live-log-table-wrap {
  border-top: 1px solid var(--line);
  flex: 1 1 auto;
  height: calc(100vh - 304px);
  max-height: none;
  min-height: 420px;
  overflow: auto;
  padding-top: 0;
}

.table-scroll .live-log-table {
  min-width: 1490px;
  table-layout: fixed;
  width: 100%;
}

.table-scroll .live-log-table[data-client-scoped="true"] {
  min-width: 1150px;
}

.live-log-table th,
.live-log-table td {
  overflow: hidden;
  padding-left: 9px;
  padding-right: 9px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.live-log-table th:nth-child(1) {
  width: 165px;
}

.live-log-table th:nth-child(2) {
  width: 300px;
}

.live-log-table th:nth-child(3) {
  width: 70px;
}

.live-log-table th:nth-child(4),
.live-log-table th:nth-child(5) {
  width: 90px;
}

.live-log-table th:nth-child(6),
.live-log-table th:nth-child(7),
.live-log-table th:nth-child(8) {
  width: 180px;
}

.live-log-table th:nth-child(9) {
  width: 150px;
}

.live-log-table th:nth-child(10) {
  width: 85px;
}

.live-log-table[data-client-scoped="true"] th:nth-child(1) {
  width: 155px;
}

.live-log-table[data-client-scoped="true"] th:nth-child(2) {
  width: 240px;
}

.live-log-table[data-client-scoped="true"] th:nth-child(7),
.live-log-table[data-client-scoped="true"] th:nth-child(8) {
  width: 150px;
}

.live-log-table[data-client-scoped="true"] th:nth-child(9) {
  width: 130px;
}

.live-log-table[data-client-scoped="true"] th:nth-child(10) {
  width: 75px;
}

.live-log-table thead th {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.live-log-table[data-client-scoped="true"] .live-log-client-column {
  display: none;
}

.live-log-table .live-log-domain {
  max-width: 300px;
}

.live-log-table td.live-log-decision {
  line-height: 1.25;
  white-space: normal;
}

.live-log-decision strong,
.live-log-decision > .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-log-decision strong {
  overflow-wrap: anywhere;
  white-space: normal;
}

.live-log-decision > .muted {
  font-size: 0.75rem;
  margin-top: 2px;
  white-space: nowrap;
}

.live-log-new {
  animation: live-log-row-arrival 800ms ease-out;
}

@keyframes live-log-row-arrival {
  from {
    background: #e9f7f3;
  }
}

@media (max-width: 1350px) {
  .log-filter-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .live-log-table-wrap {
    height: calc(100vh - 370px);
  }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
}

legend {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  text-transform: uppercase;
}

.check-row {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 9px;
  min-height: 30px;
  text-transform: none;
}

.check-row input {
  min-height: auto;
  min-width: auto;
}

input,
select,
textarea,
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
}

input,
select,
textarea {
  background: #ffffff;
  color: var(--text);
  min-width: 220px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

.secondary-form button {
  background: #eef2f6;
  border-color: #d9dee7;
  color: #344054;
}

.secondary-form button:hover {
  background: #d9dee7;
}

.danger-form button {
  background: var(--block);
  border-color: var(--block);
}

.danger-form button:hover {
  background: #8f1b12;
}

.decision {
  border-radius: 8px;
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
}

.result-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.result-preview table th,
.result-preview table td {
  padding: 7px 6px;
}

.result-preview table th {
  width: 140px;
}

pre {
  background: #111827;
  border-radius: 8px;
  color: #f9fafb;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
}

code {
  background: #eef2f6;
  border-radius: 5px;
  padding: 2px 5px;
}

.enrollment-result code {
  overflow-wrap: anywhere;
}

.token-value {
  color: var(--accent-dark);
  font-weight: 700;
}

.enrollment-code {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.enrollment-details {
  margin-top: 1rem;
}

.enrollment-details summary {
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
  }

  .page {
    padding: 18px;
  }

  .page.logs-page {
    padding: 16px;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .release-details {
    grid-template-columns: 1fr 1fr;
  }

  .policy-layout,
  .blocklist-management {
    grid-template-columns: 1fr;
  }

  .policy-nav {
    position: static;
  }

  .policy-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .domain-intel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .domain-intel-heading button {
    width: 100%;
  }

  .live-log-toolbar {
    align-items: center;
    gap: 16px;
  }

  .live-log-state {
    flex-wrap: wrap;
    min-width: 0;
  }

  .live-log-state strong,
  .live-log-switch {
    white-space: nowrap;
  }

  .live-log-state [data-live-log-count] {
    flex-basis: 100%;
    margin-left: 17px;
  }

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

  .logs-workspace {
    min-height: 0;
  }

  .live-log-table-wrap {
    height: 65vh;
    min-height: 420px;
  }

  .policy-action-bar button {
    width: 100%;
  }

  .rule-order-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .rule-order-item > .pill,
  .rule-order-item > .table-actions {
    grid-column: 2;
  }

  .default-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .template-row {
    grid-template-columns: 1fr;
  }

  .domain-match-input input {
    min-width: 0;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  input,
  select,
  textarea {
    min-width: 100%;
  }
}
