/* PATCH 012 - WORKSPACE PRESENTATION CONVERGENCE */

/* System search is a search primitive, not a command button. */
#app-titlebar-search {
    min-width: min(420px, 34vw);
}
#app-titlebar-search > .object-list-launcher[hidden] {
    display: none !important;
}
#app-titlebar-search > .system-header-search-input {
    width: 100%;
    min-height: 34px;
    padding: 7px 11px;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    outline: none;
    opacity: .62;
}
#app-titlebar-search > .system-header-search-input:hover,
#app-titlebar-search > .system-header-search-input:focus {
    opacity: 1;
    background: rgba(0,0,0,.26);
    border-color: rgba(255,255,255,.16);
}

/* The panel starts below the actual header search input. */
#app-titlebar-search > .system-object-list-panel {
    top: calc(100% + 7px);
    left: 50%;
    width: min(620px, 76vw);
    transform: translateX(-50%);
}
#app-titlebar-search > .system-object-list-panel > .object-list-search {
    display: none !important;
}

/* Search rows use the same entity color vocabulary as card rows. */
.object-list-row[data-entity-type="map"] { --entity-accent: var(--entity-map); }
.object-list-row[data-entity-type="site"] { --entity-accent: var(--entity-site, var(--entity-map)); }
.object-list-row[data-entity-type="place"] { --entity-accent: var(--entity-place); }
.object-list-row[data-entity-type="person"] { --entity-accent: var(--entity-person); }
.object-list-row[data-entity-type="quest"] { --entity-accent: var(--entity-quest); }
.object-list-row[data-entity-type="encounter"] { --entity-accent: var(--entity-encounter); }
.object-list-row[data-entity-type="monster"] { --entity-accent: var(--entity-monster); }
.object-list-row[data-entity-type="group"] { --entity-accent: var(--entity-group); }
.object-list-row[data-entity-type="item"],
.object-list-row[data-entity-type="equipment"] { --entity-accent: var(--entity-item); }

.object-list-row.card-list-item,
.object-list-row.compact-card-list-item {
    --row-accent: var(--entity-accent, var(--entity-default));
    border-color: color-mix(in srgb, var(--row-accent) 36%, rgba(255,255,255,.10));
    border-left-color: color-mix(in srgb, var(--row-accent) 72%, transparent);
    background: color-mix(in srgb, var(--row-accent) 5%, var(--surface-1));
}
.object-list-row .list-number {
    background: var(--row-accent);
    border-color: color-mix(in srgb, var(--row-accent) 52%, transparent);
}
.object-list-row .status-dot { color: var(--row-accent); }

/* Entity workspace owns its complete usable rectangle. */
#entity-workspace:not([hidden]) {
    display: grid !important;
    place-items: center !important;
    box-sizing: border-box;
    padding:
        calc(var(--system-workspace-header-height, 72px) + 18px)
        calc(var(--system-workspace-dock-width, 280px) + 18px)
        calc(var(--system-workspace-footer-height, 34px) + 18px);
    overflow: hidden;
}
#entity-workspace > #entity-dialog[open] {
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    max-height: 100% !important;
    max-width: min(980px, 100%) !important;
    width: min(900px, 100%) !important;
    overflow: auto !important;
    transform: none !important;
}

/* An active inspector floor blocks lower workspace controls. */
html[data-inspector-workspace-active="true"] #map-viewport,
html[data-inspector-workspace-active="true"] .map-controls {
    pointer-events: none !important;
    user-select: none !important;
}
html[data-inspector-workspace-active="true"] .map-controls {
    visibility: hidden !important;
}

/* Campaign and map names remain selectors without button chrome. */
.system-title-selector {
    appearance: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    text-align: left;
    color: inherit;
}
.system-title-selector::after { content: " ▾"; opacity: .58; }
