
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans.woff2?v=29e3890496") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono.woff2?v=18be452724") format("woff2");
}

:root {
  --text-primary: #1a1a2e;
  --text-secondary: #63636f;
  --text-disabled: #acacba;
  --text-inverse: #ffffff;
  --surface: #ffffff;
  --border: #e4e4ec;
  --primary-100: #f1f1f6;
  --primary-200: #dedee8;
  --primary-300: #adadc0;
  --primary-400: #6f6f88;
  --primary-500: #1a1a2e;
  --primary-900: #0d0d18;
  --danger: #b4413a;
  --danger-text: #8a2f29;
  --danger-surface: #fbf3f2;
  --danger-border: #e8c9c5;
  --sans: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 4px;
  --side: 248px;
  --gutter: 72px;
  --fade: 120ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font: 400 14px/1.5 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, ul, table, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }

a, .link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--primary-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--fade);
}
a:hover, .link:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; border-radius: 2px; }

.mono { font-family: var(--mono); font-size: 13px; }
.soft { color: var(--text-secondary); }
.none { color: var(--text-disabled); }
.absent { color: var(--text-secondary); font-style: italic; }
.attention { color: var(--danger-text); }
.hint { font-size: 13px; color: var(--text-secondary); }
.icon { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Frame: the sidebar, and one column of content beside it. */

.frame { display: flex; min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--side);
  height: 100vh;
  padding: 32px 24px 28px 28px;
  background: var(--primary-100);
  border-right: 1px solid var(--border);
}
.side-top { display: flex; flex-direction: column; gap: 48px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--primary-500); text-decoration: none; }
.logo { display: block; width: 98px; height: 26px; fill: currentColor; }
.brand-tag {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-weight: 600;
  line-height: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--fade);
}
.nav-item:hover { color: var(--text-primary); }
.nav-item.is-current {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.06);
  color: var(--text-primary);
  font-weight: 700;
}
.nav-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 400 12px/1 var(--mono);
  color: var(--text-secondary);
}
.nav-alert { width: 6px; height: 6px; border-radius: 3px; background: var(--danger); }

.side-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 10px; }
.side-who { font: 400 12px/1.4 var(--mono); color: var(--text-secondary); }

/* The main column is a stack; how far apart its blocks sit is the page's own. */
.page { flex: 1; display: flex; flex-direction: column; gap: 40px; min-width: 0; padding: 56px var(--gutter) 64px; }
.page-detail { gap: 48px; }
.page-new { gap: 44px; }
.page-key { gap: 36px; }
.page-nodes { gap: 56px; }
.page-key > * { max-width: 720px; }

/* Page header. */

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.head-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.head-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.title {
  font-size: 56px;
  font-weight: 800;
  line-height: 56px;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.page-key .title { line-height: 60px; }
.title-note { font-size: 16px; color: var(--text-secondary); }
.lead { font-size: 16px; line-height: 24px; color: var(--text-secondary); overflow-wrap: anywhere; }
.crumb {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.crumb a { text-decoration-color: transparent; }
.crumb a:hover { text-decoration-color: currentColor; }
.crumb-sep { margin: 0 1.2em; }
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.head-url { font: 400 13px/1.4 var(--mono); overflow-wrap: anywhere; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-aside { font-size: 13px; color: var(--text-secondary); }
.label { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--text-secondary); }

.flash {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--primary-100);
  overflow-wrap: anywhere;
}
.flash-error { border-color: var(--danger-border); background: var(--danger-surface); color: var(--danger-text); }

/* Controls. */

button, input, select { font: inherit; color: inherit; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fade), border-color var(--fade);
}
.button:hover { border-color: var(--primary-300); }
.button-small { padding: 7px 12px; font-size: 13px; line-height: 18px; }
.node-action .button { padding: 8px 14px; }
.button-primary {
  height: 40px;
  padding: 0 18px;
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: var(--text-inverse);
  font-weight: 700;
}
.button-primary:hover { border-color: var(--primary-900); background: var(--primary-900); }
.button-primary:has(.icon) { padding-left: 14px; }
.button-large { height: 44px; font-size: 15px; }
.button-outline { height: 38px; padding: 0 16px; border-color: var(--primary-500); font-weight: 700; }
.button-outline:hover { border-color: var(--primary-500); background: var(--primary-100); }
.button-danger {
  height: 38px;
  padding: 0 16px;
  border-color: var(--danger);
  background: var(--danger);
  color: var(--text-inverse);
  font-weight: 700;
}
.button-danger:hover { border-color: var(--danger-text); background: var(--danger-text); }

.link { padding: 0; border: 0; background: none; font-weight: 600; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.input, .select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color var(--fade);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f6f88' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
}
.input:hover, .select:hover { border-color: var(--primary-300); }
.input:focus, .select:focus { border-color: var(--primary-500); outline: 1px solid var(--primary-500); outline-offset: 0; }
.input::placeholder, .slug-input input::placeholder { color: var(--text-disabled); opacity: 1; }
.input.mono::placeholder { font-family: var(--mono); font-size: 13px; }

/* Badges: a pill, a dot, a word. Only what needs the operator is coloured. */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.dot { flex: none; width: 6px; height: 6px; border-radius: 3px; }
.badge-ok { background: var(--primary-100); }
.badge-ok .dot { background: var(--primary-500); }
.badge-idle { box-shadow: inset 0 0 0 1px var(--border); color: var(--text-secondary); }
.badge-idle .dot { border: 1.5px solid var(--primary-400); }
.badge-alert { background: var(--danger-surface); color: var(--danger-text); }
.badge-alert .dot { background: var(--danger); }
.tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-100);
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
}
.tag-attention { background: var(--danger-surface); color: var(--danger-text); }

/* Meters. Widths are attributes of the drawing, because the page may carry no inline style. */

.meter { display: block; width: 140px; max-width: 100%; height: 3px; border-radius: 2px; overflow: hidden; }
.bar { display: block; flex: 1; min-width: 0; height: 10px; border-radius: 2px; overflow: hidden; }
.fill-total { fill: var(--primary-100); }
.meter .fill-total { fill: var(--primary-200); }
.fill-promised { fill: var(--primary-200); }
.fill-backups { fill: var(--primary-400); }
.fill-used { fill: var(--primary-500); }
.fill-alert { fill: var(--danger); }

/* Tabs and filters: links, with the current one underlined. */

.tabs { display: flex; flex-wrap: wrap; gap: 0 28px; border-bottom: 1px solid var(--border); }
.filters { gap: 0 24px; }
.tab {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: -1px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--fade);
}
.tab:hover { color: var(--text-primary); }
.tab.is-current { padding-bottom: 12px; border-bottom: 2px solid var(--primary-500); color: var(--text-primary); font-weight: 700; }
.tab-count { font: 400 12px/1 var(--mono); color: var(--text-secondary); }
.tab-count.attention { color: var(--danger); }

/* Lists: a head row, then rows ruled off from each other. A wide one scrolls sideways in its own box. */

.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--text-secondary);
  white-space: nowrap;
}
.table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--border); vertical-align: middle; font: 400 12px/1.5 var(--mono); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .cell-name { font: 700 15px/1.4 var(--sans); overflow-wrap: anywhere; }
.table .cell-file { font-size: 13px; }
.cell-file .tag { margin-left: 10px; font-family: var(--sans); }
.table .cell-action { font: 600 13px/1.5 var(--sans); }
.col-name { width: 240px; }
.col-created { width: 110px; }
.col-size { width: 120px; }
.col-taken { width: 180px; }
.col-action { width: 96px; }
.narrow { max-width: 880px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.note { font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.empty { padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); overflow-wrap: anywhere; }

/* Tenants: what needs attention, then one list across every node. */

.attention-box {
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-surface);
  color: var(--danger-text);
}
.attention-box li { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.attention-box li + li { border-top: 1px solid var(--danger-border); }
.attention-box .dot { background: var(--danger); }
.attention-box .dot-hollow { border: 1.5px solid var(--danger); background: none; }
.attention-name { flex: none; width: 120px; font-weight: 700; overflow-wrap: anywhere; }
.attention-name.mono { font-weight: 600; }
.attention-text { flex: 1; min-width: 0; }
.attention-box a { font-weight: 700; text-decoration-color: currentColor; white-space: nowrap; }

.tenants { min-width: 724px; }
.tenants-head, .trow {
  display: grid;
  grid-template-columns: minmax(160px, 280px) 150px 100px minmax(150px, 200px) minmax(140px, 1fr) 24px;
  align-items: center;
}
.tenants-head { padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.trow { padding: 16px 0; border-bottom: 1px solid var(--border); text-decoration: none; transition: background-color var(--fade); }
.trow:hover { background: var(--primary-100); }
.t-name, .t-plan, .t-disk { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 16px; }
.t-slug { font-size: 16px; font-weight: 700; line-height: 20px; overflow-wrap: anywhere; }
.t-sub { font: 400 12px/1.5 var(--mono); color: var(--text-secondary); overflow-wrap: anywhere; }
.t-node { padding-right: 16px; font: 400 13px/1.4 var(--mono); overflow-wrap: anywhere; }
.t-disk { gap: 6px; font: 400 12px/1.5 var(--mono); }
.chev { width: 24px; height: 12px; fill: none; stroke: var(--primary-300); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Tenant detail. */

.split { display: flex; align-items: flex-start; gap: 64px; }
.details { flex: 1; min-width: 0; }
.section-title { padding-bottom: 14px; border-bottom: 1px solid var(--border); font-size: 20px; font-weight: 700; line-height: 1.3; }
.facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--text-secondary); }
.facts dd { overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; }

.usage { flex: none; display: flex; flex-direction: column; gap: 22px; width: 340px; padding: 24px; border-radius: var(--radius); background: var(--primary-100); }
.usage-disk { display: flex; flex-direction: column; gap: 8px; }
.usage-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--text-secondary); }
.usage-row .mono { font-size: 12px; color: var(--text-primary); }
.usage .meter { width: 100%; height: 4px; }
.usage-rule { height: 1px; margin: 0; border: 0; background: var(--primary-200); }
.usage-foot { display: flex; flex-direction: column; gap: 4px; }
.usage-foot h3 { font-size: 14px; font-weight: 700; }
.usage-foot p { font-size: 13px; line-height: 19px; color: var(--text-secondary); overflow-wrap: anywhere; }

.users { display: flex; flex-direction: column; gap: 28px; }
.user-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.user-form .field { flex: 0 1 360px; }
.user-form .hint { padding: 0 0 11px 8px; }

.logs { display: flex; flex-direction: column; gap: 16px; }
.log-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 36px; }
.log-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.log-status strong { font-size: 15px; font-weight: 700; }
.log-dot { align-self: center; flex: none; width: 8px; height: 8px; border-radius: 4px; border: 1.5px solid var(--primary-400); }
.logs[data-state="following"] .log-dot { border: 0; background: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-200); }
.logs[data-state="reconnecting"] .log-dot { border: 0; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-border); }
.logs[data-state="reconnecting"] .log-status strong { color: var(--danger-text); }
/* A page that follows says so only once its script is running. Until then, and in a browser that runs none,
   it says what it is without one. */
.logs:not([data-live]) .log-live, .logs[data-live] .log-static { display: none; }

.segments { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius); background: var(--primary-100); }
.segment { padding: 6px 14px; border-radius: 3px; font-size: 13px; font-weight: 600; line-height: 18px; color: var(--text-secondary); text-decoration: none; transition: color var(--fade); }
.segment:hover { color: var(--text-primary); }
.segment.is-current { background: var(--surface); color: var(--text-primary); font-weight: 700; box-shadow: 0 1px 2px rgba(26, 26, 46, 0.14); }

.log { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--primary-900); color: var(--primary-300); }
/* column-reverse makes the box open scrolled to its end, where the newest lines are, without a script.
   The script that adds lines keeps the reader's place itself, so the browser is told not to. */
.log-scroll {
  display: flex;
  flex-direction: column-reverse;
  height: 440px;
  padding: 14px 12px 10px;
  overflow: auto;
  overflow-anchor: none;
  scrollbar-color: var(--primary-400) transparent;
}
.log-lines { font: 400 12px/20px var(--mono); }
.log-line { display: flex; padding: 0 10px; border-radius: 2px; }
.log-time { flex: none; width: 92px; color: var(--primary-400); }
.log-text { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-line.is-stderr .log-text { color: #f2b8b3; }
.log-line:last-child { background: rgba(255, 255, 255, 0.06); }
.log-line:last-child:not(.is-stderr) .log-text { color: var(--text-inverse); }
.log-foot { display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); font: 400 11px/16px var(--mono); color: var(--primary-400); }
.log-cursor { flex: none; width: 7px; height: 13px; background: var(--primary-300); }
.logs[data-state="reconnecting"] .log-cursor { background: #f2b8b3; }
.logs[data-state="paused"] .log-cursor, .logs[data-state="connecting"] .log-cursor { background: var(--primary-400); }

.settings { display: flex; flex-direction: column; gap: 40px; }
.setting { display: flex; gap: 48px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.setting-text { flex: none; display: flex; flex-direction: column; gap: 6px; width: 320px; }
.setting-text h2 { font-size: 16px; font-weight: 700; }
.setting-text p { line-height: 21px; color: var(--text-secondary); }
.setting-form { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.setting-form .field { width: 100%; }
.setting-action { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.setting-action .hint { font: 400 12px/1.5 var(--mono); }
.danger-zone { padding: 28px; border: 1px solid var(--danger-border); border-radius: var(--radius); }
.danger-zone .setting-text { width: 292px; }
.danger-zone h2 { color: var(--danger-text); }

/* New tenant: numbered steps, each a legend beside its control. */

.provision { display: flex; flex-direction: column; gap: 44px; max-width: 960px; }
.step { display: flex; gap: 48px; }
.step-legend { flex: none; display: flex; flex-direction: column; gap: 4px; width: 220px; }
.step-body { flex: 1; min-width: 0; }
.step-no { font: 400 12px/1.4 var(--mono); color: var(--text-secondary); }
.step-name { font-size: 16px; font-weight: 700; }
.step-help { font-size: 13px; line-height: 19px; color: var(--text-secondary); }

.slug-input { display: flex; height: 44px; border: 1px solid var(--primary-500); border-radius: var(--radius); overflow: hidden; }
.slug-input:focus-within { outline: 1px solid var(--primary-500); }
.slug-input input { flex: 1; min-width: 0; padding: 0 12px; border: 0; background: none; font: 400 14px/1 var(--mono); }
.slug-input input:focus { outline: none; }
.slug-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-left: 1px solid var(--border);
  background: var(--primary-100);
  font: 400 14px/1 var(--mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

.plans { display: flex; flex-wrap: wrap; gap: 12px; }
.plan {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--fade);
}
.plan:hover { border-color: var(--primary-300); }
.plan:has(:checked) { padding: 18px; border: 2px solid var(--primary-500); }
.plan:has(:focus-visible) { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.plan-specs { font: 400 12px/20px var(--mono); color: var(--text-secondary); }
.plan-specs li { overflow-wrap: anywhere; }
.radio {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--primary-300);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.radio:checked { border: 5px solid var(--primary-500); }
.radio:disabled { cursor: default; }
.plan .radio:focus-visible { outline: none; }

.node-opts { border: 1px solid var(--border); border-radius: var(--radius); }
.node-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.node-opt + .node-opt { border-top: 1px solid var(--border); }
.node-opt-name { flex: none; width: 90px; font: 600 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.node-opt.is-off { opacity: 0.55; cursor: default; }
.node-opt-fits { flex: 1; min-width: 0; }
.fit { display: none; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 13px; }
.fit-always { display: flex; flex: 1; min-width: 0; }
.provision:has(.pick-1:checked) .fit-1,
.provision:has(.pick-2:checked) .fit-2,
.provision:has(.pick-3:checked) .fit-3,
.provision:has(.pick-4:checked) .fit-4,
.provision:has(.pick-5:checked) .fit-5,
.provision:has(.pick-6:checked) .fit-6,
.provision:has(.pick-7:checked) .fit-7,
.provision:has(.pick-8:checked) .fit-8,
.provision:has(.pick-9:checked) .fit-9,
.provision:has(.pick-10:checked) .fit-10,
.provision:has(.pick-11:checked) .fit-11,
.provision:has(.pick-12:checked) .fit-12 { display: flex; }
/* A browser that cannot match on the checked card shows the line for the plan the page opened with. */
@supports not selector(:has(a)) { .fit-initial { display: flex; } }
.fit-text { color: var(--text-secondary); }
.fit-label { font-weight: 700; white-space: nowrap; }
.fit-label.is-bad { color: var(--danger-text); }

.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-left: 268px; }
.submit .hint, .onward .hint { font-size: 14px; }

/* The pages that show a key, once. */

.key-block { display: flex; flex-direction: column; gap: 10px; }
.key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--primary-900);
  color: var(--text-inverse);
}
.key-value { min-width: 0; font: 400 15px/1.5 var(--mono); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.key-hint { font-size: 13px; color: var(--primary-300); user-select: none; -webkit-user-select: none; }
.onward { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* Nodes. */

.node { display: flex; flex-direction: column; gap: 28px; scroll-margin-top: 24px; }
.node.is-down { gap: 20px; }
.node-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.node-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.node-name { font: 700 22px/1.3 var(--mono); overflow-wrap: anywhere; }
.node-url { font: 400 12px/1.4 var(--mono); color: var(--text-secondary); overflow-wrap: anywhere; }
.node-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.node-warnings { display: flex; flex-direction: column; gap: 4px; color: var(--danger-text); overflow-wrap: anywhere; }

.node-facts { display: flex; flex-wrap: wrap; gap: 20px 48px; }
.node-facts div { display: flex; flex-direction: column; gap: 4px; }
.node-facts dt { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.node-facts dd { font-size: 16px; line-height: 38px; }
.node-facts .mono { font-size: 16px; }
.node-facts .figure { font-size: 28px; font-weight: 800; }

.capacity { display: flex; flex-direction: column; gap: 18px; }
.capacity-row { display: flex; align-items: center; gap: 24px; }
.capacity-name { flex: none; width: 90px; font-weight: 600; }
.capacity-figure { flex: none; width: 260px; font: 400 12px/1.4 var(--mono); text-align: right; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-left: 114px; font-size: 12px; color: var(--text-secondary); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch-used { background: var(--primary-500); }
.swatch-backups { background: var(--primary-400); }
.swatch-promised { background: var(--primary-200); }
.swatch-total { background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--border); }

.node-down { display: flex; flex-wrap: wrap; gap: 20px 64px; }
.node-down-text { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.node-down-text p { line-height: 22px; color: var(--text-secondary); }
.node-down-text .node-error { font: 400 12px/20px var(--mono); color: var(--danger-text); overflow-wrap: anywhere; }
.node-check { display: flex; flex-direction: column; gap: 6px; }
.node-check pre { font: 400 12px/20px var(--mono); }

/* Sign in, and the short pages for refusals. */

.signin { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.signin .field { width: min(100%, 360px); }

@media (max-width: 1040px) {
  :root { --gutter: 40px; --side: 216px; }
  .split, .setting, .step { flex-direction: column; gap: 20px; }
  .usage, .setting-text, .danger-zone .setting-text, .step-legend { width: 100%; max-width: 520px; }
  .setting-form { align-self: stretch; }
  .submit { padding-left: 0; }
  .capacity-row { flex-wrap: wrap; gap: 6px 16px; }
  .capacity-name { width: 72px; }
  .capacity-figure { width: 100%; padding-left: 88px; text-align: left; }
  .legend { padding-left: 88px; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .frame { display: block; }
  .side {
    position: static;
    flex-flow: row wrap;
    align-items: center;
    gap: 10px 20px;
    width: auto;
    height: auto;
    padding: 14px var(--gutter);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .side-top { flex-flow: row wrap; align-items: center; gap: 10px 20px; }
  .nav { flex-direction: row; gap: 4px; }
  .side-foot { padding: 0; }
  .side-who { display: none; }

  .page { padding: 32px var(--gutter) 56px; }
  .title, .page-key .title { font-size: 40px; line-height: 44px; }
  .attention-box li { flex-wrap: wrap; gap: 4px 14px; }
  .attention-name { width: auto; }
  .attention-text { flex-basis: 100%; order: 3; }
  .tabs { flex-wrap: nowrap; overflow: auto hidden; }
  .tab { margin-bottom: 0; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .user-form .hint { padding: 0; }
  .legend, .capacity-figure { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
