.alerts-tool-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 64px;
  color: var(--text);
}

.alerts-tool-hero {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.alerts-tool-kicker,
.alerts-panel-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.alerts-tool-copy h1 {
  max-width: 720px;
  margin: 8px 0 10px;
  font-size: 64px;
  line-height: .92;
  letter-spacing: 0;
}

.alerts-tool-copy p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.alerts-access-status,
.alerts-pro-required,
.alerts-status-pill,
.alerts-rules-actions span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ghost-bg) 72%, var(--panel));
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.alerts-access-status {
  align-self: start;
  padding: 9px 12px;
  white-space: nowrap;
}

.alerts-pro-required {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border-radius: 16px;
  padding: 14px 16px;
}

.alerts-pro-required span {
  display: block;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.alerts-pro-required strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
}

.alerts-pro-required button,
.alerts-rules-actions button,
.alert-rule-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.alerts-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.alerts-workspace.is-locked {
  opacity: .58;
}

.alerts-tool-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

.alerts-tool-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ghost-bg) 70%, var(--panel));
  padding: 18px;
}

.alerts-panel-head,
.alerts-rules-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.alerts-panel-head h2,
.alerts-rules-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.alerts-panel-head p {
  max-width: 430px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.alerts-status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  white-space: nowrap;
}

.alerts-status-pill.active {
  border-color: color-mix(in srgb, #18aa6e 48%, var(--line));
  background: color-mix(in srgb, #18aa6e 10%, var(--panel));
  color: color-mix(in srgb, #18aa6e 82%, var(--text));
}

.alerts-status-pill.paused {
  border-color: color-mix(in srgb, #d49a16 44%, var(--line));
  background: color-mix(in srgb, #d49a16 10%, var(--panel));
  color: color-mix(in srgb, #ad7b0f 82%, var(--text));
}

.alerts-channel-action {
  margin-top: 14px;
}

.alerts-channel-action a,
.alerts-primary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand) 70%, black 10%);
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.alert-rule-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.alert-rule-form label,
.alert-rule-grid span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.alert-rule-form input,
.alert-rule-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  outline: none;
}

.alert-rule-form input:focus,
.alert-rule-form select:focus {
  border-color: color-mix(in srgb, var(--brand) 66%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.alert-rule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.alert-rule-grid label {
  display: grid;
  gap: 7px;
}

.alerts-rules-panel {
  min-height: 420px;
}

.alerts-rules-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alerts-rules-actions span {
  padding: 7px 10px;
}

.alerts-status-message {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--panel);
  font-size: 14px;
  font-weight: 800;
}

.alerts-status-message.ok {
  border-color: color-mix(in srgb, #18aa6e 45%, var(--line));
  color: color-mix(in srgb, #158f5d 86%, var(--text));
  background: color-mix(in srgb, #18aa6e 8%, var(--panel));
}

.alerts-status-message.error {
  border-color: color-mix(in srgb, #dc4e56 45%, var(--line));
  color: color-mix(in srgb, #dc4e56 86%, var(--text));
  background: color-mix(in srgb, #dc4e56 8%, var(--panel));
}

.alert-rules-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.alert-rule-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(110px, .7fr) minmax(150px, .9fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}

.alert-rule-row.is-paused {
  background: color-mix(in srgb, #d49a16 5%, var(--panel));
}

.alert-rule-asset,
.alert-rule-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.alert-rule-asset strong,
.alert-rule-metric strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.22;
}

.alert-rule-asset span,
.alert-rule-metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
}

.alert-rule-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.alert-rule-status {
  width: fit-content;
  border: 1px solid color-mix(in srgb, #18aa6e 42%, var(--line));
  border-radius: 999px;
  padding: 4px 8px;
  color: color-mix(in srgb, #18aa6e 82%, var(--text));
  background: color-mix(in srgb, #18aa6e 9%, var(--panel));
  font-size: 12px;
  font-weight: 900;
}

.alert-rule-status.paused {
  border-color: color-mix(in srgb, #d49a16 44%, var(--line));
  color: color-mix(in srgb, #ad7b0f 82%, var(--text));
  background: color-mix(in srgb, #d49a16 10%, var(--panel));
}

.alert-rule-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.alert-rules-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--ghost-bg) 58%, var(--panel));
  font-size: 14px;
}

.alerts-paywall-card {
  width: min(780px, calc(100% - 18px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .78fr);
  gap: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 94%, #0b1220 6%), color-mix(in srgb, var(--ghost-bg) 82%, var(--panel)));
  padding: 24px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, .38);
}

.alerts-paywall-copy,
.alerts-paywall-preview {
  min-width: 0;
}

.alerts-paywall-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #79b4ff, var(--brand));
  font-size: 14px;
  font-weight: 950;
}

.alerts-paywall-copy h2 {
  margin: 14px 36px 10px 0;
  font-size: 31px;
  line-height: 1.05;
  letter-spacing: 0;
}

.alerts-paywall-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.alerts-paywall-benefits {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.alerts-paywall-benefits span {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  background: color-mix(in srgb, var(--ghost-bg) 68%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.alerts-paywall-benefits span::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #24c77a;
  box-shadow: 0 0 0 4px rgba(36, 199, 122, .12);
}

.alerts-paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.alerts-paywall-actions a,
.alerts-paywall-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.alerts-paywall-actions a {
  background: linear-gradient(135deg, #6aabff, var(--brand));
  color: #fff;
}

.alerts-paywall-actions button {
  border-color: var(--line);
  background: color-mix(in srgb, var(--ghost-bg) 78%, var(--panel));
  color: var(--text);
}

.alerts-preview-terminal {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 16px;
  padding: 14px;
  background: color-mix(in srgb, var(--ghost-bg) 74%, var(--panel));
}

.alerts-preview-head,
.alerts-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alerts-preview-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.alerts-preview-head strong {
  color: var(--brand);
}

.alerts-preview-row {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 900;
}

.alerts-preview-row.up span {
  color: #18aa6e;
}

.alerts-preview-row.down span {
  color: #dc4e56;
}

.alerts-preview-message {
  border-radius: 11px;
  padding: 10px;
  background: color-mix(in srgb, var(--brand) 12%, var(--panel));
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .alerts-tool-hero,
  .alerts-workspace,
  .alerts-paywall-card {
    grid-template-columns: 1fr;
  }

  .alerts-tool-copy h1 {
    font-size: 44px;
  }
}

@media (max-width: 620px) {
  .alerts-tool-shell {
    width: calc(100% - 18px);
    margin-top: 18px;
    padding-bottom: calc(22px + var(--mobile-bottom-nav-height, 0px));
  }

  .alerts-tool-hero {
    min-height: auto;
  }

  .alerts-tool-copy h1 {
    font-size: 36px;
  }

  .alerts-pro-required,
  .alerts-panel-head,
  .alerts-rules-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .alerts-rules-actions,
  .alert-rule-actions,
  .alerts-paywall-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
