/* ============================================================================
   Linklet design system — dark-first, hand-written, no build step.
   Foundation: near-black violet-tinted canvas, surface ladder, white-alpha
   hairlines (no boxes, no shadows-as-hierarchy). Display type is Instrument
   Serif with one italic gradient word; Inter runs the UI; mono is jewelry
   for slugs, counts, and eyebrows. One accent, used sparingly.
   ========================================================================== */

@font-face {
  font-family: "Inter var";
  src: url("/assets/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: block;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/instrument-serif-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

:root {
  /* surfaces — violet-tinted near-black ladder */
  --canvas: #0b0b12;
  --surface-1: #10101a;
  --surface-2: #15151f;
  --surface-3: #1a1a26;

  /* hairlines */
  --line: rgba(255, 255, 255, 0.08);
  --line-subtle: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* ink */
  --text-1: #f7f7fa;
  --text-2: #b8b9c7;
  --text-3: #9aa0b0;
  --text-4: #5d5e6c;

  /* the one accent + the signature gradient */
  --accent: #7c5cff;
  --accent-hover: #937bff;
  --accent-ring: rgba(124, 92, 255, 0.55);
  --gradient: linear-gradient(120deg, #7c5cff 10%, #c05dd9 55%, #ff7a52 100%);
  --glow: 0 8px 28px -10px rgba(124, 92, 255, 0.55);

  /* status — never reused as decoration */
  --live: #2fbf68;
  --danger: #e5484d;

  /* type */
  --sans: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* motion */
  --fast: 0.14s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --med: 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);

  color-scheme: dark;
}

.no-pad { padding: 0 !important; }

.skip-link {
  position: fixed; z-index: 1000; top: 10px; left: 10px;
  padding: 10px 14px; color: var(--text-1); background: var(--surface-1);
  border: 2px solid var(--accent); border-radius: 8px;
  transform: translateY(-160%); transition: transform var(--fast);
}
.skip-link:focus { transform: translateY(0); }

/* ---------------------------------------------------------------- reset -- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text-1); margin: 0; }
p { margin: 0; }
a { color: var(--text-1); text-decoration: none; }
::selection { background: rgba(124, 92, 255, 0.35); color: #fff; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent-ring);
  border-radius: 8px;
}
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ------------------------------------------------------------ primitives -- */
.mono { font-family: var(--mono); }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow .num { color: var(--accent); }
.eyebrow .rule {
  width: 40px; height: 1px; background: var(--line-strong);
  transform-origin: left; animation: rule-expand 0.9s var(--med) both;
}
@keyframes rule-expand { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: 0.1em;
}
.grad-hairline { height: 1px; background: var(--gradient); opacity: 0.5; border: 0; }

.emboss { height: 2px; position: relative; border: 0; margin: 0; background: none; }
.emboss::before { content: ""; position: absolute; inset: 0 0 1px 0; background: #000; }
.emboss::after { content: ""; position: absolute; inset: 1px 0 0 0; background: var(--line); }

.grain { position: relative; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='256' height='256' filter='url(%23n)' opacity='0.42'/></svg>");
  mix-blend-mode: overlay; opacity: 0.55;
}

.dot-live {
  position: relative; display: inline-block;
  width: 7px; height: 7px; border-radius: 999px; background: var(--live);
  box-shadow: 0 0 0 3px rgba(47, 191, 104, 0.16);
}
.dot-live::after {
  content: ""; position: absolute; inset: -3px; border-radius: 999px;
  border: 1px solid var(--live);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 80%, 100% { transform: scale(2.1); opacity: 0; } }

/* ------------------------------------------------------- buttons & inputs -- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px;
  font-family: var(--sans); font-size: 13px; font-weight: 550; letter-spacing: -0.01em;
  color: #fff; background: var(--gradient);
  border: 0; border-radius: 8px;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter var(--fast), transform var(--fast);
}
button:hover, .btn:hover { filter: brightness(1.12); }
button:active, .btn:active { transform: scale(0.97); }
.ghost, button.ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line); box-shadow: none;
}
.ghost:hover { color: var(--text-1); background: var(--surface-2); filter: none; }
.ghost.danger:hover { color: var(--danger); border-color: rgba(229, 72, 77, 0.5); background: transparent; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 14px; }
.btn.sm, button.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.icon-btn { height: 30px; width: 30px; padding: 0; }

input {
  height: 36px; width: 100%; padding: 0 12px;
  font-family: var(--sans); font-size: 14px; letter-spacing: -0.01em;
  color: var(--text-1); background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 8px;
}
input::placeholder { color: var(--text-4); }
input:focus-visible { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent-ring); }

svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================ marketing == */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 64px;
  background: rgba(11, 11, 18, 0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-nav .inner, .site-footer .inner, .site-main {
  max-width: 1080px; margin: 0 auto; padding: 0 28px;
}
.site-nav .inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 620; letter-spacing: -0.02em; color: var(--text-1); }
.brand .mark {
  width: 22px; height: 22px; border-radius: 7px; background: var(--gradient);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(124, 92, 255, 0.4);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 150px 0 96px;
  border-bottom: 1px solid var(--line-subtle);
}
.hero .crown {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 30% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    radial-gradient(40% 45% at 85% 90%, rgba(255, 122, 82, 0.07), transparent 70%);
}
.hero .inner {
  position: relative;
  max-width: 1080px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.015em;
  margin: 22px 0 20px;
}
.hero h1 em { font-style: italic; }
.hero .lede { font-size: 17px; line-height: 1.65; color: var(--text-3); max-width: 42ch; }
.hero .cta { display: flex; align-items: center; gap: 14px; margin-top: 32px; }
.proof-row {
  display: flex; gap: 22px; margin-top: 28px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-3);
}
.proof-row span { display: inline-flex; align-items: center; gap: 7px; }
.proof-row .tick { color: var(--live); }

/* the fake-product hero card ------------------------------------------ */
.mock {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-subtle);
}
.mock-dots { display: flex; gap: 6px; }
.mock-dots i { width: 9px; height: 9px; border-radius: 999px; }
.mock-dots i:nth-child(1) { background: #ff7a52; }
.mock-dots i:nth-child(2) { background: #fbbf24; }
.mock-dots i:nth-child(3) { background: #2fbf68; }
.mock-url { font-family: var(--mono); font-size: 11px; color: var(--text-4); }
.mock-body { padding: 18px 16px 16px; }
.mock-input {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; background: var(--surface-2);
}
.mock-typed { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow: hidden; white-space: nowrap; }
.mock-typed::after {
  content: ""; display: inline-block; width: 2px; height: 12px;
  background: var(--accent); margin-left: 2px; vertical-align: -2px;
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.mock-btn {
  flex: none; font-size: 11px; font-weight: 600; color: #fff;
  background: var(--gradient); border-radius: 6px; padding: 6px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.mock-receipt {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--canvas);
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.mock-receipt .tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--live);
}
.mock-receipt .slug { color: var(--text-1); font-weight: 600; }
.mock-receipt .copy { margin-left: auto; color: var(--text-4); font-size: 10.5px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-top: 1px solid var(--line-subtle); padding-top: 12px; }
.mock-stats div { text-align: left; padding: 0 4px; }
.mock-stats div + div { border-left: 1px solid var(--line-subtle); padding-left: 14px; }
.mock-stats .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.mock-stats .v { font-size: 17px; font-weight: 620; color: var(--text-1); font-variant-numeric: tabular-nums; }
.mock-feed { margin-top: 12px; }
.mock-feed li {
  list-style: none; display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  padding: 7px 2px; border-top: 1px solid var(--line-subtle);
}
.mock-feed li b { color: var(--text-2); font-weight: 600; }
.mock-feed li time { margin-left: auto; color: var(--text-4); }
.mock-feed .dot-live { width: 5px; height: 5px; }
.mock-feed .dot-live::after { display: none; }

/* stat band ------------------------------------------------------------ */
.stat-band { padding: 56px 0; border-bottom: 1px solid var(--line-subtle); }
.stat-band .inner { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.stat-band .stat { padding: 0 36px; }
.stat-band .stat:first-child { padding-left: 0; }
.stat-band .stat + .stat { border-left: 1px solid var(--line); }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.stat-value { display: block; font-size: 40px; font-weight: 620; letter-spacing: -0.03em; color: var(--text-1); font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }

/* editorial feature rows ------------------------------------------------ */
.chapters { padding: 96px 0; }
.chapters .inner { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.chapters header { max-width: 60ch; margin-bottom: 26px; }
.chapters h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.01em; margin-top: 18px; }
.chapter-row {
  display: grid; grid-template-columns: 90px 1fr 1.3fr; gap: 28px; align-items: baseline;
  padding: 34px 0; border-top: 1px solid var(--line);
}
.chapter-row:last-child { border-bottom: 1px solid var(--line); }
.chapter-num {
  font-family: var(--serif); font-style: italic; font-size: 44px; line-height: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0.7;
}
.chapter-row h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.chapter-row p { color: var(--text-3); font-size: 14.5px; max-width: 48ch; }
.chapter-row .mono-note { font-family: var(--mono); font-size: 11px; color: var(--text-4); margin-top: 8px; display: block; }

/* built-on band ---------------------------------------------------------- */
.stack-band { padding: 40px 0; }
.stack-band .inner { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.stack-band .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); }
.stack-band .tag {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-1);
}

/* closing CTA ------------------------------------------------------------ */
.closer { position: relative; text-align: center; padding: 110px 0 120px; overflow: hidden; }
.closer .crown { position: absolute; inset: 0; background: radial-gradient(50% 60% at 50% 100%, rgba(124, 92, 255, 0.13), transparent 70%); pointer-events: none; }
.closer h2 { position: relative; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 54px); letter-spacing: -0.01em; }
.closer p { position: relative; color: var(--text-3); margin: 14px 0 30px; }
.closer .btn { position: relative; }

/* footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 36px; }
.site-footer .inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .tagline { color: var(--text-3); font-size: 13px; margin-top: 10px; max-width: 34ch; }
.foot-rail {
  max-width: 1080px; margin: 30px auto 0; padding: 18px 28px 0;
  border-top: 1px solid var(--line-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 12.5px; color: var(--text-3);
}
.foot-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* ============================================================= app shell == */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 0 12px 14px;
}
.sidebar .brand { height: 64px; display: flex; align-items: center; padding: 0 8px; }
.side-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4);
  padding: 18px 10px 8px;
}
.side-sections { min-height: 0; overflow-y: auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-3);
  transition: background var(--fast), color var(--fast);
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-1); }
.side-nav a.on { background: rgba(255, 255, 255, 0.07); color: var(--text-1); }
.side-nav a.on svg { color: var(--accent-hover); }
.side-spacer { flex: 1; }
.user-block {
  display: flex; align-items: center; gap: 9px;
  padding: 10px; border-top: 1px solid var(--line-subtle);
}
.avatar {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  background: var(--gradient);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 650; color: #fff;
}
.user-block .who { min-width: 0; flex: 1; }
.user-block .who b { display: block; font-size: 12.5px; font-weight: 570; color: var(--text-1); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-block .who span { display: block; font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-block form { display: contents; }
.user-block .icon-btn { border: 0; color: var(--text-4); background: transparent; box-shadow: none; }
.user-block .icon-btn:hover { color: var(--text-1); background: var(--surface-2); filter: none; }

.content { min-width: 0; }
.page-bar {
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 32px; border-bottom: 1px solid var(--line);
}
.page-bar h1 { font-size: 16px; font-weight: 590; letter-spacing: -0.015em; }
.page-bar .bar-actions { display: flex; align-items: center; gap: 10px; }
.page-inner { max-width: 1060px; padding: 28px 32px 64px; }

/* stat strip (dashboard + account) ---------------------------------------- */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 0 26px; }
.stat-strip .stat { padding: 0 32px; }
.stat-strip .stat:first-child { padding-left: 0; }
.stat-strip .stat + .stat { border-left: 1px solid var(--line); }
.stat-strip .stat-value { font-size: 30px; }

/* shorten bar --------------------------------------------------------------- */
.shorten {
  display: flex; align-items: center; gap: 0;
  background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px;
  transition: border-color var(--fast);
}
.shorten:focus-within { border-color: var(--accent-ring); }
.shorten input { border: 0; background: transparent; height: 38px; border-radius: 6px; }
.shorten input:focus-visible { box-shadow: none; background: rgba(255, 255, 255, 0.03); }
.shorten input[name="url"] { flex: 2.4; font-size: 14.5px; }
.shorten input[name="title"] { flex: 1.2; border-left: 1px solid var(--line-subtle); }
.shorten .slugbox { display: flex; align-items: center; flex: 0.8; border-left: 1px solid var(--line-subtle); padding-left: 10px; }
.shorten .slugbox > span { font-family: var(--mono); font-size: 12.5px; color: var(--text-4); }
.shorten .slugbox input { border-left: 0; padding-left: 2px; font-family: var(--mono); font-size: 13px; flex: 1; }
.shorten button { flex: none; height: 38px; }

/* receipt strip (form feedback) --------------------------------------------- */
#form-msg { min-height: 44px; padding-top: 10px; }
.receipt {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-1);
  padding: 8px 12px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  animation: rise 0.35s var(--med) both;
}
.receipt .tag { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--live); }
.receipt .slug { color: var(--text-1); font-weight: 600; }
.receipt.err { border-color: rgba(229, 72, 77, 0.4); }
.receipt.err .tag { color: var(--danger); }
.receipt .copy { height: 24px; padding: 0 9px; font-size: 11px; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* links table ------------------------------------------------------------------ */
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.table-head h2 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.table-head .search { width: 230px; height: 32px; font-size: 13px; background: transparent; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 10px 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4);
  border-bottom: 1px solid var(--line-subtle);
}
td { padding: 0 10px; height: 46px; border-bottom: 1px solid var(--line-subtle); font-size: 13.5px; }
tbody tr { transition: background var(--fast); }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td.slug a { font-family: var(--mono); font-size: 13px; font-weight: 570; color: var(--accent-hover); }
td.slug a:hover { text-decoration: underline; }
td .title { color: var(--text-2); }
td .url { color: var(--text-3); font-size: 12px; display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
td.when { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
th.tail, td.tail { text-align: right; white-space: nowrap; }
/* A row's actions stay in the tab order. Where the pointer hovers, they take
   the place of the row's time on hover or while focus is inside the row, so
   the keyboard reaches them; on a touch screen they always show. A tail cell
   without row actions keeps its text, since nothing would take its place. */
td.tail .row-acts { display: inline-flex; gap: 6px; }
@media (hover: hover) and (pointer: fine) {
  tbody tr:not(:hover):not(:focus-within) .tail .row-acts {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  tbody tr:is(:hover, :focus-within) .tail:has(.row-acts) .when { display: none; }
}
.empty {
  border: 1px dashed var(--line-strong); border-radius: 12px;
  text-align: center; padding: 44px 20px; margin-top: 14px;
}
.empty h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.empty p { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* dashboard layout ---------------------------------------------------------------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 40px; align-items: start; }
.feed-rail { position: sticky; top: 92px; margin-top: 26px; }
.feed-rail .rail-head {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3);
}
#feed { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.feed-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 2px; border-bottom: 1px solid var(--line-subtle);
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  transition: background 0.9s ease;
}
.feed-item b { color: var(--text-1); font-weight: 600; }
.feed-item time { margin-left: auto; color: var(--text-4); font-variant-numeric: tabular-nums; }
.feed-item.htmx-added { background: rgba(124, 92, 255, 0.12); }
#feed:not(:empty) + .feed-empty { display: none; }
.feed-empty { color: var(--text-3); font-size: 12.5px; padding: 26px 2px; border-bottom: 1px solid var(--line-subtle); }

/* settings (account) ----------------------------------------------------------------- */
.settings section {
  display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 40px;
  padding: 36px 0; border-bottom: 1px solid var(--line-subtle);
}
.settings section:first-child { padding-top: 10px; }
.settings section:last-child { border-bottom: 0; }
.settings .sec-label h2 { font-size: 14px; font-weight: 590; letter-spacing: -0.01em; }
.settings .sec-label p { font-size: 12.5px; color: var(--text-3); margin-top: 5px; max-width: 30ch; }
.settings .sec-body { min-width: 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 18px; font-size: 13.5px; margin-bottom: 18px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-1); }
.kv dd.mono { font-family: var(--mono); font-size: 12.5px; }
.field-label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-3); margin-bottom: 6px; }
.inline-form { display: flex; gap: 10px; align-items: center; max-width: 420px; }
.inline-form input { flex: 1; }
.event-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-list > li {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line-subtle);
}
.event-list > li:last-child { border-bottom: 0; }
.event-list .title, .event-list .url { display: block; }
.event-list .title { color: var(--text-1); font-size: 13.5px; }
.event-list .url { color: var(--text-3); font-family: var(--mono); font-size: 11.5px; margin-top: 3px; overflow-wrap: anywhere; }
.authentication-methods form, .authentication-methods button { flex: none; }
.msg-ok { color: var(--live); font-size: 12.5px; font-family: var(--mono); margin-bottom: 10px; }
.msg-err { color: var(--danger); font-size: 12.5px; font-family: var(--mono); margin-bottom: 10px; }
.demo-note {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-size: 13px; color: var(--text-3);
}
.demo-note code { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* ================================================================= login == */
.owner-auth-shell { display: grid; place-items: center; min-height: 100dvh; padding: 40px 28px; }
.owner-auth-shell .brand { display: inline-flex; margin-bottom: 24px; }
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.split-brand {
  position: relative; overflow: hidden;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px 36px 36px;
  background:
    radial-gradient(70% 55% at 20% 0%, rgba(124, 92, 255, 0.18), transparent 70%),
    radial-gradient(45% 40% at 90% 100%, rgba(255, 122, 82, 0.08), transparent 70%);
}
.split-brand blockquote {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--text-1); max-width: 14ch;
}
.split-brand .foot { font-family: var(--mono); font-size: 11px; color: var(--text-4); letter-spacing: 0.08em; }
.split-form { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -0.01em; }
.login-box .sub { color: var(--text-3); font-size: 13.5px; margin: 8px 0 26px; }
.login-box label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-3); margin-bottom: 6px; }
.login-box .field { margin-bottom: 16px; }
.login-box button { width: 100%; height: 40px; margin-top: 6px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--text-4); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-subtle); }
.external-login-methods { display: grid; gap: 9px; }
.external-login-methods .btn { width: 100%; min-height: 40px; }
.login-hint {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-subtle);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--text-3);
}
.login-err {
  border: 1px solid rgba(229, 72, 77, 0.4); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: var(--danger);
  margin-bottom: 18px;
}

.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 9px; padding: 4px;
}
.tabs a {
  flex: 1; text-align: center; padding: 7px 0;
  font-size: 13px; font-weight: 550; color: var(--text-3);
  border-radius: 6px;
}
.tabs a:hover { color: var(--text-1); }
.tabs a.on { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.login-notice {
  border: 1px solid rgba(47, 191, 104, 0.35); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: var(--live);
  margin-bottom: 18px;
}
.dev-hint {
  border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 14px 16px; margin-top: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.dev-hint .lbl {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
}
.dev-hint p { font-size: 12.5px; color: var(--text-3); }
.hint-row { margin-top: 18px; font-size: 13px; }
a.forgot { color: var(--text-3); font-size: 13px; }
a.forgot:hover { color: var(--text-1); }

/* 404 ---------------------------------------------------------------------- */
.lost { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.lost .code { font-family: var(--serif); font-style: italic; font-size: 88px; line-height: 1; }
.lost h1 { font-size: 18px; font-weight: 590; margin: 16px 0 6px; }
.lost p { color: var(--text-3); font-size: 13.5px; margin-bottom: 26px; }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 960px) {
  .hero .inner { grid-template-columns: 1fr; gap: 44px; }
  .dash { grid-template-columns: 1fr; }
  .feed-rail { position: static; }
  .split { grid-template-columns: 1fr; }
  .split-brand { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 16px; gap: 4px; }
  .sidebar .brand { height: 56px; }
  .side-label, .side-spacer { display: none; }
  .side-sections { display: flex; flex-wrap: wrap; order: 1; flex: 1 1 100%; width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px; }
  .side-nav { flex: 0 1 auto; flex-direction: row; flex-wrap: wrap; max-width: 100%; }
  .side-nav a { flex: 0 0 auto; }
  .user-block { border: 0; margin-left: auto; padding: 0; }
  .user-block .who { display: none; }
  .stat-band .inner, .stat-strip { grid-template-columns: 1fr; gap: 18px; }
  .stat-band .stat + .stat, .stat-strip .stat + .stat { border-left: 0; padding-left: 0; }
  .chapter-row { grid-template-columns: 56px 1fr; }
  .chapter-row p { grid-column: 2; }
  .shorten { flex-wrap: wrap; }
  .shorten input[name="url"] { flex: 1 1 100%; }
  .shorten input[name="title"], .shorten input[name="slug"] { border-left: 0; }
  .page-inner { padding: 22px 18px 48px; }
  .page-bar { padding: 0 18px; }
}

@media (max-width: 620px) {
  .settings .capability-table,
  .settings .capability-table tbody,
  .settings .capability-table tr,
  .settings .capability-table td { display: block; width: 100%; }
  .settings .capability-table thead { display: none; }
  .settings .capability-table tbody { display: grid; gap: 10px; }
  .settings .capability-table tr {
    border: 1px solid var(--line-subtle); border-radius: 8px; padding: 10px 12px;
  }
  .settings .capability-table td {
    display: grid; grid-template-columns: minmax(84px, 0.7fr) minmax(0, 1.3fr); gap: 12px;
    align-items: start; min-width: 0; height: auto; padding: 7px 0;
    border-bottom: 1px solid var(--line-subtle); overflow-wrap: anywhere;
  }
  .settings .capability-table td:last-child { border-bottom: 0; }
  .settings .capability-table td::before {
    content: attr(data-label); font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4);
  }
  .settings .capability-table td.tail { text-align: left; white-space: normal; }
  .settings .capability-table td .url { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .settings .capability-table td > .url { grid-column: 2; }
  .settings .capability-table tbody tr:hover .tail .when,
  .settings .capability-table tbody tr:focus-within .tail .when { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f5f1e8; --surface-1: #fffdf8; --surface-2: #ece6db; --surface-3: #e2dacd;
    --line: rgba(48, 42, 34, 0.16); --line-subtle: rgba(48, 42, 34, 0.1); --line-strong: rgba(48, 42, 34, 0.28);
    --text-1: #26221d; --text-2: #4e473e; --text-3: #675e53; --text-4: #766c60;
    --accent: #5b3fc4; --accent-hover: #472fa8; --accent-ring: rgba(91, 63, 196, 0.5);
    --gradient: linear-gradient(120deg, #5b3fc4 10%, #8f3f82 55%, #b94d32 100%);
    --glow: 0 8px 24px -12px rgba(91, 63, 196, 0.35); --live: #14783c; --danger: #ad2633;
    color-scheme: light;
  }
  .site-nav { background: rgba(245, 241, 232, 0.9); }
  .grain::after { mix-blend-mode: multiply; opacity: 0.12; }
  .emboss::before { background: rgba(48, 42, 34, 0.22); }
}

@media (forced-colors: active) {
  :focus-visible { outline: 3px solid Highlight; outline-offset: 3px; box-shadow: none; }
  button, .btn, input, select, textarea { border: 1px solid ButtonText; box-shadow: none; }
  .grad-text { background: none; color: CanvasText; }
  .mark, .dot-live { forced-color-adjust: none; background: Highlight; }
}

/* Settings remain usable when the shell leaves less room for a side label. */
@media (max-width:1000px) { .settings section { grid-template-columns:minmax(0,1fr); gap:20px; } }
@media (max-width:700px) {
 .settings .sec-body > form:not(.row-acts) { display:grid; gap:10px; }
 .settings .row-acts { display:flex; flex-wrap:wrap; gap:8px; }
 .settings .row-acts select { min-width:0; max-width:100%; }
}
