/* =========================================================
   Shared site styles
   Theme is driven by attributes on <html>:
     data-mode   = auto | light | dark | sepia
     data-accent = blue | green | purple | orange | rose | graphite | yellow
     data-font   = system | inter | lora | nunito | mono
     data-bg     = plain | gradient | mesh | waves | paper
     data-size   = small | medium | large
   ========================================================= */

/* ---------- Color modes ---------- */
:root,
html[data-mode="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1a1d23;
  --muted: #5b6270;
  --border: #e2e5ea;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --accent-mix: 0%;          /* how much to lighten accent (used in dark) */
  --on-accent: #ffffff;
  color-scheme: light;
}

html[data-mode="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --text: #e8eaee;
  --muted: #9aa1ad;
  --border: #2a2f3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  --accent-mix: 35%;
  --on-accent: #0f1115;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-mode="auto"] {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --border: #2a2f3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
    --accent-mix: 35%;
    --on-accent: #0f1115;
    color-scheme: dark;
  }
}

html[data-mode="sepia"] {
  --bg: #f3ead6;
  --surface: #fbf6ea;
  --surface-2: #efe4ca;
  --text: #3b2f20;
  --muted: #6e5c44;
  --border: #e0d2b2;
  --shadow: 0 1px 2px rgba(80, 60, 20, 0.06), 0 4px 16px rgba(80, 60, 20, 0.08);
  --accent-mix: 0%;
  --on-accent: #ffffff;
  color-scheme: light;
}

/* ---------- Accent colors ---------- */
:root { --accent-base: #1f6fc5; }
/* Blue is "azzurro" (Italian sky blue): #1f6fc5 in light modes, a paler partner in dark mode
   with dark text on top. Both pass WCAG AA contrast for text. */
html[data-accent="blue"]   { --accent-base: #1f6fc5; }
html[data-mode="dark"][data-accent="blue"] { --accent-base: #7fb3f0; --accent-mix: 0%; }
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="blue"] { --accent-base: #7fb3f0; --accent-mix: 0%; }
}
html[data-accent="green"]  { --accent-base: #16a34a; }
html[data-accent="purple"] { --accent-base: #7c3aed; }
html[data-accent="orange"] { --accent-base: #ea580c; }
html[data-accent="rose"]   { --accent-base: #e11d48; }
html[data-accent="graphite"] { --accent-base: #475569; }
/* Yellow is light, so it gets dark text on top and a deeper gold in light modes for readability. */
html[data-accent="yellow"] { --accent-base: #ca8a04; --on-accent: #1a1d23; }
html[data-mode="dark"][data-accent="yellow"] { --accent-base: #eab308; --accent-mix: 10%; }
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="yellow"] { --accent-base: #eab308; --accent-mix: 10%; }
}


:root {
  --accent: color-mix(in srgb, var(--accent-base), #ffffff var(--accent-mix));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ---------- Fonts ---------- */
:root { --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
html[data-font="inter"]  { --font-body: "Inter", system-ui, sans-serif; }
html[data-font="lora"]   { --font-body: "Lora", Georgia, "Times New Roman", serif; }
html[data-font="nunito"] { --font-body: "Nunito", system-ui, sans-serif; }
html[data-font="mono"]   { --font-body: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Text size ---------- */
html { font-size: 16px; }
html[data-size="small"] { font-size: 15px; }
html[data-size="large"] { font-size: 18px; }

/* ---------- Backgrounds ---------- */
body {
  background-color: var(--bg);
  background-attachment: fixed;
}
html[data-bg="gradient"] body {
  background-image:
    radial-gradient(900px 600px at 0% 0%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%),
    radial-gradient(800px 600px at 100% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(900px 500px at 30% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
}
/* Mesh: soft multi-color blobs. Extra hues are derived from the accent;
   browsers without relative-color support fall back to the accent itself. */
:root { --mesh-2: var(--accent); --mesh-3: var(--accent); }
:root {
  --mesh-2: oklch(from var(--accent) l c calc(h + 60));
  --mesh-3: oklch(from var(--accent) l c calc(h - 60));
}
html[data-bg="mesh"] body {
  background-image:
    radial-gradient(at 12% 8%, color-mix(in srgb, var(--accent) 30%, transparent) 0, transparent 45%),
    radial-gradient(at 88% 12%, color-mix(in srgb, var(--mesh-2) 26%, transparent) 0, transparent 45%),
    radial-gradient(at 80% 88%, color-mix(in srgb, var(--mesh-3) 24%, transparent) 0, transparent 50%),
    radial-gradient(at 8% 92%, color-mix(in srgb, var(--mesh-2) 18%, transparent) 0, transparent 45%);
}

/* Waves and Paper use fixed layers behind the page content. */
html[data-bg="waves"] body::before,
html[data-bg="waves"] body::after,
html[data-bg="paper"] body::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
}

/* Waves: two layered waves in the accent color along the bottom. */
html[data-bg="waves"] body::before {
  height: 46vh;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath d='M0 150C240 230 480 70 720 120S1200 260 1440 180V320H0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath d='M0 150C240 230 480 70 720 120S1200 260 1440 180V320H0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
html[data-bg="waves"] body::after {
  height: 32vh;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath d='M0 210C320 140 560 280 880 230S1280 150 1440 170V320H0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath d='M0 210C320 140 560 280 880 230S1280 150 1440 170V320H0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}

/* Paper: a fine grain texture, like quality stationery. */
html[data-bg="paper"] body::before {
  top: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.12;
}
html[data-mode="dark"][data-bg="paper"] body::before { filter: invert(1); opacity: 0.1; }
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-bg="paper"] body::before { filter: invert(1); opacity: 0.1; }
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -40px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

/* Phones: no double-tap zoom (fast taps on keys stay taps); pinch-to-zoom still works. */
html, a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid; place-items: center;
}

.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* Phone menu (hamburger), shown only when the header links are hidden */
.menu-btn { display: none; padding: 0 10px; }
.site-menu { display: none; }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-header .container { gap: 10px; }
  .theme-toggle { margin-left: auto; }
  .theme-toggle .label { display: none; }
  .menu-btn { display: inline-flex; }
  .site-menu:not([hidden]) {
    display: grid;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 6px 16px 12px;
    box-shadow: var(--shadow);
  }
  .site-menu a {
    display: block;
    padding: 14px 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }
  .site-menu a:last-child { border-bottom: 0; }
  .site-menu a:hover, .site-menu a[aria-current="page"] { color: var(--accent); text-decoration: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 28px;
}

.search {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.search svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ---------- Ad slots (placeholders until ads are live) ---------- */
.ad-slot {
  display: grid;
  place-items: center;
  margin: 24px auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.ad-slot--leaderboard { max-width: 728px; min-height: 90px; }

/* ---------- Tool categories ---------- */
main { flex: 1; }

.category { padding: 24px 0 8px; scroll-margin-top: 80px; }
.category-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.category-head h2 {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0;
}
.category-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }

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

.tool-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--accent);
}
.tool-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.tool-card h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

/* ---------- Category hubs (home page layout D) ----------
   The previous tile layout is saved in /_layouts/home-tiles.html; its .tool-card styles stay above. */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 20px 0 8px;
  align-items: stretch;
}
@media (max-width: 860px) { .hub-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
/* Ad between tiles: after Finance and Math on wide screens (full row), right after Finance on phones. */
.hub-grid > .hub-ad { grid-column: 1 / -1; margin: 0 auto; width: 100%; order: 3; }
.hub-grid > #finance { order: 1; } .hub-grid > #math { order: 2; }
.hub-grid > #converters { order: 4; } .hub-grid > #words { order: 5; }
@media (max-width: 860px) { .hub-grid > .hub-ad { order: 1; } .hub-grid > #finance { order: 0; } }
.category.hub {
  padding: 26px 26px 24px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-top: 4px solid var(--accent);
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
}
.hub-head {
  display: flex; gap: 16px; align-items: center;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.hub-icon {
  flex: none;
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.hub-head h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 0 0 3px; }
.hub-count { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.hub-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.hub-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.hub-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.hub-tool:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.hub-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-tool[hidden] { display: none; }
.hub-tool-icon {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  display: grid; place-items: center;
}
.hub-tool-icon svg { width: 18px; height: 18px; }
.hub-soon {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}
@media (max-width: 520px) {
  .category.hub { padding: 20px 16px 18px; }
  .hub-icon { width: 46px; height: 46px; }
  .hub-tools { grid-template-columns: minmax(0, 1fr); }
}

.badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Theme panel ---------- */
.theme-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.theme-backdrop.is-open { opacity: 1; }

.theme-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(360px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.theme-panel.is-open { transform: translateX(0); }

.theme-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.theme-panel header h2 { margin: 0; font-size: 1.1rem; }
.theme-body { padding: 8px 20px 20px; overflow-y: auto; flex: 1; }
.theme-section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.theme-section:last-child { border-bottom: 0; }
.theme-section h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.choice-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.choice {
  font: inherit;
  font-size: 0.85rem;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.choice:hover { background: var(--surface-2); }
.choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.font-list { display: grid; gap: 8px; }
.font-list .choice { text-align: left; padding: 10px 12px; font-size: 0.95rem; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }

.bg-preview {
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  background-color: var(--bg);
}
.bg-preview.gradient {
  background-image:
    radial-gradient(60px 40px at 0% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 75%),
    radial-gradient(50px 40px at 100% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 75%);
}
.bg-preview.mesh {
  background-image:
    radial-gradient(at 10% 10%, color-mix(in srgb, var(--accent) 55%, transparent) 0, transparent 60%),
    radial-gradient(at 90% 20%, color-mix(in srgb, var(--mesh-2) 50%, transparent) 0, transparent 60%),
    radial-gradient(at 70% 100%, color-mix(in srgb, var(--mesh-3) 50%, transparent) 0, transparent 60%);
}
.bg-preview.waves {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 48' preserveAspectRatio='none'%3E%3Cpath d='M0 24C17 34 33 14 50 22S83 36 100 26V48H0Z' fill='%23808080' fill-opacity='.35'/%3E%3Cpath d='M0 34C22 28 39 42 61 36S89 30 100 32V48H0Z' fill='%23808080' fill-opacity='.45'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.bg-preview.paper {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-choice { padding: 5px; font-size: 0.78rem; }
.bg-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }

.theme-panel footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.theme-panel footer .icon-btn { width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
