:root {
  color-scheme: dark;
  --bg: #272b33;
  --panel: #1a1919;
  --panel-2: #262a33;
  --footer: var(--bg);
  --text: #eaeaea;
  --muted: #c8c8c8;
  --line: #51555d;
  --line-soft: #3b414c;
  --control-line: #5b6270;
  --orange: #f47a16;
  --orange-dark: #c94710;
  --button-line: #a94f10;
  --cyan: #8cd2d5;
  --cyan-hover: #a9dde0;
  --danger: #ff5f5f;
  --ok: #34d66b;
  --max: 1024px;
  --panel-gap: 14px;
  --panel-pad: 18px;
  --panel-min-small: 164px;
  --panel-min-wide: 148px;
  --button-min-width: 128px;
  --control-padding: 10px 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--cyan);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cyan-hover);
}

code {
  color: var(--text);
  background: var(--panel-2);
  border-radius: 0;
  padding: 0.08em 0.28em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.masthead-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 156px;
}

.brand img {
  display: block;
  width: 156px;
  height: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
}

.nav a,
.nav summary {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.nav a.active,
.nav-more.active > summary,
.nav-more[open] > summary {
  color: #bbbbbb;
}

.nav-more {
  position: relative;
}

.nav-more summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary::after {
  content: "▾";
  color: var(--orange);
  font-size: 0.8em;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  min-width: 160px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.25);
}

.nav-menu a {
  display: block;
  padding: 10px 12px;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text);
  background: var(--panel);
}

.hero,
.page-head {
  padding: 42px 0 22px;
}

.section {
  padding: 18px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 100%;
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  overflow-wrap: break-word;
  white-space: nowrap;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

h3 {
  font-size: 1.12rem;
}

p,
li {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  margin: 10px 0 0;
  max-width: 100%;
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 20px;
  min-width: 0;
}

.button,
button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  flex: 0 0 auto;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-width: var(--button-min-width);
  min-height: 42px;
  border: 1px solid var(--button-line);
  border-radius: 0;
  padding: 10px 16px;
  color: #fff;
  background: var(--orange);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  color: #fff;
}

.button.secondary,
button.secondary {
  color: var(--text);
  border-color: var(--line-soft);
  background: var(--panel-2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button,
button[aria-label^="Close" i],
button[data-invoice-close] {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  aspect-ratio: 1 / 1;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--panel-gap);
  align-items: stretch;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.manage-layout {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.grid.manage-layout.is-authenticated {
  grid-template-columns: minmax(0, 1fr);
}

.card,
.form-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: var(--panel-pad);
  overflow-wrap: break-word;
}

.card {
  display: flex;
  flex-direction: column;
}

.grid > .card {
  min-height: var(--panel-min-small);
}

.grid.two > .card {
  min-height: var(--panel-min-wide);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--panel-gap);
  margin-top: 20px;
  max-width: 760px;
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.home-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--muted);
  background: var(--panel);
}

.home-stat strong {
  color: var(--orange);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.home-stat span {
  color: var(--muted);
  font-weight: 700;
}

.stat-card {
  min-height: 88px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: var(--panel);
}

.stat-card strong {
  display: block;
  color: var(--orange);
  font-size: 1.8rem;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.card > * + * {
  margin-top: 12px;
}

.card > .price {
  margin: auto 0 0;
}

.package-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: var(--panel-gap);
  border: 1px solid var(--line);
  padding: 18px 20px;
  background: var(--panel);
}

.package-strip h3,
.package-strip p {
  margin: 0;
}

.package-strip h3 + p {
  margin-top: 6px;
}

.package-strip > .price {
  flex: 0 0 auto;
  font-size: 1.35rem;
  white-space: nowrap;
}

.code-list {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.code-list code {
  max-width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 0.92rem;
}

.status-chip {
  justify-content: center;
  min-width: 108px;
}

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

.chip.pending {
  color: var(--orange);
  border-color: var(--orange-dark);
}

.chip.warning {
  color: var(--orange);
  border-color: var(--orange);
}

.chip.error {
  color: var(--danger);
  border-color: var(--danger);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: var(--ok);
}

.dot.pending {
  background: var(--orange);
}

.dot.warning {
  background: var(--orange);
}

.dot.error {
  background: var(--danger);
}

.copy-icon-button {
  width: 34px;
  height: 30px;
  min-width: 0;
  min-height: 0;
  display: inline-grid;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.18);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  font-size: 1rem;
  line-height: 1;
}

.copy-icon-button:hover {
  border-color: var(--orange);
  color: #fff;
}

.copy-icon-button.is-copied {
  color: var(--ok);
  border-color: var(--ok);
}

.copy-icon-button.is-error {
  color: var(--danger);
  border-color: var(--danger);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-panel,
.directory-panel,
.table-wrap,
.manage-layout > .card {
  width: 100%;
}

.admin-panel {
  display: grid;
  gap: var(--panel-gap);
  margin-top: var(--panel-gap);
}

.admin-stats {
  max-width: none;
  margin-top: 0;
}

.admin-table-wrap table {
  table-layout: fixed;
}

.table-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.compact-actions {
  margin: 0;
}

.handle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: start;
}

.field {
  display: grid;
  gap: 6px;
}

.field-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

label,
legend {
  color: var(--text);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--control-line);
  border-radius: 0;
  padding: var(--control-padding);
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
}

.app-select-source {
  display: none !important;
}

.app-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.app-select-button {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  justify-content: space-between;
  gap: 12px;
  border-color: var(--control-line);
  padding: var(--control-padding);
  color: var(--text);
  background: var(--panel-2);
  font-weight: 500;
  text-align: left;
}

.app-select-button:focus {
  outline: 2px solid var(--orange);
  border-color: var(--orange);
}

.app-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-select-arrow {
  color: var(--text);
  line-height: 1;
}

.app-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 45;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--orange);
  background: var(--panel-2);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.32);
}

.app-select-menu[hidden] {
  display: none;
}

.app-select-option {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel-2);
  font-weight: 500;
  text-align: left;
}

.app-select-option:last-child {
  border-bottom: 0;
}

.app-select-option:hover,
.app-select-option:focus,
.app-select-option[aria-selected="true"] {
  outline: 0;
  color: #fff;
  background: var(--panel);
}

.app-select-option[aria-selected="true"]::before {
  content: "✓";
  margin-right: 8px;
  color: var(--orange);
}

.app-select.is-disabled {
  opacity: 0.65;
}

.field.is-ok .app-select-button {
  border-color: var(--ok);
}

.field.is-error .app-select-button,
.field.is-missing .app-select-button {
  border-color: var(--danger);
}

.field.is-pending .app-select-button {
  border-color: var(--orange);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--orange);
  border-color: var(--orange);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 42px;
}

.input-status {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-grid;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  place-items: center;
  border: 1px solid currentColor;
  background: var(--panel-2);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.input-status[hidden] {
  display: none;
}

.input-status.is-ok {
  color: var(--ok);
}

.input-status.is-error {
  color: var(--danger);
}

.input-status.is-pending {
  color: var(--orange);
}

.field.is-ok input,
.field.is-ok select,
.field.is-ok textarea {
  border-color: var(--ok);
}

.field.is-error input,
.field.is-error select,
.field.is-error textarea,
.field.is-missing input,
.field.is-missing select,
.field.is-missing textarea {
  border-color: var(--danger);
}

.field.is-pending input,
.field.is-pending select,
.field.is-pending textarea {
  border-color: var(--orange);
}

.field-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: default;
}

.field-icon:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

.field-icon[data-tip]::before,
.field-icon[data-tip]::after {
  position: absolute;
  z-index: 50;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
}

.field-icon[data-tip]::before {
  content: "";
  bottom: calc(100% + 3px);
  border: 5px solid transparent;
  border-top-color: var(--line);
}

.field-icon[data-tip]::after {
  content: attr(data-tip);
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.field-icon[data-tip]:hover::before,
.field-icon[data-tip]:hover::after,
.field-icon[data-tip]:focus-visible::before,
.field-icon[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

textarea {
  min-height: 132px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.checks {
  display: grid;
  gap: 6px;
}

.relay-group {
  gap: 10px;
  margin-top: 4px;
}

.relay-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.relay-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  line-height: 1.15;
}

.relay-option:has(input:checked) {
  border-color: var(--orange);
}

.relay-option.is-disabled,
.relay-option:has(input:disabled) {
  color: var(--muted);
  opacity: 0.65;
}

.relay-option strong {
  min-width: 0;
  color: var(--text);
}

.relay-option.is-disabled strong,
.relay-option:has(input:disabled) strong {
  color: var(--muted);
}

.relay-price {
  color: var(--orange);
  font-size: 1.15rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  color: var(--muted);
  line-height: 1.25;
}

.terms-row {
  width: fit-content;
  margin-top: 4px;
  border: 0;
  padding: 0;
}

.terms-row.is-error,
.terms-row.is-missing {
  border: 0;
}

.terms-row.is-error input,
.terms-row.is-missing input {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.check-row input,
.relay-option input {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--orange);
}

.price-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--panel);
}

.receipt-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(148px, auto) auto;
  gap: 10px;
  align-items: stretch;
  justify-content: stretch;
  justify-items: stretch;
}

.receipt-lines {
  display: grid;
  gap: 6px;
  align-content: start;
}

.receipt-line,
.receipt-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.receipt-line > span:last-child,
.receipt-total > .price {
  justify-self: end;
  min-width: 11rem;
  text-align: right;
}

.receipt-line {
  color: var(--muted);
  font-size: 0.98rem;
}

.receipt-line.subtotal {
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
  color: var(--text);
}

.receipt-line.discount {
  color: var(--orange);
}

.receipt-total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.user-count {
  display: inline;
  color: var(--orange);
}

.price {
  color: var(--orange);
  font-size: 1.65rem;
  font-weight: 900;
}

.price-box .price {
  font-size: 1.35rem;
}

.invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.invoice-card {
  position: relative;
  width: min(760px, 100%);
  border: 1px solid var(--line);
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

.invoice-card h2 {
  margin: 0 38px 14px 0;
  font-size: 1.4rem;
}

.invoice-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.4rem;
}

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.invoice-qr-panel,
.invoice-details {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.invoice-qr-panel {
  display: grid;
  place-items: center;
  padding: 14px;
}

.invoice-details {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 14px;
}

.invoice-details-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.invoice-detail-lines {
  display: grid;
  gap: 6px;
  align-content: start;
}

.invoice-detail-lines:empty::before {
  content: "Relay access";
  color: var(--muted);
}

.invoice-detail-lines .receipt-line,
.invoice-detail-total {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.invoice-detail-lines .receipt-line > span:last-child,
.invoice-detail-total > span {
  min-width: 0;
  white-space: nowrap;
}

.invoice-detail-total {
  display: grid;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.invoice-detail-total > span {
  justify-self: end;
  color: var(--orange);
  font-size: 1.15rem;
  font-weight: 900;
}

.invoice-qr {
  display: block;
  width: min(246px, 100%);
  max-width: 100%;
  height: auto;
  border: 8px solid #fff;
  background: #fff;
}

.invoice-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: stretch;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.invoice-code code {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-code .copy-icon-button {
  position: static;
  width: 46px;
  height: auto;
  min-height: 100%;
  min-width: 0;
  border-width: 0 0 0 1px;
  border-color: var(--line);
  background: var(--panel);
}

.invoice-actions {
  margin-top: 14px;
}

.invoice-success {
  display: grid;
  gap: 16px;
}

.invoice-success[hidden],
.invoice-success.is-hidden {
  display: none;
}

.invoice-success-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-success-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.invoice-success-kicker,
.invoice-success-copy,
.invoice-success-note {
  margin: 0;
}

.invoice-success-kicker {
  color: var(--text);
  font-weight: 900;
}

.invoice-success-copy,
.invoice-success-note {
  color: var(--muted);
}

.invoice-success-list {
  display: grid;
  gap: 10px;
}

.invoice-success-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--panel-2);
}

.invoice-success-label {
  color: var(--text);
  font-weight: 900;
}

.invoice-success-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.invoice-success-value code {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-success-value .copy-icon-button {
  position: static;
  width: 46px;
  height: auto;
  min-height: 100%;
  min-width: 0;
  border-width: 0 0 0 1px;
  border-color: var(--line);
  background: var(--panel);
}

.status-banner {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  padding: 11px 12px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.status-banner.ok {
  border-left-color: var(--ok);
  color: var(--text);
}

.status-banner.error {
  border-left-color: var(--danger);
  color: var(--text);
}

.status-banner.pending {
  border-left-color: var(--orange);
  color: var(--text);
}

.status-banner[hidden] {
  display: none;
}

.faq-list {
  display: grid;
  gap: var(--panel-gap);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--orange);
  font-weight: 900;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin-top: 10px;
}

.auth-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-method {
  border-color: var(--line-soft);
  color: var(--text);
  background: var(--panel-2);
}

.auth-method.is-active {
  border-color: var(--orange);
  color: #fff;
  background: var(--panel);
}

.auth-panel {
  display: grid;
  gap: 12px;
}

.auth-panel[hidden] {
  display: none;
}

.signer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.session-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--panel-gap);
}

.session-controls[hidden] {
  display: none;
}

.session-controls .small {
  max-width: 520px;
}

.signer-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
  line-height: 1.2;
}

.signer-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-textarea-wrap {
  position: relative;
}

.copy-textarea-wrap textarea {
  padding-right: 52px;
  padding-bottom: 48px;
}

.copy-textarea-wrap .copy-icon-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 30px;
}

.auth-panel textarea {
  min-height: 104px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.directory-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.directory-panel .table-wrap {
  border: 0;
}

.compact-table table {
  min-width: 0;
}

.table-wrap + .form-grid {
  margin-top: 14px;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.directory-table {
  table-layout: fixed;
  min-width: 760px;
}

.status-table {
  table-layout: fixed;
}

.status-table th:nth-child(1),
.status-table td:nth-child(1) {
  width: 30%;
}

.status-table th:nth-child(2),
.status-table td:nth-child(2) {
  width: 150px;
}

.status-source {
  display: inline-block;
  max-width: 100%;
}

.directory-col-handle {
  width: 34%;
}

.directory-col-domain {
  width: 18%;
}

.directory-col-pubkey {
  width: 34%;
}

.directory-col-profile {
  width: 14%;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text);
  background: var(--panel-2);
}

td {
  color: var(--muted);
}

.copy-token {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
}

.copy-token .clip-text {
  flex: 0 1 auto;
  padding: 8px 10px;
}

.handle-token .handle-label {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
}

.handle-token {
  width: min(100%, 36ch);
}

.handle-token .handle-name {
  display: block;
  flex: 0 1 auto;
  max-width: 13ch;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handle-token .handle-domain {
  flex: 0 0 auto;
  white-space: nowrap;
}

.copy-token .copy-icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 100%;
  min-height: 34px;
  border-width: 0 0 0 1px;
  border-color: var(--line-soft);
  background: var(--panel-2);
}

.clip-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-table code {
  background: transparent;
  padding: 0;
}

.match-highlight {
  color: var(--orange);
  background: transparent;
  font-weight: 900;
}

.directory-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.directory-tools input {
  background: var(--panel-2);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
}

.directory-pager {
  margin-top: 0;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}

.directory-count {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.profile-options {
  width: fit-content;
}

.profile-options summary {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
  list-style: none;
}

.profile-options summary::-webkit-details-marker {
  display: none;
}

.profile-options-list {
  display: grid;
  gap: 4px;
  min-width: 112px;
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  padding: 6px;
  background: var(--panel-2);
}

.profile-options-list a {
  padding: 5px 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.profile-options-list a:hover {
  color: #fff;
  background: var(--panel);
}

.footer {
  flex-shrink: 0;
  margin-top: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  background: var(--footer);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}

.small {
  font-size: 0.92rem;
}

.form-grid > .actions {
  margin-top: 2px;
}

.form-grid > .status-banner {
  margin-top: 0;
}

@media (max-width: 820px) {
  body {
    background: var(--bg);
  }

  .masthead-inner {
    display: block;
    padding: 10px 0 12px;
  }

  .brand {
    width: 145px;
  }

  .brand img {
    width: 145px;
  }

  .nav {
    gap: 11px;
    padding-top: 12px;
    overflow: visible;
  }

  .nav a,
  .nav summary {
    font-size: 0.92rem;
  }

  .nav-menu {
    left: auto;
    right: 0;
  }

  .hero,
  .page-head {
    padding-top: 28px;
  }

  h1 {
    white-space: normal;
  }

  .grid,
  .grid.two,
  .handle-row,
  .stats-grid,
  .signer-panel {
    grid-template-columns: 1fr;
  }

  .signer-action {
    align-items: stretch;
    justify-content: space-between;
  }

  .relay-options {
    grid-template-columns: 1fr;
  }

  .card,
  .form-panel {
    padding: 14px;
  }

  .price-box {
    display: grid;
  }

  .invoice-card {
    padding: 16px;
  }

  .invoice-layout {
    grid-template-columns: 1fr;
  }

  .package-strip {
    display: grid;
  }

  .package-strip > .price {
    white-space: normal;
  }

  table {
    min-width: 560px;
  }

  .directory-tools {
    grid-template-columns: 1fr;
  }

}
