@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-italic-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #f7f2e7;
  --bg-deep: #efe6d5;
  --surface: #fffdf8;
  --surface-2: #f3ecdf;
  --ink: #1e2923;
  --ink-soft: #5d6a61;
  --ink-faint: #66706a;
  --line: #ddd3c1;
  --line-soft: #e9e1d2;
  --accent: #2f5d50;
  --accent-strong: #23473d;
  --accent-soft: #e2ece5;
  --accent-ink: #ffffff;
  --gold: #b08a4f;
  --gold-soft: #f0e3cc;
  --shadow: 0 10px 30px rgba(30, 41, 35, .07);
  --shadow-strong: 0 16px 40px rgba(30, 41, 35, .13);
  --max: 760px;
  --radius: 16px;
}

[data-theme="dark"] {
  --bg: #111613;
  --bg-deep: #0d110f;
  --surface: #1a211c;
  --surface-2: #222b25;
  --ink: #eee8db;
  --ink-soft: #aab3a8;
  --ink-faint: #8a958b;
  --line: #2e3a32;
  --line-soft: #26312a;
  --accent: #8fc0a8;
  --accent-strong: #a8d3bd;
  --accent-soft: #23352c;
  --accent-ink: #0f1b15;
  --gold: #d0a262;
  --gold-soft: #33291c;
  --shadow: 0 10px 30px rgba(0, 0, 0, .3);
  --shadow-strong: 0 16px 40px rgba(0, 0, 0, .45);
}

[data-palette="jantar"] {
  --accent: #a45c2a;
  --accent-strong: #84451d;
  --accent-soft: #f4e5d4;
  --gold: #b47a3f;
}
[data-theme="dark"][data-palette="jantar"] {
  --accent: #e2a066;
  --accent-strong: #efb37c;
  --accent-soft: #35261a;
  --accent-ink: #1e120a;
  --gold: #d5a06a;
}
[data-palette="lavanda"] {
  --accent: #6a5a94;
  --accent-strong: #544677;
  --accent-soft: #eae5f3;
  --gold: #9b7fb5;
}
[data-theme="dark"][data-palette="lavanda"] {
  --accent: #b9a7dc;
  --accent-strong: #cbbce9;
  --accent-soft: #2a2438;
  --accent-ink: #161020;
  --gold: #b79bd0;
}
[data-palette="morska"] {
  --accent: #2b6777;
  --accent-strong: #1f4f5c;
  --accent-soft: #deedf0;
  --gold: #4f8b95;
}
[data-theme="dark"][data-palette="morska"] {
  --accent: #8cc6d3;
  --accent-strong: #a7d9e4;
  --accent-soft: #1c3035;
  --accent-ink: #0c1b1f;
  --gold: #7fb9c4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html[data-text="small"] { font-size: 15px; }
html[data-text="large"] { font-size: 18px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input {
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 50% -8%, var(--accent-soft), transparent 65%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line-soft); }
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--ink);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  flex: 0 0 auto;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .005em;
}
.lang-pill {
  min-width: 48px;
  min-height: 44px;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.lang-pill:active { background: var(--accent-soft); color: var(--accent); }

.update-banner {
  background: var(--accent);
  color: var(--accent-ink);
}
.update-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: .6rem 20px;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.update-text { font-size: .8rem; line-height: 1.35; }
.update-apply {
  margin-left: auto;
  min-height: 44px;
  padding: 0 .9rem;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}
.update-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: .8;
  flex: 0 0 auto;
}
.update-close svg { width: 17px; height: 17px; }

.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px calc(104px + env(safe-area-inset-bottom));
  outline: none;
}

.hero { padding: 1.6rem 0 .5rem; }
.hero h1 {
  margin: 0 0 .4rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 2.7rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -.015em;
}
.hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.55;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 58px;
  margin-top: 1.1rem;
  padding: 0 .5rem 0 .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.search-icon {
  width: 21px;
  height: 21px;
  color: var(--ink-faint);
  flex: 0 0 auto;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.search-input::placeholder { color: var(--ink-faint); }
.search-clear {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-faint);
  flex: 0 0 auto;
}
.search-clear svg { width: 16px; height: 16px; }
.search-go {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  flex: 0 0 auto;
}
.search-go svg { width: 19px; height: 19px; }

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 600;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.section { margin-top: 1.9rem; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .7rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -.005em;
}
.section-head a {
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
}
.section-kicker {
  margin: 0 0 .55rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}
.category-card {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 64px;
  padding: .7rem .8rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.category-card:active { background: var(--accent-soft); border-color: var(--accent); transform: scale(.985); }
.category-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}
.category-icon svg { width: 18px; height: 18px; }
.category-name { display: block; font-size: .8rem; font-weight: 700; line-height: 1.2; }
.category-count { display: block; margin-top: .15rem; font-size: .7rem; color: var(--ink-faint); }

.symptom-list {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.symptom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-height: 52px;
  padding: .7rem 1rem;
  border-top: 1px solid var(--line-soft);
  transition: background-color .15s ease;
}
.symptom-row:first-child { border-top: 0; }
.symptom-row:active { background: var(--accent-soft); }
.symptom-name { flex: 1; font-size: .875rem; font-weight: 600; line-height: 1.3; }
.symptom-meta { font-size: .72rem; color: var(--ink-faint); white-space: nowrap; }
.symptom-arrow { width: 15px; height: 15px; color: var(--ink-faint); flex: 0 0 auto; }

.search-page { padding-top: .4rem; }
.search-page .search-form {
  position: sticky;
  top: calc(56px + env(safe-area-inset-top));
  z-index: 20;
  margin-top: 0;
  background: var(--surface);
}
.results-head { margin: 1.3rem 0 .2rem; }
.results-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 600;
}
.results-head p { margin: .3rem 0 0; color: var(--ink-soft); font-size: .78rem; }
.result-group { margin-top: 1.3rem; }
.result-group .section-kicker { margin-bottom: .2rem; }

.remedy-row {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  transition: opacity .15s ease;
}
.remedy-row:last-child { border-bottom: 0; }
.remedy-row:active { opacity: .7; }
.rank {
  flex: 0 0 20px;
  padding-top: .1rem;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.remedy-main { flex: 1; min-width: 0; }
.remedy-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
}
.remedy-sub {
  display: block;
  margin-top: .15rem;
  color: var(--ink-soft);
  font-size: .76rem;
  line-height: 1.45;
}
.grade { display: flex; gap: 3px; padding-top: .4rem; flex: 0 0 auto; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.empty { padding: 3rem 0 1.5rem; text-align: center; }
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto .9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-icon svg { width: 24px; height: 24px; }
.empty h2 { margin: 0 0 .35rem; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 38ch; color: var(--ink-soft); font-size: .84rem; line-height: 1.55; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }

.remedy-page { padding-top: .4rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 600;
}
.back-link svg { width: 16px; height: 16px; }
.remedy-hero { display: flex; align-items: flex-start; gap: .9rem; margin-top: .2rem; }
.remedy-title { flex: 1; min-width: 0; }
.remedy-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 2.35rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.01em;
}
.remedy-title .latin {
  margin-top: .25rem;
  color: var(--ink-soft);
  font-size: .84rem;
  font-style: italic;
}
.fav-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.fav-btn svg { width: 21px; height: 21px; }
.fav-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.prose {
  margin: 1rem 0 0;
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}
.section-label {
  margin: 1.7rem 0 .55rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.keynotes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.keynotes li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .92rem;
  line-height: 1.48;
}
.keynotes li::before {
  content: "";
  position: absolute;
  left: .15rem;
  top: .55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.uses { display: grid; gap: 1.1rem; }
.use-group h3 {
  margin: 0 0 .25rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.use-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-height: 44px;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.use-row:last-child { border-bottom: 0; }
.use-name { display: block; font-size: .86rem; font-weight: 600; }
.use-note { display: block; margin-top: .1rem; max-width: 48ch; color: var(--ink-soft); font-size: .7rem; line-height: 1.4; }

.symptom-page { padding-top: .4rem; }
.symptom-page h1 {
  margin: .2rem 0 .25rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  line-height: 1.15;
  font-weight: 600;
}
.symptom-page .lede { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: .78rem; }

.browse { padding-top: .8rem; }
.browse h1 {
  margin: 0 0 .3rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}
.browse .lede { margin: 0; color: var(--ink-soft); font-size: .84rem; }
.browse-group { margin-top: 1.4rem; }
.browse-group h2 {
  margin: 0 0 .4rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.fav-page { padding-top: .8rem; }
.fav-page h1 {
  margin: 0 0 .3rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}
.fav-page .lede { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: .84rem; }
.fav-list { display: grid; gap: .6rem; }
.fav-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  transition: background-color .15s ease, border-color .15s ease;
}
.fav-card:active { background: var(--accent-soft); border-color: var(--accent); }
.fav-card .remedy-name { font-size: 1rem; }
.fav-card .remedy-sub { font-size: .72rem; }
.fav-star { color: var(--accent); flex: 0 0 auto; }
.fav-star svg { width: 18px; height: 18px; }

.settings { padding-top: .8rem; }
.settings h1 {
  margin: 0 0 .3rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}
.settings .lede { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: .84rem; }
.settings-group {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.setting { padding: .85rem 1rem; border-top: 1px solid var(--line-soft); }
.setting:first-child { border-top: 0; }
.setting-label { margin: 0 0 .55rem; font-size: .78rem; font-weight: 700; }
.segmented {
  display: flex;
  gap: .25rem;
  padding: .25rem;
  background: var(--bg-deep);
  border-radius: 12px;
}
.segmented button {
  flex: 1;
  min-height: 44px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: .74rem;
  font-weight: 700;
}
.segmented button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.palette-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .5rem .2rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 600;
  min-height: 62px;
}
.palette-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.swatch-suma { background: #2f5d50; }
.swatch-jantar { background: #a45c2a; }
.swatch-lavanda { background: #6a5a94; }
.swatch-morska { background: #2b6777; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.version-num { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink); }
.backup-row { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; align-items: center; }
.link-btn { min-height: 44px; padding: 0 .1rem; color: var(--accent); font-size: .8rem; font-weight: 700; }
.status-line { min-height: 1.1rem; margin-top: .4rem; color: var(--ink-soft); font-size: .72rem; line-height: 1.4; }
.about-text { margin: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.55; }
.version-foot { margin-top: 1.4rem; text-align: center; color: var(--ink-faint); font-size: .7rem; }

.loading { padding: 4rem 0; text-align: center; color: var(--ink-faint); font-size: .82rem; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: min(100%, var(--max));
  display: flex;
  gap: .15rem;
  padding: .5rem .7rem calc(.5rem + env(safe-area-inset-bottom));
  background: var(--bg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-soft);
}
.nav-item {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .14rem;
  border-radius: 13px;
  color: var(--ink-faint);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background-color .15s ease, color .15s ease;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 40px);
  padding: .55rem .95rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: .76rem;
  text-align: center;
  box-shadow: var(--shadow-strong);
}

@media (min-width: 560px) {
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { padding-top: 2.2rem; }
}
@media (min-width: 760px) {
  .bottom-nav {
    bottom: 16px;
    width: min(560px, calc(100% - 48px));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: .4rem .5rem;
    box-shadow: var(--shadow);
    background: var(--surface);
  }
  .main { padding-bottom: 7.5rem; }
  .topbar-inner { padding-left: 0; padding-right: 0; }
  .update-inner { padding-left: 0; padding-right: 0; }
}

@media (max-width: 360px) {
  .category-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
}

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