/*
 * The server's own page: setup and status, and nothing to listen with.
 *
 * Hand-written rather than part of the app. The app is one Expo build shared by
 * the browser tab, the phone and the desktop shell, and it draws a library; this
 * draws a server. Keeping them apart is what stopped `localhost:4600` looking
 * like a fourth, signed-out copy of the app.
 */

:root {
  color-scheme: light dark;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f0f0f2;
  --border: #e1e1e5;
  --text: #17171a;
  --text-2: #55555f;
  --muted: #85858f;
  --accent: #b5316b;
  --on-accent: #ffffff;
  --good: #1c7c4a;
  --danger: #b4242b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1b1b1f;
    --surface-2: #232329;
    --border: #2e2e36;
    --text: #f2f2f4;
    --text-2: #b6b6c0;
    --muted: #82828e;
    --accent: #e8508f;
    --on-accent: #1b0a12;
    --good: #4ad08a;
    --danger: #ff6b6b;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

.masthead h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.masthead .lede {
  margin: 8px 0 28px;
  color: var(--text-2);
  max-width: 54ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  margin-bottom: 12px;
}

.tag {
  color: var(--muted);
  font-size: 13px;
}

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

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.row-label {
  margin: 0;
  font-weight: 500;
}

.row-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 48ch;
}

.row-value {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

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

.button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 13px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.button:hover:not(:disabled) {
  border-color: var(--muted);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}

.button.danger {
  color: var(--danger);
}

.notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.notice.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.notice.good {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 40%, var(--border));
}

.lead {
  margin: 0 0 14px;
  color: var(--text-2);
  max-width: 58ch;
}

.field {
  display: block;
  margin: 0 0 12px;
}

.field span {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.meter {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 8px;
}

.meter > i {
  display: block;
  height: 100%;
  background: var(--accent);
}

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

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
}
