:root {
  --page: #fff8ef;
  --paper: #fff;
  --ink: #332118;
  --muted: #74665d;
  --line: #eadbca;
  --brand: #ffad20;
  --brand-strong: #aa4709;
  --brand-deep: #7e3108;
  --cream: #fff0d4;
  --pet: #e86b24;
  --baby: #e25488;
  --shadow: 0 10px 28px rgba(90, 57, 29, 0.1);
  --float-shadow: 0 22px 58px rgba(54, 31, 14, 0.24);
  --gutter: clamp(12px, 4vw, 16px);
  color: var(--ink);
  font-family: var(--font-ui, system-ui, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", sans-serif);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #eee4d8;
  scroll-behavior: smooth;
  scrollbar-width: none;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar { width: 0; height: 0; }
body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #eee4d8;
}
body.has-sheet-open { overflow: hidden; }
button, input { font: inherit; }
button, a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { min-height: 44px; cursor: pointer; }
a { text-decoration: none; }
img, video { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 50%;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand-deep);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
  transform: translate(-50%, -150%);
}
.skip-link:focus { transform: translate(-50%, 0); }

.template-app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  overflow-x: clip;
  background:
    radial-gradient(circle at 100% 12%, rgba(255, 211, 111, 0.2), transparent 26%),
    linear-gradient(180deg, #fffdf8 0%, var(--page) 48%, #f7eee4 100%);
  box-shadow: none;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 9px;
  align-items: center;
  min-height: 62px;
  padding: max(8px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 7px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(255, 245, 207, 0.94);
  border-bottom: 1px solid rgba(229, 190, 119, 0.42);
  backdrop-filter: blur(18px) saturate(1.1);
}
.back-link,
.template-counter {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid #ecd8bf;
  border-radius: 50%;
  box-shadow: 0 7px 15px rgba(99, 64, 31, 0.09);
}
.back-link img {
  width: 19px;
  height: 19px;
  filter: sepia(1) saturate(2.2) hue-rotate(344deg) brightness(0.7);
  transform: rotate(180deg);
}
.template-counter {
  width: 44px;
  height: 44px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #efc567, 0 8px 16px rgba(91, 56, 25, 0.1);
}
.template-counter strong,
.template-counter small { display: block; line-height: 1; }
.template-counter strong { color: #38180a; font-size: 14px; font-weight: 850; }
.template-counter small { margin-top: 3px; color: #7b6655; font-size: 7px; font-weight: 700; }
.brand-lockup { min-width: 0; }
.brand-lockup > span { display: flex; align-items: center; gap: 6px; }
.brand-lockup strong {
  overflow: hidden;
  color: #35170a;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-lockup img { width: 19px; height: 19px; object-fit: contain; }
.brand-lockup small { display: block; margin-top: 3px; color: #78685e; font-size: 10px; font-weight: 600; }

.template-hero {
  position: relative;
  min-height: 116px;
  margin: 8px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  padding: 14px 46% 12px 14px;
  overflow: hidden;
  background: #ffc94b;
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 22px;
  box-shadow: 0 10px 22px rgba(182, 103, 12, 0.14), inset 0 0 0 1px rgba(255,255,255,.28);
  isolation: isolate;
}
.template-hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 221, 119, .95) 0%, rgba(255, 221, 119, .78) 42%, rgba(255, 210, 86, .08) 72%);
}
.hero-copy { position: relative; z-index: 2; width: 100%; }
.hero-kicker {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #66300e;
  font-size: 9px;
  font-weight: 750;
}
.hero-kicker i {
  width: 7px;
  height: 7px;
  background: #e74819;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(230, 72, 25, .13);
}
.template-hero h1 {
  margin: 5px 0 0;
  color: #35170a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.8px;
}
.template-hero h1 em { color: #c34a06; font-style: normal; }
.template-hero p {
  margin: 6px 0 0;
  color: #70441e;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}
.hero-actions { display: grid; gap: 7px; margin-top: 12px; }
.hero-actions button {
  width: max-content;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.hero-actions button:first-child {
  color: #fff;
  background: linear-gradient(135deg, #be510a, #963b07);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(143, 56, 5, .24);
}
.hero-actions button:last-child {
  color: #74300c;
  background: rgba(255, 251, 235, .9);
  border: 1px solid rgba(205, 126, 36, .56);
}
.hero-actions button span { margin-right: 3px; font-size: 9px; }
.hero-robot {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  background: #ffc94b;
  filter: saturate(1.08) contrast(1.03);
}
.hero-proof {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  background: rgba(255, 253, 245, .91);
  border: 1px solid rgba(211, 150, 67, .52);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(116, 68, 17, .09);
  backdrop-filter: blur(9px);
}
.hero-proof span {
  display: grid;
  gap: 2px;
  padding: 8px 7px;
  color: #826b58;
  border-right: 1px solid rgba(222, 189, 139, .6);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}
.hero-proof span:last-child { border-right: 0; }
.hero-proof b { color: #5d270b; font-size: 14px; font-weight: 900; }

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 17px rgba(75, 48, 27, .06);
}
.trust-strip span { color: #665950; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; }
.trust-strip b { display: inline-grid; width: 16px; height: 16px; margin-right: 3px; place-items: center; color: #fff; background: #3f9d69; border-radius: 50%; font-size: 9px; }

.browse-panel { display: grid; gap: 7px; padding: 9px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 2px 12px;
  background: #fff;
  border: 1px solid #eadbca;
  border-radius: 17px;
  box-shadow: 0 7px 20px rgba(74, 47, 24, .07);
}
.search-box:focus-within { border-color: #e2a343; box-shadow: 0 0 0 4px rgba(255, 196, 94, .18), 0 7px 20px rgba(74, 47, 24, .07); }
.search-box img { width: 22px; height: 22px; opacity: .66; }
.search-box input {
  min-width: 0;
  min-height: 44px;
  padding: 0 44px 0 0;
  color: #433027;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
}
.search-box input::placeholder { color: #8a7c72; opacity: 1; }
.search-box input::-webkit-search-cancel-button { display: none; }
#clearSearch {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: #9c4e18;
  background: #fff6e9;
  border: 0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}
.filter-rail { display: flex; gap: 6px; padding: 1px 1px 3px; overflow-x: auto; scrollbar-width: none; }
.filter-rail::-webkit-scrollbar { display: none; }
.filter-rail button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  color: #75675f;
  background: #fffaf4;
  border: 1px solid #eaddce;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
}
.filter-rail button.is-active { color: #3c210d; background: #ffad28; border-color: #ffad28; box-shadow: 0 7px 14px rgba(216, 131, 18, .17); }

.catalog-section { padding: 11px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.section-heading { display: flex; gap: 10px; align-items: end; justify-content: space-between; }
.section-heading > div { min-width: 0; }
.section-heading span { display: block; margin-bottom: 3px; color: #ad5819; font-size: 11px; font-weight: 750; }
.section-heading h2 { margin: 0; color: #392117; font-size: 18px; font-weight: 850; letter-spacing: -.3px; }
.sort-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 11px;
  color: #8b4a1d;
  background: #fff2dd;
  border: 1px solid #efd2a8;
  border-radius: 13px;
  font-size: 10px;
  font-weight: 750;
}
.result-summary { margin: 5px 0 9px; color: #7e7068; font-size: 10px; line-height: 1.45; }

.template-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.template-card {
  position: relative;
  display: grid;
  grid-template-columns: clamp(118px, 36vw, 146px) minmax(0, 1fr);
  min-width: 0;
  min-height: 164px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9dacb;
  border-radius: 18px;
  box-shadow: 0 9px 23px rgba(76, 48, 25, .08);
}
.template-card.is-featured { grid-column: auto; }
.card-media {
  position: relative;
  min-height: 164px;
  aspect-ratio: auto;
  overflow: hidden;
  background: #281c17;
}
.template-card.is-featured .card-media { aspect-ratio: auto; }
.card-media img,
.card-media video { width: 100%; height: 100%; }
.card-media img { object-fit: cover; }
.card-media video { object-fit: contain; background: #1c1511; }
.card-media::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 48%;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(22, 14, 8, .68));
}
.lane-badge,
.duration-badge {
  position: absolute;
  z-index: 3;
  top: 9px;
  padding: 6px 8px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(30, 18, 9, .16);
  font-size: 9px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.lane-badge { left: 9px; background: rgba(209, 74, 113, .86); }
.template-card[data-lane="pet"] .lane-badge { background: rgba(217, 92, 27, .88); }
.duration-badge { right: 9px; background: rgba(40, 29, 21, .65); }
.preview-button {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  gap: 0;
  align-items: flex-end;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  justify-content: flex-end;
  padding: 9px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.preview-button span { display: none; }
.preview-button i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding-left: 1px;
  color: #6b2d09;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(30, 18, 9, .24);
  font-size: 10px;
  font-style: normal;
  backdrop-filter: blur(9px);
}
.preview-button.is-playing i,
.preview-button.is-loading i { padding-left: 0; }
.preview-button.is-loading i { animation: preview-pulse .8s ease-in-out infinite alternate; }
@keyframes preview-pulse { from { opacity: .58; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.card-body { display: flex; min-width: 0; flex-direction: column; padding: 12px 11px 11px; }
.card-body h3 {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #382319;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.38;
  letter-spacing: -.15px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.template-card.is-featured .card-body h3 { min-height: 0; font-size: 16px; }
.card-meta { display: grid; gap: 3px; margin-top: 7px; color: #826f62; font-size: 9px; font-weight: 650; }
.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta .material-meta { color: #a25a27; }
.template-card.is-featured .card-summary { display: none; }
.card-summary {
  display: none;
  margin: 7px 0 0;
  overflow: hidden;
  color: #75675e;
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-tags { display: none; gap: 5px; margin-top: 8px; overflow: hidden; }
.card-tags span {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 7px;
  color: #8a4c20;
  background: #fff2df;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actions { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; margin-top: auto; padding-top: 9px; }
.card-actions button { min-width: 0; min-height: 42px; border-radius: 13px; font-size: 11px; font-weight: 850; }
.use-button { color: #fff; background: linear-gradient(135deg, #c9550b, #a63e06); border: 0; box-shadow: 0 7px 15px rgba(166, 62, 6, .18); }
.use-button.needs-material { color: #7b3a11; background: #fff0d7; border: 1px solid #edc990; box-shadow: none; }
.detail-button { padding: 0; color: #8d4c1d; background: #fff8ee; border: 1px solid #ead8c3; }
.detail-button span { display: inline-block; transform: translateY(-1px); }

.empty-state { padding: 30px 18px; color: #6f625a; background: #fff; border: 1px dashed #ddc8b2; border-radius: 20px; text-align: center; }
.empty-state strong { color: #3d2a20; font-size: 16px; }
.empty-state p { margin: 7px 0 13px; font-size: 12px; }
.empty-state button { padding: 0 16px; color: #fff; background: #a94708; border: 0; border-radius: 13px; font-size: 12px; font-weight: 800; }

.source-note {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  gap: 12px;
  margin: 18px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  padding: 14px;
  background: #fff;
  border: 1px solid #ead9c7;
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(73, 45, 23, .07);
}
.source-icon { display: grid; width: 42px; height: 42px; place-items: center; color: #8b4616; background: #ffe5b3; border-radius: 13px; font-size: 14px; font-weight: 900; }
.source-note h2 { margin: 0; color: #3b281e; font-size: 14px; }
.source-note p { margin: 5px 0 8px; color: #76675f; font-size: 10px; line-height: 1.55; }
.source-note a { color: #a64d12; font-size: 10px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.template-sheet {
  width: min(100%, 430px);
  max-width: 430px;
  height: min(94dvh, 880px);
  max-height: 94dvh;
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fffaf4;
  border: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--float-shadow);
}
.template-sheet::backdrop { background: rgba(38, 25, 17, .58); backdrop-filter: blur(3px); }
.template-sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.sheet-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 7px 16px; background: rgba(255, 246, 226, .96); border-bottom: 1px solid #ecdcc8; }
.sheet-header span { color: #6e3b19; font-size: 11px; font-weight: 800; }
.sheet-header button { min-height: 40px; padding: 0 12px; color: #7b5d49; background: #fff; border: 1px solid #e7d7c6; border-radius: 12px; font-size: 11px; font-weight: 750; }
.sheet-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet-preview { position: relative; height: clamp(240px, 42dvh, 360px); overflow: hidden; background: #15100d; }
.sheet-preview video,
.sheet-preview img { width: 100%; height: 100%; }
.sheet-preview video { object-fit: contain; }
.sheet-preview img { object-fit: cover; }
.sheet-preview .no-video {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 9px;
  color: #fff;
  background: rgba(34, 23, 17, .74);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}
.sheet-content { padding: 16px 16px 24px; }
.sheet-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-badges span { padding: 6px 8px; color: #8a4719; background: #fff0d9; border: 1px solid #efcf9f; border-radius: 999px; font-size: 9px; font-weight: 800; }
.sheet-content > h2 { margin: 10px 0 0; color: #352118; font-size: 23px; font-weight: 900; line-height: 1.22; letter-spacing: -.55px; }
.sheet-summary { margin: 7px 0 0; color: #71635b; font-size: 12px; line-height: 1.6; }
.template-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 14px 0 0; }
.template-facts div { min-width: 0; padding: 10px; background: #fff; border: 1px solid #ebddcf; border-radius: 13px; }
.template-facts dt { color: #927c6d; font-size: 9px; font-weight: 700; }
.template-facts dd { margin: 3px 0 0; overflow: hidden; color: #493226; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.material-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 12px; padding: 12px; background: linear-gradient(135deg, #fff3dc, #fffbf5); border: 1px solid #efce9d; border-radius: 16px; }
.material-card span { color: #a4571d; font-size: 9px; font-weight: 750; }
.material-card h3 { margin: 2px 0 0; color: #4a2c18; font-size: 14px; }
.material-card ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.material-card li { padding: 7px 9px; color: #704a2f; background: #fff; border: 1px solid #ead6ba; border-radius: 10px; font-size: 10px; font-weight: 700; }
.advanced-settings { margin-top: 12px; background: #fff; border: 1px solid #eadbcd; border-radius: 16px; }
.advanced-settings summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary span { display: grid; gap: 3px; }
.advanced-settings summary strong { color: #3f2a20; font-size: 12px; }
.advanced-settings summary small { color: #80726a; font-size: 9px; }
.advanced-settings summary b { color: #a54b10; font-size: 10px; }
.advanced-settings[open] summary { border-bottom: 1px solid #eadbcd; }
.advanced-settings[open] summary b { font-size: 0; }
.advanced-settings[open] summary b::after { content: "收起"; font-size: 10px; }
.prompt-panel { padding: 10px; }
.prompt-panel > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.prompt-panel span { color: #876f60; font-size: 9px; font-weight: 750; }
.prompt-panel button { min-height: 36px; padding: 0 11px; color: #914511; background: #fff1db; border: 1px solid #ebcd9f; border-radius: 10px; font-size: 10px; font-weight: 800; }
.prompt-panel pre { max-height: 360px; margin: 0; padding: 12px; overflow: auto; color: #4a352a; background: #fffaf3; border: 1px solid #eee0d2; border-radius: 12px; font: 11px/1.7 var(--font-ui, system-ui, sans-serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.external-media-note { margin: 11px 2px 0; color: #8b7b71; font-size: 9px; line-height: 1.5; }
.sheet-actions { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 252, 247, .97); border-top: 1px solid #e8d8c9; box-shadow: 0 -10px 24px rgba(72, 44, 23, .08); }
.sheet-actions a,
.sheet-actions button { display: grid; min-height: 48px; place-items: center; border-radius: 15px; font-size: 12px; font-weight: 850; }
.sheet-actions a { color: #86502a; background: #fff; border: 1px solid #e7d7c6; }
.sheet-actions button { color: #fff; background: linear-gradient(135deg, #c8520a, #9f3b05); border: 0; box-shadow: 0 9px 19px rgba(159, 59, 5, .2); }
.sheet-actions button.needs-material { color: #7a390f; background: #ffe9c3; border: 1px solid #e9c17f; box-shadow: none; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 430px;
  min-height: 72px;
  margin: 0 auto;
  padding: 6px 7px calc(5px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .985);
  border: 1px solid rgba(231, 219, 205, .88);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -14px 32px rgba(82, 52, 24, .13);
  backdrop-filter: blur(20px) saturate(1.2);
}
.bottom-nav > a { display: grid; gap: 3px; place-items: center; min-width: 44px; min-height: 54px; padding: 4px 2px; color: #756b64; border: 1px solid transparent; border-radius: 18px; }
.bottom-nav > a.is-active { color: #ff6f00; background: linear-gradient(180deg, rgba(255, 240, 205, .82), rgba(255, 249, 238, .42)); border-color: rgba(230, 177, 92, .42); }
.bottom-nav img { width: 22px; height: 22px; object-fit: contain; opacity: .72; filter: grayscale(.25) saturate(.78); }
.bottom-nav > a.is-active img { opacity: 1; filter: sepia(1) saturate(7) hue-rotate(347deg) brightness(1.07); }
.bottom-nav small { color: inherit; font-size: 12px; font-weight: 650; }
.bottom-nav .assistant-nav-link { position: relative; align-content: end; min-height: 54px; overflow: visible; padding-bottom: 3px; }
.bottom-nav .assistant-nav-link img { position: absolute; top: -20px; left: 50%; width: 48px; height: 48px; padding: 3px; object-fit: cover; object-position: 76% 34%; background: #f4eee7; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #e5d8cb, 0 8px 18px rgba(82, 52, 24, .14); filter: saturate(.72); opacity: .9; transform: translateX(-50%); }
.bottom-nav .assistant-nav-link small { color: #352419; font-size: 11px; font-weight: 800; }

.toast { position: fixed; z-index: 70; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 30px); padding: 11px 15px; color: #fff; background: #4a2d1c; border-radius: 13px; box-shadow: var(--float-shadow); font-size: 11px; font-weight: 700; text-align: center; transform: translateX(-50%); }
:focus-visible { outline: 3px solid rgba(169, 72, 8, .34); outline-offset: 2px; }

@media (max-width: 355px) {
  .template-hero { min-height: 110px; padding-right: 44%; }
  .template-hero h1 { font-size: 22px; }
  .filter-rail { gap: 5px; }
  .filter-rail button { padding-inline: 10px; }
  .template-card { grid-template-columns: 112px minmax(0, 1fr); min-height: 158px; }
  .card-media { min-height: 158px; }
  .card-body { padding: 10px 9px 9px; }
  .card-body h3,
  .template-card.is-featured .card-body h3 { font-size: 15px; }
  .card-actions { grid-template-columns: minmax(0, 1fr) 38px; }
}
@media (min-width: 431px) {
  .template-app { box-shadow: 0 0 0 1px rgba(112, 80, 47, 0.06), 0 28px 80px rgba(72, 49, 28, 0.16); }
  .template-sheet { margin-bottom: max(14px, env(safe-area-inset-bottom)); border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
