/* =============================================================
   LnkTo — original brand stylesheet
   Palette: ink (#0F1115) on cream (#F4EEE2), amber accent (#C45A2A),
            muted gold (#D9A441). No purple, no glow, no pill.
   Fonts:   Space Grotesk (display) + Inter (body) + IBM Plex Mono (codes)
   ============================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink:        #0F1115;
  --ink-soft:   #1B1F26;
  --cream:      #F4EEE2;
  --cream-2:    #EAE0CD;
  --paper:      #FBF7EE;
  --line:       #2A2F38;
  --line-soft:  #3A404A;
  --muted:      #8A857A;
  --muted-2:    #5E5A52;
  --amber:      #C45A2A;
  --amber-deep: #A0451E;
  --gold:       #D9A441;
  --danger:     #B0392E;
  --ok:         #2F6A3D;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-1: 0 1px 0 rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-2: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);

  --maxw: 1080px;
}

html { height: 100%; font-size: 15px; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle paper-grain backdrop using two layered gradients. Pure CSS,
   no images, no animation. */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(196,90,42,0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(217,164,65,0.05), transparent 60%);
  z-index: 0;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--amber); }

button { font: inherit; cursor: pointer; }
input, button, select, textarea { font: inherit; color: inherit; }

code, .mono { font-family: var(--font-mono); }

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

.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--ink); color: var(--cream);
  padding: 8px 12px; border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: 8px; }

/* ---------- Top bar -------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244, 238, 226, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(15, 17, 21, 0.08);
}
.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand__mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--ink); color: var(--cream);
  border-radius: 8px;
}
.brand__mark svg { display: block; }
.brand__word { transform: translateY(0.5px); }
.brand:hover { color: var(--ink); }
.brand:hover .brand__mark { background: var(--amber); }

.topnav { display: flex; gap: 6px; }
.topnav__link {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.94rem;
  color: var(--ink);
  transition: background 120ms ease, color 120ms ease;
}
.topnav__link:hover { background: rgba(15, 17, 21, 0.06); color: var(--ink); }
.topnav__link[aria-current="page"] {
  background: var(--ink);
  color: var(--cream);
}

/* ---------- Page frame ----------------------------------------- */
.page {
  flex: 1;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ---------- Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 120ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.btn--ink {
  background: var(--ink);
  color: var(--cream);
}
.btn--ink:hover { background: var(--amber); color: var(--cream); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(15, 17, 21, 0.18);
}
.btn--ghost:hover { background: rgba(15, 17, 21, 0.05); color: var(--ink); }
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(176, 57, 46, 0.3);
}
.btn--danger:hover { background: rgba(176, 57, 46, 0.08); color: var(--danger); }
.btn svg { flex: none; }


/* ---------- Home / hero ---------------------------------------- */
.hero { margin-top: 16px; }
.hero__inner { max-width: 720px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero__accent {
  color: var(--amber);
  display: inline-block;
}
.hero__sub {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--muted-2);
  max-width: 56ch;
}

.shorten {
  margin-top: 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.shorten__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted-2);
}
.shorten__row {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: var(--radius);
  padding: 6px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.shorten__row:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(196, 90, 42, 0.18);
}
.shorten__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  font-size: 1.02rem;
  color: var(--ink);
  min-width: 0;
}
.shorten__input::placeholder { color: #B2AB9C; }
.shorten__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--cream);
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  font-weight: 600;
}
.shorten__btn:hover { background: var(--amber); }
.shorten__help {
  font-size: 0.86rem;
  color: var(--muted-2);
}
.shorten__help code {
  background: rgba(15, 17, 21, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.84rem;
}
.form-error {
  margin-top: 4px;
  color: var(--danger);
  font-weight: 500;
  font-size: 0.92rem;
}
.honeypot {
  position: absolute;
  left: -9999px; top: -9999px;
  width: 0; height: 0; overflow: hidden;
}

/* ---------- Features row --------------------------------------- */
.features {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.feature__icon {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 8px;
  margin-bottom: 14px;
}
.feature__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.feature__body {
  color: var(--muted-2);
  font-size: 0.95rem;
}

/* ---------- Success / result page ------------------------------ */
.result {
  max-width: 640px;
  margin: 16px auto 0;
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}
.result__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--amber);
}
.result__title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.result__prefix {
  color: var(--muted);
  font-weight: 500;
  margin-right: 4px;
}
.result__code {
  display: inline-flex;
  background: linear-gradient(transparent 70%, rgba(217, 164, 65, 0.35) 70%);
  padding: 0 4px;
}
.result__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px) rotate(-2deg);
  animation: charIn 320ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes charIn {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.result__bar {
  margin: 24px auto 0;
  display: inline-flex; align-items: stretch;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 4px;
  max-width: 100%;
}
.result__link {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.result__copy {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--amber);
  color: var(--cream);
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 160ms ease;
}
.result__copy:hover { background: var(--amber-deep); }
.result__copy--ok { background: var(--ok) !important; }

.result__target {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--cream-2);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result__target strong { font-weight: 600; }
.result__target:hover { background: var(--ink); color: var(--cream); }
.result__target:hover strong { color: var(--gold); }
.result__fav { border-radius: 3px; flex: none; }

.result__actions {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}


/* ---------- List (all links) page ------------------------------ */
.list { max-width: 100%; }
.list__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.list__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber);
}
.list__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.list__sub { color: var(--muted-2); font-size: 0.95rem; margin-top: 4px; }

.list__search { display: flex; align-items: center; }
.search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: var(--radius);
  color: var(--muted-2);
  min-width: 280px;
  transition: border-color 160ms ease;
}
.search:focus-within { border-color: var(--ink); }
.search__input {
  background: transparent;
  border: 0; outline: 0;
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
}
.search__input::placeholder { color: #B2AB9C; }

.flash {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.flash--ok {
  background: rgba(47, 106, 61, 0.1);
  color: var(--ok);
  border: 1px solid rgba(47, 106, 61, 0.25);
}
.flash code { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 4px; }

.empty {
  background: var(--paper);
  border: 1px dashed rgba(15, 17, 21, 0.18);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
}
.empty__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.empty__body {
  color: var(--muted-2);
  margin: 8px 0 18px;
}

.table-wrap {
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.tbl thead th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted-2);
  padding: 14px 16px;
  background: var(--cream-2);
  border-bottom: 1px solid rgba(15, 17, 21, 0.08);
}
.tbl__sort {
  color: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.tbl__sort:hover { color: var(--ink); }
.tbl tbody tr { border-bottom: 1px solid rgba(15, 17, 21, 0.05); }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(15, 17, 21, 0.02); }
.tbl__td { padding: 12px 16px; vertical-align: middle; }
.tbl__td--ellipsis {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbl--compact .tbl__td { padding: 8px 12px; }
.tbl--compact time { font-size: 0.85rem; color: var(--muted-2); }

.tbl__th--code { width: 18%; }
.tbl__th--hits { width: 10%; text-align: right; }
.tbl__th--when  { width: 18%; }
.tbl__th--actions { width: 1%; }

.tbl__td--code { white-space: nowrap; }
.tbl__td--hits { text-align: right; }
.tbl__td--when  { color: var(--muted-2); font-size: 0.88rem; font-family: var(--font-mono); }

.code-chip {
  display: inline-flex; align-items: center;
  padding: 5px 10px 5px 6px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 160ms ease;
}
.code-chip:hover { background: var(--amber); color: var(--cream); }
.code-chip__prefix { color: var(--muted); margin-right: 1px; font-weight: 500; }

.dest {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  color: var(--ink);
}
.dest__fav { border-radius: 3px; flex: none; }
.dest__text {
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.hits {
  display: inline-block;
  min-width: 32px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.06);
  color: var(--muted-2);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
}
.hits--live {
  background: var(--amber);
  color: var(--cream);
}

.row-act {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: transparent;
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--ink);
  margin-right: 4px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.row-act:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.row-act--delete:hover { background: var(--danger); border-color: var(--danger); color: var(--cream); }
.row-act__btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: transparent;
  border: 1px solid rgba(176, 57, 46, 0.3);
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--danger);
}
.row-act__btn:hover { background: var(--danger); color: var(--cream); border-color: var(--danger); }
.row-act__btn:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

.pager {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap;
}
.pager__btn {
  padding: 8px 14px;
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: var(--radius);
  font-weight: 500;
}
.pager__btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.pager__btn--off { color: var(--muted); border-color: rgba(15, 17, 21, 0.06); cursor: default; }
.pager__btn--off:hover { background: transparent; color: var(--muted); border-color: rgba(15, 17, 21, 0.06); }
.pager__count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted-2);
}


/* ---------- Analytics page ------------------------------------- */
.ana { max-width: 100%; }
.ana__head { margin-bottom: 28px; }
.ana__crumb {
  font-size: 0.86rem;
  color: var(--muted-2);
  display: flex; align-items: center; gap: 8px;
}
.ana__crumb a { color: var(--muted-2); }
.ana__crumb a:hover { color: var(--ink); }
.ana__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  display: inline-flex;
  align-items: baseline;
}
.ana__prefix { color: var(--muted); font-weight: 500; margin-right: 4px; }
.ana__code {
  background: linear-gradient(transparent 70%, rgba(217, 164, 65, 0.35) 70%);
  padding: 0 4px;
}
.ana__target {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--cream-2);
  border-radius: 999px;
  font-size: 0.88rem;
  max-width: 100%;
  overflow: hidden;
}
.ana__target span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 60ch;
}
.ana__target:hover { background: var(--ink); color: var(--cream); }
.ana__fav { border-radius: 3px; flex: none; }

.kpis {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--radius);
  padding: 16px;
}
.kpi__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted-2);
}
.kpi__value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.kpi__value--small {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0;
}
.trend--up   { color: var(--ok); }
.trend--down { color: var(--danger); }
.trend       { color: var(--muted-2); }

.card {
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__sub {
  font-size: 0.86rem;
  color: var(--muted-2);
}
.card__sub strong { color: var(--ink); }
.card__empty {
  color: var(--muted-2);
  font-size: 0.95rem;
  padding: 12px 0;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.card-row > .card { margin-bottom: 0; }

/* Bar chart */
.chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 160px;
  padding: 4px 0 0;
}
.chart__col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%;
  position: relative;
}
.chart__bar {
  width: 100%;
  max-width: 36px;
  min-height: 4px;
  background: var(--ink);
  border-radius: 4px 4px 0 0;
  margin-top: auto;
  transition: background 200ms ease;
}
.chart__col:hover .chart__bar { background: var(--amber); }
.chart__day {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-2);
  white-space: nowrap;
}

/* Ranked list (referrers, devices) */
.ranked { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ranked__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2fr auto;
  align-items: center;
  gap: 12px;
}
.ranked__label {
  font-size: 0.9rem;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranked__bar {
  height: 8px;
  background: rgba(15, 17, 21, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.ranked__fill {
  display: block;
  height: 100%;
  background: var(--amber);
  border-radius: 999px;
}
.ranked__count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted-2);
  min-width: 24px; text-align: right;
}

.ana__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
}


/* ---------- 404 page ------------------------------------------- */
.notfound {
  max-width: 640px;
  margin: 60px auto 0;
  text-align: center;
  padding: 32px 16px;
}
.notfound__eyebrow {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  letter-spacing: -0.06em;
}
.notfound__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--ink);
  margin-top: 10px;
}
.notfound__sub {
  color: var(--muted-2);
  margin: 12px 0 26px;
  max-width: 42ch;
  margin-left: auto; margin-right: auto;
}
.notfound__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------------------------------------------- */
.foot {
  background: var(--ink);
  color: var(--muted-2);
  font-size: 0.85rem;
  margin-top: auto;
}
.foot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 24px 40px;
  display: flex; flex-direction: column; gap: 12px;
  text-align: center;
}
.foot__line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot__brand { font-family: var(--font-display); font-weight: 700; color: var(--cream); }
.foot__sep { color: var(--muted); opacity: 0.5; }
.foot__meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.foot__link { color: var(--gold); }
.foot__link:hover { color: var(--amber); }

/* ---------- Popup (custom link modal) ------------------------------- */
.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.popup[aria-hidden="false"] { display: flex; }
.popup__backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(4px);
}
.popup__panel {
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.popup__close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent; border: 0;
  padding: 6px; color: var(--muted-2);
  cursor: pointer;
}
.popup__close:hover { color: var(--ink); }
.popup__title {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--ink); margin-bottom: 4px;
}
.popup__sub {
  color: var(--muted-2); font-size: 0.9rem; margin-bottom: 20px;
}
.popup__body {
  display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px;
}
.popup__actions {
  display: flex; gap: 10px; justify-content: stretch;
}
.popup__actions .btn { flex: 1; }

/* Fields & toggles */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.12em; font-weight: 600; color: var(--muted-2);
}
.field__label span { display: block; }
.field__desc {
  margin-top: 2px; font-size: 0.82rem;
  color: var(--muted-2); font-weight: 400;
}
.field__input {
  padding: 8px 12px;
  border: 1px solid rgba(15, 17, 21, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.95rem; background: var(--paper); color: var(--ink);
}
.field__input:focus {
  outline: 2px solid var(--amber); outline-offset: 1px;
}
.field__control {
  display: inline-flex; align-items: center; gap: 8px;
}
.field__unit { font-size: 0.85rem; color: var(--muted-2); }

/* Toggle switch */
.toggle {
  display: inline-flex; align-items: center; justify-content: flex-end;
  width: fit-content;
}
.toggle input { display: none; }
.toggle__track {
  position: relative;
  width: 44px; height: 24px;
  background: rgba(15, 17, 21, 0.12);
  border-radius: 999px; cursor: pointer;
  transition: background 160ms ease;
}
.toggle__track::before {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 160ms ease, background 160ms ease;
}
.toggle input:checked + .toggle__track { background: var(--amber); }
.toggle input:checked + .toggle__track::before {
  transform: translateX(20px);
  background: var(--cream);
}

/* Slug check */
.slug-check {
  display: inline-flex; align-items: center;
  background: var(--cream-2);
  border: 1px solid rgba(15, 17, 21, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 10px; transition: border-color 160ms ease;
}
.slug-check:focus-within { border-color: var(--ink); }
.slug-check__prefix {
  font-family: var(--font-mono); font-size: 1rem;
  color: var(--muted); margin-right: 6px;
}
.slug-check__input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: var(--font-mono); font-size: 0.95rem;
  color: var(--ink); padding: 6px 0; min-width: 0;
}
.slug-check__input::placeholder { color: var(--muted); }
.slug-check__status {
  font-size: 0.8rem; color: var(--muted-2); margin-left: 8px; white-space: nowrap;
}
.slug-check__status--ok { color: var(--ok); }
.slug-check__status--error { color: var(--danger); }

/* ---------- Slider (code length) ---------------------------------- */
.slider-row {
  display: inline-flex; align-items: center; gap: 10px;
}
.slider-row__min, .slider-row__max {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted-2);
}
.slider {
  flex: 1; -webkit-appearance: none;
  width: 100%; height: 6px;
  background: rgba(15, 17, 21, 0.12);
  border-radius: 999px; outline: none;
  padding: 0; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--amber); border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--amber); border-radius: 50%;
  cursor: pointer; border: 0;
}
.slider-row__val {
  font-family: var(--font-mono); font-size: 1.1rem;
  font-weight: 600; color: var(--ink);
  width: 40px; text-align: center;
}

/* ---------- Settings form page ------------------------------------ */
.settings-form { max-width: 720px; margin: 0 auto; }
.settings-form__head { margin-bottom: 28px; }
.settings-form__eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.72rem; font-weight: 700; color: var(--amber);
}
.settings-form__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.02em; margin-top: 4px;
}
.settings-form__sub {
  color: var(--muted-2); font-size: 0.95rem; margin-top: 4px;
}
.settings-form__actions { margin-top: 28px; display: flex; gap: 12px; }

/* ---------- Live hit-count indicators ----------------------------- */
/* .hits--live { position: relative; }
.hits--live::after {
  content: ''; position: absolute; top: -2px; right: -4px;
  width: 8px; height: 8px;
  background: var(--amber); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(196, 90, 42, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
} */
.kpi__live { position: relative; }
.kpi__live::after {
  content: ''; position: absolute; top: -2px; right: -4px;
  width: 6px; height: 6px;
  background: var(--amber); border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.5); }
  70% { opacity: 0.6; transform: scale(1.3); box-shadow: 0 0 0 6px rgba(217, 164, 65, 0); }
  100% { opacity: 0; }
}

/* ---------- Responsive ---------------------------------------- */
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .card-row { grid-template-columns: 1fr; }
  .list__head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .list__search { width: 100%; }
  .popup__panel { max-width: 100%; padding: 22px; }
}
@media (max-width: 719px) {
  .features { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .topbar__inner { justify-content: center; }
  .page { padding: 32px 16px 72px; }
  .result { padding: 32px 16px; }
  .ranked__item { grid-template-columns: 1fr auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .chart { height: 140px; }
  .popup__panel { max-height: 90vh; }
  .popup__actions { flex-direction: column; }
}
@media (max-width: 480px) {
  .hero__title { font-size: 1.9rem; }
  .hero__sub { font-size: 0.95rem; }
  .result__title { font-size: 2.2rem; }
  .list__head { flex-direction: column; align-items: stretch; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .notfound__eyebrow { font-size: 3.2rem; }
}
