/* CloudWatch Alarm Builder: builds on /labs/csp/tool.css and /labs/cors/tool.css. */

.alarms-main form + .results {
  margin-top: 24px;
}
.alarm-group {
  border: 1px solid #22324a;
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.alarm-group legend {
  padding: 0 6px;
  color: #8fa3bb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #c4d2e2;
}
.iam-code {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.iam-code h4 {
  font-size: 0.85rem;
  margin: 0 0 6px;
  color: #8fa3bb;
}
.iam-code pre {
  white-space: pre;
  overflow-x: auto;
  max-height: 460px;
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.alarm-timeline {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.alarm-timeline th,
.alarm-timeline td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #22324a;
}
.alarm-timeline thead th {
  color: #8fa3bb;
  font-weight: 500;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.alarm-state {
  display: inline-block;
  white-space: nowrap;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}
.state-ok {
  background: rgba(83, 227, 189, 0.14);
  color: var(--mint);
}
.state-alarm {
  background: rgba(255, 120, 140, 0.16);
  color: #ff9aa8;
}
.state-insufficient_data {
  background: rgba(143, 163, 187, 0.18);
  color: #c4d2e2;
}
.alarm-changed {
  margin-left: 8px;
  font-size: 0.72rem;
  color: #f3c969;
}
@media (max-width: 760px) {
  .iam-code {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* "See it in AWS" (shared by alarms, SLO and RUM). */
.see-in-aws {
  margin-top: 32px;
}
.see-intro {
  color: #c4d2e2;
  max-width: 70ch;
}
.see-steps {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 6px;
}
.see-cli {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.see-cli-item {
  min-width: 0;
}
.see-cli-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.see-cli-head h4 {
  margin: 0;
  font-size: 0.9rem;
}
.see-copy {
  flex: none;
  font: inherit;
  font-size: 0.78rem;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid #2c3d57;
  background: transparent;
  color: #c4d2e2;
  cursor: pointer;
}
.see-copy:hover,
.see-copy:focus-visible {
  border-color: var(--mint);
  color: var(--mint);
}
.see-cli-item pre {
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  margin: 0;
}
.see-cli-item .block-help {
  margin: 6px 0 0;
}
.see-good {
  background: rgba(83, 227, 189, 0.14);
  color: var(--mint);
}
.see-warn {
  background: rgba(243, 201, 105, 0.16);
  color: #f3c969;
}
.see-bad {
  background: rgba(255, 120, 140, 0.16);
  color: #ff9aa8;
}
.see-neutral {
  background: rgba(143, 163, 187, 0.18);
  color: #c4d2e2;
}
.see-states {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.see-state {
  border: 1px solid #22324a;
  border-left: 3px solid #8fa3bb;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.see-tone-good {
  border-left-color: var(--mint);
}
.see-tone-warn {
  border-left-color: #f3c969;
}
.see-tone-bad {
  border-left-color: #ff9aa8;
}
.see-state h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.see-tone-good h4 {
  color: var(--mint);
}
.see-tone-warn h4 {
  color: #f3c969;
}
.see-tone-bad h4 {
  color: #ff9aa8;
}
.see-state dl {
  margin: 0;
  font-size: 0.88rem;
}
.see-state dt {
  color: #8fa3bb;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.see-state dd {
  margin: 2px 0 0;
  color: #dbe5f0;
}
.see-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  font-size: 0.9rem;
}
.see-links a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.see-links a::after {
  content: "↗";
  margin-left: 3px;
  text-decoration: none;
  display: inline-block;
}

/* Wide tables become labelled cards on small screens (cells carry data-label). */
@media (max-width: 560px) {
  .alarm-timeline th,
  .alarm-timeline td {
    padding: 6px 8px;
  }
  .stack-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .stack-table,
  .stack-table tbody,
  .stack-table tr,
  .stack-table td {
    display: block;
    width: 100%;
  }
  .stack-table tr {
    border-bottom: 1px solid #22324a;
    padding: 8px 0;
  }
  .stack-table td {
    border: 0;
    padding: 3px 4px;
    display: grid;
    grid-template-columns: 6.5em minmax(0, 1fr);
    gap: 8px;
  }
  .stack-table td::before {
    content: attr(data-label);
    color: #8fa3bb;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 2px;
  }
}
