/* unidex tools and app library. The look of www.unidex.shop: warm paper, ink, a serif for headlines (Gloock),
   Atkinson Hyperlegible to read, and Martian Mono for labels, menus and buttons, like the device's own screen.
   The fonts are served from here (fonts/), so no page asks another site for anything. */

@font-face { font-family: "Gloock"; src: url("fonts/gloock.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
             font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("fonts/martian-mono.woff2") format("woff2"); font-weight: 100 800;
             font-stretch: 75% 112.5%; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #f4f1ea; --paper-deep: #ebe6dc; --ink: #141414; --red: #b2412b;
  /* The names every page uses */
  --bg: var(--paper); --bg-deep: var(--paper-deep); --card: #faf8f3; --fg: var(--ink); --muted: #645e55;
  --line: #d6d0c4; --line-strong: #b5ad9e; --field: #8a8274; --hover: rgba(20, 20, 20, .05);
  --accent: var(--ink); --on-accent: var(--paper); --ok: #2d6a39; --bad: #a83a25; --mark: var(--red);
  --rule: 1.5px solid var(--fg);  /* the line under the device's screen header */
  --font-display: "Gloock", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --radius: 4px; --wide: 1180px; --text: 720px; --head: 64px;
  /* One spacing scale for the whole site: every gap, margin and padding is one of these */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414; --bg-deep: #1b1a18; --card: #1d1c19; --fg: #f1ede4; --muted: #a9a297;
    --line: #34322d; --line-strong: #4d4a43; --hover: rgba(244, 241, 234, .07);
    --accent: #f1ede4; --on-accent: #141414; --ok: #82c48e; --bad: #ec8d78; --mark: #e0705a;
    --field: #7a746a;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--head) + var(--s5)); }
body { margin: 0; background: var(--bg); color: var(--fg); accent-color: var(--accent);
       font: 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
       display: flex; flex-direction: column; min-height: 100dvh; }
[hidden] { display: none !important; }  /* buttons set display, which would beat the hidden attribute */
::selection { background: var(--fg); color: var(--bg); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- type ---------- */
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: clamp(40px, 4.6vw, 60px); line-height: 1.02; margin: 0 0 var(--s4); }
h2 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; margin: 0 0 var(--s4); }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 var(--s2); font-weight: 700; }
* + h3 { margin-top: var(--s5); }
p { margin: 0 0 var(--s4); }
p.sub, .lead { color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 62ch; margin: 0 0 var(--s5); }
.muted { color: var(--muted); }
.eyebrow { font: 500 13px/1 var(--font-mono); color: var(--fg); margin: 0 0 var(--s5); padding-bottom: var(--s2);
           border-bottom: var(--rule); display: flex; justify-content: space-between; gap: var(--s3); }
.eyebrow span { color: var(--muted); font-weight: 400; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong);
    text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font: 13px/1.6 var(--font-mono); }
code { background: var(--hover); border-radius: 4px; padding: 1px 5px; }
pre { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--fg); border-radius: 0; padding: var(--s4);
      overflow-x: auto; margin: 0 0 var(--s4); }
pre code { background: none; padding: 0; }
kbd { font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
      padding: 1px 6px; color: var(--muted); background: var(--bg); }
.note { color: var(--muted); font-size: 14px; }
div.note > * { margin: 0 0 var(--s2); }  /* a note of several parts: small text, small gaps */
div.note > :last-child { margin-bottom: 0; }
.status { color: var(--muted); font-size: 14px; min-height: 1.4em; margin: var(--s2) 0 0; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
ol, ul { padding-left: var(--s5); margin: 0 0 var(--s4); }
li + li { margin-top: var(--s2); }
p + ul, p + ol { margin-top: calc(-1 * var(--s2)); }  /* a line that introduces a list sits close to it */
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

/* ---------- layout ---------- */
main { width: 100%; max-width: var(--text); margin: 0 auto; padding: var(--s7) var(--s4) var(--s8); flex: 1; }
main.wide { max-width: var(--wide); padding-left: var(--s5); padding-right: var(--s5); }
section { margin-bottom: var(--s7); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.card { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: var(--s5); }
.unsupported { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: var(--s3) var(--s4); background: var(--card);
               margin: 0 0 var(--s5); }
/* The last thing in a box adds no space of its own, so every box is as tall inside as its padding says */
.card > :first-child, section > :first-child { margin-top: 0; }
.card > :last-child, section > :last-child, .page-head > :last-child, main > :last-child, .unsupported > :last-child {
  margin-bottom: 0; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } main, main.wide { padding: var(--s6) var(--s4) var(--s7); } }

/* A page with an "On this page" list beside it on wide screens (as unidex.shop's Info page) */
.doc { display: grid; grid-template-columns: 200px minmax(0, var(--text)); gap: var(--s7); justify-content: center; }
.toc { position: sticky; top: calc(var(--head) + var(--s5)); align-self: start; font: 13px/1.5 var(--font-mono); }
.toc p { color: var(--muted); font-size: 12px; margin: 0 0 var(--s2); }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li + li { margin-top: 0; }
.toc a { display: block; padding: var(--s1) 0 var(--s1) var(--s4); text-decoration: none; color: var(--muted); border-left: 2px solid var(--line); }
.toc a:hover { color: var(--fg); }
.toc a[aria-current] { color: var(--fg); border-left-color: var(--fg); }
@media (max-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* ---------- buttons: a physical button on a 2 px ledge, as on unidex.shop ---------- */
button, .button { font: 500 13px/1.2 var(--font-mono); letter-spacing: .01em; min-height: 44px; padding: var(--s3) var(--s5);
         border-radius: 6px; border: 1.5px solid var(--fg); background: var(--accent); color: var(--on-accent);
         cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
         text-decoration: none; white-space: nowrap; box-shadow: 0 2px 0 var(--fg); transform: translateY(0);
         transition: transform .08s, box-shadow .08s, background-color .15s, opacity .15s; }
button:hover:not(:disabled), .button:hover { opacity: .9; }
button:active:not(:disabled), .button:active { transform: translateY(2px); box-shadow: 0 0 0 var(--fg); }
button:disabled { opacity: .38; cursor: not-allowed; }
button.secondary, .button.secondary { background: var(--bg); color: var(--fg); }
button.secondary:hover:not(:disabled), .button.secondary:hover { opacity: 1; background: var(--hover); }
button.quiet, .button.quiet { background: transparent; color: var(--fg); border-color: transparent; box-shadow: none; }
button.quiet:hover:not(:disabled), .button.quiet:hover { background: var(--hover); opacity: 1; }
button.danger { background: var(--bg); color: var(--bad); border-color: var(--bad); box-shadow: 0 2px 0 var(--bad); }
button.danger:active:not(:disabled) { box-shadow: 0 0 0 var(--bad); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
        stroke-linecap: round; stroke-linejoin: round; }

/* ---------- forms ---------- */
label { display: block; margin: var(--s4) 0 var(--s2); font: 500 12px/1.4 var(--font-mono); }
label .hint { font: 400 12px var(--font-body); color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 16px; padding: 10px var(--s3); border: 1.5px solid var(--field); border-radius: 6px; width: 100%;
  background: var(--bg); color: var(--fg); transition: border-color .15s, box-shadow .15s; min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--hover); }
input:disabled, textarea:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
textarea { font: 12px/1.5 var(--font-mono); resize: vertical; }
.check { display: flex; gap: var(--s3); align-items: center; font: 400 15px var(--font-body); cursor: pointer; }
.check input { margin: 0; width: 17px; height: 17px; }
input[type=checkbox], input[type=radio] { accent-color: var(--fg); }

/* Segmented choice (radio buttons as one bar), on Tools and Setup */
.seg { display: flex; border: 1.5px solid var(--fg); border-radius: 6px; overflow: hidden; }
.seg label { margin: 0; flex: 1; text-align: center; }
.seg label + label { border-left: 1.5px solid var(--fg); }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 10px var(--s1); cursor: pointer; transition: background-color .15s, color .15s; }
.seg input:not(:checked) + span:hover { background: var(--hover); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: -3px; }

/* ---------- chips, tables, details ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--s1); font: 400 12px/1.2 var(--font-mono); color: var(--muted); white-space: nowrap; }
.chip.new { color: var(--fg); font-weight: 500; }
.chip.bad { color: var(--bad); }
.chip.ok { color: var(--ok); }
.chip .icon { width: 13px; height: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 var(--s4); }
th, td { text-align: left; padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 12px var(--font-mono); color: var(--muted); border-bottom: var(--rule); }
td code { white-space: nowrap; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: var(--rule); }
summary { list-style: none; cursor: pointer; padding: var(--s4) var(--s6) var(--s4) 0; font-weight: 700; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: var(--s1); top: var(--s4); font: 400 18px/1.4 var(--font-mono); }
details[open] summary::after { content: "–"; }
summary:hover { text-decoration: underline; text-underline-offset: 4px; }
details > :not(summary) { margin: 0 0 var(--s4); }
details > :last-child:not(summary) { margin-bottom: var(--s5); }

/* ---------- header and menus (chrome.js) ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 14px;
        font: 500 13px var(--font-mono); text-decoration: none; }
.skip:focus { top: 10px; }
.site-head { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: var(--rule); }
.site-head .bar { max-width: var(--wide); margin: 0 auto; height: var(--head); padding: 0 var(--s5); display: flex;
                  align-items: center; gap: var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; font: 500 15px var(--font-mono);
         letter-spacing: -.01em; white-space: nowrap; margin-right: var(--s2); }
.brand small { font: 400 13px var(--font-mono); color: var(--muted); }
.brand .logo { height: 32px; width: 152px; display: block; }  /* 1000 x 211: one screen pixel per robot pixel */
.menus { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.menus > li { position: relative; margin: 0; }
.menus .top { font: 400 13px var(--font-mono); color: var(--fg); background: none; border: 0; box-shadow: none;
              min-height: 40px; padding: var(--s2) var(--s3); border-radius: 0; gap: var(--s1); }
.menus .top:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.menus .top[aria-expanded=true] { background: var(--fg); color: var(--bg); text-decoration: none; }
.menus .top:active { transform: none; }
.menus .top[aria-current] { font-weight: 500; }
.menus .top[aria-current]::after { content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: -11px; height: 3px; background: var(--fg); }
.menus .top .icon { width: 13px; height: 13px; }
.panel { position: absolute; top: calc(100% + var(--s2)); left: 0; min-width: 240px; background: var(--bg); border: var(--rule);
         padding: var(--s1) 0; list-style: none; margin: 0; display: none; }
.panel.open { display: block; }
.panel li + li { margin: 0; }
.panel a { display: block; padding: var(--s2) var(--s4); text-decoration: none; font: 400 14px var(--font-body); }
.panel a:hover, .panel a:focus-visible { background: var(--fg); color: var(--bg); outline: none; }
.panel a[aria-current] { font-weight: 700; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.search-btn { background: none; color: var(--fg); border: 0; box-shadow: none; font: 400 13px var(--font-mono);
              min-height: 40px; padding: var(--s2); gap: var(--s2); }
.search-btn:hover { opacity: 1 !important; text-decoration: underline; text-underline-offset: 5px; }
.search-btn:active { transform: none !important; }
.search-btn .icon { width: 16px; height: 16px; }
.button.small, button.small { min-height: 36px; padding: var(--s2) var(--s3); font-size: 12px; }
.shop-link { display: none; }
.gh-link { font: 500 13px var(--font-mono); color: var(--fg); text-decoration: underline; text-underline-offset: 5px; white-space: nowrap; }
.gh-link:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
@media (max-width: 700px) { .gh-link { display: none; } }  /* the menu drawer has it */
.menu-btn { display: none; background: none; color: var(--fg); border: 0; box-shadow: none; min-height: 44px; padding: var(--s3); }
.menu-btn:active { transform: none; }
@media (max-width: 1180px) { .brand small { display: none; } }
@media (max-width: 1000px) {
  .menus, .head-right .button { display: none; }
  .menu-btn { display: inline-flex; }
  .search-btn .label, .search-btn kbd { display: none; }
  .site-head .bar { padding: 0 var(--s2) 0 var(--s4); gap: var(--s1); }
}

/* Phones and narrow windows: the menus in a drawer */
.drawer { position: fixed; inset: 0; z-index: 70; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.drawer .sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); background: var(--bg);
                 border-left: var(--rule); overflow-y: auto; padding: var(--s2) var(--s5) var(--s6); }
.drawer .sheet-top { display: flex; justify-content: space-between; align-items: center; height: 52px; border-bottom: var(--rule); }
.drawer h2 { font: 500 12px var(--font-mono); color: var(--muted); margin: var(--s5) 0 var(--s1); }
.drawer ul { list-style: none; padding: 0; margin: 0; }
.drawer li + li { margin: 0; }
.drawer a { display: block; padding: var(--s3) 0; text-decoration: none; min-height: 44px; border-bottom: 1px solid var(--line); }
.drawer a[aria-current] { font-weight: 700; }
.drawer .actions { display: grid; gap: var(--s3); margin-top: var(--s6); }
.drawer .actions > a:not(.button) { border: 0; text-align: center; font: 400 13px var(--font-mono); }

/* ---------- search (chrome.js) ---------- */
dialog.search { width: min(620px, calc(100% - 24px)); max-height: min(540px, calc(100dvh - 80px)); margin: 12vh auto 0;
                padding: 0; border: var(--rule); border-width: 2px; border-radius: 0; background: var(--bg); color: var(--fg);
                overflow: hidden; }
dialog.search[open] { display: flex; flex-direction: column; }
dialog.search::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.search-field { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); border-bottom: var(--rule); }
.search-field input { border: 0; box-shadow: none !important; background: transparent; font-size: 18px; min-height: 56px; padding: 0; }
.search-results { list-style: none; margin: 0; padding: var(--s1) 0 var(--s2); overflow-y: auto; }
.search-results .group { font: 500 11px var(--font-mono); color: var(--muted); padding: var(--s3) var(--s4) var(--s1); margin: 0; }
.search-results li + li { margin: 0; }
.search-results [role=option] { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s3); align-items: center;
                                padding: var(--s2) var(--s4); cursor: pointer; text-decoration: none; }
.search-results [role=option] b { display: block; font-size: 15px; }
.search-results [role=option] small { color: var(--muted); font-size: 13px; display: block; }
.search-results [role=option][aria-selected=true] { background: var(--fg); color: var(--bg); }
.search-results [role=option][aria-selected=true] small, .search-results [role=option][aria-selected=true] .chip { color: var(--bg); }
.search-empty { padding: var(--s6) var(--s4); color: var(--muted); text-align: center; }
.search-foot { display: flex; gap: var(--s4); padding: var(--s2) var(--s4); border-top: 1px solid var(--line); font: 400 12px var(--font-mono);
               color: var(--muted); }

/* ---------- page header, link lists, steps ---------- */
.page-head { margin-bottom: var(--s7); }
.page-head h1 { padding-bottom: var(--s4); margin-bottom: var(--s5); border-bottom: var(--rule); }
.page-head .actions, .button-row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--s6); border-top: var(--rule); margin: 0 0 var(--s4); }
.tile { display: block; padding: var(--s4) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.tile b { display: block; font: 700 16px var(--font-body); margin-bottom: var(--s1); }
.tile span { color: var(--muted); font-size: 15px; line-height: 1.45; }
a.tile:hover b { text-decoration: underline; text-underline-offset: 4px; }
a.tile b::after { content: " →"; font-weight: 400; }
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--s4); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: var(--s6) 1fr; gap: var(--s2); margin: 0; }
.steps > li::before { content: counter(step) "."; font: 500 14px/1.7 var(--font-mono); }

/* ---------- footer (chrome.js) ---------- */
.site-foot { border-top: var(--rule); margin-top: auto; }
.foot-row { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s5) 0; display: flex; justify-content: space-between;
            align-items: center; gap: var(--s3) var(--s5); flex-wrap: wrap; }
.foot-row nav { display: flex; gap: var(--s2) var(--s5); flex-wrap: wrap; font: 400 13px var(--font-mono); }
.foot-row nav a { text-decoration: none; }
.foot-row nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-row.small { padding: var(--s4) var(--s5) var(--s6); color: var(--muted); font: 400 12px var(--font-mono); }
.foot-row.small nav { font-size: 12px; }
.foot-row.small nav a { color: var(--muted); }

/* ---------- the Apps library (store.html, app.html) ---------- */
canvas.app-icon { image-rendering: pixelated; border-radius: 2px; border: 1px solid var(--line-strong); flex: none; }
.store-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s5); flex-wrap: wrap; }
.store-head > div:first-child { flex: 1 1 520px; }
.store-head .lead { margin-bottom: 0; }
.device-strip { padding: var(--s4); margin-bottom: var(--s7); border: var(--rule); border-radius: 0; background: var(--bg); }
.device-row { display: flex; align-items: center; gap: var(--s4); }
.device-row .ic { display: grid; place-items: center; flex: none; }
.device-row .ic .icon { width: 24px; height: 24px; }
.device-text { flex: 1; min-width: 0; }
.device-text b { font: 500 13px var(--font-mono); }
.device-text .status { margin: var(--s1) 0 0; }
progress { width: 100%; height: 6px; margin-top: var(--s3); accent-color: var(--fg); }
.dev-apps { list-style: none; padding: 0; margin: var(--s4) 0 0; border-top: 1px solid var(--line); }
.dev-apps li { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--line); margin: 0; }
.dev-apps li:last-child { border-bottom: 0; }
.dev-apps .info { flex: 1; min-width: 0; }
.dev-apps .info b { display: block; }
.dev-apps .info small { color: var(--muted); font-size: 13px; }
.dev-apps .actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.dev-apps button, .app-row button { min-height: 36px; padding: var(--s2) var(--s3); font-size: 12px; }

.library { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s7); align-items: start; }
.filters { position: sticky; top: calc(var(--head) + var(--s5)); max-height: calc(100dvh - var(--head) - var(--s7)); overflow-y: auto; }
.filters details, .filters details:first-of-type { border: 0; }
.filters summary { font: 500 13px var(--font-mono); padding: 0 0 var(--s2); pointer-events: none; display: flex; gap: var(--s2); align-items: center;
                   border-bottom: var(--rule); }
.filters summary::after { display: none; }
.filters summary:hover { text-decoration: none; }
.facet { border: 0; padding: 0; margin: var(--s5) 0 0; min-width: 0; }
.facet legend { font: 500 12px var(--font-mono); color: var(--muted); padding: 0; margin-bottom: var(--s2); }
.facet .hint { font-size: 12px; color: var(--muted); margin: 0 0 var(--s2); }
.facet .check { font-size: 15px; padding: var(--s1) 0; margin: 0; }
.facet .check span { flex: 1; }
.facet .check small { font: 400 12px var(--font-mono); color: var(--muted); }
.facet:disabled .check { opacity: .45; }
#clearFilters { margin-top: var(--s4); padding-left: 0; text-decoration: underline; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding-bottom: var(--s2); border-bottom: var(--rule); }
.results-count { font: 500 13px var(--font-mono); margin: 0; }
.sort { display: flex; align-items: center; gap: var(--s2); }
.sort label { margin: 0; color: var(--muted); }
.sort select { width: auto; min-height: 36px; font-size: 14px; padding: var(--s1) var(--s2); }
.active-chips { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) 0 0; }
.active-chips:empty { display: none; }
.chip.removable { cursor: pointer; color: var(--fg); border: 1px solid var(--fg); border-radius: 3px; min-height: 30px; box-shadow: none;
                  background: var(--bg); padding: var(--s1) var(--s2); font: 400 12px var(--font-mono); }
.chip.removable:hover { background: var(--fg); color: var(--bg); opacity: 1; }
.chip.removable:active { transform: none; }
/* The list reads like the device's own Apps screen: one row per app, under a rule */
.app-list { list-style: none; margin: 0; padding: 0; }
.app-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4) 0;
           border-bottom: 1px solid var(--line); margin: 0; position: relative; }
.app-row h3 { margin: 0; font-size: 18px; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.app-row h3 a { text-decoration: none; }
.app-row h3 a::after { content: ""; position: absolute; inset: 0; }
.app-row:hover h3 a { text-decoration: underline; text-underline-offset: 4px; }
.app-row .by { font: 400 12px var(--font-mono); color: var(--muted); font-weight: 400; }
.app-row .desc { margin: var(--s1) 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 62ch; }
.app-row .tags { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.app-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2); position: relative; z-index: 1; }
.app-row .meta { font: 400 12px var(--font-mono); color: var(--muted); }
.app-row.create { grid-template-columns: 52px 1fr; border-bottom: 0; }
.app-row.create .plus { width: 52px; height: 52px; border: 1.5px dashed var(--fg); display: grid; place-items: center;
                        font: 400 26px var(--font-mono); border-radius: 2px; }
.empty { padding: var(--s6) 0; text-align: left; border-bottom: 1px solid var(--line); }
.empty h3 { margin-bottom: var(--s1); }
dialog.confirm { border: var(--rule); border-width: 2px; border-radius: 0; padding: var(--s5); width: min(420px, calc(100% - 32px));
                 background: var(--bg); color: var(--fg); }
dialog.confirm::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); }
dialog.confirm .buttons { display: flex; gap: var(--s3); justify-content: flex-end; margin-top: var(--s5); }
@media (max-width: 1000px) {
  .library { grid-template-columns: 1fr; gap: var(--s4); }
  .filters { position: static; max-height: none; overflow: visible; }
  .filters summary { pointer-events: auto; }
  .filters summary::after { display: block; content: "+"; top: 0; }
  .filters details[open] summary::after { content: "–"; }
  #facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 var(--s5); }
}
@media (max-width: 640px) {
  .store-head .actions { width: 100%; }
  .store-head .actions .button { flex: 1 1 140px; padding-left: var(--s3); padding-right: var(--s3); }
  .device-row { flex-wrap: wrap; }
  .device-row .device-text { flex: 1 1 200px; }
  .device-row #connect { width: 100%; }
  .app-row { grid-template-columns: 44px 1fr; }
  .app-row .side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .dev-apps li { flex-wrap: wrap; } .dev-apps .actions { width: 100%; justify-content: flex-start; }
}

/* ---------- an app's page (app.html) ---------- */
.crumbs { font: 400 13px var(--font-mono); color: var(--muted); margin-bottom: var(--s5); display: flex; gap: var(--s2); }
.crumbs a { color: var(--muted); }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s7); align-items: start; }
.app-main { max-width: var(--text); }
.app-main h2 { margin-top: var(--s6); font-size: 26px; }
.app-hero { display: flex; gap: var(--s5); align-items: center; margin-bottom: var(--s5); }
.app-hero h1 { margin: 0 0 var(--s2); }
.app-hero .kind { font: 400 13px var(--font-mono); color: var(--muted); margin: 0 0 var(--s2); }
.app-hero .by { margin: 0; font: 400 13px var(--font-mono); color: var(--muted); }
.app-install { padding: var(--s4); margin-bottom: var(--s5); border: var(--rule); border-radius: 0; background: var(--bg); }
.app-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.perm-list { padding-left: var(--s5); }
.app-side { position: sticky; top: calc(var(--head) + var(--s5)); display: grid; gap: var(--s4); border-top: var(--rule); padding-top: var(--s4); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: 14px; }
.facts dt { font: 400 12px var(--font-mono); color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .files { font: 400 12px var(--font-mono); }
.quiet-link { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .app-layout { grid-template-columns: 1fr; } .app-side { position: static; } .app-hero { gap: var(--s4); } }
@media (max-width: 560px) { .app-hero { flex-direction: column; align-items: flex-start; } }
