:root {
  --bg: #faf8f1;
  --ink: #16150f;
  --muted: #8a897f;
  --muted-2: #a6a49a;
  --line: #e7e4d8;
  --green: #5f8a4e;
  --blue: #3a6ea5;
  --accent: #e0512f;
  --pill-border: #d8d5c8;
  --white: #ffffff;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.logo-mark svg { display: block; width: 100%; height: 100%; }

.logo:hover .logo-mark { transform: rotate(-12deg); }

.logo-star { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 26px; }

.nav-link {
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover { color: var(--ink); }

.nav-link.submit {
  color: #fff;
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.05s ease;
}
.nav-link.submit:hover { color: #fff; background: #2c2a1f; }
.nav-link.submit:active { transform: scale(0.98); }

/* Hero */
.hero { padding: 56px 0 34px; }

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.subtitle {
  margin-top: 14px;
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
}

/* Newsletter CTA */
.newsletter { margin-top: 26px; max-width: 440px; }

.newsletter-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 5px 5px 5px 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.newsletter-field:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(22, 21, 15, 0.06);
}

.newsletter-field input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 12px;
}

.newsletter-field input::placeholder { color: var(--muted-2); }

.newsletter-field button {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.newsletter-field button:hover { background: #2c2a1f; }
.newsletter-field button:active { transform: scale(0.98); }

.newsletter-note {
  margin-top: 10px;
  padding-left: 6px;
  font-size: 13px;
  color: var(--muted-2);
  transition: color 0.15s ease;
}

.newsletter-note.error { color: var(--accent); }
.newsletter-note.success { color: var(--green); }

.newsletter.done .newsletter-field {
  border-color: var(--green);
  background: #f2f7ee;
}

/* Divider between hero and filters */
.hero-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0 26px;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 26px;
  flex-wrap: wrap;
}

.filters { display: flex; flex-wrap: wrap; gap: 9px; }

.pill {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pill:hover { border-color: #b9b6a7; }

.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 14px;
}

.sort label { letter-spacing: 0.01em; }

.sort select {
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 2px;
  outline: none;
}

/* List */
.list { display: flex; flex-direction: column; }

.item {
  padding: 24px 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.item:first-child { border-top: none; }

.item:hover { background: rgba(22, 21, 15, 0.03); }

.item-name {
  color: var(--ink);
  text-decoration: none;
}

.item:hover .item-name { text-decoration: underline; text-underline-offset: 2px; }

.item-body { min-width: 0; }

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.favicon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.favicon img { display: block; border-radius: 4px; }

.favicon.fallback,
.fallback-letter {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
}

.item-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rev-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #7ee787;
  color: #0c2b13;
  border: 1.5px solid var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.rev-pill-unit {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

/* Pre-revenue state — grey pill instead of green revenue */
.rev-pill.pre {
  background: #e7e5dd;
  border-color: #c9c7bb;
  color: #6a685e;
}
.detail-rev.pre { color: #6a685e; }

.item-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
}

.item-desc {
  margin-top: 7px;
  font-size: 15.5px;
  color: #56554c;
  line-height: 1.5;
}

.item-meta {
  margin-top: 11px;
  font-size: 13.5px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-meta .dot { color: var(--muted-2); }

.item-meta .source {
  color: var(--blue);
  text-decoration: none;
}

.item-meta .source:hover { text-decoration: underline; }

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

/* ===== Detail page ===== */
.detail-page .wrap { max-width: 1060px; }

.detail-layout {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 44px;
  align-items: start;
}

.detail-main { min-width: 0; }

/* Left rail */
.rail-inner { position: sticky; top: 26px; }

.rail-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
  padding-left: 8px;
}

.rail-list { display: flex; flex-direction: column; gap: 1px; }

.rail-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}
.rail-item:hover { background: rgba(22, 21, 15, 0.04); }

.rail-favicon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  opacity: 0.8;
}
.rail-favicon img { width: 16px; height: 16px; }
.rail-favicon.fallback,
.rail-favicon .fallback-letter { font-size: 12px; }

.rail-item-body {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rail-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #6a685e;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-item:hover .rail-name { color: var(--ink); }

.rail-rev {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-2);
  margin-left: auto;
}
.rail-rev .rev-pill-unit { display: none; }

.rail-all {
  display: inline-block;
  margin: 14px 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.rail-all:hover { color: var(--ink); }

.back-link {
  display: inline-block;
  margin: 34px 0 26px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--ink); }

/* Featured OG image */
.detail-featured {
  position: relative;
  margin: 0 0 26px;
  aspect-ratio: 1200 / 630;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f2f0e8;
}

.detail-featured-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(120% 120% at 50% 0%, #eafbe8 0%, #f4f1e8 55%, #eceadf 100%);
}

.detail-featured-favicon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(22, 21, 15, 0.08);
}
.detail-featured-favicon img { width: 34px; height: 34px; }
.detail-featured-favicon.fallback,
.detail-featured-favicon .fallback-letter { font-size: 26px; }

.detail-featured-host {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.detail-featured-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.detail-featured-img.loaded { opacity: 1; }

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.detail-favicon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  flex-shrink: 0;
}
.detail-favicon img { width: 30px; height: 30px; }
.detail-favicon.fallback,
.detail-favicon .fallback-letter { font-size: 22px; }

.detail-head-body { min-width: 0; flex: 1; }

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-name {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.detail-rev { font-size: 15px; padding: 4px 13px; }

.detail-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-meta .dot { color: var(--muted-2); }

.detail-desc {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.6;
  color: #3f3e36;
  max-width: 620px;
}

/* Founders */
.founders-block { margin-top: 22px; }
.founders-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.founders-row { display: flex; flex-wrap: wrap; gap: 10px; }
.founder-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
a.founder-chip:hover { border-color: #b9b6a7; transform: translateY(-1px); }
.founder-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e5da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.founder-avatar img { width: 100%; height: 100%; object-fit: cover; }
.founder-info { display: flex; flex-direction: column; line-height: 1.2; }
.founder-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.founder-handle { font-size: 12px; color: var(--muted-2); }

.stat-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 18px;
}

.stat-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-value-sm { font-size: 16px; font-weight: 700; }

/* Revenue-source tweet card */
.tweet-section { margin-top: 30px; }

.tweet-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 11px;
}

.tweet-card {
  display: block;
  max-width: 520px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tweet-card:hover {
  border-color: #cfccbe;
  box-shadow: 0 4px 18px rgba(22, 21, 15, 0.06);
}

.tweet-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  flex-shrink: 0;
  overflow: hidden;
  background: #e8e5da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--muted);
}
.tweet-avatar img { width: 100%; height: 100%; object-fit: cover; }

.tweet-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }

.tweet-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.tweet-verified { width: 15px; height: 15px; flex-shrink: 0; }

.tweet-handle { font-size: 14px; color: var(--muted-2); }

.tweet-logo {
  width: 19px;
  height: 19px;
  margin-left: auto;
  color: var(--ink);
  flex-shrink: 0;
}

.tweet-text {
  margin-top: 13px;
  font-size: 15.5px;
  line-height: 1.55;
  color: #1c1b15;
  white-space: normal;
}

.tweet-hl { color: var(--green); font-weight: 700; }

.tweet-foot {
  margin-top: 13px;
  font-size: 13.5px;
  color: var(--muted-2);
}

.tweet-metrics {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}

.tweet-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tweet-metric svg { width: 15px; height: 15px; color: var(--muted-2); }

.tweet-view {
  margin-left: auto;
  color: var(--blue);
  font-weight: 500;
}
.tweet-card:hover .tweet-view { text-decoration: underline; }

/* Shared section wrapper for lower detail sections */
.detail-section {
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

/* Popular tweets — minimised previews */
.mini-tweets { display: flex; flex-direction: column; gap: 2px; }

.mini-tweet {
  display: flex;
  gap: 12px;
  padding: 13px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}
.mini-tweet:hover { background: rgba(22, 21, 15, 0.03); }

.mini-tweet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e5da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
}
.mini-tweet-avatar img { width: 100%; height: 100%; object-fit: cover; }

.mini-tweet-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }

.mini-tweet-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
}

.mini-tweet-name {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mini-tweet-name .tweet-verified { width: 13px; height: 13px; }

.mini-tweet-handle,
.mini-tweet-date { color: var(--muted-2); font-weight: 400; }
.mini-tweet-dot { color: var(--muted-2); }

.mini-tweet-x {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: var(--muted-2);
  flex-shrink: 0;
  display: inline-flex;
}
.mini-tweet-x svg { width: 100%; height: 100%; }

.mini-tweet-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: #2a2920;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-tweet-metrics {
  display: flex;
  gap: 18px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted-2);
}
.mini-tweet-metric { display: inline-flex; align-items: center; gap: 5px; }
.mini-tweet-metric svg { width: 13px; height: 13px; color: var(--muted-2); }

/* From around the web — minimised list */
.press-list { display: flex; flex-direction: column; }

.press-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}
.press-item:first-child { border-top: none; }
.press-item:hover { background: rgba(22, 21, 15, 0.03); }

.press-favicon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.press-favicon img { width: 18px; height: 18px; display: block; }
.press-favicon .fallback-letter { font-weight: 700; font-size: 13px; color: var(--muted); }

.press-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }

.press-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.press-item:hover .press-title { text-decoration: underline; text-underline-offset: 2px; }

.press-meta { font-size: 12.5px; color: var(--muted-2); }

.press-arrow { color: var(--muted-2); font-size: 14px; flex-shrink: 0; }

.detail-actions { margin-top: 28px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: #2c2a1f; }
.btn-primary:active { transform: scale(0.99); }

/* Related */
.detail-related {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.detail-related-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.related-card:hover { border-color: #b9b6a7; transform: translateY(-2px); }

.related-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}
.related-top .rev-pill { font-size: 12.5px; padding: 2px 9px; }

.related-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.related-desc {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-notfound {
  padding: 70px 0;
  text-align: center;
}
.detail-notfound h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.detail-notfound p { margin: 12px 0 26px; color: var(--muted); }

/* Responsive */
@media (max-width: 880px) {
  .detail-layout {
    display: flex;
    flex-direction: column;
  }
  .detail-main { order: 1; }
  .rail { order: 2; margin-top: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
  .rail-inner { position: static; }
  .rail-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 16px;
  }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .rail-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { gap: 12px; }
  .logo { font-size: 16px; gap: 7px; }
  .logo-mark { width: 22px; height: 22px; }
  .nav { gap: 14px; }
  .nav-link { font-size: 13.5px; }
  .nav-link.submit { padding: 7px 13px; }
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 33px; }
  .subtitle { font-size: 16px; }
  .item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .item-title { flex-wrap: wrap; gap: 9px; }
  .detail-name { font-size: 28px; }
  .detail-desc { font-size: 16px; }
}

/* ===== Shared buttons & form controls ===== */
.btn-block { width: 100%; justify-content: center; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--pill-border);
  text-decoration: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: #b9b6a7; }

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.btn-ghost:hover { color: var(--ink); }
.btn-ghost.danger:hover { color: var(--accent); }

.btn-mini {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}
.btn-mini.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.form { max-width: 100%; }

.field { margin-bottom: 18px; display: flex; flex-direction: column; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.field label {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.req { color: var(--accent); }

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 21, 15, 0.06);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-2); }

.hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

.hint-inline { font-size: 12px; font-weight: 400; color: var(--muted-2); }

/* Category chips (toggle checkboxes) */
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--white);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.12s ease;
}
.chip span:hover { border-color: #b9b6a7; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(22, 21, 15, 0.15); }

/* Repeatable single-line rows */
.rows { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; gap: 8px; align-items: center; }
.mini-row input { flex: 1; }
.add-row { margin-top: 10px; align-self: flex-start; }
.row-remove {
  flex-shrink: 0;
  width: 38px;
  height: 40px;
  border: 1px solid var(--pill-border);
  background: var(--white);
  border-radius: 10px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.row-remove:hover { color: var(--accent); border-color: var(--accent); }

/* Submitted-by fieldset */
.submitter {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 4px;
  margin-bottom: 20px;
}
.submitter legend {
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
  color: var(--ink);
}

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  cursor: pointer;
}
.check input { width: auto; }
.checkfield { justify-content: flex-end; }

/* ===== Submit page ===== */
.submit-hero { padding: 46px 0 26px; }
.submit-hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.submit-hero .subtitle { margin-top: 12px; }

.submit-perks {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.perk {
  font-size: 13px;
  font-weight: 600;
  color: #3f6b32;
  background: #e9f1e3;
  border-radius: 999px;
  padding: 5px 12px;
}

.submit-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
  padding-bottom: 20px;
}

.submit-single { max-width: 620px; padding-bottom: 20px; }

.form-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

/* Multi-step */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
}
.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--white);
  border: 1.5px solid var(--pill-border);
  color: var(--muted-2);
  flex-shrink: 0;
}
.step-dot.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.step-line {
  width: 26px;
  height: 2px;
  background: var(--line);
  flex-shrink: 0;
}
.step-caption {
  margin-left: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.step-head { margin-bottom: 22px; }
.step-heading { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; }
.step-sub { margin-top: 8px; font-size: 15px; color: var(--muted); }

.step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.step-actions .btn-primary { flex: 1; justify-content: center; }

.pre-toggle {
  margin: -6px 0 18px;
  font-size: 14px;
}

.field.disabled { opacity: 0.5; }
.field input:disabled { background: var(--bg); cursor: not-allowed; }

.submit-success .badge-panel {
  max-width: 480px;
  margin: 22px auto 6px;
  text-align: left;
}

.form-note { margin-top: 12px; font-size: 13.5px; }
.form-note.error { color: var(--accent); }

.submit-success {
  text-align: center;
  padding: 30px 20px;
  background: #f2f7ee;
  border: 1px solid #cfe3c2;
  border-radius: 16px;
}
.success-check {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #7ee787;
  border: 1.5px solid var(--ink);
  color: #0c2b13;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.submit-success h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.submit-success p { margin: 10px auto 18px; color: #4a4a42; max-width: 420px; }

/* Badge panel */
.submit-side { position: sticky; top: 26px; }
.badge-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.badge-panel-inline { max-width: 540px; }
.badge-panel-inline .badge-preview { margin-top: 16px; }

.badge-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge-panel-head .section-title { margin-bottom: 0; }
.badge-sub { font-size: 13px; color: var(--muted); margin: 8px 0 16px; line-height: 1.5; }

.badge-theme-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.bt {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.bt.active { background: var(--ink); color: #fff; }

.badge-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px dashed var(--pill-border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.badge-preview.on-dark { background: #262419; }

.badge-embed-label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.badge-code {
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: #3f3e36;
  background: var(--bg);
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}

@media (max-width: 820px) {
  .submit-layout { grid-template-columns: 1fr; }
  .submit-side { position: static; }
}
@media (max-width: 520px) {
  .field-row { flex-direction: column; gap: 0; }
}

/* ===== Admin ===== */
.admin-page { background: var(--bg); }

.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  z-index: 50;
}
.gate-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
}
.gate-mark { width: 40px; height: 40px; margin: 0 auto 14px; }
.gate-box h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px; }
.gate-box input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  outline: none;
}
.gate-box input:focus { border-color: var(--ink); }
.gate-note { font-size: 13px; color: var(--accent); margin-top: 10px; min-height: 16px; }
.gate-msg { font-size: 14px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.gate-logout {
  display: inline-block;
  margin-top: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.gate-logout:hover { text-decoration: underline; }

.admin { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-actions { display: flex; align-items: center; gap: 8px; }
.admin-status {
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.admin-status.show { opacity: 1; }

.admin-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
  padding: 24px 0 60px;
}

.admin-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }

.admin-search {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
}
.admin-search:focus { border-color: var(--ink); }

.admin-list { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; }
.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s ease;
}
.admin-list-item:hover { background: rgba(22, 21, 15, 0.04); }
.admin-list-item.active { background: var(--ink); }
.admin-list-item.active .ali-name { color: #fff; }
.admin-list-item.active .ali-rev { color: #b7d3ad; }
.ali-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.ali-rev { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted-2); }

.admin-subs { border-top: 1px solid var(--line); padding-top: 14px; }
.admin-subhead {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-count {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
}
.admin-empty-note { font-size: 13px; color: var(--muted-2); }
.admin-sub-list { display: flex; flex-direction: column; gap: 10px; }
.sub-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.sub-top { display: flex; justify-content: space-between; gap: 8px; }
.sub-name { font-weight: 700; font-size: 14px; }
.sub-rev { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--green); }
.sub-desc { font-size: 13px; color: #56554c; margin: 6px 0; line-height: 1.4; }
.sub-meta { font-size: 12px; color: var(--muted-2); margin-bottom: 10px; }
.sub-btns { display: flex; gap: 8px; }

.admin-editor {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-height: 300px;
}
.editor-empty { color: var(--muted); font-size: 15px; text-align: center; padding: 60px 0; }

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.editor-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.editor-head-btns { display: flex; align-items: center; gap: 8px; }
.editor-note { font-size: 13px; min-height: 18px; margin-bottom: 12px; }
.editor-note.error { color: var(--accent); }
.editor-note.success { color: var(--green); }

.ed-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.ed-section:first-of-type { border-top: none; padding-top: 4px; }
.ed-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.repeat-row {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 2px;
  margin-bottom: 12px;
}
.repeat-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--white);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.repeat-del:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 820px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-side { position: static; }
}
