/* Compact task workspace; keep long queues and optional controls locally scrollable. */
:root {
  --studio-ink: #192f35;
  --studio-muted: #596c61;
  --studio-accent: #345b49;
  --studio-line: #dce3db;
  --studio-space: 16px;
}
::selection { background: #d8e6d9; color: var(--studio-ink); }
input, textarea { caret-color: var(--studio-accent); }
:focus-visible { outline: 2px solid var(--studio-accent); outline-offset: 3px; }
header { height: 64px; padding: 0 24px; }
.brand-block { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.brand-version { display: block; margin-left: 39px; color: var(--studio-muted); font-size: 11px; line-height: 1.3; letter-spacing: 0; }
.header-right { gap: 12px; color: var(--studio-muted); }
.header-right button { min-height: 40px; }
#settings-toggle[aria-expanded="true"] { background: #e8eee5; color: var(--studio-accent); }
main { max-width: 1680px; padding: 20px 24px; }
.intro { margin-bottom: 16px; }
.intro h1 { font-family: inherit; font-size: 24px; font-weight: 600; letter-spacing: -.5px; margin: 0 0 4px; }
.intro p:not(.eyebrow) { font-size: 12px; color: var(--studio-muted); }
.hint, .optional, .library-item small, .status, .review-note { color: var(--studio-muted); font-size: 12px; }
input::placeholder { color: #64756c; }
.eyebrow { font-size: 11px; }
footer { color: var(--studio-muted); font-size: 12px; letter-spacing: 0; }
.studio-grid { gap: var(--studio-space); align-items: start; }
.studio-grid > *, .results > * { min-width: 0; }
.studio-grid .card { padding: 16px; margin: 0; }
.studio-grid .preview-card { padding: 0; }
.upload-card > summary, .library h2 { font-size: 16px; font-weight: 600; margin: 0; }
.upload-card > summary { cursor: pointer; min-height: 28px; }
.upload-card[open] > summary { margin-bottom: 16px; }
.upload-step { margin-bottom: 16px; }
.upload-step legend { margin-bottom: 12px; }
.upload-card label { margin-bottom: 12px; }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.upload-card .mode-choice { position: relative; flex-direction: column; justify-content: center; padding: 8px 4px; min-height: 48px; margin: 0; text-align: center; font-size: 12px; font-weight: 600; }
.mode-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-choice:has(:focus-visible) { outline: 2px solid var(--studio-accent); outline-offset: 3px; }
.mode-choice span { gap: 3px; }
.mode-choice small { font-size: 11px; color: var(--studio-muted); }
.upload-card .dropzone { padding: 12px; gap: 6px; }
.dropzone span:not(.upload-icon) { color: var(--studio-muted); font-size: 12px; }
.upload-icon { font-size: 20px; }
.upload-card .hint { margin: 6px 0 12px; }
.upload-card #customer-profile-hint { margin-bottom: 8px; }
.upload-card .hint:empty, #batch-progress:empty, #saved-batch-status:empty { display: none; }
.library .section-heading { justify-content: space-between; margin-bottom: 16px; }
.library-count { color: var(--studio-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.library > label { margin-bottom: 12px; }
.library > button, .library > a { width: 100%; margin-bottom: 8px; padding: 10px; }
#library { min-height: 0; }
.library-item { border-radius: 6px; padding: 10px 6px; gap: 8px; }
.library-item:hover { background: #f4f6f1; }
.library-item.selected { background: #e8eee5; box-shadow: inset 0 0 0 1px #a4baa8; }
.library-item strong { max-width: none; font-weight: 600; }
.library-item img { flex: 0 0 48px; }
.library-item small { line-height: 1.5; }
.results { display: flex; flex-direction: column; gap: 12px; }
.preview-header { padding: 16px; flex-wrap: wrap; }
.preview-header h2 { overflow-wrap: anywhere; font-weight: 600; }
.status { padding: 6px 10px; line-height: 1.5; }
.empty { min-height: 260px; height: auto; padding: 16px; background: #f7f8f5; }
.empty p, .empty-tags span { color: var(--studio-muted); }
.empty-tags span { font-size: 12px; }
.empty-tags { margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.view-tabs { padding: 8px; }
.view-tabs button { min-height: 40px; font-size: 12px; color: var(--studio-muted); }
.view-tabs button:hover:not(:disabled) { background: #f3f5f0; }
.view-tabs button.active { background: #e8eee5; color: var(--studio-accent); }
.preview-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 8px; padding: 0 8px; flex-shrink: 0; }
.preview-tools .view-tabs { padding: 8px 0; min-width: 0; }
.magnifier-controls { display: flex; align-items: center; gap: 2px; padding: 4px 0; }
.magnifier-controls button { border: 0; border-radius: 6px; background: transparent; color: var(--studio-muted); min-width: 36px; min-height: 40px; padding: 8px; font-size: 12px; }
.magnifier-controls button:hover:not(:disabled) { background: #f3f5f0; }
.magnifier-controls button[aria-pressed="true"] { background: #e8eee5; color: var(--studio-accent); }
.magnifier-controls button:disabled { opacity: .45; cursor: default; }
#magnifier-zoom { min-width: 34px; text-align: center; font-size: 12px; color: var(--studio-muted); font-variant-numeric: tabular-nums; }
.magnifier-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.image-stage { position: relative; height: 420px; margin: 0 16px; }
.image-stage.magnifier-enabled { cursor: crosshair; touch-action: none; }
.magnifier-enabled #preview { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.photo-lens { position: absolute; z-index: 1; pointer-events: none; border-radius: 50%; overflow: hidden; background: white; outline: 2px solid var(--studio-accent); box-shadow: 0 3px 14px #192f3550; }
.photo-lens canvas { display: block; width: 100%; height: 100%; }
#processing-message { padding: 0 16px; margin: 8px 0; overflow-wrap: anywhere; }
#photo-details { padding: 12px 16px; border-top: 1px solid var(--studio-line); }
#photo-details summary, #presentation-panel summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--studio-muted); min-height: 24px; align-content: center; }
#photo-details:not(:has(#delete-photo:not([hidden]))) { display: none; }
.photo-actions { justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#portrait-provenance { margin-top: 12px; }
#portrait-provenance summary { font-weight: 400; }
.warnings p { padding: 8px; }
.export-bar { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
.export-bar > span { color: var(--studio-muted); font-size: 12px; }
.export-bar > div { flex-wrap: wrap; gap: 8px; }
#export-customer { width: 100%; margin: 0; }
#export-customer:empty { display: none; }
#presentation-panel { padding: 12px 16px; }
#presentation-panel details[open] summary { margin-bottom: 12px; }
.review-note { margin: 0; font-size: 12px; line-height: 1.5; }
.settings-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.settings-heading h1 { font-family: inherit; font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; margin: 0; }
.settings-heading p { color: var(--studio-muted); margin: 6px 0 0; font-size: 13px; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 800px); gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav button { border: 0; border-radius: 6px; background: transparent; padding: 12px; min-height: 44px; text-align: left; color: var(--studio-muted); font-weight: 500; }
.settings-nav button:hover { background: #edf1e8; }
.settings-nav button[aria-selected="true"] { background: #e3ebe0; color: var(--studio-accent); font-weight: 600; }
.settings-content { margin: 0; min-width: 0; padding: 24px; }
.settings-content h2 { font-size: 18px; margin: 0 0 16px; }
.settings-content .hint { font-size: 12px; }
.settings-content p { max-width: 72ch; }
#ai-style-history { max-height: none; overflow: visible; }
.style-version, .style-version button { font-size: 12px; }
#changelog-list > div { padding: 16px 0; border-bottom: 1px solid var(--studio-line); }
@media (min-width: 1100px) {
  body:has(#workspace:not([hidden])) > footer { display: none; }
  .studio-grid { grid-template-columns: 280px 220px minmax(0, 1fr); height: calc(100dvh - 172px); min-height: 540px; align-items: stretch; }
  .upload-column { overflow-y: auto; scrollbar-gutter: stable; border-radius: 12px; }
  #upload-panel[open] { position: relative; height: 100%; overflow: hidden; }
  #upload-panel[open] #upload-form { position: absolute; inset: 60px 16px 16px; display: flex; flex-direction: column; }
  .upload-fields { min-height: 0; overflow-y: auto; scrollbar-gutter: stable; flex: 1; }
  .upload-submit { flex-shrink: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--studio-line); }
  .library { display: flex; flex-direction: column; overflow: hidden; }
  #library { overflow-y: auto; scrollbar-gutter: stable; }
  .results { min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
  .preview-card { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 360px; }
  .preview-card:has(#image-view:not([hidden])) { flex: 1 0 0; }
  .preview-card .empty { flex: 1; }
  #image-view { display: flex; flex-direction: column; flex: 1; min-height: 180px; }
  .image-stage { flex: 1; height: auto; min-height: 140px; }
  .preview-header, .view-tabs, .export-bar, #photo-details { flex-shrink: 0; }
  .export-bar { flex-direction: row; }
  #presentation-panel { flex-shrink: 0; }
}
@media (min-width: 681px) and (max-width: 1099px) {
  .studio-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .upload-column { grid-row: span 2; }
  .library { max-height: 240px; overflow-y: auto; }
  .results { grid-column: 2; }
}
@media (max-width: 680px) {
  header { height: auto; min-height: 64px; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .header-right { flex-wrap: wrap; gap: 4px; }
  #account { display: none; }
  .header-right .quiet { padding: 8px; }
  main { padding: 16px; }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { font-size: 22px; }
  .library { max-height: 320px; overflow-y: auto; }
  .preview-header { padding: 12px; }
  .image-stage { height: 340px; margin: 0 12px; }
  .settings-heading { align-items: flex-start; flex-direction: column; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .settings-nav button { flex: 1 0 42%; font-size: 12px; }
  .settings-content { padding: 16px; }
  .export-bar { align-items: stretch; }
  .export-bar > div { justify-content: flex-start; }
}
