/* Photo studio: one clear preview and task-specific controls. */
body[data-photo-page] {
  --ui-accent: #176b4a;
  --ui-ink: #172a26;
  --ui-muted: #67756f;
  --ui-line: #e1e8e4;
  background: #f4f7f5 !important;
  color: var(--ui-ink);
}
.photo-app .photo-topbar { background: #fff !important; min-height: 66px !important; padding: 0 max(24px, calc((100vw - 1440px)/2)) !important; }
.photo-app .brand strong { color: #172a26 !important; }
.photo-app .brand-mark { background: #176b4a !important; border-radius: 11px; }
.photo-app .step-nav { background: #f3f6f4; border: 0; padding: 4px; border-radius: 12px; }
.photo-app .step-nav a { font-size: 13px; padding: 9px 18px; border-radius: 8px; }
.photo-app .step-nav a.active { background: #fff; color: #176b4a; box-shadow: 0 1px 5px #152c1714; }
.photo-app .photo-shell { width: min(1440px, calc(100% - 48px)); padding-top: 16px; }
.photo-app .dashboard-back { margin: 0 0 14px !important; padding: 0 !important; background: transparent !important; border: 0 !important; min-height: 26px !important; font-size: 12px !important; }
.photo-app .photo-hero { padding-bottom: 18px !important; border-bottom: 0 !important; }
.photo-app .photo-hero h1 { font-size: clamp(26px, 3vw, 34px) !important; color: #182b25 !important; margin: 7px 0 8px; font-weight: 720 !important; letter-spacing: -.035em !important; }
.photo-app .photo-hero p { max-width: 690px; color: #64736b; font-size: 13px; }
.photo-app .local-badge { background: #e6f2ec; color: #276749; font-size: 11px; padding: 4px 9px; }
.photo-app .hero-actions { gap: 8px; flex-shrink: 0; margin-top: 0; }
.photo-app .hero-actions .btn { min-height: 42px; padding-inline: 17px; }
.studio-ui .photo-app .tool-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto; grid-template-areas: 'source inspector' 'workspace inspector'; gap: 14px 18px; align-items: start; margin-top: 0; }
.studio-ui .photo-app .panel { background: #fff; border: 1px solid #e0e7e3 !important; border-radius: 16px !important; box-shadow: 0 2px 8px #172d1f04 !important; }
.studio-ui .photo-app .studio-source { grid-area: source; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px 16px !important; }
.studio-ui .photo-app .studio-source .upload-zone { display: flex; min-height: 40px; width: auto; flex: 0 0 auto; gap: 9px; padding: 9px 13px; border: 1px solid #dbe5df; background: #f8faf9; border-radius: 9px; }
.studio-ui .studio-source .upload-zone #uploadHelp { display: none; }
.studio-ui .photo-app .studio-source .upload-icon { width: 22px; height: 22px; margin: 0; border-radius: 5px; background: #e4eee8; font-size: 18px; }
.studio-ui .photo-app .studio-source .upload-zone strong { font-size: 12px; white-space: nowrap; }
.studio-file-info { min-width: 0; flex: 1; }
.studio-file-info > strong { display: block; font-size: 12px; margin-bottom: 3px; }
.studio-ui .photo-app .file-meta { overflow-wrap: anywhere; margin: 0; color: #6d7c74; font-size: 11px; }
.studio-ui .photo-app .photo-library { margin: 0; gap: 5px; max-width: 100%; }
.studio-ui .photo-app .batch-list { flex-basis: 100%; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); max-height: 140px; margin: 0; }
.studio-ui .photo-app .studio-workspace { grid-area: workspace; min-width: 0; padding: 18px !important; }
.studio-ui .photo-app .studio-workspace .panel-heading { flex-direction: row; align-items: center; margin-bottom: 14px; }
.studio-ui .photo-app .panel h2 { font-size: 14px !important; font-weight: 650 !important; }
.studio-ui .photo-app .studio-workspace .panel-heading p { font-size: 12px; margin-bottom: 0; }
.studio-ui .photo-app .status-pill { font-size: 10px; padding: 5px 8px; white-space: nowrap; }
.studio-ui .photo-app .stage { height: clamp(360px, 55vh, 580px); min-height: 0; border: 1px solid #e2e7e5; border-radius: 12px; background-color: #eff2f1 !important; background-image: linear-gradient(45deg,#e4e9e6 25%,transparent 25%),linear-gradient(-45deg,#e4e9e6 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e9e6 75%),linear-gradient(-45deg,transparent 75%,#e4e9e6 75%) !important; background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
.studio-ui:not(.has-image) .photo-app .stage { background: #f7faf8 !important; border: 1px dashed #bfd2c5; }
.studio-ui .photo-app .stage-empty { pointer-events: auto; gap: 9px; padding: 20px; }
.studio-ui .photo-app .stage-empty > span { width: 58px; height: 58px; border: 1px solid #dae8df; background: #edf5f0; color: #176b4a; box-shadow: none; font-size: 25px; }
.studio-ui .photo-app .stage-empty strong { font-size: clamp(18px,2vw,24px); font-weight: 680; color: #203b2e; letter-spacing: -.02em; }
.studio-ui .photo-app .stage-empty small { color: #718077; font-size: 12px; font-weight: 450; line-height: 1.6; }
.studio-ui .photo-app .studio-upload-main { margin-top: 10px; min-height: 44px; min-width: 160px; font-size: 13px; border-radius: 10px !important; }
.studio-ui .photo-app .stage.studio-dragover { outline: 3px solid #238957; outline-offset: -4px; }
.studio-ui .photo-app .crop-box { border: 1.5px solid #fff; box-shadow: 0 0 0 9999px #102b2145,inset 0 0 0 1px #153b2999; }
.studio-ui .photo-app .crop-box b { background: #183d30e6; color: white; font-weight: 550; letter-spacing: .02em; }
.studio-ui .photo-app .crop-handle { border: 2px solid white; background: #176b4a; box-shadow: 0 1px 5px #00190c40; }
.studio-canvas-row { display: grid; grid-template-columns: minmax(0,1fr) 148px; gap: 14px; align-items: start; }
.studio-ui:not(.has-image) .studio-canvas-row { grid-template-columns: minmax(0,1fr); }
.studio-ui:not(.has-image) .studio-result-card { display: none; }
.studio-result-card { background: #f8faf9; border: 1px solid #e1e9e4; border-radius: 12px; padding: 12px; }
.studio-ui .photo-app .studio-result-card h3 { font-size: 12px !important; margin: 0; }
.studio-ui .photo-app .single-photo-preview { min-height: 100px; background: #e8edea; border: 0; padding: 9px; margin: 10px 0; border-radius: 6px; }
.studio-ui .photo-app .single-photo-preview canvas { max-height: 230px; height: auto; max-width: 100%; }
.studio-result-card p { font-size: 11px; line-height: 1.5; color: #718077; }
.studio-ui .photo-app .studio-preview-sheet { width: 100%; padding: 8px 5px; font-size: 11px; }
.studio-workspace-note { display: flex; border-top: 1px solid #e9eeeb; padding-top: 12px; margin-top: 16px; font-size: 11px; line-height: 1.6; color: #738179; }
.studio-ui .toast { pointer-events: none; }
.studio-ui .photo-app .studio-inspector { grid-area: inspector; grid-column: auto; padding: 0 !important; min-width: 0; overflow: clip; }
.studio-tabs { display: flex; padding: 5px; gap: 2px; border-bottom: 1px solid #e4ebe6; background: #fbfcfb; }
.studio-tabs button { flex: 1; min-width: 0; padding: 11px 4px; min-height: 43px; background: none; border: 0; border-radius: 9px; color: #718077; font-size: 12px; font-weight: 550; cursor: pointer; }
.studio-tabs button[aria-selected='true'] { background: #e7f2ec; color: #176b4a; font-weight: 700; }
.studio-tabs button:focus-visible { outline: 2px solid #176b4a; outline-offset: -2px; }
.studio-tab-panel { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.studio-tab-panel[hidden] { display: none !important; }
.studio-panel-intro { margin-bottom: 2px; }
.studio-ui .photo-app .studio-panel-intro h2 { font-size: 16px !important; margin: 0 0 5px; }
.studio-panel-intro p { font-size: 12px; line-height: 1.6; color: #738078; margin: 0; }
.studio-ui .photo-app .studio-tab-panel h3 { font-size: 12px !important; margin-bottom: 0; }
.studio-ui .photo-app .studio-tab-panel .hint { margin: 0; font-size: 11px; }
.studio-ui .photo-app .btn,.studio-ui .photo-app .seg { min-height: 38px; color: #415e4d; border-color: #dce6df; border-radius: 8px !important; transition: background .15s,border-color .15s; transform: none; }
.studio-ui .photo-app .btn:hover:not(:disabled),.studio-ui .photo-app .seg:hover:not(:disabled) { background: #f0f6f2; border-color: #9cbda8; transform: none; }
.studio-ui .photo-app .btn.primary { background: #176b4a !important; color: white; border-color: #176b4a; }
.studio-ui .photo-app .btn.primary:hover:not(:disabled) { background: #115339 !important; }
.studio-ui .photo-app .seg.active { background: #e8f3ed; color: #176b4a; border-color: #a9cdb8; }
.studio-ui .photo-app .field span,.studio-ui .photo-app .control label { color: #4b6255; font-size: 12px; }
.studio-ui .photo-app .field input,.studio-ui .photo-app .field select { border-color: #dce5df; min-height: 39px; font-size: 13px; padding: 8px 9px; }
.studio-ui .photo-app .field input[type='range'] { min-height: 24px; padding: 0; }
.studio-ui .photo-app .framing-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.studio-ui .photo-app .framing-controls > .field { min-width: 0; }
.studio-ui .photo-app .framing-controls > .field:first-child,.studio-ui .photo-app .framing-controls > .field:has(#passportZoom),.studio-ui .photo-app .framing-controls > .toggle-control { grid-column: 1/-1; }
.studio-ui .photo-app #resetCrop { font-size: 12px; }
.studio-ui .photo-app .studio-details { margin: 0; padding-top: 12px; border-color: #e3eae6; }
.studio-ui .photo-app .studio-details summary { color: #365b45; font-size: 12px; margin-bottom: 4px; }
.studio-ui .photo-app .studio-details[open] summary { margin-bottom: 12px; }
.studio-ui .photo-app .studio-adjustments { grid-template-columns: 1fr; }
.studio-ui .photo-app .portrait-background { padding: 0; margin: 0; border: 0; gap: 12px; }
.studio-ui .photo-app .portrait-background > h3 { display: none; }
.studio-ui .photo-app .color-row { gap: 8px; flex-wrap: wrap; }
.studio-ui .photo-app .swatch { width: 32px; height: 32px; border: 1px solid #d2ddd5; }
.studio-ui .photo-app .swatch.active { outline: 2px solid #176b4a; outline-offset: 2px; box-shadow: none; }
.studio-ui .photo-app #repairMode { width: 100%; border: 1px solid #dce5df; padding: 9px; border-radius: 8px; font-size: 12px; }
.studio-ui .photo-app .preview-frame { max-height: 370px; min-height: 130px; padding: 12px; border: 1px solid #e1e8e3; background: #eef2ef; border-radius: 10px; }
.studio-ui .photo-app .preview-frame canvas,.studio-ui .photo-app .preview-frame img { max-height: 340px; }
.studio-ui .photo-app .sheet-quick-controls { margin: 0; padding: 12px; border: 1px solid #e2eae5; border-radius: 10px; background: #f7faf8; }
.studio-ui .photo-app .sheet-quick-controls h3 { margin-bottom: 12px; }
.studio-ui .photo-app .sheet-job { grid-template-columns: 40px minmax(0,1fr) auto; }
.studio-ui .photo-app .sheet-job.is-linked { background: #f1f8f4; border-radius: 9px; padding: 9px; }
.studio-ui .photo-app .sheet-queue-status { font-size: 11px; color: #176b4a; line-height: 1.6; }
.studio-ui.manual-compare-mode .photo-app .studio-inspector { display: none; }
.studio-ui.manual-compare-mode .photo-app .tool-grid { grid-template-columns: 1fr; grid-template-areas: 'source' 'workspace'; }
.studio-ui .photo-app .control-stack { display: flex !important; flex-direction: column; }
.studio-ui .photo-app .remove-card { border: 0; padding: 0; background: transparent; }
.studio-ui .photo-app .sheet-job .replace-sheet-photo { grid-column: 1/-1; }
.studio-print-actions { position:sticky; bottom:0; z-index:3; display:flex; gap:8px; padding:12px; border-top:1px solid #dce6df; background:#fff; }
.studio-print-actions .btn { flex:1; }
.studio-output-quality { display:grid; gap:12px; }
.background-refinement,.saved-sheet-settings { display:grid; gap:10px; }
.saved-sheet-settings { border-top:1px solid #e1e8e4; padding-top:12px; }
.background-refinement output { float:right; }
.studio-ui .photo-app .is-repairing .crop-box { visibility:hidden; }
@media (min-width: 1100px) {
  .studio-ui .photo-app .studio-inspector { position: sticky; top: 80px; max-height: calc(100vh - 94px); overflow: auto; scrollbar-width: thin; scrollbar-color: #c8d8cc transparent; }
  .studio-tabs { position: sticky; top: 0; z-index: 2; }
}
@media (max-width: 1099px) {
  .studio-ui .photo-app .tool-grid { grid-template-columns: minmax(0,1fr) 310px; gap: 12px; }
  .studio-canvas-row { grid-template-columns: minmax(0,1fr); }
  .studio-result-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .studio-result-card p { flex: 1; min-width: 100px; }
  .studio-ui .photo-app .single-photo-preview { width: 70px; min-height: 60px; margin: 0; padding: 5px; }
  .studio-ui .photo-app .single-photo-preview canvas { max-height: 90px; }
  .studio-ui .photo-app .studio-preview-sheet { width: auto; }
}
@media (max-width: 760px) {
  .photo-app .photo-topbar { padding: 8px 12px !important; gap: 8px; min-height: 60px !important; flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .photo-app .step-nav { margin-left: auto; }
  .photo-app .step-nav a { padding: 8px; font-size: 12px; }
  .photo-app .brand { gap: 7px; }
  .photo-app .brand strong { font-size: 12px; }
  .photo-app .brand-mark { width: 30px; height: 30px; }
  .photo-app .photo-shell { width: calc(100% - 24px); padding-top: 12px; }
  .photo-app .photo-hero { gap: 12px; padding-bottom: 14px !important; }
  .photo-app .hero-actions { display: flex; width: 100%; }
  .photo-app .hero-actions .btn { flex: 1; min-height: 42px; padding-inline: 9px; }
  .studio-ui .photo-app .tool-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: 'source' 'workspace' 'inspector'; gap: 12px; }
  .studio-ui .photo-app .studio-source { gap: 10px; padding: 10px !important; }
  .studio-ui .photo-app .studio-source .photo-library { flex-basis: 100%; }
  .studio-ui .photo-app .studio-workspace { padding: 12px !important; }
  .studio-ui .photo-app .studio-workspace .panel-heading { align-items: start; gap: 8px; }
  .studio-ui .photo-app .studio-workspace .panel-heading p { font-size: 11px; }
  .studio-ui .photo-app .stage { height: 360px; }
  .studio-ui .photo-app .studio-inspector { grid-column: auto; }
  .studio-tab-panel { padding: 16px; }
  .studio-tabs button { min-height: 46px; font-size: 12px; }
  .studio-ui .photo-app .field input,.studio-ui .photo-app .field select { min-height: 42px; font-size: 16px; }
  .studio-ui .photo-app .studio-file-info > strong { font-size: 11px; }
  .studio-ui .photo-app .studio-source .upload-zone { max-width: 48%; padding: 9px; }
  .studio-ui .photo-app .studio-source .upload-zone strong { font-size: 11px; white-space: normal; }
  .studio-ui .photo-app .studio-result-card { gap: 9px; padding: 10px; }
  .studio-result-card h3 { width: 100%; }
  .studio-result-card p { min-width: 80px; font-size: 11px; }
  .studio-workspace-note { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-ui *, .studio-ui *::before, .studio-ui *::after { scroll-behavior: auto !important; transition: none !important; }
}
