/* Calculator management embedded in the original catalogue; card styles stay in style.css. */
[hidden] { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.manager-settings { display:flex; align-items:center; gap:.75rem; margin-left:auto; }
.manager-settings select { background:var(--block); color:var(--on-block); border:1px solid var(--line); padding:.4rem; }
.calculator-frame { border:2px solid var(--edge); border-top:5px solid var(--accent); background:var(--surface); box-shadow:var(--shadow); padding:1.25rem; margin-bottom:2rem; }
.calculator-heading,.device-status,.section-label,.device-actions { display:flex; justify-content:space-between; align-items:center; gap:.75rem; flex-wrap:wrap; }
.calculator-heading h2 { margin:.25rem 0; font-size:1.3rem; overflow-wrap:anywhere; }
.calculator-heading p { margin:.25rem 0; font-size:.85rem; }
.calculator-heading>div:first-child { min-width:0; flex:1 1 220px; }
.eyebrow { font: .75rem 'Share Tech Mono',monospace; letter-spacing:.08em; }
.device-actions { justify-content:flex-start; }
.device-status { justify-content:flex-start; margin:.75rem 0; }
.connection-chip { padding:.2rem .5rem; background:var(--surface-2); border:1px solid var(--line); font-size:.75rem; }
.connection-chip.live { color:var(--ok); background:var(--ok-soft); border-color:var(--ok-line); }
.devices-menu { position:relative; margin-left:auto; max-width:100%; }
.devices-menu>summary { cursor:pointer; padding:.5rem .75rem; border:1px solid var(--line); font-size:.85rem; }
.devices-content { position:absolute; right:0; z-index:30; width:min(360px,calc(100vw - 4rem)); padding:1rem; background:var(--surface); border:1px solid var(--edge); box-shadow:var(--shadow); }
.profile-list { display:grid; gap:.5rem; min-width:0; }
.profile-button { text-align:left; color:var(--ink); border:1px solid var(--line); background:var(--surface); padding:.35rem .65rem; cursor:pointer; max-width:100%; overflow-wrap:anywhere; }
.profile-button[aria-pressed=true] { border-color:var(--edge); background:var(--accent-soft); }
.profile-button span { display:block; font-size:.7rem; color:var(--muted); margin-top:.2rem; }
.profile-button strong { font-size:.8rem; }
.section-label { margin:.75rem 0 .5rem; }
.section-label h3 { font-size:.9rem; margin:0; }
.section-label strong,.section-label>span { font:.8rem 'Share Tech Mono',monospace; }
.memory-bar { display:flex; height:12px; background:var(--chip-bg); border:1px solid var(--edge); overflow:hidden; }
.memory-bar span { flex:none; background:var(--accent); border-right:2px solid var(--surface); }
.memory-bar span:nth-child(even) { background:var(--muted); }
.memory-bar .protected-segment { background:repeating-linear-gradient(45deg,var(--line),var(--line) 4px,var(--surface-2) 4px,var(--surface-2) 8px); }
.memory-legend { display:flex; justify-content:space-between; gap:.5rem 1rem; flex-wrap:wrap; font-size:.75rem; color:var(--muted); margin:.4rem 0 1rem; }
#freeLabel { max-width:100%; overflow-wrap:anywhere; }
#installed { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5rem; }
.installed-row { border:1px solid var(--line); padding:.5rem .75rem; min-width:0; }
.installed-main { display:flex; gap:.5rem; align-items:center; }
.installed-main>span { min-width:0; flex:1; }
.installed-main strong { display:block; font-size:.85rem; overflow-wrap:anywhere; }
.installed-row small { display:block; color:var(--muted); font-size:.75rem; }
.installed-row.is-removing strong { text-decoration:line-through; }
.game-action { display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; padding:.5rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--ink); cursor:pointer; }
.game-action svg { width:22px; height:22px; }
.game-action[aria-pressed=true] { background:var(--accent); border-color:var(--edge); color:var(--on-accent); }
.game-action[aria-pressed=true]::after { content:'✓'; font-size:.7rem; margin-left:.1rem; }
.game-action:focus-visible { outline:2px solid var(--edge); outline-offset:3px; }
.game-action:disabled { opacity:.4; cursor:not-allowed; }
.source-details { margin-top:.25rem; font-size:.7rem; color:var(--muted); }
.source-details summary,.technical-details>summary { cursor:pointer; }
.source-label>span { display:none; }
.source-label select { width:100%; min-width:0; font-size:.75rem; background:var(--surface); color:var(--ink); margin-top:.5rem; }
.technical-details { border-top:1px solid var(--line); padding-top:.65rem; margin-top:1rem; font-size:.8rem; }
.technical-details p { max-width:85ch; }
.profile-controls,.profile-controls form { display:flex; gap:.75rem; flex-wrap:wrap; align-items:end; margin:.75rem 0; }
.profile-controls label { min-width:0; }
.profile-controls input { width:100%; max-width:280px; border:1px solid var(--line); color:var(--ink); background:var(--surface); padding:.5rem; }
.profile-controls label span { display:block; }
.small { font-size:.8rem; }
.hero h1 { font-size:1.6rem; margin:0; }
.catalogue-version { display:flex; gap:.5rem; align-items:center; font-size:.75rem; color:var(--muted); }
.catalogue-version select { min-width:0; width:100%; color:var(--ink); background:var(--surface); border:1px solid var(--line); padding:.4rem; }
.card-foot .game-action { margin-left:auto; }
.card-foot .size { min-width:0; font-size:.75rem; }
.card-item.is-selected { border-color:var(--edge); outline:2px solid var(--accent); }
.selection-state { font-size:.7rem; overflow-wrap:anywhere; }
.manager-panel { background:var(--surface); padding:1.25rem; border:2px solid var(--edge); margin-bottom:1.5rem; }
.plan-panel { border-top:5px solid var(--accent); }
.plan-panel li { overflow-wrap:anywhere; margin-bottom:.4rem; }
.plan-panel h2 { font-size:1.2rem; margin-top:0; }
.manager-actionbar { position:sticky; bottom:.75rem; z-index:20; padding:.75rem 1rem; border:1px solid var(--edge); box-shadow:var(--shadow); background:var(--block); color:var(--on-block); display:flex; gap:1rem; align-items:center; justify-content:space-between; margin:1.5rem 0 -1rem; }
.selection-overview { min-width:0; font-size:.8rem; flex:1; }
#queuedChanges { display:flex; flex-wrap:wrap; gap:.35rem; max-height:5rem; overflow:auto; margin-top:.25rem; }
.queued-change { background:transparent; color:var(--on-block); border:1px solid var(--line); font-size:.75rem; padding:.25rem .5rem; cursor:pointer; max-width:100%; overflow-wrap:anywhere; }
.queued-change.removing { border-style:dashed; }
.action-buttons { display:flex; gap:.5rem; flex:none; flex-wrap:wrap; }
.calculators-page dialog { width:min(540px,calc(100% - 2rem)); max-height:calc(100dvh - 2rem); overflow:auto; border:2px solid var(--edge); background:var(--surface); color:var(--ink); padding:1.5rem; box-shadow:var(--shadow-lg); }
.calculators-page dialog::backdrop { background:#0009; }
.confirm-check { display:flex; gap:.75rem; align-items:start; font-size:.9rem; margin-bottom:1rem; }
.confirm-check input { margin-top:.4rem; flex:none; }
.calculators-page button,.calculators-page a { touch-action:manipulation; }
.calculators-page .btn { white-space:normal; }
.back-to-calculator { position:fixed; right:1rem; bottom:1rem; z-index:25; display:grid; place-items:center; width:44px; height:44px; padding:.5rem; border:2px solid var(--edge); background:var(--surface); color:var(--ink); box-shadow:var(--shadow); cursor:pointer; }
.back-to-calculator svg { width:22px; height:22px; }
.back-to-calculator:hover { background:var(--accent); color:var(--on-accent); }
.back-to-calculator:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.pack-tabs { display:flex; gap:.5rem; border-bottom:2px solid var(--edge); padding-bottom:.75rem; margin-bottom:1rem; flex-wrap:wrap; }
.pack-tabs [aria-selected=true] { background:var(--accent); color:var(--on-accent); border-color:var(--edge); }
#packsPanel h2 { font-size:1.25rem; margin:1rem 0; }
#packsPanel section { margin-bottom:1.5rem; }
.pack-card { min-width:0; display:flex; flex-direction:column; animation:none; }
.pack-card .card-top { display:block; border-bottom:0; background:var(--surface); }
.pack-card .card-top::before { content:none; }
.pack-card .card-top>:nth-last-child(2) { margin-left:0; }
.pack-card h3 { padding:.35rem 0; }
.pack-cover { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); height:140px; overflow:hidden; background:var(--surface-2); border-bottom:1px solid var(--line); }
.pack-cover img { width:100%; height:100%; max-height:140px; object-fit:contain; min-height:0; padding:.5rem; }
.pack-card h3,.pack-card p,.pack-card li { overflow-wrap:anywhere; }
.pack-description { font-size:.85rem; }
.pack-card details { font-size:.8rem; margin:.5rem 0; }
.pack-card summary { cursor:pointer; }
.pack-actions { display:flex; gap:.5rem; flex-wrap:wrap; border-top:1px solid var(--line); padding:.75rem; margin-top:auto; }
.pack-warning { font-size:.8rem; border-left:3px solid var(--accent); padding-left:.5rem; }
#packEditor label:not(.confirm-check) { display:block; margin:.75rem 0; font-size:.85rem; }
#packEditor input:not([type=checkbox]),#packEditor textarea,#packLink { display:block; width:100%; min-width:0; padding:.6rem; margin-top:.3rem; background:var(--surface); border:1px solid var(--line); color:var(--ink); font:inherit; }
#packEditorItems { list-style:none; padding:0; max-height:14rem; overflow:auto; }
#packEditorItems li { display:flex; gap:.5rem; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); padding:.35rem 0; }
#packEditorItems span { min-width:0; overflow-wrap:anywhere; }
#packEditorItems button { flex:none; min-width:44px; min-height:44px; }
.pack-tabs button:focus-visible,.pack-actions button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:700px) { #installed { grid-template-columns:repeat(2,minmax(0,1fr)); }.calculator-frame { padding:1rem; }.manager-actionbar { flex-wrap:wrap; }.action-buttons { width:100%; }.action-buttons .btn { flex:1; }.calculator-heading>.device-actions { width:100%; }.calculator-heading h2 { font-size:1.15rem; }.brand .pill { display:none; } }
@media(max-width:400px) { #installed { grid-template-columns:1fr; }.topbar { padding:.7rem 1rem; gap:.5rem; }.manager-settings { gap:.4rem; }.card-foot { gap:.4rem; }.card-foot .btn { padding:.4rem; }.calculator-frame { padding:.75rem; }.sort-label { width:100%; margin-left:0; justify-content:space-between; }.memory-legend { flex-direction:column; } }

/* Studio mode: the manager embedded in the composer's USB panel. */
.studio-mode .topbar,.studio-mode .skip,.studio-mode footer,.studio-mode #libraryPanel,.studio-mode #packsPanel,.studio-mode #packNavigation,.studio-mode #actionBar,.studio-mode #technicalDetails,.studio-mode #backToCalculator { display:none !important; }
.studio-mode .container { padding-top:.75rem; }
.studio-mode .calculator-frame { margin-bottom:1rem; }
.studio-mode #preview { margin-bottom:1rem; }
