/* Themes screens (themes.js, themes-preview.js). Uses the portal's colour tokens; the phone preview takes its
   colours from the theme being previewed. */
.th-all{ display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 2px solid var(--edge); }
.th-all h3{ margin: 0 0 4px; }
.th-bar{ display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.th-overlap, .th-plan{ margin: 8px 0 0; padding-left: 18px; }
.th-plan{ max-height: 240px; overflow: auto; }
.th-edit{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px; align-items: start; }
.th-side{ position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 1280px){ .th-edit{ grid-template-columns: minmax(0, 1fr); } .th-side{ position: static; max-height: none; } }
.th-part{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 0.875rem; }
.th-slots{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.th-slot{ border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; min-width: 0; }
.th-slot legend{ padding: 0 6px; font-size: 0.875rem; font-weight: 600; }
.th-emoji{ margin-bottom: 10px; font-size: 0.875rem; }
.th-emoji summary{ cursor: pointer; }
.th-emoji div{ display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.th-emoji button{ width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface-2); cursor: pointer; font-size: 1.1rem; }
.th-pic{ display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.th-pic .hint, .th-pic .field-error{ flex-basis: 100%; margin: 0; }
.th-pic label.btn{ cursor: pointer; }
.th-pic label.btn:focus-within{ outline: 2px solid var(--brand); outline-offset: 2px; }
.th-thumb{ max-width: 140px; max-height: 70px; border-radius: 8px; border: 1px solid var(--line-2); }
.th-text .tabs{ flex-wrap: wrap; }
.th-missing{ color: var(--ink-faint); }
.pg-row .field.th-colour{ flex-basis: min(100%, 210px); }
.th-colour > div{ display: flex; gap: 8px; }
.field.th-colour input[type="color"]{ width: 48px; flex: 0 0 48px; padding: 4px; cursor: pointer; }
.field.th-colour input:not([type="color"]){ flex: 1; min-width: 0; width: auto; }
.pg-warnline{ color: var(--warning); }

.tp-phones{ display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; justify-content: center; }
.tp-wrap{ margin: 0; width: min(100%, 270px); }
.tp-wrap figcaption{ margin-bottom: 6px; }
.tp-phone{ position: relative; height: 520px; border-radius: 32px; border: 8px solid #17171A; overflow: hidden; font-size: 0.8125rem; display: flex; flex-direction: column; }
.tp-head{ position: relative; padding: 14px 12px 12px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; }
.tp-hero{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tp-top, .tp-greet{ position: relative; display: flex; align-items: center; gap: 8px; }
.tp-brand{ font-weight: 700; }
.tp-greet{ justify-content: space-between; gap: 4px; }
.tp-greet .tp-sal{ font-size: 0.6875rem; }
.tp-sal{ display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; justify-content: center; font-weight: 600; }
.tp-cut{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-slot{ display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tp-slot img{ width: 100%; height: 100%; object-fit: contain; }
.tp-logo{ width: 28px; height: 28px; font-size: 1.25rem; }
.tp-side{ width: 28px; height: 28px; font-size: 1.35rem; }
.tp-icon{ width: 18px; height: 18px; }
.tp-body{ padding: 10px; overflow: auto; flex: 1; }
.tp-banner{ width: 100%; aspect-ratio: 1143 / 462; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.tp-card{ padding: 10px; border-radius: 14px; margin-bottom: 10px; overflow-wrap: anywhere; }
.tp-card strong, .tp-modal strong{ display: block; }
.tp-card p, .tp-modal p{ margin: 4px 0 8px; }
.tp-card em{ font-style: normal; opacity: .75; }
.tp-media{ display: flex; width: 100%; aspect-ratio: 1143 / 462; font-size: 2.4rem; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.tp-square{ aspect-ratio: 1; max-width: 150px; margin-inline: auto; }
.tp-btn{ display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 600; }
.tp-route{ font-size: 0.6875rem; opacity: .75; }
.tp-veil{ position: absolute; inset: 0; background: rgb(0 0 0 / .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 3; }
.tp-modal{ width: 100%; border-radius: 20px; padding: 14px; text-align: center; overflow-wrap: anywhere; max-height: 100%; overflow: auto; }
.tp-close{ display: block; margin-top: 8px; text-decoration: underline; }
.tp-greeting{ position: absolute; left: 14px; right: 14px; top: 150px; z-index: 2; border-radius: 20px; padding: 14px; text-align: center; overflow-wrap: anywhere; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.tp-greeting strong{ display: block; }
.tp-greeting p{ margin: 4px 0 0; }
.tp-nopic{ font-size: 0.6875rem; opacity: .75; }
.tp-motion, .tp-burst{ position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.tp-piece{ position: absolute; width: 20px; height: 20px; font-size: 1rem; }
.tp-piece .tp-slot{ width: 100%; height: 100%; }
.tp-fall{ animation: tp-fall 5s linear infinite both; }
.tp-rise{ animation: tp-rise 5s linear infinite both; }
.tp-twinkle{ animation: tp-twinkle 2.4s ease-in-out infinite both; }
.tp-burst .tp-piece{ animation: tp-burst 1.6s ease-out both; }
@keyframes tp-fall{ from{ transform: translateY(-24px); } to{ transform: translateY(530px); } }
@keyframes tp-rise{ from{ transform: translateY(530px); } to{ transform: translateY(-24px); } }
@keyframes tp-twinkle{ 0%, 100%{ opacity: .15; transform: scale(.7); } 50%{ opacity: 1; transform: scale(1); } }
@keyframes tp-burst{ from{ transform: translateY(260px) scale(.4); opacity: 1; } to{ transform: translateY(40px) scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce){ .tp-piece{ animation: none !important; top: 30% !important; } .tp-burst{ display: none; } }
