/* Theme manager (v1.9.0, docs/THEME-MANAGER-V1.md): Settings -> Themes. The panel borrows the look of the account panel (same --sw-* tokens). */
.tm-panel{z-index:960;background:color-mix(in srgb,var(--sw-bg,#061923) 86%,transparent)}
.tm-panel[hidden]{display:none}
.tm-card{width:min(100%,460px);max-height:calc(calc(100 * var(--udvh)) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));display:flex;flex-direction:column;padding:18px 16px 12px;gap:10px;border:1px solid var(--sw-line,#88b9d333);border-radius:25px;color:var(--sw-text,#f2f7fc);background:var(--sw-decor,none) center top/cover no-repeat,var(--sw-bg,#0b2633);box-shadow:0 20px 70px var(--sw-shadow,#00000050)}
.tm-card .ui-head{position:relative;min-height:36px;padding:0 0 4px;border:0;gap:8px;align-items:center;flex:none}
.tm-card .ui-head strong{font-size:18px;letter-spacing:-.02em;font-weight:750;flex:1;color:var(--sw-header,var(--sw-text))}
.tm-card #tmClose{order:-1;width:36px;height:36px;min-height:36px;min-width:36px;padding:0;border:0;background:transparent;box-shadow:none;color:var(--sw-text,#f2f7fc);font-size:0}
.tm-card #tmClose::before{content:'‹';font:32px/1 system-ui}
/* the bar at the top, under the title: the commands for all themes; it does not move while the cards scroll (a filter icon joins it later) */
.tm-bar{flex:none;display:grid;gap:8px;padding:10px 12px;border:1px solid var(--sw-line,#88b9d333);border-radius:16px;background:var(--sw-surface-2,#173442d9);box-shadow:0 4px 12px #0000000f}
.tm-summary{margin:0;font-size:13px;font-weight:650}
.tm-tools{display:flex;gap:8px;align-items:center}
.tm-tools[hidden]{display:none}
.tm-confirm{padding:10px;border:1px solid #d6453d99;border-radius:12px;background:color-mix(in srgb,#d6453d 14%,transparent)}
.tm-confirm[hidden]{display:none}
.tm-confirm p{margin:0 0 10px;font-size:13px}
.tm-confirm div{display:flex;gap:8px;justify-content:flex-end}
.tm-confirm button{min-height:36px;padding:6px 16px;border:1px solid var(--sw-line,#9994);border-radius:999px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.tm-confirm button.tm-danger{border-color:#d6453d;background:linear-gradient(165deg,#e0554c,#b3302a);color:#fff}
.tm-list{list-style:none;margin:0;padding:0;overflow:auto;flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:22px;padding:4px 2px 14px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
/* a card like the launcher's picture: it reuses .theme-preview-art / .theme-vignette / .theme-preview-label of css/game.css */
.tm-row.tm-theme{flex:none;color:#fff;position:relative;inset:auto;width:100%;aspect-ratio:1.2;min-height:210px;border-radius:20px;border:1px solid #ffffff55;box-shadow:0 8px 20px #00000055,0 2px 5px #00000040;box-sizing:border-box;overflow:hidden;transition:none}
.tm-row.is-hidden .theme-preview-art{opacity:.45;filter:grayscale(.55)}
.tm-row .theme-preview-label{left:16px;right:16px;bottom:16px;pointer-events:none}
.tm-row .theme-preview-label strong{font-size:clamp(21px,calc(5.6 * var(--uvw)),30px);overflow-wrap:anywhere}
.tm-row .theme-preview-label p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tm-row .tm-meta{margin-top:4px;opacity:.9}
.tm-row .theme-preview-label .tm-note{color:#ffd16b;font-weight:600;max-width:none}
.tm-new{font-style:normal;font-size:11px;font-weight:700;padding:1px 7px;margin-left:4px;border-radius:999px;background:#0a8f7a;color:#fff;vertical-align:3px;text-shadow:none}
/* the icons stacked on the left; the art design brush (js/theme-badge.js, css/theme-badge.css) is on the right */
.tm-side{position:absolute;top:10px;left:10px;z-index:5;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.tm-btn{position:relative;flex:none;width:38px;height:38px;min-height:38px;min-width:38px;padding:0;border-radius:50%;border:1px solid #ffffffa8;background:#14232cd9;color:#fff;display:inline-grid;place-items:center;cursor:pointer;box-shadow:0 2px 8px #0006}
.tm-btn[aria-disabled="true"]{cursor:default}
.tm-btn:disabled{opacity:.4;cursor:default}
.tm-btn.is-globe,.tm-btn.is-download{background:#0a8f7ad9}
.tm-btn.is-ring{background:#14232cd9}
.tm-btn.is-update{background:#2b6cb0d9}
.tm-btn.is-lock{background:#5a4a8ad9}
.tm-btn.is-x{background:#5a6b75d9}
.tm-btn.is-error{background:#b3261ed9}
.tm-btn.is-trash{background:#5a3a3ad9}
.tm-btn.is-trash.is-armed{width:auto;min-width:68px;padding:0 14px;border-radius:19px;background:linear-gradient(165deg,#e0554c,#b3302a)}
.tm-sure{font:700 13px/1 system-ui}
.tm-btn.is-eye{background:#2f4a57d9}
.tm-btn.is-eye.is-off{background:#2a3338;color:#ffffffb0}
.tm-btn:focus-visible,.tm-tool:focus-visible,.tm-confirm button:focus-visible,.tm-row .ta-icon:focus-visible{outline:3px solid #ffd16b;outline-offset:2px}
@media(max-width:380px){.tm-row{grid-template-columns:40px minmax(0,1fr) auto;gap:8px}.tm-thumb{width:40px;height:54px}.tm-btn{width:36px;height:36px;min-height:36px;min-width:36px}}
