/* A single, offline-capable scene from the first HTML paint through sign-in.
   These inks belong to the artwork, independently of the workspace theme. */
.mm-startup {
  position: fixed; inset: 0; z-index: 100;
  overflow: auto; isolation: isolate; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100%; margin: 0; padding: 112px 6.5vw 96px;
  color: #fbf5e9; background: #171715;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left; color-scheme: dark;
}
.mm-startup-art, .mm-startup-shade { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.mm-startup-art {
  background: #171715 url("../assets/maestro-origami-studio.webp") center center / cover no-repeat;
  animation: mm-startup-arrive 1.4s ease-out both;
}
.mm-startup-shade {
  background: linear-gradient(90deg, rgba(10, 12, 13, .62), rgba(10, 12, 13, .27) 43%, transparent 70%),
    linear-gradient(0deg, rgba(10, 12, 13, .63), transparent 30%, transparent 85%, rgba(10, 12, 13, .15));
}
.mm-startup-brand {
  position: absolute; top: 62px; left: 6.5vw;
  display: flex; align-items: center; gap: 11px;
  color: #fbf5e9; font-size: 19px; font-weight: 600; letter-spacing: -.5px;
}
.mm-startup-mark {
  width: 28px; height: 28px; background: #e1bd92;
  -webkit-mask: url("../../workspaces/assets/maestro-mark.svg") center / contain no-repeat;
  mask: url("../../workspaces/assets/maestro-mark.svg") center / contain no-repeat;
}
.mm-startup-content { width: min(570px, 47vw); min-height: 430px; }
.mm-startup .mm-startup-eyebrow {
  margin: 0 0 25px; color: #ddbf98; font-size: 10px; line-height: 1.5;
  font-weight: 600; letter-spacing: .2em;
}
.mm-startup .mm-startup-title {
  margin: 0; color: #fffaf2; font-size: clamp(38px, 4.8vw, 76px);
  font-weight: 500; letter-spacing: -.055em; line-height: 1.08;
}
.mm-startup-title span { color: #ddc2a1; }
.mm-startup .mm-startup-intro {
  margin: 24px 0 0; color: #ded7ce; font-size: clamp(14px, 1.25vw, 18px); line-height: 1.6;
}
.mm-startup-status { margin-top: 44px; max-width: 380px; }
.mm-startup-status-line { display: flex; align-items: center; gap: 12px; }
.mm-startup .mm-startup-label { margin: 0; color: #f3eade; font-size: 14px; line-height: 1.5; }
.mm-startup .mm-startup-detail { margin: 13px 0 0; color: #c9c1b7; font-size: 13px; line-height: 1.7; text-wrap: pretty; }
.mm-startup-signal { flex: none; display: flex; gap: 3px; align-items: center; height: 18px; }
.mm-startup-signal i { display: block; height: 7px; width: 4px; background: #dbb78b; transform: skewY(-25deg); }
.mm-startup-signal i:nth-child(2) { height: 13px; }
.mm-startup-signal i:nth-child(3) { height: 9px; }
.mm-startup-signal.is-loading i { animation: mm-startup-conduct 1.35s ease-in-out infinite; }
.mm-startup-signal.is-loading i:nth-child(2) { animation-delay: .15s; }
.mm-startup-signal.is-loading i:nth-child(3) { animation-delay: .3s; }
.mm-startup-action {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 46px; margin-top: 24px; padding: 12px 17px; border: 1px solid #e4cdae; border-radius: 7px;
  background: #edddc5; color: #24201c; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.mm-startup-action:hover { background: #fff2dd; border-color: #fff2dd; }
.mm-startup-action:focus-visible { outline: 2px solid #fff8eb; outline-offset: 5px; }
.mm-startup-action span { font-size: 18px; font-weight: 400; }
.mm-startup-footer {
  position: absolute; left: 6.5vw; bottom: 38px; display: flex; align-items: center; gap: 12px;
  color: #d4c7b7; font-size: 9px; line-height: 1.5; letter-spacing: .17em;
}
.mm-startup-rule { width: 28px; height: 1px; background: #bb9772; }
.mm-startup-version {
  position: absolute; right: 24px; bottom: 20px; z-index: 2;
  color: #d4c7b7; opacity: .7; font-size: 11px; letter-spacing: .06em;
  font-variant-numeric: tabular-nums; user-select: text; -webkit-user-select: text;
}
.mm-launch-brand .mm-startup-version { position: static; margin-left: 10px; font-size: 11px; font-weight: 400; }
/* Unready workspace chrome must neither show through nor take keyboard focus.
   Keep the existing first drag surface available under the native title bar. */
body:has(.mm-startup) :is(#mm-rail, #mm-pane, #mm-top > *) { visibility: hidden; }
body:has(.mm-startup) #mm-top {
  display: block; position: fixed; inset: 0 0 auto; height: 38px; z-index: 101;
  background: transparent; border: 0; box-shadow: none;
}
@keyframes mm-startup-conduct { 50% { transform: skewY(-25deg) scaleY(.45); opacity: .55; } }
@keyframes mm-startup-arrive { from { transform: scale(1.025); } to { transform: scale(1); } }
@media (max-width: 760px) {
  .mm-startup { padding: 112px 32px 84px; justify-content: flex-end; }
  .mm-startup-art { background-position: 83% center; }
  .mm-startup-shade { background: linear-gradient(0deg, rgba(10,12,13,.97), rgba(10,12,13,.88) 34%, rgba(10,12,13,.15) 79%); }
  .mm-startup-brand { left: 32px; top: 52px; text-shadow: 0 2px 12px #000; }
  .mm-startup-content { width: min(100%, 480px); min-height: 380px; }
  .mm-startup .mm-startup-title { font-size: clamp(36px, 7vw, 52px); }
  .mm-startup .mm-startup-eyebrow { margin-bottom: 17px; }
  .mm-startup .mm-startup-intro { margin-top: 16px; }
  .mm-startup-status { margin-top: 28px; }
  .mm-startup-footer { left: 32px; bottom: 26px; font-size: 8px; }
}
@media (max-height: 650px) {
  .mm-startup { justify-content: flex-start; padding-top: 106px; padding-bottom: 32px; }
  .mm-startup-brand { top: 50px; }
  .mm-startup-status { margin-top: 24px; }
  .mm-startup-footer { position: static; margin-top: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-startup-art, .mm-startup-signal.is-loading i { animation: none; }
  .mm-startup-action { transition: none; }
}

/* The launch choice inherits the splash artwork, with quiet app chrome and a
   single decision. Lists and capacity are optional, contained destinations. */
.mm-startup.mm-launch {
  --launch-ink: #edf1f6; --launch-muted: #aeb9c8; --launch-line: #2c3743;
  --launch-bg: #0d141c; --launch-panel: #141d27; --launch-accent: #92b1ff;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 74px 1fr 52px; justify-content: stretch; padding: 0; min-height: 100dvh;
  color: var(--launch-ink); background: #0c131a; font-size: 14px;
}
.mm-launch *, .mm-launch *::before, .mm-launch *::after { box-sizing: border-box; }
.mm-launch [hidden] { display: none !important; }
.mm-launch .mm-startup-art { animation: none; }
.mm-launch .mm-startup-shade { background: linear-gradient(90deg, #0c131af5, #0c131acb 34%, #0c131a36 63%, transparent); }
.mm-launch-chrome { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 28px 0 86px; }
.mm-launch-brand, .mm-launch-tools { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.mm-launch-brand { font-weight: 600; }
/* Linux draws its window lights in the top 38px band (window_frame.js), so the
   brand row sits in that band beside them rather than a row below. */
:root[data-shell-frameless] .mm-launch-chrome { align-self: start; height: 38px; padding-top: 0; }
/* …which is also where the startup scene's invisible #mm-top drag strip lies.
   Let clicks through it to Capacity and the account button; the header is a
   drag surface of its own (data-shell-drag), so the window still moves. */
:root[data-shell-frameless] body:has(.mm-launch) #mm-top { pointer-events: none; }
.mm-launch .mm-startup-mark { background: var(--launch-accent); width: 20px; height: 20px; }
.mm-launch button, .mm-launch input { font: inherit; }
.mm-launch button { cursor: pointer; }
.mm-launch button:disabled { cursor: default; opacity: .55; }
.mm-launch button:focus-visible, .mm-launch input:focus-visible { outline: 2px solid var(--launch-accent); outline-offset: 4px; }
.mm-launch-capacity { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; background: var(--launch-bg); color: var(--launch-muted); font-size: 12px; border: 0; }
.mm-launch-capacity svg { width: 17px; height: 17px; }
.mm-launch-account-wrap { position: relative; }
.mm-launch-account { padding: 9px 12px; border-radius: 7px; border: 0; background: var(--launch-bg); color: var(--launch-muted); font-size: 12px; overflow-wrap: anywhere; text-align: left; }
.mm-launch-account:hover, .mm-launch-account[aria-expanded="true"] { color: var(--launch-accent); }
.mm-launch-account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 240px; max-width: 320px; padding: 14px; border-radius: 9px; background: var(--launch-bg); border: 1px solid var(--launch-line); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.mm-launch-account-who { margin: 0 0 10px; color: var(--launch-ink, #f2ebe1); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.mm-launch-account-out { width: 100%; padding: 9px 12px; border-radius: 7px; border: 1px solid var(--launch-line); background: transparent; color: var(--launch-ink, #f2ebe1); font-size: 13px; font-weight: 600; text-align: left; }
.mm-launch-account-out:hover { border-color: var(--launch-accent); color: var(--launch-accent); }
.mm-launch-account-hint { margin: 8px 0 0; color: var(--launch-muted); font-size: 11px; line-height: 1.4; }
.mm-launch-capacity:hover { color: var(--launch-accent); }
.mm-launch-body { display: flex; align-items: center; min-height: 430px; padding: 64px 5.4vw 70px; }
.mm-launch-intro { width: min(440px, 50%); }
.mm-launch .mm-launch-eyebrow { margin: 0 0 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .15em; color: var(--launch-muted); }
.mm-launch-intro h1, .mm-launch-picker h1 { font-size: clamp(27px, 3vw, 40px); font-weight: 600; letter-spacing: -.05em; line-height: 1.15; margin: 0 0 20px; color: var(--launch-ink); }
.mm-launch-subtitle, .mm-launch-rest { font-size: 13px; line-height: 1.6; color: var(--launch-muted); margin: 0; }
.mm-launch-choice { margin-top: 28px; }
.mm-launch-switch-label { display: flex; align-items: center; gap: 13px; font-size: 16px; font-weight: 500; cursor: pointer; }
.mm-launch input.mm-launch-switch { appearance: none; -webkit-appearance: none; margin: 0; position: relative; width: 42px; height: 24px; flex: 0 0 42px; border: 1px solid var(--launch-line); border-radius: 20px; background: #2b3544; transition: background .15s; }
.mm-launch-switch::before { content: ''; position: absolute; top: 3px; left: 3px; height: 16px; width: 16px; border-radius: 50%; background: var(--launch-muted); transition: transform .15s; }
.mm-launch-switch:checked { background: var(--launch-accent) !important; border-color: var(--launch-accent) !important; }
.mm-launch-switch:checked::before { transform: translateX(18px); background: #101b32; }
.mm-launch-link { border: 0; background: transparent; color: var(--launch-muted); text-decoration: underline; text-underline-offset: 4px; padding: 8px 0; font-size: 13px !important; }
.mm-launch-link:hover { color: var(--launch-ink); }
.mm-launch-choice > .mm-launch-link { margin: 2px 0 0 55px; }
.mm-launch-rest { margin-top: 24px; min-height: 21px; }
.mm-launch-submit { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; border: 0; border-radius: 8px; padding: 13px 19px; margin-top: 23px; background: var(--launch-accent); color: #101b32; font-size: 14px !important; font-weight: 600 !important; }
.mm-launch-submit:hover { background: #b3c8ff; }
.mm-launch-update { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding: 11px 12px 11px 14px; border: 1px solid var(--launch-line); border-radius: 8px; background: var(--launch-panel); color: var(--launch-ink); font-size: 13px; line-height: 1.45; }
.mm-launch-update > svg { flex: 0 0 auto; color: var(--launch-accent); }
.mm-launch-update > span { flex: 1 1 auto; }
.mm-launch-update-action { flex: 0 0 auto; border: 1px solid var(--launch-accent); border-radius: 7px; padding: 7px 12px; background: transparent; color: var(--launch-accent); font-size: 13px !important; font-weight: 600 !important; }
.mm-launch-update-action:hover { background: var(--launch-accent); color: #101b32; }
.mm-launch-policy-note { color: var(--launch-muted); font-size: 12px; line-height: 1.5; margin: 16px 0 0; }
.mm-launch-error { font-size: 13px; line-height: 1.6; color: #f0c592; max-width: 400px; }
.mm-launch-error button { margin-left: 12px; }
.mm-launch-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 26px; background: var(--launch-bg); color: var(--launch-muted); border-top: 1px solid var(--launch-line); font-size: 11px; }
.mm-launch[data-scene='picker'] .mm-launch-body, .mm-launch[data-scene='capacity'] .mm-launch-body { min-height: 0; overflow: hidden; align-items: flex-start; background: var(--launch-bg); padding: 25px 5.4vw; }
.mm-launch[data-scene='picker'] .mm-launch-chrome, .mm-launch[data-scene='capacity'] .mm-launch-chrome { background: var(--launch-bg); }
.mm-launch-picker { height: 100%; min-height: 0; display: flex; flex-direction: column; max-width: 860px; width: 100%; margin: 0 auto; }
.mm-launch-picker h1 { font-size: 26px; margin-bottom: 8px; }
.mm-launch-picker-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.mm-launch-picker-head p { margin: 0 0 22px; color: var(--launch-muted); font-size: 13px; }
.mm-launch .mm-launch-search { width: 100%; border: 1px solid var(--launch-line); border-radius: 8px; background: var(--launch-panel); color: var(--launch-ink); padding: 12px 14px; font-size: 14px; }
.mm-launch-select-all { display: flex; gap: 20px; margin: 9px 0; }
.mm-launch-teams { min-height: 0; overflow: auto; flex: 1; }
.mm-launch-picker > :not(.mm-launch-teams) { flex-shrink: 0; }
.mm-launch-team { border-bottom: 1px solid var(--launch-line); }
.mm-launch-team-head { display: flex; align-items: center; gap: 13px; padding: 12px 2px; }
.mm-launch-team-head button { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 0; border: 0; background: transparent; color: var(--launch-ink); text-align: left; }
.mm-launch-team-head button > span:last-child { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.mm-launch-team-head svg { width: 15px; height: 15px; }
.mm-launch-team input[type='checkbox'] { accent-color: var(--launch-accent); width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
.mm-launch-agent { display: flex; align-items: center; gap: 12px; padding: 13px 2px 13px 29px; cursor: pointer; }
.mm-launch-agent.is-unavailable { opacity: .6; cursor: default; }
.mm-launch-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; border: 1px solid var(--launch-line); display: grid; place-items: center; background: var(--launch-panel); font-size: 11px; }
.mm-launch-person { display: flex; flex: 1; min-width: 0; flex-direction: column; font-size: 14px; }
.mm-launch-person small, .mm-launch-engine small { display: block; font-size: 11px; line-height: 1.6; color: var(--launch-muted); }
.mm-launch-engine { text-align: right; font-size: 12px; max-width: 45%; overflow-wrap: anywhere; }
.mm-launch-muted { color: var(--launch-muted); }
.mm-launch-picker-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; font-size: 12px; }
.mm-launch-picker-foot .mm-launch-submit { margin: 0; min-width: 90px; }
.mm-launch-dashboard { display: flex; flex-direction: column; height: 100%; min-height: 0; width: 100%; color: var(--text); background: var(--bg); border-radius: 12px; color-scheme: normal; }
.mm-launch-accounts { flex: 1; min-height: 0; }
.mm-launch-accounts .mm-acc-body > * { flex-shrink: 0; }
.mm-launch-nav { flex: none; padding: 14px 32px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.mm-launch .mm-launch-back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 650; line-height: 1.4; }
.mm-launch-back svg { flex: none; }
.mm-launch-back:hover { background: var(--panel); }
.mm-launch .mm-launch-back:focus-visible { outline-color: var(--accent); }
@media (max-width: 760px) { .mm-launch-nav { padding: 12px 20px; } }
@media (max-width: 650px) {
  .mm-startup.mm-launch { grid-template-rows: 85px 1fr auto; }
  .mm-launch-chrome { padding: 44px 22px 0; }
  .mm-launch-account-wrap { display: none; }
  .mm-launch-body { padding: 110px 25px 44px; align-items: flex-end; }
  .mm-launch-intro { width: min(100%, 440px); }
  .mm-launch-intro h1, .mm-launch-picker h1 { font-size: 31px; }
  .mm-launch .mm-startup-shade { background: linear-gradient(0deg, #0c131aff 12%, #0c131ae8 50%, #0c131a35); }
  .mm-launch-footer { padding: 14px 22px; flex-wrap: wrap; }
  .mm-launch[data-scene='picker'] .mm-launch-body, .mm-launch[data-scene='capacity'] .mm-launch-body { padding: 25px 18px; }
  .mm-launch-agent { gap: 8px; padding-left: 2px; }
  .mm-launch-avatar { display: none; }
  .mm-launch-engine { max-width: 43%; }
}
@media (prefers-reduced-motion: reduce) { .mm-launch-switch, .mm-launch-switch::before { transition: none !important; } }

/* Workspace progress after the launch choice. Uses the shared modal's focus,
   Escape and route cleanup, and the app's light/dark palette. */
.modal-card.mm-start-progress { position: relative; padding: 0; border-radius: 15px; overflow: hidden; }
.mm-start-progress-brand { display: flex; align-items: center; gap: 8px; padding: 22px 24px 0; font-size: 12px; color: var(--muted); }
.mm-start-progress .modal-head { padding: 14px 24px 0; margin: 0; border: 0; }
.mm-start-progress .modal-head h3 { font-size: 22px; font-weight: 500; letter-spacing: -.5px; }
.mm-start-progress .modal-close { position: absolute; top: 16px; right: 18px; }
.mm-start-progress-body { padding: 0 24px; }
.mm-start-progress-subtitle { margin: 7px 0 22px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.mm-start-progress-total { margin-bottom: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm-start-progress-track { height: 4px; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.mm-start-progress-fill { height: 100%; background: var(--accent); transition: width .2s; }
.mm-start-progress-list { list-style: none; padding: 8px 0 14px; margin: 0; }
.mm-start-progress-row { display: flex; align-items: center; gap: 12px; min-height: 49px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.mm-start-progress-row:last-child { border: 0; }
.mm-start-progress-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mm-start-progress-count { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.mm-start-progress-review { border: 0; padding: 6px; border-radius: 6px; color: var(--warn); background: var(--panel-2); font: inherit; font-size: 12px; cursor: pointer; }
.mm-start-progress-footer { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--border-soft); background: var(--panel-2); }
.mm-start-progress-footer .btn { font-size: 12px; padding: 9px 14px; }
.modal-card > .mm-start-progress-brand, .modal-card > .mm-start-progress-footer { flex: none; overflow: visible; }
.mm-start-progress-chip { position: fixed; right: 22px; bottom: 20px; z-index: 1100; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); box-shadow: 0 4px 16px #0002; font: inherit; font-size: 13px; cursor: pointer; }
.mm-start-progress-chip[hidden], .mm-start-progress-review[hidden] { display: none; }
.mm-start-progress-view { color: var(--accent-ink); }
@media (max-width: 420px) { .mm-start-progress-body { padding: 0 16px; } .mm-start-progress .modal-head, .mm-start-progress-brand { padding-left: 16px; padding-right: 16px; } .mm-start-progress-footer { padding: 14px 16px; } .mm-start-progress-chip { right: 16px; } }
@media (pointer: coarse) { .mm-start-progress button { min-height: 44px; min-width: 44px; } }
@media (prefers-reduced-motion: reduce) { .mm-start-progress-fill { transition: none; } }
/* "On your other computers" on the startup choice: one line + a list dialog. */
.mm-launch-elsewhere { margin: 14px 0 0; color: var(--launch-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mm-launch-elsewhere-list { display: flex; flex-direction: column; gap: 2px; }
.mm-launch-elsewhere-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.mm-launch-elsewhere-row:last-child { border-bottom: 0; }
.mm-launch-elsewhere-row .mm-launch-person { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mm-launch-elsewhere-row small { color: var(--muted); }
.mm-launch-elsewhere-row .mm-launch-avatar { width: 30px; height: 30px; flex-shrink: 0; }
.mm-launch-elsewhere-group { margin: 12px 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mm-launch-elsewhere-group:first-child { margin-top: 0; }
