/* ============================================================================
   T2IG TEMPLATES UI - shared by the home-page rail and /templates.
   Dark, cyan/violet/pink, Inter - same tokens as the rest of t2ig.com.
   The looping before/after "wipe" is pure CSS (registered custom property), so the
   cards animate with zero JS and cost nothing on a phone. Videos only play while
   visible (templates-ui.js).
   ========================================================================== */
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 100%; }

.tpl, .tp, .td {
  --t-cyan: var(--cyan, #00e5ff);
  --t-violet: var(--violet, #9b5cff);
  --t-pink: var(--pink, #ff2d78);
  --t-grad: linear-gradient(135deg, var(--t-cyan) 0%, var(--t-violet) 50%, var(--t-pink) 100%);
  --t-w8: rgba(255,255,255,.08);
  --t-w12: rgba(255,255,255,.12);
  --t-w20: rgba(255,255,255,.20);
  --t-w65: rgba(255,255,255,.65);
  --t-w45: rgba(255,255,255,.45);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- card ---------- */
.tcard {
  --a1: #9b5cff; --a2: #00e5ff; --delay: 0s;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  text-align: left; color: #fff; cursor: pointer; background: none; border: 0; padding: 0;
  width: 100%; -webkit-tap-highlight-color: transparent;
}
.tcard:focus-visible { outline: 2px solid var(--t-cyan); outline-offset: 6px; border-radius: 20px; }
.tmedia {
  position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; isolation: isolate;
  background: #0a0a12; border: 1px solid var(--t-w12);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .35s;
}
.tcard.is-tall .tmedia { aspect-ratio: 4 / 5; }
.tcard.is-feature .tmedia { aspect-ratio: 4 / 5; }   /* featured cards use the same size and portrait shape as the grid below */
.tcard::before { /* glow that rises on hover */
  content: ''; position: absolute; inset: -2px -2px auto -2px; height: 70%;
  background: radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--a1) 55%, transparent), transparent 70%);
  opacity: 0; filter: blur(22px); transition: opacity .4s; pointer-events: none; z-index: -1;
}
@media (hover: hover) {
  .tcard:hover .tmedia { transform: translateY(-4px); border-color: color-mix(in srgb, var(--a1) 60%, #fff 10%); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--a1) 70%, transparent); }
  .tcard:hover::before { opacity: .55; }
  .tcard:hover .tcta { opacity: 1; transform: translateY(0); }
}

/* ----- the two layers, before (top, clipped) and after (base) ----- */
.tlayer { position: absolute; inset: 0; }
/* vertical clips: contained (nothing cut off) over a blurred copy of the poster */
.tcard.is-vert .tmedia::before { content: ''; position: absolute; inset: -24px; background: var(--poster, none) center / cover, #0a0a12; filter: blur(26px) brightness(.55) saturate(1.2); z-index: 0; }
.tcard.is-vert .tlayer { z-index: 1; }
.tcard.is-vert .tlayer video { object-fit: contain; }
.tlayer img, .tlayer video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbefore { clip-path: inset(0 calc(100% - var(--p)) 0 0); animation: twipe 7s cubic-bezier(.65,0,.35,1) var(--delay) infinite; z-index: 2; }
.tdiv {
  position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; z-index: 3;
  background: linear-gradient(180deg, transparent, #fff 18%, #fff 82%, transparent);
  box-shadow: 0 0 14px rgba(255,255,255,.7); animation: twipe 7s cubic-bezier(.65,0,.35,1) var(--delay) infinite;
}
.tdiv::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
@keyframes twipe {
  0%, 14%   { --p: 100%; }
  42%, 62%  { --p: 0%; }
  90%, 100% { --p: 100%; }
}
.tlabel {
  position: absolute; top: 10px; z-index: 4; font: 700 10px/1 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 8px; border-radius: 999px; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); color: #fff; border: 1px solid var(--t-w20);
}
.tlabel.b { left: 10px; animation: tfadeb 7s var(--delay) infinite; }
.tlabel.a { right: 10px; animation: tfadea 7s var(--delay) infinite; }
@keyframes tfadeb { 0%, 22% { opacity: 1; } 34%, 82% { opacity: 0; } 92%, 100% { opacity: 1; } }
@keyframes tfadea { 0%, 30% { opacity: 0; } 46%, 66% { opacity: 1; } 80%, 100% { opacity: 0; } }

/* ----- designed placeholder (no real media yet) ----- */
.tph-bg { position: absolute; inset: 0; background:
  radial-gradient(90% 70% at 15% 10%, color-mix(in srgb, var(--a1) 55%, transparent), transparent 60%),
  radial-gradient(80% 80% at 90% 95%, color-mix(in srgb, var(--a2) 50%, transparent), transparent 62%),
  #0b0b14; }
.tph-before { position: absolute; inset: 0; filter: grayscale(1) brightness(.62) contrast(.9); }
.tph-glyph { position: absolute; inset: 0; display: grid; place-items: center; }
.tph-glyph svg { width: 34%; height: 34%; fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .9;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--a1) 80%, transparent)); }
.tph-grid { position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(var(--t-w20) 1px, transparent 1px), linear-gradient(90deg, var(--t-w20) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
.tph-chip { position: absolute; left: 10px; bottom: 10px; z-index: 5; font: 600 10px/1 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 999px; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); color: var(--t-w65); border: 1px dashed var(--t-w20); }

/* play badge for video templates */
.tplay { position: absolute; right: 10px; bottom: 10px; z-index: 5; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px); border: 1px solid var(--t-w20); }
.tplay svg { width: 12px; height: 12px; fill: #fff; margin-left: 1px; }

/* ----- text under the media ----- */
.tinfo { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.ttitle { font: 600 15px/1.25 'Inter', sans-serif; letter-spacing: -.005em; }
.tcard.is-feature .ttitle { font-size: inherit; }
.ttag { font: 400 13px/1.45 'Inter', sans-serif; color: var(--t-w65); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.tmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.tpill { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 'Inter', sans-serif; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--t-w65); border: 1px solid var(--t-w8); }
.tpill i { width: 6px; height: 6px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 8px var(--a1); }
.tpill.cr { color: #fff; background: color-mix(in srgb, var(--a1) 22%, transparent); border-color: color-mix(in srgb, var(--a1) 45%, transparent); }
.tpill.soon { color: #ffc857; background: rgba(255,200,87,.1); border-color: rgba(255,200,87,.3); }
.tpill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tcta { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; opacity: 0; transform: translateY(8px); transition: .3s; pointer-events: none;
  display: none; }
@media (hover: hover) { .tcta { display: flex; } }
.tcta span { margin: 0 auto; padding: 10px 16px; border-radius: 999px; background: #fff; color: #000; font: 700 13px/1 'Inter', sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

@media (prefers-reduced-motion: reduce) {
  .tbefore, .tdiv, .tlabel { animation: none !important; }
  .tbefore { clip-path: inset(0 50% 0 0); }
  .tdiv { left: 50%; }
  .tlabel.a, .tlabel.b { opacity: 1; }
}

/* ============================ HOME RAIL ============================ */
.tpl { position: relative; max-width: var(--max, 1280px); margin: 0 auto; padding: 34px 24px 10px; }
.tpl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tpl-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 11px/1 'Inter', sans-serif; letter-spacing: .16em; color: var(--t-cyan); margin-bottom: 8px; }
.tpl-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--t-cyan); box-shadow: 0 0 10px var(--t-cyan); }
.tpl-title { font: 800 clamp(22px, 3vw, 32px)/1.1 'Inter', sans-serif; letter-spacing: -.02em; }
.tpl-title .grad { background: var(--t-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tpl-all { flex: none; display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 'Inter', sans-serif; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--t-w20); transition: .25s; }
.tpl-all:hover { background: #fff; color: #000; border-color: #fff; }
.tpl-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 14px; -webkit-overflow-scrolling: touch; }
.tpl-chips::-webkit-scrollbar { display: none; }
.tchip { flex: none; font: 500 13px/1 'Inter', sans-serif; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--t-w8); color: var(--t-w65); cursor: pointer; transition: .2s; white-space: nowrap; }
.tchip:hover { color: #fff; border-color: var(--t-w20); }
.tchip[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.tchip small { opacity: .55; margin-left: 5px; font-size: 11px; }

.tpl-railwrap { position: relative; margin: 0 -24px; }
.tpl-rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding: 6px 24px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding-left: 24px; }
.tpl-rail::-webkit-scrollbar { display: none; }
.tpl-rail .tcard { flex: 0 0 var(--cw, 236px); width: var(--cw, 236px); scroll-snap-align: start; }
.tpl-railwrap::before, .tpl-railwrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 56px; z-index: 5; pointer-events: none; transition: opacity .25s; }
.tpl-railwrap::before { left: 0; background: linear-gradient(90deg, #000, transparent); opacity: 0; }
.tpl-railwrap::after { right: 0; background: linear-gradient(270deg, #000, transparent); }
.tpl-railwrap.at-start::before { opacity: 0; }
.tpl-railwrap.scrolled::before { opacity: 1; }
.tpl-railwrap.at-end::after { opacity: 0; }
.tpl-arrow { position: absolute; top: 112px; z-index: 6; width: 44px; height: 44px; border-radius: 50%; display: none; place-items: center; background: rgba(10,10,18,.85); backdrop-filter: blur(10px); border: 1px solid var(--t-w20); color: #fff; cursor: pointer; transition: .2s; }
.tpl-arrow:hover { background: #fff; color: #000; }
.tpl-arrow.l { left: 14px; } .tpl-arrow.r { right: 14px; }
.tpl-arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (min-width: 900px) { .tpl-arrow { display: grid; } }
.tpl-arrow[hidden] { display: none !important; }

/* the closing tile of the rail */
.tmore { flex: 0 0 var(--cw, 236px); width: var(--cw, 236px); scroll-snap-align: start; display: flex; }
.tmore a { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; aspect-ratio: 1 / 1; max-height: var(--cw, 236px);
  border-radius: 18px; border: 1px solid var(--t-w20); background: radial-gradient(90% 90% at 50% 0%, rgba(155,92,255,.28), transparent 70%), rgba(255,255,255,.03); transition: .3s; padding: 18px; }
.tmore a:hover { border-color: #fff; transform: translateY(-4px); }
.tmore b { font: 800 22px/1.1 'Inter', sans-serif; letter-spacing: -.02em; }
.tmore b span { display: block; font-size: 38px; background: var(--t-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tmore em { font: 500 13px/1.3 normal 'Inter', sans-serif; font-style: normal; color: var(--t-w65); }
.tmore .go { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #000; }
.tmore .go svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 720px) {
  .tpl { padding: 26px 16px 4px; --cw: min(64vw, 250px); }
  .tpl-railwrap { margin: 0 -16px; } .tpl-rail { padding: 4px 16px 14px; scroll-padding-left: 16px; gap: 12px; }
  .tpl-head { align-items: center; } .tpl-all { padding: 9px 13px; font-size: 13px; }
  .tpl-railwrap::after { width: 34px; }
}

/* ============================ FULL PAGE ============================ */
.tp { max-width: 1280px; margin: 0 auto; padding: calc(var(--t2nav-h, 60px) + 34px) 24px 80px; }
.tp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.tp-h1 { font: 800 clamp(34px, 5vw, 56px)/1.02 'Inter', sans-serif; letter-spacing: -.03em; }
.tp-h1 .grad { background: var(--t-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-sub { color: var(--t-w65); font: 400 16px/1.5 'Inter', sans-serif; margin-top: 12px; max-width: 560px; }
.tp-search { position: relative; flex: 0 1 340px; min-width: 220px; }
.tp-search input { width: 100%; padding: 14px 16px 14px 44px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--t-w12); color: #fff; font: 400 15px/1 'Inter', sans-serif; transition: .2s; }
.tp-search input:focus { border-color: var(--t-cyan); background: rgba(255,255,255,.09); }
.tp-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--t-w65); fill: none; stroke-width: 2; stroke-linecap: round; }

.tp-bar { position: sticky; top: var(--t2nav-h, 60px); z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 0; margin: 0 0 18px;
  background: linear-gradient(180deg, rgba(8,9,13,.94) 72%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tp-bar .tpl-chips { flex: 1; padding: 0; }
.tp-kind { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--t-w8); }
.tp-kind button { font: 600 12.5px/1 'Inter', sans-serif; padding: 8px 12px; border-radius: 999px; color: var(--t-w65); cursor: pointer; background: none; border: 0; }
.tp-kind button[aria-pressed="true"] { background: #fff; color: #000; }
.tp-sort { flex: none; font: 500 13px/1 'Inter', sans-serif; padding: 10px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--t-w12); color: #fff; cursor: pointer; }
.tp-sort option { color: #000; }
@media (max-width: 900px) { .tp-bar { flex-wrap: wrap; } .tp-bar .tpl-chips { flex: 1 0 100%; order: 3; } }

.tp-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 30px 20px; margin-bottom: 38px; }
.tp-sec { font: 700 12px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--t-w45); margin: 4px 0 16px; display: flex; align-items: center; gap: 12px; }
.tp-sec::after { content: ''; flex: 1; height: 1px; background: var(--t-w8); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 30px 20px; }
.tp-empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--t-w65); }
.tp-empty b { display: block; font: 700 20px/1.2 'Inter', sans-serif; color: #fff; margin-bottom: 8px; }
.tp-more { margin-top: 56px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: 20px; border: 1px solid var(--t-w12);
  background: radial-gradient(70% 140% at 0% 0%, rgba(155,92,255,.22), transparent 60%), rgba(255,255,255,.03); }
.tp-more b { display: block; font: 700 18px/1.2 'Inter', sans-serif; } .tp-more span { color: var(--t-w65); font-size: 14px; }
.tp-more a { padding: 13px 20px; border-radius: 999px; background: #fff; color: #000; font: 700 14px/1 'Inter', sans-serif; }
@media (max-width: 720px) { .tp-featured { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; } }
@media (max-width: 720px) { .tp { padding-left: 16px; padding-right: 16px; } .tp-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; } .tp-top { gap: 16px; } .tp-search { flex: 1 1 100%; } }
@media (max-width: 420px) { .tcard .ttag { -webkit-line-clamp: 3; } .ttitle { font-size: 14px; } }

/* ============================ DETAIL SHEET ============================ */
.td { position: fixed; inset: 0; z-index: 1000; display: none; }
.td.open { display: block; }
.td-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); animation: tdfade .25s both; }
.td-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(980px, 100%); background: #07070d; border-left: 1px solid var(--t-w12); display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; animation: tdin .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes tdfade { from { opacity: 0; } } @keyframes tdin { from { transform: translateX(40px); opacity: 0; } }
.td-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); border: 1px solid var(--t-w20); color: #fff; cursor: pointer; }
.td-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.td-left { position: relative; padding: 22px; overflow-y: auto; background: radial-gradient(80% 50% at 20% 0%, color-mix(in srgb, var(--a1, #9b5cff) 22%, transparent), transparent 70%); }
.td-right { padding: 26px 26px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; border-left: 1px solid var(--t-w8); }
.td-media { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 1 / 1; border: 1px solid var(--t-w12); background: #0a0a12; }
.td-media .tmedia { border: 0; border-radius: 0; height: 100%; aspect-ratio: auto; transform: none !important; box-shadow: none !important; }
.td-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin-top: 14px; }
.td-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--t-w12); background: #0a0a12; }
.td-thumb img { width: 100%; height: 100%; object-fit: cover; }
.td-thumb span { position: absolute; left: 6px; bottom: 6px; right: 6px; font: 600 10.5px/1.2 'Inter', sans-serif; padding: 5px 7px; border-radius: 8px; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); }
.td-h { font: 800 28px/1.1 'Inter', sans-serif; letter-spacing: -.02em; padding-right: 44px; }
.td-p { color: var(--t-w65); font: 400 15px/1.5 'Inter', sans-serif; margin-top: 8px; }
.td-block h4 { font: 700 11px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--t-w45); margin-bottom: 10px; }
.td-out { display: flex; flex-wrap: wrap; gap: 8px; }
.td-out span { font: 500 12.5px/1 'Inter', sans-serif; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--t-w8); display: inline-flex; gap: 7px; align-items: center; }
.td-out span em { font-style: normal; color: var(--t-w45); font-size: 11px; }
.td-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.td-field label { font: 600 13px/1.2 'Inter', sans-serif; display: flex; justify-content: space-between; gap: 10px; }
.td-field label small { font-weight: 400; color: var(--t-w45); }
.td-field .help { font: 400 12.5px/1.4 'Inter', sans-serif; color: var(--t-w45); }
.td-drop { position: relative; display: grid; place-items: center; text-align: center; min-height: 104px; padding: 16px; border-radius: 14px; border: 1.5px dashed var(--t-w20); background: rgba(255,255,255,.03); cursor: pointer; transition: .2s; overflow: hidden; }
.td-drop:hover, .td-drop.over { border-color: var(--t-cyan); background: rgba(0,229,255,.06); }
.td-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.td-drop .ic { width: 22px; height: 22px; stroke: var(--t-w65); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.td-drop b { display: block; font: 600 13.5px/1.2 'Inter', sans-serif; } .td-drop span { font: 400 12px/1.3 'Inter', sans-serif; color: var(--t-w45); }
.td-drop.has { padding: 0; min-height: 0; border-style: solid; }
.td-drop.has img, .td-drop.has video { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.td-drop .rm { position: absolute; top: 8px; right: 8px; z-index: 3; padding: 6px 9px; border-radius: 999px; background: rgba(0,0,0,.65); font: 600 11px/1 'Inter', sans-serif; border: 1px solid var(--t-w20); }
.td-text, .td-select { width: 100%; padding: 13px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--t-w12); color: #fff; font: 400 14.5px/1.3 'Inter', sans-serif; transition: .2s; }
.td-text:focus, .td-select:focus { border-color: var(--t-cyan); } .td-select option { color: #000; }
.td-foot { margin-top: auto; position: sticky; bottom: -22px; padding: 16px 0 4px; background: linear-gradient(180deg, transparent, #07070d 26%); }
.td-quote { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 500 13.5px/1.3 'Inter', sans-serif; color: var(--t-w65); margin-bottom: 12px; }
.td-quote b { color: #fff; font-weight: 700; font-size: 15px; }
.td-go { width: 100%; padding: 17px; border-radius: 14px; font: 800 16px/1 'Inter', sans-serif; color: #000; background: var(--t-grad); cursor: pointer; border: 0; transition: .25s; box-shadow: 0 12px 30px -12px rgba(155,92,255,.7); }
.td-go:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.td-go:disabled { background: rgba(255,255,255,.1); color: var(--t-w45); cursor: not-allowed; box-shadow: none; }
.td-note { font: 400 12.5px/1.45 'Inter', sans-serif; color: var(--t-w45); margin-top: 10px; text-align: center; }
.td-note.warn { color: #ffc857; }
.td-result { display: none; }
.td-result.show { display: block; }
.td-run { display: none; gap: 10px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--t-w12); background: rgba(255,255,255,.04); font: 500 14px/1.3 'Inter', sans-serif; }
.td-run.show { display: flex; }
.td-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--t-w20); border-top-color: var(--t-cyan); animation: tdspin .8s linear infinite; flex: none; }
@keyframes tdspin { to { transform: rotate(360deg); } }
.td-res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.td-res-grid .it { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--t-w12); background: #0a0a12; aspect-ratio: 1; }
.td-res-grid .it img, .td-res-grid .it video { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-res-grid .it span { position: absolute; left: 8px; bottom: 8px; font: 600 11px/1 'Inter', sans-serif; padding: 6px 8px; border-radius: 999px; background: rgba(0,0,0,.65); }
.td-res-grid .it a { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.65); border: 1px solid var(--t-w20); }
.td-res-grid .it a svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.td-err { display: none; padding: 18px; border-radius: 16px; border: 1px solid rgba(255,45,120,.4); background: rgba(255,45,120,.08); }
.td-err.show { display: block; }
.td-err b { display: block; font: 800 20px/1.2 'Inter', sans-serif; margin-bottom: 6px; } .td-err span { font: 400 15px/1.5 'Inter', sans-serif; color: var(--t-w65); }

@media (max-width: 860px) {
  .td-panel { grid-template-columns: 1fr; grid-template-rows: auto 1fr; top: 6vh; border-radius: 22px 22px 0 0; border-left: 0; border-top: 1px solid var(--t-w12); animation-name: tdup; }
  @keyframes tdup { from { transform: translateY(40px); opacity: 0; } }
  .td-left { padding: 14px 14px 0; overflow: visible; } .td-media { aspect-ratio: 16 / 10; max-height: 34vh; }
  .td-thumbs { display: none; }
  .td-right { border-left: 0; padding: 18px 18px 18px; } .td-h { font-size: 23px; }
  .td-panel { overflow-y: auto; display: block; } .td-left, .td-right { overflow: visible; }
  .td-foot { bottom: -18px; }
}
body.td-lock { overflow: hidden; }

/* home placement: the row sits between the hero and the features strip */
.tpl-section{position:relative;padding:clamp(28px,5vw,56px) 0 clamp(8px,2vw,20px)}
.tpl-wrap{max-width:1280px;margin:0 auto;padding:0 clamp(14px,3vw,28px)}


/* phone refinements (verified in a 390px frame) */
@media (max-width: 720px) {
  .tp-bar { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 4px 0 0; gap: 10px; margin-bottom: 14px; }
  .tp-bar .tp-kind { order: 1; flex: 1 1 auto; min-width: 0; }
  .tp-bar .tp-kind button { flex: 1; padding: 8px 6px; }
  .tp-bar .tp-sort { order: 2; max-width: 46%; }
  .tp-bar .tpl-chips { order: 3; margin: 0 -16px; padding: 0 16px; }
  .td-media .tlabel.a { right: 60px; }
}
/* cards are real links now */
a.tcard { display: block; text-decoration: none; color: inherit; text-align: left; }

/* ---- live homepage (#pvRoot) fit: same gutters, rail bleed and card sizes as the curated rails ---- */
.tplsec .tpl { max-width: none; margin: 0; padding: 0; --cw: 172px; }
.tplsec .tpl-chips { padding: 2px var(--pad, 14px) 12px; }
.tplsec .tpl-railwrap { margin: 0; }
.tplsec .tpl-rail { gap: 10px; padding: 2px var(--pad, 14px) 8px; scroll-padding-left: var(--pad, 14px); }
@media (min-width: 430px) { .tplsec .tpl { --cw: 196px; } }
@media (min-width: 900px) { .tplsec .tpl { --cw: 252px; } .tplsec .tpl-rail { gap: 14px; } }
@media (min-width: 1400px) { .tplsec .tpl { --cw: 280px; } }
