/* Finish Board is a material sample bench. The sample is the operable raised
   piece; codes, product details and use remain printed on the parent material.
   The schedule alone earns a continuous data cut. */
body.windowed-layout .fb-root { background: var(--applet-material, var(--v10-surface)); }
body.windowed-layout .fb-header { padding: 12px 14px 8px; align-items: center; gap: 8px 16px; }
body.windowed-layout .fb-title-main { font-size: 13px; font-weight: 650; letter-spacing: 0; }
body.windowed-layout .fb-title-sub { margin-top: 4px; font-size: 11px; line-height: 1.5; }
body.windowed-layout .fb-header-actions { gap: 8px; }
body.windowed-layout .fb-view-toggle { padding: 3px; gap: 2px; }
body.windowed-layout .fb-toggle-btn { min-height: 34px; padding: 7px 10px; border-radius: 6px; }
body.windowed-layout .fb-cat-pills { padding: 0 14px 9px; gap: 13px; }
body.windowed-layout .fb-cat-pill { font-size: 10px; line-height: 1.4; }
body.windowed-layout .fb-cat-count { font-variant-numeric: tabular-nums; padding: 0; }
body.windowed-layout .fb-filter-bar { padding: 0 14px 12px; gap: 8px 12px; align-items: end; }
body.windowed-layout .fb-filter-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
body.windowed-layout .fb-filter-field { display: grid; min-width: 0; gap: 4px; }
body.windowed-layout .fb-filter-field > span { color: var(--applet-muted, var(--v10-muted)); font-size: 10px; line-height: 1.3; }
body.windowed-layout .fb-filter-select { min-height: 34px; padding: 7px 8px; font-size: 11px; }
body.windowed-layout .fb-filter-summary { padding-bottom: 9px; font-size: 10px; }
body.windowed-layout .fb-filter-clear { min-height: 34px; border: 0; box-shadow: none; background: transparent; }
body.windowed-layout .fb-board-section { margin-bottom: 23px; }
body.windowed-layout .fb-board-section-head { padding: 0 0 11px; }
body.windowed-layout .fb-board-section-head strong { font-size: 11px; letter-spacing: .055em; }
body.windowed-layout .fb-board-section-head span { color: var(--applet-muted, var(--v10-muted)); font-size: 11px; line-height: 1.5; }
body.windowed-layout .fb-needs-detail-section { padding-top: 18px; border-color: var(--applet-edge, var(--v10-line)); }
body.windowed-layout .fb-mosaic-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 17px; }
body.windowed-layout :is(.fb-mosaic-card, .fb-needs-detail-grid .fb-mosaic-card) {
  display: flex; flex-direction: column; height: auto; min-height: 0; overflow: visible;
  grid-column: auto; grid-row: auto; background: transparent; box-shadow: none; border: 0; border-radius: 0;
  opacity: 1;
}
body.windowed-layout .fb-swatch-card:hover { box-shadow: none; transform: none; }
body.windowed-layout .fb-mosaic-card .fb-sample-edit {
  appearance: none; display: block; position: relative; cursor: pointer; width: 100%;
  height: 152px; min-height: 152px; margin: 0; padding: 0; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--applet-edge, var(--v10-line)) 55%, transparent);
  box-shadow: inset 0 1px 0 #ffffff25, 0 2px 2px #00000020;
  text-align: left; overflow: hidden; isolation: isolate;
}
body.windowed-layout .fb-swatch-card:hover .fb-sample-edit { filter: none; }
body.windowed-layout .fb-mosaic-card .fb-sample-edit:active { transform: translateY(1px); box-shadow: inset 0 1px 2px #00000025; }
body.windowed-layout .fb-sample-edit:focus-visible { outline: 2px solid var(--applet-ink, var(--v10-ink)); outline-offset: 4px; }
body.windowed-layout .fb-sample-edit-label {
  position: absolute; z-index: 2; inset: auto 7px 7px auto; font-family: inherit; font-size: 10px; line-height: 1.3;
  padding: 4px 7px; border-radius: 4px; background: var(--applet-raised, var(--v10-surface));
  color: var(--applet-ink, var(--v10-ink)); border: 1px solid var(--applet-edge, var(--v10-line));
  opacity: 0; pointer-events: none;
}
body.windowed-layout .fb-sample-edit:is(:hover, :focus-visible) .fb-sample-edit-label { opacity: 1; }
body.windowed-layout .fb-mosaic-card .fb-swatch-body {
  padding: 10px 0 0; background: transparent; min-width: 0; flex: 1; display: flex; flex-direction: column;
}
body.windowed-layout .fb-sample-identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; margin-bottom: 5px; }
body.windowed-layout .fb-spec-code { font-size: 11px; font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
body.windowed-layout .fb-sample-category { font-size: 10px; color: var(--applet-muted, var(--v10-muted)); }
body.windowed-layout .fb-mosaic-card .fb-swatch-label {
  overflow: visible; text-overflow: clip; white-space: normal; font-size: 13px; line-height: 1.4; font-weight: 600;
  color: var(--applet-ink, var(--v10-ink)); opacity: 1; overflow-wrap: anywhere;
}
body.windowed-layout .fb-mosaic-card :is(.fb-swatch-mfr, .fb-swatch-product) {
  display: block;
  color: var(--applet-muted, var(--v10-muted)); opacity: 1; font-size: 11px; line-height: 1.45;
  white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; margin-top: 4px;
}
body.windowed-layout .fb-mosaic-card .fb-swatch-meta {
  display: grid; gap: 4px; margin-top: 9px; padding-top: 0; border: 0; color: var(--applet-muted, var(--v10-muted));
  font-size: 10px; line-height: 1.5;
}
body.windowed-layout .fb-mosaic-card :is(.fb-finish-type, .fb-usage-count, .fb-room-codes) {
  display: block;
  color: inherit; opacity: 1; font-size: inherit; line-height: inherit; white-space: normal; overflow-wrap: anywhere;
}
body.windowed-layout .fb-sample-footer { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
body.windowed-layout .fb-sample-status { font-size: 10px; line-height: 1.5; color: var(--applet-muted, var(--v10-muted)); }
body.windowed-layout .fb-sample-delete {
  appearance: none; color: var(--applet-muted, var(--v10-muted)); background: transparent; border: 0;
  border-radius: 5px; box-shadow: none; font: inherit; font-size: 11px; min-height: 34px; padding: 6px 3px; cursor: pointer;
}
body.windowed-layout .fb-sample-delete:hover { color: var(--applet-ink, var(--v10-ink)); text-decoration: underline; }
body.windowed-layout .fb-sample-delete:focus-visible { outline: 2px solid var(--applet-ink, var(--v10-ink)); outline-offset: 2px; }
body.windowed-layout .fb-room-section { background: transparent; box-shadow: none; border-radius: 0; }
body.windowed-layout .fb-section-body { border-radius: 9px; background: var(--applet-cut, var(--v10-zone)); box-shadow: var(--workspace-cut, var(--v10-cut)); }
body.windowed-layout .fb-section-head { border-radius: 5px; }
body.windowed-layout .fb-schedule-table-wrap { background: var(--applet-cut, var(--v10-zone)); }
body.windowed-layout .fb-schedule-scroll-cue { display: none; margin: 0 0 8px; color: var(--applet-muted, var(--v10-muted)); font-size: 11px; line-height: 1.4; }
body.windowed-layout .fb-schedule-table-wrap:focus-visible { outline: 2px solid var(--applet-ink, var(--v10-ink)); outline-offset: -2px; }
body.windowed-layout .fb-schedule-legend { background: transparent; border: 0; }

/* The editor retains the same material object. Actual finish color/image is
   output data; precise spec/product fields remain distinct recessed inputs. */
body.workspace-hand-enabled .fb-modal-panel {
  --applet-material: var(--applet-plan-material);
  --applet-cut: color-mix(in srgb, var(--applet-material) 90%, #080a08);
  --applet-raised: color-mix(in srgb, var(--applet-material) 94%, #ddd9ca);
  --applet-edge: color-mix(in srgb, var(--applet-material) 80%, #bbb7aa);
  --text: var(--applet-ink); --muted: var(--applet-muted); --border: var(--applet-edge);
  --input-bg: var(--applet-cut); --input-border: var(--applet-edge);
  background: var(--applet-material); color: var(--applet-ink); border: 1px solid var(--applet-edge);
  border-radius: 15px;
}
body.workspace-hand-enabled.light-theme .fb-modal-panel {
  --applet-cut: color-mix(in srgb, var(--applet-material) 92%, #17140d);
  --applet-raised: color-mix(in srgb, var(--applet-material) 93%, #e7d6ad);
  --applet-edge: color-mix(in srgb, var(--applet-material) 78%, #e7d6ad);
}
body.workspace-hand-enabled :is(.fb-modal-body, .fb-modal-preview-col, .fb-modal-form-col, .fb-modal-footer, .fb-field-group) { background: transparent; }
body.workspace-hand-enabled .fb-modal-body { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
body.workspace-hand-enabled :is(.fb-modal-preview-col, .fb-modal-form-col, .fb-field-group, .fb-field-row) { min-width: 0; }
body.workspace-hand-enabled :is(.fb-preview-label, .fb-preview-mfr, .fb-field-label, .fb-texture-name) { overflow-wrap: anywhere; }
body.workspace-hand-enabled .fb-texture-name { white-space: normal; }
body.workspace-hand-enabled .fb-modal-header { position: sticky; top: 0; z-index: 4; background: var(--applet-material); }
body.workspace-hand-enabled .fb-modal-close { min-width: 44px; }
body.workspace-hand-enabled .fb-modal-footer { position: sticky; bottom: 0; z-index: 4; background: var(--applet-material); }
body.workspace-hand-enabled .fb-modal-preview-swatch { border-radius: 10px; box-shadow: inset 0 1px 0 #ffffff25, 0 2px 2px #00000020; }
body.workspace-hand-enabled .fb-modal-panel :is(.fb-input, .fb-select, .fb-textarea, .fb-color-hex) {
  background: var(--applet-cut); color: var(--applet-ink); border-color: var(--applet-edge); box-shadow: var(--workspace-cut);
  min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box;
}
body.workspace-hand-enabled .fb-modal-panel :is(.fb-btn-save, .fb-texture-btn) {
  background: var(--applet-raised); color: var(--applet-ink); border: 1px solid var(--applet-edge); box-shadow: var(--workspace-puck);
}
body.workspace-hand-enabled .fb-modal-panel :is(.fb-btn-cancel, .fb-texture-clear) { background: transparent; color: var(--applet-ink); box-shadow: none; }
body.workspace-hand-enabled .fb-modal-panel :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--applet-ink); outline-offset: 3px; }
@container finish-board (max-width: 660px) {
  body.windowed-layout .fb-header { align-items: start; }
  body.windowed-layout .fb-header-actions { width: 100%; }
  body.windowed-layout .fb-view-toggle { flex: 1 1 auto; width: auto; }
  body.windowed-layout .fb-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; }
  body.windowed-layout .fb-schedule-scroll-cue { display: block; }
}
@container finish-board (max-width: 460px) {
  body.windowed-layout .fb-mosaic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.windowed-layout .fb-mosaic-card .fb-sample-edit { height: 125px; min-height: 125px; }
  body.windowed-layout .fb-header { padding: 10px 12px 8px; }
  body.windowed-layout :is(.fb-cat-pills, .fb-filter-bar) { padding-inline: 12px; }
  body.windowed-layout :is(.fb-palette-view, .fb-rooms-view, .fb-schedule-view) { padding-inline: 12px; }
  body.windowed-layout .fb-sample-footer { flex-wrap: wrap; gap: 2px 8px; }
}
@media (pointer: coarse) {
  body.windowed-layout :is(.fb-toggle-btn, .fb-filter-select, .fb-filter-clear, .fb-sample-delete) { min-height: 44px; }
  body.workspace-hand-enabled .fb-modal-panel :is(button, .fb-input, .fb-select) { min-height: 44px; }
}
@media (max-width: 520px) {
  body.workspace-hand-enabled .fb-modal-body { grid-template-columns: minmax(0, 1fr); }
  body.workspace-hand-enabled .fb-modal-preview-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; }
  body.workspace-hand-enabled .fb-modal-preview-swatch { height: 104px; box-sizing: border-box; }
  body.workspace-hand-enabled .fb-modal-preview-info { text-align: left; align-self: center; }
  body.workspace-hand-enabled .fb-modal-preview-col .fb-field-group:last-child { grid-column: 1 / -1; }
  body.workspace-hand-enabled .fb-modal-form-col { padding: 16px; gap: 12px; }
  body.workspace-hand-enabled .fb-color-picker-row { gap: 6px; }
  body.workspace-hand-enabled .fb-color-hex { padding-inline: 6px; }
}
@media (forced-colors: active) {
  body.windowed-layout :is(.fb-sample-edit, .fb-sample-delete, .fb-section-body, .fb-schedule-table-wrap) { border: 1px solid CanvasText; }
}

/* At a small allocation, samples and room sections follow one outer reading.
   The finish body does not become a second, clipped vertical scrolling box. */
@container finish-board (max-width: 720px) {
  body.windowed-layout [data-win-id="finish-board-hub"] .fb-root { height: auto; min-height: 0; overflow: visible; }
  body.windowed-layout [data-win-id="finish-board-hub"] .fb-body { flex: 0 0 auto; overflow: visible; }
}
body.windowed-layout .workspace-widget-compact[data-win-id="finish-board-hub"] .fb-board-section-head { padding-bottom: 8px; }
