:root {
  color-scheme: light;
  --surface: #f3f6f7;
  --paper: #fff;
  --ink: #192833;
  --muted: #526471;
  --line: #cfdbdf;
  --rail: #142c38;
  --rail-ink: #e7f2f4;
  --accent: #005d55;
  --accent-ink: #fff;
  --tint: #e2f3ed;
  --alert: #994132;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #122129;
  --paper: #1a2c35;
  --ink: #e7f2f4;
  --muted: #a8bbc3;
  --line: #39505a;
  --rail: #101e25;
  --accent: #8de0c5;
  --accent-ink: #112929;
  --tint: #265249;
  --alert: #ffb4a3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --surface: #122129;
    --paper: #1a2c35;
    --ink: #e7f2f4;
    --muted: #a8bbc3;
    --line: #39505a;
    --rail: #101e25;
    --accent: #8de0c5;
    --accent-ink: #112929;
    --tint: #265249;
    --alert: #ffb4a3;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--ink); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, input, select, textarea {
  padding: .58rem .8rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #bc7026; outline-offset: 3px; }
.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 650; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 2; padding: .6rem; background: var(--paper); }
.skip:focus { top: 1rem; }
.brand { color: inherit; text-decoration: none; white-space: nowrap; font-size: 1.06rem; letter-spacing: -.02em; }
.brand b { margin-right: .4rem; font-weight: 800; }
.sign-in { width: min(420px, calc(100% - 2rem)); margin: 12vh auto 3rem; border-top: 4px solid var(--accent); background: var(--paper); padding: 2rem; }
.sign-in .brand { color: var(--accent); }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; align-items: stretch; gap: 2rem; background: var(--rail); color: var(--rail-ink); padding: 1.55rem 1.05rem; }
.sidebar .brand { padding-left: .65rem; }
.sidebar nav { display: grid; gap: .3rem; }
.sidebar nav a { color: inherit; text-decoration: none; padding: .6rem .7rem; border-radius: 5px; }
.sidebar nav a:hover, .sidebar nav [aria-current="page"] { background: #284955; }
.sidebar nav [aria-current="page"] { box-shadow: inset 3px 0 #8de0c5; }
.account { display: grid; gap: .6rem; margin-top: auto; padding: .65rem; overflow-wrap: anywhere; }
.account button { color: inherit; background: transparent; border-color: #78919a; justify-self: start; }
main { width: min(100%, 1320px); padding: clamp(1rem, 3.6vw, 3.25rem); }
.page-header { display: flex; justify-content: space-between; gap: .65rem; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; }
h1, h2, h3, p { margin: 0 0 .75rem; }
h1 { font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.page-header h1 { margin: 0; }
.build-version { margin: .3rem 0 0; overflow-wrap: anywhere; }
h2 { font-size: 1.18rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
#notice:empty, #login-error:empty { display: none; }
#notice { margin: 1rem 0; }
#login-error { color: var(--alert); }
#view { padding-top: 1.35rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1rem 0 1.25rem; margin-bottom: 1.5rem; border-block: 1px solid var(--line); }
.metric { padding: 0 .85rem; border-right: 1px solid var(--line); }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font-size: clamp(1.55rem, 3.3vw, 2.75rem); line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.metric span, .subtle { color: var(--muted); font-size: .9rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 1.2rem; margin-bottom: 1.4rem; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.chart li { display: grid; grid-template-rows: auto 6.5rem auto; justify-items: center; gap: .35rem; font-variant-numeric: tabular-nums; }
.chart meter { writing-mode: vertical-lr; direction: rtl; height: 100%; width: min(1.5rem, 76%); accent-color: var(--accent); }
.chart meter::-webkit-meter-bar { background: var(--tint); border: 0; border-radius: 3px; }
.chart meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 3px; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: .95rem; }
th, td { padding: .68rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--tint); }
tr:last-child td { border-bottom: 0; }
td, dd { overflow-wrap: anywhere; }
td:nth-child(1) { min-width: 10rem; }
form, label { display: grid; gap: .65rem; }
form { gap: 1rem; }
label { gap: .28rem; }
form > button { justify-self: start; }
textarea { resize: vertical; min-height: 5rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters label { flex: 0 1 auto; }
.filters input, .filters select { max-width: 100%; }
.actions { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.form-panel { max-width: 780px; }
dl { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 3fr); gap: .35rem .8rem; }
dt { color: var(--muted); }
dd { margin: 0; white-space: pre-wrap; }
details { border-top: 1px solid var(--line); padding: .55rem 0; }
summary { cursor: pointer; }
code { font-family: "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { gap: .65rem; padding: .75rem 1rem; }
  .sidebar .brand { padding: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: .4rem .6rem; }
  .account { display: flex; align-items: center; justify-content: space-between; padding: 0; }
  .account button { padding: .3rem .55rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 0; }
  .metric { padding: 0 .45rem; }
  .metric:nth-child(odd) { padding-left: 0; }
  .metric:nth-child(even) { border-right: 0; }
}
@media (max-width: 760px) { .table-scroll table { min-width: 36rem; } }
