/* ==========================================================================
   9amdesk design tokens
   Type scale: 12 / 14 / 16 / 18 / 20 / 24 / 32 / 40 / 56 (px)
   Spacing: 4px base. Use only the --s* steps below. No other values.
   ========================================================================== */
:root {
  /* colour */
  --ink: #111418;
  --ink-2: #222831;
  --muted: #5c6370;
  --line: #e3e6ec;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --side: #151a22;
  --side-line: #242b38;
  --side-text: #c8cedd;
  --side-muted: #8b93a7;
  --accent: #3b6cf6;
  --lime: #d5f36b;
  --coral: #ff8a65;
  --sky: #9fd8ff;
  --lilac: #cfc2ff;

  /* type scale */
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-40: 40px;
  --fs-56: 56px;

  /* line heights */
  --lh-tight: 1.15;
  --lh-heading: 1.25;
  --lh-ui: 1.5;
  --lh-body: 1.6;
  --lh-prose: 1.75;

  /* spacing */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* measure: comfortable reading width for prose */
  --measure: 680px;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 256px 1fr;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sidebar ---------- */
aside { background: var(--side); color: var(--side-text); height: 100vh; overflow-y: auto; padding: var(--s4) var(--s3); }
.brand { font-weight: 700; font-size: var(--fs-20); letter-spacing: -0.02em; line-height: var(--lh-heading); padding: var(--s1) var(--s2) var(--s4); color: #fff; text-decoration: none; display: block; }
.brand span { color: var(--lime); }
.search { display: flex; align-items: center; border: 1px solid var(--side-line); border-radius: var(--s2); padding: var(--s1) var(--s2); color: var(--side-muted); font-size: var(--fs-14); line-height: var(--lh-ui); margin-bottom: var(--s4); text-decoration: none; }
.search:hover { color: #fff; border-color: #3a4357; }
kbd { font: var(--fs-12) ui-monospace, Menlo, monospace; background: #1d2331; border: 1px solid var(--side-line); border-radius: 5px; padding: 1px 6px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 0; }
.nav a, .nav .off { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s1) var(--s2); border-radius: 6px; font-size: var(--fs-14); line-height: var(--lh-ui); text-decoration: none; }
.nav a { color: var(--side-text); }
.nav a:hover { background: #1b2130; color: #fff; }
.nav a.on { background: #1d2331; color: #fff; box-shadow: inset 2px 0 0 var(--lime); font-weight: 600; }
/* Count badge: a small pill on the right of each menu item */
.nav a .n, .nav .off .n { min-width: 24px; text-align: center; font: var(--fs-12) ui-monospace, Menlo, monospace; line-height: 1; padding: 2px 6px; border-radius: 999px; background: #1a2030; color: var(--side-muted); }
.nav a.on .n { background: var(--lime); color: var(--ink); }
.nav .off { color: #4f5870; }
.nav .off .n { background: transparent; color: #4f5870; }
.sec { font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-muted); padding: var(--s4) var(--s2) var(--s1); }

/* ---------- Content area ---------- */
/* The page frame is the menu colour. Content sits on a white rounded panel; the footer follows it on the dark frame. */
main { height: 100vh; overflow-y: auto; scroll-behavior: smooth; background: var(--side); padding: var(--s2) var(--s2) 0 0; }
.wrap { background: var(--surface); border-radius: var(--radius-lg); padding: 40px var(--s7); min-height: calc(100vh - var(--s2)); }
.crumb { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

h1 { font-size: var(--fs-40); font-weight: 700; letter-spacing: -0.025em; line-height: var(--lh-tight); margin: var(--s3) 0 var(--s4); }
.intro { font-size: var(--fs-18); line-height: var(--lh-body); color: var(--muted); max-width: 62ch; }
.h2 { font-size: var(--fs-24); font-weight: 600; letter-spacing: -0.015em; line-height: var(--lh-heading); margin: var(--s7) 0 var(--s2); }
.sub { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); margin-bottom: var(--s5); max-width: 62ch; }

/* ---------- Filters ---------- */
.pills { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 var(--s4); }
.pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: var(--s2) var(--s4); border-radius: 999px; font: inherit; font-size: var(--fs-14); line-height: var(--lh-ui); cursor: pointer; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Grids and cards ---------- */
.row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); margin-bottom: var(--s5); }
.row.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s ease; }
.card:hover { box-shadow: 0 8px 24px rgba(17, 20, 24, .08); }
/* Card media: 4:3 landscape by default. Text sits below the image. */
.img { aspect-ratio: 4 / 3; width: 100%; position: relative; }
/* Variant: square media (1:1) for logos, icons and product shots */
.card.square .img { aspect-ratio: 1 / 1; }
/* Variant: text beside the image, for lists and dense directories */
.card.side { flex-direction: row; align-items: stretch; }
.card.side .img { width: 40%; aspect-ratio: auto; flex-shrink: 0; }
.card.side .body { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 620px) {
  .card.side { flex-direction: column; }
  .card.side .img { width: 100%; aspect-ratio: 4 / 3; }
}
.img .tag { position: absolute; left: var(--s3); bottom: var(--s3); background: var(--surface); border-radius: 6px; font-size: var(--fs-12); font-weight: 600; line-height: 1; padding: 4px 8px; }
.card .body { padding: var(--s4) var(--s4) var(--s5); }
.card b { font-size: var(--fs-16); font-weight: 600; line-height: var(--lh-heading); display: block; margin-bottom: var(--s2); }
.card p { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); }
.g1 { background: linear-gradient(135deg, var(--accent), var(--sky)); }
.g2 { background: linear-gradient(135deg, var(--lime), #fff); }
.g3 { background: linear-gradient(135deg, var(--coral), #ffe0d4); }
.g4 { background: linear-gradient(135deg, var(--lilac), #fff); }
.g5 { background: linear-gradient(135deg, #2c3446, #6a7896); }
.g6 { background: linear-gradient(135deg, #bff3e0, #7fd1b0); }
.hidden { display: none !important; }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s6); align-items: center; padding-top: var(--s6); }
.eyebrow { font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(var(--fs-32), 4.8vw, var(--fs-56)); line-height: var(--lh-tight); letter-spacing: -0.03em; margin: var(--s3) 0 var(--s4); }
.lede { font-size: var(--fs-18); line-height: var(--lh-body); color: var(--muted); max-width: 52ch; }
.ctas { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.btn-dark, .btn-light { display: inline-flex; align-items: center; border-radius: 999px; padding: var(--s3) var(--s5); font: inherit; font-size: var(--fs-14); font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; }
.btn-dark { background: var(--ink); color: #fff; border: 0; }
.btn-light { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.hart { border-radius: var(--radius-lg); min-height: 160px; padding: var(--s4); display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); }
.hart small { font-size: var(--fs-12); font-weight: 600; opacity: .7; }
.hart b { font-size: var(--fs-16); font-weight: 600; line-height: var(--lh-heading); }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-top: var(--s6); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.stat .num { font-size: var(--fs-32); font-weight: 700; letter-spacing: -0.02em; line-height: var(--lh-tight); }
.stat .lbl { margin-top: var(--s2); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); }

/* ---------- Article header ---------- */
.meta { display: flex; gap: var(--s3); align-items: center; font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); margin: var(--s4) 0 var(--s2); flex-wrap: wrap; }
.meta .tag { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: var(--s1) var(--s3); color: var(--ink); font-weight: 600; font-size: var(--fs-12); }
.dek { font-size: var(--fs-20); line-height: 1.5; color: var(--muted); max-width: 60ch; margin-top: var(--s3); }
.byline { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0 var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); font-size: var(--fs-14); line-height: var(--lh-ui); max-width: var(--measure); }
.byline .av { width: var(--s6); height: var(--s6); border-radius: 50%; background: var(--lilac); display: grid; place-items: center; font-weight: 700; }
.byline small { display: block; color: var(--muted); font-size: var(--fs-12); }
.hero-img { height: 240px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent), var(--sky)); margin-bottom: var(--s6); position: relative; overflow: hidden; max-width: var(--measure); }
.hero-img span { position: absolute; left: var(--s4); bottom: var(--s4); background: var(--surface); border-radius: 6px; font-size: var(--fs-12); font-weight: 600; padding: var(--s1) var(--s2); }

/* ---------- Prose (article body) ---------- */
article, .prose { max-width: var(--measure); }
article p, .prose p { font-size: var(--fs-18); line-height: var(--lh-prose); color: var(--ink-2); margin-bottom: var(--s4); }
article h2, .prose h2 { font-size: var(--fs-32); font-weight: 600; letter-spacing: -0.015em; line-height: var(--lh-heading); margin: var(--s7) 0 var(--s3); }
article h3, .prose h3 { font-size: var(--fs-20); font-weight: 600; line-height: var(--lh-heading); margin: var(--s6) 0 var(--s2); }
article ul, article ol, .prose ul, .prose ol { margin: 0 0 var(--s5) var(--s5); }
article li, .prose li { font-size: var(--fs-18); line-height: var(--lh-prose); color: var(--ink-2); margin-bottom: var(--s2); }
article blockquote, .prose blockquote { border-left: 3px solid var(--coral); padding: var(--s1) 0 var(--s1) var(--s4); margin: var(--s6) 0; font-size: var(--fs-20); line-height: 1.5; font-style: italic; color: var(--ink); }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: var(--s6) 0; }
.figure .img { aspect-ratio: 16 / 9; }
.figure .cap { padding: var(--s3) var(--s4); font-size: var(--fs-14); color: var(--muted); }
table, .prose table { width: 100%; border-collapse: collapse; margin: var(--s5) 0 var(--s6); font-size: var(--fs-16); line-height: var(--lh-ui); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td, .prose th, .prose td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
th, .prose th { font-size: var(--fs-12); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
.tip, .prose .tip { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--lime); border-radius: var(--radius); padding: var(--s4) var(--s5); margin: var(--s5) 0; font-size: var(--fs-16); line-height: var(--lh-body); }
.tip b, .prose .tip b { display: block; margin-bottom: var(--s1); }
.related { margin-top: var(--s7); border-top: 1px solid var(--line); padding-top: var(--s6); }
.rel { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); }
.end { margin-top: var(--s6); background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.end p { color: var(--side-text); font-size: var(--fs-14); line-height: var(--lh-ui); }
.end button { background: var(--lime); color: var(--ink); border: 0; border-radius: 999px; padding: var(--s3) var(--s5); font: inherit; font-size: var(--fs-14); font-weight: 600; cursor: pointer; }
/* Footer: on the dark frame, same colour as the menu */
.site-footer { color: var(--side-muted); font-size: var(--fs-14); line-height: var(--lh-ui); padding: var(--s6) var(--s7) var(--s6); }
.site-footer .foot-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--side-line); }
.site-footer .brand { padding: 0; }
.foot-links { display: flex; gap: var(--s5); flex-wrap: wrap; }
.site-footer a { color: var(--side-text); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer p { max-width: 80ch; margin-bottom: var(--s2); }
.site-footer p a { text-decoration: underline; }

/* ---------- Tool detail facts ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s3) var(--s5); margin: var(--s5) 0; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: var(--measure); font-size: var(--fs-14); line-height: var(--lh-ui); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wrap { padding: var(--s6) var(--s5) var(--s7); }
}
@media (max-width: 1000px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  aside { height: auto; padding: var(--s3) var(--s4); }
  .nav, .search, .sec { display: none; }
  main { height: auto; overflow: visible; }
  html, body { overflow: auto; height: auto; }
  .row, .row.three, .rel { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}
@media (max-width: 620px) {
  .row, .row.three, .rel { grid-template-columns: 1fr; }
  h1 { font-size: var(--fs-32); }
  .hero h1 { font-size: var(--fs-32); }
  .wrap { padding: var(--s5) var(--s4) var(--s7); }
}

/* ---------- List items: thumbnail left, text right ---------- */
.item-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); margin-bottom: var(--s5); }
.item { display: flex; gap: var(--s4); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); text-decoration: none; color: inherit; transition: box-shadow .15s ease; }
.item:hover { box-shadow: 0 8px 24px rgba(17, 20, 24, .08); }
.thumb { width: var(--s8); height: var(--s8); flex-shrink: 0; border-radius: var(--s2); display: grid; place-items: center; font-size: var(--fs-20); font-weight: 700; color: var(--ink); }
.item-body { min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.item-body b { font-size: var(--fs-16); font-weight: 600; line-height: var(--lh-heading); }
.item-body p { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); }
.item-meta { font-size: var(--fs-12); font-weight: 600; color: var(--muted); margin-top: var(--s1); }
@media (max-width: 1000px) { .item-list { grid-template-columns: 1fr; } }

/* ---------- Media slot (Media.astro): photo, logo or initial ---------- */
.media { position: relative; overflow: hidden; display: grid; place-items: center; width: 100%; }
.media.wide { aspect-ratio: 1200 / 630; }
.media.square { aspect-ratio: 1 / 1; }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media img.logo { width: 48%; height: auto; max-height: 60%; object-fit: contain; }
.media.has-logo { background: var(--surface); }
.media .initial { font-size: var(--fs-40); font-weight: 700; line-height: 1; color: var(--ink); opacity: .75; }
.media .tag { position: absolute; left: var(--s3); bottom: var(--s3); background: var(--surface); border-radius: 6px; font-size: var(--fs-12); font-weight: 600; line-height: 1; padding: 4px 8px; }
.thumb { width: var(--s8); height: var(--s8); flex-shrink: 0; border-radius: var(--s2); overflow: hidden; }
.thumb .media { height: 100%; aspect-ratio: auto; }
.thumb .media .initial { font-size: var(--fs-20); }
.thumb .media img.logo { width: 60%; }
.thumb .media.has-logo { border: 1px solid var(--line); border-radius: var(--s2); }

/* ---------- Grid, compact rows and carousel. One card type per section. ---------- */
/* Standard cards: 4 columns on desktop, 2 on tablet, 1 on phones */
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s5); }
/* Compact rows: logo, name and price, 4 columns on desktop */
.item-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.item-list .thumb { width: var(--s7); height: var(--s7); }

/* Section header: title on the left, "See all" on the right */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin: var(--s7) 0 var(--s2); }
.section-head .h2 { margin: 0; }
.see-all { font-size: var(--fs-14); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

/* Carousel: one featured row only. Horizontal track, no auto-rotation, keyboard scrollable */
.carousel { position: relative; margin-bottom: var(--s5); }
.carousel .track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--s5)) / 4); gap: var(--s5); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: var(--s2); }
.carousel .track > * { scroll-snap-align: start; min-width: 0; }
.carousel .track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.car-nav { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s3); }
.car-nav button { width: var(--s6); height: var(--s6); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-16); line-height: 1; cursor: pointer; }
.car-nav button:hover:not(:disabled) { border-color: var(--ink); }
.car-nav button:disabled { opacity: .4; cursor: default; }
.car-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1000px) {
  .row, .item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-list { grid-template-columns: 1fr; }
  .carousel .track { grid-auto-columns: calc((100% - var(--s5)) / 2); }
}
@media (max-width: 620px) {
  .row, .item-list { grid-template-columns: 1fr; }
  .carousel .track { grid-auto-columns: 84%; }
}

/* ---------- Home hero: heading, sub and search ---------- */
.home-hero { padding: var(--s6) 0 var(--s2); max-width: 760px; }
.home-hero h1 { font-size: clamp(var(--fs-32), 4.4vw, var(--fs-56)); letter-spacing: -0.03em; margin: 0 0 var(--s4); }
.hero-search { display: flex; gap: var(--s2); margin-top: var(--s5); }
.hero-search .searchbox { flex: 1; margin: 0; }
.hero-search .btn-dark { padding: 0 var(--s5); }
.hero-meta { margin-top: var(--s3); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); }
.hero-meta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h2.h2 { margin: 0; }
.section-head + .sub { margin: 0 0 var(--s4); }

/* ---------- Search box ---------- */
.searchbox { display: flex; align-items: center; gap: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 var(--s4); height: var(--s7); margin: var(--s5) 0 var(--s3); color: var(--muted); }
.searchbox:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(59, 108, 246, .15); }
.searchbox svg { width: var(--s5); height: var(--s5); flex-shrink: 0; }
.searchbox input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-16); color: var(--ink); min-width: 0; }
.grid-count { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--muted); margin-bottom: var(--s4); }

/* ---------- Icon tiles: 5 columns ---------- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
.tile { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); text-decoration: none; color: inherit; transition: box-shadow .15s ease, border-color .15s ease; min-width: 0; }
.tile:hover { box-shadow: 0 8px 24px rgba(17, 20, 24, .08); border-color: #d3d8e1; }
.tile-icon { width: var(--s7); height: var(--s7); flex-shrink: 0; border-radius: var(--s2); overflow: hidden; }
.tile-icon .media { height: 100%; aspect-ratio: auto; }
.tile-icon .media.has-logo { border: 1px solid var(--line); border-radius: var(--s2); }
.tile-icon .media img.logo { width: 60%; }
.tile-icon .media .initial { font-size: var(--fs-20); }
.tile-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile-text b { font-size: var(--fs-14); font-weight: 600; line-height: var(--lh-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text span { font-size: var(--fs-12); line-height: var(--lh-ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-search { flex-direction: column; } .hero-search .btn-dark { height: var(--s7); justify-content: center; } }

/* ---------- Scrollbars: thin and dark, matching the menu ---------- */
aside, main { scrollbar-width: thin; scrollbar-color: #2e3646 var(--side); }
aside::-webkit-scrollbar, main::-webkit-scrollbar { width: 8px; }
aside::-webkit-scrollbar-track, main::-webkit-scrollbar-track { background: var(--side); }
aside::-webkit-scrollbar-thumb, main::-webkit-scrollbar-thumb { background: #2e3646; border-radius: 999px; border: 2px solid var(--side); }
aside::-webkit-scrollbar-thumb:hover, main::-webkit-scrollbar-thumb:hover { background: #3d4659; }

/* Cards on the white panel: keep a visible edge */
.stat, .tile, .card, .item, .searchbox { border-color: var(--line); }
@media (max-width: 1100px) { .wrap { padding: 40px var(--s5); } .site-footer { padding: var(--s6) var(--s5); } }
@media (max-width: 1000px) { main { padding: 0 var(--s2); } .wrap { min-height: 0; } }
@media (max-width: 620px) { .wrap { padding: 40px var(--s4); border-radius: var(--radius); } .site-footer { padding: var(--s5) var(--s4); } }
/* Scrollbars inside the white panel (carousels) stay light */
.wrap { scrollbar-color: #d3d8e1 transparent; }
.wrap ::-webkit-scrollbar { height: 6px; }
.wrap ::-webkit-scrollbar-thumb { background: #d3d8e1; border-radius: 999px; }
.wrap ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Fixed white panel: content scrolls inside; at the end, the panel moves up to reveal the footer ---------- */
@media (min-width: 1001px) {
  main { padding: var(--s2) var(--s2) 0 0; }
  .wrap { height: calc(100vh - 2 * var(--s2)); min-height: 0; overflow-y: auto; overscroll-behavior-y: auto; scroll-behavior: smooth; }
  .wrap { scrollbar-width: thin; scrollbar-color: #d3d8e1 transparent; }
  .wrap::-webkit-scrollbar { width: 8px; }
  .wrap::-webkit-scrollbar-thumb { background: #d3d8e1; border-radius: 999px; border: 2px solid var(--surface); }
  .site-footer { padding-top: var(--s6); }
}

/* White panel sits 4% of the screen height from the top and from the bottom */
@media (min-width: 1001px) {
  main { padding-top: 4vh; }
  .wrap { height: 92vh; }
  .site-footer { margin-top: 4vh; padding-top: 0; }
}

/* Same gap on all four sides of the white panel: 2% of the screen height */
@media (min-width: 1001px) {
  main { padding: 2vh 2vh 0 2vh; }
  .wrap { height: 96vh; }
  .site-footer { margin-top: 2vh; }
}
