:root {
  --bg: #fafafa;
  --card: #fff;
  --text: #16181d;
  --muted: #646a73;
  --line: #e4e6ea;
  --accent: #6a59e0;
  --accent-soft: #f1eefd;
  --accent-strong: #6a59e0;
  --radius: 14px;
  color-scheme: light dark;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317;
    --card: #1a1d22;
    --text: #ebedf0;
    --muted: #979ca5;
    --line: #2b2f36;
    --accent: #9d8ff6;
    --accent-soft: #262140;
    --accent-strong: #6a59e0; }
}
:root[data-theme="dark"] {
    --bg: #111317;
    --card: #1a1d22;
    --text: #ebedf0;
    --muted: #979ca5;
    --line: #2b2f36;
    --accent: #9d8ff6;
    --accent-soft: #262140;
    --accent-strong: #6a59e0; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); padding-bottom: 12rem; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }

.top { padding: 3rem 0 1.5rem; }
.top h1 { margin: 0; font-size: 2.2rem; letter-spacing: -0.02em; }
.lede { max-width: 40rem; font-size: 1.1rem; margin: 0.5rem 0 1.5rem; }
.tools { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
#search {
  flex: 1 1 18rem; max-width: 26rem; padding: 0.6rem 0.9rem; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}

section.cat { margin: 2rem 0; }
section.cat h2 { font-size: 1.15rem; margin: 0; }
section.cat > p { margin: 0.1rem 0 0.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.6rem; }

.app {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; position: relative;
}
.app:hover { border-color: color-mix(in oklab, var(--accent), var(--line) 60%); }
.app.selected { border-color: var(--accent); background: var(--accent-soft); }
.app:focus-visible, .check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 40px; height: 40px; flex: none; border-radius: 22%; position: relative; }
.icon-clip {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: var(--tint, var(--line));
  display: grid; place-items: center; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.icon-clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; background: var(--card); }
.icon.has-img .icon-clip img { opacity: 1; }
.icon-badge {
  position: absolute; right: -5px; bottom: -5px; width: 46%; height: 46%; object-fit: cover; background: #fff;
  border: 2px solid var(--card); border-radius: 32%; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
.icon.has-img .icon-letter { visibility: hidden; }
.app-body { min-width: 0; flex: 1; }
.app-name { font-weight: 600; display: flex; gap: 0.4rem; align-items: baseline; }
.app-name .ver { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.app-desc { font-size: 0.85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 0.3rem; margin-top: 0.3rem; flex-wrap: wrap; }
.tag { font-size: 0.7rem; padding: 0.05rem 0.4rem; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.check {
  width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; color: #fff; font-size: 0.75rem; padding: 0; background: none;
}
.app.selected .check { background: var(--accent-strong); border-color: var(--accent-strong); }
.app.selected .check::after { content: "✓"; }

dialog {
  width: min(64rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.75rem; border: 1px solid var(--line);
  border-radius: 18px; background: var(--card); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 0.3);
}
dialog::backdrop { background: rgb(0 0 0 / 0.45); backdrop-filter: blur(2px); }
.modal-close {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem; padding: 0;
  border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted);
}
.modal-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; font-size: 1.4rem; }
.modal-head p { margin: 0; }
.icon-lg { width: 72px; height: 72px; font-size: 1.8rem; }
.modal-desc { margin: 0 0 1rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0 0 1.25rem; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.modal-links { display: flex; gap: 1rem; }

.bar {
  position: fixed; inset: auto 0 0 0; background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.08); padding: 0.9rem 0;
}
.bar-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem 1rem; align-items: center; }
.bar-info { order: 3; }
.bar-inner .hint { order: 4; }
.bar-info { display: flex; gap: 0.9rem; align-items: flex-end; white-space: nowrap; }
.command {
  font: 0.85rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0.55rem 0.75rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  overflow-x: auto; white-space: nowrap;
}
.bar-actions { display: flex; gap: 0.5rem; }
.hint { grid-column: 1 / -1; margin: 0; font-size: 0.8rem; }
button {
  font: inherit; padding: 0.5rem 0.9rem; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
@media (max-width: 760px) {
  .bar-inner { grid-template-columns: 1fr; }
}
.foot { padding: 2rem 1.25rem; font-size: 0.85rem; }


.tag-paid { color: #b45309; border-color: color-mix(in oklab, #f59e0b, var(--line) 50%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-paid { color: #fbbf24; }
}
:root[data-theme="dark"] .tag-paid { color: #fbbf24; }
@media (prefers-reduced-motion: reduce) { .track, .track::after { transition: none; } }

.shots { display: flex; gap: 0.5rem; overflow-x: auto; margin: 0 0 1rem; scroll-snap-type: x proximity; padding-bottom: 0.25rem; }
.shots img {
  height: 180px; width: auto; max-width: 85%; flex: none; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); cursor: zoom-in; scroll-snap-align: start; object-fit: contain;
}
.brew { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 1.25rem; font-size: 0.85rem; }
.brew code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 0.4rem 0.6rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
p.brew { display: block; }




.family { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.family-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.family-head h3 { margin: 0; font-size: 1.05rem; }
.family-head p { margin: 0.1rem 0 0; font-size: 0.85rem; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem; }
.member {
  display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); cursor: pointer;
}
.member:hover { border-color: color-mix(in oklab, var(--accent), var(--line) 60%); }
.member.current { border-color: var(--accent); background: var(--accent-soft); }
.member:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-sm2 { width: 36px; height: 36px; font-size: 1rem; border-radius: 22%; }
.member-body { min-width: 0; flex: 1; }
.member-name { font-weight: 600; font-size: 0.9rem; }
.member-desc { font-size: 0.78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
button.mini { padding: 0.25rem 0.6rem; font-size: 0.8rem; border-radius: 8px; flex: none; }
button.mini.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.icon-md { width: 44px; height: 44px; font-size: 1.1rem; }
.icon-sm { width: 30px; height: 30px; font-size: 0.8rem; }






.tag-rec {
  color: #92400e; background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #f59e0b; font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-rec { color: #fde68a; background: linear-gradient(135deg, #78350f, #92400e); border-color: #b45309; }
}
:root[data-theme="dark"] .tag-rec { color: #fde68a; background: linear-gradient(135deg, #78350f, #92400e); border-color: #b45309; }
.rec-line { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 0.8rem; font-size: 0.85rem; }

section.pack {
  padding: 1rem 1rem 1.1rem; border: 1px solid color-mix(in oklab, #f59e0b, var(--line) 55%); border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in oklab, #fbbf24, var(--card) 90%), var(--card));
}
.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.pack-head h2 { font-size: 1.25rem; }
.pack-head p { margin: 0.1rem 0 0; }

.lightbox {
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0;
  background: rgb(0 0 0 / 0.92); color: #fff; display: none; place-items: center; overflow: hidden;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.92); }
.lightbox img { max-width: min(92vw, 1600px); max-height: 88vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 50px rgb(0 0 0 / 0.6); }
.lb-btn {
  position: absolute; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.12); color: #fff; font-size: 2rem; line-height: 1; display: grid; place-items: center;
  backdrop-filter: blur(6px); transition: background 0.15s;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.28); }
.lb-btn[hidden] { display: none; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); font-size: 0.85rem; padding: 0.2rem 0.7rem; border-radius: 999px; background: rgb(255 255 255 / 0.14); }
@media (max-width: 600px) { .lb-prev { left: 0.4rem; } .lb-next { right: 0.4rem; } .lb-btn { width: 40px; height: 40px; } }

.drawer {
  /* a popover anchored above the folder: same right edge as the bar's content */
  position: fixed; right: max(1.25rem, calc((100vw - 1120px) / 2 + 1.25rem)); bottom: calc(var(--bar-h, 7rem) + 14px); z-index: 20;
  width: min(23rem, calc(100vw - 2rem)); max-height: min(68vh, calc(100vh - var(--bar-h, 7rem) - 2.5rem));
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.22); transform-origin: calc(100% - 113px) 100%; animation: pop-up 0.2s ease-out;
}
.drawer::after {
  content: ""; position: absolute; bottom: -8px; right: 105px; width: 16px; height: 16px; transform: rotate(45deg);
  background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.drawer-head strong { flex: 1; }
.drawer-close { width: 30px; height: 30px; padding: 0; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.drawer-close:hover { color: var(--text); }
.drawer-list { flex: 1; overflow-y: auto; padding: 0.25rem 0.6rem 1rem; }
.drawer-cat { margin: 0.9rem 0.4rem 0.25rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.4rem; border-radius: 10px; }
.row:hover { background: var(--accent-soft); }
.row-name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name:hover { color: var(--accent); }
.row-ver { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-x {
  width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted);
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
}
.row-x:hover { background: #ef4444; color: #fff; }
@keyframes pop-up { from { transform: translateY(12px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
@media (max-width: 760px) { .drawer { right: 1rem; } .drawer::after { right: 60px; } }

.modal-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.modal-grid.no-media { grid-template-columns: 1fr; }
.modal-media { min-width: 0; position: sticky; top: 0; }
.modal-media .shots { margin: 0; }
.modal-media .shots img { height: 340px; max-width: 100%; }
.modal-info { min-width: 0; }
.modal-info .facts { margin-bottom: 1rem; }
@media (max-width: 820px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-media { position: static; }
  .modal-media .shots img { height: 220px; }
}

/* ---- sidebar: profiles + categories, expanded / icon rail / hidden ---- */
.layout { --side-w: 15.5rem; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 2rem; align-items: start; transition: grid-template-columns 0.2s; }
body[data-sidebar="rail"] .layout { --side-w: 3.9rem; gap: 1.25rem; }
body[data-sidebar="hidden"] .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
body[data-sidebar="hidden"] .cats { display: none; }
.cats {
  position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.1rem; margin-top: 1rem;
  max-height: calc(100vh - 2rem - var(--bar-h, 0px)); overflow-y: auto; overflow-x: hidden; padding: 0.25rem 0.25rem 1rem; scrollbar-width: thin;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.4rem 0.3rem; }
.side-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.side-collapse { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.side-collapse:hover { background: var(--accent-soft); color: var(--text); }
.side-h { margin: 0.8rem 0.5rem 0.25rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.side-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; padding: 0.42rem 0.6rem;
  border: 0; border-radius: 10px; background: none; font-size: 0.92rem; transition: background 0.15s;
}
.side-item:hover { background: var(--accent-soft); }
.side-item.active { background: var(--accent-strong); color: #fff; font-weight: 600; }
.side-ic { width: 1.4rem; flex: none; display: grid; place-items: center; }
.side-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-n { font-size: 0.75rem; opacity: 0.65; font-variant-numeric: tabular-nums; }
body[data-sidebar="rail"] .side-name, body[data-sidebar="rail"] .side-n, body[data-sidebar="rail"] .side-title { display: none; }
body[data-sidebar="rail"] .side-head { justify-content: center; }
body[data-sidebar="rail"] .side-h { font-size: 0; margin: 0.5rem 0.6rem; height: 1px; background: var(--line); }
body[data-sidebar="rail"] .side-item { justify-content: center; padding: 0.5rem 0; }

.side-toggle { width: 40px; height: 40px; padding: 0; flex: none; font-size: 1.15rem; line-height: 1; border-radius: 10px; }
.side-toggle.on { border-color: color-mix(in oklab, var(--accent), var(--line) 50%); }

@media (max-width: 900px) {
  .layout, body[data-sidebar] .layout { grid-template-columns: 1fr; gap: 0; }
  .side-toggle { display: none; }
  body[data-sidebar] .cats {
    display: flex; position: sticky; top: 0; z-index: 5; flex-direction: row; gap: 0.35rem; overflow-x: auto; max-height: none; margin: 0 -1.25rem;
    padding: 0.6rem 1.25rem; background: color-mix(in oklab, var(--bg), transparent 8%); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .cats::-webkit-scrollbar { display: none; }
  .side-head, .side-h { display: none; }
  body[data-sidebar] .side-item { width: auto; flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 0.35rem 0.8rem; justify-content: flex-start; }
  body[data-sidebar] .side-name, body[data-sidebar] .side-n { display: inline; }
  .side-item.active { border-color: var(--accent-strong); background: var(--accent-strong); }
}

/* ---- toolbar filters ---- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin-top: 0.9rem; }
.filter { display: inline-flex; align-items: center; gap: 0.45rem; }
.filter-label { font-size: 0.8rem; color: var(--muted); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.seg-b { padding: 0.28rem 0.7rem; border: 0; border-radius: 8px; background: none; font-size: 0.85rem; transition: background 0.15s, color 0.15s; }
.seg-b:hover { background: var(--accent-soft); }
.seg-b.active { background: var(--accent-strong); color: #fff; }
.chip-toggle { padding: 0.32rem 0.8rem; border-radius: 999px; font-size: 0.85rem; }
.chip-toggle.active { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #f59e0b; color: #92400e; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-toggle.active { background: linear-gradient(135deg, #78350f, #92400e); border-color: #b45309; color: #fde68a; }
}
:root[data-theme="dark"] .chip-toggle.active { background: linear-gradient(135deg, #78350f, #92400e); border-color: #b45309; color: #fde68a; }
.filter-count { font-size: 0.85rem; margin-left: auto; }

/* one row: sidebar toggle, search and filters */
.tools { flex-wrap: nowrap; gap: 0.9rem; }
#search { flex: 1 1 9rem; min-width: 8rem; max-width: 19rem; }
.filters { flex: 1 1 auto; flex-wrap: nowrap; margin-top: 0; gap: 0.5rem 0.9rem; justify-content: flex-start; white-space: nowrap; }
@media (max-width: 1060px) { .tools { flex-wrap: wrap; } .filters { flex-wrap: wrap; flex-basis: 100%; } }

.profile-select {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer;
}
.profile-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-sidebar="rail"] .profile-select { padding: 0.45rem 0; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; font-size: 1.1rem; }
@media (max-width: 900px) { body[data-sidebar] .profile-select { width: auto; flex: none; border-radius: 999px; } }

.tb-select {
  padding: 0.38rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
  font: inherit; font-size: 0.88rem; cursor: pointer; max-width: 13rem;
}
.tb-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) { .tb-select { display: none; } }

/* every toolbar control shares one height */
.tools { --ctl-h: 40px; align-items: center; }
.tools .side-toggle, .tools #search, .tools .tb-select, .tools .seg, .tools .chip-toggle {
  height: var(--ctl-h); box-sizing: border-box; margin: 0;
}
.tools .side-toggle { width: var(--ctl-h); padding: 0; }
.tools #search { padding-top: 0; padding-bottom: 0; }
.tools .tb-select { padding-top: 0; padding-bottom: 0; line-height: normal; }
.tools .seg { align-items: stretch; }
.tools .seg-b { display: flex; align-items: center; padding: 0 0.8rem; height: auto; }
.tools .chip-toggle { display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }

/* ---- the folder in the bottom bar: a tile with a frosted-glass folder, a page per app, and a caption ---- */
.folder-card {
  flex: none; width: 226px; display: flex; flex-direction: column; gap: 0.5rem; padding: 12px 14px 12px; border-radius: 20px; text-align: left;
  background: linear-gradient(180deg, #f6f6f9, #ebebf1); border: 1px solid rgb(0 0 0 / 0.07); color: var(--text); cursor: pointer;
  box-shadow: 0 6px 18px rgb(30 30 60 / 0.12), inset 0 1px 0 #fff; transition: transform 0.2s, box-shadow 0.2s;
}
.folder-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgb(30 30 60 / 0.18), inset 0 1px 0 #fff; }
.folder-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.folder { position: relative; display: block; height: 124px; margin-top: 2px; perspective: 560px; }
.folder-back {
  position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; height: 96px; border-radius: 6px 16px 16px 16px;
  background: linear-gradient(165deg, #5b5675, #3a3652 60%, #2c2942);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 10px 20px rgb(30 25 60 / 0.28);
}
.folder-back::before {
  content: ""; position: absolute; left: 0; top: -12px; width: 74px; height: 18px; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #67617f, #4b4766);
}
.folder-pages { position: absolute; left: 8px; right: 8px; bottom: 16px; height: 0; z-index: 1; clip-path: inset(-140px 0 0 0); }
.paper {
  position: absolute; left: 50%; bottom: 0; width: 66px; height: 92px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 7px 0; border-radius: 8px; background: linear-gradient(180deg, #fff, #f3f4f9); border: 1px solid rgb(90 90 130 / 0.18);
  box-shadow: 0 4px 10px rgb(30 25 70 / 0.28); transform-origin: 50% 100%;
  transform: translateX(calc(-50% + var(--x, 0px))) translateY(var(--sag, 0px)) rotate(var(--rot, 0deg));
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.folder-card:hover .paper { transform: translateX(calc(-50% + var(--x, 0px) * 1.08)) translateY(calc(var(--sag, 0px) - 12px)) rotate(calc(var(--rot, 0deg) * 1.1)); }
.paper.enter { animation: paper-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes paper-in { from { opacity: 0; transform: translateX(calc(-50% + var(--x, 0px))) translateY(40px) rotate(0deg) scale(0.6); } }
.paper-name { max-width: 100%; font-size: 0.6rem; font-weight: 600; line-height: 1.1; color: #3b3d5c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-line { width: 78%; height: 3px; border-radius: 2px; background: #dfe1ee; }
.paper-line.short { width: 52%; }
.icon-paper { width: 30px; height: 30px; font-size: 0.8rem; flex: none; }
.folder-front {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 64px; border-radius: 8px 8px 16px 16px;
  display: flex; align-items: flex-end; justify-content: space-between; padding: 0 10px 9px; transform-origin: 50% 100%; transition: transform 0.28s ease;
  background: linear-gradient(180deg, rgb(150 140 200 / 0.46), rgb(86 76 140 / 0.66));
  -webkit-backdrop-filter: blur(9px) saturate(1.4); backdrop-filter: blur(9px) saturate(1.4);
  border: 1px solid rgb(255 255 255 / 0.3); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -10px 18px rgb(30 20 80 / 0.25), 0 -6px 14px rgb(30 25 80 / 0.22);
}
.folder-card:hover .folder-front { transform: rotateX(-14deg); }
.folder-pill {
  padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: #fff;
  background: rgb(255 255 255 / 0.18); border: 1px solid rgb(255 255 255 / 0.35); backdrop-filter: blur(4px);
}
.folder-caption { display: flex; flex-direction: column; padding: 0 2px; }
.folder-n { font-weight: 700; font-size: 0.98rem; }
.folder-sub { font-size: 0.76rem; color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .folder-card { background: linear-gradient(180deg, #23262e, #1b1d24); border-color: rgb(255 255 255 / 0.08); box-shadow: 0 6px 18px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.06); }
  :root:not([data-theme="light"]) .paper { background: linear-gradient(180deg, #2c313d, #232733); border-color: rgb(160 170 240 / 0.22); }
  :root:not([data-theme="light"]) .paper-name { color: #cfd4f7; }
  :root:not([data-theme="light"]) .paper-line { background: #394052; }
}
:root[data-theme="dark"] .folder-card { background: linear-gradient(180deg, #23262e, #1b1d24); border-color: rgb(255 255 255 / 0.08); box-shadow: 0 6px 18px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.06); }
  :root[data-theme="dark"] .paper { background: linear-gradient(180deg, #2c313d, #232733); border-color: rgb(160 170 240 / 0.22); }
  :root[data-theme="dark"] .paper-name { color: #cfd4f7; }
  :root[data-theme="dark"] .paper-line { background: #394052; }
@media (prefers-reduced-motion: reduce) { .paper, .folder-front, .folder-card { transition: none; } .paper.enter { animation: none; } }

.tag-chip { border-color: transparent; background: var(--bg); }
.tag-arm { color: #6d28d9; background: #f3e8ff; border-color: #d8b4fe; font-weight: 600; }
.tag-intel { color: #92400e; background: #fef3c7; border-color: #fcd34d; font-weight: 600; }
.tag-both { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-arm { color: #d8b4fe; background: #3b0764; border-color: #6b21a8; }
  :root:not([data-theme="light"]) .tag-intel { color: #fde68a; background: #78350f; border-color: #b45309; }
}
:root[data-theme="dark"] .tag-arm { color: #d8b4fe; background: #3b0764; border-color: #6b21a8; }
  :root[data-theme="dark"] .tag-intel { color: #fde68a; background: #78350f; border-color: #b45309; }

/* dropdowns: a custom chevron with room to breathe on the right */
.tb-select, .profile-select {
  -webkit-appearance: none; appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 12px 8px;
}
body[data-sidebar="rail"] .profile-select { background-image: none; padding-right: 0; }

/* search with a clear button */
.search-wrap { position: relative; flex: 1 1 9rem; min-width: 8rem; max-width: 19rem; }
.tools .search-wrap #search { width: 100%; max-width: none; padding-right: 2.2rem; }
#search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0;
  border-radius: 50%; background: var(--line); color: var(--muted); font-size: 1rem; line-height: 1; display: grid; place-items: center;
}
.search-clear:hover { background: var(--muted); color: var(--card); }
.search-clear[hidden] { display: none; }

/* ---- slim bar: the folder tile hangs up out of it, keeping its own column on the right ---- */
.bar { padding: 0.75rem 0; }
.bar-inner { grid-template-columns: 1fr auto 226px; }
.bar-info { order: 3; grid-row: 1 / span 2; grid-column: 3; position: relative; align-self: stretch; }
.bar-info .folder-card { position: absolute; right: 0; bottom: 0; }
.bar-inner .hint { grid-column: 1 / 3; }
.drawer {
  bottom: var(--pop-bottom, 13rem);
  max-height: min(68vh, calc(100vh - var(--pop-bottom, 13rem) - 1.25rem));
}
@media (max-width: 760px) {
  .bar-inner { grid-template-columns: 1fr; }
  .bar-info { grid-row: auto; grid-column: auto; position: static; }
  .bar-info .folder-card { position: static; }
  .bar-inner .hint { grid-column: 1; }
}

/* ---- the folder lives at the far right of the bar, on the bar's own surface (no separate card) ---- */
.bar .bar-inner {
  max-width: none; margin: 0; grid-template-columns: 1fr auto;
  padding-left: max(1.25rem, calc((100vw - 1120px) / 2 + 1.25rem));
  padding-right: calc(200px + 3rem);   /* leave room for the folder */
}
.bar .bar-inner .hint { grid-column: 1 / -1; }
.bar .bar-info { position: absolute; right: 1.5rem; bottom: 0.75rem; grid-row: auto; grid-column: auto; align-self: auto; }
.bar .bar-info .folder-card { position: static; }
.folder-card, .folder-card:hover { background: none; border-color: transparent; box-shadow: none; }
.folder-card { width: 200px; padding: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .folder-card, :root:not([data-theme="light"]) .folder-card:hover { background: none; border-color: transparent; box-shadow: none; }
}
:root[data-theme="dark"] .folder-card, :root[data-theme="dark"] .folder-card:hover { background: none; border-color: transparent; box-shadow: none; }
.drawer { right: 1.5rem; transform-origin: calc(100% - 100px) 100%; }
.drawer::after { right: 92px; }
@media (max-width: 760px) {
  .bar .bar-inner { padding: 0 1.25rem; grid-template-columns: 1fr; }
  .bar .bar-info { position: static; }
  .drawer { right: 1rem; }
  .drawer::after { right: 60px; }
}

/* ---- folder proportions: taller, with portrait pages that rise above the back panel ---- */
.folder { height: 176px; margin-top: 0; }
.folder-back { height: 142px; }
.folder-back::before { width: 78px; height: 20px; top: -13px; }
.folder-pages { left: 8px; right: 8px; bottom: 38px; clip-path: inset(-220px 0 0 0); }
.paper { width: 84px; height: 126px; padding: 11px 8px 0; gap: 6px; border-radius: 9px; }
.icon-paper { width: 38px; height: 38px; font-size: 1rem; }
.paper-name { font-size: 0.68rem; }
.paper-line { height: 4px; width: 80%; }
.paper-line.short { width: 54%; }
.folder-front { height: 94px; border-radius: 10px 10px 18px 18px; padding: 0 12px 11px; }
.folder-pill { font-size: 0.76rem; padding: 3px 12px; }
.folder-caption { padding: 0 4px; }

/* pages leave the folder instead of piling up */
.paper { transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s ease; }
.paper.leave {
  opacity: 0; pointer-events: none;
  transform: translateX(calc(-50% + var(--x, 0px) - 26px)) translateY(46px) rotate(calc(var(--rot, 0deg) - 8deg)) scale(0.86);
}
@media (prefers-reduced-motion: reduce) { .paper.leave { transition: none; } }

/* ---- the install command, drawn as a terminal ---- */
.command {
  background: #0d1117; color: #e6edf3; border: 1px solid #262c36; border-radius: 12px; padding: 0.65rem 0.95rem 0.7rem;
  font: 0.84rem/1.6 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; overflow-y: auto; max-height: 5.9rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 1px 2px rgb(0 0 0 / 0.25); scrollbar-width: thin; scrollbar-color: #3a4250 transparent;
}
.t-prompt { color: #3fb950; font-weight: 700; user-select: none; }
.t-cmd { color: #79c0ff; font-weight: 600; }
.t-flag { color: #d2a8ff; }
.t-url { color: #a5d6ff; text-decoration: underline; text-decoration-color: #3b4a5f; text-underline-offset: 3px; }
.t-pipe { color: #ff7b72; font-weight: 700; }
.t-id { color: #ffa657; }
.t-caret { display: inline-block; width: 0.55em; height: 1.05em; vertical-align: text-bottom; background: #e6edf3; animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .t-caret { animation: none; } }
.bar-inner .hint code { background: var(--line); padding: 0.05rem 0.35rem; border-radius: 5px; font-size: 0.78rem; }

/* ---- the pile: blank sheets behind the visible pages, one per extra pick ---- */
.ghost {
  position: absolute; left: 50%; bottom: 0; width: 84px; height: 126px; border-radius: 9px; transform-origin: 50% 100%;
  background: linear-gradient(180deg, #fafbff, #e9ecf6); border: 1px solid rgb(90 90 130 / 0.2); box-shadow: 0 2px 6px rgb(30 25 70 / 0.2);
  transform: translateX(calc(-50% + var(--gx, 0px))) translateY(var(--gy, 0px)) rotate(var(--gr, 0deg));
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s;
}
.ghost.enter { animation: ghost-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes ghost-in { from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.8); } }
.ghost.leave { opacity: 0; }
.folder-card:hover .ghost { transform: translateX(calc(-50% + var(--gx, 0px) * 1.2)) translateY(calc(var(--gy, 0px) - 4px)) rotate(calc(var(--gr, 0deg) * 1.15)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ghost { background: linear-gradient(180deg, #333949, #272b38); border-color: rgb(160 170 240 / 0.2); }
}
:root[data-theme="dark"] .ghost { background: linear-gradient(180deg, #333949, #272b38); border-color: rgb(160 170 240 / 0.2); }
@media (prefers-reduced-motion: reduce) { .ghost, .ghost.enter { transition: none; animation: none; } }

/* ---- the command as a macOS Terminal window: title bar with traffic lights, two lines by default ---- */
.term { background: #0d1117; border: 1px solid #2a313c; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px rgb(0 0 0 / 0.14); min-width: 0; }
.term-bar {
  position: relative; display: flex; align-items: center; justify-content: center; height: 28px; padding: 0 0.7rem;
  background: linear-gradient(180deg, #2b303a, #21252e); border-bottom: 1px solid #12151b; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07);
}
.dots { position: absolute; left: 0.7rem; display: flex; gap: 7px; }
.dot { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; cursor: default; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.35); }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; cursor: pointer; } .dot-g { background: #28c840; cursor: pointer; }
.dot:hover { filter: brightness(1.12); }
.term-title { font: 500 0.72rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #9aa3b2; letter-spacing: 0.01em; user-select: none; }
.term-toggle {
  position: absolute; right: 0.55rem; padding: 2px 9px; border: 1px solid #3a4250; border-radius: 999px; background: transparent;
  color: #9aa3b2; font: 500 0.7rem/1.4 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer;
}
.term-toggle:hover { color: #e6edf3; border-color: #596375; }
.term-toggle[hidden] { display: none; }
.term .command { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0.5rem 0.95rem 0.6rem; max-height: none; }
.term[data-open="false"] .command { max-height: calc(2 * 1.6 * 0.84rem + 1.1rem); overflow: hidden; }
.term[data-open="true"] .command { max-height: 9.5rem; overflow-y: auto; }
.term.more[data-open="false"] .command { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }

/* ---- Lucide icons ---- */
.lucide { flex: none; display: block; }
.side-toggle, .modal-close, .drawer-close, .side-collapse, .search-clear, .row-x, .lb-btn { display: grid; place-items: center; }
.search-icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.tools .search-wrap #search { padding-left: 2.35rem; }
#copy, #download { display: inline-flex; align-items: center; gap: 0.45rem; }
#copy.done { background: #16a34a; border-color: #16a34a; }
.tag-rec, .term-toggle, .chip-toggle, .stars { display: inline-flex; align-items: center; gap: 0.3rem; }
.tag-rec .lucide { fill: currentColor; }
.chip-toggle.active .lucide { fill: currentColor; }
.stars .lucide { color: #f59e0b; fill: #f59e0b; }
a.ext { display: inline-flex; align-items: center; gap: 0.38rem; text-decoration: none; }
a.ext:hover { text-decoration: underline; }
a.ext .lucide:last-child { opacity: 0.55; }
.pack-title { display: flex; align-items: center; gap: 0.55rem; }
.pack-title .lucide { color: var(--accent); }
.side-item.active .side-ic { color: #fff; }
.side-item:not(.active) .side-ic { color: var(--muted); }

/* ---- labelled dropdown with icons ---- */
.dd {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dd:hover { border-color: color-mix(in oklab, var(--accent), var(--line) 55%); }
.dd[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd-label { color: var(--muted); font-size: 0.78rem; white-space: nowrap; padding-right: 0.15rem; }
.dd-icon { display: grid; place-items: center; color: var(--accent); flex: none; }
.dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.dd-text.placeholder { color: var(--muted); font-weight: 400; }
.dd-chev { display: grid; place-items: center; color: var(--muted); flex: none; margin-right: 0.1rem; }
.dd-compact { justify-content: center; padding: 0.5rem 0; }
.dd-tool { width: auto; max-width: 16rem; height: var(--ctl-h, 40px); padding-top: 0; padding-bottom: 0; }
.dd-menu {
  position: fixed; z-index: 70; padding: 0.35rem; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.22); animation: pop-up 0.15s ease-out;
}
.dd-opt {
  display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.6rem; border: 0; border-radius: 9px; background: none;
  color: var(--text); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer;
}
.dd-opt:hover, .dd-opt:focus-visible { background: var(--accent-soft); outline: none; }
.dd-opt.selected { font-weight: 600; }
.dd-opt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dd-opt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-opt-hint { font-size: 0.74rem; font-weight: 400; color: var(--muted); line-height: 1.3; }
.dd-count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dd-check { display: grid; place-items: center; color: var(--accent); }
@media (max-width: 900px) { body[data-sidebar] .dd { width: auto; flex: none; border-radius: 999px; } }

/* quick clear inside a dropdown */
.dd-clear {
  display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; color: var(--muted);
  background: var(--line); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dd-clear:hover, .dd-clear:focus-visible { background: var(--muted); color: var(--card); outline: none; }
.dd-price { min-width: 9.5rem; }

.pack-actions { display: flex; align-items: center; gap: 0.5rem; }
.pack-close {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--muted);
}
.pack-close:hover { color: var(--text); border-color: var(--muted); }

/* the command is a <code>, which is inline by default: its padding then only reaches the first line */
.term .command, .command { display: block; }

/* the search box takes all the room the controls leave */
.tools .search-wrap { flex: 1 1 10rem; min-width: 10rem; max-width: none; }
.tools .filters { flex: 0 0 auto; }
@media (max-width: 1060px) { .tools .filters { flex-basis: 100%; } }

/* --dry-run: a toggle inside the hint line */
.dry {
  padding: 0.05rem 0.45rem; border: 1px dashed var(--muted); border-radius: 6px; background: var(--line); color: var(--accent);
  font: 0.78rem/1.5 ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dry:hover { border-style: solid; background: var(--accent-soft); }
.dry.on { background: var(--accent-strong); border-color: var(--accent-strong); border-style: solid; color: #fff; }
.t-dry { color: #f0883e; font-weight: 600; }

/* dependencies: a confirm dialog and a small notice */
.confirm { width: min(26rem, calc(100vw - 2rem)); padding: 1.4rem; }
.confirm h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.confirm p { margin: 0 0 1.2rem; color: var(--muted); }
.confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h, 0px) + 1rem); z-index: 40; max-width: min(34rem, calc(100vw - 2rem));
  padding: 0.6rem 1rem; border-radius: 12px; background: #1f2430; color: #f3f4f6; font-size: 0.88rem; box-shadow: 0 10px 28px rgb(0 0 0 / 0.3); animation: pop-up 0.2s ease-out;
}
.toast[hidden] { display: none; }
.brew-wrap { margin: 0 0 1.25rem; }
.brew-wrap .brew { margin-bottom: 0.4rem; }
.brew-need { margin: 0; font-size: 0.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.brew-need .link:disabled { color: var(--muted); cursor: default; display: inline-flex; align-items: center; gap: 0.3rem; }

#share { display: inline-flex; align-items: center; gap: 0.45rem; }

/* the end of the list */
.endcap { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin: 2.5rem 0 1rem; padding: 1.6rem 1rem; border-top: 1px dashed var(--line); text-align: center; }
.endcap p { margin: 0; color: var(--muted); }
.endcap-flag { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.endcap-clear { display: inline-flex; align-items: center; gap: 0.45rem; border-radius: 999px; padding: 0.45rem 1rem; }
.endcap-clear:hover { border-color: var(--accent); color: var(--accent); }

/* ---- brand: the mascot beside the name ---- */
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand h1 { margin: 0; }
.brand-logo {
  width: 64px; height: 64px; flex: none; filter: drop-shadow(0 6px 10px rgb(90 70 180 / 0.3));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.07); }
@media (prefers-reduced-motion: reduce) { .brand-logo { transition: none; } }

/* ---- brand: a modest mascot, a clean heavy wordmark, one accent ---- */
.brand { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.brand-logo { width: 210px; height: 210px; flex: none; margin: -0.4rem 0 -0.6rem -0.5rem; filter: drop-shadow(0 14px 22px rgb(90 70 180 / 0.3)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.top .wordmark {
  margin: 0; font: 800 clamp(3rem, 7vw, 4.7rem)/1 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.045em; color: var(--text);
}
.wordmark .bang { background: linear-gradient(180deg, #8b7bf2, #6a59e0); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 0.02em; }
.tagline { margin: 0.6rem 0 0.25rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.tagline > span { white-space: nowrap; }
.tagline .hl { color: #6a59e0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tagline .hl { color: #a99af7; }
}
:root[data-theme="dark"] .tagline .hl { color: #a99af7; }
.subline { margin: 0 0 1.4rem; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 640px) { .brand-logo { width: 128px; height: 128px; margin: 0; } .top .wordmark { font-size: 2.5rem; } .tagline > span { white-space: normal; } }

/* a small heading above each toolbar dropdown; everything else lines up with the bottom of the row */
.tool-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.tool-field-label { padding-left: 0.2rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tools, .tools .filters { align-items: flex-end; }

/* phones: no sidebar toggle (the categories are the row of pills), and the selected pill stays readable */
@media (max-width: 900px) {
  .tools .side-toggle { display: none; }
  body[data-sidebar] .side-item.active { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
}

/* the lead line: "New Mac?" is the part that throws confetti */
.tagline .newmac { color: #6a59e0; cursor: default; display: inline-block; margin-right: 0.3em; text-decoration: underline dotted rgb(106 89 224 / 0.45); text-underline-offset: 0.2em; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tagline .newmac:hover { transform: scale(1.06) rotate(-1.5deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tagline .newmac { color: #a99af7; text-decoration-color: rgb(169 154 247 / 0.5); }
}
:root[data-theme="dark"] .tagline .newmac { color: #a99af7; text-decoration-color: rgb(169 154 247 / 0.5); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }
@media (prefers-reduced-motion: reduce) { .tagline .newmac:hover { transform: none; } }

/* ================= sticky top bar, sticky headings, spacing, responsiveness ================= */
.top { padding-bottom: 1rem; }
.topbar-sentinel { height: 1px; margin-bottom: -1px; }
.topbar {
  position: sticky; top: 0; z-index: 30; padding: 0.4rem 0 1.1rem;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s; border-bottom: 1px solid transparent;
}
.topbar.stuck {
  padding-bottom: 0.7rem; background: color-mix(in oklab, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: var(--line); box-shadow: 0 8px 24px rgb(0 0 0 / 0.07);
}
.topbar.stuck .tool-field-label { display: none; }
/* the small logo: invisible and zero-width until the bar is stuck */
.mini-brand { width: 0; min-width: 0; padding: 0; margin: 0 -0.45rem 0 0; border: 0; background: none; opacity: 0; overflow: hidden; flex: none; cursor: pointer;
  transition: width 0.22s ease, opacity 0.22s ease, margin 0.22s ease; display: grid; place-items: center; height: var(--ctl-h, 40px); }
.mini-brand img { width: 40px; height: 40px; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mini-brand:hover img { transform: rotate(-8deg) scale(1.1); }
.topbar.stuck .mini-brand { width: 44px; opacity: 1; margin-right: 0; }

/* category titles stay under the bar while their section scrolls, until the next title takes the place */
section.cat:not(.pack) { margin: 0 0 3.4rem; }
section.cat:not(.pack):last-of-type { margin-bottom: 1.5rem; }
section.cat:not(.pack) > h2 {
  position: sticky; top: var(--topbar-h, 0px); z-index: 4; margin: 0 -0.6rem; padding: 0.75rem 0.6rem 0.6rem;
  font-size: 1.3rem; letter-spacing: -0.015em;
  background: color-mix(in oklab, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
section.cat:not(.pack) > p { margin: 0 0 1rem; }
.grid { gap: 0.8rem; }
section.pack { margin: 0 0 3.4rem; }

/* the sidebar sits below the bar */
.cats { top: calc(var(--topbar-h, 0px) + 0.75rem); max-height: calc(100vh - var(--topbar-h, 0px) - var(--bar-h, 0px) - 1.75rem); }

/* ---- responsiveness ---- */
/* desktop and tablet: one row, never two. Inner labels go first when space is tight. */
@media (min-width: 901px) {
  .tools { flex-wrap: nowrap; }
  .tools .filters { flex-wrap: nowrap; flex: 0 0 auto; }
  .search-wrap { min-width: 8rem; }
}
@media (max-width: 1240px) { .dd-tool .dd-label { display: none; } .dd-tool { max-width: 13rem; } }
@media (max-width: 1040px) { .dd-price .dd-text { display: none; } .dd-price { min-width: 0; } .dd-tool { max-width: 11rem; } }

/* phones and small tablets: the logo and search share the first row, the filters scroll sideways on the second */
@media (max-width: 900px) {
  .topbar { padding: 0.5rem 0 0.7rem; }
  .tools { flex-wrap: wrap; gap: 0.55rem; }
  .search-wrap { flex: 1 1 10rem; min-width: 0; }
  .tools .filters { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .tools .filters::-webkit-scrollbar { display: none; }
  .tool-field-label { display: none; }
  .mini-brand { margin-right: 0; }
  body[data-sidebar] .cats { top: var(--topbar-h, 0px); }
  section.cat:not(.pack) { margin-bottom: 2.6rem; }
  section.cat:not(.pack) > h2 { top: calc(var(--topbar-h, 0px) + 3.1rem); font-size: 1.2rem; }
}
/* small phones: once the bar is stuck it keeps only the logo and the search */
@media (max-width: 640px) {
  .topbar.stuck .filters { display: none; }
  .topbar.stuck { padding-bottom: 0.5rem; }
  section.cat:not(.pack) > h2 { top: calc(var(--topbar-h, 0px) + 3rem); }
}

/* tablets: once stuck, the filters fit beside the search, so the bar stays one row */
@media (min-width: 641px) and (max-width: 900px) {
  .topbar.stuck .filters { flex: 0 0 auto; overflow: visible; }
  .topbar.stuck { padding-bottom: 0.5rem; }
}

/* stacking order, lowest to highest: page < sticky category titles (4) < pickers' list (20) < bottom bar (25) < the list above the folder (28) < top bar (30) < notices (40) < menus (70) */
.bar { z-index: 25; }
.drawer { z-index: 28; }

/* ================= phones: a compact bottom bar and a calmer top ================= */
.term-show, .folder-mini-ic { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: 6.5rem; }
  .bar { padding: 0.55rem 0 calc(0.55rem + env(safe-area-inset-bottom, 0px)); }
  .bar .bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0 0.75rem; }
  /* the terminal and its hint are one tap away, not always in the way */
  .bar .term { order: 0; flex: 1 1 100%; display: none; }
  .bar[data-term="1"] .term { display: block; }
  .bar .hint { order: 3; display: none; flex: 1 1 100%; margin: 0; font-size: 0.78rem; }
  .bar[data-term="1"] .hint { display: block; }
  /* one row: [12 apps] [Copy command] [terminal] [download] [link] */
  .bar .bar-info { order: 1; position: static; }
  .bar .bar-actions { order: 2; flex: 1 1 0; min-width: 0; display: flex; gap: 0.4rem; }
  #copy { flex: 1; justify-content: center; height: 44px; }
  #download, #share, .term-show { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; }
  #download .btn-label, #share .btn-label { display: none; }
  .term-show.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  /* the folder shrinks to a pill with the count */
  .bar .bar-info .folder-card {
    flex-direction: row; align-items: center; gap: 0.45rem; width: auto; height: 44px; padding: 0 0.9rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: none; transform: none;
  }
  .bar .bar-info .folder, .bar .bar-info .folder-sub { display: none; }
  .bar .bar-info .folder-caption { padding: 0; }
  .folder-mini-ic { display: grid; place-items: center; color: var(--accent); }
  .folder-n { font-size: 0.92rem; white-space: nowrap; }
  /* the list of picked apps becomes a sheet above the bar */
  .drawer { left: 0.75rem; right: 0.75rem; width: auto; bottom: var(--pop-bottom, 6rem); max-height: min(60vh, calc(100vh - var(--pop-bottom, 6rem) - 1rem)); }
  .drawer::after { display: none; }
  .toast { bottom: calc(var(--bar-h, 0px) + 0.75rem); }
  /* titles scroll with the page on phones: the top bar and the category pills are already fixed up there */
  section.cat:not(.pack) > h2 { position: static; margin: 0; padding: 0 0 0.35rem; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  section.cat:not(.pack) { margin-bottom: 2.2rem; }
  .grid { gap: 0.65rem; }
}

@media (max-width: 760px) {
  /* "Copy" is enough on a phone; the full words come back from 760px up */
  #copy .long { display: none; }
  #copy { white-space: nowrap; min-width: 0; }
  .bar .bar-actions { flex-wrap: nowrap; }
  /* the fixed top rows are nearly opaque, so the page doesn't show through as blurred text */
  .topbar.stuck { background: color-mix(in oklab, var(--bg) 97%, transparent); }
  body[data-sidebar] .cats { background: color-mix(in oklab, var(--bg) 97%, transparent); }
}

/* ================= two-level navigation: groups with categories inside ================= */
.side-group { display: flex; flex-direction: column; }
.side-row { display: flex; align-items: center; gap: 0.1rem; }
.side-row .side-item { flex: 1; min-width: 0; }
.side-item.has-active { color: var(--accent); }
.side-item.has-active .side-ic { color: var(--accent); }
.side-expand {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--muted); transition: background 0.15s, color 0.15s;
}
.side-expand:hover { background: var(--accent-soft); color: var(--text); }
.side-expand svg { transition: transform 0.2s; }
.side-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.side-subs { display: flex; flex-direction: column; gap: 0.05rem; margin: 0.1rem 0 0.4rem 1.2rem; padding-left: 0.45rem; border-left: 1px solid var(--line); }
.side-item.sub { font-size: 0.86rem; padding: 0.32rem 0.55rem; }
.side-item.sub .side-ic { width: 1.2rem; }
body[data-sidebar="rail"] .side-subs, body[data-sidebar="rail"] .side-expand { display: none; }
.side-pills { display: none; }
.dd-opt.sub { padding-left: 1.9rem; font-size: 0.86rem; }

/* the group in small type above a category heading */
.crumb { font: inherit; font-weight: 500; letter-spacing: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.crumb:hover { color: var(--accent); }
.crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.crumb-sep { display: inline-grid; place-items: center; margin: 0 0.3rem; color: var(--muted); opacity: 0.6; vertical-align: -0.12em; }
.crumb-sep svg { width: 0.8em; height: 0.8em; }

/* phones and small tablets: groups as pills, and a second row with the categories of the chosen group */
@media (max-width: 900px) {
  .cats > .side-head, .cats > .side-h, .cats > .dd, .cats > .side-list { display: none; }
  body[data-sidebar] .cats { flex-direction: column; gap: 0; padding: 0.55rem 1.25rem 0.5rem; overflow-x: visible; }
  .side-pills { display: flex; flex-direction: column; gap: 0.4rem; }
  .pill-row { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pill-row::-webkit-scrollbar { display: none; }
  .pill-row .dd { width: auto; flex: none; border-radius: 999px; }
  .pill-row .sub-row .side-item { font-size: 0.84rem; padding: 0.28rem 0.7rem; }
  .sub-row { padding-left: 0.1rem; }
  /* titles that stick (tablets) sit below the bar and however many rows of pills there are */
  section.cat:not(.pack) > h2 { top: calc(var(--topbar-h, 0px) + var(--cats-h, 3.1rem)); }
}
@media (max-width: 760px) {
  section.cat:not(.pack) > h2 { position: static; }
}

/* ================= Muggle mascot: slides in from the right, tilted ================= */
.mascot {
  position: fixed; right: 0; bottom: calc(var(--bar-h, 0px) - 0.5rem); z-index: 3; height: clamp(170px, 34vh, 360px); width: auto;
  pointer-events: none; user-select: none; transform-origin: 80% 100%;
  transform: translateX(115%) rotate(16deg); opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34, 1.4, 0.5, 1), opacity 0.4s ease;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.28));
}
.mascot.in { transform: translateX(30%) rotate(-9deg); opacity: 1; }
@media (max-width: 900px) { .mascot.in { transform: translateX(45%) rotate(-9deg); } }
@media (max-width: 760px) { .mascot { height: clamp(120px, 22vh, 200px); bottom: calc(var(--bar-h, 0px) - 0.25rem); } }
@media (prefers-reduced-motion: reduce) { .mascot { transition: opacity 0.3s; transform: translateX(30%) rotate(-9deg); } }

/* ================= version picker on a card ================= */
.ver-pick { margin-top: 0.45rem; }
.ver-pick .dd { height: 30px; min-width: 0; width: auto; padding: 0 0.55rem; gap: 0.4rem; font-size: 0.8rem; border-radius: 8px; }
.ver-pick .dd .dd-label { font-size: 0.72rem; }

/* ================= theme: follows the system until a choice is made with the switcher ================= */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-switch { display: inline-flex; flex: none; height: var(--ctl-h, 40px); padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.theme-switch button {
  display: grid; place-items: center; width: 32px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; padding: 0;
  transition: background 0.15s, color 0.15s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.theme-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (min-width: 901px) { .theme-switch { order: 5; } }

/* ================= preloader: a soft shimmer where an icon or screenshot is still on its way ================= */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.icon.loading .icon-clip, .shots img.loading {
  background: linear-gradient(100deg, var(--line) 30%, color-mix(in oklab, var(--line) 45%, var(--card)) 50%, var(--line) 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.icon.loading .icon-letter { visibility: hidden; }
.shots img { transition: opacity 0.3s; }
.shots img.loading { opacity: 0.85; min-width: 260px; border-radius: 10px; }
.shots img.loaded { animation: shot-in 0.3s ease; }
@keyframes shot-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .icon.loading .icon-clip, .shots img.loading, .shots img.loaded { animation: none; } }

/* the chip and macOS badges ride on the screenshot in the app's details */
.modal-media { position: relative; }
.media-tags { position: absolute; left: 0.6rem; top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.35rem; z-index: 2; pointer-events: none; }
.media-tags .tag { pointer-events: auto; background: color-mix(in oklab, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 4px rgb(0 0 0 / 0.18); }

/* ================= FAQ ================= */
.faq { margin-top: 3.5rem; }
/* a rule across the page width, so the FAQ reads as its own part of the page, lined up with the catalog and footer */
.faq::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: 2.5rem; }
.faq h2 { margin: 0 0 1rem; font-size: 1.5rem; letter-spacing: -0.02em; }
.faq-list { display: grid; gap: 0.6rem; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: border-color 0.15s; }
.faq-item:hover, .faq-item[open] { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.95rem 1.1rem; cursor: pointer;
  font-weight: 600; list-style: none; border-radius: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-plus { position: relative; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: currentColor; transition: transform 0.2s; }
.faq-plus::after { transform: rotate(90deg); }
.faq-item[open] .faq-plus::after { transform: rotate(0); }
.faq-item p { margin: 0; padding: 0 1.1rem 1.1rem; color: var(--muted); line-height: 1.6; }
.faq-item code { font-size: 0.85em; padding: 0.1em 0.35em; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .faq-plus::before, .faq-plus::after { transition: none; } }

/* the add circle: a ring that reads on both themes, and turns accent on hover */
:root { --check-ring: #c4c8cf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --check-ring: #5d6470; } }
:root[data-theme="dark"] { --check-ring: #5d6470; }
.check { border: 1.5px solid var(--check-ring); transition: border-color 0.15s, background 0.15s; }
.app:hover .check, .check:hover { border-color: var(--accent); }
.faq-item p a { color: var(--accent); }
.faq-item p code#update-cmd { display: inline; word-break: break-all; }

/* ================= starter pack parts: pick one / pick any / included ================= */
.pack .slot + .slot { margin-top: 1.4rem; }
.slot-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.6rem; }
.slot-head h3 { margin: 0; font-size: 0.95rem; letter-spacing: -0.01em; }
.slot-hint { font-size: 0.78rem; color: var(--muted); }
.slot-one .slot-hint::before, .slot-any .slot-hint::before, .slot-all .slot-hint::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.4rem; vertical-align: 0.05em;
  border: 1.5px solid var(--accent); border-radius: 50%;
}
.slot-any .slot-hint::before { border-radius: 2px; }
.slot-all .slot-hint::before { background: var(--accent); border-radius: 2px; }

/* FAQ words that act: a dotted underline, and an icon that slides in on hover */
.faq-act {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0; vertical-align: baseline;
  text-decoration: underline dotted; text-decoration-color: color-mix(in oklab, var(--accent) 50%, transparent); text-underline-offset: 3px;
}
.faq-act code { color: inherit; }
.faq-act-ic { display: inline-grid; place-items: center; width: 0; opacity: 0; overflow: hidden; transition: width 0.18s ease, opacity 0.18s ease, margin 0.18s ease; }
.faq-act:hover .faq-act-ic, .faq-act:focus-visible .faq-act-ic { width: 18px; opacity: 1; margin-left: 0.3rem; }
.faq-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.faq-act[aria-disabled="true"] { color: inherit; cursor: default; text-decoration: none; }
.faq-act[aria-disabled="true"] .faq-act-ic { display: none; }
@media (prefers-reduced-motion: reduce) { .faq-act-ic { transition: none; } }

/* Copy command: on hover a slow gradient in the logo's colours drifts across the button */
@keyframes copy-glow { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
#copy { position: relative; transition: box-shadow 0.25s ease, transform 0.15s ease; }
#copy:not(.done):hover {
  background-image: linear-gradient(110deg, #6a59e0, #8b7bf2, #c86fe0, #f472b6, #8b7bf2, #6a59e0);
  background-size: 200% 100%; border-color: transparent;
  animation: copy-glow 2.4s linear infinite;
  box-shadow: 0 6px 20px rgb(139 123 242 / 0.4);
}
#copy:not(.done):active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { #copy:not(.done):hover { animation: none; background-position: 30% 50%; } }

/* install list: more air between rows, a wider panel, and the trash icons stay quiet until you point at a row */
.drawer { width: min(380px, calc(100vw - 1.5rem)); }
.drawer-head { padding: 1rem 1.15rem; }
.drawer-list { padding: 0.4rem 0.75rem 1rem; }
.drawer-cat { margin: 1.1rem 0.5rem 0.45rem; }
.drawer-cat:first-child { margin-top: 0.7rem; }
.row { gap: 0.8rem; padding: 0.5rem 0.55rem; }
.row + .row { margin-top: 2px; }
.row .icon-sm { width: 32px; height: 32px; }
.row-x { width: 30px; height: 30px; border-radius: 8px; opacity: 0.45; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.row:hover .row-x, .row-x:focus-visible { opacity: 1; }
.row-x:hover { background: #ef4444; color: #fff; }
@media (hover: none) { .row-x { opacity: 0.8; } }
@media (max-width: 760px) { .drawer { width: auto; } }
/* once the real icon has loaded, the coloured tint behind it must not bleed through the rounded edge */
.icon.has-img .icon-clip { background: transparent; }
/* the install list opens above the sticky top bar, not under it */
.drawer { z-index: 32; }

/* phones: the category and starter-pack pills under the bar already do this, so the toolbar copies (shown when the
   sidebar is hidden on a big screen) stay out of the way */
@media (min-width: 901px) { body:not([data-sidebar="hidden"]) .tools .tool-field { display: none; } }
/* ================= phones and small tablets: search + a menu button; the menu holds packs, categories, price, theme ================= */
.menu-toggle { display: none; }
.tools-menu { display: contents; }
.theme-label { display: none; }
@media (max-width: 900px) {
  .cats { display: none !important; }
  .tools { flex-wrap: wrap; }
  .tools .search-wrap { order: 1; flex: 1 1 0; min-width: 0; }
  .menu-toggle {
    display: grid; place-items: center; order: 2; flex: none; position: relative;
    width: var(--ctl-h, 40px); height: var(--ctl-h, 40px); padding: 0; border-radius: 10px; color: var(--text);
  }
  .menu-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  /* a dot when a pack, category or price filter is on, so you know the menu is hiding something */
  .menu-toggle.has-filters::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 2px var(--card); }
  .tools-menu { display: none; }
  .topbar.menu-open .tools-menu {
    display: flex; flex-direction: column; gap: 0.85rem; order: 3; flex: 1 1 100%;
    padding: 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.08);
    max-height: calc(100vh - var(--topbar-h, 60px) - 2rem); overflow-y: auto;
  }
  .topbar.menu-open .tools-menu .filters { display: flex !important; flex-direction: column; align-items: stretch; gap: 0.85rem; overflow: visible; padding: 0; flex: none; }
  .tools-menu .tool-field { display: flex !important; flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .tools-menu .tool-field-label { display: block !important; }
  .tools-menu .dd, .tools-menu .dd-tool { width: 100%; max-width: none; }
  .tools-menu .dd-price .dd-text { display: inline; }
  .tools-menu .dd .dd-label { display: inline; }
  .tools-menu .theme-switch { display: flex; width: 100%; order: 0; }
  .tools-menu .theme-switch button { flex: 1; width: auto; gap: 0.4rem; display: inline-flex; align-items: center; justify-content: center; }
  .tools-menu .theme-label { display: inline; font-size: 0.85rem; }
}
@media (max-width: 900px) { section.cat:not(.pack) > h2 { top: var(--topbar-h, 0px); } }

/* ================= phones: the header stacks and centres, with the mascot front and centre ================= */
@media (max-width: 760px) {
  .top { padding: 1.5rem 0 1.25rem; }
  .brand { flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; }
  .brand-logo { width: min(240px, 62vw); height: auto; aspect-ratio: 1; margin: 0 0 -0.4rem; }
  .brand-text { align-items: center; }
  .top .wordmark { font-size: clamp(2.8rem, 13vw, 3.6rem); }
  .tagline { margin: 0.45rem 0 0.35rem; font-size: 1.2rem; line-height: 1.35; text-wrap: balance; }
  .subline { max-width: 30ch; margin: 0 auto; text-wrap: balance; }
}

.top .wordmark { position: relative; width: fit-content; }
/* the "beta" tag: a small sticker, tilted, tucked against the top of the wordmark */
.wordmark .beta {
  position: absolute; top: 0.05em; left: 100%; margin-left: 0.1rem; padding: 3px 7px 2px; white-space: nowrap;
  transform: rotate(-12deg); transform-origin: left bottom;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.2;
  color: #fff; -webkit-text-fill-color: #fff; background: linear-gradient(135deg, #8b7bf2, #6a59e0); border-radius: 5px;
  box-shadow: 0 2px 6px rgb(106 89 224 / 0.35);
}
