:root { color-scheme: light; --lite-background: #f3f5f9; --lite-text: #142237; --lite-muted: #546277; --lite-border: #d8dfeb; --lite-accent: #1649ff; --lite-hover: #eaf0ff; --lite-tab: #e9edf4; --lite-panel: rgba(250,252,255,.96); --lite-surface: #fff; --lite-selected: #142237; --lite-selected-text: #fff; --lite-error: #9c2432; }
:root[data-theme="dark"] { color-scheme: dark; --lite-background: #181c24; --lite-text: #eef2f8; --lite-muted: #b8c4d5; --lite-border: #445064; --lite-accent: #8badff; --lite-hover: #34435c; --lite-tab: #303a4b; --lite-panel: rgba(28,34,45,.96); --lite-surface: #252e3d; --lite-selected: #a9c3ff; --lite-selected-text: #142237; --lite-error: #ffabab; }
:root[data-theme="dark"] .lite-toggle img { filter: invert(1); }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--lite-background); }
body { font: 14px/1.4 system-ui, sans-serif; color: var(--lite-text); }
#app { display: contents; }
[v-cloak], [hidden] { display: none !important; }
.lite-viewer { position: relative; height: 100%; display: flex; flex-direction: column; }
#canvasUI { position: relative; flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
#canvas { display: block; position: static; width: 100%; height: 100%; touch-action: none; }
.lite-interface { position: static; width: 100%; flex: none; max-height: 40%; overflow: auto; background: var(--lite-background); }
.lite-states { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 24px; padding: 12px 16px; }
.lite-states fieldset { min-width: 0; max-width: 100%; border: 0; padding: 0; margin: 0; text-align: center; }
.lite-states legend { float: none; width: 100%; font-size: 12px; color: var(--lite-muted); margin-bottom: 6px; }
.lite-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lite-options button { cursor: pointer; min-height: 44px; padding: 9px 16px; border: 1px solid var(--lite-border); border-radius: 24px; background: var(--lite-surface); color: var(--lite-text); font: inherit; overflow-wrap: anywhere; max-width: 100%; }
.lite-options button[aria-pressed="true"] { border-color: var(--lite-accent); box-shadow: inset 0 0 0 1px var(--lite-accent); }
.lite-options button:hover { background: var(--lite-hover); }
.lite-options button:focus-visible { outline: 3px solid var(--lite-accent); outline-offset: 3px; }
.lite-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 16px 20px; max-width: 90%; width: max-content; border-radius: 10px; background: var(--lite-surface); text-align: center; }
.lite-error { color: var(--lite-error); }

.lite-categories { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 24px; }
.lite-categories section { min-width: 0; max-width: 100%; text-align: center; }
.lite-categories h2 { font: 500 12px/1.4 system-ui, sans-serif; color: var(--lite-muted); margin: 0 0 8px; }
.lite-options img { width: 100%; height: 80px; object-fit: contain; display: block; margin-bottom: 8px; }
.lite-options.lite-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.lite-tiles button { border-radius: 12px; min-width: 0; }
.lite-interface.lite-panel { position: absolute; z-index: 2; left: 16px; top: 16px; bottom: 16px; width: 304px; max-height: none; border: 1px solid var(--lite-border); border-radius: 18px; background: var(--lite-panel); box-shadow: 0 12px 36px rgba(0,0,0,.16); overflow: hidden; display: flex; }
.lite-interface.lite-panel-right { left: auto; right: 16px; }
.lite-panel .lite-states { display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; padding: 0; gap: 0; width: 100%; min-height: 0; }
.lite-panel-header { display: flex; align-items: center; justify-content: flex-start; padding: 8px 16px; border-bottom: 1px solid var(--lite-border); font-weight: 650; }
.lite-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 7px; min-height: 44px; padding: 8px; color: var(--lite-muted); font: inherit; font-size: 12px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.lite-toggle img { display: block; width: 22px; height: 22px; opacity: .7; }
.lite-toggle:hover { background: var(--lite-tab); }
.lite-toggle:hover img { opacity: 1; }
.lite-panel #lite-state-content { overflow: auto; min-height: 0; padding: 16px; }
.lite-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 12px; }
.lite-tabs button { flex: none; border: 0; background: var(--lite-tab); color: var(--lite-muted); border-radius: 8px; padding: 10px 12px; min-height: 44px; font: inherit; cursor: pointer; }
.lite-tabs button[aria-selected="true"] { color: var(--lite-selected-text); background: var(--lite-selected); }
.lite-tabs button:focus-visible, .lite-toggle:focus-visible { outline: 3px solid var(--lite-accent); outline-offset: -3px; }
.lite-panel .lite-categories { display: block; }
.lite-panel .lite-categories section { text-align: left; }
.lite-panel .lite-categories h2 { font-size: 14px; margin-bottom: 14px; }
.lite-panel .lite-options { justify-content: flex-start; }
.lite-panel .lite-options:not(.lite-tiles) { flex-direction: column; }
.lite-panel .lite-options button { border-radius: 10px; text-align: left; }
.lite-panel .lite-tiles button { text-align: center; }
.lite-interface.lite-panel.lite-panel-collapsed { bottom: auto; width: max-content; max-width: calc(100% - 32px); border-radius: 12px; }
.lite-panel-collapsed .lite-panel-header { padding: 4px; border-bottom: 0; }
@media (max-width: 640px) {
    .lite-interface.lite-panel, .lite-interface.lite-panel-right { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 44%; border-radius: 14px; }
    /* Thumbnail rows need more room than the compact text controls. */
    .lite-interface.lite-panel:has(.lite-tiles) { max-height: calc(100% - 120px); }
    .lite-panel-header { padding: 4px 12px; flex-shrink: 0; }
    .lite-panel #lite-state-content { padding: 10px 12px; }
    .lite-panel .lite-options:not(.lite-tiles) { flex-direction: row; }
    .lite-panel .lite-options.lite-tiles { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
    .lite-panel .lite-options img { height: 56px; }
}

@media (max-width: 640px) {
    .lite-interface.lite-panel.lite-panel-collapsed { left: 8px; right: auto; bottom: 8px; max-width: calc(100% - 16px); }
    .lite-interface.lite-panel-right.lite-panel-collapsed { left: auto; right: 8px; }
    .lite-panel-collapsed .lite-panel-header { padding: 4px; }
}

.lite-panel-right .lite-panel-header { justify-content: flex-end; }
