/* V5 skin for the real Image Workspace (Homepage + Pages → Images tab). Visual only. Scoped to the manifest card. */
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) {
  --iw-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --iw-card: color-mix(in srgb, var(--primary) 5%, var(--surface));
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) * { min-width: 0; }

/* layout: stacked in the narrow card, side-by-side when expanded; each column scrolls on its own when expanded */
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-inspector { container-type: inline-size; overflow-x: hidden; }
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-images-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-image-preview-col { width: 100%; flex: none; }
.hp5 :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-meta-col { flex: none; width: 100%; }
@container (min-width: 520px) {
  .hp5 .iw-images-grid { flex-direction: row !important; align-items: flex-start; }
  .hp5 .iw-image-preview-col { width: 280px !important; flex: 0 0 280px !important; }
  .hp5 .iw-meta-col { flex: 1 1 0 !important; width: auto !important; }
}
.hp5 .homepageWorkspaceGrid.imagesWide { grid-template-columns: max(700px, 62%) minmax(0, 1fr) !important; } /* max() (not minmax) so the column can animate from the 320px state */
.hp5 .homepageWorkspaceGrid.imagesWide :is(#hp5ImagesBody, #pdv5ImagesBody) { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 12px; }
.hp5 .homepageWorkspaceGrid.imagesWide :is(#hp5ImagesBody, #pdv5ImagesBody) > .iw-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.hp5 .homepageWorkspaceGrid.imagesWide :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-root { flex: 1 1 auto; min-height: 0; height: 100%; gap: 18px; }
.hp5 .homepageWorkspaceGrid.imagesWideIn :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-section-list { overflow-y: auto; width: 220px !important; max-height: none; scrollbar-width: thin; }
.hp5 .homepageWorkspaceGrid.imagesWide :is(#hp5ImagesBody, #pdv5ImagesBody) .iw-inspector { overflow-y: auto; overflow-x: hidden; padding-right: 6px; scrollbar-width: thin; }

/* section list rows */
.hp5 .iw-section-list-header { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.hp5 .iw-section-row { display: block; width: 100%; text-align: left; padding: 9px 11px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.hp5 .iw-section-row:hover { background: var(--surface-2); }
.hp5 .iw-section-row-active { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: var(--primary); }
.hp5 .iw-section-name { font-size: 13px; font-weight: 700; }
.hp5 .iw-section-id { font: 500 10.5px var(--iw-mono, monospace); color: var(--muted); }

/* header + tabs */
.hp5 .iw-inspector-header { align-items: baseline; gap: 8px; margin-bottom: 8px; }
.hp5 .iw-inspector-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.hp5 .iw-inspector-sectionid { font: 500 11px var(--iw-mono, monospace); color: var(--muted); }
.hp5 .iw-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.hp5 .iw-tab-btn { flex: none; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: -1px; }
.hp5 .iw-tab-btn:hover { color: var(--ink); }
.hp5 .iw-tab-btn-active { color: var(--primary); border-bottom-color: var(--primary); }

/* preview + meta */
.hp5 .iw-image-preview-label, .hp5 .iw-meta-title { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hp5 .iw-image-preview-box { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.hp5 .iw-source-row { flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.hp5 .iw-media-path, .hp5 .iw-note { font: 500 11px var(--iw-mono, monospace); color: var(--muted); word-break: break-all; margin-top: 6px; }
.hp5 .iw-kv-grid { grid-template-columns: minmax(96px, auto) minmax(0, 1fr); gap: 7px 14px; }
.hp5 .iw-kv-key { font-size: 12px; color: var(--muted); white-space: normal; }
.hp5 .iw-kv-val { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.hp5 .iw-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); }
.hp5 .iw-badge-ready { background: color-mix(in srgb, var(--teal) 14%, var(--surface)); color: var(--teal); }
.hp5 .iw-badge-failed { background: color-mix(in srgb, #d6453d 14%, var(--surface)); color: #d6453d; }
.hp5 .iw-badge-generating { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }

/* prompt cards */
.hp5 .iw-intent-panel, .hp5 .iw-prompt-panel { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--iw-card); }
.hp5 .iw-prompt-panel label, .hp5 .iw-prompt-panel .iw-req-label, .hp5 .iw-prompt-panel > div > label { font-size: 12px; font-weight: 700; color: var(--ink); }
.hp5 .iw-prompt-text {
  width: 100%; min-height: 96px; padding: 10px 12px; resize: vertical; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 500 12px/1.55 var(--iw-mono, monospace); outline: 0;
}
.hp5 .iw-prompt-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.hp5 .iw-final-image-prompt { background: var(--surface); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.hp5 .iw-prompt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* every button inside the workspace: one size / one look */
.hp5 .iw-inspector :is(.inline-btn, .action-btn), .hp5 .iw-media-actions button, .hp5 .iw-modal :is(.inline-btn, .action-btn) {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 700 12px/1 var(--app-font, Inter, system-ui, sans-serif); white-space: nowrap; cursor: pointer; box-shadow: none; transition: border-color .15s ease, background-color .15s ease;
}
.hp5 .iw-inspector :is(.inline-btn, .action-btn):hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.hp5 .iw-inspector .action-btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.hp5 .iw-inspector .action-btn.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.07); }
.hp5 .iw-inspector :is(.inline-btn, .action-btn):disabled { opacity: .5; cursor: not-allowed; }
.hp5 .iw-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.hp5 .iw-media-actions { gap: 6px; }
.hp5 .iw-blocked-note, .hp5 .iw-auto-apply-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.hp5 .iw-auto-apply-note { font-style: normal; }
.hp5 .iw-guard-banner { border-radius: 10px; font-size: 12.5px; }

/* grids of requirements / history / assets */
.hp5 .iw-req-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.hp5 .iw-history-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.hp5 .iw-asset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hp5 .iw-req-card, .hp5 .iw-asset-card, .hp5 .iw-job-card, .hp5 .iw-legacy-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hp5 .iw-req-card-active, .hp5 .iw-legacy-card-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.hp5 .iw-req-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.hp5 .iw-empty { color: var(--muted); }
.hp5 .iw-empty-title { color: var(--ink); font-weight: 700; }
.hp5 .iw-section-row > :is(.iw-section-name, .iw-section-id, .iw-badge) { display: block; }
.hp5 .iw-section-row .iw-badge { display: inline-flex; margin-top: 4px; margin-right: 4px; }

/* consistency pass */
.hp5 .iw-inspector :is(.inline-btn, .action-btn) { height: 34px !important; padding: 0 16px !important; font-size: 12.5px !important; font-weight: 700 !important; line-height: 1 !important; border-radius: 9px !important; min-width: 0; }
.hp5 .iw-inspector .action-btn.primary { box-shadow: none !important; }
.hp5 .iw-note { font: 500 12px/1.5 var(--app-font, Inter, system-ui, sans-serif); color: var(--muted); word-break: normal; }
.hp5 .iw-note.iw-media-path { font: 500 11px var(--iw-mono, monospace); word-break: break-all; }
.hp5 .iw-prompt-panel :is(.iw-meta-title, .iw-image-preview-label) { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 800; color: var(--ink); margin: 12px 0 6px; }
.hp5 .iw-prompt-panel :is(.iw-meta-title, .iw-image-preview-label):first-child { margin-top: 0; }
.hp5 .iw-prompt-panel :is(.iw-meta-title, .iw-image-preview-label) :is(span, small, em) { font-weight: 500; color: var(--muted); font-family: inherit; text-transform: none; letter-spacing: 0; }
.hp5 .iw-blocked-note, .hp5 .iw-auto-apply-note { font-family: var(--app-font, Inter, system-ui, sans-serif); }
.hp5 .iw-prompt-actions { font-family: var(--app-font, Inter, system-ui, sans-serif); }
.hp5 .iw-prompt-actions :is(span, small) { font-size: 12px; color: var(--muted); font-family: inherit; }
