@font-face {
  font-family: "Chivo";
  src: url("/brand/chivo.ttf") format("truetype");
  font-weight: 300 700;
  font-display: optional;
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  color: #19221b;
  background: #eef0e8;
  font-synthesis: none;
  --ink: #19221b;
  --muted: #515b50;
  --rule: #cbd1c5;
  --control-border: #7d897b;
  --canvas: #eef0e8;
  --paper: #fbfcf7;
  --link: #284e35;
  --red: #942c22;
  --critical-light: #ffad9a;
  --surface-dark: #172019;
  --surface-dark-raised: #243127;
  --on-dark: #f5f8ee;
  --muted-on-dark: #b5c2b0;
  --dark-rule: #536253;
  --accent: #dafa62;
  --accent-hover: #c8e851;
  --display: "Chivo", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --page-width: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
body { margin: 0; }
p { line-height: 1.65; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: #ddefaa; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:where(button, input):focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.topbar { background: var(--surface-dark); color: var(--on-dark); }
.topbar-inner, .workspace {
  width: min(100%, var(--page-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.25rem);
  min-height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .065em;
  line-height: 1;
}
.brand img { width: 2rem; height: 2rem; flex: none; }
@media (max-width: 25rem) {
  .topbar .brand { gap: .5rem; font-size: 1rem; }
  .topbar .brand img { width: 1.5rem; height: 1.5rem; }
  .topbar .button { padding-inline: .5rem; }
}
.environment {
  padding-inline-start: clamp(.75rem, 2vw, 1.25rem);
  border-inline-start: 1px solid var(--dark-rule);
  color: var(--muted-on-dark);
  font-size: .75rem;
}
.topbar .button {
  margin-inline-start: auto;
  border-color: var(--dark-rule);
  color: inherit;
  background: transparent;
}
.topbar .button:hover { background: var(--surface-dark-raised); }
.topbar .button:focus-visible { outline-color: var(--accent); }

.workspace { padding-block: clamp(1.75rem, 5vw, 3.625rem) 3rem; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-block-end: 1.125rem;
}
h1 {
  margin: 0;
  font-size: clamp(1.625rem, 4.5vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.35;
}
h2 { margin: 0; font-size: 1.0625rem; line-height: 1.45; }

.button {
  flex: none;
  min-height: 2.25rem;
  padding: .4375rem .75rem;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: .8125rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}
.button.outline { color: var(--ink); background: var(--paper); border-color: var(--control-border); }
.button.outline:hover:enabled { background: #e6ebe0; }
.button.primary { color: var(--ink); background: var(--accent); border-color: transparent; }
.button.primary:hover:enabled { background: var(--accent-hover); }
.button.quiet { color: var(--muted); background: transparent; }
.button.quiet:hover { color: var(--ink); background: #e6ebe0; }
.button.outline:disabled, .button.primary:disabled { color: var(--muted); background: #e8ece3; border-color: var(--rule); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 clamp(1.75rem, 4vw, 2.75rem);
  padding-block: .875rem;
  border-block-start: 1px solid var(--ink);
  border-block-end: 1px solid var(--rule);
}
.metric {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding-inline: clamp(.75rem, 2.25vw, 1.5rem);
  border-inline-start: 1px solid var(--rule);
}
.metric:first-child { padding-inline-start: 0; border-inline-start: 0; }
.metric dt { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.metric dd {
  order: -1;
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.urgent :is(dt, dd) { color: var(--red); }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .625rem 1rem;
  border-block-end: 1px solid #9a9d9a;
}
.filters { display: flex; flex-wrap: wrap; gap: .25rem .875rem; }
.filter {
  margin-block-end: -1px;
  min-height: 2.75rem;
  padding: .5rem .125rem;
  border: 0;
  border-block-end: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: .8125rem;
  font-weight: 600;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { border-block-end-color: var(--link); color: var(--link); }
input {
  min-width: 0;
  padding: .5rem .625rem;
  border: 1px solid var(--control-border);
  border-radius: 3px;
  color: var(--ink);
  background: var(--paper);
  caret-color: var(--link);
}
input::placeholder { color: var(--muted); opacity: 1; }
input:disabled { background: #e8ece3; border-color: var(--rule); }
.search { width: min(100%, 15rem); flex: none; }
.search input { width: 100%; font-size: .8125rem; font-weight: 400; }

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .875rem;
  line-height: 1.5;
  text-align: left;
}
th {
  background: #e8ece3;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}
td, th {
  padding: .625rem clamp(.5rem, 1.6vw, 1.125rem);
  border-block-end: 1px solid var(--rule);
}
td { padding-block: .875rem; vertical-align: top; }
tbody tr { background: var(--paper); }
tbody tr:hover, tbody tr:focus-within { background: #edf3e8; }
.severity-cell { width: 6rem; }
.state-cell { width: 8rem; }
.received-cell { width: 12rem; }
.received-cell time, .received-narrow, .history-time {
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.received-narrow { display: none; }
.incident-link {
  padding: 0;
  border: 0;
  color: var(--link);
  background: transparent;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
}
.incident-link:hover { text-decoration: underline; text-underline-offset: .22em; }
.service-label {
  display: block;
  margin-block-start: .1875rem;
  color: var(--muted);
  font-size: .75rem;
  overflow-wrap: anywhere;
}
.state-label { color: var(--muted); font-size: .75rem; font-weight: 600; }
.state-label[data-value^="P"] { font-variant-numeric: tabular-nums; font-weight: 750; }
.state-label[data-value="P1"] { color: var(--red); }
.state-label[data-value="triggered"] { color: var(--ink); font-weight: 750; }

.empty { padding: 2rem clamp(0px, 1vw, .75rem); border-block-end: 1px solid var(--rule); }
.empty h2 { font-size: .9375rem; }
.empty p { margin: .375rem 0 0; color: var(--muted); font-size: .8125rem; }
.empty .button { margin-block-start: 1rem; }
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding-block-start: .75rem;
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

dialog {
  width: min(28rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 24px;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop { background: #171d2c76; }
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-block-end: 1rem;
}
label { font-size: .8125rem; font-weight: 650; }
#token { display: block; width: 100%; margin-block-start: .4375rem; }
.hint { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-block-start: 1.25rem; }
.inline-message { margin: 0; border-block-end: 1px solid #e0c4c5; padding: .625rem 0; color: var(--red); font-size: .8125rem; }
.drawer {
  width: min(36rem, 100%);
  max-width: 100%;
  max-height: 100dvh;
  height: 100%;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
  overflow-y: auto;
}
.drawer .dialog-header {
  padding-block-end: .625rem;
  border-block-end: 1px solid var(--rule);
}
.drawer .dialog-header h2 { font-size: .8125rem; color: var(--muted); }
.detail-summary {
  margin: .375rem 0 .75rem;
  font-size: 1.375rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: .125rem .875rem; align-items: baseline; }
.detail-meta .service-label { margin: 0; }
.detail-notice { margin: 0 0 .875rem; padding-block-end: .625rem; border-block-end: 1px solid var(--rule); font-size: .8125rem; }
.detail-section { margin-block-start: 1.5rem; padding-block-start: .875rem; border-block-start: 1px solid var(--rule); }
.detail-section h3 { margin: 0; font-size: .875rem; }
.detail-section p { margin: .5rem 0 0; font-size: .8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-section ul { margin: .375rem 0 0; padding: 0; list-style: none; }
.detail-section li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .125rem .75rem;
  padding-block: .625rem;
  border-block-end: 1px solid var(--rule);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.detail-action { margin-block-start: 1rem; }

@media (max-width: 42rem) {
  .list-toolbar { align-items: stretch; flex-direction: column; padding-block-end: .625rem; }
  .search { width: min(100%, 20rem); }
  .received-cell { width: 9rem; }
  .state-cell { width: 7rem; }
  .severity-cell { width: 4.375rem; }
}
@media (max-width: 34rem) {
  dialog { padding: 16px; }
  .received-cell { display: none; }
  .received-narrow { display: block; margin-block-start: .25rem; }
  .state-cell { width: 5.4375rem; }
  .severity-cell { width: 3.25rem; }
  .table-wrap .state-label { overflow-wrap: anywhere; }
}
@media (max-width: 24rem) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 0; }
  .metric:nth-child(3) { padding-inline-start: 0; border-inline-start: 0; }
  .filters { column-gap: .625rem; }
}
