/* ============================================================================
   Photlin Aquarium — Templates gallery
   The same paper, ink and serifs as the landing page, but here the living
   layer is FLORA ONLY (no fish): every card and every box is a little vessel
   the vegetation has grown out of. Plants are rooted behind each element and
   lean out of its edges, so the grid reads like a bed of reeds.
   ========================================================================== */

.tpc-shell { position: relative; max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 24px clamp(56px, 9vw, 110px); }

/* a calm wash of plants behind the whole gallery, never in the way */
.tpc-flora-field { position: absolute; inset: -4% -8%; z-index: 0; pointer-events: none; }
.tpc-flora-field .flora { opacity: 0.5; }

.tpc-main { position: relative; z-index: 2; }

/* the left filters drawer + overlay: off-canvas on every breakpoint, opened by
   the sliders button in the search bar (desktop and mobile alike) */
.tpc-drawer-overlay { position: fixed; inset: 0; z-index: 48; background: rgba(22, 22, 20, 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.tpc-drawer-overlay.open { opacity: 1; visibility: visible; }
.tpc-drawer { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  width: min(86vw, 340px); max-width: 360px; background: var(--bg); border-right: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 18px 18px 28px; overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.3s ease; }
.tpc-drawer.open { transform: none; }
.tpc-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.tpc-drawer-head .kicker { margin: 0; }
.tpc-drawer-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 1.4rem; line-height: 1; color: var(--ink); cursor: pointer; }
.tpc-drawer-section { margin-bottom: 26px; }
.tpc-drawer-h { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin: 0 0 12px; }
.tpc-drawer-h svg { width: 18px; height: 18px; }
.tpc-drawer-modes { display: flex; flex-direction: column; gap: 8px; }
.tpc-drawer-mode { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px;
  border: 1.4px solid var(--ink); border-radius: 10px; background: var(--bg); color: var(--ink);
  font-size: 0.92rem; text-align: left; cursor: pointer; }
.tpc-drawer-mode svg { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tpc-drawer-mode[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tpc-drawer .tpc-moods { margin-bottom: 0; }
.tpc-drawer-flora { margin-top: auto; display: flex; align-items: flex-end; justify-content: center;
  gap: 6px; padding-top: 24px; opacity: 0.7; }
.tpc-drawer-flora .flora { position: static; }

/* ---------- header ---------- */
.tpc-head { text-align: center; max-width: 720px; margin: 0 auto clamp(30px, 5vw, 56px); }
.tpc-head .kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 16px; }
.tpc-title { font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 1.0; letter-spacing: 0.05em;
  text-transform: uppercase; margin: 0 0 14px; }
.tpc-lede { color: var(--ink-soft); margin: 0 auto; max-width: 54ch; line-height: 1.65; font-size: 1.05rem; }

/* ---------- mode tabs: one style for the whole section ---------- */
.tpc-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 0 auto clamp(28px, 5vw, 48px); }
.tpc-tab { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px;
  border: 0; background: none; color: var(--dim); font-family: var(--sans); font-size: 0.96rem;
  border-radius: 10px; cursor: pointer; transition: background 0.24s ease, color 0.24s ease, padding 0.24s ease, box-shadow 0.24s ease;
  white-space: nowrap; }
.tpc-tab svg { width: 18px; height: 18px; flex: none; }
.tpc-tab:hover { color: var(--ink); }
.tpc-tab[aria-selected="true"] { background: var(--ink); color: var(--bg);
  padding: 0 18px; box-shadow: var(--shadow-sm); }
.tpc-tab[aria-selected="true"] svg { stroke: var(--bg); }
.tpc-tab svg { stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- panels ---------- */
.tpc-panel { display: none; }
.tpc-panel.active { display: block; animation: tpc-fade 0.32s ease both; }
@keyframes tpc-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- search bar (always on browse, the centre of interest) ---------- */
.tpc-searchbar { position: relative; z-index: 2; margin-bottom: 18px; }
.tpc-search { display: flex; gap: 10px; }
.tpc-filter-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 50px; height: 50px; border: 1.4px solid var(--ink); border-radius: 10px; background: var(--bg);
  color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease; }
.tpc-filter-toggle svg { width: 22px; height: 22px; }
.tpc-filter-toggle:hover { background: var(--surface); }
.tpc-filter-toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.tpc-search input { flex: 1 1 auto; min-width: 0; height: 50px; padding: 0 16px;
  border: 1.4px solid var(--ink); border-radius: 10px; background: var(--bg); color: var(--ink);
  font: inherit; font-size: 0.98rem; box-shadow: var(--shadow-sm); }
.tpc-search input::placeholder { color: var(--dim); }
.tpc-search .btn { min-height: 50px; }

/* ---------- active mood chips (below the search bar, clearable) ---------- */
.tpc-active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tpc-active-chips[hidden] { display: none; }
.tpc-chip-active { display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 0 6px 0 12px; border: 1px solid var(--ink); border-radius: 999px; background: var(--bg);
  color: var(--ink); font-size: 14px; }
.tpc-chip-active button { border: 0; background: none; color: var(--dim); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0 6px; }
.tpc-chip-active button:hover { color: var(--ink); }

/* ---------- back button (photo / match panels) ---------- */
.tpc-back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 8px 16px;
  border: 1.4px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: background 0.18s ease; }
.tpc-back:hover { background: var(--surface); }

/* ---------- mood chips (live in the panel) ---------- */
.tpc-moods { display: flex; flex-wrap: wrap; gap: 8px; }
.tpc-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-soft);
  font-size: 14px; cursor: pointer; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease; }
.tpc-chip .cnt { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
.tpc-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tpc-chip[aria-pressed="true"] .cnt { color: rgba(250,250,247,0.7); }
.tpc-more { border-style: dashed; }

/* ---------- filters (dropdowns with icons + chevrons) ---------- */
.tpc-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tpc-filter { position: relative; }
.tpc-filter > button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border: 1.4px solid var(--ink); border-radius: 10px; background: var(--bg); color: var(--ink);
  font-size: 0.88rem; box-shadow: var(--shadow-sm); cursor: pointer; }
.tpc-filter > button .ic { width: 19px; height: 19px; flex: none; }
.tpc-filter > button .chev { width: 19px; height: 19px; flex: none; margin-left: auto;
  transition: transform 0.2s ease; }
.tpc-filter.open > button .chev { transform: rotate(180deg); }
.tpc-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 190px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; display: none; }
.tpc-filter.open .tpc-menu { display: block; }
.tpc-menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 0; background: none; color: var(--ink); font-size: 0.9rem; text-align: left;
  border-radius: 8px; cursor: pointer; }
.tpc-menu button:hover { background: var(--surface); }
.tpc-menu button[aria-checked="true"] { font-weight: 600; }
.tpc-menu button[aria-checked="true"]::after { content: "✓"; font-family: var(--mono); color: var(--ink); }
/* inside the left drawer: stack the filters full-width and let the menu span the panel */
.tpc-drawer .tpc-filters { flex-direction: column; }
.tpc-drawer .tpc-filter { width: 100%; }
.tpc-drawer .tpc-filter > button { width: 100%; }
.tpc-drawer .tpc-menu { left: 0; right: 0; min-width: 0; }

/* ---------- skeleton loader ---------- */
.tpc-skel { pointer-events: none; }
.tpc-skel .sk-img, .tpc-skel .sk-line { background: linear-gradient(100deg, var(--surface) 30%, #f4f3ef 50%, var(--surface) 70%);
  background-size: 220% 100%; animation: tpc-shimmer 1.3s ease-in-out infinite; }
.tpc-skel .sk-img { width: 100%; aspect-ratio: 4 / 5; border-radius: 4px; }
.tpc-skel .sk-line { height: 12px; border-radius: 6px; }
.tpc-skel .sk-title { width: 62%; margin: 14px 0 9px; }
.tpc-skel .sk-sub { width: 40%; }
@keyframes tpc-shimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }

/* ---------- results line ---------- */
.tpc-results { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px;
  font-size: 0.95rem; color: var(--ink-soft); }
.tpc-results .count { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.tpc-active { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; }
.tpc-active button { border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 0 4px; }
.tpc-active button:hover { color: var(--ink); }
.tpc-clear { margin-left: auto; color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
  background: none; border: 0; cursor: pointer; font-size: 0.9rem; }

/* ---------- the grid ---------- */
.tpc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .tpc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .tpc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.tpc-card { position: relative; display: flex; flex-direction: column; }
/* the client-gallery frame is the only framing device; flora grows from it */
.tpc-card .shot { position: relative; margin: 0 var(--frame-off) var(--frame-off) 0; z-index: 1; }
.tpc-card .frame-line { position: absolute; inset: 0; z-index: 1;
  transform: translate(var(--frame-off), var(--frame-off)); border: 1.4px solid var(--ink); pointer-events: none; }
.tpc-card .shot-frame { position: relative; z-index: 2; display: block; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); }
.tpc-card .shot-frame img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity 0.2s ease; }
.tpc-ba { position: absolute; inset: 0; z-index: 3; opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
.tpc-card:hover .tpc-ba, .tpc-card.peek .tpc-ba { opacity: 1; }
.tpc-ba img { width: 100%; height: 100%; object-fit: cover; }

.tpc-tag { position: absolute; top: 10px; left: 10px; z-index: 4; padding: 3px 9px; border-radius: 6px;
  background: rgba(22,22,20,0.78); color: #fff; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; }
.tpc-tag.after { background: rgba(22,22,20,0.78); transition: opacity 0.2s ease; }
.tpc-tag.before { opacity: 0; transition: opacity 0.2s ease; }
.tpc-card:hover .tpc-tag.after, .tpc-card.peek .tpc-tag.after { opacity: 0; }
.tpc-card:hover .tpc-tag.before, .tpc-card.peek .tpc-tag.before { opacity: 1; }

.tpc-meta { padding: 10px 2px 0; }
.tpc-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; margin: 0 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpc-owner { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; color: var(--ink-soft); }
.tpc-owner .av { width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.62rem; color: var(--ink-soft); overflow: hidden; }
.tpc-owner .av img { width: 100%; height: 100%; object-fit: cover; }
.tpc-owner a { color: var(--ink-soft); text-decoration: none; position: relative; z-index: 6; }
.tpc-owner a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tpc-owner a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tpc-moods-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tpc-moods-row .m { font-size: 0.72rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); }
.tpc-moods-row .m.more { border-style: dashed; }
.tpc-installs { font-size: 0.78rem; color: var(--dim); margin: 2px 0 0; }
.tpc-badge { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }

/* the whole card links to the template; the owner name is a sibling link */
.tpc-card > a.tpc-card-link { position: absolute; inset: 0; z-index: 5; border-radius: 10px; }
.tpc-card > a.tpc-card-link:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; }

/* ---------- pagination ---------- */
.tpc-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.tpc-pager .of { font-family: var(--mono); font-size: 0.82rem; color: var(--dim); }

/* ---------- empty states ---------- */
.tpc-empty { position: relative; text-align: center; max-width: 560px; margin: 30px auto; color: var(--ink-soft);
  display: none; }
.tpc-empty.show { display: block; }
/* a plant rooted at the box's centre-top, rising out of it (kept clear of the heading) */
.tpc-empty .tpc-empty-plant { position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); bottom: 100%; margin-bottom: -22px; pointer-events: none; }
.tpc-empty h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--ink); margin: 0 0 12px; }
.tpc-empty p { line-height: 1.6; margin: 0 0 22px; }
.tpc-empty .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tpc-empty .fallback-note { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); margin-top: 18px; }

/* ---------- dotted folder card (the "vessel" the flora grows from) ---------- */
.tpc-folder { position: relative; border: 1.4px dashed var(--ink); border-radius: 14px;
  background: transparent; padding: 0; margin: clamp(48px, 7vw, 80px) 0 0; }
.tpc-folder > .tpc-folder-tab { position: absolute; top: -15px; left: 22px; width: 120px; height: 15px;
  background: var(--bg); border: 1.4px dashed var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0;
  box-sizing: border-box; }
/* the opaque surface sits ABOVE the plant, so the plant's base is hidden behind
   the box and only the foliage rises out of the top edge: it grew from the box */
.tpc-folder-surface { position: relative; z-index: 2; background: var(--bg); border-radius: 12px;
  padding: clamp(22px, 4vw, 36px); }
.tpc-folder h2, .tpc-folder h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.tpc-folder .tpc-folder-title { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 14px; }
.tpc-folder p { color: var(--ink-soft); line-height: 1.65; margin: 0 0 16px; }
/* a signature plant rooted at the folder tab, growing up and out of the box */
.tpc-folder .tpc-folder-plant { position: absolute; z-index: 1; left: 64px; bottom: 100%; margin-bottom: -22px; pointer-events: none; }
/* keep the plant in flow so the wrapper keeps its height and extends upward */
.tpc-folder .tpc-folder-plant .flora, .tpc-empty .tpc-empty-plant .flora { position: static; }
.tpc-folder .tpc-folder-inner { position: relative; z-index: 2; }

/* ---------- FAQ ---------- */
.tpc-faq { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 0; }
.tpc-faq li { padding: 14px 0; border-bottom: 1px dotted var(--line); }
.tpc-faq li:first-child { border-top: 1px dotted var(--line); }
.tpc-faq .q { font-family: var(--serif); font-size: 1.08rem; margin: 0 0 6px; color: var(--ink); }
.tpc-faq .a { color: var(--ink-soft); line-height: 1.6; margin: 0; }

/* ---------- collapsible "What is a template?" (always an accordion) ---------- */
.tpc-fold .tpc-folder-toggle { display: flex; align-items: center; width: 100%; text-align: left; gap: 0;
  padding: clamp(20px, 4vw, 30px) 20px clamp(18px, 3vw, 26px); background: none; border: 0;
  font: inherit; color: var(--ink); cursor: pointer; }
.tpc-fold .tpc-folder-tab { left: 22px; }
.tpc-fold .tpc-folder-title { margin: 0; }
.tpc-fold .tpc-folder-chev { margin-left: auto; font-family: var(--mono); font-size: 1.5rem; line-height: 1;
  color: var(--dim); transition: transform 0.25s ease; }
.tpc-fold .tpc-folder-chev::before { content: "+"; }
.tpc-fold .tpc-folder-toggle[aria-expanded="true"] .tpc-folder-chev { transform: rotate(45deg); }
.tpc-fold .tpc-fold-body { margin-top: 4px; padding: 0 20px clamp(20px, 3vw, 28px); }
.tpc-fold .tpc-fold-body[hidden] { display: none; }
.tpc-fold .tpc-folder-surface { background: transparent; padding: 0; }

/* ---------- photo search ---------- */
.tpc-search-explain { max-width: 60ch; color: var(--ink-soft); line-height: 1.65; margin: 0 auto 22px; text-align: center; }
.tpc-drop { position: relative; min-height: 220px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 28px 28px 24px;
  border: 1.4px dashed var(--ink); border-radius: 14px; background: var(--bg); }
.tpc-drop .tpc-folder-tab { position: absolute; top: -15px; left: 22px; width: 96px; height: 15px;
  background: var(--bg); border: 1.4px dashed var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0;
  box-sizing: border-box; }
.tpc-drop.drag { background: var(--surface); }
/* a plant rooted at the drop folder's RIGHT edge, rising out of the box — kept
   clear of the tab on the left so the two never collide */
.tpc-drop .tpc-drop-plant { position: absolute; z-index: 1; left: auto; right: 40px; bottom: 100%; margin-bottom: -22px; pointer-events: none; }
.tpc-drop .tpc-drop-plant .flora { position: static; }
.tpc-drop-pic { max-width: 100%; max-height: 150px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.tpc-drop .tpc-drop-text { font-size: 1.05rem; color: var(--ink); }
.tpc-drop .tpc-drop-small { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); margin: 0; }
.tpc-privacy { text-align: center; font-size: 0.86rem; color: var(--dim); margin: 14px auto 0; max-width: 60ch; }
.tpc-progress { margin: 22px auto; max-width: 420px; text-align: center; color: var(--ink-soft); }
.tpc-progress .bar { height: 4px; border-radius: 4px; background: var(--surface); overflow: hidden; margin-top: 10px; }
.tpc-progress .bar > i { display: block; height: 100%; width: 30%; background: var(--ink);
  animation: tpc-load 1.1s ease-in-out infinite; }
@keyframes tpc-load { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.tpc-match-row { font-size: 0.84rem; color: var(--ink-soft); margin: 10px 2px 0; line-height: 1.55; }
.tpc-match-pct { display: inline-block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  background: var(--ink); color: var(--bg); border-radius: 6px; padding: 2px 7px; margin-bottom: 6px; }
.tpc-try { display: flex; justify-content: center; margin-top: 26px; }

/* ---------- callouts (Tip / Note / Careful) ---------- */
.tpc-callout { border-left: 4px solid var(--dim); background: var(--bg); padding: 12px 16px;
  margin: 18px 0; border-radius: 0 10px 10px 0; font-size: 0.92rem; color: var(--ink-soft); }
.tpc-callout.tip { border-left-color: var(--ink); }
.tpc-callout.note { border-left-color: var(--dim); }
.tpc-callout.careful { border-left-color: #b3261e; }
.tpc-callout b { color: var(--ink); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; display: block; margin-bottom: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .tpc-shell { padding: 40px 16px 64px; }
  .tpc-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tpc-tabs::-webkit-scrollbar { display: none; }
  .tpc-tab { flex: 0 0 auto; }
  .tpc-search { flex-wrap: wrap; }
  .tpc-search .btn { flex: 1 1 auto; }
  /* keep decorative plants from sitting on the text on small screens */
  .tpc-flora-field { opacity: 0.4; }
}

/* ============================================================================
   Mobile: a slim top bar (Templates + Filters) is always visible so the filter
   choices are one tap away without crowding the page. The noisy search / mood /
   filter controls are tucked into an off-canvas drawer (opened by the sidebar
   icon) together with the three mode buttons, so the photographer is not handed
   a wall of options at once. The big intro tucks away as you scroll.
   ========================================================================== */
@media (max-width: 760px) {
  .tpc-shell { padding: 40px 16px 64px; }
  .tpc-head { margin-bottom: clamp(22px, 5vw, 40px); }

  /* the search bar stays pinned to the top as the intro tucks away on scroll */
  .tpc-searchbar { position: sticky; top: 0; z-index: 40; background: var(--bg);
    padding: 10px 0; margin: 0 0 16px; box-shadow: 0 1px 0 var(--line); }
  .tpc-search { flex-wrap: nowrap; }
  .tpc-search .btn { flex: 0 0 auto; padding: 0 16px; }
  .tpc-active-chips { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tpc-panel.active { animation: none; }
  .tpc-progress .bar > i { animation: none; }
}
