/* The hosted document starts in the modern shell before any JavaScript runs. */
:root:has(> body > .app[aria-busy="true"]), :root:has(> body > .app[aria-busy="true"]) > body { overflow: hidden !important; }
.app[inert][aria-busy="true"] > :not(.topbar) { visibility: hidden; }
body:has(> .app[aria-busy="true"]) > dialog:not([data-authentication-gate]) { visibility: hidden; }
#appStartup {
  position: fixed;
  inset: 56px 0 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #08120f;
  color: #b5c4bb;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}
#appStartup:not(.experience-startup) p,
#appStartup .startup-feedback p { margin: 0; font: inherit; color: inherit; letter-spacing: 0; text-transform: none; }
#appStartup a { font: inherit; letter-spacing: 0; text-transform: none; color: #8be4a8; padding: 8px 12px; border: 1px solid #26392f; border-radius: 6px; text-decoration: none; }
#appStartup a:focus-visible { outline: 2px solid #8be4a8; outline-offset: 2px; }
@media (max-width: 700px) { #appStartup { inset-block-start: 92px; } }

.tc-skeleton { display:block; border-radius:8px; background:linear-gradient(100deg,#15271f 25%,#233b2e 45%,#15271f 65%);background-size:220% 100%;animation:tc-loading-shimmer 1.8s ease-in-out infinite; }
@keyframes tc-loading-shimmer { from {background-position:100% 0} to {background-position:-100% 0} }
.startup-skeleton {width:min(1400px,100%);}
.startup-toolbar {height:46px;margin-bottom:20px;}
.startup-columns {display:grid;grid-template-columns:180px 1fr 220px;gap:24px;}
.startup-sidebar {height: min(55vh,500px);}
.startup-video {aspect-ratio:16/9;min-height:180px;}
.tc-loading {position:relative;padding:20px;border-radius:8px;background:#0e1c15;color:#c4d4cb;text-align:center;z-index:12;}
.tc-loading-overlay {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:inherit;z-index:15;}
.tc-loading p {font:14px/1.5 system-ui;margin:12px 0;}
.tc-loading-shapes {width:min(420px,80%);margin:auto;display:grid;gap:12px;}
.tc-loading-shapes .tc-skeleton {height:18px;}
.tc-loading-shapes .tc-skeleton:first-child {height:80px;}
.tc-loading-shapes .tc-skeleton:last-child {width:65%;}
.tc-loading button {padding:10px 18px;border:1px solid #466551;border-radius:6px;background:#173923;color:#e2f4e8;cursor:pointer;}
.tc-loading [hidden] {display:none;}
.tc-startup-mark {display:block;object-fit:contain;margin:0 auto 8px;}
@media(max-width:700px) {.startup-columns {grid-template-columns:1fr}.startup-sidebar {display:none}.startup-video {min-height:240px}}
@media(prefers-reduced-motion:reduce) {.tc-skeleton {animation:none;background:#1a3024}}

/* The redesigned preview uses the same scoped presentation rules as the
   finished page; only content that needs account data is a placeholder. */
#appStartup.experience-startup {
  inset:var(--tc-header-height) 0 0;
  z-index:20;
  display:block;
  width:auto;
  height:auto;
  padding:0;
  margin:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  background:var(--tc-background);
  color:var(--text-primary);
  font:14px/1.5 var(--tc-body);
  text-align:left;
}
.experience-startup .startup-preview {height:100%;}
.experience-startup .startup-preview>section {display:none;}
html:not([data-startup-destination]) .experience-startup .startup-home,
html[data-startup-destination="home"] .experience-startup .startup-home,
html[data-startup-destination="library"] .experience-startup .startup-library,
html[data-startup-destination="settings"] .experience-startup .startup-settings {display:block;height:100%;}
html:is([data-startup-destination="analyze"],[data-startup-destination="coach"]) .experience-startup .startup-analysis {display:grid;grid-template-rows:var(--tc-command-height) minmax(0,1fr);height:100%;}
html[data-startup-destination="coach"] .experience-startup .workspace-layout {grid-template-columns:minmax(0,1fr) min(40vw,440px);}
.experience-startup .startup-coach-title {display:none;}
html[data-startup-destination="coach"] .experience-startup .startup-sync-title {display:none;}
html[data-startup-destination="coach"] .experience-startup .startup-coach-title {display:block;}
.experience-startup .startup-command {display:flex;align-items:center;gap:12px;}
.experience-startup .startup-project-name {height:18px;width:min(220px,40%);margin-right:auto;}
.experience-startup .startup-command-action {height:32px;width:100px;}
.experience-startup .startup-source-video {display:block;width:100%;height:auto;min-height:0;aspect-ratio:16/9;}
html[data-startup-destination="analyze"] .experience-startup [data-startup-tool="sync"],
html[data-startup-destination="coach"] .experience-startup [data-startup-tool="coach"] {color:var(--tc-ink);background:var(--tc-raised);}
html[data-startup-destination="analyze"] .experience-startup [data-startup-tool="sync"] svg,
html[data-startup-destination="coach"] .experience-startup [data-startup-tool="coach"] svg {color:var(--tc-accent);}
.experience-startup .startup-inspector {display:block;}
.experience-startup .startup-inspector .startup-line {margin:14px 0;}
.experience-startup .startup-inspector-panel {height:150px;margin-top:22px;}
.experience-startup .startup-transport {display:flex;align-items:center;gap:12px;}
.experience-startup .startup-transport .startup-line {width:120px;}
.experience-startup .startup-timeline {height:6px;align-self:center;}
.experience-startup .startup-line {height:13px;width:80%;}
.experience-startup .startup-line-short {width:55%;}
.experience-startup .startup-library .project-library {grid-template-columns:repeat(3,minmax(0,1fr));}
.experience-startup .startup-feedback {position:absolute;z-index:1;left:50%;bottom:16px;transform:translateX(-50%);max-width:calc(100% - 32px);padding:8px 14px;border:1px solid var(--tc-line);border-radius:8px;background:var(--tc-surface);text-align:center;font:12px/1.5 var(--tc-body);}
.experience-startup .startup-feedback a {display:inline-block;margin-top:8px;border-color:var(--tc-line);color:var(--tc-accent);}
.experience-startup .startup-feedback a:focus-visible {outline-color:var(--tc-accent);}
.experience-startup .tc-skeleton,
.app.experience .tc-skeleton {background:var(--tc-raised);animation:tc-loading-pulse 1.8s ease-in-out infinite;}
body:has(>.app.experience) .tc-loading {background:var(--tc-surface);color:var(--tc-muted);font-family:var(--tc-body);}
@keyframes tc-loading-pulse {0%,100% {opacity:.55} 50% {opacity:1}}

/* Apply the requested destination's navigation state before boot has mounted
   its click handlers. The normal active state takes over on completion. */
html[data-startup-destination] .app.experience[inert] .primary-nav-button {color:var(--tc-muted);}
html[data-startup-destination] .app.experience[inert] .primary-nav-button::after {display:none;}
html:is(:not([data-startup-destination]),[data-startup-destination="home"]) .app.experience[inert] #navWorkspace,
html[data-startup-destination="library"] .app.experience[inert] #navLibrary,
html[data-startup-destination="analyze"] .app.experience[inert] #navCompare,
html[data-startup-destination="coach"] .app.experience[inert] #navCoach {color:var(--tc-ink);}
@media(min-width:701px) and (min-height:601px), (min-width:1001px) {
  html[data-startup-destination="home"] .app.experience[inert] #navWorkspace::after,
  html[data-startup-destination="library"] .app.experience[inert] #navLibrary::after,
  html[data-startup-destination="analyze"] .app.experience[inert] #navCompare::after,
  html[data-startup-destination="coach"] .app.experience[inert] #navCoach::after {display:block;content:"";position:absolute;left:12px;right:12px;bottom:12px;height:2px;background:var(--tc-accent);transform:scaleX(1);}
}

@media(max-width:700px), (max-width:1000px) and (max-height:600px) {
  #appStartup.experience-startup {inset:calc(var(--tc-header-height) + env(safe-area-inset-top)) env(safe-area-inset-right) calc(var(--tc-navigation-height) + env(safe-area-inset-bottom)) env(safe-area-inset-left);}
  html[data-startup-destination="coach"] .experience-startup .workspace-layout {grid-template-columns:minmax(0,1fr);}
  .experience-startup .startup-command-action {width:70px;}
  .experience-startup .startup-library .project-library {grid-template-columns:repeat(2,minmax(0,1fr));}
  html[data-startup-destination="library"] .app.experience[inert] .project-search {display:block;position:absolute;top:66px;left:16px;right:16px;max-width:none;z-index:2;}
  .experience-startup .startup-library .search-page-heading {margin-top:52px;}
  html[data-startup-destination] .app.experience[inert] .primary-nav-button::after {display:none;}
  html:is(:not([data-startup-destination]),[data-startup-destination="home"]) .app.experience[inert] #navWorkspace,
  html[data-startup-destination="library"] .app.experience[inert] #navLibrary,
  html[data-startup-destination="analyze"] .app.experience[inert] #navCompare,
  html[data-startup-destination="coach"] .app.experience[inert] #navCoach {color:var(--tc-accent);}
  @media(orientation:landscape) {
    #appStartup.experience-startup {inset-block-end:env(safe-area-inset-bottom);}
    html[data-startup-destination="coach"] .experience-startup .workspace-layout {grid-template-columns:minmax(0,1fr) min(38vw,300px);}
    html[data-startup-destination="library"] .app.experience[inert] .project-search {top:50px;left:20px;right:20px;}
  }
}
@media(prefers-reduced-motion:reduce) {.experience-startup .tc-skeleton,.app.experience .tc-skeleton {animation:none;opacity:1;}}

/* A first-paint brand screen, dismissed by the existing real boot lifecycle.
   No minimum display timer, account gate, or extra runtime dependency. */
#appStartup.brand-startup {
  inset:0;z-index:40;display:grid;place-items:center;overflow-y:auto;
  padding:24px;box-sizing:border-box;background:#101719;color:#eef3ed;text-align:center;
  padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(24px,env(safe-area-inset-bottom));
}
.brand-startup .startup-feedback {position:static;transform:none;max-width:100%;padding:0;margin:0;border:0;border-radius:0;background:none;color:#94a5a3;}
.startup-brand {display:grid;justify-items:center;gap:18px;margin-bottom:20px;}
.startup-brand-mark {display:block;width:clamp(136px,20vmin,176px);height:auto;object-fit:contain;animation:tc-brand-arrive 420ms cubic-bezier(.23,1,.32,1) both;}
.startup-brand-name {display:block;width:min(282px,76vw);height:auto;overflow:hidden;animation:tc-brand-arrive 420ms cubic-bezier(.23,1,.32,1) 70ms both;}
.startup-brand-loading {display:block;width:64px;height:2px;margin-top:8px;overflow:hidden;background:#263537;border-radius:2px;}
.startup-brand-loading::before {content:"";display:block;width:32px;height:100%;background:#c9f36a;transform:translateX(-32px);animation:tc-brand-loading 1.2s cubic-bezier(.4,0,.2,1) infinite;}
@keyframes tc-brand-arrive {from {opacity:0;transform:translateY(8px) scale(.96);}to {opacity:1;transform:none;}}
@keyframes tc-brand-loading {to {transform:translateX(96px);}}
#appStartup:not([role="alert"]) .startup-recovery,
#appStartup[role="alert"] :is(.startup-pending,.startup-brand-loading) {display:none;}
.brand-startup[role="alert"] .startup-feedback {max-width:360px;line-height:1.6;}
.brand-startup .startup-feedback a {min-height:44px;box-sizing:border-box;border-color:#3b4b4c;color:#c9f36a;}
@media(prefers-reduced-motion:reduce) {
  .startup-brand-mark,.startup-brand-name {animation:none;transform:none;opacity:1;}
  .startup-brand-loading::before {animation:none;transform:none;width:100%;}
}
