/* Scoped to an existing AI project. Library, new-video setup, automatic jobs,
   uploaded-file projects and the shared sidebar keep their own layouts. */
#projectProgressPercent[hidden], #projectProgressTrack[hidden], #scriptStrategySection[hidden] { display: none !important; }
#detailView[data-ai-flow="true"] #projectPager[data-render-action="true"] #nextProjectStep { display: none; }
@media (max-width: 900px) {
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) { --ai-flow-footer-space: calc(160px + env(safe-area-inset-bottom, 0px)); }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .page { padding-bottom: var(--ai-flow-footer-space); }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .topbar { min-height: 0; padding: 16px 0; margin-bottom: 12px; gap: 10px; }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .topbar .title-row { gap: 12px; }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .topbar .title-icon { width: 48px; height: 48px; min-width: 48px; border-radius: 14px; }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .topbar h1 { font-size: clamp(25px, 7vw, 32px); }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) .scene-header-art { display: none; }
  body:has(#detailView[data-ai-flow="true"]:not([hidden])):has(#oneClickProgress[hidden]) #newProjectButton {
    width: auto; align-self: flex-end; min-height: 44px; padding: 8px 12px;
    color: var(--sia-heading) !important; background: transparent !important;
    border: 1px solid var(--sia-line-strong); box-shadow: none !important; font-size: 14px;
  }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) .detail-actions { display: none; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) .detail-head { margin-bottom: 14px; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) #projectPager {
    box-sizing: border-box; position: fixed; inset: auto 12px 0; z-index: 30;
    display: grid; grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr); gap: 8px 10px;
    margin: 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--sia-surface); border: 1px solid var(--sia-line-strong);
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px rgb(0 0 0 / 12%);
  }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) #projectPagerPosition { grid-area: 1 / 1 / 2 / -1; text-align: center; font-size: 12px; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) #projectPager .button { min-height: 48px; width: 100%; min-width: 0; padding: 10px; white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) #projectPager #nextProjectStep { display: inline-flex; align-items: center; justify-content: center; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) #projectMontageQuickRenderButton { display: none; }
  #detailView[data-ai-flow="true"]:has(#oneClickProgress[hidden]) .project-tab-panel { scroll-margin-bottom: var(--ai-flow-footer-space); }
}
/* Cost hierarchy in AI setup. */
#projectCostSummary { min-width: 0; }
#stepCostEstimateNote:not([hidden]) {
  margin: 24px 0 16px; padding: 24px; border: 1px solid color-mix(in srgb, var(--sia-teal) 20%, var(--sia-line));
  background: var(--sia-sidebar-bg); border-radius: 24px; box-shadow: 0 18px 44px rgba(18, 49, 74, .08);
}
.step-cost-heading { display: flex; gap: 16px; align-items: center; }
.project-cost-icon {
  display: flex; align-items: center; justify-content: center; flex: 0 0 48px; height: 48px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--sia-teal) 35%, var(--sia-line));
  background: var(--sia-teal-soft); color: var(--sia-teal-dark);
}
.project-cost-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.step-cost-title { min-width: 0; }
.project-cost-eyebrow { display: block; color: var(--sia-teal-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; line-height: 1.5; }
#stepCostNow { display: block; margin-top: 4px; color: var(--sia-heading); font-size: 22px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
#stepCostEstimateNote p { margin: 16px 0; color: var(--sia-text); font-size: 15px; line-height: 1.6; }
#stepCostEstimateNote small { border-top: 1px solid var(--sia-line); padding-top: 16px; color: var(--sia-muted); font-size: 13px; line-height: 1.6; }
#projectBudgetDetails { border: 1px solid var(--sia-line-strong); border-radius: 24px; background: var(--sia-sidebar-bg); overflow: hidden; }
#projectBudgetDetails > summary { display: flex; gap: 16px; align-items: center; cursor: pointer; list-style: none; padding: 24px; color: var(--sia-heading); min-height: 96px; box-sizing: border-box; }
#projectBudgetDetails > summary::-webkit-details-marker { display: none; }
.project-budget-label { display: block; flex: 1; min-width: 0; }
.project-budget-label > strong { display: block; font-size: 18px; font-weight: 800; line-height: 1.4; }
.project-budget-label > span { display: block; color: var(--sia-muted); font-size: 14px; line-height: 1.5; margin-top: 4px; }
.project-budget-chevron { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; height: 44px; border: 1px solid var(--sia-line-strong); border-radius: 50%; background: var(--sia-surface-soft); color: var(--sia-teal-dark); }
.project-budget-chevron svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#projectBudgetDetails > summary:hover { background: var(--sia-surface-soft); }
#projectBudgetDetails[open] > summary { border-bottom: 1px solid var(--sia-line); }
#projectBudgetDetails[open] .project-budget-chevron svg { transform: rotate(180deg); }
#projectCostSummary #projectBudgetDetails .one-click-quote { margin: 0; border: 0; border-radius: 0; padding: 24px; background: transparent; box-shadow: none; }
#projectBudgetDetails[data-automatic="true"] { border: 0; background: transparent; overflow: visible; }
#projectBudgetDetails[data-automatic="true"] > summary { display: none; }
#projectCostSummary #projectBudgetDetails[data-automatic="true"] .one-click-quote { margin-top: 22px; border: 1px solid var(--sia-line-strong); border-radius: 20px; background: var(--sia-sidebar-bg); padding: 16px; box-shadow: 0 8px 24px rgba(18,49,74,.06); }
@media (max-width: 600px) {
  #stepCostEstimateNote:not([hidden]), #projectBudgetDetails > summary, #projectCostSummary #projectBudgetDetails .one-click-quote { padding: 20px; }
  .step-cost-heading { align-items: flex-start; gap: 12px; }
  #stepCostNow { font-size: 20px; }
  #projectBudgetDetails > summary { gap: 12px; }
  #projectBudgetDetails > summary .project-cost-icon { display: none; }
}
#projectBudgetDetails > summary:focus-visible { outline: 2px solid var(--sia-teal); outline-offset: -3px; }
