/* ============================================================
   saas.fyi — design system
   Inter font, -0.3px tracking throughout, hairline borders,
   curated-by-humans premium feel.
   ============================================================ */

@import url("https://rsms.me/inter/inter.css");

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-tint: #f5f5f4;
  --bg-tint-2: #f0efed;
  --border: #ececec;
  --border-strong: #d8d8d6;
  --text: #0a0a0a;
  --text-2: #4b4b4b;
  --text-3: #8a8a8a;
  --text-4: #b3b3b3;
  --accent: #0a0a0a;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #bbf7d0;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-md: 0 1px 3px rgba(15, 15, 15, 0.06), 0 1px 2px rgba(15, 15, 15, 0.03);
  --shadow-lg: 0 8px 24px rgba(15, 15, 15, 0.06), 0 2px 6px rgba(15, 15, 15, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --tracking: -0.3px;
  --max-w: 1240px;
}

@supports (font-variation-settings: normal) {
  :root { --font: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Light by design — but keep selection visible */
  }
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  background: var(--bg);
  color: var(--text);
  letter-spacing: var(--tracking);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

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

button { font-family: inherit; letter-spacing: var(--tracking); cursor: pointer; }
input, textarea, select { font-family: inherit; letter-spacing: var(--tracking); }

img { max-width: 100%; display: block; }

::selection { background: #ffe45c; color: var(--text); }

/* -------- Layout container -------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   Top Navigation
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: var(--tracking);
}
.nav-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0a0a0a, #2a2a2a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  font-size: 14px;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--bg-tint); color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--text);
  color: #fff !important;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-cta:hover { opacity: 0.88; transform: translateY(-1px); }

@media (max-width: 720px) {
  .nav-link { display: none; }
  .nav-link.always { display: inline-flex; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 88px 0 56px;
  text-align: center;
  position: relative;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.hero-pill-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--green);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
}
.hero-pill strong { color: var(--text); font-weight: 600; }
.hero-title {
  font-size: clamp(40px, 6.4vw, 64px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0 0 18px;
  background: linear-gradient(180deg, #0a0a0a 0%, #2a2a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.5;
}
.hero-sub b { color: var(--text); font-weight: 500; }
.hero-search {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 56px 0 50px;
  font-size: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  outline: none;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-search input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(10,10,10,0.06), var(--shadow-md);
}
.hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.hero-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.hero-meta-item { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   Toolbar — sort + filters
   ============================================================ */
.toolbar {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.toolbar-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.chip {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  cursor: pointer;
  user-select: none;
}
.chip:hover { background: var(--bg-tint); border-color: var(--border-strong); }
.chip[aria-pressed="true"] {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.chip-count { font-size: 11px; color: var(--text-4); }
.chip[aria-pressed="true"] .chip-count { color: rgba(255,255,255,0.7); }

.select {
  height: 32px;
  padding: 0 30px 0 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238a8a8a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select:hover { background-color: var(--bg-tint); }

.result-count {
  font-size: 13px;
  color: var(--text-3);
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
}

/* ============================================================
   Section headers & card grid
   ============================================================ */
.section-block {
  padding: 40px 0 8px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin: 0;
}
.section-link {
  font-size: 12px;
  color: var(--text-3);
}
.section-link:hover { color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

/* -------- Card -------- */
.card {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-align: left;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}
.card-icon-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.card-body { min-width: 0; flex: 1; }
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: var(--tracking);
}
.badge {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  text-transform: capitalize;
}
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.badge.neutral { background: var(--bg-tint); color: var(--text-2); border-color: var(--border); }
.card-tagline {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.card-tag {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
}

/* Make the entire card clickable */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty h3 { color: var(--text); margin: 0 0 6px; font-weight: 600; font-size: 18px; }
.empty p { margin: 0; font-size: 14px; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  margin-top: 80px;
  padding: 56px 0 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin: 0 0 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer li a { font-size: 14px; color: var(--text-2); }
.footer li a:hover { color: var(--text); }
.footer-tagline { font-size: 14px; color: var(--text-2); margin: 12px 0 0; max-width: 280px; }
.footer-base {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   Tool detail page
   ============================================================ */
.tool-hero {
  padding: 48px 0 32px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { margin: 0 8px; color: var(--text-4); }

.tool-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.tool-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.tool-icon img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tool-name-block { flex: 1; min-width: 240px; }
.tool-h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tool-tagline {
  font-size: 18px;
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.45;
  max-width: 720px;
}
.tool-cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  background: var(--text);
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  background: var(--bg-elevated);
  color: var(--text) !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg-tint); }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  gap: 40px;
  padding: 24px 0 24px;
}
@media (max-width: 880px) { .tool-grid { grid-template-columns: 1fr; } }

.prose { font-size: 16px; line-height: 1.65; color: var(--text); }
.prose h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
}
.prose p { margin: 0 0 14px; color: var(--text-2); }
.prose ul { padding-left: 18px; color: var(--text-2); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }

.factbox {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: sticky;
  top: 92px;
  box-shadow: var(--shadow-sm);
}
.factbox h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin: 0 0 14px;
}
.fact-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}
.fact-row:last-child { border-bottom: none; }
.fact-row dt { color: var(--text-3); }
.fact-row dd { margin: 0; color: var(--text); text-align: right; font-weight: 500; }
.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.tag-row .card-tag { background: #fff; }

/* ============================================================
   Submit page form
   ============================================================ */
.page-narrow { max-width: 720px; margin: 0 auto; padding: 56px 0; }
.page-narrow h1 {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}
.page-narrow .lede {
  font-size: 18px;
  color: var(--text-2);
  margin: 0 0 32px;
  max-width: 620px;
}

.form-grid { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.field .hint { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.callout {
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: #92400e;
  margin: 28px 0;
}

/* ============================================================
   Websites showcase
   ============================================================ */
.web-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 720px) { .web-grid { grid-template-columns: 1fr; } }
.web-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.web-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.web-preview {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #f5f5f4, #e7e7e4);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.web-preview iframe {
  width: 200%;
  height: 200%;
  transform: scale(0.5);
  transform-origin: top left;
  border: 0;
  pointer-events: none;
}
.web-preview-fallback {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.web-body { padding: 16px 18px; }
.web-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.web-note { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.web-domain { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ============================================================
   Misc
   ============================================================ */
.hidden { display: none !important; }

.crumb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 10px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Subtle background grid effect for hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 100, 80, 0.04) 0px, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(120, 80, 255, 0.04) 0px, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================================
   v2: Sidebar layout + editorial hero
   ============================================================ */

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding-top: 8px;
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
}

.sidebar {
  position: sticky;
  top: 60px;
  align-self: start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 8px 32px 0;
  /* Hide scrollbar but keep scroll */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
@media (max-width: 1024px) {
  .sidebar {
    position: static;
    max-height: none;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
}

.sidebar-search {
  position: relative;
  margin-bottom: 22px;
}
.sidebar-search input {
  width: 100%;
  height: 40px;
  padding: 0 50px 0 36px;
  font-size: 13.5px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  font-family: inherit;
  letter-spacing: var(--tracking);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sidebar-search input::placeholder { color: var(--text-3); }
.sidebar-search input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.05);
}
.sidebar-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.sidebar-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  letter-spacing: 0;
}

.sidebar-section { margin-bottom: 22px; }
.sidebar-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin: 0 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  letter-spacing: var(--tracking);
  transition: background 0.12s, color 0.12s;
}
.sidebar-item:hover { background: var(--bg-tint); color: var(--text); }
.sidebar-item[aria-pressed="true"] {
  background: var(--text);
  color: #fff;
}
.sidebar-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.sidebar-item-count {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sidebar-item[aria-pressed="true"] .sidebar-item-count { color: rgba(255,255,255,0.55); }

.sidebar-cta {
  margin-top: 8px;
  padding: 16px;
  background: linear-gradient(160deg, #fffbeb 0%, #fef3c7 60%, #fff 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-2);
}
.sidebar-cta h5 { margin: 0 0 4px; color: #78350f; font-size: 13px; font-weight: 600; }
.sidebar-cta p { margin: 0 0 10px; line-height: 1.45; color: #92400e; }
.sidebar-cta a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
}
.sidebar-cta a:hover { color: #451a03; }

.sidebar-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 6px;
}
.sidebar-tag {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: inherit;
  letter-spacing: var(--tracking);
}
.sidebar-tag:hover { background: var(--bg-tint); border-color: var(--border-strong); }
.sidebar-tag[aria-pressed="true"] {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* -------- Editorial hero -------- */

.hero-editorial {
  padding: 40px 0 16px;
  position: relative;
}

.issue-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
  flex-wrap: wrap;
}
.issue-bar .issue-num { color: var(--text); }
.issue-bar .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-4); }
.issue-bar .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}
.issue-bar .live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.06); }
}

.hero-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
}
@media (max-width: 880px) { .hero-editorial-grid { grid-template-columns: 1fr; gap: 24px; } }

.hero-editorial-title {
  font-size: clamp(44px, 5.6vw, 72px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin: 0 0 22px;
  color: var(--text);
}
.hero-editorial-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-2);
}
.hero-editorial-title .underline-wave {
  background-image: linear-gradient(120deg, #fde68a 0%, #fde68a 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  background-position: 0 88%;
  padding: 0 2px;
}

.hero-editorial-sub {
  font-size: 17px;
  color: var(--text-2);
  margin: 0 0 22px;
  max-width: 54ch;
  line-height: 1.55;
}
.hero-editorial-sub strong { color: var(--text); font-weight: 500; }

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #b45309;
  background: #fef3c7;
  border: 1.5px dashed #d97706;
  border-radius: 4px;
  transform: rotate(-2deg);
  transform-origin: left center;
}
.stamp::before {
  content: "✓";
  font-weight: 800;
}

/* Editor's stack on the right side of editorial hero */
.editor-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.editor-stack-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.editor-stack-label .week {
  font-weight: 500;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}

.stack-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, transform 0.15s;
  position: relative;
}
.stack-item:hover { background: var(--bg-tint); }
.stack-item:hover .stack-name { color: var(--text); }
.stack-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}
.stack-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.stack-icon img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.stack-body { min-width: 0; padding-right: 24px; }
.stack-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--text);
}
.stack-note {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Grid toolbar above the directory results */
.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.grid-toolbar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin: 0;
}
.grid-toolbar-title strong { color: var(--text); font-variant-numeric: tabular-nums; }
.grid-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* Compact sort select for grid toolbar */
.select-bare {
  background: transparent;
  border: none;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  padding: 4px 22px 4px 4px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%230a0a0a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  font-family: inherit;
  letter-spacing: var(--tracking);
}
.select-bare:hover { color: var(--text); }

/* Tweak section blocks within sidebar layout */
.layout .section-block { padding-top: 24px; }
.layout .section-block:first-of-type { padding-top: 0; }

/* ============================================================
   Studio banner — sponsor placement on each tool page
   ============================================================ */

.studio-banner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 26px;
  margin: 8px 0 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.10), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.10), transparent 55%),
    linear-gradient(135deg, #0a0a0a 0%, #171717 60%, #1f1f1f 100%);
  border: 1px solid #262626;
  border-radius: 16px;
  color: #f5f5f4;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 12px 32px rgba(10,10,10,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.studio-banner:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: #3a3a3a;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.05),
    0 20px 44px rgba(10,10,10,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.studio-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.5;
  mask-image: linear-gradient(135deg, transparent 30%, black 70%, black 100%);
  -webkit-mask-image: linear-gradient(135deg, transparent 30%, black 70%, black 100%);
}

.studio-banner-mark {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 70%, #d97706 100%);
  color: #0a0a0a;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow:
    0 6px 14px rgba(251, 191, 36, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
  position: relative;
  z-index: 1;
}

.studio-banner-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.studio-banner-kicker {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.studio-banner-kicker::after {
  content: "Sponsored";
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #737373;
  background: rgba(255,255,255,0.05);
  border: 1px solid #262626;
  padding: 2px 6px;
  border-radius: 4px;
}
.studio-banner-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: #fafaf9;
  margin: 0;
  letter-spacing: var(--tracking);
}
.studio-banner-title strong {
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.studio-banner-title .days {
  white-space: nowrap;
}
.studio-banner-sub {
  font-size: 13px;
  color: #a3a3a3;
  margin-top: 4px;
}

.studio-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: #fbbf24;
  color: #0a0a0a;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  letter-spacing: var(--tracking);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: background 0.15s ease;
  box-shadow:
    0 4px 10px rgba(251, 191, 36, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
.studio-banner-cta::after {
  content: "→";
  font-weight: 600;
  transition: transform 0.15s ease;
}
.studio-banner:hover .studio-banner-cta { background: #fcd34d; }
.studio-banner:hover .studio-banner-cta::after { transform: translateX(3px); }

@media (max-width: 720px) {
  .studio-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 18px 20px;
    gap: 14px;
  }
  .studio-banner-cta { align-self: stretch; justify-content: center; }
}
