/* apps.merq.org – light blue, Material-inspired store design. No external fonts, no CDN. */
:root {
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --on-primary: #fff;
  --primary-container: #d3e3fd;
  --on-primary-container: #041e49;
  --bg: #f8fafd;
  --surface: #fff;
  --surface-2: #f0f4f9;
  --text: #1f1f1f;
  --muted: #5e6368;
  --outline: #dde3ea;
  --ok: #146c2e;
  --ok-bg: #e6f4ea;
  --warn-bg: #fef7e0;
  --warn: #7a5900;
  --error: #b3261e;
  --error-bg: #fce8e6;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(60, 64, 67, .12), 0 1px 3px 1px rgba(60, 64, 67, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --max: 1200px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 600; }
h2 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -.25em; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--outline); }
.topbar__inner { max-width: var(--max); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 36px; height: 36px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 700; font-size: 1.05rem; }
.brand__tag { font-size: .72rem; color: var(--muted); }
.search { position: relative; flex: 1; max-width: 560px; display: flex; gap: 8px; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding: 10px 16px 10px 44px; min-height: 44px; }
.search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.search--page { max-width: 640px; margin: 0 0 24px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: 6px; color: var(--text); padding: 8px 12px; border-radius: 999px; font-size: .92rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav .ic { color: var(--primary); }
@media (max-width: 900px) {
  .topbar__inner { flex-wrap: wrap; gap: 8px 12px; }
  .brand__tag { display: none; }
  .nav { margin-left: auto; }
  .nav span { display: none; }
  .nav a { padding: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
}

main.container { padding-top: 16px; padding-bottom: 48px; min-height: 60vh; }

/* ---- hero / heads ---- */
.hero { padding: 16px 0 8px; }
.hero h1 { margin-bottom: .25em; }
.hero__sub { color: var(--muted); margin: 0; }
.page-head { margin: 8px 0 16px; }
.page-head__intro { max-width: 70ch; color: var(--muted); }
.page-head--dev { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-container); color: var(--on-primary-container); font-size: 1.6rem; font-weight: 700; flex: none; }

/* ---- breadcrumbs ---- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 4px 0 12px; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }

/* ---- chips ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border: 1px solid var(--outline); border-radius: 8px; color: var(--text); font-size: .9rem; background: var(--surface); }
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.is-active { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); font-weight: 600; }

/* ---- slider ---- */
.slider { position: relative; margin: 8px 0 24px; }
.slider__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: var(--radius); }
.slider__track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 1; background: var(--surface-2); }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide__caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 20px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; display: flex; flex-direction: column; }
.slide__caption strong { font-size: 1.25rem; }
.slider__btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.slider__btn--prev { left: 12px; }
.slider__btn--next { right: 12px; }
@media (max-width: 600px) { .slide { aspect-ratio: 2 / 1; } .slider__btn { display: none; } }

/* ---- sections + rails ---- */
.section { margin: 24px 0; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section__head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.section__head h2 .ic { color: var(--primary); }
.section__more { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.rail { position: relative; }
.rail__track { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 12px; scrollbar-width: thin; scroll-behavior: smooth; }
.rail__btn { position: absolute; top: 40px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.rail__btn--prev { left: -8px; }
.rail__btn--next { right: -8px; }
@media (hover: none) { .rail__btn { display: none !important; } }
.card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; color: var(--text); padding: 8px; border-radius: var(--radius); }
.card:hover { background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.card__icon { width: 96px; height: 96px; border-radius: 22%; object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 1px var(--outline); }
.card__name { font-size: .9rem; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.card__meta { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- list (categories, search, developer) ---- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item + .item { border-top: 1px solid var(--outline); }
.item__link { display: flex; align-items: center; gap: 16px; padding: 14px 16px; color: var(--text); }
.item__link:hover { background: var(--surface-2); text-decoration: none; }
.item__icon { width: 64px; height: 64px; border-radius: 22%; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 0 0 1px var(--outline); }
.item__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { font-size: .82rem; color: var(--muted); }
.item__desc { font-size: .9rem; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__chev { color: var(--muted); }
.dev-info { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-top: 24px; }
.dev-info > .panel:only-child { grid-column: 1 / -1; max-width: 420px; }
@media (max-width: 900px) { .dev-info { grid-template-columns: minmax(0, 1fr); } }
.ugc-note { color: var(--muted); font-size: .82rem; margin: 8px 0 0; max-width: 80ch; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }

/* ---- category grid ---- */
.cat-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cat-card { display: flex; gap: 16px; padding: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); height: 100%; }
.cat-card:hover { text-decoration: none; outline: 2px solid var(--primary-container); }
.cat-card__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; flex: none; }
.cat-card__icon .ic { width: 26px; height: 26px; }
.cat-card__body { display: flex; flex-direction: column; gap: 2px; }
.cat-card__desc { font-size: .88rem; color: var(--muted); }

/* ---- pager ---- */
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.pager__nums { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; flex-wrap: wrap; }
.pager a, .pager .is-current, .pager__gap { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; border-radius: 999px; }
.pager a { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.pager a:hover { background: var(--primary-container); text-decoration: none; }
.pager .is-current { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.pager__gap { color: var(--muted); }

/* ---- panels, buttons, notices ---- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.panel > h2:first-child { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; border: 0; border-radius: 999px; padding: 10px 20px; min-height: 44px; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn--tonal:hover { filter: brightness(.96); }
.btn--text { background: none; color: var(--primary); padding: 8px 12px; }
.btn--big { padding: 12px 32px; font-size: 1.05rem; min-width: 200px; }
.btn--small { min-height: 32px; padding: 4px 12px; font-size: .85rem; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-s); background: var(--surface-2); margin: 0 0 16px; font-size: .92rem; }
.notice > .ic { margin-top: 2px; color: var(--primary); }
.notice p { margin: 0; }
.notice--ugc { background: var(--warn-bg); color: var(--text); border-left: 4px solid #f9ab00; }
.notice--ugc > .ic { color: #b06000; }
.notice--ok { background: var(--ok-bg); }
.notice--ok > .ic { color: var(--ok); }
.notice--error { background: var(--error-bg); color: var(--error); }
.notice--error > .ic { color: var(--error); }
.notice--inline { display: flex; margin-top: 12px; }

/* ---- app detail ---- */
.app__banner { margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 1; background: var(--surface-2); }
.app__banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px 24px; align-items: center; margin: 8px 0 20px; }
.app-hero__icon { width: 128px; height: 128px; border-radius: 22%; object-fit: cover; box-shadow: var(--shadow), 0 0 0 1px var(--outline); background: var(--surface); }
.app-hero__title { margin: 0 0 4px; word-break: break-word; }
.app-hero__dev { margin: 0 0 10px; font-weight: 500; }
.app-hero__dev a { font-weight: 600; }
.app-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; color: var(--muted); font-size: .9rem; }
.app-stats li, .app-stats a { display: inline-flex; align-items: center; gap: 6px; }
.app-stats a { color: var(--muted); }
.app-hero__actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.app-hero__free { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) {
  .app-hero { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .app-hero__icon { width: 88px; height: 88px; }
  .app-hero__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .app-hero__actions .btn--big { flex: 1; min-width: 0; padding: 12px 16px; }
  .app-hero__free { flex-basis: 100%; }
}
.app__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .app__layout { grid-template-columns: minmax(0, 1fr); } }
.app__main, .app__side, .app-hero__info { min-width: 0; }
.shot { margin: 0; display: flex; justify-content: center; background: var(--surface-2); border-radius: var(--radius-s); padding: 12px; }
.shot img { max-height: 520px; width: auto; max-width: 100%; min-width: 0; object-fit: contain; border-radius: 8px; }
.desc { overflow-wrap: anywhere; }
.mock { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 0; }
.mock svg { width: 150px; height: auto; max-width: 60%; filter: drop-shadow(0 2px 6px rgba(60, 64, 67, .12)); }
.mock figcaption { text-align: center; }
.app-info p { margin: 0 0 .8em; }
.app-info p:last-child { margin-bottom: 0; }
.app-info--sep { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--outline); }
.app-info h3 { font-size: 1rem; margin-bottom: .5em; }
.desc.is-clamped { max-height: 14em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.steps { padding-left: 1.3em; margin: 0 0 .75em; }
.steps li { margin-bottom: .35em; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .ic { width: 1em; height: 1em; margin-left: 4px; }
.reveal__result { margin: 8px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.reveal__captcha { margin-top: 8px; }
.imprint__text { font-size: .9rem; overflow-wrap: anywhere; }
.report { display: inline-flex; align-items: center; gap: 8px; color: var(--error); font-weight: 500; }

/* ---- news / prose ---- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.news-list { display: grid; gap: 12px; }
.news-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.news-card h2, .news-card h3 { font-size: 1.1rem; margin-bottom: .25em; }
.news-card p:last-child { margin: 0; }
.article { max-width: 820px; }
.article__image { border-radius: var(--radius-s); margin-bottom: 16px; }
.prose { overflow-wrap: anywhere; }
.prose img { border-radius: 8px; height: auto; }
.prose h2 { margin-top: 1.4em; }
.prose blockquote { margin: 1em 0; padding: .5em 1em; border-left: 4px solid var(--primary-container); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--outline); padding: 6px 8px; }

/* ---- publish ---- */
.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cta { display: flex; flex-direction: column; margin: 0; }
.cta .btn { margin-top: auto; align-self: flex-start; }
.cta__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; margin-bottom: 12px; }
.cta__icon .ic { width: 30px; height: 30px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; }
.checks li { padding-left: 1.6em; position: relative; margin-bottom: .3em; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.faq details { border-top: 1px solid var(--outline); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.seo-text { margin-top: 32px; }
.seo-text p { max-width: 80ch; }

/* ---- forms ---- */
.form { max-width: 760px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field label { font-weight: 500; font-size: .92rem; }
.field input, .field select, .field textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-s); padding: 10px 12px; min-height: 44px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-container); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field__error { color: var(--error); font-size: .85rem; margin: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- error page ---- */
.error-page { text-align: center; padding: 48px 20px; }
.error-page__code { font-size: 4rem; font-weight: 700; color: var(--primary); margin: 0; line-height: 1; }
.error-page .search { margin: 24px auto; }

/* ---- footer ---- */
.footer { background: var(--surface); border-top: 1px solid var(--outline); font-size: .9rem; color: var(--muted); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-top: 32px; padding-bottom: 24px; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__about { grid-column: 1 / -1; } }
.footer h2 { font-size: .95rem; color: var(--text); margin-bottom: .6em; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .35em; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1rem; }
.footer__ugc { display: flex; gap: 6px; align-items: flex-start; }
.footer__ugc .ic { color: var(--primary); margin-top: 2px; }
.footer__bottom { border-top: 1px solid var(--outline); padding-top: 16px; padding-bottom: 24px; }
.footer__bottom p { margin: 0; }
.lang { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.lang .ic { color: var(--primary); }
.lang select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--outline); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.js .js-hide { display: none; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #303030; color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 200; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  .topbar, .footer, .chips, .rail, .app-hero__actions, #commento { display: none !important; }
}
