:root {
  --bg: #0b0d11;
  --surface: #14171d;
  --elevated: #1b1f28;
  --fg: #eef0f4;
  --muted: #8f97a8;
  --subtle: #6b7384;
  --accent: #6ec8c0;
  --primary: #eef0f4;
  --primary-fg: #0b0d11;
  --danger: #c45c5c;
  --border: rgba(255, 255, 255, 0.08);
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); color: var(--fg); }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(to right, rgba(238, 240, 244, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 240, 244, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

.top, .foot, .main { width: min(960px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; font-size: 18px; text-decoration: none; }
.mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--border);
}
nav { display: flex; gap: 8px; }
nav a { color: var(--muted); padding: 12px 10px; border-radius: 12px; text-decoration: none; }
nav a.is-active, nav a:hover { color: var(--fg); text-decoration: none; }

.main { flex: 1; padding: 48px 0 64px; }
.hero { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.hero.split { text-align: left; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: end; max-width: none; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.03em; margin: 8px 0 12px; font-weight: 600; }
h1 span { color: var(--muted); }
.lede { color: var(--muted); line-height: 1.55; margin: 0 auto; }
.hero.split .lede { margin: 0; }

.composer {
  background: var(--surface);
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 0 0 1px var(--border);
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .composer:not(.login) { grid-template-columns: 1fr auto; }
}
.composer input {
  height: 48px; border: 0; border-radius: 16px; background: var(--elevated); color: var(--fg);
  padding: 0 16px; font-size: 16px; box-shadow: 0 0 0 1px var(--border);
}
.composer button, .btn {
  height: 48px; min-width: 140px; border: 0; border-radius: 16px; background: var(--primary); color: var(--primary-fg);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px;
}
.hint, .form-error { grid-column: 1 / -1; margin: 0 8px 6px; font-size: 12px; color: var(--subtle); }
.form-error { color: var(--danger); }

.result, .empty, .table-wrap, .stats article {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  border-radius: 28px;
}
.result { max-width: 640px; margin: 24px auto 0; padding: 24px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--subtle); margin: 0; }
.short { font-family: var(--mono); font-size: 16px; word-break: break-all; }
.dest { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 32px auto 0; }
.stats article { padding: 20px; }
.num { font-family: var(--mono); font-size: 32px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 56px 24px; }
.table-wrap { overflow-x: auto; margin-top: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--subtle); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 20px; border-bottom: 1px solid var(--border); }
td { padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.mono { font-family: var(--mono); }
td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }
.link-danger { background: none; border: 0; color: var(--danger); cursor: pointer; padding: 8px; }
.meta { color: var(--muted); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding: 24px 0; border-top: 1px solid var(--border); color: var(--subtle); font-size: 12px; }
.foot p { margin: 0; }
