/* The hero's program window (templates/pages/_app_window.html, pages/static/pages/hero.js): the
   HTML copy of the desktop app at 1440 x 900 (design/landing-2026-11-24/canvas/AppAnimated.dc.html),
   scaled to the hero's width by --aa-scale (hero.js measures the frame). The app's own components
   (.oc-btn, .oc-chip, .oc-tabs, .oc-progress, .oc-seg, .oc-toggle, .oc-input) carry the look; this
   file lays the window out and holds the app's off-scale sizes (tests/test_design_literals.py lets
   this file mirror them; colours stay tokens).

   The root's data-phase is the moment of the run: idle and drop (the empty order and the dragged
   scan), run (the eight stages; data-stage marks the running one), ready (the finished model). The
   template ships "ready", so the window shows the result without JavaScript and with reduced motion. */

.hm-window{--aa-scale:.8333}
.aa{position:absolute;left:0;top:0;width:1440px;height:900px;transform-origin:0 0;transform:scale(var(--aa-scale));display:flex;overflow:hidden;background:var(--oc-surface);color:var(--oc-text);font:var(--oc-type-ui-body);text-align:left}
.aa .i{--icon:16px}

/* What each moment shows. */
.aa:not([data-phase="idle"]):not([data-phase="drop"]) .aa-only-start,
.aa[data-phase="idle"] .aa-only-job,.aa[data-phase="drop"] .aa-only-job,
.aa:not([data-phase="run"]) .aa-only-run,
.aa:not([data-phase="ready"]) .aa-only-ready,
.aa:not([data-phase="run"]):not([data-phase="ready"]) .aa-today,
.aa:not([data-phase="run"]) .aa-st-run,
.aa:not([data-phase="ready"]) .aa-today .aa-st-ok,
.aa:not([data-phase="drop"]) .aa-fly{display:none !important}

/* ---------------------------------------------------------------- the sidebar (the app's dark chrome) */
.aa-side{width:280px;flex:none;display:flex;flex-direction:column;background:var(--oc-chrome-bg);color:var(--oc-neutral-50)}
.aa-side-top{padding:18px 16px 14px;display:flex;flex-direction:column;gap:14px}
.aa-logo{height:22px;width:auto;align-self:flex-start;display:block}
.aa-add{width:100%}
.aa-search{display:flex;align-items:center;gap:8px;height:32px;padding:0 10px;border-radius:6px;background:var(--oc-neutral-900);border:1px solid var(--oc-neutral-700);color:var(--oc-neutral-350)}
.aa-list{flex:1;overflow:hidden;padding:4px 8px;display:flex;flex-direction:column;gap:2px}
.aa-today{display:flex;flex-direction:column;gap:2px}
.aa-day{display:block;padding:14px 8px 6px;font:600 12px/16px var(--oc-font-ui);color:var(--oc-neutral-350)}
.aa-today .aa-day{padding-top:10px}
.aa-row{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border-radius:6px}
.aa-row.is-sel{background:var(--oc-neutral-700)}
.aa-file{font:500 13px/18px var(--oc-font-mono);color:var(--oc-neutral-50)}
.aa-st{display:flex;align-items:center;gap:6px;font:400 12px/16px var(--oc-font-ui)}
.aa-st .i{--icon:14px}
.aa-st-ok{color:var(--oc-success-300)}
.aa-st-run{color:var(--oc-blue-300)}
.aa-st-run .oc-spin{width:10px;height:10px;margin:0 2px}
.aa-st-skip{color:var(--oc-neutral-300)}
.aa-lab{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--oc-neutral-700);font:500 13px/18px var(--oc-font-ui)}
.aa-lab-mark{width:28px;height:28px;border-radius:6px;background:var(--oc-neutral-700);display:flex;align-items:center;justify-content:center;font:600 12px/16px var(--oc-font-ui)}

/* ---------------------------------------------------------------- the main area */
.aa-main{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--oc-bg)}
.aa-head{height:60px;flex:none;display:flex;align-items:center;gap:12px;padding:0 20px;background:var(--oc-surface);border-bottom:1px solid var(--oc-border)}
.aa-title{font:600 18px/24px var(--oc-font-ui)}
.aa-file-title{font:600 15px/20px var(--oc-font-mono)}
.aa-actions{margin-left:auto;display:flex;gap:8px}
.aa-head .oc-chip .i{--icon:14px}

/* idle and drop: the empty order, a scan flies into the drop zone */
.aa-start{flex:1;min-height:0;padding:32px;display:flex}
.aa-drop{flex:1;position:relative;border:2px dashed var(--oc-border-strong);border-radius:16px;background:var(--oc-surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;transition:border-color 300ms ease,background-color 300ms ease}
.aa[data-phase="drop"] .aa-drop{border-color:var(--oc-accent);background:var(--oc-blue-50)}
.aa-drop-ico{width:56px;height:56px;border-radius:16px;background:var(--oc-accent-subtle);color:var(--oc-accent-text);display:flex;align-items:center;justify-content:center}
.aa-drop-ico .i{--icon:28px}
.aa-drop-h{font:700 26px/32px var(--oc-font-display);letter-spacing:-.01em}
.aa-drop-p{color:var(--oc-text-muted)}
.aa-fly{position:absolute;left:50%;top:58%;margin-left:-150px;width:300px;box-sizing:border-box;display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:10px;background:var(--oc-surface);border:1px solid var(--oc-border);box-shadow:var(--oc-shadow-3);font:500 14px/20px var(--oc-font-mono);animation:aa-fly 900ms cubic-bezier(.2,.8,.2,1) both}
.aa-fly .i{--icon:18px;color:var(--oc-accent-text)}

/* run and ready: the order */
.aa-job{flex:1;min-height:0;display:flex}
.aa-work{flex:1;min-width:0;display:flex;flex-direction:column;gap:16px;padding:16px 20px 20px}
.aa-tabs{flex:none}
.aa[data-phase="run"] .aa-tab-model{color:var(--oc-text-disabled);border-bottom-color:transparent}
.aa[data-phase="run"] .aa-tab-scan,.aa[data-phase="ready"] .aa-tab-model{color:var(--oc-accent-text);border-bottom-color:var(--oc-accent);font-weight:600}
.aa-view{flex:1;min-height:0;position:relative;border-radius:10px;overflow:hidden;background:var(--oc-viewport-bg);display:flex;align-items:center;justify-content:center}
.aa-card{position:relative;width:380px;background:var(--oc-surface);border-radius:10px;box-shadow:var(--oc-shadow-3);padding:20px 22px;display:flex;flex-direction:column;gap:14px;animation:aa-in 500ms cubic-bezier(.2,.8,.2,1) both}
.aa-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.aa-card-head b{font:600 18px/24px var(--oc-font-ui)}
.aa-card-head span{font:500 13px/18px var(--oc-font-ui);color:var(--oc-text-muted);font-variant-numeric:tabular-nums}
.aa-card .oc-progress i{width:6%;transition:width 400ms cubic-bezier(.2,.8,.2,1)}
.aa-stages{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.aa-stages li{display:flex;align-items:center;gap:10px;height:20px;color:var(--oc-text-subtle)}
.aa-stage-ico{width:16px;display:flex;justify-content:center;align-items:center}
.aa-stage-ico .i{stroke:var(--oc-success)}
.aa-stage-ico .oc-spin{color:var(--oc-accent);width:14px;height:14px}
.aa-todo{width:6px;height:6px;border-radius:50%;background:var(--oc-border-strong);display:block}
.aa-stages li:not(.is-done) .aa-done,.aa-stages li:not(.is-now) .aa-now,.aa-stages li:is(.is-done,.is-now) .aa-todo{display:none}
.aa-stages li.is-done{color:var(--oc-text-muted)}
.aa-stages li.is-done .aa-done{animation:aa-pop 450ms cubic-bezier(.34,1.56,.64,1) both}
.aa-stages li.is-now{color:var(--oc-text);font-weight:600}
.aa-card-foot{margin:0;padding-top:12px;border-top:1px solid var(--oc-border);font:400 12px/16px var(--oc-font-ui);color:var(--oc-text-muted)}
.aa-model{height:88%;width:auto;display:block}
.aa-legend{position:absolute;left:16px;bottom:14px;display:flex;gap:16px;font:400 12px/16px var(--oc-font-ui);color:var(--oc-neutral-300)}
.aa-legend span{display:inline-flex;align-items:center;gap:6px}
.aa-legend i{width:10px;height:10px;border-radius:2px;display:block}
.aa-sw-scan{background:var(--oc-viewport-model)}
.aa-sw-base{background:var(--oc-model-added)}
.aa-tiles{flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.aa-tile{background:var(--oc-surface);border:1px solid var(--oc-border);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.aa-tile b{font:600 20px/26px var(--oc-font-ui);letter-spacing:-.005em}
.aa-tile span{font:400 12px/16px var(--oc-font-ui);color:var(--oc-text-muted)}

/* the order's settings, dimmed while the run goes */
.aa-pane{width:320px;flex:none;display:flex;flex-direction:column;background:var(--oc-surface);border-left:1px solid var(--oc-border);transition:opacity 400ms ease}
.aa[data-phase="run"] .aa-pane{opacity:.45}
.aa-pane-sec{padding:16px 20px;display:flex;flex-direction:column;gap:10px;border-bottom:1px solid var(--oc-border)}
.aa-pane-top{padding:16px 20px 12px}
.aa-pane-last{border-bottom:0;gap:8px}
.aa-pane-h{font:600 18px/24px var(--oc-font-ui)}
.aa-pane-h3{font:600 15px/20px var(--oc-font-ui)}
.aa-pane .oc-seg{align-self:flex-start}
.aa-pane .oc-seg button{cursor:default}
.aa-kv{display:flex;align-items:center;justify-content:space-between}
.aa-kv > span{color:var(--oc-text-muted)}
.aa-kv b:not(.aa-pane-h3){font-weight:600}
.aa-note{font:400 12px/16px var(--oc-font-ui);color:var(--oc-text-subtle)}
.aa-pane .oc-input .i{--icon:16px;color:var(--oc-text-muted)}

.aa-foot{height:30px;flex:none;display:flex;align-items:center;gap:8px;padding:0 20px;background:var(--oc-surface);border-top:1px solid var(--oc-border);font:400 12px/16px var(--oc-font-ui);color:var(--oc-text-muted)}
.aa-foot > span{display:inline-flex;align-items:center;gap:6px}
.aa-foot .aa-ok{--icon:14px;stroke:var(--oc-success)}

/* ---------------------------------------------------------------- motion (only while hero.js plays) */
@keyframes aa-fly{from{opacity:0;transform:translate(-560px,-140px) rotate(-8deg)}55%{opacity:1}to{opacity:1;transform:none}}
@keyframes aa-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes aa-pop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}
@keyframes aa-fade{from{opacity:0}to{opacity:1}}
@keyframes aa-window{from{opacity:0;transform:translateY(28px) scale(.985)}to{opacity:1;transform:none}}
@keyframes aa-note{from{opacity:0;transform:rotate(-4deg) scale(.6)}to{opacity:1;transform:rotate(-4deg) scale(1)}}
.is-playing .aa-in{animation:aa-in 500ms cubic-bezier(.2,.8,.2,1) both}
.is-playing .aa-pop{animation:aa-pop 450ms cubic-bezier(.34,1.56,.64,1) both}
.is-playing .aa-fade{animation:aa-fade 600ms ease both}
.is-playing .aa-d1{animation-delay:120ms}
.is-playing .aa-d2{animation-delay:240ms}
.is-playing .aa-d3{animation-delay:360ms}
.hm-window.is-playing{animation:aa-window 700ms cubic-bezier(.2,.8,.2,1) both}
/* The time note pops onto the corner once the model is ready. */
.hm-stage.is-waiting .hm-note{visibility:hidden}
.hm-stage.is-noted .hm-note{animation:aa-note 500ms cubic-bezier(.34,1.56,.64,1) both}
@media (prefers-reduced-motion:reduce){
  .aa *,.hm-window,.hm-note{animation:none !important;transition:none !important}
}
