/* ============================================================
   AI STACK
   ------------------------------------------------------------
   No borders anywhere: separation comes from elevation. That
   only works if the page is meaningfully darker than the cards,
   so the canvas is a cream off-white and cards are pure white.
   Accent is a deep forest green, used on the hero band, active
   filters, search matches and stars.
   ============================================================ */

:root {
  /* canvas */
  --bg:         #f6f6f3;   /* cream page — cards float on this */
  --surface:    #ffffff;   /* cards, panels, search */
  --surface-2:  #eeeeea;   /* quiet fills: tags, logo tiles, hovers */
  --surface-3:  #e5e5e0;   /* pressed / stronger fill */

  /* ink */
  --ink:        #171a18;
  --ink-soft:   #5f665f;
  --ink-faint:  #8d938c;

  /* accent */
  --accent:      #1f6f52;
  --accent-deep: #17543e;
  --accent-tint: #e7f2ed;
  --accent-tint-2: #d5e8de;
  --on-accent:  #ffffff;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  /* Type scale — named by role, not by number, so the rules survive
     future edits. Nine steps replace the 17 ad-hoc sizes this file
     used to carry. Nothing should introduce a size outside this set. */
  --text-display: clamp(2.1rem, 5.2vw, 3.4rem);
  --text-2xl: 19px;   /* panel title            */
  --text-xl:  17px;   /* empty-state title      */
  --text-lg:  16px;   /* inputs — the iOS floor */
  --text-md:  15px;   /* card title, body base  */
  --text-base:14px;   /* panel body             */
  --text-sm:  13px;   /* card body, secondary   */
  --text-xs:  12px;   /* meta, counts           */
  --text-2xs: 11px;   /* uppercase labels, tags */

  --r-sm: 9px;
  --r:    14px;
  --r-lg: 20px;
  --pad:  clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* elevation — doing the job borders used to */
  --e-1: 0 1px 2px rgba(23,26,24,.05), 0 3px 8px -2px rgba(23,26,24,.09);
  --e-2: 0 1px 2px rgba(23,26,24,.05), 0 8px 20px -8px rgba(23,26,24,.12);
  --e-3: 0 2px 4px rgba(23,26,24,.06), 0 16px 32px -12px rgba(23,26,24,.18);
  --e-4: 0 24px 60px -18px rgba(23,26,24,.30);
  --ring: 0 0 0 3px var(--accent-tint-2);
}

[data-theme="dark"] {
  /* shadows barely read on dark, so surfaces lift by lightness instead */
  --bg:         #0f120f;
  --surface:    #191d1a;
  --surface-2:  #232823;
  --surface-3:  #2d332d;

  --ink:        #eef0ed;
  --ink-soft:   #9aa198;
  --ink-faint:  #6d746c;

  --accent:      #4fbf8f;
  --accent-deep: #6ed3a6;
  --accent-tint: #16301f;
  --accent-tint-2: #1e4630;
  --on-accent:  #0b1a12;

  --e-1: 0 1px 2px rgba(0,0,0,.4);
  --e-2: 0 2px 8px rgba(0,0,0,.45);
  --e-3: 0 8px 24px rgba(0,0,0,.55);
  --e-4: 0 24px 60px -18px rgba(0,0,0,.75);
  --ring: 0 0 0 3px var(--accent-tint-2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s var(--ease), color .25s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
em { font-family: var(--serif); font-style: italic; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- TOPBAR ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem var(--pad);
  background: transparent;
  transition: box-shadow .3s var(--ease), background .3s var(--ease),
              backdrop-filter .3s var(--ease);
}
/* Once you scroll it frosts whatever is behind it rather than laying
   a flat panel over it, so there is no hard edge against the band. */
.topbar.is-float {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  box-shadow: var(--e-1);
}

.brand { display: flex; align-items: center; gap: .5rem; flex: none; }
/* Three stacked plates: the name, drawn. Top plate solid, the two
   beneath falling away — reads at 20px and as a favicon. */
.brand__mark { width: 21px; height: 21px; flex: none; color: var(--accent); display: block; }
.brand__mark .plate-2 { opacity: .55; }
.brand__mark .plate-3 { opacity: .28; }
.brand:hover .brand__mark .plate-2 { opacity: .75; }
.brand:hover .brand__mark .plate-3 { opacity: .5; }
.brand__mark .plate-2, .brand__mark .plate-3 { transition: opacity .25s var(--ease); }
.brand__name { font-weight: 600; letter-spacing: -0.022em; font-size: var(--text-md); }

.topbar__search {
  flex: 1; max-width: 440px; margin: 0 auto;
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem;
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--e-1);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.topbar__search.is-on { opacity: 1; transform: none; pointer-events: auto; }
.topbar__search .ic { color: var(--ink-faint); width: 16px; height: 16px; }
.topbar__search input { flex: 1; border: none; background: none; outline: none; font-size: var(--text-base); min-width: 0; }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; flex: none; }
.count { color: var(--ink-faint); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }

.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-soft);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.ic--moon { display: none; }
[data-theme="dark"] .ic--sun { display: none; }
[data-theme="dark"] .ic--moon { display: block; }

/* ---------------- HERO ----------------
   Full-bleed tinted band. The colour carries the width, so the
   margins stop reading as empty space. */
.hero {
  position: relative;
  margin-top: -3.4rem;            /* slide under the translucent topbar */
  padding: 7rem var(--pad) 3.25rem;
  background:
    radial-gradient(115% 130% at 50% -10%,
      var(--accent-tint-2) 0%,
      var(--accent-tint) 38%,
      color-mix(in srgb, var(--accent-tint) 40%, var(--bg)) 68%,
      var(--bg) 100%);
  text-align: center;
}

.hero__inner { max-width: 1000px; margin: 0 auto; }

.hero__title {
  font-size: var(--text-display);
  font-weight: 500; letter-spacing: -0.035em; line-height: 1.06;
  text-wrap: balance;
}
.hero__title em { font-weight: 400; color: var(--accent); }

.hero__sub {
  margin: .9rem auto 0; max-width: 54ch;
  color: var(--ink-soft); font-size: var(--text-md);
  text-wrap: pretty;
}

.searchbox {
  position: relative;
  display: flex; align-items: center; gap: .8rem;
  width: 100%; max-width: 820px;
  margin: 2.1rem auto 0; padding: 1.05rem 1.25rem;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--e-3);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}
.searchbox:focus-within { box-shadow: var(--e-3), var(--ring); }
.searchbox .ic { color: var(--accent); width: 20px; height: 20px; }
.searchbox input {
  flex: 1; border: none; background: none; outline: none;
  font-size: var(--text-lg); letter-spacing: -0.01em; min-width: 0;
}
.searchbox input::placeholder { color: var(--ink-faint); }
.searchbox input::-webkit-search-cancel-button { display: none; }

.searchbox__clear {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; color: var(--ink-faint); flex: none;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.searchbox__clear[hidden] { display: none; }
.searchbox__clear:hover { background: var(--surface-2); color: var(--ink); }
.searchbox__clear .ic { width: 14px; height: 14px; }

.searchbox__kbd {
  flex: none; font-family: var(--font); font-size: var(--text-xs); color: var(--ink-faint);
  background: var(--surface-2); border-radius: 6px;
  padding: 2px 8px; line-height: 1.5;
}
.searchbox:focus-within .searchbox__kbd { display: none; }

.suggestions {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: .45rem; margin-top: 1.15rem;
}
.suggestions__label { color: var(--ink-soft); font-size: var(--text-sm); margin-right: .15rem; }
.sugg {
  font-size: var(--text-sm); color: var(--accent-deep); font-weight: 500;
  padding: .34rem .8rem; border-radius: 100px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: var(--e-1);
  transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.sugg:hover {
  background: var(--surface); transform: translateY(-1px);
  box-shadow: var(--e-2);
}

/* ---------------- LAYOUT ---------------- */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 1.75rem var(--pad) 4rem;
  max-width: 1440px; margin: 0 auto;
  align-items: start;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar { position: sticky; top: 76px; display: grid; gap: 1.6rem; }
.sidebar__title {
  font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-faint); margin-bottom: .55rem;
}
.catlist { display: grid; gap: 2px; }
.cat {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; text-align: left;
  padding: .42rem .6rem; border-radius: var(--r-sm);
  font-size: var(--text-sm); color: var(--ink-soft);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.cat:hover { background: var(--surface-2); color: var(--ink); }
.cat.is-on { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.cat__n { font-size: var(--text-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cat.is-on .cat__n { color: var(--accent); }
.cat.is-empty { opacity: .32; pointer-events: none; }

.pricefilter { display: flex; flex-wrap: wrap; gap: .35rem; }
.price {
  font-size: var(--text-xs); color: var(--ink-soft);
  padding: .3rem .7rem; border-radius: 100px;
  background: var(--surface-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.price:hover { background: var(--surface-3); color: var(--ink); }
.price.is-on { background: var(--accent); color: var(--on-accent); }

.resetbtn {
  justify-self: start; font-size: var(--text-sm); color: var(--accent);
  font-weight: 500;
}
.resetbtn:hover {
  color: var(--accent-deep); text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: from-font; text-underline-position: from-font;
}

/* ---------------- RESULTS ---------------- */
.results__bar {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin-bottom: 1rem; min-height: 30px;
}
.results__count { font-size: var(--text-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.results__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: var(--text-xs); padding: .26rem .55rem .26rem .65rem;
  border-radius: 100px; white-space: nowrap;
  background: var(--accent-tint); color: var(--accent-deep); font-weight: 500;
  transition: background .15s var(--ease);
}
.chip .ic { width: 12px; height: 12px; }
.chip:hover { background: var(--accent-tint-2); }

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

/* ---------------- CARD ---------------- */
.card {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.1rem 1.15rem .95rem;
  text-align: left; cursor: pointer;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--e-1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--e-3); }

.card__top { display: flex; align-items: flex-start; gap: .5rem; }
.card__logo {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft);
  letter-spacing: -0.02em;
}
.card__name {
  font-size: var(--text-md); font-weight: 600; line-height: 1.3;
  text-wrap: balance; overflow-wrap: break-word;
  flex: 1 1 auto;          /* keep min-content width: never break mid-word */
}
.card__price {
  flex: none; white-space: nowrap;
  font-size: var(--text-2xs); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-faint);
}
.card__price::after { content: ' \00b7'; color: var(--ink-faint); }
.card__price[data-p="free"] { color: var(--accent); }

.card__tagline {
  font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.5;
  text-wrap: pretty; overflow-wrap: break-word;
}

.card__best {
  font-size: var(--text-xs); color: var(--ink-faint);
  display: flex; align-items: baseline; gap: .4rem;
  text-wrap: pretty;
}
.card__best b { color: var(--ink-soft); font-weight: 600; flex: none; }

.card__tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .5rem; }
.tag {
  font-size: var(--text-2xs); color: var(--ink-soft);
  padding: .15rem .5rem; border-radius: 6px;
  background: var(--surface-2);
  overflow-wrap: break-word; max-width: 100%;
}
.tag--hit { background: var(--accent-tint); color: var(--accent-deep); font-weight: 500; }

.card__foot {
  display: flex; align-items: center; gap: .35rem;
  margin-top: .55rem; padding-top: .6rem;
  font-size: var(--text-xs); color: var(--ink-faint);
}
.card__out { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__go {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: .25rem;
  color: var(--accent); font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
}
.card__go .ic { width: 13px; height: 13px; }
.card:hover .card__go { color: var(--accent-deep); }

/* ---------------- EMPTY ---------------- */
.empty { padding: 4rem 0; text-align: center; }
.empty__title { font-size: var(--text-xl); font-weight: 500; }
.empty__text {
  margin: .4rem auto 0; max-width: 58ch;
  color: var(--ink-soft); font-size: var(--text-base);
  text-wrap: pretty;
}
.empty__text em { color: var(--accent); font-style: italic; }

/* ---------------- DETAIL PANEL ---------------- */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,18,15,.32);
  backdrop-filter: blur(2px);
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0 } }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(430px, 100%);
  background: var(--surface);
  box-shadow: var(--e-4);
  overflow-y: auto;
  padding: 1.6rem 1.7rem 2.5rem;
  animation: slide .28s var(--ease);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0 } }

.panel__close {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-faint);
}
.panel__close:hover { background: var(--surface-2); color: var(--ink); }

.panel__head { display: flex; align-items: center; gap: .8rem; padding-right: 4.5rem; }
.panel__logo {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: var(--surface-2);
  font-size: var(--text-lg); font-weight: 600; color: var(--ink-soft);
}
.panel__name {
  font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
  text-wrap: balance; overflow-wrap: break-word;
}
.panel__meta { font-size: var(--text-xs); color: var(--ink-faint); margin-top: .1rem; }
.panel__tagline {
  margin-top: 1rem; font-size: var(--text-base); color: var(--ink-soft); line-height: 1.6;
  text-wrap: pretty;
}

.panel__section { margin-top: 1.6rem; }
.panel__label {
  font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-faint); margin-bottom: .6rem;
}
.panel__list { display: grid; gap: .45rem; list-style: none; }
.panel__list li {
  display: flex; gap: .55rem; font-size: var(--text-base); color: var(--ink); line-height: 1.5;
  text-wrap: pretty;
}
.panel__list li::before { content: '\2192'; color: var(--accent); flex: none; }

.panel__chips { display: flex; flex-wrap: wrap; gap: .35rem; }

.panel__cta {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1.75rem; padding: .85rem 1rem;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-sm); font-size: var(--text-base); font-weight: 600;
  box-shadow: var(--e-1);
  transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.panel__cta:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--e-2); }
.panel__cta .ic { width: 15px; height: 15px; }

/* ---------------- DEFAULT PICK ---------------- */
/* Marks the tool to reach for first in its category, so a result list
   of six equally valid options still has an obvious starting point. */
.card__pick, .panel__pick {
  font-size: var(--text-2xs); font-weight: 600;
  letter-spacing: .03em; white-space: nowrap;
  padding: .2rem .5rem; border-radius: 6px;
  background: var(--accent); color: var(--on-accent);
}
.card__pick { margin-left: auto; align-self: center; }
.panel__pick { padding: .1rem .4rem; }

/* ---------------- LOGOS ---------------- */
.card__logo, .panel__logo { position: relative; overflow: hidden; }
.card__logo img, .panel__logo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; padding: 3px;
  background: #fff; border-radius: inherit;
}
.panel__logo img { padding: 5px; }
[data-theme="dark"] .card__logo img,
[data-theme="dark"] .panel__logo img { background: #f2f2ee; }

/* ---------------- STARS & NOTES ---------------- */
.star {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin: -3px -4px -3px .15rem;
  border-radius: 50%; color: var(--ink-faint);
  transition: color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.star .ic { width: 15px; height: 15px; }
.star:hover { background: var(--accent-tint); color: var(--accent); transform: scale(1.12); }
.star.is-on { color: var(--accent); }
.star.is-on .ic { fill: var(--accent); }

.card__note {
  display: inline-flex; align-items: center; gap: .25rem;
  color: var(--accent); font-size: var(--text-2xs); font-weight: 500; white-space: nowrap;
}
.card__note .ic { width: 12px; height: 12px; }

.cat--star { width: 100%; }
.cat--star span:first-child { display: inline-flex; align-items: center; gap: .4rem; }
.cat--star .ic { width: 13px; height: 13px; }
.cat--star.is-on .ic { fill: currentColor; }
.cat--star[hidden] { display: none; }

.panel__star { position: absolute; top: 1.1rem; right: 3.1rem; }
.panel__star .star { width: 30px; height: 30px; margin: 0; }
.panel__star .star .ic { width: 17px; height: 17px; }

.notes {
  width: 100%; resize: vertical; min-height: 86px;
  padding: .7rem .8rem;
  font-family: inherit; font-size: var(--text-sm); line-height: 1.55;
  overflow-wrap: break-word;
  color: var(--ink); background: var(--surface-2);
  border: none; border-radius: var(--r-sm); outline: none;
  transition: box-shadow .18s var(--ease);
}
.notes::placeholder { color: var(--ink-faint); }
.notes:focus { box-shadow: var(--ring); }
.notes__hint { margin-top: .35rem; font-size: var(--text-2xs); color: var(--ink-faint); }

/* ---------------- ADD / EDIT FORM ---------------- */
.form { margin-top: 1.4rem; display: grid; gap: 1.1rem; }

.f { display: grid; gap: .35rem; }
.f__label {
  font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-faint);
}
.f__input {
  width: 100%; padding: .6rem .75rem;
  font-size: var(--text-base);
  color: var(--ink); background: var(--surface-2);
  border: none; border-radius: var(--r-sm); outline: none;
  transition: box-shadow .18s var(--ease);
}
.f__input::placeholder { color: var(--ink-faint); }
.f__input:focus { box-shadow: var(--ring); }
.f__hint { font-size: var(--text-2xs); color: var(--ink-faint); }

.f__cats { display: flex; flex-wrap: wrap; gap: .3rem; }
.f__cat {
  font-size: var(--text-xs); color: var(--ink-soft);
  padding: .28rem .6rem; border-radius: 100px;
  background: var(--surface-2); white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.f__cat:hover { background: var(--surface-3); color: var(--ink); }
.f__cat.is-on { background: var(--accent); color: var(--on-accent); font-weight: 500; }

.f__err {
  font-size: var(--text-sm); color: #b3261e;
  background: color-mix(in srgb, #b3261e 8%, transparent);
  padding: .55rem .7rem; border-radius: var(--r-sm);
}
[data-theme="dark"] .f__err { color: #ff9c92; }
.f__err[hidden] { display: none; }

.f__row { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.f__danger { color: #b3261e; }
[data-theme="dark"] .f__danger { color: #ff9c92; }

/* marks a tool you added yourself, which lives only in this browser */
.card__mine {
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: .03em;
  white-space: nowrap; padding: .2rem .5rem; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-soft);
}
.card__pick + .card__mine { margin-left: .3rem; }
.card__mine:first-of-type { margin-left: auto; }

/* ---------------- FOOT ---------------- */
.foot {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  justify-content: space-between;
  padding: 1.75rem var(--pad) 3rem;
  color: var(--ink-faint); font-size: var(--text-xs);
}
.foot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-xs); background: var(--surface-2);
  padding: .1rem .35rem; border-radius: 5px;
}
.foot__link { color: var(--accent); font-weight: 500; }
.foot__link:hover {
  color: var(--accent-deep); text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: from-font; text-underline-position: from-font;
}
.foot__backup { display: inline-flex; align-items: center; gap: .5rem; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero { padding-top: 6rem; padding-bottom: 2.5rem; }
  .sidebar {
    position: static;
    display: flex; gap: 1rem; overflow-x: auto;
    padding-bottom: .5rem; scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar__block { flex: none; }
  .sidebar__title { display: none; }
  .catlist { display: flex; gap: .35rem; }
  .cat {
    background: var(--surface); box-shadow: var(--e-1);
    border-radius: 100px; white-space: nowrap;
    padding: .34rem .75rem; font-size: var(--text-sm);
  }
  .cat.is-on { background: var(--accent); color: var(--on-accent); }
  .cat.is-on .cat__n { color: var(--on-accent); opacity: .65; }
  .cat.is-empty { display: none; }
  .pricefilter { flex-wrap: nowrap; }
  .resetbtn { display: none; }
  .topbar__search { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); }
}

@media (max-width: 560px) {
  /* iOS Safari zooms the whole page when an input is below 16px */
  .notes, .searchbox input, .topbar__search input, .f__input { font-size: var(--text-lg); }
  .hero { padding-top: 5.25rem; }
  .grid { grid-template-columns: 1fr; }
  .panel { width: 100%; }
  .foot { flex-direction: column; }
  .searchbox { padding: .9rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
