:root { color-scheme: light; font-family: system-ui, sans-serif; font-size: 14px; color: #24292f; background: #eef1f5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { height: 100dvh; display: grid; grid-template-rows: 52px minmax(0, 1fr) 32px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #c5ced8; border-radius: 5px; padding: 7px 10px; background: white; color: inherit; }
button:hover { background: #e6eef7; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #2478bd; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .6; }
.primary { background: #173f63; color: white; border-color: #173f63; }
.primary:hover { background: #245c8d; }
.titlebar { display: flex; align-items: center; gap: 20px; padding: 8px 18px; background: #172f46; color: white; }
h1 { font-size: 18px; margin: 0; }
#filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#login { margin-left: auto; flex-shrink: 0; color: #24292f; }
main { min-height: 0; min-width: 0; display: grid; grid-template-rows: 32px auto 42px minmax(0, 1fr); }
.menubar { display: flex; gap: 4px; padding: 0 12px; align-items: center; background: white; border-bottom: 1px solid #d5dce4; z-index: 4; }
.menubar > .menu > button { border: 0; padding: 4px 12px; }
.menu { position: relative; }
.menu-popup { position: absolute; top: calc(100% + 3px); left: 0; min-width: 275px; max-height: calc(100dvh - 100px); overflow: auto; padding: 6px; background: white; border: 1px solid #c5ced8; border-radius: 6px; box-shadow: 0 6px 20px #172f4630; }
.menu-popup button { display: flex; width: 100%; gap: 20px; justify-content: space-between; text-align: left; border: 0; padding: 8px 10px; }
.menu-popup hr { border: 0; border-top: 1px solid #e1e6eb; margin: 4px 0; }
kbd { color: #627181; font: inherit; font-size: 11px; }
.menu-hint { margin-left: auto; font-size: 11px; color: #627181; }
.ribbon { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 8px 12px 6px; background: white; border-bottom: 1px solid #c5ced8; }
.ribbon-group { padding-right: 10px; border-right: 1px solid #e1e6eb; display: flex; flex-direction: column; justify-content: space-between; gap: 5px; }
.ribbon-group > div { display: flex; gap: 4px; }
.group-label { text-align: center; font-size: 10px; color: #627181; }
.tools button { position: relative; padding-right: 23px; }
.tools button[aria-pressed="true"] { background: #173f63; color: white; border-color: #173f63; font-weight: 700; box-shadow: inset 3px 0 0 #72c4ff; }
button[aria-pressed="true"]::after { content: ""; position: absolute; right: 7px; top: 50%; width: 4px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-65%) rotate(45deg); }
#palette button { position: relative; padding: 7px 14px 7px 7px; font-size: 12px; }
#palette [aria-pressed="true"] { outline: 3px solid #1766ab; outline-offset: 1px; box-shadow: inset 0 0 0 2px white; }
#palette [aria-pressed="true"]::after { right: 4px; top: 4px; transform: rotate(45deg); }
.workspace-heading { display: flex; align-items: center; gap: 12px; padding: 4px 12px; }
.workspace-heading h2 { font-size: 12px; color: #627181; margin: 0 auto 0 0; }
[role="tablist"] { display: flex; gap: 3px; }
[role="tab"] { padding: 5px 10px; background: transparent; border-color: transparent; }
[role="tab"][aria-selected="true"] { background: white; color: #173f63; border-color: #b6c7d7; box-shadow: inset 0 -3px #2478bd; font-weight: 600; }
#toggle-inspector { padding: 5px 8px; font-size: 11px; }
.editor-body { position: relative; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; border-top: 1px solid #d5dce4; }
.editor-body:has(#inspector[hidden]) { grid-template-columns: minmax(0, 1fr); }
.workspace { min-width: 0; min-height: 0; padding: 20px; display: grid; place-items: center; container-type: size; background: #e4e9ef; }
.canvas-frame { position: relative; width: min(100cqw, calc(100cqh * 443 / 210)); aspect-ratio: 443 / 210; border: 1px solid #aeb9c4; background: #fffdf2; box-shadow: 0 3px 14px #172f4620; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#inspector { min-height: 0; min-width: 0; background: white; border-left: 1px solid #c5ced8; }
.task-panel { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.panel-content { min-height: 0; overflow: auto; padding: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.panel-content p { font-size: 12px; line-height: 1.5; color: #526170; margin: 10px 0; }
.panel-actions { margin-top: auto; padding: 12px 16px; border-top: 1px solid #e1e6eb; flex-shrink: 0; }
.panel-actions button { width: 100%; }
#trace-settings label, #settings label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; font-size: 12px; }
#trace-settings input[type="number"], #settings input[type="number"] { width: 72px; flex-shrink: 0; padding: 4px; }
.checkbox { justify-content: flex-start !important; }
.checkbox input { flex-shrink: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-selector { display: flex; align-items: center; gap: 10px; font-size: 12px; }
select { min-width: 0; padding: 5px; width: 100%; }
textarea { width: 100%; margin: 8px 0; resize: vertical; max-height: 35vh; padding: 8px; }
footer { grid-row: 3; display: flex; align-items: center; gap: 16px; padding: 5px 12px; border-top: 1px solid #c5ced8; background: white; font-size: 11px; min-width: 0; }
#status { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-hint { margin-left: auto; white-space: nowrap; font-size: 10px; color: #627181; }
.error, #download-error { color: #a11818; font-weight: 600; }
dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #aeb9c4; border-radius: 10px; box-shadow: 0 15px 70px #172f4640; }
dialog::backdrop { background: #172f4660; }
dialog label { display: block; margin: 12px 0 6px; }
#download-name { width: 100%; padding: 9px; }
#download-help { font-size: 12px; color: #526170; line-height: 1.5; }
#download-error { font-size: 12px; min-height: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1150px) { .file-actions { display: none; } .canvas-hint { display: none; } }
@media (max-width: 850px) { .editor-body { grid-template-columns: minmax(0, 1fr) 270px; } .workspace { padding: 12px; } .workspace-heading h2 { display: none; } [role="tablist"] { margin-right: auto; } }
@media (max-width: 700px) {
  .titlebar { gap: 10px; padding: 8px 12px; } h1 { font-size: 15px; }
  .menu-hint { display: none; } .ribbon { gap: 6px; padding: 6px 8px; }
  .ribbon-group { padding-right: 6px; } .ribbon button { font-size: 12px; padding-top: 6px; padding-bottom: 6px; }
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  #inspector { position: absolute; top: 0; right: 0; bottom: 0; width: min(300px, calc(100% - 24px)); z-index: 2; box-shadow: -4px 0 16px #172f4620; }
  .workspace-heading { padding: 4px 6px; gap: 4px; } [role="tab"] { padding: 5px 6px; font-size: 12px; }
}
