/* QuireOS app store. The same paper, ink, type and spacing as the website (quireos.dev, site/) and the
   OS's design system: tones on the 0–15 scale mixed from ink and paper, Inter for the interface,
   Literata for reading, controls that invert when pressed, no colour. */

@font-face { font-family: "Quire Inter"; font-weight: 400; font-display: swap; src: url(/fonts/Inter-Regular.ttf) format("truetype"); }
@font-face { font-family: "Quire Inter"; font-weight: 600; font-display: swap; src: url(/fonts/Inter-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Quire Inter Display"; font-weight: 600; font-display: swap; src: url(/fonts/InterDisplay-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Quire Literata"; font-weight: 400; font-display: swap; src: url(/fonts/Literata-Regular.ttf) format("truetype"); }

:root {
  --ink-rgb: 28 28 26;
  --paper-rgb: 236 235 230;
  --ink: rgb(var(--ink-rgb));
  --paper: rgb(var(--paper-rgb));
  --secondary: color-mix(in srgb, var(--paper) 33%, var(--ink));
  --tertiary: color-mix(in srgb, var(--paper) 60%, var(--ink));
  --outline: color-mix(in srgb, var(--paper) 53%, var(--ink));
  --hairline: color-mix(in srgb, var(--paper) 67%, var(--ink));
  --fill-subtle: color-mix(in srgb, var(--paper) 87%, var(--ink));
  --sans: "Quire Inter", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Quire Inter Display", "Quire Inter", Inter, system-ui, sans-serif;
  --serif: "Quire Literata", Literata, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page: 32px;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink-rgb: 232 231 226; --paper-rgb: 25 25 24; color-scheme: dark; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-feature-settings: "cv05";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration-color: var(--outline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--fill-subtle); border-radius: 4px; padding: 0.05em 0.3em; }
.pre { white-space: pre-wrap; }
.muted { color: var(--secondary); }
.small { font-size: 14px; }
.mdi { width: 22px; height: 22px; fill: currentColor; flex: none; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: var(--page); padding-right: var(--page); }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 16px; }

/* ------------------------------------------------------------------------------ header --- */
.top { border-bottom: 1px solid var(--outline); }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand .mark { width: 36px; height: 36px; }
.brand-name { font: 600 26px/1 var(--display); letter-spacing: -0.03em; }
.brand-name span { color: var(--secondary); }
/* The links shared with the website (site/README.md): the same words, order, icons and look as its
   status bar. Labels fold to icons on narrow screens, as there. */
.global, .account { display: flex; align-items: center; gap: 2px; }
.global a, .account a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; border-radius: 8px;
  text-decoration: none; font-size: 14px; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.global a:hover, .account a:hover { background: var(--fill-subtle); }
.global a:active, .account a:active, .global a.here { background: var(--ink); color: var(--paper); }
.global .mdi { width: 18px; height: 18px; }
.account { padding-left: 12px; border-left: 1px solid var(--hairline); }
.account .pill { border: 1px solid var(--ink); font-weight: 600; }
.account .quiet { color: var(--secondary); }
@media (max-width: 860px) {
  .global span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .global a { padding: 0 8px; }
}

main { flex: 1; padding-top: 24px; padding-bottom: 64px; }

/* -------------------------------------------------------------------------- typography --- */
h1 { font: 600 40px/1.1 var(--sans); letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font: 600 20px/1.3 var(--sans); margin: 40px 0 12px; }
h1 + section > h2:first-child, section:first-child > h2:first-child { margin-top: 24px; }
.lede { font: 400 21px/1.45 var(--serif); margin: 0 0 16px; }
.reading { font: 400 18px/1.65 var(--serif); max-width: 62ch; }
.reading p { margin: 0 0 16px; }
.meta { color: var(--secondary); font-size: 14px; margin: 0; }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ the store bar and search --- */
/* One slim row: the page's name and the search box, so the apps start near the top. */
.store-bar { display: flex; align-items: center; gap: 24px; margin: 0 0 20px; }
.store-bar h1 { font: 600 32px/1 var(--display); letter-spacing: -0.02em; margin: 0; white-space: nowrap; }
.search {
  flex: 1; max-width: 560px; margin-left: auto;
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--outline); border-radius: 12px; background: var(--paper);
  padding-left: 12px;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.search > .mdi { color: var(--secondary); }
.search input[type="search"] {
  flex: 1; min-width: 0; border: 0; box-shadow: none; background: transparent;
  height: 46px; padding: 0 10px; font-size: 16px;
}
.search input[type="search"]:focus { box-shadow: none; }
.search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.search button { min-height: 40px; margin: 3px; padding: 0 16px; border-radius: 9px; font-size: 15px; }

/* The first-visit note: one line, closable, and gone for a year once closed. */
.intro {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 24px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--outline); border-radius: 12px;
}
.intro p { margin: 0; flex: 1; font-size: 15px; }
.intro form { margin: 0; }
.intro .close {
  min-height: 40px; width: 40px; padding: 0; justify-content: center;
  background: transparent; color: var(--ink); border-color: transparent;
}
.intro .close:hover { background: var(--fill-subtle); }
.intro .close:active { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------------- filters, results --- */
.browse { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.filters { position: sticky; top: 16px; display: grid; gap: 24px; }
.group h2 { margin: 0 0 6px; font: 600 13px/1.3 var(--sans); color: var(--secondary); letter-spacing: 0.02em; }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 40px; padding: 0 10px; margin: 0 -10px; border-radius: 8px;
  text-decoration: none; font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
a.opt:hover { background: var(--fill-subtle); }
a.opt:active, a.opt[aria-current] { background: var(--ink); color: var(--paper); font-weight: 600; }
.opt .n { color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 400; }
a.opt[aria-current] .n, a.opt:active .n { color: inherit; }
.opt.off { color: var(--tertiary); }
.opt.off .n { color: inherit; }

.results-head { margin: 0 0 8px; }
.results-head h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 22px; }
.results-head .count { color: var(--secondary); font-weight: 400; font-size: 15px; font-variant-numeric: tabular-nums; }
.active { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.active .chip .mdi { width: 16px; height: 16px; margin-left: 4px; }
.active .clear { font-size: 14px; color: var(--secondary); padding: 0 6px; }
.tag {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 0 7px; height: 20px;
  border: 1px solid var(--outline); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink);
}
.card:active .tag { border-color: currentColor; color: inherit; }
.pages { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 24px; }
.pages .where { color: var(--secondary); font-size: 15px; font-variant-numeric: tabular-nums; }
.pages a[rel="next"] { justify-self: end; }
.share { margin-top: 40px; color: var(--secondary); font-size: 15px; }
.empty-title { font-weight: 600; font-size: 17px; color: var(--ink); }

/* ------------------------------------------------------------------------------ buttons --- */
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
button, .btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: 10px;
  background: var(--ink); color: var(--paper);
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:active, .btn:active { background: var(--paper); color: var(--ink); }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); }
button.secondary:active, .btn.secondary:active { background: var(--ink); color: var(--paper); }
button.danger { background: transparent; color: var(--ink); border-style: dashed; }
button.danger:active { background: var(--ink); color: var(--paper); }
button[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .mdi, button .mdi { width: 18px; height: 18px; }

/* -------------------------------------------------------------------------------- chips --- */
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--outline); border-radius: 999px; text-decoration: none; font-size: 14px;
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.chip:active { background: var(--ink); color: var(--paper); }


/* ------------------------------------------------------------------- app tiles and cards --- */
.tile {
  flex: none; display: grid; place-items: center; overflow: hidden;
  width: 72px; height: 72px; border-radius: 18px;
  border: 1px solid var(--outline); background: var(--paper);
}
.tile .mdi { width: 36px; height: 36px; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .initial { font: 600 28px/1 var(--display); color: var(--secondary); }
.tile-lg { width: 112px; height: 112px; border-radius: 26px; }
.tile-lg .mdi { width: 56px; height: 56px; }
.tile-lg .initial { font-size: 44px; }

ul.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 32px;
}
ul.cards > li { border-bottom: 1px solid var(--hairline); padding: 6px 0; }
.card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 10px 8px; margin: 0 -8px; border-radius: 12px;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.card:hover { background: var(--fill-subtle); }
.card:active { background: var(--ink); color: var(--paper); }
.card:active .meta, .card:active .card-tagline { color: inherit; }
.card:active .tile { border-color: var(--paper); }
.card-body { display: grid; gap: 2px; min-width: 0; }
.card-name { font-weight: 600; font-size: 17px; }
.card-tagline { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chev { width: 22px; height: 22px; fill: var(--tertiary); }

.empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--outline); border-radius: var(--radius); }
.empty .mdi { width: 48px; height: 48px; }
.empty p { margin: 8px 0 0; }

/* -------------------------------------------------------------------------- an app page --- */
.crumbs { margin: 0 0 20px; }
.crumbs a { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; color: var(--secondary); font-size: 15px; }
.crumbs .mdi { width: 20px; height: 20px; }
.app-head { display: flex; gap: 28px; align-items: flex-start; padding-bottom: 32px; border-bottom: 1px solid var(--hairline); }
.app-title h1 { margin-bottom: 6px; }
.app-title .lede { margin-bottom: 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border: 1px solid var(--outline); border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.app-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.install { margin-top: 32px; padding: 20px 24px; border: 1px solid var(--outline); border-radius: var(--radius); position: sticky; top: 24px; }
.install h2 { margin-top: 0; }
.steps { margin: 0 0 16px; padding-left: 1.3em; }
.steps li { margin: 0 0 6px; }
.copy-block p { margin: 0 0 8px; font-size: 14px; }
.shot-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.shot-row img { height: 360px; width: auto; border: 1px solid var(--outline); border-radius: 8px; background: #fff; }
.report { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--hairline); }
details summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--secondary); font-size: 15px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary .mdi { width: 18px; height: 18px; }
.report form { display: flex; flex-direction: column; gap: 12px; max-width: 30rem; margin-top: 16px; }
.report form button { align-self: flex-start; }

.badge.link { text-decoration: none; }
.badge.link:hover { background: var(--fill-subtle); }
.badge.link:active { background: var(--ink); color: var(--paper); }
/* What to know before installing: a definition list read as rows. */
.facts { margin: 0; border-top: 1px solid var(--hairline); }
.facts > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.facts dt { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 15px; }
.facts dt .mdi { width: 20px; height: 20px; margin-top: 1px; }
.facts dd { margin: 0; }
.copy-block label { display: block; margin: 0 0 8px; font-size: 14px; }

/* A page that only says one thing (sharing not open yet). */
.notice-page { max-width: 36rem; margin: 48px auto; text-align: center; }
.notice-page .big { width: 56px; height: 56px; }
.notice-page .buttons { justify-content: center; }

/* ------------------------------------------------------------------------------- tables --- */
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--secondary); font-weight: 600; font-size: 13px; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--outline); }
td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
td a { font-weight: 600; }

/* -------------------------------------------------------------------------------- forms --- */
form.stack { display: flex; flex-direction: column; gap: 18px; max-width: 40rem; }
form.stack.narrow { max-width: 22rem; }
form.stack > button { align-self: flex-start; }
form.stack label, .report label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
label.inline { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.help { color: var(--secondary); font-size: 14px; font-weight: 400; }
input[type="text"], input:not([type]), input[type="url"], input[type="file"], select, textarea {
  font: 400 16px/1.4 var(--sans); color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--outline); border-radius: 10px;
  background: var(--paper); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); width: 18px; height: 18px; }
input.copy { font: 400 13px/1.4 var(--mono); background: var(--fill-subtle); border-color: var(--hairline); }
input.code { font: 600 28px/1 var(--mono); letter-spacing: 0.3em; text-transform: uppercase; text-align: center; padding: 16px; }
fieldset { border: 1px solid var(--outline); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 600; font-size: 15px; padding: 0 4px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 4px 8px 4px 0; flex-wrap: wrap; }
.inline-form input { width: auto; }
section.danger { margin-top: 48px; padding: 20px 24px; border: 1px dashed var(--outline); border-radius: var(--radius); }
section.danger h2 { margin-top: 0; }
section.danger label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

/* ------------------------------------------------------------------------------ notices --- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin: 0 0 24px; border: 1px solid var(--outline); }
.notice.err { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.notice .mdi { margin-top: 1px; }

/* ------------------------------------------------------------------------------- footer --- */
.foot { border-top: 1px solid var(--outline); padding: 40px 0 32px; }
.foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; max-width: 32rem; }
.foot-brand .mark { width: 32px; height: 32px; flex: none; }
.foot-brand p { margin: 0; color: var(--secondary); }
.foot-brand strong { color: var(--ink); }
.foot-links { display: grid; grid-template-columns: repeat(2, auto); grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 8px 40px; align-content: start; }
.foot-links a { text-decoration: none; font-size: 15px; }
.foot-links a:hover { text-decoration: underline; }
.fine { margin-top: 32px; color: var(--secondary); font-size: 13px; }

/* ----------------------------------------------------------------------- small screens --- */
@media (max-width: 860px) {
  /* Filters become rows of chips above the results, each row scrolling sideways on its own. */
  .browse { grid-template-columns: 1fr; gap: 16px; }
  .filters { position: static; gap: 10px; }
  .group { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .group h2 { margin: 0; flex: none; width: 72px; }
  .opts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
  .opts::-webkit-scrollbar { display: none; }
  .opt { margin: 0; white-space: nowrap; border: 1px solid var(--outline); border-radius: 999px; padding: 0 12px; min-height: 36px; }
  a.opt[aria-current] { border-color: var(--ink); }
  .opt .n { margin-left: 2px; }
  .opt.off { display: none; }
  .app-body { grid-template-columns: 1fr; gap: 0; }
  .install { position: static; order: -1; }
  .app-main { order: 1; }
}
@media (max-width: 640px) {
  :root { --page: 18px; }
  .top-row { min-height: 60px; gap: 8px; }
  .brand { gap: 8px; }
  .brand .mark { width: 30px; height: 30px; }
  .brand-name { font-size: 22px; }
  .account { padding-left: 6px; }
  .account a { padding: 0 8px; }
  main { padding-top: 16px; }
  h1 { font-size: 32px; }
  .store-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .store-bar h1 { font-size: 28px; }
  .search { max-width: none; margin: 0; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .lede { font-size: 19px; }
  ul.cards { grid-template-columns: 1fr; }
  .app-head { gap: 18px; }
  .tile-lg { width: 80px; height: 80px; border-radius: 20px; }
  .tile-lg .mdi { width: 40px; height: 40px; }
  .shot-row img { height: 260px; }
  table { font-size: 14px; }
}
