/* Conveno web app (app.conveno.dev): the pages the Worker renders in src/pages.ts.
   Light on :root, dark through prefers-color-scheme, and the theme control sets data-theme to
   override either way. The sidebar is dark in both themes. Entry blue is for the mark's point,
   links, the current page, live state and focus. Everything motion is behind
   prefers-reduced-motion: no-preference. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("/static/fonts/martian-mono-latin-variable.woff2") format("woff2");
}

:root {
  --ground: #f3f5f7;
  --surface: #ffffff;
  --sunken: #e9edf1;
  --ink: #111b28;
  --quiet: #566474;
  --rule: #c7d0da;
  --line: #dbe1e8;
  --card: #ffffff;
  --entry: #2346d9;
  --entry-ink: #ffffff;
  --ok: #1e7b3a;
  --warn: #8a5200;
  --error: #b3202a;
  --focus: #2346d9;
  --rail: #111b28;
  --rail-ink: #93a1b3;
  --rail-hi: #e4eaf1;
  --rail-hover: #1c2a3c;
  --rail-line: #243245;
  --rail-point: #8ca6ff;
  --rail-on: color-mix(in srgb, var(--rail-point) 18%, var(--rail));
  --seam: var(--entry);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --rail-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d1520;
    --surface: #141f2e;
    --sunken: #0a111a;
    --ink: #e4eaf1;
    --quiet: #93a1b3;
    --rule: #2a384a;
    --line: #243245;
    --card: #141f2e;
    --entry: #8ca6ff;
    --entry-ink: #0d1520;
    --ok: #7bd88f;
    --warn: #ffb547;
    --error: #f2777a;
    --focus: #8ca6ff;
    --rail: #0a111a;
    --rail-hover: #162232;
    --rail-line: #1b2a3c;
    --seam: color-mix(in srgb, var(--entry) 62%, var(--rail));
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #0d1520;
  --surface: #141f2e;
  --sunken: #0a111a;
  --ink: #e4eaf1;
  --quiet: #93a1b3;
  --rule: #2a384a;
  --line: #243245;
  --card: #141f2e;
  --entry: #8ca6ff;
  --entry-ink: #0d1520;
  --ok: #7bd88f;
  --warn: #ffb547;
  --error: #f2777a;
  --focus: #8ca6ff;
  --rail: #0a111a;
  --rail-hover: #162232;
  --rail-line: #1b2a3c;
  --seam: color-mix(in srgb, var(--entry) 62%, var(--rail));
  color-scheme: dark;
}

:root.rail-min {
  --rail-w: 64px;
}

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

[hidden] {
  display: none !important;
}

/* Controls that need JavaScript stay out of the way until theme.js marks the page. */
html:not(.js) .needs-js {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px / 1.55 var(--font-display);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

form {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--entry) 28%, transparent);
  color: var(--ink);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

a {
  color: var(--entry);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  flex: none;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

/* ---------- Buttons, pills, small controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 500;
  font-size: 14.5px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.btn:hover {
  background: color-mix(in srgb, var(--ink) 85%, var(--entry));
}

.btn:active {
  transform: translateY(1px);
}

.btn.entry {
  background: var(--entry);
  color: var(--entry-ink);
}

.btn.entry:hover {
  background: color-mix(in srgb, var(--entry) 88%, var(--ink));
}

.btn.line {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--quiet) 40%, transparent);
}

.btn.line:hover {
  background: var(--card);
  border-color: var(--quiet);
}

.btn.danger {
  background: var(--error);
  color: #fff;
}

.btn.danger:hover {
  background: color-mix(in srgb, var(--error) 88%, #000);
}

.btn.sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13.5px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--quiet);
}

.iconbtn:hover {
  background: var(--sunken);
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--sunken);
  color: var(--quiet);
  text-decoration: none;
  white-space: nowrap;
}

.pill.on {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}

.pill.entry {
  background: color-mix(in srgb, var(--entry) 13%, transparent);
  color: var(--entry);
}

.pill.warn {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--entry);
  color: var(--entry-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.avatar.big {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* ---------- App frame ---------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.content {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-x: clip;
}

/* ---------- Sidebar ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px 14px;
  background: var(--rail);
  color: var(--rail-ink);
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  margin-bottom: 14px;
  padding: 0 4px 0 12px;
}

.rail .iconbtn {
  color: var(--rail-ink);
}

.rail .iconbtn:hover {
  background: var(--rail-hover);
  color: var(--rail-hi);
}

.rail .brand {
  display: inline-flex;
  color: var(--rail-hi);
}

.rail .lockup {
  height: 22px;
  width: auto;
  color: var(--rail-hi);
}

.lockup .lockup-point {
  fill: var(--entry);
}

.rail .lockup .lockup-point,
.rail .mark .mk-point {
  fill: var(--rail-point);
}

.rail .mark {
  display: none;
  height: 24px;
  width: auto;
}

.mark .mk-bracket {
  fill: currentColor;
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.rail .item {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--rail-ink);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.rail .item:hover {
  background: var(--rail-hover);
  color: var(--rail-hi);
}

.rail .item[aria-current="page"] {
  background: var(--rail-on);
  color: var(--rail-hi);
}

.rail .label {
  margin-left: 12px;
  max-width: 160px;
  overflow: hidden;
  transition:
    max-width 0.28s var(--ease),
    margin 0.28s var(--ease),
    opacity 0.2s var(--ease);
}

.rail .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--rail-ink);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s var(--ease);
}

.rail .tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 50;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--rail-hi);
  color: var(--rail);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition:
    opacity 0.15s var(--ease),
    transform 0.15s var(--ease);
  display: none;
}

html.rail-min .rail .tip {
  display: block;
}

.rail :is(.item, .plan-chip, .userbtn):is(:hover, :focus-visible) .tip {
  opacity: 1;
  transform: translate(0, -50%);
}

html.rail-min .rail .label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
}

html.rail-min .rail .count {
  display: none;
}

html.rail-min .rail-top {
  flex-direction: column;
  height: auto;
  gap: 10px;
  padding: 0;
  margin-bottom: 18px;
}

html.rail-min .rail .lockup {
  display: none;
}

html.rail-min .rail .mark {
  display: block;
}

.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.plan-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rail-line);
  border-radius: 14px;
  color: var(--rail-hi);
  text-decoration: none;
  transition: background 0.15s var(--ease);
}

.plan-chip:hover {
  background: var(--rail-hover);
}

.chip-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  white-space: nowrap;
}

.chip-text b {
  display: block;
  font-weight: 600;
}

.chip-text .sub {
  display: block;
  font-size: 12px;
  color: var(--rail-ink);
}

.mini {
  display: flex;
  gap: 2px;
  margin: 7px 0 6px;
}

.mini i {
  flex: 1;
  height: 4px;
  border-radius: 1px;
  background: var(--rail-line);
}

.mini i.used {
  background: var(--rail-point);
}

.chip-min {
  display: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

html.rail-min .plan-chip {
  justify-content: center;
  padding: 8px;
}

html.rail-min .chip-text {
  display: none;
}

html.rail-min .chip-min {
  display: block;
}

.user {
  position: relative;
}

.userbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--rail-hi);
  text-align: left;
}

.userbtn:hover {
  background: var(--rail-hover);
}

.userbtn .who {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.userbtn .who b,
.userbtn .who span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.userbtn .who b {
  font-weight: 600;
}

.userbtn .who span {
  font-size: 12px;
  color: var(--rail-ink);
}

html.rail-min .userbtn {
  justify-content: center;
  padding: 6px 0;
}

html.rail-min .userbtn .who,
html.rail-min .userbtn .chev {
  display: none;
}

/* The account menu, in the sidebar and in the phone's top bar. */
.menu {
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 40px -16px rgb(10 17 26 / 0.4);
}

html.rail-min .rail .menu {
  bottom: 0;
  left: calc(100% + 12px);
}

.menu-head {
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}

.menu-head b,
.menu-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-head span {
  font-size: 13px;
  color: var(--quiet);
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  text-align: left;
}

.menu a:hover,
.menu button:hover {
  background: var(--sunken);
}

.menu .site {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--quiet);
  font-size: 13px;
}

/* ---------- Phone bars ---------- */

.mtop,
.tabbar {
  display: none;
}

/* ---------- Page canvas ---------- */

.canvas {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 48px 80px;
}

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.head h1 {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.head p {
  margin: 8px 0 0;
  color: var(--quiet);
  max-width: 58ch;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-line {
  max-width: 26ch;
  margin: 0 0 36px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.status-line .hl {
  color: var(--entry);
}

.status-line .q {
  color: var(--quiet);
}

.sec {
  margin-top: 44px;
}

.sec.first {
  margin-top: 0;
}

.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.sec-h h2 {
  font-size: 19px;
}

.sec-h p {
  margin: 4px 0 0;
  color: var(--quiet);
  font-size: 14px;
  max-width: 62ch;
}

.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  color: var(--quiet);
  font-size: 14px;
}

.hint .ic {
  margin-top: 3px;
}

.fine {
  margin: 14px 0 0;
  color: var(--quiet);
  font-size: 13.5px;
}

.fine.wide {
  max-width: 70ch;
}

.msg {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--quiet);
  font-size: 14px;
}

.msg.err {
  color: var(--error);
}

.quiet {
  color: var(--quiet);
}

/* Machine tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  transition:
    border-color 0.15s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

/* An online machine is lit faintly from its status corner; an offline one sits back a little. */
.tile.on {
  background:
    radial-gradient(
      120% 100% at 100% 0%,
      color-mix(in srgb, var(--ok) 8%, transparent),
      transparent 62%
    ),
    var(--card);
}

.tile.off .t-ic {
  filter: saturate(0.3);
  opacity: 0.75;
}

.tile.off h3 {
  color: color-mix(in srgb, var(--ink) 80%, var(--card));
}

.tile:hover {
  border-color: var(--rule);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgb(10 17 26 / 0.45);
}

.t-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.t-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--sunken);
}

.tile h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tile p {
  margin: 2px 0 0;
  color: var(--quiet);
  font-size: 13.5px;
}

.tile.add {
  place-content: center;
  justify-items: center;
  text-align: center;
  border-style: dashed;
  background: transparent;
  color: var(--quiet);
  text-decoration: none;
  min-height: 150px;
}

.tile.add .t-ic {
  background: transparent;
  border: 1px dashed var(--rule);
}

.tile.add:hover {
  color: var(--entry);
}

/* Two blocks side by side */

.two {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.block {
  padding: 24px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.canvas.narrow > .block,
.canvas.narrow > .danger-box {
  max-width: 760px;
}

.canvas.narrow > .block {
  margin-bottom: 14px;
}

.block h2 {
  font-size: 17px;
}

.block .lead {
  margin: 6px 0 18px;
  color: var(--quiet);
}

.block.rows {
  margin-top: 14px;
}

.rows .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.rows h2 {
  margin-bottom: 12px;
}

.rows .row:last-child {
  padding-bottom: 0;
}

.rows .row b {
  display: block;
  font-weight: 500;
}

.rows .row span {
  color: var(--quiet);
  font-size: 13.5px;
}

.plan-big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 6px;
}

.plan-big b {
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.plan-line p {
  margin: 12px 0 20px;
}

.days {
  display: flex;
  gap: 4px;
  margin: 18px 0 8px;
}

.days i {
  flex: 1;
  height: 8px;
  border-radius: 3px;
  background: var(--sunken);
}

.days i.used {
  background: var(--entry);
}

/* Today is the brand point, sitting on the bar. */
.days i.today {
  position: relative;
  background: transparent;
}

.days i.today::before,
.days i.today::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
}

.days i.today::before {
  background: var(--entry);
}

.days i.today::after {
  border: 1.5px solid var(--entry);
  opacity: 0;
}

.days-l {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--quiet);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
}

.price .n {
  font-size: 42px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.price .per {
  color: var(--quiet);
}

.stack {
  display: grid;
  gap: 12px;
}

.stack.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack .btn {
  width: 100%;
}

.stack.row .btn {
  width: auto;
}

.pro-block .stack {
  max-width: 420px;
}

/* Terminal block */

.term {
  border-radius: 12px;
  background: var(--rail);
  color: #e4eaf1;
  padding: 16px 16px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.term .c {
  color: #93a1b3;
}

.term .p {
  color: #8ca6ff;
}

.term .r {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #2a384a;
  border-radius: 7px;
  background: transparent;
  color: #c6d0dc;
  font: 500 12px / 1 var(--font-display);
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.copy:hover {
  border-color: #566474;
  color: #fff;
}

.copy.copied {
  color: #7bd88f;
  border-color: #3b7a4b;
}

.head-actions .copy,
.head-actions button[data-copy] {
  height: 40px;
}

button.btn.copied {
  background: color-mix(in srgb, var(--ok) 18%, var(--ground));
  color: var(--ok);
}

/* Lists and tables */

.list {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.list table {
  width: 100%;
  border-collapse: collapse;
}

.list th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--quiet);
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.list td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.list tr:last-child td {
  border-bottom: 0;
}

.nm {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  min-width: 0;
}

.nm > .ic {
  color: var(--quiet);
}

.nm-t {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nm > div {
  min-width: 0;
}

.nm .sub {
  display: none;
  color: var(--quiet);
  font-size: 13px;
  font-weight: 400;
}

.list .q {
  color: var(--quiet);
}

.list .r {
  text-align: right;
}

.list .mono {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.list form {
  display: inline-block;
}

/* Empty states */

.empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 36px 20px;
  border: 1px dashed var(--rule);
  border-radius: 16px;
  text-align: center;
  color: var(--quiet);
}

.empty h3 {
  color: var(--ink);
  font-size: 17px;
  margin-top: 4px;
}

.empty p {
  margin: 0;
  max-width: 46ch;
}

/* Danger zone */

.danger-box {
  margin-top: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--error) 30%, var(--line));
  background: color-mix(in srgb, var(--error) 4%, var(--card));
}

.danger-box h2 {
  font-size: 16px;
}

.danger-box p {
  margin: 4px 0 0;
  color: var(--quiet);
  font-size: 14px;
  max-width: 62ch;
}

/* Profile and the theme choice */

.profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.profile dl {
  margin: 0;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile dt {
  color: var(--quiet);
  font-size: 13px;
}

.profile dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--sunken);
}

.seg label {
  position: relative;
}

.seg input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 6px 18px;
  border-radius: 999px;
  color: var(--quiet);
  font-weight: 500;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.seg input:checked + span {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(10 17 26 / 0.18);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Dialogs */

dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 28px;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -24px rgb(0 0 0 / 0.5);
  overflow-y: auto;
}

dialog::backdrop {
  background: rgb(10 17 26 / 0.55);
  backdrop-filter: blur(2px);
}

html:not(.js) dialog {
  display: block;
  position: static;
  width: auto;
  margin: 24px 0 0;
  box-shadow: none;
  border: 1px solid var(--line);
}

dialog h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

dialog p {
  margin: 0 0 16px;
  color: var(--quiet);
}

dialog label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

dialog input[type="text"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--ground);
  font-family: var(--font-mono);
  font-size: 14px;
}

dialog .f {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

dialog fieldset {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

dialog legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--quiet);
  font-size: 14px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-weight: 400;
}

.check .quiet {
  margin-left: 4px;
  font-size: 13px;
}

.check input {
  margin-top: 4px;
}

/* Notices */

.note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-left: 4px solid var(--entry);
}

.note.ok {
  border-left-color: var(--ok);
}

.note.warn {
  border-left-color: var(--warn);
}

.note.err {
  border-left-color: var(--error);
}

.note p {
  margin: 0;
}

.note-body {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  margin: 0;
  box-shadow: 0 18px 40px -16px rgb(10 17 26 / 0.45);
}

.toast .iconbtn {
  flex: none;
  margin: -6px -8px 0 0;
}

/* ---------- Sign in ---------- */

.signin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  background: var(--rail);
  color: #e4eaf1;
  overflow: hidden;
}

.art .art-brand {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: #e4eaf1;
}

.art .lockup {
  height: 26px;
  width: auto;
  color: #e4eaf1;
}

.art .lockup .lockup-point {
  fill: var(--rail-point);
}

/* The mark, solid and large, cut by the seam between the panels: the point sits on the seam. */
.art .art-mark {
  position: absolute;
  z-index: 0;
  right: 0;
  top: calc(var(--h) * -0.1);
  --h: min(54vh, 500px, 42vw);
  height: var(--h);
  width: auto;
  color: color-mix(in srgb, var(--rail-hi) 7%, var(--rail));
}

.art .art-mark .sg-point {
  fill: var(--seam);
}

.art blockquote {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 15ch;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.art blockquote span {
  color: #8ca6ff;
}

.form {
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--ground);
}

.inner {
  width: min(380px, 100%);
}

/* The lockup and the mark the art panel shows, for when it is hidden (narrow screens). */
.form-brand,
.inner .hero-mark {
  display: none;
}

.form-brand {
  position: absolute;
  top: 24px;
  left: 20px;
  color: var(--ink);
}

.form-brand .lockup {
  height: 22px;
  width: auto;
}

.inner h1 {
  font-size: 30px;
  letter-spacing: -0.025em;
}

.inner .lead {
  margin: 8px 0 28px;
  color: var(--quiet);
}

.inner .btn,
.center-card .stack .btn {
  height: 46px;
  font-size: 15px;
}

.foot {
  margin-top: 36px;
  display: flex;
  gap: 18px;
  font-size: 13.5px;
}

.foot a {
  color: var(--quiet);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
}

.tbtn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--quiet);
}

.tbtn:hover {
  color: var(--ink);
}

/* ---------- Centered pages: device approval and not found ---------- */

.center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 40px;
}

.center-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.center-top .brand {
  display: inline-flex;
  color: var(--ink);
}

.center-top .lockup {
  height: 24px;
  width: auto;
  color: var(--ink);
}

.center-top .tbtn {
  position: static;
}

.center-card {
  width: min(460px, 100%);
  margin: auto;
  padding: 36px 0 0;
  text-align: center;
  display: grid;
  justify-items: center;
}

.center-card h1 {
  font-size: 30px;
  letter-spacing: -0.025em;
}

.center-card .lead {
  margin: 8px 0 24px;
  color: var(--quiet);
}

.center-card .note {
  text-align: left;
  width: 100%;
}

.center-card .stack.row {
  justify-content: center;
}

.center-card h1 + .stack {
  margin-top: 24px;
}

.center-card .fine {
  max-width: 44ch;
}

.back {
  margin: 0;
}

.code-form {
  display: grid;
  gap: 8px;
  width: min(320px, 100%);
  text-align: left;
}

.code-form label {
  font-size: 14px;
  font-weight: 500;
}

.code-form .btn {
  margin-top: 8px;
}

.code-input {
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-stage {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 26px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid var(--rail-line);
  background: var(--rail);
}

.code {
  font-family: var(--font-mono);
  font-size: clamp(26px, 8vw, 38px);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #e4eaf1;
}

.req {
  width: 100%;
  margin: 0 0 22px;
  padding: 6px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
}

.req div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.req div:last-child {
  border-bottom: 0;
}

.req dt {
  color: var(--quiet);
}

.req dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

/* ---------- The mark as an outline (empty states) ---------- */

.motif {
  display: block;
  overflow: visible;
  color: var(--rule);
}

.motif .mf-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linejoin: miter;
}

.motif .mf-point {
  fill: var(--entry);
}

.motif .mf-ring {
  fill: none;
  stroke: var(--entry);
  stroke-width: 1.5;
  opacity: 0;
}

.motif.small {
  width: 84px;
  height: auto;
  margin-bottom: 14px;
  color: var(--quiet);
}

.motif.small .mf-line {
  stroke-width: 3;
}

/* ---------- The mark, solid (brand moments) ---------- */

.sigil {
  display: block;
  overflow: hidden;
}

.sigil .sg-bracket {
  fill: currentColor;
  stroke: none;
}

.sigil .sg-point {
  fill: var(--entry);
}

.hero-mark {
  width: 46px;
  height: auto;
  margin: 0 0 22px;
  color: var(--ink);
}

/* Terminal connected: the point sits in the bracket's opening (and the mark re-centres on it). */
.hero-mark.joined {
  translate: 7px 0;
}

.hero-mark.joined .sg-point {
  transform: translateX(-50px);
}

.hero-mark.off .sg-point {
  fill: var(--rule);
}

.hero-mark.lost .sg-point {
  transform: translate(14px, 34px);
}

/* ---------- Motion (everything here is off for people who ask for less) ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .rail {
    view-transition-name: rail;
  }

  .content {
    view-transition-name: content;
  }

  .mtop {
    view-transition-name: mtop;
  }

  .tabbar {
    view-transition-name: tabbar;
  }

  ::view-transition-group(rail),
  ::view-transition-group(mtop),
  ::view-transition-group(tabbar) {
    animation: none;
  }

  ::view-transition-old(rail),
  ::view-transition-new(rail),
  ::view-transition-old(mtop),
  ::view-transition-new(mtop),
  ::view-transition-old(tabbar),
  ::view-transition-new(tabbar) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-old(content) {
    animation: vt-out 0.16s ease both;
  }

  ::view-transition-new(content) {
    animation: vt-in 0.3s var(--ease) both;
  }

  @keyframes vt-out {
    to {
      opacity: 0;
      transform: translateY(-4px);
    }
  }

  @keyframes vt-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }

  .canvas > .status-line,
  .canvas > .head,
  .canvas > .sec,
  .canvas > .two,
  .canvas > .block,
  .canvas > .danger-box,
  .canvas > .hint,
  .canvas > .fine {
    animation: rise 0.6s var(--ease) both;
  }

  .canvas > :nth-child(3) {
    animation-delay: 0.06s;
  }

  .canvas > :nth-child(4) {
    animation-delay: 0.12s;
  }

  .canvas > :nth-child(5) {
    animation-delay: 0.18s;
  }

  .canvas > :nth-child(6) {
    animation-delay: 0.24s;
  }

  .tiles > * {
    animation: rise 0.6s var(--ease) both;
    animation-delay: 0.08s;
  }

  .tiles > :nth-child(2) {
    animation-delay: 0.14s;
  }

  .tiles > :nth-child(3) {
    animation-delay: 0.2s;
  }

  .tiles > :nth-child(4) {
    animation-delay: 0.26s;
  }

  .tiles > :nth-child(5) {
    animation-delay: 0.32s;
  }

  .tiles > :nth-child(n + 6) {
    animation-delay: 0.38s;
  }

  .pill.on .dot {
    animation: pulse 2.4s var(--ease) infinite;
  }

  @keyframes pulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent);
    }

    60% {
      box-shadow: 0 0 0 5px transparent;
    }
  }

  .app {
    transition: grid-template-columns 0.28s var(--ease);
  }

  .toast {
    animation: toast-in 0.4s var(--ease) both;
  }

  .toast.leaving {
    animation: toast-out 0.2s ease both;
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
  }

  @keyframes toast-out {
    to {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  dialog[open] {
    animation: pop 0.25s var(--ease) both;
  }

  @keyframes pop {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.98);
    }
  }

  /* The mark draws itself, then the point arrives and sends out a ring now and then. */
  .motif .mf-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.4s var(--ease) 0.2s forwards;
  }

  .motif .mf-point {
    transform-box: fill-box;
    transform-origin: center;
    animation: arrive 0.6s var(--ease) 1.1s both;
  }

  .motif .mf-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: ring 3.6s ease-out 1.9s infinite;
  }

  @keyframes draw {
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes arrive {
    from {
      opacity: 0;
      transform: scale(0.2);
    }
  }

  @keyframes ring {
    0% {
      opacity: 0.7;
      transform: scale(1);
    }

    60%,
    100% {
      opacity: 0;
      transform: scale(2.4);
    }
  }

  .art blockquote {
    animation: rise 0.8s var(--ease) 0.3s both;
  }

  /* Once per browser session (html.draw-mark, from theme.js): the bracket's outline draws, it
     fills, then the point drops onto the seam. Otherwise the mark is simply there. */
  .draw-mark .sigil.draw .sg-bracket {
    stroke: var(--entry);
    stroke-width: 0.35;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation:
      sg-draw 0.6s var(--ease) 0.15s forwards,
      sg-fill 0.4s ease 0.7s both;
  }

  .draw-mark .hero-mark.draw .sg-bracket {
    stroke: currentColor;
    stroke-width: 4;
  }

  .draw-mark .sigil.draw .sg-point {
    transform-box: fill-box;
    transform-origin: center;
    animation: sg-drop 0.5s var(--ease) 1s both;
  }

  @keyframes sg-draw {
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes sg-fill {
    from {
      fill-opacity: 0;
    }

    to {
      fill-opacity: 1;
      stroke-opacity: 0;
    }
  }

  @keyframes sg-drop {
    from {
      opacity: 0;
      transform: translateY(-90%);
    }
  }

  /* Terminal connected: the point slides into the bracket once. */
  .hero-mark.joined .sg-point {
    animation: sg-join 0.55s var(--ease) 0.35s both;
  }

  @keyframes sg-join {
    from {
      transform: translateX(0);
    }
  }

  .days i.today::after {
    animation: today 3s ease-out 0.8s infinite;
  }

  @keyframes today {
    0% {
      opacity: 0.55;
      transform: scale(1);
    }

    70%,
    100% {
      opacity: 0;
      transform: scale(2.4);
    }
  }

  .inner > * {
    animation: rise 0.6s var(--ease) both;
  }

  .inner > :nth-child(2) {
    animation-delay: 0.05s;
  }

  .inner > :nth-child(3) {
    animation-delay: 0.1s;
  }

  .inner > :nth-child(4) {
    animation-delay: 0.15s;
  }

  .center-card > * {
    animation: rise 0.6s var(--ease) both;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 980px) {
  .two {
    grid-template-columns: 1fr;
  }

  .signin {
    grid-template-columns: 1fr;
  }

  .art {
    display: none;
  }

  .form-brand,
  .inner .hero-mark {
    display: block;
  }

  .inner .hero-mark {
    width: 40px;
    margin-bottom: 20px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: none;
  }

  .mtop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0;
    background: color-mix(in srgb, var(--ground) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .mtop .lockup {
    height: 20px;
    width: auto;
    color: var(--ink);
  }

  .mtop-r {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .mtop .user .menu {
    bottom: auto;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
  }

  .mtop .iconbtn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--card) 90%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }

  .tab-ic {
    display: grid;
    place-items: center;
    padding: 4px 14px;
    border-radius: 999px;
    transition: background 0.15s var(--ease);
  }

  .tabbar a[aria-current="page"] .tab-ic {
    background: color-mix(in srgb, var(--entry) 14%, transparent);
  }

  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 0;
    border-radius: 10px;
    color: var(--quiet);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
  }

  .tabbar a[aria-current="page"] {
    color: var(--entry);
  }

  .toasts {
    right: 16px;
    left: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .canvas {
    padding: 24px 16px 40px;
  }

  .head {
    margin-bottom: 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .head h1 {
    font-size: 28px;
  }

  .status-line {
    font-size: 23px;
    margin-bottom: 26px;
  }

  .sec {
    margin-top: 32px;
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .tile {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
  }

  .tile .t-top {
    display: contents;
  }

  .tile .t-top .pill {
    grid-column: 3;
    grid-row: 1;
  }

  .tile .t-ic {
    grid-column: 1;
    grid-row: 1;
  }

  .tile .t-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .tile.add {
    min-height: 0;
    grid-template-columns: auto 1fr;
    text-align: left;
    justify-items: start;
  }

  .block {
    padding: 18px;
  }

  .list th,
  .list td {
    padding: 13px 14px;
  }

  .hide-sm {
    display: none;
  }

  .nm .sub {
    display: block;
  }

  .tile.on {
    background:
      radial-gradient(
        90% 140% at 100% 50%,
        color-mix(in srgb, var(--ok) 8%, transparent),
        transparent 62%
      ),
      var(--card);
  }

  .profile {
    align-items: flex-start;
  }

  .seg span {
    padding: 6px 14px;
  }

  dialog {
    padding: 22px;
  }

  dialog .f {
    flex-wrap: wrap;
  }

  .inner h1 {
    font-size: 26px;
  }

  .form {
    padding: 116px 20px 32px;
    place-items: start center;
  }

  .center {
    padding: 16px 16px 32px;
  }
}

@media (max-width: 640px) {
  .list thead,
  .details {
    display: none;
  }

  /* Let the name column shrink so long names end in an ellipsis and buttons stay in view. */
  .list td:first-child {
    width: 100%;
    max-width: 0;
  }

  .list td.r {
    white-space: nowrap;
  }
}
