:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #4f63f6;
  --accent-text: #ffffff;
  --link: #4f5ef6;
  --rule: #e5e5ea;
  --field: #ffffff;
  --field-border: #86868b;
  --good: #1f7a3a;
  --good-bg: #e8f5ec;
  --bad: #b3261e;
  --bad-bg: #fdecea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --accent: #7c8cff;
    --accent-text: #0b0b0f;
    --link: #6f80f8;
    --rule: #2c2c2e;
    --field: #1c1c1e;
    --field-border: #7c7c80;
    --good: #6fdc8c;
    --good-bg: #10261a;
    --bad: #ff8a80;
    --bad-bg: #2d1311;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
/* Links: brand blue, no underline. The blue has at least 4.5:1 contrast with every background
   and 3:1 with body text (WCAG 1.4.1, 1.4.3); hover and keyboard focus add an underline. */
a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* Skip link: hidden until a keyboard user tabs to it (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .inner, .site-footer .inner, main { max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.site-header .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; margin-right: auto; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; display: inline-block; padding: 10px 0; }
.site-header nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }
.site-footer .inner { padding-top: 24px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--muted); display: inline-block; padding: 6px 0; }

/* Content */
main { padding-top: 40px; padding-bottom: 64px; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.3rem; margin: 40px 0 8px; padding-top: 16px; border-top: 1px solid var(--rule); }
h3 { font-size: 1.05rem; margin: 24px 0 4px; }
.meta { color: var(--muted); margin: 0 0 24px; }
.lead { font-size: 1.1rem; }
.toc { background: var(--surface); border-radius: 12px; padding: 12px 20px; font-size: 0.95rem; }
.toc ol { margin: 8px 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; }
address { font-style: normal; }

/* FAQ: each topic's questions sit in a box like the Topics box, with small square markers. */
.faq-group { background: var(--surface); border-radius: 12px; padding: 4px 20px; }
details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.faq-group details:last-child { border-bottom: 0; }
summary {
  display: block; /* no built-in disclosure triangle */
  cursor: pointer; font-weight: 600; padding: 10px 0 10px 20px; min-height: 44px; position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
summary::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(10px + 0.8em - 3px);
  width: 6px;
  height: 6px;
  background: currentColor;
}
details[open] summary::before { background: var(--accent); }
details p { margin: 0 0 12px 20px; }

/* Form */
form { display: grid; gap: 18px; margin-top: 24px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 160px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--bad); }
.field-error { display: block; color: var(--bad); font-weight: 600; font-size: 0.95rem; margin-top: 6px; }
.field-error[hidden] { display: none; }
.required-note { color: var(--muted); margin: 0; }
.check input { width: 22px; height: 22px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button {
  justify-self: start;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
}
button[disabled] { opacity: 0.6; cursor: progress; }
.status { border-radius: 10px; padding: 12px 16px; margin: 0; }
.status.good { color: var(--good); background: var(--good-bg); }
.status.bad { color: var(--bad); background: var(--bad-bg); }
.status[hidden] { display: none; }

/* Legally conspicuous text (assumption of risk, releases). */
.conspicuous {
  border-left: 4px solid currentColor;
  padding: 0.75rem 1rem;
  font-size: 0.95em;
  line-height: 1.55;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
main:focus { outline: none; }

/* Header extras */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 7px; }
.site-header nav { align-items: center; }
.site-header nav a.nav-cta { color: var(--accent-text); background: var(--accent); border-radius: 999px; padding: 6px 14px; font-weight: 600; }
.site-header nav a.nav-cta:hover { text-decoration: none; filter: brightness(1.08); }

/* Wider pages (listings) */
main.wide, .site-header .inner, .site-footer .inner { max-width: 1080px; }

/* Buttons */
.button, button.secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 20px; border-radius: 12px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--accent-text); border: 0;
}
.button:hover, .button:focus-visible { text-decoration: none; filter: brightness(1.08); }
.button.secondary, button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--rule); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Home */
.hero { padding-bottom: 8px; }
.app-icon { display: block; border-radius: 25px; margin-bottom: 20px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 16px; }
.section-head h2 { border: 0; margin: 0; padding: 0; }
.features { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.features li { background: var(--surface); border-radius: 12px; padding: 4px 18px 6px; }
.features h3 { margin-top: 14px; }
.features p { margin: 0 0 12px; font-size: 0.95rem; }
.cta-band { margin-top: 48px; background: var(--surface); border-radius: 16px; padding: 8px 24px 24px; }
.cta-band h2 { border: 0; padding-top: 8px; margin-top: 16px; }
.status-line { color: var(--muted); }
.status-line[hidden] { display: none; }

/* Listing cards */
.cards { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.card a { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.card a:hover .card-title { text-decoration: underline; }
.card-photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface); margin-bottom: 6px; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-photo { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: 0.9rem; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--accent-text); font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.badge.inline { position: static; display: inline-block; margin-bottom: 8px; }
.card-title { font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-price { font-weight: 700; }
.card-meta { color: var(--muted); font-size: 0.85rem; }

/* Browse filters */
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); align-items: end; margin-top: 16px; }
.filter-search { grid-column: 1 / -1; }
input[type="search"] { width: 100%; font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--field-border); border-radius: 10px; padding: 10px 12px; }
.filters button { justify-self: stretch; }
.more { text-align: center; margin-top: 24px; }
.more button { justify-self: center; }

/* Listing page */
.back { margin: 0 0 16px; }
.listing { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .listing { grid-template-columns: minmax(0, 1fr); } }
.gallery-main { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--surface); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumbs { list-style: none; padding: 0; margin: 10px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; width: 64px; height: 64px; min-height: 0; border-radius: 10px; overflow: hidden; background: var(--surface); border: 2px solid transparent; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-body h1 { margin-bottom: 4px; }
.listing-price { font-size: 1.5rem; font-weight: 700; margin: 0 0 16px; }
.in-app { display: grid; gap: 10px; background: var(--surface); border-radius: 14px; padding: 16px; }
.in-app .button { width: 100%; }
.in-app .hint { margin: 0; }
.facts { display: grid; gap: 0; margin: 20px 0 0; }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.description { white-space: pre-line; }
.seller { color: var(--muted); }

/* Download, news, partners */
.download-box { background: var(--surface); border-radius: 16px; padding: 4px 20px 12px; margin-top: 8px; }
.steps li { margin-bottom: 8px; }
.post { border-top: 1px solid var(--rule); margin-top: 32px; }
.post h2 { border: 0; margin-top: 20px; padding-top: 0; }
.post h2 a { color: var(--text); }
.post .meta { margin-bottom: 12px; }
.fine-print { color: var(--muted); font-size: 0.85rem; margin-top: 40px; }

/* Text pages line up with the wide header but keep a readable line length. */
main { max-width: 1080px; }
main:not(.wide) > * { max-width: 760px; }
[hidden] { display: none !important; }
.filters select, .filters button { min-height: 46px; }
.actions:empty { display: none; }

/* Account */
.sign-in-buttons { display: grid; gap: 10px; max-width: 360px; margin: 24px 0; }
.sign-in-buttons .provider { justify-self: stretch; background: var(--surface); color: var(--text); border: 1px solid var(--field-border); }
.panel { background: var(--surface); border-radius: 14px; padding: 4px 18px 16px; }
.panel button { margin-top: 4px; }
.link-list { list-style: none; padding: 0; margin: 8px 0; }
.link-list li { border-bottom: 1px solid var(--rule); }
.link-list a { display: block; padding: 12px 0; }
.link-list a.unread strong::after, .conversations a.unread strong::after { content: " •"; color: var(--accent); }
details.danger { border: 1px solid var(--rule); border-radius: 12px; padding: 4px 16px 12px; }
details.danger summary { color: var(--bad); }
.danger-button { background: var(--bad); color: #fff; }
input[type="url"], input[type="file"] { width: 100%; font: inherit; color: var(--text); }
input[type="url"] { background: var(--field); border: 1px solid var(--field-border); border-radius: 10px; padding: 10px 12px; }

/* Messages */
.inbox { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 20px; margin-top: 16px; min-height: 60vh; }
.conversations ul { list-style: none; padding: 0; margin: 0; }
.conversations a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.conversations a:hover, .conversations a[aria-current="true"] { background: var(--surface); }
.conversations img, .thumb-empty { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface); }
.conversation-text { display: grid; min-width: 0; }
.conversation-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { color: var(--muted); font-size: 0.85rem; }
.thread { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 16px; padding: 12px 16px; min-width: 0; }
.thread-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.thread-head h2 { border: 0; margin: 0; padding: 0; }
.thread-head p { margin: 2px 0 0; }
.thread-back { display: none; }
.bubbles { list-style: none; padding: 12px 0; margin: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 55vh; flex: 1; }
.bubble { align-self: flex-start; max-width: 80%; background: var(--surface); border-radius: 16px; padding: 8px 14px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-text); }
.bubble.mine .card-meta, .bubble.mine a { color: var(--accent-text); opacity: 0.85; }
.bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.support-thread { max-height: none; }
.attachments { margin: 6px 0 0; padding-left: 18px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 8px; }
.composer textarea { min-height: 60px; }
.composer .status { grid-column: 1 / -1; }
.composer.stacked { grid-template-columns: 1fr; }
.safety { font-size: 0.9rem; }
.safety summary { min-height: 0; padding: 4px 0 4px 16px; color: var(--muted); font-weight: 500; }
.safety-body { display: grid; gap: 6px; padding: 8px 0; min-width: 240px; }
@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.show-thread .conversations { display: none; }
  .inbox:not(.show-thread) .thread { display: none; }
  .thread-back { display: inline-block; margin-bottom: 4px; }
  .thread-head { flex-direction: column; }
}
.in-app button { width: 100%; justify-self: stretch; }
