/* Tinkerloop UI: the shared look of every Tinkerloop web tool (Townie Lab, Styled Townie Lab, Looks Library,
   Look Studio, Picture Wall Studio, and every tool after them).
   Overview of every token, component and icon: /ui/ (web/public/ui/index.html). Rules: web/public/ui/README.md.
   - Everything here is prefixed tl- (classes) or plain tokens (--ink, --rose ...). Pages keep only their own layout.
   - Never copy a token or a component into a page: change it here, look at /ui/, run the system tests.
   - Light and dark: follows the system, or <html data-theme="light|dark">.
   The Townie Labs inline this file at build time (they are also claude.ai artifacts and load nothing else). */

/* ── tokens ─────────────────────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #F7FAF2; --bg-grad: linear-gradient(100deg, #FBFCF9 0%, #F7FAF1 50%, #EAF5DD 100%);
  --glow-1: rgba(185, 227, 156, .45); --glow-2: rgba(140, 205, 105, .30); --glow-3: rgba(232, 163, 186, .10); --star: #9ED47E; --star-o: .8;
  --card: #ffffff; --card-2: #f6f7f9; --well: #eef0f4; --line: rgba(28, 26, 31, .09); --line-2: rgba(28, 26, 31, .16);
  --ink: #1C1A1F; --ink-2: #5b5864; --ink-3: #9794a0;
  --rose: #B33D66; --rose-deep: #8b2a4e; --rose-soft: #f7e6ed; --sparkle: #E8A3BA; --on-rose: #ffffff;
  --good: #3f9a5c; --wait: #c9962b; --cc: #D9578A;
  --bar: #e6e8ee; --tip: #1C1A1F; --tip-fg: #FAFAF9;
  --pic-top: #fbf4f7; --pic-bottom: #e9efe3;
  --lift: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(28,26,31,.06), 0 18px 40px -22px rgba(28,26,31,.45);
  --lift-strong: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 4px rgba(28,26,31,.06), 0 30px 60px -28px rgba(28,26,31,.55);
  --pop: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 32px rgba(0,0,0,.12), 0 2px 6px rgba(28,26,31,.06);
  --r-card: 16px; --r-box: 12px; --r-ctl: 9px;
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; --mono: ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121710; --bg-grad: linear-gradient(100deg, #131810 0%, #17221a 50%, #1c2d18 100%);
  --glow-1: rgba(185, 227, 156, .10); --glow-2: rgba(120, 196, 92, .20); --glow-3: rgba(232, 163, 186, .08); --star: #E9F5DA; --star-o: .55;
  --card: #1f1d24; --card-2: #26242c; --well: #2c2a33; --line: rgba(250,250,249,.08); --line-2: rgba(250,250,249,.16);
  --ink: #FAFAF9; --ink-2: #bdb9c6; --ink-3: #85818f; --rose: #E8A3BA; --rose-deep: #c97896; --rose-soft: #3a2630; --sparkle: #E8A3BA; --on-rose: #1C1A1F;
  --good: #7cc995; --wait: #e0b45e; --bar: #34313b; --tip: #FAFAF9; --tip-fg: #1C1A1F; --pic-top: #2a2530; --pic-bottom: #222a20;
  --lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -22px rgba(0,0,0,.8); --lift-strong: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -26px rgba(0,0,0,.9);
  --pop: 0 1px 0 rgba(255,255,255,.05) inset, 0 16px 40px rgba(0,0,0,.55); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121710; --bg-grad: linear-gradient(100deg, #131810 0%, #17221a 50%, #1c2d18 100%);
  --glow-1: rgba(185, 227, 156, .10); --glow-2: rgba(120, 196, 92, .20); --glow-3: rgba(232, 163, 186, .08); --star: #E9F5DA; --star-o: .55;
  --card: #1f1d24; --card-2: #26242c; --well: #2c2a33; --line: rgba(250,250,249,.08); --line-2: rgba(250,250,249,.16);
  --ink: #FAFAF9; --ink-2: #bdb9c6; --ink-3: #85818f; --rose: #E8A3BA; --rose-deep: #c97896; --rose-soft: #3a2630; --sparkle: #E8A3BA; --on-rose: #1C1A1F;
  --good: #7cc995; --wait: #e0b45e; --bar: #34313b; --tip: #FAFAF9; --tip-fg: #1C1A1F; --pic-top: #2a2530; --pic-bottom: #222a20;
  --lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -22px rgba(0,0,0,.8); --lift-strong: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -26px rgba(0,0,0,.9);
  --pop: 0 1px 0 rgba(255,255,255,.05) inset, 0 16px 40px rgba(0,0,0,.55); color-scheme: dark }

/* ── base: the green studio backdrop with soft light and twinkling sparkles ─────────────────────── */
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body.tl-page { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; min-height: 100vh }
body.tl-page::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 92% 8%, var(--glow-1), transparent 70%), radial-gradient(ellipse 70% 80% at 6% 100%, var(--glow-2), transparent 70%),
              radial-gradient(ellipse 40% 45% at 55% 45%, var(--glow-3), transparent 70%), var(--bg-grad) }
/* element defaults without specificity (:where), so any page or component class wins over them */
:where(.tl-page) :where(h1, h2, h3) { margin: 0; font-weight: 700; text-wrap: balance }
:where(.tl-page) :where(button, input, select, textarea) { font: inherit; color: inherit }
:where(.tl-page) :where(:focus-visible) { outline: 2px solid var(--rose); outline-offset: 2px }
:where(.tl-page) :where(code, kbd) { font-family: var(--mono); font-size: .9em }
:where(.tl-page) :where(kbd) { padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--card); font-weight: 700; font-size: .85em }   /* a key: press R */
/* a button's keyboard shortcut, inside it: <button class="tl-btn primary">…Roll a new townie<kbd class="tl-key" aria-hidden="true">R</kbd></button>
   (plus aria-keyshortcuts="r" on the button). Hidden where there is no keyboard to press it (touch screens). */
.tl-key { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 5px; border-radius: 6px; font: 700 11px/1 var(--mono);
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--card); color: var(--ink-2) }
.tl-btn.primary .tl-key { background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 40%, transparent); color: inherit }   /* follows the button's text: light and dark */
@media (hover: none), (max-width: 760px) { .tl-key { display: none } }
/* page frame: centred, safe-area aware. --tl-wrap sets the width (default 1400px) */
.tl-wrap { max-width: var(--tl-wrap, 1400px); margin: 0 auto; padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.tl-sparkles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden }
.tl-sparkles svg { position: absolute; fill: var(--star); opacity: var(--star-o); animation: tl-twinkle 4.5s ease-in-out infinite }
.tl-sparkles svg:nth-child(3n+2) { animation-delay: -1.5s } .tl-sparkles svg:nth-child(3n) { animation-delay: -3s }
@keyframes tl-twinkle { 0%, 100% { opacity: calc(var(--star-o) * .26); transform: scale(.8) } 50% { opacity: var(--star-o); transform: scale(1) } }
@keyframes tl-spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .tl-sparkles svg, .tl-boot .tl-spark { animation: none } }

/* ── icons: TL.icon(name) / <i data-icon="name"></i> (tl.js). 1em, the text colour ─────────────── */
.tl-icon { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -.125em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.tl-icon.tl-fill { fill: currentColor; stroke: none }
i[data-icon] { display: inline-flex; font-style: normal }
.tl-icon.s16 { width: 16px; height: 16px } .tl-icon.s20 { width: 20px; height: 20px } .tl-icon.s24 { width: 24px; height: 24px }
/* illustrated icons (Scenario stickers, game icons): a fixed square, never stretched */
.tl-illus { width: 32px; height: 32px; object-fit: contain; flex: none }
.tl-illus.sm { width: 24px; height: 24px } .tl-illus.lg { width: 44px; height: 44px } .tl-illus.xl { width: 56px; height: 56px }

/* ── top bar: brand mark, title, subtitle, actions on the right ─────────────────────────────────── */
.tl-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap }
.tl-top > .tl-titles { min-width: 0 }
.tl-top h1 { font-size: 20px; letter-spacing: -.01em; line-height: 1.25 }
.tl-sub { color: var(--ink-3); font-size: 13px; font-weight: 500; margin: 0 }
.tl-sub a { color: inherit; text-decoration: none } .tl-sub a:hover { color: var(--rose) }
.tl-topact { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; flex-wrap: wrap }
.tl-mark { width: 40px; height: 40px; border-radius: 9px; display: block; box-shadow: var(--lift); flex: none; color: inherit }
.tl-mark svg { display: block; width: 100%; height: 100% }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-mark { box-shadow: 0 0 0 1px var(--line-2), var(--lift) } }
:root[data-theme="dark"] .tl-mark { box-shadow: 0 0 0 1px var(--line-2), var(--lift) }
@media (max-width: 560px) { .tl-top { gap: 10px; margin-bottom: 12px } .tl-top h1 { font-size: 18px } .tl-top > .tl-titles { flex: 1 } .tl-sub { font-size: 12.5px } }

/* ── buttons ────────────────────────────────────────────────────────────────────────────────────── */
/* .tl-btn = soft (default)  .primary = rose call to action  .ghost = text only  .danger  .small  .big (full width)  .round (icon only) */
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font: inherit; font-weight: 700; font-size: 13px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--card-2); color: var(--ink); box-shadow: var(--lift); transition: border-color .15s, color .15s, background .15s, filter .15s }
.tl-btn:hover:not(:disabled) { border-color: var(--rose); color: var(--rose) }
.tl-btn:disabled, .tl-btn[aria-disabled="true"] { opacity: .45; cursor: default; box-shadow: none }
.tl-btn .tl-icon { font-size: 15px }
.tl-btn.primary { border: 0; color: var(--on-rose); padding: 13px 20px; font-size: 14.5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rose) 82%, #fff), var(--rose) 55%, var(--rose-deep));
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 12px 24px -12px var(--rose) }
.tl-btn.primary:hover:not(:disabled) { color: var(--on-rose); filter: brightness(1.05) }
.tl-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2) }
.tl-btn.ghost:hover:not(:disabled) { background: var(--well); border-color: transparent; color: var(--ink) }
.tl-btn.danger { color: var(--rose); border-color: var(--rose); background: var(--card) }
.tl-btn.danger:hover:not(:disabled) { background: var(--rose-soft) }
.tl-btn.small { padding: 6px 12px; font-size: 12.5px; gap: 6px }
.tl-btn.small.primary { padding: 7px 14px; font-size: 12.5px }
.tl-btn.compact.primary { padding: 10px 18px; font-size: 14px }
.tl-btn.big { width: 100%; padding: 15px 20px; font-size: 15.5px }
.tl-btn.round { width: 34px; height: 34px; padding: 0; flex: none }
.tl-btn.round.small { width: 28px; height: 28px }
.tl-btn .tl-illus { width: 26px; height: 26px; margin: -6px 0 }
/* icon button without a frame (close, collapse, remove) */
.tl-iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: var(--ink-3); cursor: pointer; font-size: 16px; transition: background .15s, color .15s }
.tl-iconbtn:hover:not(:disabled) { background: var(--well); color: var(--ink) }
.tl-iconbtn.small { width: 22px; height: 22px; font-size: 12px }
/* a remove "x" on a picture or chip corner */
.tl-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 72%, transparent); color: var(--card); font-size: 11px; cursor: pointer }
.tl-x:hover { background: var(--rose); color: var(--on-rose) }

/* ── product app bar: one product (e.g. Styled Townies) with its tools in a nav ─────────────────────
   <header class="tl-appbar"><a class="tl-brand" href="…"><span class="tl-mark" data-mark="34"></span><span><b>Styled Townies</b><small>by Tinkerloop</small></span></a>
     <nav class="tl-nav"><a href="…" aria-current="page"><i data-icon="collection"></i>Library</a><a href="…" class="locked">…<i class="lock" data-icon="lock"></i></a></nav>
     <div class="tl-appbar-end">page controls, account</div></header>
   Sticky at the top; on phones the nav gets its own scrollable row. Under it: .tl-pagehead (the page's own title and actions). */
.tl-appbar { position: sticky; top: 10px; z-index: 50; min-width: 0; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 8px 10px 8px 8px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--lift);
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px) }
.tl-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; padding-right: 4px; border-radius: 12px }
.tl-brand .tl-mark { width: 36px; height: 36px; border-radius: 9px; box-shadow: none }
.tl-brand b { display: block; font-size: 16px; letter-spacing: -.015em; line-height: 1.15 }
.tl-brand small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); line-height: 1.2 }
.tl-nav { display: flex; align-items: center; gap: 2px; min-width: 0 }
.tl-nav a, .tl-nav button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 11px; border: 0; background: none; font: inherit;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s }
.tl-nav a:hover, .tl-nav button:hover { background: var(--well); color: var(--ink) }
.tl-nav [aria-current="page"] { background: var(--rose-soft); color: var(--rose-deep) }
.tl-nav .tl-icon { font-size: 16px }
.tl-nav .lock { color: var(--ink-3); margin-left: -2px } .tl-nav .lock .tl-icon { font-size: 12px }
.tl-nav .short { display: none }
.tl-appbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative }
@media (max-width: 860px) {
  .tl-appbar { top: 6px; padding: 6px }
  .tl-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; padding-top: 4px; border-top: 1px solid var(--line) }
  .tl-nav::-webkit-scrollbar { display: none }
  .tl-nav a, .tl-nav button { padding: 7px 10px; font-size: 13px; gap: 6px }
  .tl-brand small { display: none }
}
@media (max-width: 560px) {
  .tl-nav .full { display: none } .tl-nav .short { display: inline }
  .tl-nav { justify-content: space-between; gap: 0 }
  .tl-nav a, .tl-nav button { padding: 7px 8px; gap: 5px }
}
@media (max-width: 400px) { .tl-nav a .tl-icon, .tl-nav button .tl-icon { display: none } .tl-nav .lock .tl-icon { display: inline-block } }
/* ---------- tool bar: a tool's main action with its most used settings (Townie Lab: Roll + Collections + Packs) ----------
   <div class="tl-toolbar"><div class="chips"><button class="tl-setchip">…</button></div><div class="end"><button class="tl-btn">Reset</button><button class="tl-btn primary">…</button></div></div>
   The main action sits at the right end (.end), a quiet secondary one (Reset) just before it.
   Settings a visitor changes often belong here as a set chip that opens a dialog, not deep in a settings list. */
.tl-toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--lift) }
.tl-toolbar > .tl-btn.primary { flex: none }
.tl-toolbar > .chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0 }
.tl-toolbar > .end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none }
.tl-toolbar > .aside { margin-left: auto; font-size: 12.5px; color: var(--ink-3); min-width: 0 }
@media (max-width: 560px) { .tl-toolbar > .end { flex: 1 1 100%; justify-content: flex-end } .tl-toolbar > .tl-btn.primary { flex: 1 1 100% } .tl-toolbar > .chips { flex: 1 1 100% } .tl-toolbar > .chips > * { flex: 1 1 calc(50% - 8px) } .tl-toolbar > .aside { display: none } .tl-setchip b { max-width: none } }
/* set chip: <button class="tl-setchip"><i data-icon="layers"></i><span><small>Collections</small><b>Tinkerloop Basics</b></span><i data-icon="chevron-down"></i></button> */
.tl-setchip { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; padding: 7px 12px 7px 10px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink); cursor: pointer; text-align: left }
.tl-setchip:hover { border-color: var(--rose) }
.tl-setchip > .tl-icon:first-child { font-size: 18px; color: var(--rose); flex: none }
.tl-setchip > .tl-icon:last-child { font-size: 14px; color: var(--ink-3); flex: none }
.tl-setchip > span { display: grid; min-width: 0; line-height: 1.15 }
.tl-setchip small { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3) }
.tl-setchip b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch }
.tl-setchip.changed small::after { content: " · changed"; color: var(--rose) }

/* ---------- fold: a titled group that opens and closes, with what is set inside it on the right ----------
   <details class="tl-fold" open><summary><span class="t">Personality</span><span class="sum">2 picked</span></summary><div class="fbd">…</div></details>
   Long settings panels: the everyday group open, the rest closed with a short summary, so nothing is lost and little is shown. */
.tl-fold { border-top: 1px solid var(--line) }
/* folds stack without the card's gap (else the space under a closed title is wider than above it); what follows them gets its own */
.tl-card > .bd:has(> .tl-fold) { gap: 0 }
.tl-card > .bd > .tl-fold ~ :not(.tl-fold) { margin-top: 10px }
.tl-fold:first-of-type { border-top: 0 }
.tl-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 2px }
.tl-fold > summary::-webkit-details-marker { display: none }
.tl-fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 2px }
.tl-fold[open] > summary::before { transform: rotate(45deg) }
.tl-fold > summary .t { font-weight: 800; font-size: 14px; letter-spacing: -.005em }
.tl-fold > summary .sum { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tl-fold > summary .sum.on { color: var(--rose) }
.tl-fold > .fbd { display: grid; gap: 14px; padding: 0 0 16px }

/* ---------- card filter row: groups of big icon cards (Looks Library: life stage, frame, look category) ----------
   <div class="tl-cardrow" data-fit-row>
     <div class="tl-cardgroup" style="--n: 4"><span class="lbl">Life stage</span>
       <div class="cards" role="group" aria-label="Life stage"><button class="tl-fcard" aria-pressed="false">
         <span class="ic"><img …></span><span class="lab">Child</span><span class="n">158</span></button>…</div></div>…</div>
   --n = the group's number of cards. The groups share the whole row, each as wide as its cards need, so the cards grow
   to fill the panel. tl.js (data-fit-row) moves groups that don't fit behind a "More" card at the end of the first row;
   it opens them as a second row and shows how many of their cards are on. Add a group: one more .tl-cardgroup, nothing
   else. Wrap a card in your own element (e.g. a card with a menu) and it still fills its cell. */
.tl-cardrow { --tl-card-min: 76px; --tl-card-gap: 6px; display: flex; flex-wrap: wrap; gap: 14px 22px; min-width: 0 }
.tl-cardgroup { flex: var(--n, 1) 1 0; min-width: calc(var(--n, 1) * var(--tl-card-min) + (var(--n, 1) - 1) * var(--tl-card-gap));
  display: grid; gap: 6px; align-content: start }
.tl-cardgroup > .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tl-cardgroup > .cards { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: var(--tl-card-gap) }
.tl-cardgroup > .cards > * { min-width: 0 }
.tl-cardgroup.wrap { flex-basis: 100%; min-width: 0 }   /* wider than the whole row (phones): its cards wrap */
.tl-cardgroup.wrap > .cards { grid-template-columns: repeat(auto-fill, minmax(var(--tl-card-min), 1fr)) }
.tl-cardgroup.more { flex: 1 0 var(--tl-card-min); order: 1; min-width: var(--tl-card-min); max-width: 110px }
.tl-cardrow.more-line > .more { flex-basis: 100%; max-width: none }
.tl-cardrow.more-line > .more > .lbl { display: none }
.tl-cardrow.more-line > .more .tl-fcard { height: 42px; grid-template-rows: none; grid-auto-flow: column; justify-content: center; gap: 6px; padding: 0 12px }
.tl-cardrow.more-line > .more .tl-fcard .ic { width: auto; height: auto; font-size: 18px }
.tl-cardrow.more-line > .more .tl-fcard .n { position: static }
.tl-cardrow-break { order: 2; flex-basis: 100%; height: 0 }
.tl-cardgroup.is-more { order: 3 }
.tl-cardrow:not(.has-more) > .more, .tl-cardrow:not(.has-more) > .tl-cardrow-break,
.tl-cardrow:not(.open) > .is-more, .tl-cardrow:not(.open) > .tl-cardrow-break { display: none }
.tl-fcard { display: grid; grid-template-rows: 40px 32px; justify-items: center; align-items: center; gap: 2px; width: 100%; min-width: 0; height: 86px;
  padding: 8px 4px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); cursor: pointer; position: relative }
.tl-fcard:hover:not(:disabled) { border-color: var(--line-2) }
.tl-fcard[aria-pressed="true"], .tl-fcard[aria-expanded="true"] { background: var(--rose-soft); border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose) inset }
.tl-fcard:disabled { opacity: .38; cursor: default }
.tl-fcard .ic { width: 38px; height: 38px; display: grid; place-items: center; font-size: 22px; color: var(--ink-2) }
.tl-fcard .ic img { width: 34px; height: 34px; object-fit: contain }
.tl-fcard .noicon { width: 34px; height: 34px; border-radius: 50%; background: var(--well); display: grid; place-items: center; font-weight: 800; color: var(--ink-2) }
.tl-fcard .lab { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }
.tl-fcard .n { position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--ink-3); font-weight: 700 }
.tl-fcard .n.on { color: #fff; background: var(--rose); border-radius: 999px; padding: 1px 6px; top: 5px }
/* the page's own head under the app bar: <div class="tl-pagehead"><div><h1>Looks Library</h1><p class="tl-sub">20 looks</p></div><div class="tl-topact">…</div></div> */
.tl-pagehead { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 4px 2px 14px }
.tl-pagehead h1 { font-size: 22px; letter-spacing: -.015em; line-height: 1.2 }
.tl-pagehead > div:first-child { min-width: 0 }
.tl-pagehead .tl-topact { margin-left: auto }
/* a strip that says what logging in / joining adds (or other news for the whole page):
   <div class="tl-banner"><i data-icon="sparkle"></i><div><b>Title</b><span>text</span></div><a class="tl-btn primary compact">Log in with Patreon</a></div> */
.tl-banner { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 12px 14px 12px 16px; margin-bottom: 14px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--rose) 22%, transparent); box-shadow: var(--lift);
  background: linear-gradient(100deg, var(--rose-soft), color-mix(in srgb, var(--card) 85%, var(--rose-soft)) 60%, var(--card)) }
.tl-banner > i[data-icon] { color: var(--rose); font-size: 22px; flex: none }
.tl-banner > div:not(.acts) { flex: 1 1 280px; min-width: 0; display: grid; gap: 2px; font-size: 13px; color: var(--ink-2) }
.tl-banner > div:not(.acts) b { color: var(--ink); font-size: 14px }
.tl-banner .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: none; margin-left: auto }   /* the call to action on the right */
@media (max-width: 560px) { .tl-banner .acts { margin-left: 0 } }
/* a locked area (members only): <div class="tl-locked"><i data-icon="lock"></i><h2>…</h2><p>…</p><div class="acts">buttons</div></div> */
.tl-locked { max-width: 560px; margin: 32px auto; padding: 28px 26px; text-align: center; display: grid; justify-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--lift-strong) }
.tl-locked > i[data-icon] { font-size: 26px; color: var(--rose); width: 54px; height: 54px; border-radius: 50%; background: var(--rose-soft); display: grid; place-items: center }
.tl-locked h2 { font-size: 20px; letter-spacing: -.01em }
.tl-locked p { margin: 0; color: var(--ink-2); line-height: 1.55 }
.tl-locked ul { margin: 4px 0 6px; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; font-size: 13.5px; color: var(--ink-2) }
.tl-locked li { display: flex; gap: 8px; align-items: flex-start } .tl-locked li .tl-icon { color: var(--good); margin-top: 3px }
.tl-locked .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px }

/* ── pills in the top bar (Share, Patreon, Open, status) and the account button ─────────────────── */
.tl-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; padding: 8px 14px; border-radius: 999px; background: var(--card);
  box-shadow: var(--lift); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap }
.tl-pill { transition: background-color .15s, color .15s, box-shadow .15s, transform .15s, border-color .15s }
@media (hover: hover) {
  a.tl-pill:hover, button.tl-pill:hover:not([aria-expanded="true"]):not(:disabled), label.tl-pill:hover { color: var(--rose); transform: translateY(-1px); box-shadow: var(--lift-strong) }
  .tl-pill[aria-expanded="true"]:hover { filter: brightness(1.15) } }
@media (prefers-reduced-motion: reduce) { .tl-pill:hover { transform: none !important } }
.tl-pill[aria-expanded="true"] { background: var(--ink); color: var(--card) }
.tl-pill .tl-icon { font-size: 14px }
.tl-pill.status { font-weight: 600; color: var(--ink-2); cursor: default; padding: 7px 12px }
.tl-pill.status:hover { border-color: transparent }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); flex: none }
.tl-dot.good, .ready > .tl-dot { background: var(--good) } .tl-dot.bad, .fail > .tl-dot { background: var(--rose) } .tl-dot.off { background: var(--ink-3) }
@media (max-width: 560px) { .tl-pill.collapse .lbl { display: none } .tl-pill.collapse { padding: 8px 10px } }
.tl-avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--rose-soft); color: var(--rose); font-size: 12px; font-weight: 800 }
.tl-avatar img { width: 100%; height: 100%; object-fit: cover }
.tl-pill.acct { padding: 4px 10px 4px 4px; font-size: 13px; gap: 8px }
.tl-pill.acct[aria-expanded="true"] { background: var(--card); color: var(--ink); border-color: var(--rose) }
.tl-pill.acct .chev { color: var(--ink-3); font-size: 13px; margin-left: -2px }

/* ── popover and menu (share box, account menu, small option lists) ─────────────────────────────── */
.tl-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 200px; width: max-content; max-width: min(380px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); padding: 14px }
.tl-menu { padding: 6px; display: grid; gap: 2px }
.tl-menu .head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px }
.tl-menu .head b { font-size: 13.5px } .tl-menu .head span { font-size: 12px; color: var(--ink-3) }
.tl-menu button, .tl-menu a { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; border-radius: var(--r-ctl);
  padding: 8px 10px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-decoration: none }
.tl-menu button:hover, .tl-menu a:hover, .tl-menu button:focus-visible { background: var(--well) }
.tl-menu [aria-current="page"] { font-weight: 700 }
.tl-menu .tl-icon { color: var(--ink-3); font-size: 15px }
.tl-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 }

/* ── cards ──────────────────────────────────────────────────────────────────────────────────────── */
/* <section class="tl-card"><div class="hd"><h2>Title</h2><span class="aside">note</span></div><div class="bd">…</div></section> */
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--lift); min-width: 0 }
.tl-card > .hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; min-width: 0 }
.tl-card > .hd h2, .tl-card > .hd h3 { font-size: 13.5px; font-weight: 700 }
.tl-card > .bd { padding: 12px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px }
.tl-card > .bd > * { min-width: 0 }
.tl-card .aside, .tl-aside { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3) }
.tl-card.strong { box-shadow: var(--lift-strong); border-radius: 18px }
.tl-card.flat { background: var(--card-2); box-shadow: none; border-radius: 14px }
.tl-card.pad { padding: 16px }
.tl-card.link { cursor: pointer; transition: transform .15s, box-shadow .15s }
.tl-card.link:hover, .tl-card.link:focus-visible { transform: translateY(-3px); box-shadow: var(--lift-strong) }
@media (max-width: 560px) { .tl-card > .hd, .tl-card > .bd { padding-left: 14px; padding-right: 14px } }
/* a soft box inside a card */
.tl-box { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-box); padding: 12px 14px }
.tl-empty { text-align: center; padding: 44px 16px; color: var(--ink-2); background: var(--card); border-radius: var(--r-card); box-shadow: var(--lift) }
.tl-empty .tl-illus { display: block; margin: 0 auto 10px }
.tl-empty > i[data-icon] { display: flex; justify-content: center; margin-bottom: 10px; font-size: 32px; color: var(--ink-3) }
.tl-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px }

/* ── text bits ──────────────────────────────────────────────────────────────────────────────────── */
.tl-title { font-size: 13px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px }
.tl-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--rose) }
.tl-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3) }
.tl-hint { font-size: 12.5px; color: var(--ink-2); margin: 0 }
.tl-muted { color: var(--ink-3) }
.tl-link { color: var(--rose); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer }
.tl-link:hover { color: var(--rose-deep) }
.tl-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px }
.tl-kv dt { color: var(--ink-3); font-weight: 600 } .tl-kv dd { margin: 0 }
.tl-foot { margin-top: 26px; color: var(--ink-3); font-size: 12.5px; line-height: 1.6 }
.tl-foot.center { text-align: center }
.tl-foot > div + div, .tl-foot > p + p { margin-top: 4px } .tl-foot p { margin: 0 }
.tl-foot a, .tl-foot .tl-link { color: var(--ink-2); font-weight: 500 }

/* ── segmented control, tabs, stepper ───────────────────────────────────────────────────────────── */
/* <div class="tl-seg" role="group"><button aria-pressed="true">A</button><button aria-pressed="false">B</button></div>
   tabs: role="tablist" + aria-selected. .wide = fills the row, .mini = small (in a card header) */
.tl-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--well); border-radius: var(--r-box); min-width: 0; max-width: 100% }
.tl-seg.wide { display: flex }
.tl-seg.wide > button { flex: 1 }
.tl-seg > button { min-width: 0; border: 0; background: transparent; border-radius: var(--r-ctl); padding: 7px 12px; font: inherit; font-weight: 700; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; justify-content: center; gap: 6px }
.tl-seg > button:hover:not([aria-pressed="true"]):not([aria-selected="true"]):not(:disabled) { background: color-mix(in srgb, var(--card) 75%, transparent); color: var(--rose) }
.tl-seg > button[aria-pressed="true"], .tl-seg > button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--lift) }
.tl-seg > button { transition: background-color .15s, color .15s, box-shadow .15s }
.tl-seg > button[aria-pressed="true"]:hover, .tl-seg > button[aria-selected="true"]:hover { color: var(--rose-deep) }
.tl-seg > button:disabled { opacity: .45; cursor: default }
.tl-seg.tabs > button { padding: 8px; font-size: 13px }
.tl-seg.mini { padding: 2px; gap: 2px; border-radius: 10px }
.tl-seg.mini > button { padding: 3px 9px; font-size: 11.5px; border-radius: 8px }
@media (max-width: 560px) { .tl-seg > button { padding: 9px 6px; font-size: 12px } }
/* wizard steps: <nav class="tl-steps"><button aria-current="step"><i>1</i>Pictures</button><button class="done"><i>2</i>…</button></nav> */
.tl-steps { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; padding: 5px; border-radius: var(--r-card);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--lift) }
.tl-steps > button { border: 0; background: transparent; border-radius: 11px; padding: 7px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px;
  color: var(--ink-3); font: inherit; font-weight: 700; font-size: 12px; min-width: 0 }
.tl-steps > button:hover:not([aria-current="step"]) { color: var(--rose) }
.tl-steps > button > i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
  background: var(--well); color: var(--ink-2) }
.tl-steps > button[aria-current="step"] { background: var(--rose-soft); color: var(--rose-deep) }
.tl-steps > button[aria-current="step"] > i { background: var(--rose); color: var(--on-rose) }
.tl-steps > button.done > i { background: var(--good); color: #fff }
/* number stepper: <span class="tl-step"><button>−</button><b>3</b><button>+</button></span> */
.tl-step { display: inline-flex; align-items: center; gap: 2px; background: var(--well); border-radius: var(--r-ctl); padding: 2px }
.tl-step button { width: 24px; height: 24px; border: 0; background: transparent; border-radius: 7px; font-weight: 800; cursor: pointer; color: var(--ink-2); display: grid; place-items: center }
.tl-step button:hover { background: var(--card); color: var(--ink) }
.tl-step b { min-width: 30px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums }

/* ── chips, tags, badges ────────────────────────────────────────────────────────────────────────── */
/* chip: a value or a filter. button.tl-chip + aria-pressed toggles. .like / .dislike for preferences */
.tl-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.35;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); white-space: nowrap }
button.tl-chip { cursor: pointer; box-shadow: var(--lift) }
button.tl-chip:hover:not(:disabled) { border-color: var(--rose) }
.tl-chip[aria-pressed="true"], .tl-chip.on { background: var(--rose-soft); border-color: var(--rose); color: var(--rose-deep) }
.tl-chip.like { background: var(--rose-soft); border-color: transparent; color: var(--rose-deep) }
.tl-chip.dislike { background: var(--card-2); border-color: var(--line-2); color: var(--ink-2); font-weight: 600 }
.tl-chip.good { border-color: var(--good); color: var(--good) }
.tl-chip.warn { border-color: var(--rose); color: var(--rose) }
.tl-chip .tl-icon { font-size: 12px }
.tl-chip img { width: 16px; height: 16px; margin: -2px 0 }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px }
/* tag: tiny uppercase marker next to a name. .solid (TALENT), .outline (JOB), .soft (SIDE) */
.tl-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; flex: none; line-height: 1.5;
  background: var(--well); color: var(--ink-2) }
.tl-tag.solid { background: var(--rose); color: var(--on-rose) }
.tl-tag.outline { background: transparent; border: 1px solid var(--rose); color: var(--rose); padding: 0 5px }
.tl-tag.muted { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); padding: 0 5px }
.tl-tag.cc { background: var(--cc); color: #fff }
/* count bubble on a corner */
.tl-count { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800;
  background: var(--well); color: var(--ink-2); font-variant-numeric: tabular-nums }
.tl-count.rose { background: var(--rose); color: var(--on-rose) }

/* ── icon wells (pick one or several icons: traits, ages, likes) ────────────────────────────────── */
/* <div class="tl-wells"><button class="tl-well" aria-pressed="true"><img …></button></div>; data-state="like|dislike" adds ♥ / ✕ */
.tl-wells { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; justify-items: center }
.tl-well { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--well); display: grid; place-items: center; cursor: pointer; padding: 0; position: relative; color: var(--ink-2) }
.tl-well img { width: 30px; height: 30px; filter: grayscale(1); opacity: .55; transition: filter .15s, opacity .15s }
.tl-well:hover img { opacity: .85 }
.tl-well[aria-pressed="true"] { background: var(--card); border-color: var(--rose); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rose) 30%, transparent), var(--lift) }
.tl-well[aria-pressed="true"] img, .tl-well[data-state] img { filter: none; opacity: 1 }
.tl-well[data-state="like"] { border-color: var(--rose); background: var(--card) }
.tl-well[data-state="dislike"] { border-color: var(--ink-3); background: var(--card) }
.tl-well[data-state]::before { position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: var(--lift) }
.tl-well[data-state="like"]::before { content: "\2665"; background: var(--rose); color: var(--on-rose) }
.tl-well[data-state="dislike"]::before { content: "\2715"; background: var(--ink-3); color: var(--card) }
.tl-well > i[data-icon] { font-size: 22px; color: var(--ink-3) } .tl-well[aria-pressed="true"] > i[data-icon] { color: var(--rose) }
.tl-wells.big .tl-well { width: 52px; height: 52px; border-radius: 15px } .tl-wells.big .tl-well img { width: 38px; height: 38px }
/* a framed icon (shown, not picked) */
.tl-badge { width: 38px; height: 38px; border-radius: var(--r-box); background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--lift); flex: none; color: var(--ink-2) }
.tl-badge img { width: 28px; height: 28px } .tl-badge .tl-icon { font-size: 18px }

/* ── form controls ──────────────────────────────────────────────────────────────────────────────── */
/* <label class="tl-field"><span>Title</span><input class="tl-input"><small class="tl-hint">…</small></label> */
.tl-field { display: grid; gap: 5px; min-width: 0 }
.tl-field > span:first-child, .tl-field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-2) }
.tl-input, .tl-textarea, .tl-select { width: 100%; max-width: 100%; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); color: var(--ink);
  padding: 9px 12px; font: inherit; font-weight: 500; line-height: 1.3; transition: border-color .15s }
.tl-input:hover, .tl-textarea:hover, .tl-select:hover, .tl-input:focus, .tl-textarea:focus, .tl-select:focus-visible { border-color: var(--rose); outline: none }
.tl-input::placeholder, .tl-textarea::placeholder { color: var(--ink-3) }
.tl-textarea { resize: vertical; min-height: 64px }
.tl-select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236F6A75' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 12px 12px }
.tl-input.small, .tl-select.small { padding-top: 6px; padding-bottom: 6px; border-radius: var(--r-ctl) }
.tl-search { position: relative; display: flex; align-items: center; min-width: 0 }
.tl-search > .tl-icon { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none }
.tl-search > .tl-input { border-radius: 999px; padding-left: 38px }
.tl-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px }
.tl-check input { accent-color: var(--rose); width: 15px; height: 15px; margin: 0 }
/* range with a rose fill: set --p (0–100%) from JS */
.tl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; margin: 6px 0; cursor: pointer;
  background: linear-gradient(90deg, var(--rose), var(--sparkle) var(--p, 20%), var(--bar) var(--p, 20%)) }
.tl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--rose); box-shadow: var(--lift) }
.tl-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2px solid var(--rose); box-shadow: var(--lift) }
.tl-range::-moz-range-track { background: transparent }
@media (max-width: 560px) { .tl-input, .tl-textarea, .tl-select { font-size: 16px } }   /* iOS zooms into smaller inputs */
/* drop zone for files */
.tl-drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; display: grid; place-items: center; text-align: center; gap: 6px; cursor: pointer;
  background: var(--card-2); color: var(--ink); transition: background .15s, border-color .15s; width: 100%; font: inherit }
.tl-drop:hover, .tl-drop.over { border-color: var(--rose); background: var(--rose-soft) }
.tl-drop b { font-size: 14px } .tl-drop span { font-size: 12.5px; color: var(--ink-2) }
.tl-drop .tl-illus { width: 56px; height: 56px }
.tl-drop.compact { padding: 10px 14px; grid-template-columns: auto 1fr; text-align: left; justify-items: start; column-gap: 12px; row-gap: 0 }
.tl-drop.compact .tl-illus { width: 36px; height: 36px; grid-row: span 2 }

/* ── more controls: switch, number with unit, colour swatches, picture tiles, fold-out section ──── */
/* <label class="tl-switch"><input type="checkbox"> Keep the shape</label> */
.tl-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 13px }
.tl-switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--bar); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s }
.tl-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s }
.tl-switch input:checked { background: var(--rose) } .tl-switch input:checked::after { left: 19px }
/* <div class="tl-num"><input type="number"><span>cm</span></div> (the unit may also come first: §) */
.tl-num { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); overflow: hidden; min-width: 0 }
.tl-num:hover, .tl-num:focus-within { border-color: var(--rose) }
.tl-num input { border: 0; background: transparent; padding: 9px 10px; width: 100%; min-width: 0; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; outline: none }
.tl-num span { padding: 0 10px; color: var(--ink-3); font-weight: 700; font-size: 12.5px }
/* colour swatches: <div class="tl-swatches"><button class="tl-swatch" style="--c:#b33d66" aria-pressed="true"></button></div>; .sm = small dots on a card */
.tl-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.tl-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card); background: var(--c, var(--well)); box-shadow: 0 0 0 1.5px var(--line-2); cursor: pointer; padding: 0; flex: none }
.tl-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--rose) }
.tl-swatches.sm { gap: 4px } .tl-swatches.sm .tl-swatch { width: 14px; height: 14px; border-width: 2px; box-shadow: 0 0 0 1px var(--line-2); cursor: default }
.tl-swatches.sm .tl-swatch[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--ink) }
/* picture tiles to pick from (frame types, layouts, effects, look categories):
   <div class="tl-tiles"><button class="tl-tile" aria-pressed="true"><img …><b>Classic</b><span>wood</span></button></div>; --tile = min width */
.tl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 74px), 1fr)); gap: 8px }
.tl-tile { position: relative; border: 2px solid transparent; background: var(--card-2); border-radius: 13px; padding: 6px 6px 8px; cursor: pointer; display: grid; gap: 4px;
  justify-items: center; text-align: center; box-shadow: var(--lift); color: var(--ink-2); font: inherit; font-size: 11.5px; font-weight: 700; min-width: 0 }
.tl-tile:hover:not(:disabled) { color: var(--ink) }
.tl-tile > img, .tl-tile > svg { width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; border-radius: 9px; display: block }
.tl-tile > b { font-size: 12px; line-height: 1.2; color: var(--ink) } .tl-tile > span { font-size: 10.5px; color: var(--ink-3); font-weight: 600 }
.tl-tile[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); color: var(--rose-deep) }
.tl-tile:disabled { opacity: .45; cursor: default }
.tl-tile > .tl-count { position: absolute; top: 4px; right: 4px }
/* fold-out section: <details class="tl-details"><summary><span>Adjust</span><span class="tl-muted">size · crop</span></summary><div class="bd">…</div></details> */
.tl-details { border: 1px solid var(--line); border-radius: 13px; background: var(--card-2); min-width: 0 }
.tl-details > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-weight: 700; font-size: 13px }
.tl-details > summary::-webkit-details-marker { display: none }
.tl-details > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin: -4px 2px 0 6px; flex: none }
.tl-details[open] > summary::after { transform: rotate(-135deg); margin-top: 4px }
.tl-details > summary > .tl-muted { margin-left: auto; font-weight: 600; font-size: 12px }
.tl-details > .bd { padding: 0 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px }
.tl-details > .bd > * { min-width: 0 }
/* a bar at the bottom of the screen on phones (main action always in reach) */
.tl-mobilebar { display: none }
@media (max-width: 980px) {
  .tl-mobilebar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 10px; align-items: center;
    padding: 10px max(14px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line) }
  .tl-mobilebar .meta { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1.2 }
  body:has(.tl-mobilebar) .tl-toast { bottom: 92px }
}

/* ── tooltips, info bubble, toast ───────────────────────────────────────────────────────────────── */
/* any element with data-tip="text" shows it on hover/focus. .tl-tip-below / .tl-tip-left move it by hand; otherwise tl.js opens it
   below or from a side when it wouldn't fit (window edges, sticky bars) */
[data-tip] { position: relative }
[data-tip]:hover, [data-tip]:focus-visible { z-index: 40 }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--tip); color: var(--tip-fg); font: 600 12px/1.35 var(--font); font-style: normal; letter-spacing: 0; text-transform: none; padding: 7px 10px; border-radius: 9px;
  width: max-content; max-width: 240px; white-space: normal; text-align: left; z-index: 20; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); pointer-events: none }
.tl-tip-below[data-tip]:hover::after, .tl-tip-below[data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px) }
.tl-tip-left[data-tip]:hover::after, .tl-tip-left[data-tip]:focus-visible::after { left: auto; right: 0; transform: none }
/* set by tl.js just before a tooltip shows, when it wouldn't fit: below (no room above, e.g. under the sticky bars), from the left or right edge */
.tl-tip-flip[data-tip]:hover::after, .tl-tip-flip[data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px) }
.tl-tip-start[data-tip]:hover::after, .tl-tip-start[data-tip]:focus-visible::after { left: 0; right: auto; transform: none }
.tl-tip-end[data-tip]:hover::after, .tl-tip-end[data-tip]:focus-visible::after { left: auto; right: 0; transform: none }
.tl-info { width: 17px; height: 17px; flex: 0 0 auto; border-radius: 50%; border: 0; padding: 0 1px 0 0; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-2);
  font: italic 700 11.5px/1 Georgia, 'Times New Roman', serif; display: inline-grid; place-items: center; cursor: help }
.tl-info:hover, .tl-info:focus-visible { background: color-mix(in srgb, var(--rose) 16%, transparent); color: var(--rose) }
/* TL.toast('Saved', { action: 'Undo', onAction }) */
.tl-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 90; background: var(--tip); color: var(--tip-fg); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 13px; box-shadow: var(--lift-strong); display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px) }
.tl-toast button { background: none; border: 0; color: var(--sparkle); font: inherit; font-weight: 800; cursor: pointer; padding: 0; white-space: nowrap }
.tl-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-box); background: var(--rose-soft); color: var(--ink); font-size: 13px }
.tl-note > .tl-icon { color: var(--rose); font-size: 16px; margin-top: 1px }
.tl-note.info { background: var(--well) } .tl-note.info > .tl-icon { color: var(--ink-2) }

/* ── split overlay: a picture (or other media) next to a long text or form ───────────────────────────────────────────
   <dialog class="… tl-split"><div class="hd">title + actions</div><div class="tl-split-body"><div class="tl-split-media">…</div>
     <div class="tl-split-main"><div class="tl-split-scroll">…</div><div class="tl-split-foot">Cancel · Save</div></div></div></dialog>
   Head and media stay, only .tl-split-scroll scrolls (its scrollbar ends above the buttons); .tl-split-foot (the form's buttons)
   is always in view, right-aligned with the .primary button last. On phones everything stacks and the body scrolls as one.
   (Looks Library / Townie Lab: a look's details.) */
dialog.tl-split[open] { display: flex; flex-direction: column; overflow: hidden }
dialog.tl-split > :first-child { flex: none }
dialog.tl-split .tl-split-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); align-items: stretch }
dialog.tl-split .tl-split-media { min-height: 0; overflow: hidden; align-self: start }
dialog.tl-split .tl-split-main { min-height: 0; display: flex; flex-direction: column; overflow: visible }   /* (visible: the buttons' shadow isn't cut) */
dialog.tl-split .tl-split-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px }
dialog.tl-split .tl-split-foot { flex: none; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px }
.tl-split-foot, .tl-split-foot > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end }
.tl-split-foot > div { flex: 1 1 auto; margin: 0 }
.tl-split-foot .primary { order: 9 }
.tl-split-foot .tl-btn { min-height: 44px; padding: 0 20px; font-size: 14px }   /* one size: the main button and Cancel side by side */
.tl-split-foot .tl-btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 14px -8px var(--rose) }
.tl-split-foot[hidden] { display: none }
@media (max-width: 720px) {
  dialog.tl-split .tl-split-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto }
  dialog.tl-split .tl-split-main, dialog.tl-split .tl-split-scroll { overflow: visible }
}
/* ── dialogs (native <dialog class="tl-dialog">) ────────────────────────────────────────────────── */
/* <dialog class="tl-dialog"><div class="hd"><h2>…</h2><button class="tl-iconbtn" data-close>…</button></div><div class="bd">…</div><div class="ft">buttons</div></dialog> */
.tl-dialog { border: 0; padding: 0; border-radius: 20px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--ink);
  box-shadow: var(--lift-strong); font-family: var(--font) }
.tl-dialog.wide { width: min(1100px, calc(100vw - 32px)) }
.tl-dialog::backdrop { background: rgba(20, 18, 24, .45); backdrop-filter: blur(3px) }
.tl-dialog > .hd { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0 }
.tl-dialog > .hd h2 { font-size: 17px; letter-spacing: -.01em; flex: 1; min-width: 0 }
.tl-dialog[open] { display: flex; flex-direction: column }   /* a long body scrolls; the head and the buttons stay */
.tl-dialog > .bd { padding: 14px 18px 18px; display: grid; gap: 14px; overflow: auto; min-height: 0; flex: 1 1 auto; align-content: start }
.tl-dialog > .hd, .tl-dialog > .ft { flex: none }
.tl-dialog > .ft { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; flex-wrap: wrap }

/* ── loading ────────────────────────────────────────────────────────────────────────────────────── */
.tl-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--rose) 22%, transparent); border-top-color: var(--rose);
  animation: tl-spin .8s linear infinite; flex: none; display: inline-block }
/* full-page start screen with the brand mark: <div class="tl-boot" role="status">TL.mark(56, true) <span>Loading…</span></div> */
.tl-boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--ink-2); font-weight: 600; font-size: 14px; text-align: center; padding: 24px; transition: opacity .25s ease; z-index: 100 }
.tl-boot.done { opacity: 0; pointer-events: none }
.tl-boot.fail { color: var(--rose) }
.tl-boot svg { border-radius: 13px; box-shadow: var(--lift) }
.tl-boot .tl-spark { transform-origin: 79px 22.5px; animation: tl-twinkle 1.6s ease-in-out infinite }
.tl-bar { height: 6px; border-radius: 999px; background: var(--bar); overflow: hidden }
.tl-bar > i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--sparkle)); transition: width .3s }
