/* Flathub-inspired theme. Token references and rollout plan: docs/IMPLEMENTATION.md.
   Inter is distributed under the SIL Open Font License; see fonts/OFL.txt. */
@font-face {
  font-family: Inter;
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: oklch(25.61% .0354 296.84);
  --muted: oklch(48.56% .0136 312.8);
  --line: #e5e4e8;
  --blue: oklch(49.79% .1314 251.94);
  --green: #187349;
  --surface: #fff;
  --canvas: oklch(98.48% 0 0);
  --accent-soft: #eaf3fc;
  --chart-new: #187349;
  --chart-updated: oklch(63.85% .1314 251.94);
  --chart-total: #7852a3;
  --control: #efeff1;
  --hover: #f0f0f3;
  --table-heading: #f1f1f4;
  --new-soft: #e6f5ec;
  --returned-soft: #eee8f6;
  --returned: #684590;
  --notice-bg: #fff9e8;
  --notice-ink: #665022;
  --notice-line: #e9dfbe;
  --button-ink: #fff;
  --button-hover: #1c568c;
  --card-line: #ecebef;
  --card-hover: #c9d9ec;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; font: 400 16px/1.6 Inter, system-ui, sans-serif; color: var(--ink); background: var(--canvas); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0 0 1rem; }
h1, h2, h3, h4 { font-weight: 750; line-height: 1.25; letter-spacing: -.025em; }
h1, .p-heading--2 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); font-weight: 800; }
h2 { font-size: 1.5rem; }
h3, .p-heading--5 { font-size: 1.05rem; letter-spacing: -.015em; }
.p-muted-heading { font-size: 1.05rem; font-weight: 700; letter-spacing: 0; }
small { font-size: .875rem; }
code { font-family: ui-monospace, monospace; font-size: .875em; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-weight: 600; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); }
dl { margin: 0; } dd { margin-left: 0; } dt { font-weight: 600; }
.u-off-screen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.u-no-margin--bottom { margin-bottom: 0; }
.p-button, .p-button--positive, button, select, input {
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; background: var(--surface); color: var(--ink);
}
.p-button, .p-button--positive { display: inline-block; font-weight: 600; line-height: 1.5; text-align: center; }
.p-button:hover, button:hover { background: var(--hover); text-decoration: none; }
.p-button--positive { background: var(--blue); border-color: var(--blue); color: var(--button-ink); }
.p-button--positive:hover { background: var(--button-hover); color: var(--button-ink); text-decoration: none; }
.p-card { background: var(--surface); border: 1px solid var(--card-line); border-radius: 12px; box-shadow: 0 2px 5px #24203308, 0 1px 2px #24203305; }
.container { max-width: 1240px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 82px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.site-brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; color: var(--ink); letter-spacing: -.04em; white-space: nowrap; }
.site-brand:hover { text-decoration: none; }
.site-brand strong { color: var(--blue); }
.site-brand img { border-radius: 10px; }
.unofficial { color: var(--muted); font-size: .65rem; font-weight: 600; border: 1px solid var(--line); padding: 2px 7px; border-radius: 20px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 3px; margin-left: auto; }
.main-nav a, .header-feed { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 10px; font-size: .85rem; font-weight: 600; color: var(--muted); border-radius: 8px; }
.main-nav a:hover, .header-feed:hover { background: var(--canvas); text-decoration: none; color: var(--ink); }
.main-nav a[aria-current] { background: var(--accent-soft); color: var(--blue); }
.header-feed { color: var(--blue); }
.stats-strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.stat-bar { padding: 14px 0; gap: 28px; color: var(--muted); font-size: .8rem; }
.stat-bar strong { font-weight: 700; }
.stat-bar>span:last-child { margin-left: auto; }
.notice { border-color: var(--notice-line); background: var(--notice-bg); color: var(--notice-ink); font-size: .8rem; }
main.container { padding-top: 36px; }
.page-heading { align-items: center; margin-bottom: 28px; }
.page-heading p { font-size: .9rem; }
.page-heading .search { margin-bottom: 0; }
.search input { height: 44px; background: var(--control); border-color: transparent; border-radius: 24px; padding-left: 18px; }
.search input:focus { background: var(--surface); }
.search button { height: 42px; border-radius: 50%; }
.p-icon--search { display: block; width: 15px; height: 15px; border: 2px solid var(--muted); border-radius: 50%; position: relative; }
.p-icon--search::after { content: ''; position: absolute; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); right: -5px; bottom: -2px; }
.activity-section { padding: 24px; margin-bottom: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.activity-section h2 { margin-bottom: 16px; }
.activity-ranges { gap: 6px; }
.activity-ranges a { font-size: .75rem; padding: 6px 12px; border-color: transparent; background: var(--canvas); margin-bottom: 0; }
.activity-ranges a[aria-current] { background: var(--accent-soft); color: var(--blue); }
.activity-legend { display: flex; gap: 20px; font-size: .75rem; margin: 18px 0 0; flex-wrap: wrap; }
.legend-total { color: var(--chart-total); }.legend-new { color: var(--chart-new); }.legend-updated { color: var(--blue); }
.activity-chart-scroll:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.activity-chart text { font: 13px Inter, sans-serif; fill: var(--muted); }
.activity-coverage { font-size: .75rem; }
.changes, .developers { background: var(--surface); border: 1px solid var(--line); }
.changes th, .developers th { background: var(--table-heading); font-size: .75rem; color: var(--muted); padding: 12px 18px; }
.changes td, .developers td { padding: 16px 18px; font-size: .875rem; }
.changes th a { color: var(--muted); }
.table-app>div>a { color: var(--ink); font-weight: 650; }
.table-app small, td>small { font-size: .75rem; }
.app-icon { background: var(--table-heading); border-radius: 8px; }
.app-icon img { background: transparent; }
.app-icon.large { width: 56px; height: 56px; }
.app-icon.sample { width: 28px; height: 28px; }
.badge { font-size: .75rem; font-weight: 600; padding: 3px 10px; }
.badge-new { background: var(--new-soft); color: var(--green); }.badge-updated { background: var(--accent-soft); color: var(--blue); }.badge-returned { background: var(--returned-soft); color: var(--returned); }
.app-card { padding: 20px; transition: box-shadow .15s, border-color .15s; }
.app-card:hover, .directory-card:hover { border-color: var(--card-hover); box-shadow: 0 4px 14px #2420330d; }
.app-card h2 a, .app-card h3 a { color: var(--ink); }
.app-card small { font-size: .75rem; }
.app-card small a { color: var(--muted); }
.event-card .event-version { color: var(--muted); }
.directory-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.directory-grid>div { min-width: 0; }
.directory-card { padding: 20px; height: 100%; margin: 0; }
.directory-icons { margin-top: 16px; gap: 6px; }
.category-card, .metadata { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.metadata { align-self: start; }
.category-tag, .external-links a { background: var(--accent-soft); border-radius: 6px; }
.screenshots img { border-radius: 12px; }
.verified { color: var(--green); }
footer { background: var(--surface); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 1250px) {
  .main-nav { order: 3; margin-left: 0; width: 100%; }
  .header-actions { margin-left: auto; }
  .header-inner { gap: 10px; }
  .directory-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 772px) {
  .header-inner { padding-top: 12px; padding-bottom: 12px; }
  .site-brand { font-size: 1.1rem; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 8px 10px; min-height: 44px; font-size: .8rem; }
  .stat-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 12px 0; font-size: .75rem; }
  .stat-bar>span:last-child { margin-left: 0; }
  .activity-section { padding: 16px; }
  .activity-ranges a { min-height: 36px; display: inline-flex; align-items: center; }
  .activity-legend { gap: 10px; }
  .changes, .developers { border: 0; background: transparent; }
  .changes tr, .developers tr { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: var(--surface); }
  .changes td, .developers td { padding: 0; }
  .directory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .directory-card, .app-card { padding: 16px; }
  .metadata { align-self: stretch; }
}
@media (max-width: 380px) {
  .unofficial { display: none; }
  .app-grid, .directory-grid { grid-template-columns: 1fr; }
}

/* Auto also works without JavaScript. Explicit Light always overrides the OS. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eeecf2;
  --muted: #bcb8c5;
  --line: #4b4556;
  --blue: #8bc3fc;
  --green: #84d5a7;
  --surface: oklch(25.61% .0354 296.84);
  --canvas: #201d27;
  --accent-soft: #293c52;
  --chart-new: #84d5a7;
  --chart-updated: #8bc3fc;
  --chart-total: #c8a5ed;
  --control: #363140;
  --hover: #403949;
  --table-heading: #363140;
  --new-soft: #233e32;
  --returned-soft: #40304f;
  --returned: #d5b6f1;
  --notice-bg: #39321e;
  --notice-ink: #ead69c;
  --notice-line: #625537;
  --button-ink: #172638;
  --button-hover: #abd4ff;
  --card-line: #423c4d;
  --card-hover: #698bb1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: dark;
  --ink: #eeecf2;
  --muted: #bcb8c5;
  --line: #4b4556;
  --blue: #8bc3fc;
  --green: #84d5a7;
  --surface: oklch(25.61% .0354 296.84);
  --canvas: #201d27;
  --accent-soft: #293c52;
  --chart-new: #84d5a7;
  --chart-updated: #8bc3fc;
  --chart-total: #c8a5ed;
  --control: #363140;
  --hover: #403949;
  --table-heading: #363140;
  --new-soft: #233e32;
  --returned-soft: #40304f;
  --returned: #d5b6f1;
  --notice-bg: #39321e;
  --notice-ink: #ead69c;
  --notice-line: #625537;
  --button-ink: #172638;
  --button-hover: #abd4ff;
  --card-line: #423c4d;
  --card-hover: #698bb1;
  }
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-picker[hidden] { display: none; }
.theme-picker { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.theme-picker:hover { color: var(--blue); background: var(--accent-soft); }
.theme-icon { display: none; }
[data-theme="light"] .theme-icon-light,
[data-theme="dark"] .theme-icon-dark,
[data-theme="auto"] .theme-icon-auto { display: inline; }
.changes tr:hover, .developers tr:hover, .category-card:hover { background: var(--hover); }
.app-subtitle, .directory-card small { color: var(--muted); }
.screenshots img, .skip-link { background: var(--surface); }
.example-label { background: var(--notice-bg); color: var(--notice-ink); }
.activity-chart path { stroke: var(--line); }
.activity-tooltip rect { fill: var(--surface); stroke: var(--muted); }
.activity-tooltip text { fill: var(--ink); }
.activity-day:focus-visible>rect { stroke: var(--blue); }
@media (max-width: 500px) {
  .header-actions { gap: 2px; }
  .header-feed { padding: 8px 4px; }
  .header-inner { gap: 8px; }
  .unofficial { display: none; }
}

input::placeholder { color: var(--muted); opacity: 1; }
