/* Screen-only shared component theme. Geometry stays in each component's CSS.
   Palette: theme-palette.css. Roles: neutral control, primary action, selected,
   destructive action. Photo overlays intentionally keep their compact shape. */
:root { --workspace-accent: var(--theme-action); }
body { background: var(--theme-background); color: var(--theme-ink); }
a { color: var(--theme-action); text-underline-offset: .16em; }
h1, h2, h3 { color: var(--theme-ink); }
button, .capture-button {
    background: var(--theme-surface); color: var(--theme-ink);
    border-color: var(--theme-secondary-border); border-radius: var(--theme-control-radius);
}
button:disabled { opacity: .5; }
input, textarea, select { accent-color: var(--theme-action); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select,
#object-editor input, #object-editor textarea {
    border: 1px solid var(--theme-secondary-border); border-radius: var(--theme-control-radius);
    background: var(--theme-surface); color: var(--theme-ink);
}
:where(a, button, input, select, textarea, .capture-button):focus-visible {
    outline: 3px solid var(--theme-focus); outline-offset: 2px;
}
.text-button { color: var(--theme-action); background: transparent; border-color: transparent; }
/* Strong color means the action that completes this step, never ordinary navigation. */
.primary-action, .detail-save-bar button:not(.detail-undo), #prepare-labels button,
#print-labels, #execute, #picker-confirm, #location-save, #capture-done {
    background: var(--theme-action); color: var(--theme-on-action); border-color: var(--theme-action);
}
.detail-save-bar .detail-undo { background: var(--theme-surface); color: var(--theme-ink); }
#location-delete, #image-trash { color: var(--theme-danger); border-color: var(--theme-danger); background: var(--theme-danger-surface); }
.label-mode-choice button[aria-pressed="true"] {
    background: var(--theme-collection-surface); color: var(--theme-ink);
    border-color: var(--theme-action); box-shadow: inset 0 -3px var(--theme-action);
}
/* Opaque pinned surfaces keep text legible over scrolling photos. */
.workspace-header, .toolbar { background: var(--theme-primary-surface); border-color: var(--theme-border); }
.workspace-actions, .detail-save-bar, #selection-bar, #label-bar {
    background: var(--theme-primary-surface); border-color: var(--theme-secondary-border);
    box-shadow: 0 -3px 14px var(--theme-shadow);
}
.page-topline > h1 { color: var(--theme-accent); }
/* Identity icons repeat HOME's artwork. Masks inherit color and add no spoken text. */
[data-page="boxes"] { --page-icon: url('/static/icons/box.svg'); }
[data-page="items"] { --page-icon: url('/static/icons/items.svg'); }
[data-page="locations"] { --page-icon: url('/static/icons/pin.svg'); }
[data-page="labels"] { --page-icon: url('/static/icons/label.svg'); }
[data-page="image-browser"] { --page-icon: url('/static/icons/photo.svg'); }
#start-view { --page-icon: url('/static/icons/open.svg'); }
#unassigned-header { --page-icon: url('/static/icons/inbox.svg'); }
#capture-view { --page-icon: url('/static/icons/items.svg'); }
#box-select-dialog { --page-icon: url('/static/icons/box.svg'); }
#move-dialog { --page-icon: url('/static/icons/items.svg'); }
.page-topline > h1::before {
    content: ''; display: inline-block; width: 1.1em; height: 1.1em; margin-right: .35em;
    vertical-align: -.16em; background: currentColor;
    mask: var(--page-icon) center / contain no-repeat;
}
/* User-entered detail titles retain their full-width row, without an oversized icon. */
.location-detail-heading > h1::before { width: .85em; height: .85em; vertical-align: -.05em; }
.box-list-card, .workspace-item, .location-card, .image-group, .card,
#boxes-number-result, #box-select-number-result {
    background: var(--theme-surface); border-color: var(--theme-border);
    border-radius: var(--theme-card-radius);
}
.workspace-item { box-shadow: inset 0 0 0 1px var(--theme-border); }
.box-list-card:has(input:checked), .workspace-item:has(input:checked), .image-group:has(input:checked) {
    outline: 3px solid var(--theme-action); outline-offset: -3px;
    background: var(--theme-primary-surface);
}
.pick input { accent-color: var(--theme-action); }
.box-list-photo, .workspace-media, .item-placeholder, .location-photo-placeholder,
.item-list-card .item-open img, .item-list-card .item-placeholder, .tile {
    background: var(--theme-collection-surface);
}
.no-photo, .item-placeholder, .box-list-text small, .item-list-placement, .item-list-location,
.workspace-identity p, #box-description, .workspace-hint, .workspace-section-line > span,
.filter-count, .association small, #picker-results small { color: var(--theme-muted); }
.status-grid div { background: var(--theme-primary-surface); border-radius: var(--theme-control-radius); }
.status-grid dd { color: var(--theme-action); }
.associations, .association { border-color: var(--theme-border); }
/* Dialogs share the palette, but full-screen pickers remain pages, not floating cards. */
dialog { background: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-border); }
dialog::backdrop, #box-menu::backdrop, #item-preview::backdrop,
#picker-dialog::backdrop, #box-warning::backdrop, #image-warning::backdrop,
#image-menu::backdrop, #box-registration::backdrop { background: var(--theme-backdrop); }
#box-select-dialog, #move-dialog.move-page { background: var(--theme-background); }
#object-gallery .image-menu-button, .photo-menu {
    color: var(--theme-ink); border-color: var(--theme-secondary-border); background: var(--theme-surface);
}
#move-location-warning, #items-move-warning { color: var(--theme-warning); }
@media (hover: hover) {
    button:not(:disabled):not(.text-button):not(.item-open):not(.box-list-open):not(#box-card):hover,
    .capture-button:hover { filter: brightness(.96); }
    .location-card:hover, .box-list-card:hover, .workspace-item:hover { border-color: var(--theme-accent); }
    a:hover, .text-button:hover { text-decoration-thickness: 2px; }
}

[data-page="security"] { --page-icon: url("/static/icons/lock.svg"); }
