/* guw.no portal. Tokens are the shared block from design/portal*.html.
   Pure black, monochrome, radius 0, native caret, no inverted white fills. */

:root {
  --bg: #000;
  --panel: #0a0a0a;
  --panel-2: #101010;
  --raise: #161616;
  --hover: #141414;
  --line: #1c1c1c;
  --line-strong: #2a2a2a;
  --text: #f2f2f2;
  --text-2: #c8c8c8;
  --dim: #8a8a8a;
  /* 4.5:1 on black and 4.3:1 on the panel, so meta text stays readable */
  --faint: #787878;
  --accent: #fff;
  --accent-ink: #000;
  --ok: #7fbf9a;
  --warn: #d4b06a;
  --danger: #d9776e;
  --mono: "Cascadia Mono", "Cascadia Code", "SF Mono", Menlo,
    "DejaVu Sans Mono", Consolas, monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13.5px;
  --fs-lg: 15px;
  --lh: 1.5;
  --bar: 40px;
  --t: 120ms;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #242424;
  border: 3px solid #000;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* selection: a raised block with a 2px white left bar, never an inverted fill */
::selection {
  background: var(--raise);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ============ site chrome ============ */

.nav {
  flex: none;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: relative;
  z-index: 30;
}

.nav .brand {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav .brand:hover {
  color: var(--text-2);
}

.nav .crumb {
  font-size: var(--fs-xs);
  color: var(--faint);
}

.nav .crumb b {
  color: var(--text-2);
  font-weight: 400;
}

.nav .r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.nav .r a:hover {
  color: var(--text-2);
}

/* account menu */
.acct {
  position: relative;
}

.acct .btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background var(--t) linear, color var(--t) linear,
    border-color var(--t) linear;
}

.acct .btn:hover,
.acct .btn[aria-expanded="true"] {
  background: var(--raise);
  color: var(--text);
  border-color: var(--faint);
}

.acct .btn .c {
  font-size: 8px;
  color: var(--faint);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 208px;
  z-index: 60;
  background: var(--raise);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
  padding: 4px 0;
}

.menu .who {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.menu .who .n {
  font-size: var(--fs-sm);
  color: var(--text);
}

.menu .who .n,
.menu .who .a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu .who .a {
  font-size: var(--fs-xs);
  color: var(--faint);
}

.menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-align: left;
  transition: background var(--t) linear, color var(--t) linear;
}

.menu button:hover,
.menu button:focus-visible {
  background: var(--hover);
  color: var(--text);
}

.menu button:focus-visible {
  outline: 0;
  box-shadow: inset 2px 0 0 var(--accent);
}

.menu .sep {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.menu button[disabled] {
  color: var(--faint);
  cursor: default;
}

.menu button[disabled]:hover {
  background: none;
}

.menu .err {
  padding: 4px 12px 8px;
  font-size: var(--fs-xs);
}

/* icon in mono brackets */
.ib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  white-space: nowrap;
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: 1;
  transition: color var(--t) linear;
}

.ib::before {
  content: "[";
  color: var(--faint);
}

.ib::after {
  content: "]";
  color: var(--faint);
}

.ib svg {
  width: 14px;
  height: 14px;
  display: block;
  margin: 0 1px;
  flex: none;
}

.ib:hover {
  color: var(--text);
}

.ib:hover::before,
.ib:hover::after {
  color: var(--text-2);
}

/* ============ landing ============ */

/* Grows with its content, so a long page (admin) scrolls the document. */
.wrap {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
}

/* margin:auto so a too-tall block scrolls instead of clipping */
.col {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

/* official mark: 1024px source, art spans x80-942 y123-899, cropped by the wrapper */
.mark {
  width: 280px;
  height: 252px;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
}

.mark img {
  position: absolute;
  left: -26px;
  top: -40px;
  width: 332px;
  height: 332px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  display: block;
}

.hero h1 {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero p {
  font-size: var(--fs-sm);
  color: var(--dim);
  margin-top: 4px;
}

/* full-viewport character dither: a fixed layer, never part of the layout */
.backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Content sits above the backdrop. Only .wrap: the nav keeps its own z-index
   (30), or the main column, later in the DOM, paints over the account menu
   that drops out of it and swallows every click on its items. */
.wrap {
  position: relative;
  z-index: 1;
}

/* ============ auth panel ============ */

.auth {
  border: 1px solid var(--line);
  background: var(--panel);
  width: 100%;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  position: relative;
}

/* one bar slides between the tabs instead of each tab owning an underline */
.tabbar {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 50%;
  height: 1px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}

.tabbar.right {
  transform: translateX(100%);
}

.tab {
  flex: 1;
  height: 36px;
  font-size: var(--fs-sm);
  color: var(--dim);
  position: relative;
  transition: background var(--t) linear, color var(--t) linear;
}

/* the slider bar is the last child, so a divider keyed on :last-child would
   leave the second tab a border that doubles the panel's own edge */
.tab + .tab {
  border-left: 1px solid var(--line);
}

.tab:focus-visible {
  outline-offset: -2px;
}

.tab:hover {
  background: var(--hover);
  color: var(--text-2);
}

.tab.on {
  background: var(--raise);
  color: var(--text);
  font-weight: 600;
}

.pane {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* field row: always a visible box: panel bg, hairline, dim prompt label */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background var(--t) linear, border-color var(--t) linear;
}

.row:hover {
  border-color: #333;
}

.row:focus-within {
  background: var(--raise);
  border-color: var(--text);
}

/* focus light-sweep along the top edge */
.row::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 1px;
  width: 0;
  background: var(--text);
  opacity: 0;
}

.row:focus-within::after {
  animation: sweep 420ms ease-out forwards;
}

@keyframes sweep {
  from {
    width: 0;
    opacity: 0.9;
  }
  to {
    width: 100%;
    opacity: 0;
  }
}

/* one label column for every form; "display name ›" is the longest at 14ch */
.row .k {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 14ch;
  font-size: var(--fs-sm);
  color: var(--dim);
  flex: none;
  white-space: nowrap;
  user-select: none;
}

.row:focus-within .k {
  color: var(--text-2);
}

.row .at {
  font-size: var(--fs-md);
  color: var(--dim);
  flex: none;
  user-select: none;
}

.row input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: var(--fs-md);
  border: 0;
  outline: none;
  background: transparent;
  caret-color: var(--text);
}

.row input:focus,
.row input:focus-visible {
  outline: none;
  border: 0;
}

.row input::placeholder {
  color: var(--faint);
}

.echo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.echo b {
  color: var(--text-2);
  font-weight: 400;
}

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  font-size: var(--fs-xs);
}

.meter .bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--faint);
}

.meter .cell {
  width: 6px;
  height: 10px;
  background: var(--line-strong);
}

.meter .cell.on {
  background: var(--text);
}

.meter .lvl {
  color: var(--dim);
}

.err {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px;
  font-size: var(--fs-sm);
  color: var(--danger);
  overflow-wrap: anywhere;
}

.err .g {
  flex: none;
}

.note {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 2px;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.note.good {
  color: var(--ok);
}

.submit {
  margin-top: 8px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--text);
  text-align: left;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background var(--t) linear, color var(--t) linear;
}

.submit:hover {
  background: var(--raise);
}

.submit[disabled] {
  color: var(--dim);
  border-color: var(--line-strong);
  cursor: default;
}

.submit[disabled]:hover {
  background: none;
}

.submit > span:first-child {
  white-space: nowrap;
}

.submit .k {
  min-width: 0;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foot-note {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--faint);
}

.foot-note b {
  color: var(--dim);
  font-weight: 400;
}

/* created confirmation */
.created {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.created .summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.created .summary > div {
  display: flex;
  gap: 8px;
}

.created .summary .key {
  flex: none;
  width: 40px;
  color: var(--faint);
}

/* the confirmation arrives in sequence: check, then each line */
.created .note.good {
  animation: reveal 260ms ease-out both;
}

.created .summary .line {
  animation: reveal 240ms ease-out both;
}

.created .summary .line:nth-child(1) {
  animation-delay: 140ms;
}

.created .summary .line:nth-child(2) {
  animation-delay: 260ms;
}

.created .submit {
  animation: reveal 240ms ease-out 380ms both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ============ launcher ============ */

.wrap.left {
  align-items: center;
  justify-content: flex-start;
  padding: 48px 20px 40px;
}

.col.wide {
  max-width: 720px;
  align-items: stretch;
}

.hi {
  margin-bottom: 24px;
  min-width: 0;
}

.hi h1,
.hi .ps1,
.hi .addr {
  overflow-wrap: anywhere;
}

.hi .ps1 {
  font-size: var(--fs-sm);
  color: var(--faint);
  margin-bottom: 4px;
}

.hi .ps1 b {
  color: var(--text-2);
  font-weight: 400;
}

.hi h1 {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hi .addr {
  font-size: var(--fs-sm);
  color: var(--dim);
  margin-top: 4px;
}

.hi .addr .ib {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: -2px;
}

.lhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--faint);
}

.lhead .r {
  margin-left: auto;
  white-space: nowrap;
}

.tiles {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.tile {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  text-align: left;
  width: 100%;
  background: var(--panel);
  transition: background var(--t) linear;
  opacity: 0;
  transform: translateY(6px);
}

.tile.revealed {
  opacity: 1;
  transform: none;
  transition: opacity 260ms ease-out, transform 260ms ease-out, background var(--t) linear;
}

.tile:last-child {
  border-bottom: 0;
}

.tile:hover {
  background: var(--hover);
}

.tile .n {
  font-size: var(--fs-sm);
  color: var(--dim);
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.tile .body {
  min-width: 0;
}

.tile .top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tile .name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
}

.tile .tag {
  font-size: var(--fs-xs);
  color: var(--dim);
  border: 1px solid var(--line-strong);
  padding: 0 4px;
  line-height: 16px;
  flex: none;
}

.tile .desc {
  font-size: var(--fs-sm);
  color: var(--dim);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.tile .acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tile .acts .a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 8px;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-xs);
  transition: background var(--t) linear, color var(--t) linear,
    border-color var(--t) linear;
}

.tile .acts .a:hover {
  background: var(--raise);
  color: var(--text);
  border-color: var(--faint);
}

.tile .acts .a svg {
  width: 12px;
  height: 12px;
  display: block;
  flex: none;
}

.tile .acts .a .k {
  color: var(--faint);
  font-size: var(--fs-xs);
}

.tile .acts .a:hover .k {
  color: var(--text-2);
}

/* No artifact to link to yet: same shape, dimmed, not clickable. */
.tile .acts .soon {
  color: var(--faint);
  border-color: var(--line);
  cursor: default;
}


.tile .dlnote {
  font-size: var(--fs-xs);
  color: var(--faint);
  margin-top: 8px;
}

.tile:focus-visible {
  outline-offset: -1px;
}

/* selected = dark raise + 2px white edge bar, never a white fill */
.tile.sel {
  background: var(--raise);
}

.tile.sel .n,
.tile.sel .name {
  color: var(--text);
}

.tile.sel .desc {
  color: var(--text-2);
}

.tile.sel .tag {
  border-color: var(--faint);
  color: var(--text-2);
}

.tile.sel .dlnote {
  color: var(--dim);
}

.tile.sel .acts .a:hover {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--text);
}

/* After the hover rules above: same specificity, so order decides. */
.tile .acts .soon:hover,
.tile.sel .acts .soon:hover {
  background: none;
  color: var(--faint);
  border-color: var(--line);
}

.tile.sel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
}

.more {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel-2);
  font-size: var(--fs-sm);
  color: var(--faint);
}

.more .n {
  width: 24px;
  font-size: var(--fs-sm);
  color: var(--faint);
  flex: none;
}

.more .r {
  margin-left: auto;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.adminrow {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
}

.adminrow a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-xs);
  transition: background var(--t) linear, color var(--t) linear,
    border-color var(--t) linear;
}

.adminrow a:hover {
  background: var(--raise);
  color: var(--text);
  border-color: var(--faint);
}

.adminrow a svg {
  width: 12px;
  height: 12px;
  display: block;
}

.adminrow .note {
  font-size: var(--fs-xs);
  color: var(--faint);
}

.keys {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.keys kbd {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

/* ============ admin / account ============ */

/* A centred column under the header, on every signed-in page. */
.wrap.admin {
  align-items: center;
  justify-content: flex-start;
  padding: 48px 20px 40px;
}

.col.admin {
  max-width: 1080px;
  align-items: stretch;
  gap: 32px;
}

.col.account {
  max-width: 720px;
  align-items: stretch;
  gap: 32px;
}

/* 404: the launcher's prompt voice, one line of why, one way back */
.col.lost {
  max-width: 520px;
  align-items: flex-start;
}

.lost .ps1 {
  font-size: var(--fs-sm);
  color: var(--faint);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.lost .ps1 b {
  color: var(--text-2);
  font-weight: 400;
}

.lost h1 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.lost .why {
  font-size: var(--fs-sm);
  color: var(--dim);
  margin-top: 4px;
}

.lost .adminrow {
  margin-top: 24px;
}

.sect {
  display: flex;
  flex-direction: column;
}

.shead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--faint);
}

.shead .t {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 600;
}

.shead .r {
  margin-left: auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shead .t {
  flex: none;
}

.form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
  transition: background var(--t) linear, color var(--t) linear,
    border-color var(--t) linear;
}

.btn:hover {
  background: var(--raise);
  color: var(--text);
  border-color: var(--faint);
}

.btn svg {
  width: 12px;
  height: 12px;
  display: block;
  flex: none;
}

.btn.primary {
  border-color: var(--text);
  color: var(--text);
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--raise);
  border-color: var(--text);
}

.btn.sm {
  height: 24px;
  padding: 0 8px;
  font-size: var(--fs-xs);
}

.btn[disabled] {
  color: var(--faint);
  border-color: var(--line);
  cursor: default;
}

.btn[disabled]:hover {
  background: none;
  color: var(--faint);
  border-color: var(--line);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--t) linear, border-color var(--t) linear;
}

.check input:hover {
  border-color: var(--faint);
}

.check input:checked {
  background: var(--text);
  border-color: var(--text);
}

.check input:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.5px solid var(--accent-ink);
  border-bottom: 1.5px solid var(--accent-ink);
  transform: rotate(-45deg) translate(0, -1px);
}

.selwrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--dim);
}

.selwrap select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--t) linear, border-color var(--t) linear;
}

.selwrap select:hover {
  background: var(--raise);
  border-color: var(--faint);
}

.issued {
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: var(--panel-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issued .code {
  font-size: 22px;
  letter-spacing: 0.14em;
  color: var(--text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.issued .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.issued .msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: var(--fs-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.issued .msg .g {
  color: var(--faint);
  flex: none;
}

.issued .msg b {
  color: var(--text);
  font-weight: 400;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  /* Fixed layout so the action column keeps its width and never clips. */
  table-layout: fixed;
}

/* Below this the table scrolls inside .scrollx instead of squeezing. */
.tbl.invites {
  min-width: 620px;
}

.tbl.users {
  min-width: 660px;
}

.tbl .c-code {
  width: 26%;
}

.tbl .c-handle {
  width: 20%;
}

.tbl .c-email {
  width: 30%;
}

.tbl .c-when {
  width: 17%;
}

.tbl .c-created {
  width: 17%;
}

.tbl .c-status {
  width: 24%;
}

.tbl .c-role {
  width: 14%;
}

.tbl .c-act {
  width: 96px;
}

/* copy + revoke at 72px each, the gap and the cell padding */
.tbl.invites .c-act {
  width: 176px;
}

.tbl th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--faint);
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* one row height whether or not the row carries buttons */
.tbl td {
  height: 40px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr:hover {
  background: var(--hover);
}

.tbl .code {
  color: var(--text);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.tbl .num {
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}

.tbl .act {
  text-align: right;
  overflow: visible;
}

/* Every action button is one width, so copy, copied and revoke line up and the
   row does not shift on click. */
.tbl .act .btn {
  height: 24px;
  min-width: 72px;
  padding: 0 8px;
  justify-content: center;
  font-size: var(--fs-xs);
  vertical-align: middle;
}

.tbl .act .btn.cp {
  margin-right: 8px;
}

/* The used/expired invites fold: one quiet row that opens the rest. */
.tbl .fold td {
  padding: 0;
}

.foldbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: var(--fs-xs);
  color: var(--dim);
  white-space: pre;
  text-align: left;
  transition: color var(--t) linear;
}

.foldbtn .k {
  color: var(--faint);
  transition: color var(--t) linear;
}

.foldbtn:hover,
.foldbtn:hover .k,
.foldbtn[aria-expanded="true"] .k {
  color: var(--text);
}

.foldbtn:focus-visible {
  outline-offset: -2px;
}

.scrollx {
  overflow-x: auto;
  /* The table's own border is the visual edge; the scroll box adds none. */
  max-width: 100%;
}

.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
}

.st .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}

.st.unused {
  color: var(--text-2);
}

.st.unused .d {
  background: var(--ok);
}

.st.used {
  color: var(--dim);
}

.st.used .d {
  background: var(--faint);
}

.st.expired {
  color: var(--warn);
}

.st.expired .d {
  background: var(--warn);
}

.st.revoked {
  color: var(--danger);
}

.st.revoked .d {
  background: var(--danger);
}

.st.admin {
  color: var(--text-2);
}

.st.admin .d {
  background: var(--accent);
}

.st.plain {
  color: var(--faint);
}

.st.plain .d {
  background: #2e2e2e;
}

.st.disabled {
  color: var(--warn);
}

.st.disabled .d {
  background: var(--warn);
}

.empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  font-size: var(--fs-sm);
  color: var(--faint);
}

/* account page */
.pane-card {
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pane-card .row {
  background: var(--panel-2);
}

.sess {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  font-size: var(--fs-sm);
}

.sess:first-of-type {
  border-top: 1px solid var(--line);
}

.sess .ua {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.sess .meta {
  font-size: var(--fs-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.sess .meta .this,
.sess .ua .this {
  color: var(--ok);
}

/* key › value rows, one height, an optional action at the end */
.kv {
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.kvrow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 4px 12px;
  font-size: var(--fs-sm);
}

.kvrow + .kvrow {
  border-top: 1px solid var(--line);
}

.kvrow .k {
  color: var(--faint);
  white-space: nowrap;
  user-select: none;
}

.kvrow .k::after {
  content: " ›";
}

.kvrow .v {
  min-width: 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.kvrow .v .sub {
  color: var(--faint);
  font-size: var(--fs-xs);
}

.empty .err {
  padding: 0;
}

/* Present for the password manager, invisible to everyone else. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============ boot ============ */

.boot {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: var(--fs-sm);
}

/* ============ motion ============ */

@media (prefers-reduced-motion: reduce) {
  .row:focus-within::after {
    animation: none;
  }

  .created .note.good,
  .created .summary .line,
  .created .submit {
    animation: none;
  }

  * {
    transition-duration: 1ms !important;
  }
}

/* ============ responsive ============ */

@media (max-width: 640px) {
  .nav {
    padding: 0 16px;
  }

  .nav .crumb {
    display: none;
  }

  .wrap.admin {
    padding: 24px 16px 32px;
  }

  .issued .code {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .nav {
    padding: 0 16px;
  }

  .wrap {
    padding: 24px 16px;
  }

  .wrap.left {
    padding: 24px 16px;
  }

  .mark {
    width: 200px;
    height: 180px;
    margin-bottom: 12px;
  }

  .mark img {
    left: -18.6px;
    top: -28.6px;
    width: 237px;
    height: 237px;
  }

  .tile {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 12px 12px 8px;
  }

  /* Narrow enough that the tables would only scroll: drop the least useful
     column instead, so every row stays readable without a hidden scroll. */
  .tbl.invites {
    min-width: 0;
  }

  .tbl.users {
    min-width: 0;
  }

  .tbl.invites .c-created,
  .tbl.invites th:nth-child(2),
  .tbl.invites td:nth-child(2),
  .tbl.users .c-created,
  .tbl.users th:nth-child(3),
  .tbl.users td:nth-child(3) {
    display: none;
  }

  /* Two action buttons leave room for one more column next to the code:
     status wins, it carries "used → @handle". */
  .tbl.invites .c-when,
  .tbl.invites th:nth-child(3),
  .tbl.invites td:nth-child(3) {
    display: none;
  }

  /* the row action drops under its value instead of squeezing it */
  .kvrow {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 8px 12px;
  }

  .kvrow .btn {
    grid-column: 2;
    justify-self: start;
  }

  /* keyboard hints mean nothing on a touch screen */
  .keys,
  .lhead .r {
    display: none;
  }

  .tbl td {
    font-size: var(--fs-xs);
  }

  .tbl .code {
    letter-spacing: 0;
  }

  .tbl th,
  .tbl td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .tbl .act .btn {
    min-width: 52px;
    padding: 0 6px;
  }

  .tbl .act .btn.cp {
    margin-right: 4px;
  }

  /* Every visible column carries a width: an auto one would be squeezed
     to the leftovers. At 343px: 106 + 113 + 124 for invites, 89 + 96 + 69 + 88
     for users, so a code and "used → @handle" both fit whole. */
  .tbl.invites .c-code {
    width: 31%;
  }

  .tbl.invites .c-status {
    width: 33%;
  }

  .tbl.invites .c-act {
    width: 124px;
  }

  .tbl.users .c-handle {
    width: 26%;
  }

  .tbl.users .c-email {
    width: 28%;
  }

  .tbl.users .c-role {
    width: 20%;
  }

  .tbl.users .c-act {
    width: 88px;
  }
}
