/* Slova blog — design reference. Tokens mirror src/app/globals.css @theme. */
:root {
  --fg: #0a0a0a;
  --primary: #171717;
  --muted: #f5f5f5;
  --muted-hover: #e8e8e8;
  --muted-fg: #737373;
  --muted-2: #a3a3a3;
  --border: #e5e5e5;
  --subtle: #f0f0f0;
  --acc: #f2e6ff;
  --acc-fg: #9133ea;
  --cta: #7c3aed;
  --cta-hover: #6d28d9;
  --t-sky: #e1f3fe; --t-sky-ink: #0284c5;
  --t-mint: #dcfce7; --t-mint-ink: #15803d;
  --t-butter: #fef5a7; --t-butter-ink: #7a5a06;
  --t-peach: #ffe9d6; --t-peach-ink: #b44a12;
  --t-peri: #d4ddff; --t-peri-ink: #3730a3;
  --t-pink: #fce7f3; --t-pink-ink: #be185d;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-title: "Manrope", var(--font-sans);
  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc-fg); outline-offset: 2px; border-radius: 6px; }

.title { font-family: var(--font-title); font-weight: 600; letter-spacing: -0.01em; }

/* ---- Topbar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 56px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 700; font-size: 16px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--fg); }
/* A white mark on a black tile. The filter has to sit on the image alone: put
   it on the tile and it repaints the tile's own background white too. */
.brand-mark, .avatar { display: grid; place-items: center; background: var(--fg); }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; }
.brand-mark img { width: 15px; height: 15px; filter: brightness(0) invert(1); }
.avatar img { width: 13px; height: 13px; filter: brightness(0) invert(1); }
.brand span { color: var(--muted-fg); font-weight: 500; font-size: 13px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted-fg); font-weight: 500; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); background: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 10px;
  font-weight: 600; border: 1px solid transparent; transition: background .15s var(--ease);
}
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); }
.btn-ghost { border-color: var(--border); background: #fff; }
.btn-ghost:hover { background: var(--muted); }

/* ---- Layout ------------------------------------------------------------ */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---- Blog index -------------------------------------------------------- */
.index-hero { padding: 88px 0 44px; border-bottom: 1px solid var(--border); }
.index-hero h1 { font-size: 40px; line-height: 46px; margin: 0 0 14px; }
.index-hero p { font-size: 15px; line-height: 22px; color: var(--muted-fg); max-width: 560px; margin: 0; }

.filters .chip[aria-pressed="true"] { background: var(--fg); color: #fff; border-color: var(--fg); }
.card[hidden] { display: none; }
.section-label[hidden], .grid[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 24px 0 8px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; font-weight: 500; font-size: 13px; color: var(--muted-fg);
}
.chip:hover { background: var(--muted); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }

.section-label {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 56px 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.section-label h2 { font-size: 18px; line-height: 24px; margin: 0; }
.section-label a { color: var(--muted-fg); font-size: 13px; }
.section-label a:hover { color: var(--fg); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid.featured { grid-template-columns: 1.4fr 1fr 1fr; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border-radius: 18px; border: 1px solid var(--border);
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { border-color: var(--muted-2); box-shadow: 0 10px 28px -20px var(--muted-fg); }
.card .thumb { aspect-ratio: 16/9; border-radius: 10px; background: var(--muted); display: grid; place-items: center; color: var(--muted-2); font-size: 12px; }
img.thumb { width: 100%; height: auto; object-fit: cover; }
.card .meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted-fg); }
.card .meta .cat { color: var(--fg); font-weight: 600; }
.card h3 { font-size: 17px; line-height: 24px; margin: 0; }
.card.large h3 { font-size: 22px; line-height: 28px; }
.card p { margin: 0; color: var(--muted-fg); font-size: 14px; line-height: 21px; }
.card .row { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; font-size: 12px; color: var(--muted-fg); }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--t-peri); }

.list { display: flex; flex-direction: column; }
.list a { display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--border); }
.list a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.list .cat { font-size: 12px; font-weight: 600; }
.list h3 { margin: 0; font-size: 15px; line-height: 21px; }
.list p { margin: 6px 0 0; color: var(--muted-fg); font-size: 14px; line-height: 20px; }
.list .when { font-size: 12px; color: var(--muted-fg); white-space: nowrap; }

/* ---- Article ----------------------------------------------------------- */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted-fg); padding: 40px 0 0; }
.crumbs a:hover { color: var(--fg); }
.crumbs span { color: var(--muted-2); }

.post-head { padding: 36px 0 44px; }
.post-head .cat { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--t-mint); color: var(--t-mint-ink); font-size: 12px; font-weight: 600; }
.post-head h1 { font-size: 48px; line-height: 56px; margin: 22px 0 20px; letter-spacing: -0.02em; }
.post-head .dek { font-size: 20px; line-height: 31px; color: var(--muted-fg); margin: 0 0 28px; }
.byline { display: flex; align-items: center; gap: 12px; row-gap: 8px; font-size: 14px; color: var(--muted-fg); flex-wrap: wrap; }
.byline .who { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 500; }
.byline .avatar { width: 28px; height: 28px; }
.byline .dot { color: var(--muted-2); }

.cover { border-radius: 16px; aspect-ratio: 1200/630; background: var(--muted); display: grid; place-items: center; color: var(--muted-2); font-size: 13px; }
img.cover { width: 100%; height: auto; object-fit: cover; display: block; }
.cover + figcaption, figure figcaption { margin-top: 12px; font-size: 13px; line-height: 20px; color: var(--muted-fg); }

/* One shell for the whole article: 720 text column + 56 gap + 240 rail. Head,
   cover and prose all start on the same left edge. */
.post-shell { max-width: 1072px; margin: 0 auto; }
.post-shell > .crumbs, .post-shell > .post-head, .post-shell > .cover-fig { max-width: 760px; }
.post-grid { display: grid; grid-template-columns: minmax(0, 760px) 240px; gap: 72px; padding: 64px 0 96px; }
.post-grid > * { min-width: 0; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 13px; }
.toc h4 { margin: 0 0 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-fg); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 7px 0 7px 14px; line-height: 18px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted-fg); }
.toc li a:hover { color: var(--fg); }
.toc li a[aria-current] { color: var(--fg); border-left-color: var(--fg); font-weight: 500; }
.toc .cta {
  margin-top: 28px; padding: 18px; border-radius: 12px; background: var(--muted);
}
.toc .cta strong { display: block; font-family: var(--font-title); font-size: 14px; margin-bottom: 4px; }
.toc .cta p { margin: 0 0 10px; color: var(--muted-fg); }

/* Prose */
.prose { font-size: 18px; line-height: 32px; max-width: 760px; }
.prose > * + * { margin-top: 28px; }
.prose .lede { font-size: 21px; line-height: 34px; }
.prose h2 { font-family: var(--font-title); font-weight: 700; font-size: 30px; line-height: 38px; letter-spacing: -0.015em; margin-top: 88px; margin-bottom: -4px; scroll-margin-top: 80px; }
.prose h3 { font-family: var(--font-title); font-weight: 600; font-size: 22px; line-height: 30px; margin-top: 52px; scroll-margin-top: 80px; }
.prose a { text-decoration: underline; text-decoration-color: var(--muted-2); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--fg); }
.prose ul, .prose ol { padding-left: 26px; }
.prose li + li { margin-top: 12px; }
.prose li::marker { color: var(--muted-fg); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 23px; }
.prose thead th { text-align: left; font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--fg); font-family: var(--font-title); }
.prose tbody td { padding: 16px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 500; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; margin-top: 32px !important; margin-bottom: 8px; }
.table-wrap table { min-width: 520px; }
.table-wrap thead th { background: var(--muted); border-bottom-color: var(--border); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 16px; line-height: 24px; margin-top: 32px !important; }
.compare > div { padding: 18px 20px; border-radius: 14px; }
.compare p { margin: 0; }
.compare .weak { background: var(--t-peach); color: var(--t-peach-ink); }
.compare .better { background: var(--t-mint); color: var(--t-mint-ink); }
.compare small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; opacity: .8; }

.figure { margin: 56px 0 !important; }
.figure .ph { aspect-ratio: 16/9; border-radius: 16px; background: var(--muted); border: 1px dashed var(--border); display: grid; place-items: center; text-align: center; color: var(--muted-2); font-size: 13px; padding: 20px; }
.figure img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); }
/* Phone screenshots are portrait: keep them phone-sized and centred instead of column-wide. */
.figure img[src*="/screens/"] { width: auto; max-width: min(100%, 320px); max-height: 620px; display: block; margin: 0 auto; border-radius: 24px; }
.figure .ph b { display: block; color: var(--muted-fg); font-weight: 600; margin-bottom: 4px; }

.callout {
  padding: 22px 24px; border-radius: 16px; background: var(--muted);
  font-size: 17px; line-height: 27px; margin-top: 36px !important;
}
.callout.tip { background: var(--t-sky); color: var(--t-sky-ink); }
.callout .lbl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }

.product {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 28px 30px; border-radius: 18px; border: 1px solid var(--border); margin-top: 48px !important;
}
.product .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--muted-fg); }
.product strong { display: block; font-family: var(--font-title); font-size: 19px; line-height: 26px; margin: 8px 0 8px; }
.product p { margin: 0; font-size: 15px; line-height: 23px; color: var(--muted-fg); }
.product p.examples { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; color: var(--fg); }

.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; font-family: var(--font-title); font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted-fg); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 24px; font-size: 17px; line-height: 28px; color: var(--muted-fg); }

.sources { font-size: 15px; line-height: 25px; }
.sources ol { padding-left: 22px; }
.sources li + li { margin-top: 14px; }
.sources li a { text-decoration: underline; text-decoration-color: var(--muted-2); text-underline-offset: 3px; }
.sources .pub { color: var(--muted-fg); }

.author {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  padding: 28px; border-radius: 18px; background: var(--muted); margin-top: 80px;
}
.author .avatar { width: 56px; height: 56px; }
.author strong { display: block; font-family: var(--font-title); font-size: 16px; }
.author .role { font-size: 13px; color: var(--muted-fg); }
.author p { margin: 10px 0 0; font-size: 15px; line-height: 23px; color: var(--muted-fg); }

.related { padding: 72px 0 104px; border-top: 1px solid var(--border); }
.related h2 { font-size: 24px; line-height: 30px; margin: 0 0 20px; }

.footer { border-top: 1px solid var(--border); padding: 28px 0 48px; font-size: 13px; color: var(--muted-fg); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .grid, .grid.featured { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; order: -1; margin-bottom: 28px; padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
  .toc .cta { display: none; }
}
@media (max-width: 640px) {
  .crumbs { padding-top: 24px; }
  .post-grid { padding: 40px 0 64px; }
  .nav { display: none; }
  .grid, .grid.featured { grid-template-columns: 1fr; }
  .list a { grid-template-columns: 1fr; gap: 4px; }
  .list .when { order: -1; }
  .index-hero h1 { font-size: 30px; line-height: 34px; }
  .post-head h1 { font-size: 34px; line-height: 40px; }
  .post-head .dek { font-size: 17px; line-height: 26px; }
  .prose { font-size: 17px; line-height: 29px; }
  .prose h2 { font-size: 26px; line-height: 32px; margin-top: 64px; }
  .compare { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
}

/* ---- v2: centered editorial layout ------------------------------------- */
.post-shell { max-width: 820px; }
.post-shell > .crumbs, .post-shell > .post-head, .post-shell > .cover-fig { max-width: none; }
.crumbs { justify-content: center; }
.post-head { text-align: center; }
.post-head h1 { font-size: 48px; line-height: 56px; letter-spacing: -0.025em; }
.post-head .dek { margin-left: auto; margin-right: auto; max-width: 680px; }
.byline { justify-content: center; }
.chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chips .chip { height: 26px; font-size: 12px; padding: 0 10px; }
.chips .chip.lvl { background: var(--t-peri); color: var(--t-peri-ink); border-color: transparent; font-weight: 600; }
.chips .chip.cat { background: var(--t-mint); color: var(--t-mint-ink); border-color: transparent; font-weight: 600; }
.cover { background: linear-gradient(180deg, var(--acc), #fff); }

.post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.prose { max-width: none; }
.prose h2 { text-align: center; font-size: 30px; line-height: 38px; margin-top: 96px; }
.prose h2 + p, .prose h2 + .table-wrap { margin-top: 24px; }
.prose .part-label { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-fg); margin-top: 104px; }
.prose .part-label + h2 { margin-top: 14px; }
.prose > .lede { font-size: 21px; line-height: 34px; }

/* mini contents: a sticky rail inside the article grid, so it stops with the article */
.toc { display: none; }
@media (min-width: 1280px) {
  .post-shell { max-width: 820px; overflow: visible; }
  .post-grid { grid-template-columns: 196px minmax(0, 820px); column-gap: 40px; margin-left: -236px; }
  .post-grid > .prose { grid-column: 2; }
  .toc { display: block; grid-column: 1; grid-row: 1; order: 0; position: sticky; top: 100px; align-self: start; width: 196px; font-size: 12px; margin: 0; padding: 0; border: 0; }
  .toc h4 { font-size: 10px; }
  .toc li a { padding: 4px 0 4px 12px; line-height: 16px; }
  .toc .cta { margin-top: 20px; padding: 14px; border-radius: 12px; background: var(--muted); }
  .toc .cta strong { font-size: 13px; line-height: 18px; margin-bottom: 6px; }
  .toc .cta p { font-size: 12px; line-height: 17px; margin-bottom: 10px; }
  .toc .cta .btn { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
}

/* Slova card: problem → feature, one tint per row */
.slova-card { margin-top: 48px !important; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; font-size: 15px; line-height: 23px; }
.slova-card .sc-head { padding: 20px 24px; background: var(--muted); }
.slova-card .sc-head .k { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--muted-fg); margin-bottom: 6px; }
.slova-card .sc-head strong { font-family: var(--font-title); font-size: 19px; line-height: 26px; }
.slova-card .sc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; padding: 16px 24px; border-top: 1px solid var(--border); }
.slova-card .sc-row .prob { color: var(--muted-fg); }
.slova-card .sc-row .fix b { font-weight: 600; display: inline-block; padding: 0 8px; border-radius: 6px; margin-right: 4px; line-height: 21px; }
.slova-card .t-mint .fix b { background: var(--t-mint); color: var(--t-mint-ink); }
.slova-card .t-sky .fix b { background: var(--t-sky); color: var(--t-sky-ink); }
.slova-card .t-butter .fix b { background: var(--t-butter); color: var(--t-butter-ink); }
.slova-card .t-peri .fix b { background: var(--t-peri); color: var(--t-peri-ink); }
.slova-card .sc-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted-fg); }
.slova-card .sc-foot .examples { max-width: 520px; }
@media (max-width: 640px) {
  .slova-card .sc-row { grid-template-columns: 1fr; gap: 6px; }
  .slova-card .sc-foot { flex-direction: column; align-items: flex-start; }
  .post-head h1 { font-size: 34px; line-height: 40px; }
  .prose h2 { font-size: 26px; line-height: 32px; margin-top: 64px; }
}

/* ---- Slova mini: a one-line nudge, dropped between paragraphs ---------- */
.slova-mini {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 32px !important; padding: 14px 18px; border-radius: 14px;
  font-size: 15px; line-height: 23px;
}
.slova-mini p { margin: 0; }
.slova-mini b { font-weight: 600; }
.slova-mini em { font-style: normal; font-weight: 600; }
.slova-mini a {
  white-space: nowrap; font-weight: 600; text-decoration: none;
  border-bottom: 1.5px solid currentColor; padding-bottom: 1px;
}
.slova-mini a:hover { opacity: .75; }
.slova-mini, .slova-mini.mint { background: var(--t-mint); color: var(--t-mint-ink); }
.slova-mini.sky { background: var(--t-sky); color: var(--t-sky-ink); }
.slova-mini.butter { background: var(--t-butter); color: var(--t-butter-ink); }
.slova-mini.peri { background: var(--t-peri); color: var(--t-peri-ink); }
@media (max-width: 640px) {
  .slova-mini { flex-direction: column; align-items: flex-start; gap: 10px; }
}
/* ---- Grammar blocks ---------------------------------------------------
   Three components a grammar post needs and an article does not: a sentence
   broken into coloured parts, a drawn diagram, and the black test. They live
   inside .prose and are the only blocks allowed to leave the text column. */

/* Sentence anatomy: one sentence pulled apart, or a set of sentences whose
   differences are the lesson. Roles are named by the writer and coloured by
   order of first appearance, so any topic can mark what matters to it. */
.anatomy { margin-top: 36px !important; }
.anatomy .lead { margin: 0 0 18px; color: var(--muted-fg); font-size: 16px; line-height: 26px; }
.anatomy .sent {
  margin: 0; font-family: var(--font-title); font-weight: 600;
  font-size: 26px; line-height: 48px; letter-spacing: -.02em;
}
.anatomy .sent span { padding: 3px 10px; border-radius: 9px; }
.anatomy .trans { margin: 14px 0 0; color: var(--muted-fg); font-size: 16px; line-height: 24px; }
.anatomy .parts { list-style: none; margin: 20px 0 0 !important; padding-left: 0 !important; display: grid; gap: 12px; }
.anatomy .parts li { margin: 0; font-size: 16px; line-height: 27px; }
.anatomy .parts li + li { margin-top: 0; }
.anatomy .parts li::marker { content: none; }
.anatomy .parts b { display: inline-block; margin-right: 10px; padding: 1px 9px; border-radius: 7px; font-weight: 600; white-space: nowrap; }

/* A contrast set: several sentences, each with the line that explains it. */
.anatomy .set { display: grid; gap: 22px; }
.anatomy .set > div { padding-left: 16px; border-left: 2px solid var(--border); }
.anatomy .set .sent { font-size: 22px; line-height: 42px; }
.anatomy .set .why { margin: 6px 0 0; font-size: 16px; line-height: 25px; color: var(--muted-fg); }
.anatomy .set .why b { color: var(--fg); font-weight: 600; }

.anatomy .legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0 !important; }
.anatomy .legend span { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.t-a { background: var(--t-peri); color: var(--t-peri-ink); }
.t-b { background: var(--acc); color: var(--acc-fg); }
.t-c { background: var(--t-sky); color: var(--t-sky-ink); }
.t-d { background: var(--t-peach); color: var(--t-peach-ink); }
.t-e { background: var(--t-butter); color: var(--t-butter-ink); }
.t-f { background: var(--t-pink); color: var(--t-pink-ink); }

/* The test. Black, interactive, and it breaks out of the column. */
/* Below 1280 there is no contents rail, so the block may break out of the
   column. At 1280 and up the rail occupies the left gutter and it must not. */
.quiz {
  position: relative; left: 50%; transform: translateX(-50%);
  width: min(1120px, calc(100vw - 32px));
  margin-top: 64px !important; margin-bottom: 64px;
  color: #fff; scroll-margin-top: 80px;
}
@media (min-width: 1280px) {
  .quiz { left: auto; transform: none; width: 100%; }
}
.quiz-panel {
  border-radius: 28px; background: #0a0a0a;
  padding: clamp(40px, 5vw, 72px) clamp(20px, 3vw, 48px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.quiz .k { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #c4a3ff; }
.quiz h2 { margin: 14px 0 0 !important; font-family: var(--font-title); font-weight: 700; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -.02em; color: #fff; text-align: center; }
.quiz .dl { margin: 12px 0 0; max-width: 52ch; font-size: 16px; line-height: 26px; color: rgba(255, 255, 255, .7); }

.qtabs { position: relative; display: flex; gap: 4px; margin: 32px auto 18px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .1); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.qtabs::-webkit-scrollbar { display: none; }
.qtabs .ind { position: absolute; top: 5px; bottom: 5px; left: 5px; width: 0; border-radius: 999px; background: #fff; transition: left .3s var(--ease), width .3s var(--ease); }
.qtabs button { position: relative; z-index: 1; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .7); font-weight: 600; font-size: 13px; white-space: nowrap; }
.qtabs button.is-on { color: #0a0a0a; }
.qtabs button.done::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #c4a3ff; margin-left: 7px; vertical-align: middle; }

.quiz .screen { position: relative; width: min(720px, 100%); border-radius: 20px; background: #fff; color: var(--fg); text-align: left; min-height: 290px; }
.quiz .pane { position: absolute; inset: 0; padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s; }
.quiz .pane.is-on { opacity: 1; visibility: visible; position: relative; }
.quiz .qk { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--acc-fg); }
.quiz .pane h3 { margin: 0 !important; font-family: var(--font-title); font-weight: 600; font-size: 22px; line-height: 30px; letter-spacing: -.02em; }
.quiz .opts { display: grid; gap: 9px; }
.quiz .opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--fg); font-size: 16px; line-height: 24px; transition: border-color .15s, background .15s; }
.quiz .opt:hover { border-color: var(--cta); background: var(--acc); }
.quiz .opt.ok { border-color: #1f9d55; background: #f0fbf4; }
.quiz .opt.no { border-color: #e7b4bb; background: #fdf4f5; color: var(--muted-fg); }
.quiz .opt .mark { flex: none; font-size: 12px; font-weight: 600; }
.quiz .opt.ok .mark { color: #1f9d55; }
.quiz .opt.no .mark { color: #c02c3d; }
.quiz .why { margin: 0; color: var(--muted-fg); font-size: 15px; line-height: 24px; min-height: 1.5em; }
.quiz .why b { color: var(--fg); }
.quiz .pane .next { align-self: flex-end; }
.quiz .pane .next[hidden] { display: none; }
.quiz .result { display: none; flex-direction: column; align-items: center; gap: 12px; margin-top: 26px; }
.quiz .result.show { display: flex; }
.quiz .result h3 { margin: 0 !important; font-family: var(--font-title); font-weight: 700; font-size: 24px; color: #fff; }
.quiz .result p { margin: 0; color: rgba(255, 255, 255, .7); max-width: 46ch; font-size: 15px; line-height: 24px; }
.quiz .result .btn { margin-top: 4px; text-decoration: none; border-bottom: 0; }

@media (max-width: 640px) {
  .anatomy .sent { font-size: 22px; line-height: 38px; }
  .quiz { width: calc(100vw - 20px); }
  .quiz .screen { min-height: 340px; }
}

/* ---- index browse screen ---- */
/* The index reads like a browse screen: one search box, two filters, and one
   row per section that opens into a grid. */
.searchbox { margin: 24px 0 4px; padding: 8px; border: 1px solid var(--border); border-radius: 18px; }
.searchrow { display: flex; gap: 8px; }
.inputwrap { display: flex; align-items: center; gap: 10px; background: var(--muted); border-radius: 12px; padding: 0 14px; flex: 1; min-width: 0; }
.inputwrap svg { width: 18px; height: 18px; color: var(--muted-fg); flex: none; }
.searchbox input { height: 46px; border: 0; outline: none; background: transparent; width: 100%; min-width: 0; color: var(--fg); font: inherit; }
.searchbtn { border: 0; border-radius: 12px; background: var(--fg); color: #fff; padding: 0 20px; font: inherit; font-weight: 600; cursor: pointer; }
.filterrow { display: flex; gap: 8px; align-items: center; padding-top: 8px; flex-wrap: wrap; }
.filterrow select { border: 0; border-radius: 12px; padding: 9px 12px; background: var(--muted); color: var(--muted-fg); font: inherit; font-size: 13px; min-width: 150px; }
.reset { border: 0; background: none; color: var(--muted-fg); font: inherit; font-size: 13px; margin-left: auto; padding: 6px 10px; cursor: pointer; }
.section { margin-top: 40px; }
.section[hidden] { display: none; }
.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sectionhead h2 { font-size: 18px; line-height: 24px; margin: 0; }
.more { border: 1px solid var(--border); background: none; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--muted-fg); cursor: pointer; }
.more:hover { color: var(--fg); border-color: var(--muted-2); }
.count { font-size: 13px; color: var(--muted-fg); }
.track { display: flex; gap: 20px; overflow: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.track > .card { flex: 0 0 300px; scroll-snap-align: start; }
.track.expanded { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
.track.expanded > .card { flex: none; }
.track.expanded.featured { grid-template-columns: 1.4fr 1fr 1fr; }
.empty { padding: 36px 0; color: var(--muted-fg); }
.cta-block { margin-top: 72px; padding: 48px 28px; border: 1px solid var(--border); border-radius: 18px; text-align: center; }
.cta-block h2 { font-size: 26px; line-height: 32px; margin: 0 0 18px; }
@media (max-width: 860px) { .track.expanded, .track.expanded.featured { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .track > .card { flex-basis: 262px; }
  .track.expanded, .track.expanded.featured { grid-template-columns: 1fr; }
  .filterrow select { flex: 1; min-width: 120px; }
  .cta-block { padding: 36px 20px; }
  .cta-block h2 { font-size: 22px; line-height: 28px; }
}

/* ---- Apps pages: picks, scores, matrix ---------------------------------
   Comparison pages answer "which one" first, then show why. Each app keeps
   one colour across all three blocks; Slova is always the violet one. */
.prose { --k-c1: #16a34a; --k-c2: #0284c5; --k-c3: #d97706; --k-s: var(--cta); }
.k-c1 { --k: var(--k-c1); } .k-c2 { --k: var(--k-c2); } .k-c3 { --k: var(--k-c3); } .k-s { --k: var(--k-s); }

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 36px !important; }
.pick { border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 20px; background: #fff; }
.pick .app { display: inline-block; font-family: var(--font-title); font-weight: 700; font-size: 15px; }
.pick .who { margin: 10px 0 0; font-weight: 600; font-size: 16px; line-height: 23px; }
.pick .why { margin: 6px 0 0; font-size: 14px; line-height: 21px; color: var(--muted-fg); }
.pick.is-slova { border-color: var(--cta); background: linear-gradient(180deg, var(--acc), #fff 70%); box-shadow: 0 12px 30px -22px var(--cta); }
.pick.is-slova .app { color: var(--acc-fg); }
.pick.is-slova .app::after { content: "Our pick"; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: var(--cta); color: #fff; font: 600 11px/18px var(--font-sans); vertical-align: 2px; }

.scores { border: 1px solid var(--border); border-radius: 18px; padding: 26px 26px 22px; margin-top: 32px !important; font-size: 14px; line-height: 20px; }
.scores .lead { margin: 0 0 14px; color: var(--muted-fg); font-size: 15px; line-height: 23px; }
.scores .legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 8px; font-weight: 600; }
.scores .legend span::before, .scores .totals div::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--k); margin-right: 7px; vertical-align: 0; }
.scores .group { padding: 14px 0; border-top: 1px solid var(--subtle); }
.scores .group:first-of-type { border-top: 0; }
.scores .cat { margin: 0 0 8px; font-family: var(--font-title); font-weight: 700; font-size: 15px; }
.scores .bar { display: grid; grid-template-columns: 84px 1fr 24px; gap: 12px; align-items: center; margin-top: 5px; color: var(--muted-fg); }
.scores .bar .who { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores .rail { height: 10px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.scores .rail i { display: block; height: 100%; border-radius: 99px; background: var(--k); opacity: .55; }
.scores .bar.is-top .rail i { opacity: 1; }
.scores .bar b { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }
.scores .bar.is-top .who { color: var(--fg); font-weight: 600; }
.scores .totals { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.scores .totals small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-fg); }
.scores .totals div { display: flex; align-items: center; gap: 6px; }
.scores .totals b { font-family: var(--font-title); font-size: 18px; }

.matrix table { min-width: 560px; }
.matrix thead th { text-align: center; }
.matrix thead th:first-child { text-align: left; }
.matrix thead th[class*="k-"], .table-wrap.apps thead th[class*="k-"] { background: color-mix(in srgb, var(--k) 12%, #fff); color: color-mix(in srgb, var(--k) 80%, #000); border-bottom: 2px solid var(--k); }
.matrix tbody th { text-align: left; font-weight: 500; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; line-height: 22px; }
.matrix tbody tr:last-child th { border-bottom: 0; }
.matrix td { text-align: center; vertical-align: middle !important; }
.prose .matrix td:first-child { font-weight: 400; white-space: normal; }
.matrix .mk { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 14px; font-weight: 700; }
.matrix .m-yes .mk { background: var(--t-mint); color: var(--t-mint-ink); }
.matrix .m-part .mk { background: #fdecc8; color: #a16207; }
.matrix .m-no .mk { background: var(--t-pink); color: var(--t-pink-ink); }
.matrix td small { display: block; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted-fg); }
.matrix tbody tr:hover { background: #fafafa; }

@media (max-width: 640px) {
  .scores { padding: 20px 16px 18px; }
  .scores .bar { grid-template-columns: 70px 1fr 22px; gap: 8px; }
}

.matrix td.m-yes { background: color-mix(in srgb, var(--t-mint) 45%, #fff); }
.matrix td.m-no { background: color-mix(in srgb, var(--t-pink) 30%, #fff); }
.matrix-key { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 32px !important; margin-bottom: -18px; font-size: 13px; color: var(--muted-fg); }
.matrix-key span { display: inline-flex; align-items: center; gap: 6px; }
.matrix-key i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 700 11px/1 var(--font-sans); }
.matrix-key .m-yes i { background: var(--t-mint); color: var(--t-mint-ink); }
.matrix-key .m-part i { background: #fdecc8; color: #a16207; }
.matrix-key .m-no i { background: var(--t-pink); color: var(--t-pink-ink); }

/* app tables: the better cell of a row carries that app's colour */
.table-wrap.apps td.win { background: color-mix(in srgb, var(--k) 9%, #fff); color: color-mix(in srgb, var(--k) 75%, #000); font-weight: 600; }
.table-wrap.apps td.win::before { content: "✓ "; font-weight: 700; }
.table-wrap.apps tbody th { text-align: left; font-weight: 500; padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 15px; white-space: nowrap; }
.table-wrap.apps tbody tr:last-child th { border-bottom: 0; }

/* ---- Stats: the numbers before the story ------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 36px !important; }
.stat { border: 1px solid var(--border); border-top: 3px solid var(--k); border-radius: 16px; padding: 18px 20px 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--k) 7%, #fff), #fff 55%); }
.stat .app { margin: 0 0 14px; font: 700 15px/20px var(--font-title); color: color-mix(in srgb, var(--k) 80%, #000); }
.stat dl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin: 0; }
.stat dt { font-size: 12px; line-height: 16px; color: var(--muted-fg); }
.stat dd { margin: 3px 0 0; font: 700 22px/28px var(--font-title); letter-spacing: -0.01em; color: var(--fg); }
.stats .note { grid-column: 1 / -1; margin: 2px 0 0; font-size: 12px; line-height: 18px; color: var(--muted-2); }

/* ---- Slova promo: a quiet banner on app comparisons -------------------- */
.slova-mini.slova-promo {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  background: linear-gradient(100deg, #faf5ff 0%, #fff 60%); color: var(--fg);
  border: 1px solid #e9d8fd; border-radius: 16px; box-shadow: 0 10px 28px -24px var(--cta);
}
.slova-promo .mark { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--cta); display: grid; place-items: center; }
.slova-promo .mark::after { content: "S"; color: #fff; font: 700 17px/1 var(--font-title); }
.slova-promo p { flex: 1; font-size: 15px; line-height: 22px; color: #3f3f46; }
.slova-promo b { color: var(--acc-fg); }
.slova-promo a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 9px 14px; border-radius: 99px;
  background: var(--cta); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
}
.slova-promo a:hover { background: var(--cta-hover); opacity: 1; }
@media (max-width: 640px) {
  .slova-mini.slova-promo { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .slova-promo p { flex-basis: calc(100% - 50px); }
  .slova-promo a { margin-left: 48px; }
  .stat dd { font-size: 20px; }
}
.stat dd em { display: block; margin-top: 1px; font: 500 12px/16px var(--font-sans); letter-spacing: 0; color: var(--muted-fg); }
.pick[class*="k-c"] { border-top: 3px solid var(--k); }
.pick[class*="k-c"] .app { color: color-mix(in srgb, var(--k) 80%, #000); }
.stats { display: flex; flex-wrap: wrap; }
.stats .stat { flex: 1 1 240px; }
.stats .note { flex-basis: 100%; }
/* flat surfaces, no gradients */
.stat { background: #fff; }
.slova-mini.slova-promo { background: #faf7ff; box-shadow: none; }
.pick.is-slova { background: #faf7ff; box-shadow: none; }

/* ---- Apps pages, v2: the homepage's language ---------------------------
   Kickers are small, tracked and coloured; titles are tight Manrope; the
   Slova banner is a black strip like the homepage's dark sections. */
.pick, .pick[class*="k-c"], .pick.is-slova { border: 1px solid var(--border); border-top-width: 1px; border-radius: 22px; padding: 22px 22px 24px; background: #fff; box-shadow: none; }
.pick .app, .pick[class*="k-c"] .app { font: 600 12px/16px var(--font-sans); letter-spacing: .12em; color: color-mix(in srgb, var(--k) 85%, #000); }
.pick .app::before { content: "Pick "; }
.pick .who { margin-top: 12px; font: 600 20px/26px var(--font-title); letter-spacing: -0.02em; color: var(--fg); }
.pick .why { margin-top: 10px; font-size: 14px; line-height: 21px; }

.slova-mini.slova-promo {
  display: flex; flex-direction: row; align-items: center; gap: 18px;
  padding: 20px 20px 20px 22px; border: 0; border-radius: 22px;
  background: #09090b; color: #fff; box-shadow: 0 28px 60px -34px rgba(126, 34, 255, .7);
}
.slova-promo .mark { flex: none; width: 44px; height: 44px; object-fit: contain; }
.slova-promo .copy { flex: 1; min-width: 0; }
.slova-promo .kicker { display: block; font: 600 11px/14px var(--font-sans); letter-spacing: .14em; color: #b58cff; }
.slova-promo strong { display: block; margin-top: 4px; font: 600 18px/24px var(--font-title); letter-spacing: -0.015em; color: #fff; }
.slova-promo p { margin: 3px 0 0; font-size: 14px; line-height: 21px; color: #a1a1aa; }
.slova-promo b { color: #fff; font-weight: 600; }
.slova-promo a.go {
  flex: none; border: 0; padding: 12px 18px; border-radius: 14px; background: #7e22ff; color: #f4edff;
  font: 500 15px/20px var(--font-sans); text-decoration: none; white-space: nowrap;
}
.slova-promo a.go:hover { background: #6d12ee; opacity: 1; }
.toc .cta .mark { display: block; width: 28px; height: 28px; object-fit: contain; margin-bottom: 10px; }
@media (max-width: 640px) {
  .slova-mini.slova-promo { flex-wrap: wrap; align-items: flex-start; padding: 18px; }
  .slova-promo .mark { width: 36px; height: 36px; }
  .slova-promo .copy { flex-basis: calc(100% - 56px); }
  .slova-promo a.go { margin-left: 54px; }
}
.slova-promo img.mark { background: none; border-radius: 0; display: block; }
/* v3: no glow behind the banner, no outlines on the top boxes */
.slova-mini.slova-promo { box-shadow: none; }
.slova-promo strong { margin-top: 0; }
.stat, .pick, .pick[class*="k-c"], .pick.is-slova { border: 0; background: #f6f6f7; }

/* ---- List pages: entries and the lineup table --------------------------- */
.entry { margin-top: 44px !important; padding-top: 32px; border-top: 1px solid var(--border); }
.entry .head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.entry .rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--fg); color: #fff; font: 700 14px/1 var(--font-title); }
.entry .mark { width: 28px; height: 28px; object-fit: contain; }
.prose .entry h3 { margin: 0; font: 700 24px/30px var(--font-title); letter-spacing: -0.02em; }
.entry .best { padding: 4px 10px; border-radius: 99px; background: var(--muted); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted-fg); }
.entry > p { margin-top: 16px; }
.entry .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.entry .pc p { margin: 0; padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 23px; background: #f6f6f7; }
.entry .pc b { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.entry .pro b { color: var(--t-mint-ink); }
.entry .con b { color: var(--t-pink-ink); }
.entry .facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.prose .entry .facts li { margin: 0; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; line-height: 18px; color: var(--muted-fg); }
.entry.is-slova .rank { background: #7e22ff; }
.entry.is-slova .best { background: #f3ebff; color: #6d12ee; }
.entry.is-slova .pc p { background: #faf7ff; }

.lineup table { min-width: 720px; }
.lineup tbody th { white-space: nowrap; font-weight: 600; }
.lineup td.txt { font-size: 14px; line-height: 20px; color: var(--fg); }
.lineup tr.is-slova th, .lineup tr.is-slova td { background: #faf7ff; }
.lineup tr.is-slova th { color: #6d12ee; }
@media (max-width: 640px) { .entry .pc { grid-template-columns: 1fr; } }
