@font-face {
  font-family: "Archivo Black";
  src: url("./launch-assets/archivo-black.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("./launch-assets/ibm-plex-mono.woff2") format("woff2");
  font-display: swap;
}
body.emulator {
  background: radial-gradient(ellipse at 50% 0%, #2b1c14, transparent 58%), #101010;
  color: #fff1e5;
  font-family: "IBM Plex Mono", monospace;
  min-height: 100vh;
  --line: #3d312b;
  --muted: #bcab9f;
  --orange: #ff923f;
}
.emulator .shell { width: min(1380px, calc(100% - 76px)); margin-inline: auto; padding-inline: 0; }
.emulator .top { height: 75px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.emulator .brand { font-size: 16px; color: #fff1e5; gap: 9px; }
.emulator .brand small { color: var(--muted); border: 0; margin: 0; padding: 0; font: inherit; }
.brand-pixel {
  display: inline-block;
  width: 21px; height: 19px; flex: none; position: relative;
  background: var(--orange);
  clip-path: polygon(0 20%, 18% 20%, 18% 0, 82% 0, 82% 20%, 100% 20%, 100% 80%, 82% 80%, 82% 100%, 18% 100%, 18% 80%, 0 80%);
}
.brand-pixel::after { content: ""; position: absolute; left: 4px; top: 5px; width: 8px; height: 8px; background: #22130e; box-shadow: 8px 2px 0 -2px #22130e; }
.emulator .back { color: #f8a16b; font-size: 14px; text-decoration: none; }
.emulator .back:hover { text-decoration: underline; }
.emulator a:focus-visible, .emulator button:focus-visible { outline: 2px solid #ffc394; outline-offset: 3px; }
.emulator main { padding-top: 26px; }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.workspace-head h1, .emulator #boot-title { font-family: "Archivo Black", sans-serif; font-weight: 400; }
.workspace-head h1 { margin: 0; font-size: clamp(2.15rem, 5.2vw, 4.45rem); line-height: 1.04; letter-spacing: -.078em; }
.workspace-head p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.session-actions, .view-switch, .quick-actions { display: flex; align-items: center; gap: 8px; }
.emulator .session-actions { flex-wrap: wrap; justify-content: flex-end; }
.emulator #status { display: flex; align-items: center; gap: 8px; flex-basis: 100%; margin: 0 0 2px; justify-content: flex-end; max-width: none; font-size: 13px; }
.emulator #status::before { content: ""; width: 7px; height: 7px; flex: none; background: #86726a; }
.emulator #status[data-live=true]::before { background: #ff9e5b; box-shadow: 0 0 14px #ff8b37a0; }
.emulator #status[data-live=true] { color: #ffc496; }
.emulator button { font: inherit; font-size: 13px; min-height: 36px; padding: 7px 12px; background: #27201d; color: #f4e1d4; border: 1px solid #4a3930; border-radius: 8px; }
.emulator button:hover:not(:disabled) { border-color: var(--orange); color: #fff6ed; }
.emulator .primary { min-width: 100px; background: var(--orange); color: #1b0d06; border-color: var(--orange); font-weight: 600; }
.emulator .primary:hover:not(:disabled) { background: #ffad6f; color: #1b0d06; }
.workspace { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #181414; box-shadow: 0 16px 44px #0005; }
.workspace-bar, .emulator .below { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; gap: 10px; margin: 0; background: #1b1716; }
.workspace-bar { border-bottom: 1px solid var(--line); }
.workspace-bar button[aria-pressed=true] { background: #3b281d; border-color: #945735; color: #ffb47c; }
.emulator #screens { display: grid; gap: 0; background: #1b1413; }
.emulator #screens.dual { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); }
.emulator #screens .machine, .emulator #monitor { position: relative; height: clamp(390px, 40vw, 525px); min-height: 0; border: 0; border-radius: 0; }
.emulator #handheld {
  background-color: #201613;
  background-image: radial-gradient(ellipse at 50% 70%, #77422145, transparent 55%), radial-gradient(#6a4533 0.8px, transparent 0.8px);
  background-size: auto, 16px 16px;
}
.emulator iframe#device { display: block; position: relative; width: 100%; height: 100%; }
.emulator #monitor { background: #130f10; border-left: 1px solid var(--line); }
.emulator .monitor-head { background: #221a19; min-height: 48px; font-size: 12px; }
.emulator #desktop { background: #100d0d; outline-offset: -2px; }
.emulator .below { border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.emulator .below #frames { white-space: nowrap; }
.emulator #boot { text-align: center; width: min(435px, 85%); }
.boot-photo { position: relative; width: clamp(200px, 23vw, 290px); max-width: 100%; margin: -10px auto 4px; filter: drop-shadow(0 8px 12px #0008); }
#boot-device { display: block; width: 100%; height: auto; }
#boot-leds { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.emulator #boot-title { letter-spacing: -.045em; font-size: clamp(1.3rem, 3vw, 1.85rem); margin: 0; }
.emulator #boot-detail { min-height: 0; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.emulator .progress { background: #4b3429; margin-top: 16px; }
.emulator .download-row { font-size: 12px; text-align: left; }
.emulator .lab-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; align-items: start; }
.emulator .tool-card { border-radius: 13px; padding: 13px 15px; background: #191615; color: #eddbd0; }
.emulator .upload-card { grid-column: 1/-1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 15px; align-items: center; }
.emulator .upload-card.drag { background: #39241b; border-color: var(--orange); }
.emulator .upload-card .actions { flex-wrap: wrap; }
.emulator .upload-card button { margin: 0; }
.emulator #app-result, .emulator #app-progress { grid-column: 1/-1; margin: 0; }
.emulator #app-result:empty, .emulator #disk-result:empty { display: none; }
.emulator .tool-card h2 { margin: 0 0 4px; font-size: 15px; }
.emulator .tool-card p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.emulator .drawer summary { cursor: pointer; font-size: 14px; }
.emulator .drawer .actions, .emulator fieldset { margin: 12px 0 0; padding: 0; border: 0; min-width: 0; align-items: center; flex-wrap: wrap; }
.emulator .drawer select { background-color: #30251e; color: #f5e0ce; border: 1px solid #503c30; border-radius: 6px; font: inherit; font-size: 13px; padding: 7px 24px 7px 8px; }
.emulator:not([data-profile=kde]) .kde-only { display: none; }
.emulator .session-info { border-top: 1px solid var(--line); margin: 0; padding: 13px 0; color: var(--muted); font-size: 12px; }
@media (max-width: 800px) {
  .emulator .shell { width: calc(100% - 30px); }
  .emulator .top { height: 60px; }
  .emulator .brand small { display: none; }
  .emulator #screens.dual { grid-template-columns: minmax(0, 1fr); }
  .emulator #screens .machine { height: clamp(280px, 63vw, 410px); }
  .emulator #monitor { height: clamp(240px, 62vw, 415px); border: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .emulator .session-actions { justify-content: flex-start; }
  .emulator #status { flex-basis: auto; justify-content: flex-start; padding: 0 5px 0 0; }
  .emulator .lab-tools, .emulator .upload-card { grid-template-columns: 1fr; }
  .workspace-bar { flex-wrap: wrap; }
  .emulator .lab-tools .drawer { grid-column: 1/-1; }
}

.emulator #console {
  position: static;
  display: block;
  width: auto;
  margin-top: 15px;
  background: #191615;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.emulator #console > summary, .boot-log > summary {
  padding: 13px 15px;
  cursor: pointer;
  font-size: 14px;
}
.emulator #console > summary { color: #ffbf91; }
#shell-status { float: right; color: var(--muted); font-size: 12px; }
.terminal-body { padding: 11px 13px 0; border-top: 1px solid var(--line); }
#shell-screen { height: clamp(240px, 36vh, 430px); padding: 8px; background: #151110; border: 1px solid #3d312b; border-radius: 7px; overflow: hidden; }
#shell-screen:focus-within { border-color: #a76842; }
#shell-screen .xterm { height: 100%; }
.shell-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; font-size: 12px; color: var(--muted); }
.boot-log { border-top: 1px solid var(--line); }
.boot-log > summary { padding-left: 0; color: var(--muted); font-size: 12px; }
.emulator #log { max-height: 220px; padding: 9px 0 15px; }

.site-links { display: flex; align-items: center; gap: 18px; }
.workbench { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 18px; align-items: start; }
.library-hidden .workbench { grid-template-columns: minmax(0,1fr); }
.workspace-main { min-width: 0; }
.emulator #library {
  position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow-y: auto;
  background: linear-gradient(145deg,#211916,#181514 70%);
  border: 1px solid #4b352b; border-radius: 17px; box-shadow: 0 14px 30px #0005;
  scrollbar-color: #624633 #191514;
}
.library-heading, .library-section-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.library-heading { background: #2b201b; padding: 12px; font-size: 14px; }
.library-heading strong { flex: 1; }
.library-icon { width: 14px; height: 13px; background: #fc9857; clip-path: polygon(0 0,36% 0,36% 16%,100% 16%,100% 100%,0 100%); }
.emulator .library-heading button, .emulator .library-section-head button {
  min-height: 28px; padding: 4px 7px; font-size: 11px;
}
.library-section { padding: 13px 11px; border-top: 1px solid #443129; }
.library-section h2 { margin: 0; font: 14px "Archivo Black",sans-serif; letter-spacing: -.035em; }
.library-list, .file-list { display: grid; gap: 5px; list-style: none; margin: 10px 0 0; padding: 0; }
.library-list .session-button { display: flex; align-items: center; gap: 9px; text-align: left; width: 100%; white-space: normal; min-height: 45px; }
.library-list li.selected .session-button { background: #432c20; border-color: #9d5d39; color: #ffbd8d; }
.session-icon { flex: none; width: 15px; height: 11px; border: 2px solid #ba7855; border-radius: 2px; position: relative; }
.session-icon::after { content: ""; width: 5px; height: 4px; position: absolute; left: 2px; top: 2px; background: #bc7753; }
.session-copy { display: grid; gap: 3px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.session-copy strong { font-size: 12px; font-weight: 600; }
.session-copy small, .drop-hint, .library-empty { color: #beab9e; font-size: 11px; line-height: 1.45; }
.emulator .library-text-button { border: 0; padding: 7px 0 0; background: none; min-height: 28px; color: #f3af81; font-size: 11px; }
#library-result, #files-result { display: block; padding-top: 6px; color: #efb68d; font-size: 12px; overflow-wrap: anywhere; }
#library-result:empty, #files-result:empty { display: none; }
#library input { width:100%; min-width:0; background:#1e1816; color:#fff1e5; border:1px solid #573d30; border-radius:7px; padding:8px; margin-top:9px; font:12px "IBM Plex Mono",monospace; }
#library input:focus-visible { outline: 2px solid #ffb284; outline-offset: 2px; }
.library-form { margin: 9px 0; font-size: 11px; color: #eec4a7; }
.library-form button { margin-top: 7px; }
.library-form input { display: block; }
.library-list.apps-list { max-height: 235px; overflow: auto; }
.app-row, .file-list li { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 0; overflow-wrap:anywhere; }
.app-row + .app-row, .file-list li + li { border-top:1px solid #452f25; }
.emulator .app-row button { min-height: 26px; font-size: 11px; padding: 3px 7px; }
#library-apps.drag { background: #3b281d; outline: 1px dashed var(--orange); outline-offset: -5px; }
.drop-hint { display: block; margin-top: 8px; }
.file-tool { grid-column: 1/-1; }
.emulator .file-tool p { margin-top: 10px; }
.file-list { font-size: 12px; }
@media(max-width:1050px) { .workbench { grid-template-columns: 225px minmax(0,1fr); gap: 12px; } }
@media(max-width:920px) { .emulator:not(.library-hidden) #screens.dual { grid-template-columns: minmax(0,1fr); } .emulator:not(.library-hidden) #monitor { border-left:0; border-top:1px solid var(--line); } }
@media(max-width:760px) { .workbench { grid-template-columns: minmax(0,1fr); } .emulator #library { position:static; max-height:none; } }

.sidebar-modes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  padding: 8px 10px; border-block: 1px solid #443129; background: #1c1614;
}
.emulator .sidebar-modes button, .emulator .tree-roots button,
.emulator .tree-toolbar button, .emulator .explorer-heading button {
  min-height: 27px; padding: 4px 7px; font-size: 11px;
}
.emulator .sidebar-modes button[aria-pressed=true], .emulator .tree-roots button[aria-pressed=true] {
  color: #ffc296; background: #422a1f; border-color: #9b5b3d;
}
#explorer { padding: 12px 10px 10px; }
.explorer-heading, .tree-roots, .tree-toolbar { display: flex; align-items: center; gap: 6px; }
.explorer-heading { justify-content: space-between; margin-bottom: 9px; }
.explorer-heading h2 { margin: 0; font: 14px "Archivo Black", sans-serif; letter-spacing: -.035em; }
.tree-roots { margin-bottom: 7px; }
.tree-roots button { flex: 1; }
#tree-path {
  display: block; padding: 7px 8px; margin-bottom: 7px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; direction: ltr;
  color: #deab8a; background: #171211; border: 1px solid #4c352a; border-radius: 6px;
  font: 11px "IBM Plex Mono", monospace;
}
.tree-toolbar { margin-bottom: 8px; }
.explorer-hint, .tree-note { margin: 5px 0; color: #bcab9f; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
#file-tree {
  max-height: min(50dvh, 570px); min-width: 0; overflow: auto;
  padding: 4px 0; margin: 0; list-style: none; scrollbar-color: #654331 #1a1413;
  border-top: 1px solid #382820;
}
#file-tree ul {
  padding: 0 0 0 7px; margin: 0 0 0 9px; list-style: none; border-left: 1px solid #473027;
}
.emulator button.tree-row {
  display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; min-height: 24px;
  padding: 2px 5px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; text-align: left; font-size: 11px; color: #ecd5c4;
}
.emulator button.tree-row span { overflow: hidden; text-overflow: ellipsis; }
.emulator button.tree-row:hover { background: #2e231d; border-color: transparent; }
.emulator button.tree-row[aria-current=true] { background: #492c20; border-color: #825136; color: #ffe2cc; }
.emulator button.tree-row:focus-visible { outline-offset: -2px; }
.tree-caret { margin-right: 2px; flex: 0 0 5px; width:5px; height:7px; color:#d59b7a; background: currentColor; clip-path: polygon(0 0,100% 50%,0 100%); }
.tree-caret.empty { visibility: hidden; }
.tree-row[aria-expanded=true] .tree-caret { transform: rotate(90deg); }
.tree-icon { position: relative; flex: 0 0 12px; height: 10px; }
.tree-icon.folder { background:#ed985e; clip-path:polygon(0 0,39% 0,52% 20%,100% 20%,100% 100%,0 100%); }
.tree-icon.document { background:#b49b8b; flex-basis:10px; height:12px; clip-path:polygon(0 0,65% 0,100% 35%,100% 100%,0 100%); }
.tree-icon.document::after { content:""; position:absolute; inset:5px 2px 2px; border-block:1px solid #4e3930; }
.tree-icon.shortcut { width:9px; flex-basis:9px; height:8px; border:1px solid #a98e80; transform:rotate(-30deg); }
.tree-note { padding-left: 5px; }
#files-result[data-error=true] { color:#f5a899; }

.copy-row { display: grid; grid-template-columns: minmax(0,1fr) 30px; gap: 5px; align-items: stretch; }
.emulator .copy-trash { padding: 0; min-width: 0; display: grid; place-items: center; color: #d79a7c; }
.emulator .copy-trash::before {
  content: ""; width: 12px; height: 13px; background: currentColor;
  clip-path: polygon(0 15%,33% 15%,33% 0,67% 0,67% 15%,100% 15%,100% 30%,85% 30%,77% 100%,23% 100%,15% 30%,0 30%);
}
.emulator .copy-trash:hover:not(:disabled) { background: #4d271f; border-color: #d98670; color: #ffb5a0; }
.copy-dialog {
  width: min(410px, calc(100% - 38px)); padding: 23px;
  background: #211916; border: 1px solid #78523d; border-radius: 15px;
  color: #fff1e5; box-shadow: 0 22px 80px #000a;
}
.copy-dialog::backdrop { background: #090604b9; }
.copy-dialog h2 { font: 22px "Archivo Black",sans-serif; letter-spacing: -.04em; margin: 0 0 10px; }
.copy-dialog p, .copy-dialog label { color: #cdb5a5; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.copy-dialog #copy-name { width: 100%; margin: 6px 0 11px; padding: 8px; border: 1px solid #76513b; border-radius: 6px; color: #fff1e5; background: #15100e; font: inherit; }
.copy-check { display: flex; align-items: center; gap: 6px; }
.copy-check input { accent-color: var(--orange); }
.copy-dialog .actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.emulator .delete-confirm { background: #823f33; border-color: #b9705d; color: #fff1e5; }
.emulator .network-lab { grid-column: 1 / -1; }
.network-lab #modem-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; }
.network-lab label { display: grid; gap: 5px; font-size: 12px; color: #dbc1af; }
.network-field { display: grid; gap: 5px; }
.network-lab label.check { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.network-lab label[hidden] { display: none; }
.network-lab input:not([type="checkbox"]) { box-sizing: border-box; max-width: 100%; min-width: 0; background: #16110e; border: 1px solid #5c4032; border-radius: 6px; padding: 7px 9px; color: #f5e0ce; font: inherit; }
.network-lab input[type="checkbox"] { accent-color: #ff8a3a; }
#network-result { display: block; margin-top: 7px; }

.emulator .wordmark { font-family: "Archivo Black", sans-serif; letter-spacing: -.045em; }
.emulator .wordmark b { color: var(--orange); font-weight: inherit; }
.emulator .brand .byline { display: inline; color: #d2aa93; font-size: 11px; }
.emulator .build-strip { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.emulator .build-strip div { display: flex; gap: 6px; border: 1px solid #493429; border-radius: 6px; padding: 4px 7px; background: #211814; }
.emulator .build-strip dt { color: #ffb37a; }
.emulator .build-strip dd { margin: 0; }
.emulator .build-strip code { color: #f7e3d6; font: inherit; }

.scenario-tools { padding: 10px 13px; border-bottom: 1px solid var(--line); background: #211916; }
.scenario-buttons, #scenario-playback { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#scenario-playback { padding-top: 10px; }
#scenario-playback strong, #scenario-playback p { width: 100%; }
#scenario-playback p, #scenario-steps, #scenario-result { color: #d7bcaa; font-size: 12px; line-height: 1.55; }
#scenario-playback p { margin: 0 0 4px; }
#scenario-result:empty { display: none; }
#scenario-result { display: block; margin-top: 6px; overflow-wrap: anywhere; }
#scenario-result[data-error=true] { color: #ffad99; }
#scenario-steps { margin: 6px 0 0; padding-left: 21px; }
#scenario-link { width: 100%; padding: 8px; margin: 5px 0 8px; border: 1px solid #76513b; border-radius: 6px; background: #15100e; color: #fff1e5; }
#open-scenario-link, #regular-session { color: #ffb078; align-self: center; font-size: 13px; }
#scenario-copy-result { font-size: 12px; }
