:root {
  color-scheme: light;
  --paper: #f8f7f3;
  --ink: #252620;
  --muted: #65675e;
  --border: #ddded5;
  --green: #386150;
  --warn: #8b542c;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 system-ui, sans-serif;
}
main { width: min(100% - 3rem, 640px); margin: clamp(2rem, 10vh, 7rem) auto 4rem; }
.masthead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; }
h1 { font: 500 clamp(3.8rem, 11vw, 6rem)/.95 Georgia, serif; letter-spacing: -.075em; margin: 0; }
main > details { border-top: 1px solid var(--border); }
main > details:last-of-type { border-bottom: 1px solid var(--border); }
summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .95rem 0;
  font-weight: 650;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--green); font: 1rem var(--mono); }
details[open] > summary::before { content: "−"; }
.meta, footer, .metric dt { font: .74rem/1.5 var(--mono); color: var(--muted); }
.online { color: var(--green); }
.online::before { content: "●"; margin-right: .45em; }
.stale { color: var(--warn); }
.body { padding: .15rem 0 1.15rem 1.53rem; }
.server-line { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .9rem; margin-top: .8rem; }
.metric { margin: 0; min-width: 0; }
.metric dd { margin: .15rem 0 .3rem; }
.metric dd strong { display: block; font: 1.25rem/1.2 var(--mono); }
.metric small { font-size: .73rem; color: var(--muted); }
meter { width: 100%; height: .38rem; display: block; appearance: none; }
meter::-webkit-meter-bar { border: 0; background: #e5e6dd; }
meter::-webkit-meter-optimum-value { background: #719184; }
meter::-moz-meter-bar { background: #719184; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li {
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  padding: .38rem 0; overflow-wrap: anywhere;
}
.rows li + li { border-top: 1px solid var(--border); }
.rows .meta { flex-shrink: 0; }
a { color: inherit; text-decoration-color: #a7b4a9; text-underline-offset: .22em; }
a:hover { color: var(--green); }
p { margin: .2rem 0; }
.empty { color: var(--muted); }
.bookmark-form { margin-top: .35rem; }
.bookmark-form summary { display: inline-grid; grid-template-columns: 14px auto; padding: .4rem 0; color: var(--green); font-size: .85rem; }
form { margin: 0; }
.bookmark-form form, .login form { display: grid; gap: .6rem; max-width: 340px; }
label { display: grid; gap: .25rem; }
input { width: 100%; padding: .55rem; border: 1px solid var(--border); border-radius: .2rem; font: inherit; color: inherit; background: #fff; }
button { font: inherit; cursor: pointer; color: var(--paper); background: var(--green); border: 0; border-radius: .25rem; padding: .45rem .75rem; justify-self: start; }
button.quiet { padding: 0; background: none; color: var(--muted); font-size: .78rem; text-decoration: underline; text-underline-offset: .2em; }
button:hover { filter: brightness(.8); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
footer { margin-top: 1.1rem; }
.login h1 { margin-bottom: 2rem; }
.login p { color: var(--warn); margin-top: .75rem; }
@media (max-width: 400px) {
  main { width: calc(100% - 2rem); }
  .body { padding-left: 0; }
  .metrics { gap: .5rem; }
}

#automations { margin-top: 1rem; }
#automations h2 { margin: 0 0 .25rem; font-size: .83rem; }
@media (max-width: 500px) { #automation-list li { flex-wrap: wrap; } }

.history { margin-top: 1.35rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.history-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem .7rem; }
.history-heading h2 { font-size: .83rem; margin: 0; }
.history-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: .5rem; }
.history-charts figure { margin: 0; min-width: 0; }
.history-charts figcaption { color: var(--muted); font: .74rem/1.5 var(--mono); margin-bottom: .15rem; }
.history-charts canvas { display: block; width: 100%; height: 54px; }
.history-axis { margin-top: .25rem; display: flex; justify-content: space-between; }
@media (max-width: 400px) { .history-charts { gap: .5rem; } }
