/* Top-bar palette button and theme picker (assets/js/theme-picker.js). Preview cards follow the app's
   Appearance ▸ Themes cards (laboratory/Web/appearance-ui.css .source-theme-*). */
.tp-wrap { position: relative; display: flex; align-items: center; }
.tp-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .14s cubic-bezier(.23,1,.32,1), color .14s; }
.tp-btn:hover, .tp-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.tp-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--ink) 50%, transparent); outline-offset: 2px; }
.tp-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-btn svg circle { fill: currentColor; stroke: none; }

.tp-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 372px; padding: 14px; border-radius: 16px; background: var(--card-2); color: var(--ink); box-shadow: 0 18px 48px rgba(0,0,0,.28), inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent); }
.tp-pop[hidden] { display: none; }
.tp-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 11px; align-items: start; }
.tp-opt { position: relative; display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 5px; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.tp-opt strong { font-size: 12.5px; font-weight: 600; padding: 0 2px; }
.tp-opt small { font-size: 10.5px; line-height: 1.45; color: var(--muted); padding: 0 2px; }
.tp-opt:focus-visible { outline: none; }
.tp-opt:focus-visible .tp-prev { outline: 2px solid color-mix(in srgb, var(--ink) 50%, transparent); outline-offset: 3px; }
.tp-opt[aria-checked="true"] .tp-prev { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.tp-opt[aria-checked="true"]::after { content: "✓"; position: absolute; right: 7px; top: 7px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700; background: var(--ink); color: var(--page); }

/* Mini window: frame → rounded page → card with "Aa" and a Log Trade pill, in that theme's own colours. */
.tp-prev { position: relative; display: block; aspect-ratio: 1.6; border-radius: 9px; background: var(--th-frame); box-shadow: inset 0 0 0 1px var(--th-edge); container-type: inline-size; transition: transform .26s cubic-bezier(.23,1,.32,1); }
.tp-opt:hover .tp-prev { transform: translateY(-2px); }
.tp-page { position: absolute; inset: 9% 8% 0; border-radius: 7px 7px 0 0; background: var(--th-page); box-shadow: inset 0 0 0 1px var(--th-edge); }
.tp-card { position: absolute; inset: 14% 11% 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6%; padding: 8%; border-radius: 6px 6px 0 0; background: var(--th-card); color: var(--th-ink); box-shadow: inset 0 0 0 1px var(--th-edge); }
.tp-card b { font-size: clamp(16px, 16cqw, 30px); line-height: 1; letter-spacing: -.03em; font-weight: 600; }
.tp-card i { font-style: normal; font-size: 8.5px; font-weight: 600; line-height: 1; padding: 4px 6px; border-radius: 5px; background: var(--th-ink); color: var(--th-card); }

@media (max-width: 520px) { .tp-pop { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; } }
