:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --text: #172033;
  --muted: #667085;
  --border: #d7dce5;
  --accent: #1f7a5c;
  --accent-strong: #155f47;
  --danger: #b42318;
  --warning: #8a6100;
  --shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.nav a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.inline-form {
  margin: 0;
}

.nav-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.nav-button:hover {
  color: var(--text);
}

.hero {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 32px;
  align-items: center;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow,
.hero-copy .eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.button:hover {
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.button:focus-visible,
.text-link:focus-visible,
.attention-item a:focus-visible,
.ops-action-links a:focus-visible {
  outline: 3px solid rgba(31, 122, 92, 0.24);
  outline-offset: 3px;
}

.button.danger-outline {
  border-color: #e6a7a0;
  background: #fff7f5;
  color: var(--danger);
}

.button.danger-outline:hover {
  border-color: var(--danger);
  background: #fde8e5;
}

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

.status-panel,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-panel {
  padding: 8px 22px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row span {
  color: var(--muted);
}

.status-row strong {
  text-align: right;
}

.content-band {
  padding: 34px 0;
}

.content-band.muted {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel {
  padding: 24px;
}

h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li + li {
  margin-top: 8px;
}

.check-list li::marker {
  color: var(--accent);
}

.next-list li::marker {
  color: var(--danger);
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

code {
  display: block;
  min-height: 48px;
  padding: 14px;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-section {
  min-height: calc(100vh - 165px);
  display: grid;
  align-items: center;
  padding: 64px 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 64px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.08;
}

.auth-copy > p:last-child {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.auth-panel {
  padding: 30px;
}

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

.stacked-form label {
  margin-top: 8px;
  font-weight: 700;
}

.stacked-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.stacked-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 92, 0.15);
}

.stacked-form .button {
  margin-top: 14px;
  cursor: pointer;
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.alert.error {
  border-color: #f3b7b2;
  background: #fff1f0;
  color: var(--danger);
}

.alert.success {
  border-color: #9fd8c4;
  background: #effaf6;
  color: var(--accent-strong);
}

.page-heading {
  padding: 56px 0 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-heading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
}

.page-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
}

.page-actions {
  margin: 0;
}

.account-grid {
  align-items: start;
}

.setup-list,
.account-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setup-list li:last-child {
  border-bottom: 0;
}

.setup-list .ready strong {
  color: var(--accent);
}

.setup-list .missing strong {
  color: var(--danger);
}

.flow-list {
  padding-left: 22px;
}

.flow-list code {
  min-height: auto;
  display: inline;
  padding: 2px 5px;
}

.panel-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-note code {
  min-height: auto;
  display: inline;
  padding: 2px 5px;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr) auto;
  gap: 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.account-row > div {
  display: grid;
  gap: 4px;
}

.account-row span:not(.status-badge) {
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dff3eb;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.status-badge.expired,
.status-badge.error,
.status-badge.disconnected {
  background: #fde8e5;
  color: var(--danger);
}

.status-badge.needs_refresh {
  background: #fff2cf;
  color: #7a5700;
}

.account-actions {
  align-content: center;
}

.account-actions form {
  margin: 0;
}

.empty-state {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.account-switcher {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 0 0 20px;
}

.account-switcher label {
  font-weight: 700;
}

.account-switcher select {
  min-width: 240px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.media-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.media-summary > div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}

.media-summary > div:last-child {
  border-right: 0;
}

.media-summary span,
.section-heading > p {
  color: var(--muted);
  font-size: 13px;
}

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

.section-heading .eyebrow,
.section-heading h2,
.section-heading > p {
  margin: 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.media-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e6ebf2;
}

.media-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 4px;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  color: var(--muted);
  text-align: center;
}

.media-placeholder span {
  font-size: 12px;
  letter-spacing: 0.06em;
}

.media-type {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.82);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.media-card-body {
  padding: 18px;
}

.media-card-body > p {
  min-height: 76px;
  margin: 0 0 16px;
}

.media-meta {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.media-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.media-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.media-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.media-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 18px;
}

.media-card-actions .button {
  width: 100%;
  padding: 8px 12px;
  text-align: center;
}

.media-empty {
  display: grid;
  gap: 4px;
}

.form-help {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-help code {
  min-height: auto;
  display: inline;
  padding: 2px 5px;
  font-size: 13px;
}

.rule-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.rule-form-panel {
  padding: 28px;
}

.section-heading.compact {
  align-items: center;
}

.rule-form {
  display: grid;
  gap: 20px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.field-label {
  font-weight: 700;
}

.field-group input:not([type="checkbox"]),
.field-group select,
.field-group textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field-group textarea {
  resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 92, 0.15);
}

.field-group small {
  color: var(--muted);
  font-size: 13px;
}

.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.checkbox-field {
  align-content: start;
}

.checkbox-control {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.rule-form-actions,
.rule-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.rule-form-actions {
  padding-top: 6px;
}

.rule-form-actions button,
.rule-card-actions button {
  cursor: pointer;
  font: inherit;
}

.rule-preview-column {
  display: grid;
  gap: 18px;
}

.selected-media-card,
.rule-policy-card {
  padding: 20px;
}

.selected-media-card > img,
.selected-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-muted);
}

.selected-media-card h2,
.rule-policy-card h2 {
  margin-top: 16px;
  font-size: 20px;
}

.rule-policy-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.rule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rule-summary > div {
  display: grid;
  gap: 3px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.rule-summary > div:last-child {
  border-right: 0;
}

.rule-summary span,
.rule-account,
.rule-caption {
  color: var(--muted);
}

.rule-list {
  display: grid;
  gap: 14px;
}

.rule-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rule-card.inactive {
  border-style: dashed;
}

.rule-media-thumb {
  min-height: 176px;
  background: #e6ebf2;
}

.rule-media-thumb img,
.rule-media-thumb .media-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rule-card-main {
  padding: 20px;
}

.rule-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.rule-title-row h2 {
  margin: 8px 0 0;
  font-size: 22px;
}

.rule-account {
  font-size: 13px;
  font-weight: 700;
}

.rule-caption {
  margin: 10px 0 12px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.keyword-list span {
  padding: 3px 9px;
  border-radius: 999px;
  background: #dff3eb;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.rule-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 22px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.rule-details > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rule-details dt {
  color: var(--muted);
  font-size: 12px;
}

.rule-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.rule-card-actions form {
  margin: 0;
}

.rule-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.webhook-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.webhook-summary > div {
  display: grid;
  gap: 3px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.webhook-summary > div:last-child {
  border-right: 0;
}

.webhook-summary span {
  color: var(--muted);
}

.comment-match-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.comment-match-summary > div {
  display: grid;
  gap: 3px;
  padding: 13px 20px;
  border-right: 1px solid var(--border);
}

.comment-match-summary > div:last-child {
  border-right: 0;
}

.comment-match-summary span {
  color: var(--muted);
  font-size: 13px;
}

.log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 20px;
}

.log-filters > div {
  display: grid;
  gap: 6px;
}

.log-filters label {
  font-size: 13px;
  font-weight: 700;
}

.log-filters select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.webhook-event-list {
  display: grid;
  gap: 14px;
}

.webhook-event-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.webhook-event-card.status-failed {
  border-left-color: var(--danger);
}

.webhook-event-card.status-ignored {
  border-left-color: #a17000;
}

.webhook-event-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.webhook-event-heading h2 {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.webhook-event-heading time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-type-badge,
.signature-badge,
.redacted-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.signature-badge {
  background: #dff3eb;
  color: var(--accent-strong);
}

.signature-badge.invalid {
  background: #fde8e5;
  color: var(--danger);
}

.redacted-badge {
  background: #fff2cf;
  color: #7a5700;
}

.webhook-event-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 28px;
  margin: 16px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.webhook-event-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.webhook-event-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.webhook-event-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.event-error {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff2cf;
  color: #7a5700;
  font-size: 13px;
}

.comment-match-results {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comment-match-heading,
.comment-match-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-match-heading h3 {
  margin: 0;
  font-size: 15px;
}

.comment-match-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.comment-match-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.comment-match-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid #a17000;
  border-radius: 8px;
  background: var(--surface-muted);
}

.comment-match-card.status-matched {
  border-left-color: var(--accent);
  background: #f2faf7;
}

.comment-match-card.status-action_detected {
  border-left-color: var(--accent);
  background: #f2faf7;
}

.comment-match-card.status-failed {
  border-left-color: var(--danger);
  background: #fff7f5;
}

.comment-match-card-heading > strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.match-status-badge,
.matched-keyword-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff2cf;
  color: #7a5700;
  font-size: 12px;
  font-weight: 700;
}

.match-status-badge.status-matched,
.match-status-badge.status-action_detected,
.matched-keyword-badge {
  background: #dff3eb;
  color: var(--accent-strong);
}

.match-status-badge.status-failed {
  background: #fde8e5;
  color: var(--danger);
}

.comment-text {
  margin: 12px 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.6;
}

.comment-match-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 24px;
  margin: 0;
}

.comment-match-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.comment-match-meta dt,
.comment-match-meta dd {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.comment-match-meta dt {
  color: var(--muted);
}

.comment-match-meta dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.match-reason,
.comment-match-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.comment-match-empty {
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-muted);
}

.raw-payload {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101828;
  color: #e7edf7;
}

.raw-payload summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.raw-payload pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border-top: 1px solid #344054;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 Consolas, "Courier New", monospace;
}

.webhook-empty {
  display: grid;
  gap: 5px;
}

.ops-header {
  padding: 48px 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.ops-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  animation: ops-rise 300ms ease both;
}

.ops-header h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
}

.ops-header p:not(.eyebrow) {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
}

.ops-updated {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ops-header-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.ops-overview {
  padding: 24px 0 34px;
}

.ops-health-strip {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  animation: ops-rise 340ms 70ms ease both;
}

.ops-health-strip.tone-danger {
  border-top-color: var(--danger);
}

.ops-health-strip.tone-warning {
  border-top-color: var(--warning);
}

.ops-health-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ops-health-title span:not(.health-dot),
.ops-health-title strong {
  display: block;
}

.ops-health-title span:not(.health-dot) {
  color: var(--muted);
  font-size: 13px;
}

.ops-health-title strong {
  margin-top: 2px;
  font-size: 22px;
}

.health-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(31, 122, 92, 0.12);
}

.tone-danger .health-dot {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.1);
}

.tone-warning .health-dot {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(138, 97, 0, 0.1);
}

.attention-list {
  display: grid;
  gap: 6px;
}

.attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 34px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  font-size: 14px;
}

.attention-item.tone-danger {
  border-left-color: var(--danger);
}

.attention-item.tone-warning {
  border-left-color: var(--warning);
}

.attention-item a,
.text-link {
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.ops-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  animation: ops-rise 380ms 120ms ease both;
}

.ops-kpi {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--border);
}

.ops-kpi:last-child {
  border-right: 0;
}

.ops-kpi > span,
.ops-kpi > small {
  color: var(--muted);
}

.ops-kpi > span {
  font-size: 13px;
  font-weight: 700;
}

.ops-kpi > strong {
  font-size: 32px;
  line-height: 1.2;
}

.ops-kpi.tone-danger > strong,
.tone-danger {
  color: var(--danger);
}

.ops-kpi.tone-healthy > strong,
.tone-healthy {
  color: var(--accent-strong);
}

.tone-warning {
  color: var(--warning);
}

.ops-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
}

.ops-section {
  min-width: 0;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.section-heading.compact .eyebrow {
  margin-bottom: 4px;
}

.section-heading.compact h2 {
  margin-bottom: 0;
}

.section-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ops-list {
  border-top: 1px solid var(--border);
}

.ops-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 160ms ease, background-color 160ms ease;
}

a.ops-list-row:hover {
  padding-left: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.ops-list-row strong,
.ops-list-row span {
  display: block;
}

.ops-list-row > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.state-label,
.state-number {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.state-label {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ops-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ops-empty a {
  color: var(--accent-strong);
  font-weight: 700;
}

.ops-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.ops-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.ops-table th,
.ops-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.ops-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-table th:first-child,
.ops-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.ops-table td:first-child {
  white-space: normal;
}

.ops-table td:first-child strong,
.ops-table td:first-child span {
  display: block;
}

.ops-table td:first-child span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ops-table tbody tr {
  transition: background-color 160ms ease;
}

.ops-table tbody tr:hover {
  background: #f2faf7;
}

.ops-footer-actions {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
}

.ops-action-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.ops-action-links a {
  display: grid;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 160ms ease, color 160ms ease;
}

.ops-action-links a:nth-child(odd) {
  padding-right: 24px;
}

.ops-action-links a:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.ops-action-links a:hover {
  color: var(--accent-strong);
}

.ops-action-links span {
  color: var(--muted);
  font-size: 13px;
}

.log-ops-kpis {
  margin-top: 0;
}

.log-metrics-detail {
  margin-top: 14px;
  border-bottom: 1px solid var(--border);
}

.log-metrics-detail > summary {
  padding: 12px 0;
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.log-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px 0 16px;
}

.log-metrics-grid > div {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-left: 1px solid var(--border);
}

.log-metrics-grid > div:nth-child(3n + 1) {
  padding-left: 0;
  border-left: 0;
}

.log-metrics-grid span,
.log-metrics-grid small {
  color: var(--muted);
}

.log-metrics-grid span {
  font-size: 12px;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.retry-job-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px;
  border-top: 1px solid #efc3bd;
  border-bottom: 1px solid #efc3bd;
  background: #fff7f5;
}

.retry-job-form strong,
.retry-job-form span {
  display: block;
}

.retry-job-form span {
  color: var(--muted);
  font-size: 12px;
}

.operation-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-items: center;
  padding: 56px 0;
}

.operation-result-inner {
  max-width: 720px;
}

.operation-result h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08;
}

.operation-result p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

@keyframes ops-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .header-inner,
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner {
    padding: 16px 0;
  }

  .hero {
    padding: 48px 0 34px;
  }

  .hero-grid,
  .two-column,
  .command-grid,
  .auth-layout,
  .page-heading-grid,
  .ops-header-grid,
  .ops-health-strip,
  .ops-two-column,
  .ops-footer-actions,
  .account-row,
  .media-summary,
  .rule-form-layout,
  .rule-summary,
  .webhook-summary,
  .comment-match-summary,
  .log-filters {
    grid-template-columns: 1fr;
  }

  .ops-header-actions {
    justify-content: flex-start;
  }

  .ops-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-kpi:nth-child(2) {
    border-right: 0;
  }

  .ops-kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .log-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-metrics-grid > div:nth-child(3n + 1) {
    padding-left: 16px;
    border-left: 1px solid var(--border);
  }

  .log-metrics-grid > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .media-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .media-summary > div:last-child {
    border-bottom: 0;
  }

  .rule-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .rule-summary > div:last-child {
    border-bottom: 0;
  }

  .webhook-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .webhook-summary > div:last-child {
    border-bottom: 0;
  }

  .comment-match-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .comment-match-summary > div:last-child {
    border-bottom: 0;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .account-switcher select {
    width: 100%;
  }

  .auth-layout {
    gap: 34px;
  }

  .status-row {
    flex-direction: column;
    gap: 4px;
  }

  .status-row strong {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .media-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-row,
  .rule-details,
  .rule-card,
  .webhook-event-meta,
  .comment-match-meta {
    grid-template-columns: 1fr;
  }

  .webhook-event-heading,
  .comment-match-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rule-media-thumb {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .rule-title-row {
    flex-direction: column;
    gap: 6px;
  }

  .rule-card-actions,
  .rule-card-actions form,
  .rule-card-actions .button {
    width: 100%;
  }

  .ops-kpi-strip,
  .ops-action-links,
  .log-metrics-grid {
    grid-template-columns: 1fr;
  }

  .ops-kpi,
  .ops-kpi:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .ops-kpi:last-child {
    border-bottom: 0;
  }

  .attention-item,
  .ops-list-row,
  .ops-empty,
  .retry-job-form {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-label,
  .state-number {
    text-align: left;
  }

  .ops-action-links a:nth-child(odd),
  .ops-action-links a:nth-child(even) {
    padding: 14px 0;
    border-left: 0;
  }

  .log-metrics-grid > div,
  .log-metrics-grid > div:nth-child(3n + 1),
  .log-metrics-grid > div:nth-child(odd) {
    padding: 12px 0;
    border-left: 0;
    border-bottom: 1px solid var(--border);
  }

  .filter-actions,
  .filter-actions .button,
  .retry-job-form .button {
    width: 100%;
  }
}

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