/* B + E windows: only the authenticated, single-workshop hose workspace. */
#application.hose-home .dialog {
  --page: var(--home-canvas);
  --surface: var(--home-paper);
  --surface-subtle: #f4f5f4;
  --text: var(--home-ink);
  --muted: var(--home-muted);
  --border: var(--home-line);
  --line: var(--home-line);
  --border-strong: #9aa7ae;
  --primary: var(--home-blue);
  --primary-strong: var(--home-blue-deep);
  --primary-soft: var(--home-blue-wash);
  --shadow: 0 24px 80px #102f5126;
  --shadow-soft: 0 4px 16px #102f5112;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--home-ink);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: .875rem;
  line-height: 1.6;
  overscroll-behavior: contain;
}
#application.hose-home .dialog::backdrop { background: #14212d99; backdrop-filter: blur(3px); }
#application.hose-home .dialog[open] { animation: workbench-dialog-enter .18s ease-out; }
#application.hose-home .dialog :is(.dialog__header, .image-preview-header, .document-preview-header) {
  gap: 16px;
  padding: 20px 24px;
  color: var(--text);
  background: var(--surface);
  border-bottom: 2px solid var(--home-ink);
  backdrop-filter: none;
}
/* Static headers/tabs avoid a fixed sticky offset when headings wrap. */
#application.hose-home .dialog .dialog__header { position: static; }
#application.hose-home .dialog :is(.dialog__header, .image-preview-header, .document-preview-header) > div:first-child { min-width: 0; }
#application.hose-home .dialog :is(h2, h3, h4, strong, p, small, dd, label, .file-line > span) { overflow-wrap: anywhere; }
#application.hose-home .dialog .dialog__header h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.35; letter-spacing: 0; }
#application.hose-home .dialog .dialog__header > div > p:last-child { font-size: .875rem; line-height: 1.6; }
#application.hose-home .dialog .eyebrow { color: var(--primary); font-size: .75rem; font-weight: 750; letter-spacing: .06em; }
#application.hose-home .dialog :is(.dialog__footer, .form-actions) { gap: 12px; padding: 16px 24px; border-top-color: var(--home-ink); background: var(--surface); }
#application.hose-home .dialog :is(.form-body, .product-detail) { padding: 24px; min-width: 0; }
#application.hose-home .dialog :is(.form-body > h3, .section-heading h3, .template-intro h3) { font-size: 1.125rem; font-weight: 750; }
#application.hose-home .dialog :is(.form-grid, .detail-cell-grid) { gap: 12px; }

/* Button hierarchy, touch targets and keyboard feedback retain native actions. */
#application.hose-home .dialog :is(button, .button, summary) { min-height: 44px; }
#application.hose-home .dialog :is(button, .button) { min-width: 44px; border-radius: 2px; }
#application.hose-home .dialog .button { padding: 10px 16px; font-size: .875rem; font-weight: 650; box-shadow: none; }
#application.hose-home .dialog .button:hover { transform: none; }
#application.hose-home .dialog .button--primary,
#application.hose-home .dialog .inline-confirm,
#application.hose-home .dialog .template-tabs__save { color: var(--home-ink); border-color: var(--home-orange); background: var(--home-orange); }
#application.hose-home .dialog .button--secondary { color: var(--primary-strong); border-color: #aabccb; background: var(--primary-soft); }
#application.hose-home .dialog .button--quiet { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
#application.hose-home .dialog .button--danger { color: var(--danger); border-color: #d5aaa6; background: var(--danger-soft); }
#application.hose-home .dialog :is(.icon-button, .inline-confirm, .inline-cancel, .image-rotate-actions button, .image-preview-close, .module-asset-delete) { width: 44px; height: 44px; flex-shrink: 0; }
#application.hose-home .dialog :is(.icon-button, .inline-cancel) { color: var(--text); border: 1px solid var(--border-strong); background: var(--surface); }
#application.hose-home .dialog .image-rotate-actions--labeled button { width: auto; }
#application.hose-home .dialog .image-rotate-actions button { color: var(--primary-strong); border-color: var(--border-strong); background: var(--surface); box-shadow: none; }
#application.hose-home .dialog :is(button, .button, summary, .detail-cell--editable, .upload-source-card) { transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .12s ease; }
#application.hose-home .dialog :is(button, a, summary, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
#application.hose-home .dialog :is(.detail-module-nav, .template-tabs, .image-preview-header) :is(button, input, a):focus-visible { outline-offset: -4px; }
#application.hose-home .dialog :is([data-preview-image], .document-preview-stage):focus-visible { outline: 3px solid var(--primary); outline-offset: -4px; }
#application.hose-home .dialog :is(button, .button):active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 2px #17447526; }
#application.hose-home .dialog :is(button, input, select, textarea):disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
#application.hose-home .dialog :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  border-radius: 2px;
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
  font-size: 1rem;
  line-height: 1.5;
}
#application.hose-home .dialog :is(input, select, textarea):focus { border-color: var(--primary); }
#application.hose-home .dialog :is(input[type="checkbox"], input[type="radio"], input[type="range"]) { accent-color: var(--primary); }
#application.hose-home .dialog :is(.check-field, .classification-options label, .drawing-source-options label, .customer-check-list label) { min-height: 44px; white-space: normal; }
#application.hose-home .dialog :is(.form-field > span, .field-label, .detail-row dt, .cell-editor label > span, .template-field-main label > span, .packaging-edit-grid label > span, .user-login-settings label > span) { font-size: .75rem; line-height: 1.5; }
#application.hose-home .dialog :is(.field-value, .detail-row dd) { font-size: 1rem; line-height: 1.55; }
#application.hose-home .dialog :is(.field-description, .field-pending, .section-hint, .section-note, .table-source, .technical-version-card small, .technical-version-counts, .technical-version-empty, .upload-preview small) { font-size: .75rem; line-height: 1.55; }
#application.hose-home .dialog :is(.pending-import-fields label > span, .process-profile-fields label, .customer-picker__custom > span, .form-field small, .user-list span, .user-login-settings > summary span, .customer-check-heading small, .customer-check-footer > small, .upload-empty-state > p, .media-plus small, .action-card small, .confirmed-price-card span, .confirmed-price-entry-summary span, .confirmed-price-entry-summary small, .customer-option-source p) { font-size: .75rem; }

/* The product shell reserves real header/nav space rather than guessing its height. */
#application.hose-home .product-dialog { height: min(90dvh, 960px); overflow: hidden; }
#application.hose-home #product-dialog-content { height: 100%; min-height: 0; display: flex; flex-direction: column; }
#application.hose-home #product-dialog-content > :is(.dialog__header, .detail-module-nav) { flex: 0 0 auto; }
#application.hose-home #product-dialog-content > .product-detail { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
#application.hose-home #product-dialog-content > .product-lifecycle-footer { flex: 0 0 auto; position: static; justify-content: flex-end; }
#application.hose-home #product-dialog-content > .product-lifecycle-footer > .button { flex: 0 1 auto; max-width: 100%; }
#application.hose-home .dialog .admin-customer-list { display: grid; gap: 12px; margin: 16px 0; padding: 0; list-style: none; }
#application.hose-home .dialog .admin-customer-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
#application.hose-home .dialog .admin-customer-list > li > span { min-width: 0; overflow-wrap: anywhere; }
#application.hose-home .dialog .admin-customer-list > li > .button { justify-self: end; white-space: nowrap; }
#application.hose-home .dialog :is(.detail-module-nav, .template-tabs) { position: static; top: auto; padding: 8px 24px; gap: 4px; background: var(--surface); border-bottom-color: var(--border); }
#application.hose-home .dialog :is(.detail-module-nav, .template-tabs) button { padding: 10px 14px; font-size: .875rem; border-radius: 2px; }
#application.hose-home .dialog :is(.detail-module-nav, .template-tabs) button.is-active { color: #fff; border-color: var(--primary); background: var(--primary); }
#application.hose-home .dialog .identity-badges span { border: 1px solid #aabccb; border-radius: 2px; font-size: .75rem; }
#application.hose-home .dialog .section-heading { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
#application.hose-home .dialog .basic-detail-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 20px; }
#application.hose-home .dialog .detail-cell { min-height: 88px; padding: 14px; border-radius: 2px; }
#application.hose-home .dialog .detail-cell--editable { background: var(--surface); }
#application.hose-home .dialog .detail-cell--editing { border-color: var(--primary); background: var(--primary-soft); }
#application.hose-home .dialog .edit-glyph { top: 13px; right: 13px; color: var(--primary); font-size: .875rem; }
#application.hose-home .dialog :is(.product-sketch-card, .media-slot, .drawing-kind-group, .technical-history, .technical-version-card, .technical-version-duplicates, .price-section, .confirmed-price-panel, .confirmed-price-card, .detail-grid, .detail-gallery figure, .table-wrap, .source-trace, .action-card, .process-card-block, .legacy-document-block) { border-radius: 3px; box-shadow: none; }
#application.hose-home .dialog :is(.product-sketch-card, .media-slot) { padding: 16px; background: var(--primary-soft); }
#application.hose-home .dialog :is(.product-sketch-card figure, .media-thumbnails figure, .detail-gallery figure) { border-radius: 2px; background: #fff; }
#application.hose-home .dialog :is(.product-sketch-card figure img, .media-thumbnails img, .detail-gallery img, .upload-preview img, .card-image-picker img) { filter: none; mix-blend-mode: normal; }
#application.hose-home .dialog :is(.media-plus, .product-sketch-empty) { border-radius: 2px; }
#application.hose-home .dialog :is(.media-plus > span, .product-sketch-empty > span, .action-card > span, .file-preview > span) { border-radius: 3px; }
#application.hose-home .dialog .media-plus--compact { min-height: 44px; padding: 8px 12px; }
#application.hose-home .dialog .media-plus--compact strong { font-size: .875rem; }
#application.hose-home .dialog :is(.drawing-kind-group__heading, .media-slot__heading) strong { font-size: 1rem; }
#application.hose-home .dialog .drawing-file-card { border-radius: 0; }
#application.hose-home .dialog .file-type { border-radius: 2px; }
#application.hose-home .dialog .drawing-file-card__main small { font-size: .75rem; }
#application.hose-home .dialog :is(.technical-history > summary, .technical-version-duplicates > summary) { padding: 14px 16px; font-size: .875rem; }
#application.hose-home .dialog .technical-version-change { border-radius: 2px; padding: 10px; font-size: .875rem; }
#application.hose-home .dialog .technical-version-card > header small { white-space: normal; }
#application.hose-home .dialog .technical-version-duplicates p { font-size: .75rem; flex-wrap: wrap; }
#application.hose-home .dialog .technical-version-more > summary { font-size: .75rem; padding: 10px 0; }
#application.hose-home .dialog th { color: var(--primary-strong); background: var(--primary-soft); font-size: .875rem; }
#application.hose-home .dialog td { font-size: .875rem; }
#application.hose-home .dialog .table-wrap { max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
#application.hose-home .dialog .table-wrap :is(input, select) { max-width: none; }

/* Uploads, management and forms use the same paper and squared component rhythm. */
#application.hose-home .dialog :is(.upload-source-card, .upload-preview, .upload-panel, .defect-upload-panel, .defect-guidebook-panel, .defect-incident, .template-field-row, .template-options, .template-option-row, .packaging-edit-row, .user-list article, .user-login-settings, .customer-check-form, .customer-check-list, .review-card, .directory-version, .directory-job-status, .directory-price-preview, .quote-fieldset, .process-profile-card, .quote-system-snapshot, .quote-review-status, .calculation-box, .classification-options, .recognized-diameters, .customer-option-source) { border-radius: 3px; }
#application.hose-home .dialog .upload-source-card { min-width: 0; min-height: 100px; padding: 16px; background: var(--primary-soft); }
#application.hose-home .dialog .upload-empty-state .upload-source-actions { width: 100%; max-width: 720px; }
#application.hose-home .dialog .upload-source-card > span { color: var(--primary); border-radius: 2px; background: var(--surface); }
#application.hose-home .dialog .upload-source-card strong { font-size: .875rem; }
#application.hose-home .dialog .upload-source-card small { font-size: .75rem; }
#application.hose-home .dialog .upload-preview strong { font-size: .875rem; }
#application.hose-home .dialog :is(.upload-preview img, .upload-file-icon, .upload-progress) { border-radius: 2px; }
#application.hose-home .dialog .upload-preview--failed { border-color: var(--danger); background: var(--danger-soft); }
#application.hose-home .dialog .upload-preview--failed small { color: var(--danger); }
#application.hose-home .dialog .continue-upload .upload-source-card { min-height: 44px; }
#application.hose-home .dialog .admin-system-actions { flex-wrap: wrap; }
#application.hose-home .dialog .template-field-main { grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, .45fr); }
#application.hose-home .dialog .customer-option-source { padding: 16px; }
#application.hose-home .dialog .customer-picker__list { border-radius: 2px; background: var(--surface); }
#application.hose-home .dialog .customer-picker__list button { font-size: .875rem; }
#application.hose-home .dialog .customer-picker__control button { border-radius: 0 2px 2px 0; }
#application.hose-home .dialog :is(.customer-check-actions button, .customer-check-list label, .classification-options label) { font-size: .875rem; border-radius: 2px; }
#application.hose-home .dialog :is(.quote-review-status:not(.quote-review-status--blocked), .quote-system-snapshot, .quote-warning-list, .quote-formula-summary > div) { background: var(--primary-soft); }
#application.hose-home .dialog .quote-review-status--ready { border-color: #7ea995; }
#application.hose-home .dialog .quote-formula-total { background: var(--primary-soft) !important; border-color: var(--primary) !important; }
#application.hose-home .dialog .status-pill--approved { color: #245848; background: #eef5f0; }
#application.hose-home .dialog .price-import-file-picker { border-radius: 2px; }
#application.hose-home .dialog .price-import-file-picker strong { white-space: normal; overflow-wrap: anywhere; }
#application.hose-home .dialog .quote-original-sheet { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }

/* Image pixels stay unchanged; only preview chrome receives the new theme. */
#application.hose-home .image-preview-dialog { height: min(90dvh, 960px); }
#application.hose-home #image-preview-content { height: 100%; display: flex; flex-direction: column; min-height: 0; }
#application.hose-home .dialog :is(.image-preview-header, .document-preview-header) { flex: 0 0 auto; flex-wrap: wrap; }
#application.hose-home .dialog .image-preview-header__actions { flex-wrap: wrap; justify-content: flex-end; }
#application.hose-home .dialog .preview-zoom-controls { min-width: 0; max-width: 100%; flex-wrap: wrap; }
#application.hose-home .dialog :is(.preview-zoom-controls button, .preview-zoom-controls input, .image-preview-header .image-rotate-actions button, .image-preview-close) { color: var(--primary-strong); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: none; }
#application.hose-home .dialog .preview-zoom-controls input { width: 72px; }
#application.hose-home .dialog .image-preview-delete { color: var(--danger); border-color: #d5aaa6; background: var(--danger-soft); border-radius: 2px; font-size: .875rem; }
#application.hose-home .dialog .image-preview-stage { flex: 1 1 auto; min-height: 0; padding: 16px; background: var(--home-blue-deep); overscroll-behavior: contain; }
#application.hose-home .dialog .image-preview-stage img { max-height: 100%; filter: none; mix-blend-mode: normal; }
#application.hose-home .document-preview-dialog { height: min(94dvh, 1100px); }
#application.hose-home .dialog .document-preview-stage { background: var(--home-blue-wash); }
#application.hose-home .dialog .document-preview-page { border: 1px solid var(--border); box-shadow: 0 4px 16px #102f511a; }
#application.hose-home .dialog .image-preview-stage--qr img { background: #fff; }
body.hose-home-active #toast { border-radius: 2px; background: #174475; box-shadow: 0 8px 24px #102f5126; font-size: .875rem; }
body.hose-home-active #toast[data-type="error"] { background: var(--danger); }

@keyframes workbench-dialog-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) {
  #application.hose-home .dialog :is(.button, .icon-button, .inline-cancel, .image-rotate-actions button, .image-preview-close, .customer-picker__list button):not(:disabled):hover { transform: none; border-color: var(--primary); background: var(--primary-soft); }
  #application.hose-home .dialog :is(.button--primary, .inline-confirm, .template-tabs__save):not(:disabled):hover { color: var(--home-ink); background: #f69b6c; border-color: var(--home-orange); }
  #application.hose-home .dialog :is(.button--danger, .image-preview-delete):not(:disabled):hover { color: var(--danger); background: #f2d5d2; border-color: var(--danger); }
  #application.hose-home .dialog :is(.detail-cell--editable:not(.detail-cell--editing), .upload-source-card, .media-plus, summary):hover { border-color: var(--primary); background: var(--primary-soft); }
  #application.hose-home .dialog :is(.detail-module-nav, .template-tabs) button:not(:disabled):hover { background: var(--primary-soft); color: var(--primary-strong); }
  #application.hose-home .dialog :is(.detail-module-nav, .template-tabs) button.is-active:hover { color: #fff; background: var(--primary-strong); }
}
@media (max-width: 880px) {
  #application.hose-home .dialog .basic-detail-layout { grid-template-columns: 1fr; }
  #application.hose-home .dialog :is(.cell-editor--temperatures, .cell-editor--gross-weight) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #application.hose-home .dialog :is(.cell-editor--temperatures, .cell-editor--gross-weight) .cell-editor__actions { grid-column: 1 / -1; }
  #application.hose-home .dialog .tool-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #application.hose-home .dialog .tool-row .icon-button { justify-self: end; }
  #application.hose-home .dialog .similar-search-filters { grid-template-columns: 1fr; }
  #application.hose-home .dialog .template-field-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #application.hose-home .dialog .quote-original-table { min-width: 720px; }
}
@media (max-width: 580px) {
  #application.hose-home .dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    margin: auto 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  #application.hose-home :is(.product-dialog, .image-preview-dialog, .document-preview-dialog) { height: 100dvh; }
  #application.hose-home .dialog :is(.dialog__header, .image-preview-header, .document-preview-header) { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); gap: 12px; }
  #application.hose-home .dialog .dialog__header h2 { font-size: 1.25rem; }
  #application.hose-home .dialog :is(.form-body, .product-detail) { padding: 20px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  #application.hose-home .dialog :is(.dialog__footer, .form-actions) { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  #application.hose-home .dialog :is(.dialog__footer, .form-actions) > .button { flex: 1 1 auto; white-space: normal; }
  #application.hose-home .dialog :is(.detail-module-nav, .template-tabs) { padding: 8px 16px; }
  #application.hose-home .dialog :is(.detail-module-nav, .template-tabs) button { padding: 10px 12px; }
  #application.hose-home .dialog .identity-badges { gap: 6px; }
  #application.hose-home .dialog .product-v2-header { gap: 12px; }
  #application.hose-home .dialog :is(.upload-source-actions, .upload-preview-grid, .template-field-main) { grid-template-columns: 1fr; }
  #application.hose-home .dialog .upload-empty-state .upload-source-card { min-height: 80px; padding: 12px 16px; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; align-content: center; justify-items: start; text-align: left; }
  #application.hose-home .dialog .upload-empty-state .upload-source-card > span { grid-column: 1; grid-row: 1 / span 2; }
  #application.hose-home .dialog .upload-empty-state .upload-source-card :is(strong, small) { grid-column: 2; }
  #application.hose-home .dialog .upload-source-card--clipboard small { display: none; }
  #application.hose-home .dialog .upload-preview { grid-template-columns: 56px minmax(0, 1fr) 44px; gap: 8px; }
  #application.hose-home .dialog :is(.upload-preview img, .upload-file-icon) { width: 56px; height: 56px; }
  #application.hose-home .dialog .continue-upload { grid-template-columns: 1fr; }
  #application.hose-home .dialog .cell-editor { grid-template-columns: 1fr; }
  #application.hose-home .dialog :is(.cell-editor--temperatures, .cell-editor--gross-weight, .cell-editor--speed, .cell-editor--material, .cell-editor--diameters, .cell-editor--tolerance, .cell-editor--tolerances) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #application.hose-home .dialog .cell-editor__actions { grid-column: 1 / -1; width: 100%; justify-content: flex-end; }
  #application.hose-home .dialog .cell-editor__actions > button { width: 48px; }
  #application.hose-home .dialog .cell-editor--tolerances > .tolerance-editor-group { grid-column: 1 / -1; }
  #application.hose-home .dialog :is(.tool-row, .quote-line) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #application.hose-home .dialog .tool-row input { width: 100%; }
  #application.hose-home .dialog :is(.customer-check-actions, .customer-check-footer > div, .image-preview-header__actions, .quote-list__actions, .similar-search-control, .export-template-links) { flex-wrap: wrap; }
  #application.hose-home .dialog .drawing-file-card__actions { justify-content: flex-start; }
  #application.hose-home .dialog .drawing-file-card__actions .asset-actions { flex-wrap: wrap; }
  #application.hose-home .dialog :is(.technical-version-change, .audit-changes dd) { font-size: .875rem; }
  #application.hose-home .dialog .audit-changes dd { grid-template-columns: 1fr; }
  #application.hose-home .dialog .image-preview-header__actions { gap: 8px; width: 100%; justify-content: flex-start; }
  #application.hose-home .dialog .preview-zoom-controls { width: 100%; margin-left: 0; }
  #application.hose-home .dialog .image-preview-close { margin-left: auto; }
  #application.hose-home .dialog .image-preview-stage { padding: 12px; }
  #application.hose-home .dialog .directory-version { grid-template-columns: 1fr; }
  #application.hose-home .dialog .customer-export-actions .button { white-space: normal; }
  #application.hose-home .dialog .customer-check-heading input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #application.hose-home .dialog,
  #application.hose-home .dialog *,
  #application.hose-home .dialog *::before,
  #application.hose-home .dialog *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  #application.hose-home .dialog :is(button, .button):active { transform: none; }
  body.hose-home-active #toast { transition: none; }
}
