html, body { margin: 0; height: 100%; background: #131316; color: #eee; font: 13px system-ui, sans-serif; }
body { display: flex; flex-direction: column; }
button { color: #eee; background: #383838; border: 1px solid #666; border-radius: 4px; padding: 3px 10px; cursor: pointer; font: inherit; }
button:hover { background: #505050; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, summary:focus-visible { outline: 2px solid #9bceff; outline-offset: 2px; }
a { color: #9bceff; }
iframe { border: 0; width: 100%; flex: 1; min-height: 0; }
#host-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 5px 12px; border-bottom: 1px solid #444; }
#host-toolbar[hidden], #show-toolbar[hidden] { display: none; }
#toolbar-info { margin-right: auto; color: #ccc; }
#show-toolbar { position: fixed; top: 0; right: 12px; z-index: 20; opacity: .85; font-size: 11px; }
#show-toolbar:hover, #show-toolbar:focus { opacity: 1; }
button.primary { background: #3b6fe0; border-color: #5b8af0; color: #fff; font-weight: 600; }
button.primary:hover { background: #4a7cf0; }
kbd { font: 12px ui-monospace, monospace; background: #333; border: 1px solid #666; border-radius: 3px; padding: 0 4px; }
code { font: 12px ui-monospace, monospace; }
#export-status { color: #b9ddff; }
#host-toolbar > details > summary { cursor: pointer; padding: 3px 10px; border: 1px solid #666; border-radius: 4px; background: #383838; list-style: none; }
#host-toolbar > details > summary::-webkit-details-marker { display: none; }
#host-toolbar > details[open] > summary { background: #505050; }
#host-toolbar > details[open] > :not(summary) { position: absolute; z-index: 27; top: 40px; right: 12px; width: min(460px, calc(100vw - 48px)); max-height: 78vh; overflow: auto; padding: 4px 16px 12px; background: #26272b; border: 1px solid #777; border-radius: 6px; box-shadow: 0 3px 15px #0008; line-height: 1.45; }
.panel h2 { font-size: 14px; margin: 12px 0 4px; }
#help-content details { border-bottom: 1px solid #3a3a3a; padding: 6px 0; }
#help-content details summary { cursor: pointer; font-weight: 600; color: #b9ddff; }
#help-content .lead { color: #ccc; }

#welcome { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(15, 16, 18, .82); padding: 16px; }
#welcome[hidden] { display: none; }
#welcome .card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #26272b; border: 1px solid #555; border-radius: 10px; padding: 22px 26px; box-shadow: 0 8px 40px #000a; font-size: 14px; line-height: 1.45; }
#welcome h1 { margin: 0 0 12px; font-size: 22px; }
#welcome h2 { margin: 0 0 10px; font-size: 17px; }
#welcome .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 8px 0 14px; }
#welcome button.big { padding: 14px 16px; font-size: 15px; text-align: left; border-radius: 8px; background: #33353b; }
#welcome button.big:hover { background: #41444c; }
#welcome #w-new, #welcome #w-resume { background: #3b6fe0; border-color: #5b8af0; color: #fff; font-weight: 600; }
#welcome button.template { display: flex; flex-direction: column; gap: 4px; }
#welcome button.template span { font-size: 13px; color: #c9c9cc; }
#welcome .small { color: #aaa; font-size: 12px; }
#welcome .warn, .warn { color: #ffb38a; }
#welcome ol.tour li { margin-bottom: 6px; }

#toasts { position: fixed; right: 12px; top: 44px; z-index: 25; display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw - 24px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; border-radius: 8px; background: #2d3a52; border: 1px solid #5b8af0; box-shadow: 0 4px 18px #0009; line-height: 1.4; }
.toast.warn { background: #4a3122; border-color: #e0884a; }
.panel h2:first-child { margin-top: 8px; }
#export-more .menu-list { width: min(320px, calc(100vw - 48px)) !important; }
#export-more .menu-list p { color: #bbb; margin: 8px 0; }
#export-more .menu-list button { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 7px 10px; }
#welcome .note { color: #b9ddff; }
#welcome .tip { color: #9a9aa2 !important; }
button.link { background: none; border: 0; color: #9bceff; text-decoration: underline; padding: 0; font-size: 12px; }
body.exporting #export-mp4, body.exporting #export-more summary { opacity: .55; pointer-events: none; }

#toolbar-info { display: inline-flex; align-items: center; gap: 8px; }
#toolbar-info .app-icon { width: 24px; height: 24px; border-radius: 22%; flex: none; }
/* Tutorials drop-down (tutorials-menu.js + tutorials.json) */
#host-toolbar > #tutorial-videos > summary { border-color: #f08a6e; color: #ffd2c4; font-weight: 600; }
#tutorial-videos .tut-panel p { margin: 8px 0; }
#tutorial-videos ul { list-style: none; margin: 0; padding: 0; }
#tutorial-videos li a { display: block; padding: 7px 6px; border-bottom: 1px solid #444; text-decoration: none; }
#tutorial-videos li a:hover, #tutorial-videos li a:focus-visible { background: #383838; }
#tutorial-videos small { color: #bbb; }
#tutorial-videos .tut-all a { font-weight: 600; border-bottom: 0; }
