:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1c1f24;
  --muted: #5d6470;
  --line: #e4e0d8;
  --accent: #2b5fae;
  --accent-soft: #e8f0fb;
  --link: #1f56a8;
  --chart: #2b5fae;
  --radius: 14px;
  --serif: "Iowan Old Style", "Charter", "Source Serif Pro", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-niche="sleep"] { --accent: #4b4fb8; --accent-soft: #eceefc; }
[data-niche="anxiety"] { --accent: #2f8073; --accent-soft: #e5f3f0; }
[data-niche="padel"] { --accent: #2e7d32; --accent-soft: #e8f4e8; --chart: #2e7d32; }
[data-niche="forex"], [data-niche="trading"] { --accent: #1f6fb2; --accent-soft: #e6f0fa; }
[data-niche="stocks"] { --accent: #0f7a63; --accent-soft: #e3f4ef; }
[data-niche="crypto"] { --accent: #b86a12; --accent-soft: #fbf0e2; }
[data-niche="chess"] { --accent: #5b4636; --accent-soft: #f2ece6; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418; --surface: #1a1d23; --surface-2: #20242b; --text: #e8e9ec; --muted: #a2a8b3;
    --line: #2d323b; --accent: #8fb4f0; --accent-soft: #1d2a3f; --link: #9cc0ff; color-scheme: dark;
  }
  :root:not([data-theme="light"]) [data-niche="sleep"] { --accent: #a9adf5; --accent-soft: #24264a; }
  :root:not([data-theme="light"]) [data-niche="anxiety"] { --accent: #7fd0c2; --accent-soft: #16302c; }
  :root:not([data-theme="light"]) [data-niche="padel"] { --accent: #8fd18f; --accent-soft: #1a2f1b; --chart: #4aa851; }
  :root:not([data-theme="light"]) [data-niche="forex"], :root:not([data-theme="light"]) [data-niche="trading"] { --accent: #8cc2f0; --accent-soft: #172a3d; }
  :root:not([data-theme="light"]) [data-niche="stocks"] { --accent: #78d3bd; --accent-soft: #142f29; }
  :root:not([data-theme="light"]) [data-niche="crypto"] { --accent: #f0b768; --accent-soft: #33260f; }
  :root:not([data-theme="light"]) [data-niche="chess"] { --accent: #d6b89f; --accent-soft: #2e251e; }
}
:root[data-theme="dark"] {
  --bg: #121418; --surface: #1a1d23; --surface-2: #20242b; --text: #e8e9ec; --muted: #a2a8b3;
  --line: #2d323b; --accent: #8fb4f0; --accent-soft: #1d2a3f; --link: #9cc0ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--sans); }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
.logo b { color: var(--muted); font-weight: 650; margin-left: 2px; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); }

/* type */
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font: 650 clamp(30px, 4.6vw, 42px)/1.15 var(--serif); margin: 8px 0 12px; }
.lede { font-size: 19px; color: var(--muted); max-width: 680px; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.meta a { color: var(--muted); }
.page-head { margin: 8px 0 32px; }
.section-title { font: 650 22px/1.3 var(--serif); margin: 56px 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 650; color: var(--muted); margin: 0 0 10px; }

/* app card */
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.app-card p { margin: 0 0 12px; font-size: 15px; }
.app-card ul { margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.app-card li { padding-left: 20px; position: relative; margin: 4px 0; }
.app-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.app-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.app-head strong { display: block; line-height: 1.3; font-size: 16px; }
.app-icon { border-radius: 13px; flex: none; border: 1px solid var(--line); }
.rating { display: block; font-size: 13px; color: var(--muted); }
.app-note { font-size: 12px !important; color: var(--muted); margin: 10px 0 0 !important; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.store-btn { display: inline-flex; align-items: center; gap: 8px; background: #111; color: #fff; text-decoration: none; border-radius: 10px; padding: 7px 14px 7px 11px; line-height: 1.1; font-weight: 600; font-size: 16px; }
.store-btn small { display: block; font-size: 10px; font-weight: 500; opacity: .85; }
.store-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.store-btn:hover { background: #2a2a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .store-btn { background: #fff; color: #111; } }
.app-strip { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 24px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.4; }
.app-strip img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.app-strip > span:nth-child(2) { flex: 1; min-width: 0; }
.app-strip strong { display: block; }
.app-strip small { display: block; color: var(--muted); font-size: 13px; }
.app-strip-cta { flex: none; background: var(--accent); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 650; font-size: 13px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app-strip-cta { color: #111; } }

.store-btn.small { padding: 5px 11px 5px 9px; font-size: 14px; border-radius: 9px; }
.store-btn.small svg { width: 18px; height: 18px; }
.store-btn.small small { font-size: 9px; }

/* review layout */
.r-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.r-layout article { max-width: 760px; min-width: 0; }
.sidebar { display: none; }
@media (min-width: 1040px) {
  .r-layout { grid-template-columns: minmax(0, 760px) 240px; justify-content: space-between; }
  .sidebar { display: block; padding-top: 96px; }
  .sticky { position: sticky; top: 24px; }
  .toc-mobile { display: none; }
}
.h2, .prose h2, .quick h2, .changelog h2, .picks h2, .related h2 { font: 650 26px/1.3 var(--serif); margin: 48px 0 14px; scroll-margin-top: 16px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin: 4px 0; }
.prose blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 650; font-size: 13.5px; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
.compare tbody th { font-weight: 600; white-space: nowrap; }
.compare tbody th a { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.compare tbody th a:hover span { text-decoration: underline; }
.compare .app-icon { border-radius: 7px; }
.compare td { min-width: 110px; }

.short-answer { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 0 0 8px; }
.short-answer .label { margin: 0 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.short-answer p { margin: 0 0 8px; font-size: 17.5px; }
.short-answer p:last-child { margin: 0; }
.disclosure { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 20px; }

/* picks */
.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pick { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px 16px; display: flex; flex-direction: column; }
.pick .eyebrow { color: var(--accent); margin-bottom: 8px; }
.pick-app { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-bottom: 8px; }
.pick-app strong { font-size: 16px; line-height: 1.3; }
.pick-app:hover strong { text-decoration: underline; }
.pick > p { font-size: 14.5px; margin: 0 0 12px; flex: 1; }
.pick .app-icon { border-radius: 10px; }

/* one app's section */
.app-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 18px; scroll-margin-top: 16px; }
.app-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.app-head strong { display: block; line-height: 1.3; font-size: 18px; }
.app-icon { border-radius: 14px; flex: none; border: 1px solid var(--line); }
.app-icon.blank { display: inline-block; background: var(--surface-2); }
.pick-tag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.app-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 0 0 14px; font-size: 14px; }
.app-facts dt { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.app-facts dd { margin: 0; }
.app-facts small { color: var(--muted); }

/* table of contents */
.toc ol { list-style: none; margin: 0; padding: 0; font-size: 14px; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc li a:hover { color: var(--text); }
.toc-mobile { margin: 28px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.toc-mobile summary { cursor: pointer; font-weight: 650; font-size: 15px; }
.toc-mobile .toc { margin-top: 10px; }
.toc-mobile .eyebrow { display: none; }
.side-note { font-size: 14px; margin: 16px 0 0 14px; }

/* FAQ, changelog */
.quick { margin-top: 8px; }
.qa { padding: 12px 0; border-bottom: 1px solid var(--line); }
.qa h3 { font-size: 17px; margin: 0 0 4px; }
.qa p { margin: 0 0 8px; }
.qa p:last-child { margin: 0; }
.changelog { font-size: 15px; color: var(--muted); }
.changelog ul { padding-left: 18px; margin: 0 0 12px; }
.changelog time { font-weight: 650; color: var(--text); margin-right: 6px; }

/* testing gaps: visible only in drafts */
.todo { background: #fff3b0; color: #5c4a00; border-radius: 5px; padding: 1px 6px; font-size: .9em; font-weight: 600; }
mark.todo { display: inline; }
.draft-banner { margin-top: 20px; background: #fff3b0; color: #5c4a00; border-radius: var(--radius); padding: 12px 16px; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .todo, :root:not([data-theme="light"]) .draft-banner { background: #4a3f12; color: #ffe58a; } }

/* review lists */
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.review-list a { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); }
.review-list a:hover { box-shadow: 0 4px 16px rgb(0 0 0 / .06); }
.review-list a:hover strong { text-decoration: underline; }
.review-list .icons { display: grid; grid-template-columns: repeat(2, 32px); gap: 4px; flex: none; }
.review-list .app-icon { border-radius: 8px; }
.review-list strong { display: block; font: 650 19px/1.3 var(--serif); margin-bottom: 4px; }
.review-list small { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.review-list .when { margin-top: 6px; font-size: 13px; }
.related { margin-top: 24px; }

/* home, category, text pages */
.hero { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); padding: 56px 0 48px; }
.hero h1 { max-width: 820px; font-size: clamp(32px, 5.4vw, 52px); }
.home-cat .section-title a { color: var(--text); text-decoration: none; }
.home-cat .section-title a:hover { text-decoration: underline; }
.narrow-wide { max-width: 860px; }
.prose-page .prose { margin-top: 16px; }

/* data studies: stat tiles, bar charts, data tables */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font: 650 30px/1.1 var(--serif); letter-spacing: -.01em; }
.stat span { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 4px; }
.findings { padding-left: 22px; }
.findings li { margin: 0 0 10px; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; margin: 8px 0 24px; }
.chart h3 { font-size: 17px; margin: 0 0 2px !important; }
.chart .sub { color: var(--muted); font-size: 14px; margin: 0 0 14px !important; }
.bars-h { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 12px; align-items: center; font-size: 14px; margin: 0; }
.bars-h dt { color: var(--text); line-height: 1.3; }
.bars-h dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bars-h .bar { height: 18px; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.bars-h .val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .note { color: var(--muted); font-size: 13px; margin: 12px 0 0 !important; }
@media (max-width: 560px) {
  .bars-h { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bars-h dd { margin-bottom: 8px; }
}
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td { font-size: 14px; }
.data-table td:first-child { min-width: 170px; }
.download { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.yes { font-weight: 650; }
.dim { color: var(--muted); }
