:root {
    color-scheme: dark;
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --black: #000;
    --body: #141416;
    --bar: #18181a;
    --surface: #1c1c1e;
    --group: #2c2c2e;
    --line: #2d2d30;
    --text: #f2f2f5;
    --muted: #a1a1a8;
    --amber: #e69b33;
    --blue: #77c5ff;
    background: var(--black);
    color: var(--text);
    touch-action: manipulation;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button {
    min-height: 44px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--group);
    color: var(--text);
    font-weight: 550;
    cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
button:active:not(:disabled) { filter: brightness(1.2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.primary { background: linear-gradient(#0968d5,#084ca0); color: #fff; box-shadow: inset 0 1px #ffffff32; }
.quiet { background: #262628; color: #dbdbdf; }
.danger-text { color: #ef9ba4; }
.wide { width: 100%; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 11px; }
a { color: var(--blue); text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.studio-frame { height: 100vh; height: 100dvh; width: 100%; position: relative; overflow: hidden; }
#workspace {
    height: 100%;
    display: grid;
    grid-template:
        "header" auto
        "preview" minmax(0, 44fr)
        "inspector" minmax(0, 56fr)
        "footer" auto / minmax(0,1fr);
    background: var(--body);
}
#workspace:not(.has-image) { display: block; }
#workspace:not(.has-image) :is(.app-header,.inspector,.build-footer) { display: none; }
#workspace:not(.has-image) .scene { height: 100%; }

.app-header {
    grid-area: header;
    display: grid;
    grid-template-columns: minmax(44px,1fr) minmax(0, 210px) minmax(132px,1fr);
    align-items: center;
    min-height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left));
    background: var(--black);
    border-bottom: 1px solid #242426;
}
.header-actions { display: flex; justify-content: end; }
.icon-button {
    display: inline-grid; place-items: center; width: 44px; min-height: 44px;
    padding: 0; color: #a6a6ad; background: transparent; border: 0;
    text-decoration: none;
}
.home-link { justify-self: start; color: var(--amber); }
.build-title { text-align: center; font-size: 15px; font-weight: 600; white-space: nowrap; }
.scene { grid-area: preview; min-height: 0; min-width: 0; padding: 6px; border-bottom: 1px solid #262628; background: #1a1a1c; }
.canvas-wrap { position: relative; width: 100%; height: 100%; background: var(--black); overflow: hidden; }
.viewport { position: relative; width: 100%; height: 100%; overflow: hidden; user-select: none; touch-action: pan-y; }
.viewport.draw, .viewport.is-zoomed, .target-box, .resize { touch-action: none; }
.viewport.draw { cursor: crosshair; }
.viewport.is-zoomed:not(.draw) { cursor: grab; }
.image-surface { position: absolute; inset: 0 auto auto 0; transform-origin: top left; }
.image-surface img, .boxes { position: absolute; inset: 0; width: 100%; height: 100%; }
.image-surface img { object-fit: contain; pointer-events: none; }
#panel-dismiss { position: absolute; inset: 0; z-index: 3; border: 0; border-radius: 0; background: transparent; padding: 0; cursor: pointer; }
#panel-dismiss:active { filter: none; }

.target-box { position: absolute; color: #e5ffff; cursor: move; }
.target-box::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    border: calc(1px * var(--inverse-zoom, 1)) solid #a0e5ed;
    background: #54c3e420; box-shadow: 0 0 8px #57cfe881, inset 0 0 8px #57cfe83d;
}
.target-box.is-suggested::before { border-color: #fff1bc; border-style: dashed; background: #f8d97512; box-shadow: none; }
.target-box.is-selected::before { border-color: #e1fbff; }
.draw .target-box { pointer-events: none; }
.box-label {
    position: absolute; top: 0; left: 0; transform: scale(var(--inverse-zoom, 1)); transform-origin: top left;
    padding: 2px 5px; background: #121b20ee; color: #fff;
    font-size: 10px; font-weight: 650; max-width: 126px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}
.is-suggested .box-label { color: #fff1bc; }
.resize { position: absolute; display: grid; place-items: center; width: 38px; height: 38px; transform: translate(-50%,-50%) scale(var(--inverse-zoom,1)); z-index: 2; }
.resize::after { width: 10px; height: 10px; border: 1.5px solid #fff; border-radius: 50%; background: #111; content: ""; }
.resize.nw { top: 0; left: 0; cursor: nwse-resize; }
.resize.ne { top: 0; left: 100%; cursor: nesw-resize; }
.resize.sw { top: 100%; left: 0; cursor: nesw-resize; }
.resize.se { top: 100%; left: 100%; cursor: nwse-resize; }

.upload-screen {
    height: 100%; display: grid; place-items: center; overflow: auto;
    padding: max(24px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom));
    background: #141416;
}
.upload-content { width: min(390px, 100%); text-align: center; display: grid; justify-items: center; gap: 13px; }
.build-brand { display: flex; align-items: center; gap: 7px; color: #bfc4ce; font-weight: 600; }
.build-brand img { width: 21px; height: 21px; object-fit: contain; }
.upload-symbol {
    display: grid; place-items: center; width: 60px; height: 60px; margin-top: 17px;
    border: 1px solid #39393d; border-radius: 13px; color: #d7d7dd; background: #222225;
}
.upload-symbol svg { width: 26px; height: 26px; }
.upload-screen h1 { font-size: clamp(23px,4vw,31px); line-height: 1.14; letter-spacing: -.032em; }
.upload-screen p { color: #a4aab5; max-width: 310px; font-size: 13px; }

.inspector { grid-area: inspector; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.scene-strip { flex: none; display: flex; align-items: stretch; padding: 0 10px; background: var(--bar); border-bottom: 1px solid var(--line); }
.scene-list {
    display: flex; flex: 1; min-width: 0; gap: 5px; overflow-x: auto; position: relative;
    scrollbar-width: thin; scrollbar-color: #444 transparent;
}
.scene-chip, #add-scene {
    flex: none; min-height: 45px; padding: 0 10px;
    background: transparent; border: 0; border-bottom: 2px solid transparent;
    border-radius: 0; color: #a1a1a8; font-size: 13px; white-space: nowrap;
}
.scene-chip[aria-current="step"] { color: #fff; border-bottom-color: var(--amber); }
.scene-chip[data-state="ready"]::after { content: ""; display: inline-block; margin-left: 6px; width: 5px; height: 5px; border-radius: 50%; background: #64cda3; vertical-align: middle; }
#add-scene { color: var(--blue); }
.stages {
    display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); flex: none;
    align-items: stretch; border-bottom: 1px solid #28282c; background: #171719;
}
.stages button {
    padding: 0 2px; min-width: 0; height: 44px; white-space: nowrap;
    border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent;
    font-size: 12px; color: #b1b1b7;
}
.stages button[aria-current="step"] { background: #202024; color: #fff; border-bottom-color: #66666c; }
#target-count { color: var(--blue); }

.editor-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #49494e transparent; touch-action: pan-y; }
.panel { color: var(--text); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px 8px; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-head p { font-size: 11px; color: var(--muted); }
.panel-body { padding: 0 13px 14px; }
.panel-tip { color: var(--muted); margin: 7px 0 8px; font-size: 12px; }
#workspace:not([data-stage="image"]) #scene-home,
#workspace:not([data-stage="targets"]) #targets-panel,
#workspace:not([data-stage="behavior"]) #behavior,
#workspace:not([data-stage="blueprint"]) #blueprint,
#workspace:not([data-stage="run"]) #run-panel { display: none; }
.annotation-tools {
    display: flex; width: min(100%,264px); margin-inline: auto; padding: 1px 3px; gap: 1px; justify-content: space-around;
    border: 1px solid #303035; border-radius: 10px; background: var(--surface);
}
.annotation-tools .icon-button {
    flex: 1; width: auto; min-width: 0; gap: 1px; align-content: center;
    color: #bfbfc6; font-size: 10px; line-height: 1.2;
}
.annotation-tools .icon-button[aria-pressed="true"] { color: #89ccff; background: #222c39; }
.tool-icon { display: grid; place-items: center; }
.tool-icon svg { width: 17px; height: 17px; }

label { display: block; color: #d9d9df; font-size: 12px; font-weight: 550; }
input:not([type="checkbox"]), textarea {
    width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #38383d; border-radius: 9px;
    background: #1b1b1e; color: var(--text); font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #8d8d96; }
textarea { min-height: 84px; resize: vertical; }
.input-action { display: flex; gap: 6px; margin: 4px 0 7px; }
.input-action input { flex: 1; }
.target-list { display: grid; gap: 6px; margin: 10px 0; }
.target-row { display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 4px 6px; border: 1px solid #2f2f32; border-radius: 10px; background: #1d1d1f; }
.target-row:has([aria-pressed="true"]) { border-color: #44769a; background: #202831; }
.target-name { display: flex; align-items: center; flex: 1; gap: 9px; min-width: 0; padding: 3px; background: transparent; text-align: left; }
.target-name > span { display: grid; overflow-wrap: anywhere; min-width: 0; }
.target-name strong { color: var(--text); font-size: 13px; font-weight: 600; }
.target-name small { color: #7ec6fc; font-size: 11px; }
.target-row[data-confirmed="false"] .target-name small { color: #dcba7e; }
.target-thumb, .target-name > svg { flex: none; display: block; width: 40px; height: 40px; border-radius: 7px; border: 1px solid #3a3a3e; background: #101014; }
.target-name > svg { padding: 9px; color: #8ec8f3; }
.target-row .quiet { padding-inline: 8px; font-size: 11px; }
.target-row :is(.action-edit,.action-delete), .task-row .action-delete { display: grid; flex: none; place-items: center; width: 42px; padding: 0; border-radius: 50%; border: 0; background: transparent; }
.target-row :is(.action-edit,.action-delete) svg, .task-row .action-delete svg { width: 29px; height: 29px; padding: 7px; border-radius: 50%; color: #99d6ff; background: #2a3d4c; }
.target-row .action-delete svg, .task-row .action-delete svg { color: #ef9aa5; background: #452b30; }
.task-fields { display: grid; gap: 8px; margin-bottom: 8px; }
.task-row { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 4px 8px 8px; background: #1d1d20; border: 1px solid #303034; border-radius: 9px; }
.task-row label { padding-block: 8px; }
.task-row textarea { grid-column: 1 / -1; min-height: 58px; }
.target-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
#target-feedback { margin-top: 6px; }
.clear-targets { min-height: 40px; padding: 4px 8px; background: transparent; color: #f0a2ad; font-size: 12px; }
#scene-clear-targets { display: block; margin-inline: auto; }
#review-targets { margin-bottom: 8px; }

#blueprint-summary { font-size: 12px; color: var(--muted); }
.command-body { padding-top: 7px; }
#review-image {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin: 8px 0 2px;
    border: 1px solid #303033; border-radius: 9px; background: #1b1b1d; text-align: left;
}
#review-thumbnail { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; flex: none; }
#review-image > span:not(.review-chevron) { display: grid; flex: 1; min-width: 0; }
#review-title { font-size: 13px; font-weight: 600; }
.review-facts { color: #63c3ff; font-size: 11px; font-weight: 500; }
.review-chevron { color: var(--muted); }
.command-tabs { display: flex; align-items: stretch; justify-content: space-between; border-bottom: 1px solid #29292e; }
.command-tabs > span { display: grid; align-items: center; padding-inline: 7px; border-bottom: 2px solid var(--amber); }
.command-tabs button { padding-inline: 6px; background: transparent; color: var(--blue); font-size: 12px; }
.command-tabs #edit-inputs { color: var(--muted); }
.workflow { position: relative; isolation: isolate; display: grid; gap: 2px; margin: 7px 0 11px; }
.workflow::before { content: ""; position: absolute; top: 5px; bottom: 26px; left: 12px; width: 1px; background: #3a3a3e; }
.flow-entry { margin-left: 18px; position: relative; display: flex; align-items: center; flex-wrap: wrap; border-radius: 7px; }
.flow-entry::before {
    content: ""; position: absolute; left: -6px; top: -8px; height: 32px; width: 16px;
    border-left: 1px solid #3a3a3e; border-bottom: 1px solid #3a3a3e; border-radius: 0 0 0 8px;
}
.flow-entry:hover { background: #1c1c1e; }
.flow-node { display: flex; text-align: left; align-items: center; flex: 1; gap: 11px; min-width: 0; min-height: 47px; padding: 5px; background: transparent; }
.flow-node div { display: grid; min-width: 0; overflow-wrap: anywhere; }
.flow-node strong { font-size: 13px; font-weight: 550; }
.flow-node small { color: var(--muted); font-size: 11px; }
.action-icon {
    position: relative; display: grid; place-items: center; width: 25px; height: 25px; flex: none;
    border-radius: 50%; border: 1px solid #36363a; background: #1d1d20; color: #b0b0b6;
}
.action-icon svg, .command-row-actions svg { width: 13px; height: 13px; }
.flow-node[data-type="detect"] .action-icon, [data-action="detect"] svg { color: #efa631; }
.flow-node[data-type="interact"] .action-icon, [data-action="interact"] svg { color: #64bae6; }
[data-action="move"] svg { color: #aebeee; }
[data-action="collect"] svg { color: #87cdad; }
.command-row-actions { display: flex; }
.command-row-actions button {
    position: relative; display: grid; place-items: center; width: 39px; min-height: 44px; padding: 0;
    border: 0; background: transparent; color: #94d3ff; isolation: isolate;
}
.command-row-actions button::before {
    content: ""; position: absolute; width: 25px; height: 25px; border-radius: 50%; z-index: -1; background: #273a48;
}
.command-row-actions .action-delete { color: #ef9aa5; }
.command-row-actions .action-delete::before { background: #452b30; }
.edges { flex-basis: 100%; order: 3; padding-left: 42px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; }
.original { margin-block: 10px; font-size: 12px; color: #b4b4ba; }
.original p { white-space: pre-wrap; }
.order-panel { border: 1px solid #323237; border-radius: 10px; padding: 10px; background: var(--surface); }
.order-panel h3 { font-size: 14px; }
.order-panel p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.studio-link { padding: 8px 4px; font-size: 12px; }

.build-footer { grid-area: footer; background: #141416; border-top: 1px solid #37373b; padding-bottom: env(safe-area-inset-bottom); }
.status-strip { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; min-height: 32px; padding: 0 12px; gap: 10px; border-bottom: 1px solid #262629; font-size: 11px; }
.status-strip > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-strip span { color: var(--muted); }
.status-strip strong { margin-left: 5px; font-weight: 550; }
.save-status { display: flex; align-items: center; gap: 5px; }
.save-state[data-kind="ok"] { color: #80c7a6; }
.save-state[data-kind="error"] { color: #f6a7ac; }
#retry-save { min-height: 25px; padding: 2px 5px; font-size: 10px; }
.footer-actions {
    display: grid; grid-template-columns: 42px 64px 42px; justify-content: center;
    align-items: start; justify-items: center; gap: 7px; padding-block: 6px 5px;
}
.round-button {
    width: 42px; min-height: 43px; position: relative; isolation: isolate;
    color: #bebec6; border-radius: 50%;
}
.round-button::before {
    content: ""; position: absolute; inset: 6px auto auto 5px; z-index: -1;
    width: 32px; height: 32px; border-radius: 50%; background: #29292d;
}
.round-button svg { width: 15px; height: 15px; }
.main-action { display: grid; grid-template-columns: minmax(0,1fr); justify-items: center; gap: 4px; width: 64px; }
#primary-action {
    width: 43px; height: 43px; min-height: 43px; padding: 0; display: grid; place-items: center; border-radius: 50%;
    border: 1px solid #2375cb; background: linear-gradient(145deg,#005ecb,#192a4b); color: #edf7ff;
    box-shadow: inset 0 1px #adcefa36, 0 0 0 3px #17417744, 0 3px 12px #003d805e;
}
#primary-action span { display: grid; place-items: center; }
#primary-action svg { width: 21px; height: 21px; stroke-width: 1.8; }
#primary-caption { color: #c4c6cf; font-size: 10px; line-height: 1.2; }
#primary-action:active:not(:disabled), .round-button:active:not(:disabled) { transform: scale(.94); }

.notice, .progress {
    position: absolute; z-index: 5; bottom: calc(119px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 24px); border: 1px solid #3c3c40; border-radius: 10px;
    padding: 8px 11px; background: #242428; color: #ebebee; box-shadow: 0 5px 18px #0009; font-size: 12px;
}
.notice { pointer-events: none; }
.notice[data-kind="error"] { background: #3c262d; border-color: #71414b; color: #ffe2e7; }
#draft-stale { position: static; width: 100%; max-width: none; transform: none; margin-bottom: 7px; }
.progress { display: flex; align-items: center; gap: 8px; }
.progress h2 { font-size: 14px; }
.progress p { color: var(--muted); }
.spinner { width: 19px; height: 19px; border: 2px solid #3f3f44; border-top-color: #89ceff; border-radius: 50%; animation: spin .85s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog {
    width: min(450px,100%); max-height: calc(100dvh - 28px); margin: auto;
    padding: 15px; overflow: auto; color: var(--text);
    background: var(--surface); border: 1px solid #353537; border-radius: 19px; touch-action: manipulation;
}
dialog::backdrop { background: #000a; }
dialog form { display: grid; gap: 8px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.dialog-head h2 { font-size: 16px; font-weight: 600; }
.dialog-head button { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: #bcbcc2; background: #323235; font-size: 22px; }
.action-options { display: grid; margin-top: 10px; overflow: hidden; border-radius: 10px; background: var(--group); }
.action-options button {
    display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #3a3a3c;
    border-radius: 0; background: transparent; text-align: left; min-height: 48px; font-size: 14px; font-weight: 500;
}
.action-options button::after { content: "›"; margin-left: auto; color: #909099; }
.action-options button:last-child { border-bottom: 0; }
.help-steps { padding-inline-start: 19px; color: #c9c9d1; }
.help-steps li { padding-block: 3px; }
@media (max-width: 760px) {
    .app-header { grid-template-columns: 44px minmax(0, 1fr) auto; }
    dialog:not(#help-dialog) { margin: auto 0 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; padding-bottom: max(15px,env(safe-area-inset-bottom)); }
}
@media (min-width: 761px), (min-width: 625px) and (max-height: 500px) and (orientation: landscape) {
    #workspace {
        grid-template: "header header" auto "preview inspector" minmax(0,1fr) "footer footer" auto /
            minmax(0,1fr) minmax(280px, min(42%,460px));
    }
    .inspector { border-left: 1px solid #333338; }
    .footer-actions { padding-block: 5px; }
    .scene { padding: 8px; }
}
@media (max-height: 470px) and (orientation: landscape) {
    .footer-actions { padding-block: 3px; }
    .status-strip { height: 27px; }
    .demo-tour p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; }
}

.upload-actions { display: grid; width: min(100%,290px); gap: 8px; margin-top: 10px; }
.upload-actions button { border-radius: 9px; min-height: 46px; }
.upload-actions .primary { background: #0966ce; border-color: #247dde; box-shadow: none; }
#reuse-image { background: #232326; border-color: #39393d; }
#demo-start, #return-scene, #discard-empty-scene { background: transparent; }
#demo-start { color: #a5d4ff; }
#discard-empty-scene { min-height: 38px; font-size: 12px; }
#primary-caption { white-space: nowrap; }
.action-icon.with-thumb { width: 36px; height: 36px; border: 0; border-radius: 7px; }
.action-icon.with-thumb .target-thumb { width: 36px; height: 36px; }
.action-options [data-action="target"] svg, .flow-node[data-type="target"] .action-icon { color: #f16785; }
.action-options [data-action="click"] svg, .flow-node[data-type="click"] .action-icon { color: #68c4f2; }
#step-options { display: grid; gap: 6px; }
.step-field { display: grid; grid-template-columns: 1fr minmax(0,54%); align-items: center; gap: 6px; }
.step-field:has(.target-thumb) { grid-template-columns: auto minmax(0,1fr) minmax(0,54%); }
.step-field select { width: 100%; min-width: 0; min-height: 44px; padding: 6px 9px; border: 1px solid #3b3b40; border-radius: 9px; background: #242427; color: var(--text); font: inherit; font-size: 16px; }
.step-field input[type="checkbox"] { justify-self: end; width: 20px; height: 20px; accent-color: #3689d6; }
.offsets { display: grid; gap: 6px 10px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; border: 1px solid #38383d; border-radius: 8px; }
.offsets legend { color: var(--muted); font-size: 12px; }

#plan-dialog { width: min(100%,520px); }
.plan-preview { display: flex; align-items: center; gap: 10px; margin-block: 9px 11px; padding: 9px; border: 1px solid #37373b; border-radius: 10px; background: #242427; }
.plan-preview img { width: 64px; height: 45px; object-fit: cover; border-radius: 6px; }
.plan-preview div { display: grid; min-width: 0; overflow-wrap: anywhere; }
.plan-preview small, .plan-card small { color: #b2b2bb; }
.plan-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-block: 10px 8px; border-radius: 10px; background: #141416; }
.plan-switch button { min-height: 39px; background: transparent; color: var(--muted); }
.plan-switch [aria-pressed="true"] { background: #303036; color: #fff; }
.plan-options { display: grid; gap: 6px; margin-bottom: 10px; }
.plan-card { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 6px; text-align: left; padding: 9px; border-color: #3a3a40; background: #242428; }
.plan-card[aria-pressed="true"] { border-color: #579eda; background: #1d2b3b; }
.plan-card small { grid-column: 1/-1; font-weight: 400; }
.plan-card .plan-custom { color: #9cd6ff; }
.plan-price { color: #e4ebf7; white-space: nowrap; font-size: 13px; }
#plan-hint { margin-top: 7px; text-align: center; }
#plan-feedback { margin-top: 10px; }

.walking .build-footer { display: none; }
.demo-tour {
    grid-area: footer; padding: 2px max(12px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    background: #1d1d20; border-top: 1px solid #39393d;
}
.demo-tour > * { width: min(100%,480px); margin-inline: auto; }
.demo-tour-head { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: #96ccf2; font-size: 11px; }
.demo-controls { display: flex; align-items: center; flex: none; gap: 2px; }
.demo-controls .icon-button { min-height: 38px; width: 36px; color: #c7c7d0; font-size: 21px; }
.demo-controls svg { width: 16px; height: 16px; }
.demo-controls .primary { min-height: 34px; padding: 4px 12px; font-size: 12px; }
.demo-tour h2 { font-size: 13px; font-weight: 600; line-height: 1.2; }
.demo-tour p { color: #b8b8c0; font-size: 11px; line-height: 1.25; margin-top: 3px; }
.demo-focus { outline: 2px solid #9ccff7; outline-offset: -2px; }

#scene-home .panel-head { justify-content: center; text-align: center; }
#canvas-help { text-align: center; margin: 9px auto; max-width: 300px; }
#choose-plan { justify-self: end; min-height: 32px; padding: 0 3px; background: transparent; color: var(--blue); font-size: 11px; }
.preview-zoom {
    position: absolute; top: 4px; right: 4px; z-index: 4; border-radius: 9px;
    background: #171719cf; color: #e3e6ec; width: 36px; min-height: 36px;
}
.preview-zoom svg, #remove-scene svg { width: 16px; height: 16px; }
#remove-scene { width: 35px; flex: none; color: #df9ba4; }
.upload-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.upload-links .quiet { background: transparent; padding: 5px 9px; min-height: 40px; font-size: 12px; }
.upload-links :not(.danger-text) { color: #a5d4ff; }
#reset { margin: 10px 0; }
.project-list { display: grid; gap: 6px; }
.project-card {
    display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px;
    border: 1px solid #38383c; background: #242427; text-align: left;
}
.project-card > span { display: grid; min-width: 0; overflow-wrap: anywhere; }
.project-card small { font-weight: 400; color: #aaaab5; }
.project-card::after { content: "›"; margin-left: auto; color: #9ba6b5; }
.project-cover { width: 54px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; background: #18181a; }
svg.project-cover { padding: 8px; color: #a7b3c0; }
#project-more { margin-top: 8px; }
.danger-button { background: #682e37; color: #fff0f3; }
#workspace[data-example="gate"] .box-label { top: calc(100% + 2px); }

.upload-progress {
    position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #08090bdd; color: #f4f5f8; font-size: 14px;
}
#workspace:not(.has-image)[data-stage="run"] { display: grid; grid-template: "header" auto "inspector" minmax(0,1fr) / minmax(0,1fr); }
#workspace:not(.has-image)[data-stage="run"] :is(.app-header,.inspector) { display: flex; }
#workspace:not(.has-image)[data-stage="run"] .app-header { display: grid; }
#workspace:not(.has-image)[data-stage="run"] :is(.scene,.build-footer) { display: none; }
#workspace:not(.has-image)[data-stage="run"] .stages { grid-template-columns: repeat(2,1fr); }
#workspace:not(.has-image)[data-stage="run"] .stages button:not([data-view="image"],[data-view="run"]) { display: none; }
.run-settings, .run-connection { display: grid; gap: 6px; min-width: 0; }
.run-settings { border: 1px solid #343439; border-radius: 12px; padding: 9px 11px 11px; margin: 0; background: #202023; }
.run-settings legend { padding: 0 4px; color: #e8e8eb; font-size: 13px; font-weight: 650; }
.run-settings select { width: 100%; min-height: 44px; padding: 7px 9px; border: 1px solid #3b3b40; border-radius: 9px; background: #1a1a1d; color: var(--text); font: inherit; font-size: 16px; }
.run-settings label { margin-top: 3px; }
.run-connection { margin-top: 5px; border-top: 1px solid #38383c; padding-top: 9px; }
.run-connection h3 { color: #e1e1e5; font-size: 13px; }
#run-name-row, #run-client-row { display: grid; gap: 5px; }
.run-client-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.run-client-tools button { font-size: 12px; }
.run-actions { margin-top: 9px; }
#run-feedback:empty { display: none; }
#run-feedback[data-kind="error"] { color: #ffb2b7; }
