/*
  The feed's pages in the manner of Tabler (tabler.io), the open-source admin kit: its vertical
  layout for the admin, a soft grey page, white bordered cards, small uppercase headings over tables
  and figures, tinted badges and outlined buttons. Light only, and Tabler's own colours rather than
  Beacon's: this is a tool for whoever runs the feed, not a piece of the product. Written here
  rather than loaded, because the feed is one PC on a LAN and must look right with no way out to a
  CDN. The variable names are the ones the pages already used, so home.css follows unchanged.
*/
:root {
  --window: #f6f8fb;
  --panel: #ffffff;
  --control: #f4f6fa;
  --control-hover: #eaeef4;
  --line: #e6e7e9;
  --line-strong: #d9dbde;
  --text: #1d273b;
  --muted: #626976;
  --faint: #929dab;
  --accent: #066fd1;
  --accent-hover: #0562bb;
  --accent-text: #066fd1;
  --accent-soft: #e6f1fb;
  --danger: #d63939;
  --danger-soft: #fbebeb;
  --warning: #b35f00;
  --warning-soft: #fef1e0;
  --success: #2fb344;
  --routed-soft: #e5f6e8;
  --routed-text: #1d7a2e;
  --navbar: #ffffff;
  --sidebar-width: 248px;
  --shadow: 0 1px 2px rgba(29, 39, 59, .04), 0 2px 6px rgba(29, 39, 59, .04);
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* Anything this sheet gives a display of its own would otherwise ignore the hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--window);
  color: var(--text);
  font: 14px/1.45 Inter, -apple-system, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, .mono { font-family: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12.5px; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin: 0; }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.error { color: var(--danger); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------------------------------------------------------------- the two bars across the top */

.navbar { background: var(--navbar); border-bottom: 1px solid var(--line); }
.navbar-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.mark { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.mark circle { fill: var(--accent); stroke: none; }

/* The home page's one link still sits in a bar (home.css). */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; align-items: stretch; }
.tabs .nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-weight: 500; padding: 8px 12px; text-decoration: none;
}
.tabs .nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tabs .nav-link:hover { color: var(--text); }

/* ---------------------------------------------------------------- the admin's sidebar */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 6;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 20px;
  font-weight: 700; font-size: 16px; letter-spacing: -.01em;
  border-bottom: 1px solid var(--line);
}
.sidebar-label {
  padding: 20px 20px 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.side-nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  border: 0; border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit; font-weight: 500; text-align: left;
  padding: 9px 12px;
  cursor: pointer;
  position: relative;
}
.side-nav button svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.side-nav button:hover { background: var(--control); color: var(--text); }
.side-nav button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side-nav button[aria-selected="true"]::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sidebar-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); }
.sidebar-foot .window { margin-left: 0; }

body.with-sidebar .page { margin-left: var(--sidebar-width); }
body.with-sidebar main { max-width: 1240px; }

/* The publish window, as a Tabler status badge with its dot. */
.window {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
}
.window::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.window.open { background: var(--routed-soft); color: var(--routed-text); }
.window.closed { background: var(--warning-soft); color: var(--warning); }

/* ---------------------------------------------------------------- page */

main { padding-top: 4px; padding-bottom: 40px; }
.page-header { padding: 22px 0 18px; }
.pretitle { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.view > * + * { margin-top: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
/* A card's first heading reads as Tabler's card header: a title over a rule. */
.card > h2:first-child, .card > .card-head:first-child {
  margin: -18px -20px 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.card.empty, .card.error { box-shadow: none; }
.card.error { border-color: var(--danger); background: var(--danger-soft); }

/* Figures along the top, as Tabler's small cards: an uppercase subheader over a large number. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 3px solid var(--accent);
}
.tile .label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -.01em; }
.tile .sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; }

/* Badges, Tabler's "-lt" kind: a tint with the colour in the word. */
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--control);
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .01em;
}
.pill.live { background: var(--routed-soft); color: var(--routed-text); }
.pill.staged { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(24, 36, 51, .05);
  transition: background .12s, border-color .12s, color .12s;
}
.button:hover { background: var(--control); text-decoration: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.danger { color: var(--danger); border-color: var(--line-strong); }
.button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.button:disabled { opacity: .5; cursor: default; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- releases */

.versions { margin-top: 4px; }
.version { padding: 12px 0; border-bottom: 1px solid var(--line); }
.version:last-child { border-bottom: 0; padding-bottom: 0; }
.version-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-row .number { font-weight: 600; font-size: 15px; min-width: 70px; }
.version-row .date { color: var(--faint); font-size: 12.5px; }
.version-row .spacer { flex: 1; }

.downloads { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
}
.download:hover { background: var(--control); border-color: var(--line-strong); text-decoration: none; }
.download svg { width: 14px; height: 14px; stroke: var(--accent-text); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.download .size { color: var(--faint); }

details.notes { margin-top: 8px; }
details.notes summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.notes summary:hover { color: var(--accent-text); }
.notes-body { margin: 8px 0 0 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.notes-body h4 { margin: 12px 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.note { margin: 6px 0; }
.note .title { font-weight: 600; }
.note ul { margin: 2px 0 0; padding-left: 20px; color: var(--muted); }
.applause { color: var(--warning); margin: 6px 0; }

.show-older { margin-top: 12px; }

.get-beacon { padding: 22px 24px; border-left: 3px solid var(--accent); }
.get-beacon h2 { font-size: 20px; }
.get-beacon p { margin: 6px 0 0; }
.get-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.get-head > div { flex: 1 1 320px; }
.button.big { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 15px; font-weight: 600; text-decoration: none; }
.button.big svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button.big .size { font-weight: 400; opacity: .85; font-size: 13px; }
.other-installers { margin: 10px 0 0; padding-left: 20px; font-size: 13px; }
.other-installers li { margin: 3px 0; }

details.packs > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
details.packs > summary::-webkit-details-marker { display: none; }
details.packs > summary::before { content: "\25B8"; display: inline-block; color: var(--muted); transition: transform .15s; }
details.packs[open] > summary::before { transform: rotate(90deg); }
details.packs > summary:hover h2 { color: var(--accent-text); }
.pack-list { margin-top: 12px; border-top: 1px solid var(--line); }
.pack { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pack:last-child { border-bottom: 0; padding-bottom: 0; }
.pack .versions { margin-top: 2px; border-top: 0; }
.pack .version { padding: 4px 0; border-bottom: 0; }
.pack .downloads { margin-top: 4px; }

/* ---------------------------------------------------------------- tables, bars, feedback */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--control);
  white-space: nowrap;
}
tbody tr:hover td { background: var(--control); }
tr:last-child td { border-bottom: 0; }
tr.offline td { color: var(--faint); }
/* A first column is a time or a name: wrapping it put "Nov 1, 11:49 AM" on three lines. */
td:first-child { white-space: nowrap; }

.bars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 8px 12px; align-items: center; margin-top: 10px; }
.bar { height: 8px; border-radius: 4px; background: var(--control); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar span.current { background: var(--success); }

.feedback-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-item .subject { font-weight: 600; }
.feedback-item pre { white-space: pre-wrap; margin: 6px 0 0; font: inherit; color: var(--muted); }
.feedback-item img { max-width: 320px; max-height: 200px; margin-top: 8px; border-radius: 4px; border: 1px solid var(--line); }

.empty { color: var(--muted); padding: 8px 0; }

/* ---------------------------------------------------------------- dialog and toast */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 36, 51, .45);
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(24, 36, 51, .2);
  padding: 20px 22px;
}
.modal-card label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 12px; }
.modal-card textarea {
  width: 100%;
  margin-top: 4px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}
.modal-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--success);
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(24, 36, 51, .18);
  z-index: 20;
}

@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .navbar-inner { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .window { margin-left: 0; }
  .card { overflow-x: auto; }
  .page-header { padding: 16px 0 12px; }
  .card { padding: 16px; }
  .card > h2:first-child, .card > .card-head:first-child { margin: -16px -16px 12px; padding: 12px 16px; }
}

/* A narrow window has no room for a column: the sidebar lies across the top instead. */
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { height: 52px; border-bottom: 0; }
  .sidebar-label { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 0 8px 8px; order: 3; width: 100%; }
  .side-nav button { width: auto; white-space: nowrap; }
  .side-nav button[aria-selected="true"]::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0 16px; border-top: 0; }
  body.with-sidebar .page { margin-left: 0; }
}
