
:root {
  --bg: #F2F3F6;
  --surface: #FFFFFF;
  --surface-2: #E9EBF0;
  --line: #DBDEE6;
  --line-strong: #C3C8D4;
  --ink: #171A22;
  --ink-2: #565C6B;
  --ink-3: #838A99;
  --accent: #B4661A;
  --accent-ink: #FFFFFF;
  --pass: #2C7A64;
  --pass-soft: #E3F0EB;
  --fail: #B23A26;
  --fail-soft: #F7E4E0;
  --warn: #8A6A15;
  --warn-soft: #F5EDD8;
  --idle: #9AA1AF;
  --shadow: 0 1px 2px rgba(23,26,34,.05), 0 6px 20px -12px rgba(23,26,34,.16);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101319;
    --surface: #171B23;
    --surface-2: #1E232D;
    --line: #262C38;
    --line-strong: #39414F;
    --ink: #EDEFF4;
    --ink-2: #A8AFBE;
    --ink-3: #767E8E;
    --accent: #E8A24A;
    --accent-ink: #17110A;
    --pass: #4FB495;
    --pass-soft: #16302A;
    --fail: #E0705A;
    --fail-soft: #331915;
    --warn: #D6B24E;
    --warn-soft: #302713;
    --idle: #4A5361;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.7);
  }
}

:root[data-theme="dark"] {
  --bg: #101319;
  --surface: #171B23;
  --surface-2: #1E232D;
  --line: #262C38;
  --line-strong: #39414F;
  --ink: #EDEFF4;
  --ink-2: #A8AFBE;
  --ink-3: #767E8E;
  --accent: #E8A24A;
  --accent-ink: #17110A;
  --pass: #4FB495;
  --pass-soft: #16302A;
  --fail: #E0705A;
  --fail-soft: #331915;
  --warn: #D6B24E;
  --warn-soft: #302713;
  --idle: #4A5361;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- top bar */

header.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}

.top .wrap { display: flex; align-items: center; gap: 26px; height: 58px; }

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }

nav.top-nav { display: flex; gap: 20px; font-size: .9rem; }
nav.top-nav a { color: var(--ink-2); }
nav.top-nav a.on { color: var(--ink); font-weight: 600; }
.spacer { margin-left: auto; }

.tick {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ type */

h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 30px 0 4px;
  text-wrap: balance;
}

h2 {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 34px 0 12px;
}

.sub { color: var(--ink-2); font-size: .92rem; margin: 0 0 22px; }

.label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

/* ----------------------------------------------------------- stat tiles */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 0; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px 16px;
}

.tile .label { display: block; margin-bottom: 7px; }

.tile .fig {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tile.alarm { border-color: var(--fail); }
.tile.alarm .fig { color: var(--fail); }

/* -------------------------------------------------------------- monitors */

.rows {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
  display: grid;
  gap: 1px;
}

.row {
  background: var(--surface);
  display: grid;
  grid-template-columns: 3px 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 0;
}

.row .stripe { align-self: stretch; background: var(--idle); }
.row.is-pass .stripe { background: var(--pass); }
.row.is-fail .stripe { background: var(--fail); }
.row.is-warn .stripe { background: var(--warn); }
.row.is-off .stripe { background: var(--line-strong); }

.row .body { padding: 15px 0; min-width: 0; }
.row .name { font-weight: 600; color: var(--ink); display: block; margin-bottom: 3px; }
.row .name:hover { color: var(--accent); text-decoration: none; }
.row .meta { font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }
.row .hist { padding: 15px 0; }
.row .right { padding: 15px 18px 15px 0; text-align: right; display: grid; gap: 5px; justify-items: end; }

/* history strip: one bar per run, oldest left */
.hist { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.hist span {
  width: 4px;
  border-radius: 1px;
  background: var(--pass);
  opacity: .85;
}
.hist span.f { background: var(--fail); opacity: 1; }
.hist .empty { width: auto; white-space: nowrap; color: var(--ink-3); font-size: .78rem; font-family: var(--mono); align-self: center; }

/* ------------------------------------------------------------------ pill */

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.pill.pass { color: var(--pass); border-color: var(--pass); background: var(--pass-soft); }
.pill.fail { color: var(--fail); border-color: var(--fail); background: var(--fail-soft); }
.pill.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.pill.idle { color: var(--ink-3); border-color: var(--line-strong); }
.pill.open { color: var(--fail); border-color: var(--fail); background: var(--fail-soft); }

/* ------------------------------------------------------------------ card */

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

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-2);
}

.card-head b { color: var(--ink); font-weight: 600; }

.banner {
  border: 1px solid var(--fail);
  background: var(--fail-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 20px 0 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.banner .label { color: var(--fail); }
.banner .what { font-weight: 600; }

/* ------------------------------------------------------------- step list */

ol.steps { list-style: none; margin: 0; padding: 6px 0; }

.step {
  display: grid;
  grid-template-columns: 26px 16px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-3);
  border-left: 3px solid transparent;
}

.step .n { font-size: .72rem; font-variant-numeric: tabular-nums; }
.step .desc { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .ms { font-size: .74rem; font-variant-numeric: tabular-nums; }

.step .mark {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: .58rem; line-height: 1; color: transparent;
}

.step.passed { color: var(--ink-2); }
.step.passed .mark { border-color: var(--pass); background: var(--pass); color: var(--surface); }
.step.failed { color: var(--fail); background: var(--fail-soft); border-left-color: var(--fail); }
.step.failed .mark { border-color: var(--fail); background: var(--fail); color: var(--surface); }
.step.skipped { opacity: .5; }

.errbox {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: var(--fail-soft);
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--fail);
  word-break: break-word;
}

/* ----------------------------------------------------------------- table */

.tbl-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .87rem; }

th {
  text-align: left;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.wrap-any { word-break: break-word; max-width: 380px; }

/* ------------------------------------------------------------ screenshots */

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 14px 0 0; }

.shot { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.shot.is-fail { border-color: var(--fail); }
.shot img { display: block; width: 100%; height: auto; background: var(--surface-2); }
.shot figcaption {
  padding: 8px 11px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 10px;
}
/* The step number must never be squeezed out by a long selector. */
.shot figcaption span:first-child { flex: 0 0 auto; }
.shot figcaption span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot.is-fail figcaption { color: var(--fail); }

/* ----------------------------------------------------------------- login */

.login { min-height: 78vh; display: grid; place-items: center; }
.login form { width: 100%; max-width: 330px; display: grid; gap: 11px; }
.login h1 { margin: 0 0 4px; }
.sub.center { text-align: center; margin: 2px 0 0; }
.sub.center a { color: var(--accent); }
.btn.google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  text-decoration: none; font-family: var(--ui); font-weight: 600;
}
.btn.google:hover { filter: none; background: var(--surface-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .78rem; margin: 2px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signout { margin-left: 16px; font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }
.signout:hover { color: var(--ink); }
.banner.warn .label { color: var(--warn); }
.banner-cta { margin-left: auto; color: var(--accent); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.banner-cta:hover { text-decoration: underline; }
.ok-note { color: var(--pass); font-size: .87rem; }

/* account subscription detail */
.acct-grid { display: flex; flex-wrap: wrap; gap: 30px; padding: 14px 16px 4px; }
.acct-cell .label { display: block; margin-bottom: 4px; }
.acct-val { font-size: 1.05rem; color: var(--ink); }
.acct-val b { font-size: 1.2rem; }

/* run filter tabs + pagination */
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tabs a { font-size: .82rem; padding: 5px 12px; border-radius: 7px; color: var(--ink-2); border: 1px solid var(--line); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pager .btn.small { padding: 6px 12px; }

/* password strength meter */
.pwbar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pwbar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }
.pwlbl { font-size: .74rem; font-family: var(--mono); }

/* subscription plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 22px 20px; display: grid; gap: 14px; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -10px; left: 20px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }
.plan-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0; }
.plan-price { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.plan-price span { font-family: var(--ui); font-weight: 500; font-size: .9rem; color: var(--ink-3); margin-left: 3px; }
.plan-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.plan-feats li { font-size: .88rem; color: var(--ink-2); padding-left: 22px; position: relative; }
.plan-feats li::before { content: "\2713"; position: absolute; left: 0; color: var(--pass); font-weight: 700; }
.plan form { margin-top: 4px; }
.plan .btn { width: 100%; text-align: center; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

/* landing hero */
.hero { max-width: 640px; margin: 6vh auto 0; text-align: center; }
.hero-h1 { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1.1; margin: 0 0 16px; }
.hero-sub { color: var(--ink-2); font-size: 1.05rem; line-height: 1.55; margin: 0 auto 26px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 40px; }
.hero-points { list-style: none; padding: 0; margin: 0 auto; max-width: 470px; text-align: left; display: grid; gap: 13px; }
.hero-points li { color: var(--ink-2); font-size: .95rem; padding-left: 25px; position: relative; }
.hero-points li::before { content: "\2713"; position: absolute; left: 0; color: var(--pass); font-weight: 700; }
.hero-points b { color: var(--ink); }

input[type=password] {
  font-family: var(--ui);
  font-size: .95rem;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

button.btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button.btn:hover { filter: brightness(1.07); }

.err-note { color: var(--fail); font-size: .87rem; }

/* -------------------------------------------------------- add-monitor form */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; }

.form { max-width: 620px; display: grid; gap: 18px; margin-top: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field .opt { color: var(--ink-3); font-weight: 400; }
.field .hint { font-size: .78rem; color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

input[type=text], input[type=number], input[type=email], textarea {
  font-family: var(--ui);
  font-size: .95rem;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
textarea { font-family: var(--mono); font-size: .88rem; resize: vertical; }

.btn-row { display: flex; gap: 10px; align-items: center; }

a.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
a.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn.small { padding: 7px 13px; font-size: .85rem; }

.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--ink-2); }
.check input { width: auto; }

textarea.code { font-family: var(--mono); font-size: .82rem; white-space: pre; line-height: 1.5; }

.danger {
  max-width: 620px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn.danger-btn { background: transparent; color: var(--fail); border-color: var(--fail); }
.btn.danger-btn:hover { background: var(--fail-soft); filter: none; }

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

/* ------------------------------------------------------------------ misc */

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-3);
  margin-top: 14px;
}

footer.foot {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  padding: 18px 0 40px;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-3);
}

.back { font-size: .85rem; color: var(--ink-3); display: inline-block; margin-top: 26px; }
