/* FDS extensions: compact workflow rail and integrated display workspace. */
.ss-editor-page:not(.is-start-failed) { --ss-workspace-height: 0px; }
.ss-editor-page .ss-editor { position: relative; grid-template-columns: var(--ss-rail-width, 64px) 240px minmax(0, 1fr) 300px; }
.ss-editor-page .ss-navigation-rail { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 5px; background: var(--fds-bg-panel); border-right: 1px solid var(--fds-border); grid-column: 1; grid-row: 1 / span 3; }
.ss-editor-page .ss-navigation-rail button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; padding: 6px 2px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--fds-text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.ss-navigation-rail svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ss-editor-page .ss-navigation-rail button:is(.is-active,[aria-expanded=true]) { background: var(--fds-bg-muted); color: var(--fds-text-primary); border-color: transparent; font-weight: 600; }
.ss-navigation-rail button:disabled { opacity: .4; cursor: default; }
.ss-editor-page .ss-editor-left { grid-column: 2; }
.ss-editor-page .ss-editor-stage { grid-column: 3; }
.ss-editor-page .ss-editor-right { grid-column: 4; }
.ss-editor-page.is-panel-collapsed .ss-editor { grid-template-columns: var(--ss-rail-width, 64px) minmax(0, 1fr) 300px; }
.ss-editor-page.is-panel-collapsed .ss-editor-stage { grid-column: 2; }
.ss-editor-page.is-panel-collapsed .ss-editor-right { grid-column: 3; }
.ss-editor-page [hidden] { display: none !important; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-stage { grid-template-rows: auto minmax(280px, 1fr) auto; }
.ss-editor-page[data-workspace-step=fpa]:not(.is-fpa-properties) .ss-editor { grid-template-columns: var(--ss-rail-width, 64px) 240px minmax(0, 1fr); }
.ss-editor-page[data-workspace-step=fpa].is-panel-collapsed:not(.is-fpa-properties) .ss-editor { grid-template-columns: var(--ss-rail-width, 64px) minmax(0, 1fr); }
.ss-editor-page[data-workspace-step=fpa] .ss-stage-head { right: 120px; }
#fpa-properties { position: absolute; right: 12px; top: 12px; z-index: 3; }
#fpa-library { min-width: 0; padding: 12px 16px 6px; border-bottom: 1px solid var(--fds-border); background: var(--fds-bg-panel); }
#fpa-library button { font: inherit; font-size: 12px; border: 1px solid var(--fds-border); border-radius: 7px; background: var(--fds-white); color: var(--fds-text-secondary); min-height: 30px; padding: 5px 10px; cursor: pointer; }
#fpa-library button[aria-pressed=true] { background: var(--fds-blue-50); border-color: var(--fds-blue-600); color: var(--fds-blue-600); }
#fpa-library button:disabled { opacity: .35; cursor: default; }
#fpa-library :is(button,input):focus-visible, .ss-navigation-rail button:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }
.fpa-library-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fpa-library-head strong { font-size: 14px; }
.fpa-library-head label { display: flex; align-items: center; gap: 4px; font-size: 12px; }
#fpa-search { flex: 1 1 130px; width: 130px; min-width: 90px; max-width: 300px; border: 1px solid var(--fds-border); border-radius: 7px; padding: 6px 10px; font: inherit; background: var(--fds-bg-muted); }
.fpa-categories { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; scrollbar-width: thin; }
#fpa-library .fpa-categories button { white-space: nowrap; flex-shrink: 0; min-height: 28px; border-color: transparent; }
.fpa-shelf { display: grid; grid-template-columns: 28px minmax(0,1fr) 28px; gap: 8px; }
#fpa-library .fpa-shelf > button { padding: 0; font-size: 24px; align-self: stretch; background: var(--fds-bg-muted); }
.fpa-cards { --fpa-rows: 1; display: grid; grid-auto-flow: column; grid-template-rows: repeat(var(--fpa-rows),126px); grid-auto-columns: 180px; gap: 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding: 2px 2px 9px; touch-action: pan-x pan-y; }
.fpa-card { position: relative; display: flex; flex-direction: column; justify-content: center; background: var(--fds-gray-25); border: 1px solid var(--fds-border); border-radius: 10px; overflow: hidden; padding: 12px 10px 34px 72px; cursor: grab; }
/* Touch drag of a card (ui/touch-drag.js): on tablets a downward move lifts it, a sideways swipe scrolls the shelf. */
.fpa-card { -webkit-touch-callout: none; }
@media (min-width: 768px) { .fpa-card { touch-action: pan-x; } }
.fpa-card-copy { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.fpa-card-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpa-card-copy span { font-size: 10px; line-height: 1.4; color: var(--fds-text-secondary); }
.fpa-card-copy small { font-size: 9px; color: var(--fds-text-muted); }
.fpa-art { position: absolute; left: 3px; top: 20px; width: 70px; height: 72px; pointer-events: none; }
.fpa-art svg { width: 100%; height: 72px; }
.fpa-art img { position: absolute; inset: 0; width: 70px; height: 72px; object-fit: contain; }
#fpa-library .fpa-star { position: absolute; right: 2px; top: 1px; padding: 0; width: 26px; min-height: 26px; border: 0; background: transparent; }
#fpa-library .fpa-add { position: absolute; right: 8px; bottom: 6px; min-height: 24px; padding: 2px 12px; border-radius: 999px; color: var(--fds-text-primary); font-weight: 500; }
#fpa-library .fpa-add:not(:disabled):hover { border-color: var(--fds-text-primary); background: var(--fds-gray-25); }
.fpa-unfit { position: absolute; left: 8px; bottom: 10px; font-size: 10px; color: var(--fds-text-secondary); }
#fpa-feedback { margin: 3px 0 0; font-size: 11px; min-height: 17px; }
.ss-editor-page[data-workspace-step=fpa] .ss-stage-viewport { background: var(--fds-gray-50); }
.ss-editor-page[data-workspace-step=fpa] .da-case { fill: #ded9cc; stroke: #bfb7a6; stroke-width: 3; }
.ss-editor-page[data-workspace-step=fpa] .da-deck { fill: #f6f2e9; stroke: #cbbfa8; stroke-width: 2; }
.ss-editor-page[data-workspace-step=fpa] .da-component { fill: #e2e7ed; stroke: #a5b1bf; stroke-width: 1.5; }
.ss-editor-page[data-workspace-step=fpa] .da-margin { fill: none; stroke: #b8c2cf; opacity: .45; }
.ss-editor-page[data-workspace-step=fpa] .da-component.is-error { fill: #fee4e2; stroke: var(--fds-red-700); }
.fpa-detail { fill: none; stroke: #8595a7; stroke-width: 2; pointer-events: none; }
.fpa-label { font-size: 13px; fill: #68778a; pointer-events: none; }
.fpa-drop-ghost { fill: #dbeafe; stroke: #2563eb; stroke-width: 3; opacity: .8; pointer-events: none; }
.fpa-drop-ghost.invalid { fill: #fee4e2; stroke: #b42318; }
.ss-editor-page.is-fpa-focus .ss-editor-top, .ss-editor-page.is-fpa-focus .ss-navigation-rail { display: none; }
.ss-editor-page.is-fpa-focus:not(.is-start-failed) { grid-template-rows: minmax(0,1fr); }
.ss-editor-page.is-fpa-focus .ss-editor { grid-template-columns: minmax(0,1fr) !important; }
.ss-editor-page.is-fpa-focus .ss-editor-stage { grid-column: 1; }
.ss-editor-page.is-fpa-focus .fpa-cards { --fpa-rows: 2; }
.ss-editor-page.is-fpa-focus .ss-editor-right { grid-column: 2; }
@media (min-height: 1020px) { .ss-editor-page.is-fpa-focus .fpa-cards { --fpa-rows: 3; } }
@media (min-width: 1024px) {
  .ss-editor-page:not(.is-start-failed):not(.is-fpa-focus) { grid-template-rows: auto minmax(0,1fr); }
  .ss-editor-page :is(.ss-editor-stage,.ss-editor-left,.ss-editor-right) { grid-row: 1 / span 3; }
  .ss-editor-page .ss-navigation-rail { min-height: 0; overflow-y: auto; }
}
@media (max-width: 1023px) {
  .ss-editor-page .ss-editor, .ss-editor-page.is-panel-collapsed .ss-editor,
  .ss-editor-page[data-workspace-step=fpa]:not(.is-fpa-properties) .ss-editor,
  .ss-editor-page[data-workspace-step=fpa].is-panel-collapsed:not(.is-fpa-properties) .ss-editor { grid-template-columns: var(--ss-rail-mobile-width, 54px) minmax(0,1fr); }
  .ss-editor-page .ss-navigation-rail { grid-row: 1 / span 3; position: sticky; top: var(--ss-editor-header-height, var(--fds-topbar)); max-height: calc(100dvh - var(--ss-editor-header-height, var(--fds-topbar))); overflow-y: auto; align-self: start; padding: 8px 3px; }
  .ss-editor-page .ss-editor-stage, .ss-editor-page.is-panel-collapsed .ss-editor-stage { grid-column: 2; grid-row: 1; order: 0; }
  .ss-editor-page .ss-editor-left, .ss-editor-page .ss-editor-right, .ss-editor-page.is-panel-collapsed .ss-editor-right { grid-column: 2; }
  .ss-editor-page .ss-editor-left { grid-row: 2; }
  .ss-editor-page .ss-editor-right { grid-row: 3; }
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-left { position: absolute; inset: 0 auto auto var(--ss-rail-mobile-width, 54px); z-index: 8; width: min(280px, calc(100% - var(--ss-rail-mobile-width, 54px))); max-height: 80dvh; overflow: auto; box-shadow: var(--fds-shadow-2); }
  .ss-editor-page[data-workspace-step=fpa] .ss-stage-viewport { min-height: 320px; height: clamp(280px, 38dvh, 420px); }
  .ss-editor-page .ss-toolbar { padding: 8px; gap: 6px; }
  .ss-editor-page.is-fpa-focus .ss-editor-stage { grid-column: 1; }
  .ss-editor-page.is-fpa-focus.is-fpa-properties .ss-editor { grid-template-columns: minmax(0,1fr) !important; }
  .ss-editor-page.is-fpa-focus .ss-editor-right { grid-column: 1; grid-row: 3; }
  #fpa-library { padding: 10px 8px 5px; }
  .fpa-shelf { grid-template-columns: 24px minmax(0,1fr) 24px; gap: 4px; }
}
@media (pointer: coarse) {
  #fpa-library button, #fpa-search { min-height: 44px; }
  #fpa-library .fpa-add { min-height: 36px; }
  #fpa-library .fpa-star { width: 36px; min-height: 36px; }
  .fpa-card { padding-bottom: 44px; }
  .fpa-card-copy { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .fpa-cards { scroll-behavior: auto; } }

@media (max-width: 480px) { .ss-editor-page .ss-snap-help p { left: 0; width: min(260px, calc(100vw - 78px)); } }
/* Preview-aligned library header, drawing board and contextual controls. */
.fpa-library-head { flex-wrap: nowrap; margin-bottom: 10px; gap: 12px; }
.fpa-library-head > strong { flex-shrink: 0; white-space: nowrap; }
.fpa-library-head .fpa-categories { flex: 1; min-width: 100px; margin: 0; }
.fpa-library-filters { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; flex-shrink: 0; }
.fpa-library-filters > button, .fpa-library-filters > label { flex-shrink: 0; white-space: nowrap; }
#fpa-search { width: 160px; flex: 0 1 160px; }
#fpa-library .fpa-categories button { border: 0; padding: 4px 12px; min-height: 28px; background: transparent; color: var(--fds-text-primary); border-radius: 7px; }
#fpa-library .fpa-categories button[aria-pressed=true] { background: var(--fds-bg-muted); color: var(--fds-text-primary); font-weight: 600; }
#fpa-stage-tools, #fpa-zoom-controls { display: flex; align-items: center; gap: 6px; }
#fpa-stage-tools { position: absolute; top: 12px; right: 12px; z-index: 4; }
#fpa-stage-tools button, #fpa-selection-bar button { min-height: 30px; padding: 4px 10px; border: 1px solid var(--fds-border); background: var(--fds-white); color: var(--fds-text-primary); border-radius: 7px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
#fpa-stage-tools #fpa-properties { position: static; }
#fpa-zoom { font-size: 11px; min-width: 35px; text-align: center; }
#fpa-stage-tools button:disabled, #fpa-selection-bar button:disabled { opacity: .4; cursor: default; }
#fpa-stage-tools button:focus-visible, #fpa-selection-bar button:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }
.ss-editor-page[data-workspace-step=fpa] .ss-stage-viewport { --fpa-inspector-width: 0px; background: #f5f7f9; }
.ss-editor-page[data-workspace-step=fpa] .ss-stage-head { position: absolute; left: 20px; top: 17px; right: 290px; }
.ss-editor-page[data-workspace-step=fpa] .ss-stage-head > div { background: transparent; padding: 0; box-shadow: none; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-canvas { inset: 48px var(--fpa-inspector-width) 76px 0; }
.ss-editor-page[data-workspace-step=fpa][data-view="2d"] .ss-editor-canvas .plan-svg { padding: 8px 16px; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor { grid-template-columns: var(--ss-rail-width, 64px) 240px minmax(0,1fr); }
.ss-editor-page[data-workspace-step=fpa].is-panel-collapsed .ss-editor { grid-template-columns: var(--ss-rail-width, 64px) minmax(0,1fr); }
.ss-editor-page[data-workspace-step=fpa].is-fpa-properties .ss-stage-viewport { --fpa-inspector-width: 280px; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right { position: absolute; inset: 48px 0 0 auto; width: 280px; height: auto; max-height: none; z-index: 5; display: block; overflow: auto; padding: 16px; border-top: 1px solid var(--fds-border); background: var(--fds-white); }
#fpa-inspector-close { float: right; position: sticky; top: 0; z-index: 1; padding: 0 8px; background: var(--fds-white); }
.fpa-inspector-art { height: 100px; margin: 12px 0; display: flex; justify-content: center; border-radius: 10px; background: var(--fds-gray-50); }
.fpa-inspector-art svg { width: 110px; height: 100%; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right .ss-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right .ss-facts > div { display: block; padding: 0; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right .ss-facts dt { font-size: 11px; }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right .ss-facts dd { margin: 4px 0 0; font-size: 12px; }
#fpa-selection-bar { position: absolute; bottom: 12px; left: 0; right: var(--fpa-inspector-width,0px); margin: auto; width: max-content; max-width: calc(100% - var(--fpa-inspector-width,0px) - 24px); display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--fds-border); border-radius: 14px; background: var(--fds-white); box-shadow: var(--fds-shadow-1); z-index: 3; }
.fpa-selected-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
#fpa-selection-bar .danger { color: var(--fds-red-700); }
.ss-editor-page[data-workspace-step=fpa] .da-case { fill: var(--fds-border); stroke: var(--fds-gray-400); stroke-width: 1; }
.ss-editor-page[data-workspace-step=fpa] .da-surface { fill: var(--fds-white); stroke: var(--fds-border-strong); }
.ss-editor-page[data-workspace-step=fpa] .da-deck { fill: url(#fpa-stage-grid); stroke: var(--fds-gray-400); stroke-dasharray: 7 5; stroke-width: 1; }
.fpa-gridline { stroke: var(--fds-gray-100); stroke-width: 1; fill: none; }
.fpa-dimension { stroke: var(--fds-gray-400); stroke-width: 1; fill: none; }
.fpa-dimension-label { font-family: inherit; font-size: 14px; fill: var(--fds-text-muted); }
.ss-editor-page[data-workspace-step=fpa] .da-component { fill: var(--fds-gray-200); stroke: var(--fds-gray-400); stroke-width: 1.5; }
.ss-editor-page[data-workspace-step=fpa] .is-selected .da-component { stroke: var(--fds-blue-600); stroke-width: 2.5; fill: var(--fds-blue-50); }
.ss-editor-page[data-workspace-step=fpa] .da-margin, .ss-editor-page[data-workspace-step=fpa] .da-selection { display: none; }
.fpa-detail { stroke: var(--fds-gray-400); stroke-width: 1; fill: var(--fds-gray-200); }
.fpa-label { font-size: 12px; fill: var(--fds-text-secondary); }
@media(max-width: 1100px) {
  .fpa-library-head { flex-wrap: wrap; }
  .fpa-library-filters { flex-basis: 100%; flex-wrap: wrap; }
}
@media(max-width: 1023px) {
  .ss-editor-page[data-workspace-step=fpa] .ss-editor, .ss-editor-page[data-workspace-step=fpa].is-panel-collapsed .ss-editor { grid-template-columns: var(--ss-rail-mobile-width, 54px) minmax(0,1fr); }
  .ss-editor-page[data-workspace-step=fpa].is-fpa-properties .ss-stage-viewport { --fpa-inspector-width: 0px; }
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-right { width: min(280px, calc(100% - 12px)); box-shadow: var(--fds-shadow-2); }
}
@media(max-width: 767px) {
  .ss-editor-page[data-workspace-step=fpa] .ss-stage-head { top: 10px; left: 12px; right: 12px; }
  #fpa-stage-tools { top: 38px; right: 8px; }
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-canvas { top: 74px; bottom: 104px; }
  #fpa-selection-bar { flex-wrap: wrap; justify-content: center; gap: 5px; padding: 6px; bottom: 8px; }
  .fpa-selected-label { flex-basis: 100%; max-width: none; text-align: center; }
  #fpa-search { flex: 1 1 90px; width: 90px; }
  .fpa-library-filters { gap: 6px; }
}
@media(pointer: coarse) {
  #fpa-stage-tools button, #fpa-selection-bar button { min-height: 36px; }
}
@media(max-width: 767px) {
  #fpa-selection-bar > button:last-child { position: absolute; top: 3px; right: 3px; min-height: 24px; padding: 0 7px; border: 0; background: transparent; }
  .fpa-selected-label { padding-inline: 24px; }
}
.ss-editor-page[data-workspace-step=fpa].is-fpa-focus .ss-editor { grid-template-columns: minmax(0,1fr) !important; }
#fpa-selection-bar { flex-wrap: wrap; justify-content: center; }
.ss-editor-page[data-workspace-step=fpa] .da-component.is-error { fill: var(--fds-red-50); stroke: var(--fds-red-700); }
/* FPA stacking S1: pieces on a support read as raised layers, each level a little darker. */
.ss-editor-page[data-workspace-step=fpa] .is-stacked .da-component { fill: var(--fds-gray-100); stroke: var(--fds-gray-600); stroke-width: 2; }
.ss-editor-page[data-workspace-step=fpa] .is-level-3 .da-component { fill: var(--fds-white); stroke: var(--fds-gray-800); }
.ss-editor-page[data-workspace-step=fpa] .is-stacked.is-selected .da-component { stroke: var(--fds-blue-600); stroke-width: 2.5; fill: var(--fds-blue-50); }
.ss-editor-page[data-workspace-step=fpa] .is-stacked .da-component.is-error { fill: var(--fds-red-50); stroke: var(--fds-red-700); }
/* FPA stacking S2: the top face a dragged piece would stand on, and its clear distance to each edge. */
/* Slots of a carrier card (FPA stacking S3a): dashed when free, solid when taken; a recess is shaded. */
.da-slot { fill: none; stroke: var(--fds-gray-500); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.da-slot.is-recess { fill: var(--fds-gray-200); fill-opacity: .7; }
.da-slot.is-taken { stroke-dasharray: none; stroke: var(--fds-gray-700); }
.da-stack-guide { pointer-events: none; }
.da-stack-guide .da-stack-target { fill: var(--fds-blue-50); fill-opacity: .55; stroke: var(--fds-blue-600); stroke-width: 2; stroke-dasharray: 6 4; }
.da-stack-guide .da-stack-gap { font-size: 18px; font-weight: 600; fill: var(--fds-blue-600); paint-order: stroke; stroke: var(--fds-white); stroke-width: 4px; }
.da-stack-guide .da-stack-gap.is-over { fill: var(--fds-red-700); }
.da-stack-guide .da-stack-slot { fill: var(--fds-blue-50); fill-opacity: .8; stroke: var(--fds-blue-600); stroke-width: 2.5; }
.fpa-slot-tools { display: grid; gap: var(--fds-space-2); }
.fpa-slot-fill { display: flex; flex-wrap: wrap; gap: var(--fds-space-2); align-items: center; }
.fpa-slot-fill select { flex: 1 1 160px; min-width: 0; min-height: 44px; }
.fpa-stack-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; min-width: 0; }
.fpa-stack-path button { padding: 2px 6px; font-size: 13px; }
.fpa-stack-path strong { font-weight: 600; overflow-wrap: anywhere; }
.fpa-stack-sep { color: var(--fds-text-muted); }

/* FDS extension: generation actions belong to the showcase workspace. */
.ss-showcase-generation { margin-top: 12px; border-top: 1px solid var(--fds-border); padding-top: 12px; font-size: 12px; }
.ss-showcase-generation > summary { cursor: pointer; padding: 6px 0; }
.ss-showcase-generation > div, .ss-showcase-start, .ss-showcase-start > div, #project-settings-content > div { display: grid; gap: 12px; }
.ss-case-editor:has(.ss-showcase-generation[open]) { overflow-y: auto; }
.ss-case-editor:has(.ss-showcase-generation[open]) .ss-case-directory { flex: 0 0 auto; overflow: visible; }

/* FDS extension: cabinet-scoped template entry and modal. */
.ss-stage-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
#fpa-layout-open, #fpa-tidy-open, #fpa-lux-toggle, #fpa-area-select { flex: 0 0 auto; pointer-events: auto; min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: 7px; }
/* FDS extension: tidy-current-display dialog and before/after preview. */
.ss-fpa-tidy-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.ss-fpa-tidy-figure { margin: 0; display: grid; gap: 6px; }
.ss-fpa-tidy-preview { width: 100%; height: auto; max-height: 240px; background: var(--fds-bg-muted); border-radius: var(--fds-radius-md); }
.ss-fpa-tidy-area { fill: none; stroke: var(--fds-border-strong); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ss-fpa-tidy-before { fill: none; stroke: var(--fds-text-secondary); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.ss-fpa-tidy-after { fill: var(--fds-action-primary); fill-opacity: .35; stroke: var(--fds-action-primary); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ss-fpa-tidy-after.is-locked { fill: var(--fds-text-secondary); stroke: var(--fds-text-secondary); }
.ss-fpa-tidy-after.is-skipped { fill: var(--fds-red-50); stroke: var(--fds-red-700); stroke-width: 2; }
.ss-fpa-tidy-summary { font-weight: 600; }
#fpa-tidy-open .ss-label-short, #fpa-layout-open .ss-label-short, #fpa-lux-toggle .ss-label-short { display: none; }
@media(max-width: 479px) {
  #fpa-tidy-open .ss-label-long, #fpa-layout-open .ss-label-long, #fpa-lux-toggle .ss-label-long { display: none; }
  #fpa-tidy-open .ss-label-short, #fpa-layout-open .ss-label-short, #fpa-lux-toggle .ss-label-short { display: inline; }
}
/* FDS extension: display layout (DLT) choices. */
.ss-fpa-layout-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media(max-width: 767px) {
  .ss-stage-title-row { gap: 6px; }
  #fpa-layout-open, #fpa-tidy-open, #fpa-lux-toggle { min-height: 32px; }
  .ss-editor-page[data-workspace-step=fpa][data-view="2d"] .ss-stage-head { top: 5px; }
}
@media(pointer: coarse) {
  #fpa-layout-open, #fpa-tidy-open, #fpa-lux-toggle { min-height: 36px; }
}
/* Touch title buttons are 36px tall: keep the zoom tools row and the drawing below them. */
@media(max-width: 767px) and (pointer: coarse) {
  #fpa-stage-tools, .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) #fpa-stage-tools { top: 46px; }
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-canvas { top: 84px; }
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-right { top: 84px; }
}

/* FDS extension: one inspector and selection toolbar across FPA views. */
.ss-editor-page[data-workspace-step=fpa] #fpa-properties[aria-expanded=true] { color: var(--fds-blue-600); border-color: var(--fds-blue-600); background: var(--fds-blue-50); }
.ss-editor-page[data-workspace-step=fpa] .ss-editor-right .ss-panel:first-of-type { padding-top: 0; }
@media(max-width: 767px) {
  .ss-editor-page[data-workspace-step=fpa] .ss-editor-right { top: 74px; }
  .ss-editor-page[data-workspace-step=fpa] .ss-stage-head { top: 5px; }
}

/* FDS extension: compact component overview and grouped inspector fields. */
.ss-editor-page[data-workspace-step=fpa] #properties-title { color: var(--fds-text-primary); font-size: 14px; letter-spacing: 0; line-height: 32px; }
.ss-editor-page[data-workspace-step=fpa] #fpa-inspector-close { min-width: 32px; min-height: 32px; border-radius: 8px; color: var(--fds-text-secondary); }
.fpa-property-content { display: grid; gap: 16px; }
.fpa-property-overview { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 12px; }
.fpa-property-overview .fpa-inspector-art { height: 64px; margin: 0; border: 1px solid var(--fds-border); border-radius: 10px; }
.fpa-property-overview .fpa-inspector-art svg { width: 58px; }
.fpa-inspector-art img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
/* A model that turns with a drag (view3d/glb-turntable.js). */
.fpa-inspector-art.is-turnable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.fpa-inspector-art.is-turnable.is-turning { cursor: grabbing; }
.fpa-inspector-art canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.fpa-property-identity { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.fpa-property-identity strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.fpa-property-identity .fds-meta { font-size: 11px; overflow-wrap: anywhere; }
.fpa-property-role { font-size: 11px; color: var(--fds-text-secondary); }
.fpa-lock-status { color: var(--fds-text-secondary); background: var(--fds-bg-muted); border-radius: var(--fds-radius-pill); padding: 3px 8px; }
.fpa-lock-status.is-locked { color: var(--fds-blue-600); background: var(--fds-blue-50); }
.fpa-property-section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--fds-border); }
.fpa-property-heading { margin: 0; color: var(--fds-text-primary); font-size: 12px; font-weight: 600; }
.ss-editor-page[data-workspace-step=fpa] .fpa-property-section .ss-facts { padding: 12px; background: var(--fds-gray-50); border: 1px solid var(--fds-border); border-radius: 10px; gap: 14px 12px; }
.ss-editor-page[data-workspace-step=fpa] .fpa-property-section .ss-facts dd { text-align: left; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fpa-property-section .ss-field-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.fpa-property-section .ss-field-grid > :last-child { grid-column: 1 / -1; }
.fpa-property-section .ss-field { margin: 0; }
.fpa-property-section .fds-input, .fpa-property-section .fds-select { min-height: 36px; border-radius: 8px; font-size: 13px; }
.fpa-property-section input[readonly] { color: var(--fds-text-muted); background: var(--fds-bg-muted); }
.fpa-property-note { margin: 0; font-size: 11px; line-height: 1.6; }
@media(pointer: coarse) {
  .ss-editor-page[data-workspace-step=fpa] #fpa-inspector-close { min-width: 44px; min-height: 44px; }
  .fpa-property-section .fds-input, .fpa-property-section .fds-select { min-height: 44px; }
}

/* FDS extension: 3D display controls overlay the drawing surface. */
.ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-editor-canvas { inset: 0 var(--fpa-inspector-width) 0 0; }
.ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-head { top: 12px; left: 12px; right: calc(var(--fpa-inspector-width) + var(--fpa-tools-width, 80px) + 28px); }
.ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) #fpa-stage-tools { right: calc(var(--fpa-inspector-width) + 12px); }
/* The selection bar shares the bottom row with material and camera capsules when the canvas is wide
   enough; on a narrower canvas those two capsules rise above it. */
.ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-editor-canvas { container: fpa-canvas / inline-size; }
@container fpa-canvas (max-width: 879px) {
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-viewport:has(#fpa-selection-bar:not([hidden])) .ss-3d-host:not(:fullscreen):not(.is-expanded) .ss-3d-foot,
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-viewport:has(#fpa-selection-bar:not([hidden])) .ss-3d-host:not(:fullscreen):not(.is-expanded) .ss-single-case-map { bottom: calc(var(--ss-float-height, 34px) + 24px); }
}
/* In 3D the display tools sit left of the reserved inspector column, so the inspector starts at the
   top instead of leaving the 2D tools row empty. Below 1024px it floats over the stage under the tools. */
@media(min-width: 1024px) {
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-editor-right { top: 0; border-top: 0; }
}
@media(max-width: 767px) {
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-head { top: 6px; left: 12px; right: 12px; }
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-head > div { padding-block: 2px; }
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) #fpa-stage-tools { top: calc(var(--ss-float-height, 34px) + 12px); right: 8px; }
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-viewport:has(#fpa-selection-bar:not([hidden])) .ss-3d-host:not(:fullscreen):not(.is-expanded) .ss-3d-foot,
  .ss-editor-page[data-workspace-step=fpa]:not([data-view="2d"]) .ss-stage-viewport:has(#fpa-selection-bar:not([hidden])) .ss-3d-host:not(:fullscreen):not(.is-expanded) .ss-single-case-map { bottom: calc(112px + var(--ss-float-height, 34px) + 8px); }
}

/* FDS extension: larger product image beside a card on mouse hover. */
.fpa-preview { position: fixed; left: var(--x, 0); top: var(--y, 0); z-index: 60; width: 240px; display: grid; gap: 4px; padding: 12px; background: var(--fds-white); border: 1px solid var(--fds-border); border-radius: 12px; box-shadow: var(--fds-shadow-2); pointer-events: none; }
.fpa-preview img { width: 216px; height: 216px; object-fit: contain; background: var(--fds-gray-25); border-radius: 8px; }
.fpa-preview strong { font-size: 13px; overflow-wrap: anywhere; }
.fpa-preview span { font-size: 12px; color: var(--fds-text-secondary); }
.fpa-preview small { font-size: 11px; color: var(--fds-text-muted); }
@media (pointer: coarse) { .fpa-preview { display: none; } }

/* FDS extension: the Display tools are one floating capsule — 2D zoom and reset, a divider, then
   the Checks and Component properties switches; an open switch is tinted instead of outlined. */
#fpa-stage-tools { box-sizing: border-box; min-height: var(--ss-float-height, 34px); gap: 2px; padding: 3px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-pill); background: var(--fds-bg-panel); box-shadow: var(--fds-shadow-1); }
#fpa-stage-tools #fpa-zoom-controls { gap: 2px; }
#fpa-stage-tools #fpa-zoom-controls:not([hidden])::after { content: ""; flex: none; width: 1px; height: 18px; margin: 0 4px; background: var(--fds-border); }
#fpa-stage-tools button { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 10px; border: 0; border-radius: var(--fds-radius-pill); background: none; box-shadow: none; }
#fpa-stage-tools :is(#fpa-zoom-out, #fpa-zoom-in) { padding: 0 8px; }
#fpa-stage-tools button:hover { background: var(--fds-bg-muted); }
#fpa-stage-tools button svg { flex: none; width: 15px; height: 15px; }
.ss-editor-page[data-workspace-step=fpa] #fpa-stage-tools #fpa-properties[aria-expanded=true] { color: var(--fds-blue-600); background: var(--fds-blue-50); }
@media (pointer: coarse) {
  #fpa-stage-tools button { min-height: 36px; }
}
/* Phones: the panel switch shows its icon (and error badge) only; the label stays for screen readers. */
@media (max-width: 767px) {
  #fpa-stage-tools #fpa-properties { padding-inline: 9px; }
  #fpa-stage-tools #fpa-properties > span:not([data-check-badge]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* FDS extension: the selection bar is the same floating capsule — name, then borderless actions. */
#fpa-selection-bar { box-sizing: border-box; min-height: var(--ss-float-height, 34px); gap: 2px; padding: 3px 3px 3px 14px; border-radius: var(--fds-radius-pill); }
#fpa-selection-bar .fpa-selected-label { margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--fds-border); line-height: 18px; }
#fpa-selection-bar button { min-height: 26px; padding: 0 10px; border: 0; border-radius: var(--fds-radius-pill); background: none; }
#fpa-selection-bar button:hover:not(:disabled) { background: var(--fds-bg-muted); }
#fpa-selection-bar button.danger:hover:not(:disabled) { background: var(--fds-red-50); }
#fpa-selection-bar > button:last-child { width: 26px; padding: 0; color: var(--fds-text-secondary); }
@media (pointer: coarse) {
  #fpa-selection-bar button { min-height: 36px; }
  #fpa-selection-bar > button:last-child { width: 36px; }
}
/* Phones wrap the name onto its own row, so the bar becomes a rounded card. */
@media (max-width: 767px) {
  #fpa-selection-bar { padding: 6px; border-radius: 18px; }
  #fpa-selection-bar .fpa-selected-label { margin: 0; border: 0; padding-inline: 24px; }
  #fpa-selection-bar > button:last-child { width: 28px; min-height: 28px; }
}
/* FDS extension: display layout dialog with live preview cards. */
.ss-fpa-layout-dialog { width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.ss-fpa-layout-dialog .ss-dialog-body { display: grid; gap: 14px; }
.ss-layout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-height: min(46dvh, 420px); overflow-y: auto; padding: 2px; }
.ss-layout-card { display: grid; gap: 6px; padding: 8px; text-align: left; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); color: var(--fds-text-primary); font: inherit; cursor: pointer; min-width: 0; }
.ss-layout-card:hover { border-color: var(--fds-text-secondary); }
.ss-layout-card:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }
.ss-layout-card[aria-checked="true"] { border-color: var(--fds-action-primary); box-shadow: 0 0 0 1px var(--fds-action-primary); }
.ss-layout-card .ss-fpa-tidy-preview { max-height: 90px; }
.ss-layout-card.is-misfit { color: var(--fds-text-secondary); }
.ss-layout-card.is-misfit .ss-fpa-tidy-preview { opacity: .5; }
.ss-layout-card-name { font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.ss-layout-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fds-text-secondary); }
.ss-layout-badge { padding: 1px 6px; border-radius: var(--fds-radius-pill); background: var(--fds-blue-50); color: var(--fds-blue-600); font-weight: 600; }
/* "Suits this case": a quieter badge than "recommended" (DLT path layouts). */
.ss-layout-badge.is-suits { background: var(--fds-bg-muted); color: var(--fds-text-secondary); font-weight: 500; }
.ss-layout-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ss-layout-status { display: grid; gap: 4px; }
.ss-layout-status p { margin: 0; }
.ss-layout-selected { font-weight: 600; }
.ss-layout-count { margin-top: 10px; max-width: 160px; }
.ss-layout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .ss-layout-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 36dvh; }
  .ss-layout-detail { grid-template-columns: minmax(0, 1fr); }
  .ss-layout-actions .ss-grow { display: none; }
  .ss-layout-actions [data-layout-action="all"] { order: 3; flex-basis: 100%; }
}
/* FDS extension: the lighting preset a display layout recommends (P6) carries a small dot. */
#lighting-presets [data-recommended] { position: relative; }
#lighting-presets [data-recommended]::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--fds-amber-700); }
/* FDS extension: CLS-2 approximate illuminance heat map on the case plan (below, within, above the thresholds). */
#fpa-lux-toggle[aria-pressed="true"] { background: var(--fds-gray-900); color: var(--fds-white); border-color: var(--fds-gray-900); }
.da-lux { pointer-events: none; }
.da-lux-cell { stroke: none; }
.da-lux-cell.is-dark { fill: var(--fds-blue-600); }
.da-lux-cell.is-ok { fill: var(--fds-amber-700); }
.da-lux-cell.is-bright { fill: var(--fds-red-700); }
.ss-lux-legend { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: min(560px, calc(100% - 24px)); margin: 0; padding: 6px 10px; border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); box-shadow: var(--fds-shadow-1); font-size: 12px; line-height: 18px; color: var(--fds-text-secondary); text-align: center; pointer-events: none; }
@media (max-width: 768px), (max-height: 820px) { .ss-lux-legend { position: static; transform: none; margin: 8px auto 0; } }
/* FDS extension: display area choice (wall display W3), as compact as the title buttons. */
#fpa-area-select { width: auto; min-width: 84px; }

/* Missing catalog models are UI markers, never estimated geometry. */
.ss-editor-page[data-workspace-step=fpa] .da-missing { stroke-dasharray: 5 3; fill: var(--fds-red-50); }

/* FDS extension: compact carrier cues and a combined component preview/specification section. */
.fpa-card > .fpa-carrier-badge { position: absolute; right: 30px; top: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 500; line-height: 14px; color: var(--fds-text-secondary); }
.fpa-carrier-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.da-carrier-hint { fill: none; stroke: var(--fds-text-secondary); stroke-width: 1.7; opacity: .42; }
.fpa-property-overview { grid-template-columns: minmax(0,1fr); }
.fpa-property-section .fpa-inspector-art-frame > .fpa-inspector-art { height: 160px; margin: 0; border: 1px solid var(--fds-border); }
.fpa-property-section .fpa-inspector-art-frame > .fpa-inspector-art svg { width: 160px; }
/* FDS extension: full-screen button on the model picture and the model viewer. */
.fpa-inspector-art-frame { position: relative; }
.fpa-art-expand { position: absolute; top: 6px; inset-inline-end: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--fds-border); border-radius: 8px; background: rgb(255 255 255 / .92); color: var(--fds-gray-700); cursor: pointer; }
.fpa-art-expand:hover { background: var(--fds-white); color: var(--fds-gray-900); }
.fpa-art-expand:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }
.ss-model-viewer { box-sizing: border-box; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--fds-gray-50); }
.ss-model-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.ss-model-viewer > header { display: flex; align-items: center; gap: var(--fds-space-3); padding: var(--fds-space-3) var(--fds-space-4); background: var(--fds-white); border-bottom: 1px solid var(--fds-border); }
.ss-model-viewer > header strong { min-width: 0; overflow-wrap: anywhere; }
.ss-model-viewer > header button { margin-inline-start: auto; }
.ss-model-viewer-stage { min-width: 0; min-height: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.ss-model-viewer-stage.is-turning { cursor: grabbing; }
.ss-model-viewer-stage canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 480px) { .ss-model-viewer > header .fds-meta { display: none; } }
@media (max-width: 680px) { .fpa-card > .fpa-carrier-badge { right: 39px; top: 11px; } }

/* Black capsule for entering the TrayScene workspace from a safe (FDS extension). */
#fpa-library .fds-btn.ss-pill-dark, .ss-editor-page .fds-btn.ss-pill-dark { min-height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: #111827; color: #fff; font-weight: 600; }
#fpa-library .fds-btn.ss-pill-dark:hover, #fpa-library .fds-btn.ss-pill-dark:focus-visible, .ss-editor-page .fds-btn.ss-pill-dark:hover, .ss-editor-page .fds-btn.ss-pill-dark:focus-visible { background: #000; color: #fff; }
/* FDS extension: component code with a copy button, lock tag after the name, preview without heading. */
.fpa-property-code { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fpa-property-code .fds-btn { min-height: 24px; padding: 0 8px; font-size: 11px; }
.fpa-property-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fpa-property-name .fpa-lock-status { padding: 1px 6px; font-size: 10px; line-height: 16px; }
.fpa-property-section.fpa-property-preview { padding-top: 0; border-top: 0; }


/* FDS extension: compact display-library actions and caption filters. */
#fpa-library #fpa-favorites { display: inline-flex; align-items: center; justify-content: center; width: 32px; padding: 5px; }
#fpa-favorites span, #fpa-favorites svg { display: block; width: 18px; height: 18px; }
#fpa-favorites[aria-pressed=true] svg { fill: currentColor; }
.fpa-library-more { position: relative; flex: none; }
.fpa-library-more > summary { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 10px; box-sizing: border-box; border: 1px solid var(--fds-border); border-radius: 7px; background: var(--fds-bg-panel); color: var(--fds-text-secondary); font-size: 12px; cursor: pointer; list-style: none; }
.fpa-library-more > summary::-webkit-details-marker { display: none; }
.fpa-library-more > summary::after { content: ''; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.fpa-library-more[open] > summary::after { transform: rotate(225deg); }
.fpa-library-more > summary:hover { background: var(--fds-bg-muted); }
.fpa-library-more > summary:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }
.fpa-library-more-actions { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 4px; width: max-content; min-width: 160px; padding: 6px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); box-shadow: var(--fds-shadow-2); }
#fpa-library .fpa-library-more-actions > button { width: 100%; justify-content: flex-start; text-align: start; border-color: transparent; background: transparent; border-radius: var(--fds-radius-sm); }
#fpa-library .fpa-library-more-actions > button:hover { background: var(--fds-bg-muted); color: var(--fds-text-primary); }
#fpa-library .fpa-library-more-actions > button[hidden] { display: none; }
.fpa-library-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-top: 3px; }
.fpa-library-caption #fpa-feedback { flex: 1; min-width: 0; margin: 0; line-height: 1.5; }
.fpa-fit-filter { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; font-size: 12px; white-space: nowrap; cursor: pointer; min-height: 24px; }
.fpa-fit-filter input { margin: 0; accent-color: var(--fds-blue-600); }
@media (pointer: coarse) {
  #fpa-library #fpa-favorites { width: 44px; min-height: 44px; }
  .fpa-library-more > summary, .fpa-fit-filter { min-height: 44px; }
}

/* FDS extension: separate component identity from the inspector tabs. */
.ss-editor-page #properties > .fpa-property-content { padding-top: var(--fds-space-4); }


/* FDS extension: contextual library help and compact, actionable empty states. */
.fpa-library-heading { display: inline-flex; align-items: center; gap: 2px; flex: none; white-space: nowrap; }
#fpa-library .fpa-library-help { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; width: 24px; min-height: 24px; margin-top: -5px; margin-inline: -3px; padding: 3px; border: 0; background: transparent; color: var(--fds-text-muted); }
.fpa-library-help svg { width: 16px; height: 16px; }
#fpa-library .fpa-library-help:hover { color: var(--fds-text-primary); background: var(--fds-bg-muted); }
.fpa-help-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-lg); background: var(--fds-bg-panel); color: var(--fds-text-primary); }
.fpa-help-dialog::backdrop { background: rgb(0 0 0 / 30%); }
.fpa-help-dialog h2 { margin: 0 0 16px; font-size: 18px; }
.fpa-help-dialog p { font-size: 13px; line-height: 1.85; margin: 0 0 14px; color: var(--fds-text-secondary); }
.fpa-help-dialog footer { display: flex; justify-content: flex-end; margin-top: 20px; }
.fpa-cards:has(.fpa-library-empty) { grid-auto-columns: 100%; }
.fpa-library-empty { grid-row: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; padding: 16px 24px; border: 1px dashed var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-page); }
.fpa-empty-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--fds-bg-muted); color: var(--fds-text-muted); }
.fpa-empty-icon svg { width: 22px; height: 22px; }
.fpa-empty-copy { min-width: 0; }
.fpa-empty-copy strong { display: block; font-size: 13px; font-weight: 500; color: var(--fds-text-primary); }
.fpa-empty-copy p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: var(--fds-text-secondary); }
#fpa-library .fpa-empty-action { flex: none; background: var(--fds-bg-panel); }
@media (max-width: 600px) {
  .fpa-library-empty { gap: 10px; padding: 12px; flex-wrap: wrap; justify-content: flex-start; }
  .fpa-empty-copy { flex: 1; }
  #fpa-library .fpa-empty-action { margin-inline-start: 50px; }
}
@media (pointer: coarse) {
  #fpa-library .fpa-library-help { width: 44px; min-height: 44px; margin-top: -10px; margin-inline: -13px; }
  .fpa-help-dialog .fds-btn { min-height: 44px; }
}

.fpa-library-heading > strong { display: inline-flex; align-items: center; gap: 0; }
@media (max-width: 600px) {
  .fpa-cards:has(.fpa-library-empty) { grid-template-rows: minmax(154px, auto); }
  .fpa-library-empty { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-content: center; gap: 8px 12px; }
  .fpa-empty-icon { width: 32px; height: 32px; }
  .fpa-empty-copy { width: 100%; }
  #fpa-library .fpa-empty-action { grid-column: 2; margin: 0; justify-self: start; }
}
