/* Bayton SysApp DB - design system
   Tokens mirror bayton.org/core.css so the service feels native. */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');

:root, [data-theme='light'] {
  --light: #c9c9c9;
  --input: #f0f0f0;
  --dark: #333333;
  --bright: #ffffff;
  --text: #333333;
  --background: #ffffff;
  --blue: #0077b37a;
  --orange: #ff4500;
  --orange-soft: #ff45001a;
  --orange-opacity: #ff45009c;
  --blood-orange: #ce3800;
  --main-red: #c30000;
  --main-blue: #0283bd;
  --main-green: #15B007;
  --subtle-bg: #f1f1f1;
  --card-bg: #ffffff;
  --card-border: #e6e6e6;
  --muted: #6a6a6a;
  --chip-bg: #ffffff;
}

[data-theme='dark'] {
  --light: #2d2d2d;
  --input: #1f1f1f;
  --dark: #292929;
  --bright: #ffffff;
  --text: #cfcfcf;
  --blood-orange: #ff6028;
  --background: #0d0d0d;
  --blue: #0077b33b;
  --orange-opacity: #ff450066;
  --subtle-bg: #1a1a1a;
  --card-bg: #161616;
  --card-border: #242424;
  --muted: #8d8d8d;
  --chip-bg: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --light: #2d2d2d;
    --input: #1f1f1f;
    --dark: #292929;
    --bright: #ffffff;
    --text: #cfcfcf;
    --blood-orange: #ff6028;
    --background: #0d0d0d;
    --blue: #0077b33b;
    --orange-opacity: #ff450066;
    --subtle-bg: #1a1a1a;
    --card-bg: #161616;
    --card-border: #242424;
    --muted: #8d8d8d;
    --chip-bg: #1a1a1a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-size: 18px;
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--background);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--blood-orange); }

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 14px;
}

h1 { font-size: clamp(28px, 5vw, 56px); font-weight: 600; }
h2 { font-size: clamp(24px, 2.6vw, 32px); }
h3 { font-size: 20px; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 90%;
  overflow-wrap: break-word;
  word-break: break-word;
}

p { margin: 0 0 14px; }

/* Form controls -------------------------------------------------------
   Adopted from KIOSK / WEB APP GENERATOR. Adapted to work in both light
   and dark via the existing token set. */

input[type='text'],
input[type='url'],
input[type='password'],
input[type='number'],
input[type='email'],
input[type='search'],
input[type='tel'],
input[type='date'],
textarea,
select {
  width: 100%;
  background: var(--subtle-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type='text']:focus,
input[type='url']:focus,
input[type='password']:focus,
input[type='number']:focus,
input[type='email']:focus,
input[type='search']:focus,
input[type='tel']:focus,
input[type='date']:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

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

/* Replace the native blue webkit search clear button with a muted X that
   tracks the theme (orange on hover, matching the rest of the design). */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  margin-left: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b8b8b' stroke-width='2' stroke-linecap='round'><line x1='4' y1='4' x2='12' y2='12'/><line x1='12' y1='4' x2='4' y2='12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
}
input[type='search']::-webkit-search-cancel-button:hover {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ff4500' stroke-width='2' stroke-linecap='round'><line x1='4' y1='4' x2='12' y2='12'/><line x1='12' y1='4' x2='4' y2='12'/></svg>");
}

/* Strip native chrome from <select> and paint our own chevron so it
   matches the surface tokens in both light and dark. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%238b8b8b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  cursor: pointer;
}
select option { background: var(--card-bg); color: var(--text); }

/* Chrome/Safari autofill paints a baked-in light-blue background that
   ignores our theme. Override with an inset shadow the size of the
   field plus a text-fill-color so text stays readable. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--subtle-bg) inset;
  box-shadow: 0 0 0 1000px var(--subtle-bg) inset;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
}


/* Layout shell -------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.brand { justify-self: start; }
.topbar-tools { justify-self: end; }

/* Hamburger only appears on mobile (the @media block shows it). Scoped to
   .topbar so it outranks the later .icon-button { display: grid } rule. */
.topbar .nav-toggle { display: none; }

/* Global header search: a popover that drops from the header search icon,
   reusing the home typeahead (results target #header-search-results). */
.header-search {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: min(460px, calc(100vw - 32px));
  z-index: 40;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  padding: 6px;
}
.header-search[hidden] { display: none; }
.header-search-box { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.header-search-box .search-icon { color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.header-search-box .search-icon svg { width: 18px; height: 18px; }
.header-search-box input[type='search'] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 4px 0;
  box-shadow: none;
}
.header-search-box input[type='search']:focus { border: 0; box-shadow: none; }
/* The results flow inside the panel rather than as a detached popup. */
.header-search .search-popup.header-results {
  position: static;
  margin-top: 4px;
  border: 0;
  border-top: 1px solid var(--card-border);
  border-radius: 0;
  box-shadow: none;
  max-height: 56vh;
}
.header-search .search-popup.header-results:empty { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand-wordmark {
  height: 28px;
  width: auto;
  display: block;
  color: var(--text);
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--card-border);
}

.brand-project {
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  justify-self: start;
}

.topbar nav a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s ease;
}

.topbar nav a:hover { background: var(--subtle-bg); }
.topbar nav a.active { background: var(--orange-soft); color: var(--blood-orange); }

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fast tooltips (positioned by app.js, appended to <body>). Body-level so
   scroll containers never clip them, and instant where native title=
   tooltips lag ~1s. */
abbr[data-tip] {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.tip-bubble {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #1f1f23;
  color: #f4f4f5;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 90ms ease, transform 90ms ease;
}
.tip-bubble.visible { opacity: 1; transform: none; }

/* Contributor attribution: a labelled, overlapping avatar stack. Avatars are
   served same-origin by /avatar (GitHub photo or a generated initials SVG). */
.contributors {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0 24px;
}
.contrib-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.avatar-stack {
  display: inline-flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.avatar-item {
  display: inline-flex;
  margin-left: -8px;
  border-radius: 50%;
  transition: transform 0.12s ease;
}
.avatar-item:first-child { margin-left: 0; }
.avatar-item:hover { transform: translateY(-2px); z-index: 1; }
.avatar-item a { display: inline-flex; line-height: 0; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--subtle-bg);
  box-shadow: 0 0 0 2px var(--card-bg);
}
.avatar-stack.mini {
  margin-top: 8px;
}
.avatar-stack.mini .avatar {
  width: 26px;
  height: 26px;
}

/* sysapp signature-provenance pills */
.pill.sig-core { background: rgba(47, 158, 70, 0.16); color: #2f9e46; }
.pill.sig-google { background: rgba(86, 130, 214, 0.16); color: #6f9ae6; }
.pill.sig-oem { background: rgba(59, 111, 182, 0.18); color: #5b8fd6; }
.pill.sig-chipset { background: var(--subtle-bg); color: var(--muted); }
.pill.sig-third-party { background: var(--orange-soft); color: var(--blood-orange); }

/* Provenance as coloured text (no pill chrome) - used in the device app list
   and the package "Seen on" table where a pill would be visual noise. */
.sig-text { font-weight: 600; font-size: 12px; }
.sig-text.sig-core { color: #2f9e46; }
.sig-text.sig-google { color: #6f9ae6; }
.sig-text.sig-oem { color: #5b8fd6; }
.sig-text.sig-chipset { color: var(--muted); }
.sig-text.sig-third-party { color: var(--blood-orange); }

/* The package identifier is primary content; give it room so long dotted
   names are not crushed into the App column's slipstream. */
#device-apps th:nth-child(2),
#device-apps td[data-label="Package"] { min-width: 240px; }
/* The App-cell name is the canonical label, which is often the package name
   itself - a long dotted string with no spaces. Default wrapping won't break
   it, so it overflows the row/card; force it to break. */
#device-apps td[data-label="App"] { overflow-wrap: anywhere; }

/* Signing cell: provenance on one line, certificate beneath, both left
   aligned - on desktop and mobile alike. inline-flex so on mobile cards it
   sits beside the "Signing" label rather than forcing it onto its own line. */
.sig-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  vertical-align: top;
}
.sig-cert { font-size: 11px; white-space: nowrap; }
/* Certificate hash with an inline copy button (the full SHA-256 is copyable;
   no popover, which a 64-char hash would overflow anyway). */
.sig-cert-row { display: inline-flex; align-items: center; gap: 5px; }
.cert-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  line-height: 0;
}
.cert-copy:hover { color: var(--orange); }
.cert-copy.copied { color: #2f9e46; }

/* Package-intelligence dashboard tiles. */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.intel-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.intel-tile.flag { border-color: var(--blood-orange); }
.intel-val {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.intel-tile.flag .intel-val { color: var(--blood-orange); font-size: 16px; }
.intel-label {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.intel-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* Derived, factual observations under the intelligence tiles. */
.intel-insights {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 18px;
  background: var(--subtle-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}
.intel-insights li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.intel-insights li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

/* Authoritative Android-doc reference link on a permission row. */
.perm-ref {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--orange);
  text-decoration: none;
}
.perm-ref:hover { text-decoration: underline; }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.icon-button:hover { background: var(--subtle-bg); }
.icon-button svg { width: 18px; height: 18px; }

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}

main.wide { max-width: 1480px; }

/* Hero ---------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  padding: 48px 0 32px;
  align-items: center;
}

.hero-main {
  display: grid;
  gap: 24px;
  justify-items: start;
  text-align: left;
}

.hero .eyebrow { color: var(--orange); }

.hero h1 {
  max-width: 17ch;
  margin: 0;
}

.hero p.lede {
  max-width: 52ch;
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}

.hero .search-shell { max-width: 560px; }
.hero .search-suggestions { justify-content: flex-start; }

/* Right-hand honesty panel: how the data is sourced + caveats. */
.hero-aside {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-aside-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.hero-facts li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-facts li strong { color: var(--text); font-weight: 650; }

.hero-aside-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
}

.hero-aside-cta:hover { text-decoration: underline; }

.eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Search box - hero ---------------------------------------------------- */

.search-shell {
  position: relative;
  width: 100%;
  max-width: 720px;
}

.search-shell form {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The pill: search icon + input + kbd hint. The submit button is a
   sibling, so it can sit beside the pill on desktop and stack below it
   on mobile without ending up trapped inside a tall rounded container. */
.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 999px;
  box-shadow: 0 18px 40px -24px rgba(0,0,0,0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--orange);
  box-shadow: 0 18px 40px -16px rgba(255,69,0,0.35);
}

.search-shell .search-icon { color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.search-shell .search-icon svg { width: 22px; height: 22px; }

.search-shell input[type='search'] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  padding: 14px 0;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
}

.search-shell input[type='search']:focus { box-shadow: none; border: 0; }

.search-shell input::placeholder { color: var(--muted); }

.search-shell .kbd {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--subtle-bg);
  color: var(--muted);
  border: 1px solid var(--card-border);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.search-shell .kbd:hover { color: var(--text); border-color: var(--orange); }

.search-box:focus-within .kbd { display: none; }

.search-submit {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 14px 26px;
  background: var(--orange);
  border: 0;
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.search-submit:hover { background: var(--blood-orange); }

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 0;
  font-size: 13px;
}

.search-suggestions .label { color: var(--muted); margin-right: 4px; align-self: center; }

.search-suggestions a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-suggestions a:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
}

/* Live results popup ------------------------------------------------- */

.search-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.35);
  max-height: 60vh;
  overflow: auto;
  z-index: 10;
}

.search-popup:empty { display: none; }

.search-popup a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--card-border);
  align-items: center;
}

.search-popup a:last-child { border-bottom: 0; }
.search-popup a:hover { background: var(--subtle-bg); }

.search-popup .result-name { font-weight: 600; }
.search-popup .result-meta { font-size: 12px; color: var(--muted); }
.search-popup .result-package {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.search-popup .result-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--blood-orange);
  font-weight: 600;
}
.search-popup .empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Stats / metric tiles ------------------------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.metric {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--orange);
  border-radius: 16px 0 0 16px;
}

.metric strong {
  display: block;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.metric span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric.compact { padding: 16px 18px; }
.metric.compact strong { font-size: clamp(22px, 2.4vw, 28px); }

/* Section headers ----------------------------------------------------- */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 48px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.section-head .head-text { display: flex; flex-direction: column; gap: 4px; }
.section-head h2 { margin: 0; }
.section-head .head-text p { margin: 0; color: var(--muted); font-size: 14px; }

.section-head a.section-link {
  text-decoration: none;
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.section-head a.section-link:hover { color: var(--blood-orange); }

/* Inline filter input (e.g. bundle detail package filter). */
.inline-filter {
  flex: 0 1 280px;
  min-width: 180px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.inline-filter::placeholder { color: var(--muted); }
.inline-filter:focus { outline: none; border-color: var(--orange); }

/* Page heads ---------------------------------------------------------- */

.page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin: 16px 0 24px;
}

.page-head h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 40px);
}

.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons ------------------------------------------------------------- */

.button, button.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.button:hover, button.button:hover { background: var(--blood-orange); }
.button:active, button.button:active { transform: translateY(1px); }

.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.button.ghost:hover { border-color: var(--orange); color: var(--orange); background: transparent; }

.button.small { padding: 6px 12px; font-size: 13px; }

.button svg { width: 16px; height: 16px; }

/* Filters bar --------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--subtle-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin-bottom: 18px;
}

.filters input[type='search'],
.filters select {
  background: var(--card-bg);
  font-size: 0.875rem;
  padding: 0.55rem 0.8rem;
}

/* Search gets its own full-width row; the selects/checks/Apply flow on the
   row beneath so the bar isn't cramped. */
.filters input[type='search'] { flex: 1 1 100%; min-width: 0; }
.filters select { flex: 0 1 170px; padding-right: 2rem; }

/* Checkboxes cluster together as one group rather than scattering across
   the bar. */
.filters-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.filters .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.filters .check input { width: auto; }

/* Apply sits at the far end of the bar. */
.filters > button { margin-left: auto; }

/* Applied filter chips ------------------------------------------------ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  align-items: center;
}

.chips .chips-label { font-size: 13px; color: var(--muted); margin-right: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  background: var(--orange-soft);
  color: var(--blood-orange);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.chip .x {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blood-orange);
  color: #fff;
}

.chip .x svg { width: 10px; height: 10px; }

.chip-clear {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--muted);
}

/* Result count + sort ------------------------------------------------- */

.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* Tables -------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

table.data tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }

/* Bundle detail renders one separate <table> per OEM group. With the
   default auto layout each table sizes its columns to its own content, so
   the Package/Notes boundary jumps around between groups. Pin the layout so
   every group's columns line up: Package gets a fixed share across all
   tables, and the cross-OEM table gives its OEMs column the extra room. */
.bundle-group table.data { table-layout: fixed; }
/* Each OEM group is its own table, so the "no border on the last row" rule
   means single-row groups show no divider while multi-row groups do -
   inconsistent down the page. Drop inter-row dividers on grouped tables
   entirely (the header underline stays) so every group looks the same. */
.bundle-group table.data tbody td { border-bottom: 0; }
.bundle-group table.data th:first-child { width: 44%; }
/* The package name is the primary content of a bundle row, so give it full
   size and weight rather than the shrunk-down .mono treatment. */
.bundle-group table.data td:first-child a {
  overflow-wrap: break-word;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.bundle-group table.cols-3 th:nth-child(2) { width: 40%; }
.bundle-group table.cols-3 th:nth-child(3) { width: 16%; }
table.data tbody tr:hover { background: var(--subtle-bg); }

table.data td a { text-decoration: none; }
table.data td a:hover { text-decoration: underline; text-decoration-color: var(--orange); }

table.data td .secondary {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--subtle-bg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.5;
}

.pill.facing { background: var(--orange-soft); color: var(--blood-orange); }

.pill.api {
  background: color-mix(in srgb, var(--main-blue) 14%, transparent);
  color: var(--main-blue);
  border: 1px solid color-mix(in srgb, var(--main-blue) 28%, transparent);
  font-variant-numeric: tabular-nums;
}

[data-theme='dark'] .pill.api {
  color: #5fb6dd;
  background: color-mix(in srgb, #5fb6dd 12%, transparent);
  border-color: color-mix(in srgb, #5fb6dd 28%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .pill.api {
    color: #5fb6dd;
    background: color-mix(in srgb, #5fb6dd 12%, transparent);
    border-color: color-mix(in srgb, #5fb6dd 28%, transparent);
  }
}

/* Card grids ---------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card-grid.tight { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(0,0,0,0.2);
}

.card .card-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
}

.card .card-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.card .card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
}

.card .card-meta .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--muted);
}

/* Grids --------------------------------------------------------------- */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Detail header (package / device) ----------------------------------- */

.detail-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 24px 26px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.detail-head::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--orange);
}

.detail-head h1 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 3.2vw, 36px);
  word-break: break-word;
}

/* The package name is the lead heading on the package page: it's the unique
   identifier people search and arrive on. Mono, prominent, copyable. */
.detail-head h1.package-id {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-all;
  color: var(--text);
}

/* Friendly display name, shown as a supporting subtitle under the package
   name when it differs from it. */
.detail-head .package-label {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Copy buttons -------------------------------------------------------- */

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover { border-color: var(--orange); color: var(--orange); }
.copy-btn svg { width: 12px; height: 12px; }
.copy-btn.copied { border-color: var(--main-green); color: var(--main-green); }
.copy-btn.copy-failed { border-color: var(--main-red); color: var(--main-red); }

/* Code block with copy ----------------------------------------------- */

/* A labelled stack of ADB commands (package "Manage on devices"). */
.cmd-list { display: flex; flex-direction: column; gap: 16px; }
.cmd-label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.code-block {
  position: relative;
  padding: 14px 50px 14px 18px;
  background: var(--subtle-bg);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  overflow-x: auto;
  border: 1px solid var(--card-border);
}

.code-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Coverage bar -------------------------------------------------------- */

.coverage-list { display: flex; flex-direction: column; gap: 10px; }

.coverage-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.coverage-row .oem-name { font-weight: 600; }

.coverage-row .bar {
  background: var(--subtle-bg);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.coverage-row .bar-fill {
  background: linear-gradient(90deg, var(--orange), var(--blood-orange));
  height: 100%;
  border-radius: 999px;
}

.coverage-row .count { text-align: right; color: var(--muted); font-size: 13px; }

/* Tabs ---------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--card-border);
}

.tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover { color: var(--text); }

.tabs a.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--subtle-bg);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tabs a.active .tab-count { background: var(--orange-soft); color: var(--blood-orange); }

/* Compare ------------------------------------------------------------- */

.compare-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  margin-bottom: 22px;
}

.compare-picker .vs {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.compare-picker .device-side { display: flex; flex-direction: column; gap: 8px; position: relative; }
/* The VS column carries an empty label-height spacer so its badge lines up
   with the input row, not the label+input block. */
.compare-picker .vs-col { align-items: center; }
.compare-picker .device-side label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* Searchable combobox (compare device pickers). The input inherits the
   shared form-control styling; this is the dropdown list of options. */
.combobox { position: relative; }
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.combobox-option {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combobox-option:hover,
.combobox-option.active { background: var(--orange-soft); color: var(--blood-orange); }
.combobox-option[hidden] { display: none; }

.compare-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.compare-summary .metric strong { font-size: clamp(24px, 2.4vw, 30px); }

/* Bulk lookup --------------------------------------------------------- */

.bulk-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  margin-bottom: 22px;
}

.bulk-form label { font-weight: 600; }
.bulk-form .hint { font-size: 13px; color: var(--muted); }

.bulk-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  min-height: 180px;
  resize: vertical;
}

.bulk-form .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Pager --------------------------------------------------------------- */

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
}

.pager a, .pager span {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  text-decoration: none;
  font-size: 14px;
  color: var(--text);
}

.pager a:hover { border-color: var(--orange); color: var(--orange); }
.pager .info { border: 0; color: var(--muted); }

/* Empty / error ------------------------------------------------------- */

.empty {
  padding: 60px 20px;
  text-align: center;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  color: var(--muted);
}

.empty svg { width: 42px; height: 42px; margin-bottom: 8px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 8px 0 6px; font-size: 18px; }

.error-banner {
  margin: 12px 0;
  padding: 12px 16px;
  border: 1px solid var(--main-red);
  background: color-mix(in srgb, var(--main-red) 8%, transparent);
  color: var(--main-red);
  border-radius: 10px;
  font-size: 14px;
}

/* Bundle membership chip: the in-table marker that a package belongs to a
   curated bundle. Labelled + clickable (jumps to the package's "Appears in"
   section) so it reads at a glance instead of relying on a native tooltip. */
.bundle-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--blood-orange);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}

.bundle-chip:hover {
  border-color: var(--orange);
  text-decoration: none;
}

.bundle-chip svg { font-size: 12px; }

/* Guidance marker: a package has curated guidance notes. Outline
   style so it reads as distinct from the filled orange bundle chip. */
.guidance-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--card-border);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
  text-decoration: none;
}

.guidance-chip:hover { color: var(--text); border-color: var(--orange); }
.guidance-chip svg { font-size: 12px; }

/* Warning block (e.g. critical-package disable guard). Amber, not red -
   it's a caution, not an error. */
.warn-block {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--orange);
  background: color-mix(in srgb, var(--orange) 9%, transparent);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.warn-block strong { color: var(--blood-orange); }

/* Curator's safe-to-disable assessment badge on the package guidance block. */
.disable-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.disable-safe {
  background: color-mix(in srgb, #2ea043 14%, transparent);
  color: #2ea043;
  border-color: color-mix(in srgb, #2ea043 45%, transparent);
}
.disable-caution {
  background: var(--orange-soft);
  color: var(--blood-orange);
  border-color: var(--orange);
}
.disable-never {
  background: color-mix(in srgb, var(--main-red) 10%, transparent);
  color: var(--main-red);
  border-color: color-mix(in srgb, var(--main-red) 45%, transparent);
}

/* Android version support-status pills (from the version reference). */
.os-status { border: 1px solid transparent; font-weight: 600; }
.os-latest { background: color-mix(in srgb, #2ea043 14%, transparent); color: #2ea043; border-color: color-mix(in srgb, #2ea043 45%, transparent); }
.os-maintained { background: var(--orange-soft); color: var(--blood-orange); border-color: color-mix(in srgb, var(--orange) 45%, transparent); }
.os-end-of-support { background: color-mix(in srgb, var(--main-red) 9%, transparent); color: var(--main-red); border-color: color-mix(in srgb, var(--main-red) 35%, transparent); }
.os-end-of-life { background: color-mix(in srgb, var(--main-red) 14%, transparent); color: var(--main-red); border-color: color-mix(in srgb, var(--main-red) 50%, transparent); }

/* Contribute callout (e.g. unknown packages on the bulk page). */
.contribute-note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.contribute-note strong { color: var(--text); display: block; margin-bottom: 4px; }
.contribute-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Footer -------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--card-border);
  padding: 32px;
  font-size: 13px;
  color: var(--muted);
  background: var(--card-bg);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
}

.footer a { text-decoration: none; }
.footer a:hover { color: var(--orange); }

.footer .sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--subtle-bg);
  font-size: 12px;
}

.footer .sync-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--main-green);
}

/* htmx indicators ----------------------------------------------------- */

.htmx-indicator { opacity: 0; transition: opacity 0.15s ease; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--card-border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
  main { padding: 24px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero .search-shell { max-width: 560px; }
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .filters input[type='search'] { flex-basis: 100%; }
  .filters select { flex: 1 1 140px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .compare-summary { grid-template-columns: repeat(2, 1fr); }
}

/* The nav collapses to a hamburger well before the table breakpoint: with
   seven links plus the search and theme buttons, the inline row runs out of
   room on narrower laptops, so trigger the tap-to-open panel at 1250px. */
@media (max-width: 1250px) {
  /* Brand + theme toggle + hamburger on the top row; the nav collapses
     into a tap-to-open panel beneath (no horizontal scrolling). */
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand tools"
      "nav   nav";
    gap: 0 10px;
    padding: 10px 16px;
  }
  .brand { grid-area: brand; }
  .topbar-tools { grid-area: tools; }
  .brand-divider, .brand-project { display: none; }
  .brand-wordmark { height: 24px; }
  .topbar .nav-toggle { display: grid; }

  .topbar nav { grid-area: nav; display: none; }
  .topbar.nav-open nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
  }
  .topbar nav a { padding: 11px 10px; font-size: 15px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  /* Tables collapse to a stacked card layout: each <tr> becomes a card,
     each <td> becomes a labelled line. data-label on the td (set per
     table where useful) renders as the inline-prefix; cells without it
     just stack. */
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td {
    display: block;
    width: 100%;
  }
  table.data tr {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  table.data tbody tr:hover { background: var(--card-bg); }
  table.data td {
    padding: 4px 0;
    border: 0;
    font-size: 14px;
  }
  table.data td:first-child {
    font-size: 15px;
    font-weight: 600;
    padding-top: 0;
  }
  table.data td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 90px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
    margin-right: 8px;
  }
  table.data td:first-child::before { display: none; }
  /* The desktop Package min-width must not force the cell wider than the card
     (it would break out of the rounded border on narrow screens). */
  #device-apps td[data-label="Package"] { min-width: 0; }
  main { padding: 18px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 24px 0 12px; }
  .hero .search-shell { max-width: none; }
  .compare-picker { grid-template-columns: 1fr; }
  .compare-picker .vs { justify-self: center; }
  .compare-picker .vs-col { align-items: stretch; }
  .compare-picker .vs-col label { display: none; }
  .filters select,
  .filters > button { flex-basis: 100%; }
  .filters > button { margin-left: 0; }
  .detail-head { grid-template-columns: 1fr; }
  /* Give the package name the full width on mobile; the copy button drops
     to its own line beneath it rather than squeezing the name. */
  .detail-head h1.package-id { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-head { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .coverage-row { grid-template-columns: 100px 1fr 50px; }
  /* Stack the search: full-width input pill on top, full-width Search
     button beneath it - not trapped inside the pill. */
  .search-shell form { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-submit { width: 100%; padding: 14px; }
  .search-shell .kbd { display: none; }
}
