:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #64716b;
  --line: #d5dcd8;
  --surface: #ffffff;
  --wash: #f3f6f4;
  --green: #087f5b;
  --green-dark: #065f46;
  --blue: #1769aa;
  --red: #b42318;
  --amber: #98620b;
  --shadow: 0 12px 36px rgba(23, 33, 29, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--wash);
  background-image: linear-gradient(rgba(23, 33, 29, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 33, 29, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; letter-spacing: 0; }
button { min-height: 40px; border: 1px solid var(--green); border-radius: 5px; padding: 0 16px; color: white; background: var(--green); font-weight: 600; cursor: pointer; }
button:hover { background: var(--green-dark); }
button:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
button.secondary:hover, button.quiet:hover { background: #e8eeeb; }
button.quiet { color: var(--muted); background: transparent; border-color: transparent; }
button.danger { color: var(--red); background: transparent; border-color: transparent; padding-inline: 8px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
button:disabled:hover { background: var(--green); }
button.secondary:disabled:hover { background: var(--surface); }
button.quiet:disabled:hover, button.danger:disabled:hover { background: transparent; }
input { width: 100%; min-height: 42px; border: 1px solid #aeb9b3; border-radius: 5px; padding: 8px 10px; color: var(--ink); background: white; }
label, legend { color: #394740; font-size: 0.875rem; font-weight: 500; }
label > input { display: block; margin-top: 6px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.55rem; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 1.15rem; line-height: 1.3; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; text-transform: uppercase; }
.label { display: block; color: var(--muted); font-size: 0.75rem; }
.muted { color: var(--muted); }
.error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 0.85rem; }
.error:empty { display: none; }
.error, td, .detail-list dd { overflow-wrap: anywhere; }
[aria-invalid="true"] { border-color: var(--red); }
.skip-link { position: absolute; z-index: 10; left: 16px; top: -80px; padding: 12px; background: var(--surface); color: var(--ink); }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 480px); padding: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.login-panel h1 { margin: 16px 0 28px; }
.login-panel > button { width: 100%; margin-top: 20px; }
#sign-in { min-width: 0; margin-top: 24px; }
#user-button { min-width: 32px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 4px; color: white; background: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 0.82rem; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.status-pill { min-width: 80px; min-height: 30px; display: inline-grid; place-items: center; padding: 4px 10px; border-radius: 999px; color: var(--green-dark); background: #dff3ea; font-size: 0.78rem; font-weight: 600; }
.workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto 64px; background: var(--surface); box-shadow: var(--shadow); }
.status-strip { min-height: 74px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #edf4f0; }
.status-strip p { margin: 8px 0 0; line-height: 1.5; font-size: 0.875rem; }
.notice-area { padding: 0 24px; }
.notice-area > p:not(:empty) { margin-block: 16px; }
.notice { padding: 12px 16px; border-left: 3px solid var(--amber); background: #fff8e8; font-size: 0.875rem; line-height: 1.5; }
.notice:empty, [role="status"]:empty { display: none; }
.mode-nav { display: flex; gap: 8px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.mode-nav [aria-pressed="true"] { border-color: var(--green); color: var(--green-dark); background: #dff3ea; }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border: 2px solid var(--blue); background: #edf6ff; }
.support-banner p { margin: 8px 0 0; }
.help { font-size: 0.8rem; line-height: 1.5; margin-bottom: 0; }
.spaced { margin-block: 16px; }
.section-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 30px 24px; border-bottom: 1px solid var(--line); }
.section-content { min-width: 0; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.device-form { margin-top: 24px; }
fieldset { padding: 0; border: 0; margin: 0; }
.device-list { display: flex; flex-wrap: wrap; gap: 10px; min-height: 42px; margin: 8px 0 12px; }
.device-option { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--wash); }
.device-option input { width: 16px; min-height: 16px; margin: 0; }
.watch-form { display: grid; gap: 18px; }
.checkbox-option { display: flex; align-items: center; gap: 10px; }
.checkbox-option input { display: inline-block; width: 18px; min-height: 18px; margin: 0; flex: 0 0 18px; }
.segmented { display: flex; gap: 0; }
.segmented legend { margin-bottom: 7px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-width: 116px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); background: white; }
.segmented label:first-of-type span { border-radius: 5px 0 0 5px; }
.segmented label:last-of-type span { border-radius: 0 5px 5px 0; border-left: 0; }
.segmented input:checked + span { color: white; border-color: var(--ink); background: var(--ink); }
.segmented input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }
.form-actions { display: flex; gap: 8px; }
.data-section { padding: 30px 24px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.watch-heading-meta { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.next-check-block { text-align: right; }
.next-check-block time { display: block; color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; white-space: nowrap; }
.count { display: grid; place-items: center; min-width: 32px; min-height: 28px; padding: 6px 10px; border-radius: 4px; color: white; background: var(--blue); font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { padding: 10px 8px; color: var(--muted); border-bottom: 1px solid #aeb9b3; font-size: 0.72rem; text-align: left; text-transform: uppercase; }
td { padding: 14px 8px; border-bottom: 1px solid #e5eae7; vertical-align: top; }
td:first-child { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.cell-note { display: block; margin-top: 5px; font-size: 0.76rem; line-height: 1.35; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 2px; min-width: 180px; }
.row-actions button { text-align: left; }
.row-actions button[data-action="test"] { min-width: 88px; }
.state-ok { color: var(--green-dark); }
.state-error { color: var(--red); }
.state-critical { color: var(--red); font-weight: 600; }
.state-paused { color: var(--amber); }
.empty-state { margin: 18px 0 0; padding: 24px 8px; color: var(--muted); text-align: center; }
.detail-list { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; gap: 10px 20px; font-size: 0.875rem; }
.detail-list dt { color: var(--muted); text-transform: capitalize; }
.detail-list dd { margin: 0; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 12px 16px; border-radius: 5px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 160ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .workspace { width: 100%; margin-top: 0; }
  .status-strip { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; gap: 20px; }
  .inline-form, .date-fields { grid-template-columns: 1fr; }
  .inline-form button { width: 100%; }
  .section-heading { flex-wrap: wrap; }
  .watch-heading-meta { width: 100%; justify-content: space-between; margin-left: 0; }
  .next-check-block { text-align: left; }
  .table-wrap { margin-inline: -12px; width: calc(100% + 24px); }
  th, td { min-width: 112px; }
  .support-banner { align-items: flex-start; flex-direction: column; }
  .detail-list { grid-template-columns: 1fr; gap: 5px; }
  .detail-list dd { margin-bottom: 12px; }
  .login-panel { padding: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}