.display-assignment-card { margin: 12px 0; padding: 16px; border: 1px solid var(--v3-line, #61777e); border-radius: 12px; background:var(--v3-panel-2); color:var(--v3-text); }
.display-assignment-card [hidden] { display: none !important; }
.display-assignment-card header, .display-editor-toolbar, .display-picker-heading, .display-assignment-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.display-assignment-card header strong, .display-assignment-card small { display: block; }
.display-assignment-card small { margin-top: 5px; color:var(--v3-muted); }
.display-assignment-card [role="status"] { font-size: 13px; line-height: 1.5; }
.display-assignment-card button, .display-assignment-card select { font: inherit; }
.display-assignment-card button:focus-visible, .display-assignment-card select:focus-visible { outline: 2px solid var(--v3-live, #abc987); outline-offset: 3px; }
.display-editor-toolbar { margin-top: 16px; }
.display-editor-toolbar label, .display-picker-heading label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.display-assignment-card select { min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 10px; color: inherit; background:var(--dock-input); border: 1px solid var(--v3-line, #61777e); border-radius: 6px; }
.display-assignment-grid { margin: 16px 0; display: grid; grid-template-columns: repeat(var(--display-columns, 2), minmax(0, 1fr)); gap: 6px; }
.display-assignment-grid .display-position { position: relative; min-width: 0; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--v3-line, #61777e); border-radius: 6px; background: var(--v3-panel-2, #253239); }
.display-position.empty { border-style: dashed; }
.display-assignment-card .display-position > [data-display-position] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 0; color: inherit; background: transparent; box-shadow: none; font-size: 12px; }
.display-assignment-card .display-position > [data-display-position]:disabled { opacity: 1; cursor: default; }
.display-position.selected, .display-position.drop-target { border-color: var(--v3-live, #abc987); box-shadow: 0 0 0 2px var(--v3-live, #abc987); }
.display-position.drop-target { filter: brightness(1.2); }
.display-assignment-card .multi-view-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; }
.display-assignment-card .multi-view-preview.ready { opacity: 1; }
.display-preview-placeholder { color: var(--v3-muted, #acbdb7); font-size: 11px; }
.display-preview-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.86)); color: #fff; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; pointer-events: none; }
.display-position-number, .display-camera-position { position: absolute; top: 4px; left: 4px; min-width: 20px; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; line-height: 18px; pointer-events: none; }
.display-assignment-card .display-clear { position: absolute; top: 3px; right: 3px; z-index: 4; display: grid; place-items: center; width: 28px; height: 28px; min-height: 0; padding: 0; border: 1px solid rgba(255,255,255,.5); border-radius: 5px; background:var(--v3-panel-2); color:var(--v3-text); font-size: 22px; line-height: 1; cursor: pointer; }
.display-clear:hover { background: #703a35; }
.display-empty-plus { font-size: 26px; color: var(--v3-muted, #acbdb7); }
.display-camera-picker { border-top: 1px solid var(--v3-line, #61777e); padding-top: 14px; }
.display-camera-picker p, .display-assignment-actions > span { font-size: 12px; color: var(--v3-muted, #acbdb7); line-height: 1.5; }
.display-camera-previews { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 12px 0 16px; }
.display-assignment-card .display-camera-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; min-width: 0; display: grid; place-items: center; border: 1px solid var(--v3-line, #61777e); border-radius: 6px; background:var(--v3-panel-2); color: inherit; cursor: grab; }
.display-camera-preview.assigned { border-color: var(--v3-live, #abc987); }
.display-camera-position { background: var(--v3-live, #abc987); color: #1c2c16; }
.display-empty-catalog { grid-column: 1 / -1; }
.display-assignment-actions { border-top: 1px solid var(--v3-line, #61777e); padding-top: 14px; }
@media (max-width: 520px) { .display-assignment-card { padding: 10px; } .display-assignment-grid { gap: 4px; } .display-camera-previews { grid-template-columns: repeat(2,minmax(0,1fr)); } .display-picker-heading label { width: 100%; } .display-picker-heading select { flex: 1; } .display-position-number { top: 2px; left: 2px; } .display-preview-name { font-size: 10px; } }
#deviceAdminPanel.display-only-mode > :not(header):not(#deviceDisplayAssignments) { display: none !important; }
#deviceAdminPanel.display-only-mode { align-content: start; }
/* Preview images share the scoped thumbnail cache with the main view. Keep
   their labels above the shared image layer, in both application themes. */
.display-preview-name { z-index: 2; }
.display-position-number, .display-camera-position { z-index: 3; }
html #deviceAdminPanel .display-assignment-card .display-clear { color:var(--v3-text)!important; background:var(--v3-panel-2); }
.display-assignment-actions { position: sticky; bottom: 0; z-index: 6; padding-bottom: 10px; background: var(--v3-panel, #1c282e); }
.display-device-heading { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.display-device-heading > div { flex: 1; min-width: 0; }
.display-device-heading small { display: block; overflow-wrap: anywhere; color:var(--v3-muted); font-size: 11px; margin-top: 4px; }
html #deviceAdminPanel .v3-device-edge-chip > button { grid-column: 2; justify-self: start; margin-top: 5px; }

/* The application reduces ordinary mobile buttons to a fixed height. Camera
   previews keep their cell geometry instead of inheriting that toolbar size. */
html #deviceAdminPanel .display-assignment-card .display-camera-preview { width: 100%; height: auto !important; max-width: none; min-height: 0; }
@media (max-width: 520px) {
    .display-assignment-card .display-empty-plus { font-size: 18px; line-height: 18px; }
    .display-assignment-card .display-position.empty > [data-display-position] { font-size: 10px; line-height: 12px; padding-top: 6px; }
}
