:root {
  --bg: #0b0d12;
  --bg-2: #12151d;
  --bg-3: #181c26;
  --line: #242938;
  --line-2: #2f3548;
  --fg: #e8ecf5;
  --fg-2: #98a1b8;
  --fg-3: #6b7488;
  --accent: #5b8cff;
  --accent-2: #7aa2ff;
  --good: #35c98a;
  --warn: #f5a524;
  --bad: #f2555a;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, .88);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
header.site .inner { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { font-weight: 700; font-size: 17px; color: var(--fg); letter-spacing: -.3px; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
nav.main { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
nav.main a { color: var(--fg-2); font-size: 14px; font-weight: 500; }
nav.main a:hover, nav.main a.active { color: var(--fg); text-decoration: none; }
.tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--fg-2);
  padding: 2px 7px; border-radius: 999px;
}

/* ---------- layout ---------- */
main { padding: 32px 0 64px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.5px; }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -.2px; }
h3 { font-size: 15px; margin: 0 0 10px; color: var(--fg-2); font-weight: 600; }
.sub { color: var(--fg-2); margin: 0 0 24px; font-size: 14px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card.pad-sm { padding: 14px 16px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

/* ---------- stat tiles ---------- */
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat .value.sm { font-size: 20px; }
.stat .hint { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--fg-3); text-transform: none; letter-spacing: 0; }
input[type=text], input[type=url], input[type=email], input[type=password],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--fg); font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.14); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field { margin-bottom: 16px; }
.field .help { font-size: 12px; color: var(--fg-3); margin-top: 5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 150px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.check input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check label { margin: 0; font-weight: 500; color: var(--fg); }
.check .help { font-size: 12px; color: var(--fg-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); text-decoration: none; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--fg-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--fg); }
.btn.danger { background: transparent; border-color: rgba(242,85,90,.4); color: var(--bad); }
.btn.danger:hover { background: rgba(242,85,90,.12); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--fg-3); font-weight: 700; padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-3);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.018); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

code, .mono { font-family: var(--mono); font-size: 13px; }
.short-code { color: var(--accent-2); font-weight: 600; }

/* ---------- misc ---------- */
.pill {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--fg-2);
  text-transform: capitalize;
}
.pill.good { color: var(--good); border-color: rgba(53,201,138,.35); background: rgba(53,201,138,.1); }
.pill.bad { color: var(--bad); border-color: rgba(242,85,90,.35); background: rgba(242,85,90,.1); }
.pill.warn { color: var(--warn); border-color: rgba(245,165,36,.35); background: rgba(245,165,36,.1); }

.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert.err { background: rgba(242,85,90,.1); border-color: rgba(242,85,90,.3); color: #ff9a9d; }
.alert.ok { background: rgba(53,201,138,.1); border-color: rgba(53,201,138,.3); color: #6fe0ae; }
.alert.info { background: rgba(91,140,255,.1); border-color: rgba(91,140,255,.3); color: var(--accent-2); }
.alert.warn { background: rgba(240,173,78,.1); border-color: rgba(240,173,78,.3); color: #f0c274; }

.empty { text-align: center; padding: 48px 20px; color: var(--fg-3); }
.empty .big { font-size: 32px; margin-bottom: 10px; opacity: .5; }

.muted { color: var(--fg-3); }
.small { font-size: 13px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.mt { margin-top: 18px; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }

/* result box after shortening */
.result {
  background: linear-gradient(180deg, rgba(91,140,255,.12), rgba(91,140,255,.04));
  border: 1px solid rgba(91,140,255,.35);
}
.result .url {
  font-family: var(--mono); font-size: 17px; font-weight: 600; color: #fff;
  word-break: break-all; padding: 12px 14px; background: rgba(0,0,0,.3);
  border-radius: 8px; border: 1px solid var(--line-2);
}

/* range filter chips */
.ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.ranges a {
  font-size: 13px; padding: 5px 11px; border-radius: 7px;
  border: 1px solid var(--line-2); color: var(--fg-2); background: var(--bg-2);
}
.ranges a:hover { color: var(--fg); text-decoration: none; border-color: var(--fg-3); }
.ranges a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 8px; }
.bars .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.bars .bar:hover { opacity: 1; background: var(--accent-2); }
.bars .bar span {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--line-2); color: var(--fg); font-size: 11px;
  padding: 3px 7px; border-radius: 5px; white-space: nowrap; margin-bottom: 5px; z-index: 5;
}
.bars .bar:hover span { display: block; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-3); margin-top: 6px; }

/* breakdown list */
.bd { list-style: none; padding: 0; margin: 0; }
.bd li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; position: relative; }
.bd li:last-child { border-bottom: none; }
.bd .fill { position: absolute; left: -6px; top: 3px; bottom: 3px; background: rgba(91,140,255,.13); border-radius: 4px; z-index: 0; }
.bd .txt { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; }
.bd .n { color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: 13px; }

/* hero on home */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: 38px; letter-spacing: -1px; margin-bottom: 10px; }
.hero p { color: var(--fg-2); font-size: 16px; max-width: 560px; margin: 0 auto; }
.shortbox { display: flex; gap: 10px; flex-wrap: wrap; }
.shortbox input[type=url] { flex: 3; min-width: 220px; font-size: 15px; padding: 13px 14px; }
.shortbox select { flex: 1; min-width: 160px; }
.shortbox .btn { padding: 13px 26px; }

footer.site { border-top: 1px solid var(--line); padding: 22px 0; color: var(--fg-3); font-size: 13px; }
footer.site .inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.qr { background: #fff; padding: 10px; border-radius: 8px; display: inline-block; line-height: 0; }
.qr img { width: 150px; height: 150px; display: block; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-size: 14px; color: var(--fg-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  header.site .inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  nav.main { margin-left: 0; width: 100%; gap: 14px; }
}
