/* Blackoutly Console — layout; colours come from /theme.css (the program's themes, palette.py) */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; src: url("/fonts/IBMPlexSans-Regular.ttf"); font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; src: url("/fonts/IBMPlexSans-Medium.ttf"); font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; src: url("/fonts/IBMPlexSans-SemiBold.ttf"); font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 "IBM Plex Sans", "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  background: var(--window); color: var(--text);
}
a { color: var(--accent); }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--surface); padding: 6px 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.app { display: flex; min-height: 100vh; }
.rail {
  width: 76px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
}
.logo {
  width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 700; font-size: 20px; margin-bottom: 12px;
}
.rail-item {
  width: 64px; padding: 8px 2px; border-radius: 8px; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-align: center;
}
.rail-item:hover { background: var(--surface-alt); color: var(--text); }
.rail-item.active { background: var(--accent-soft); color: var(--text); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; font-size: 15px; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account { color: var(--muted); font-size: 12.5px; }
main { padding: 24px; flex: 1; max-width: 1200px; width: 100%; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
h2.sub { margin-top: 18px; }
footer { padding: 12px 24px; border-top: 1px solid var(--border); }
.lead { max-width: 760px; margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.card.narrow { max-width: 680px; }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.big { font-size: 32px; font-weight: 600; margin: 0; }
.more { display: inline-block; margin-top: 12px; text-decoration: none; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

.status { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; border-left: 4px solid var(--muted); background: var(--surface-alt); }
.status.ok { border-color: var(--success); }
.status.warn { border-color: var(--warning); }
.status.bad { border-color: var(--danger); background: var(--danger-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--success); }
.dot.bad { background: var(--danger); }
.dot.warn { background: var(--warning); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 12px; margin: 1px 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-alt); }
.row-bad td { background: var(--danger-soft); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.bar { width: 100px; height: 8px; flex: none; }
.bar .track { fill: var(--track); }
.bar .fill { fill: var(--accent); }

.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
select, button, .button {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 6px 12px; min-height: 32px;
}
button, .button { cursor: pointer; background: var(--primary); color: var(--on-primary); border-color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .button:hover { background: var(--primary-hover); }
button.ghost, .button.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
button.ghost:hover, .button.ghost:hover { background: var(--surface-alt); }
button .icon { width: 16px; height: 16px; }
input, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 6px 10px; min-height: 32px; width: 100%;
}
textarea { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
form.stack { display: grid; gap: 12px; max-width: 560px; margin-top: 12px; }
form.stack label, .filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
form.stack button { justify-self: start; }
.filters input[type=search] { min-width: 260px; }
.tag.over { border-color: var(--danger); background: var(--danger-soft); }
tr.muted td { color: var(--muted); }
fieldset.choices { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; margin: 0; }
fieldset.choices legend { color: var(--muted); font-size: 12.5px; padding: 0 4px; }
fieldset.choices label { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 13px; }
fieldset.choices input { width: auto; min-height: 0; margin-top: 3px; }
form.inline { display: inline-flex; margin: 0; }
.segmented { border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 30px; padding: 4px 10px; }
.segmented button.on { background: var(--primary); color: var(--on-primary); }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .rail { width: auto; flex-direction: row; justify-content: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px; }
  .logo { margin: 0 8px 0 0; }
  main { padding: 16px; }
  table { display: block; overflow-x: auto; }
}
@media print {
  .rail, .top-right, .filters { display: none; }
  body { background: #fff; color: #000; }
}
form.limit input[type=number] { width: 80px; min-height: 28px; padding: 2px 6px; }
form.limit { gap: 6px; align-items: center; }
code.select { user-select: all; word-break: break-all; }
ol.steps { padding-left: 20px; display: grid; gap: 8px; }
