/* StagePlan 1.5 controls: tablet/touch friendly, no changes to stored projects */
[hidden]{display:none!important}
#app.hide-left{grid-template-columns:minmax(0,1fr)!important}
#app.hide-left>.sidebar{display:none!important}
#app.hide-right .inspector{display:none!important}
#toggle-left,#toggle-right{flex:0 0 auto;min-width:34px;width:34px;height:34px;font-size:17px}
.user-chip{font-size:11px;font-weight:700;line-height:1.2;color:var(--text);background:var(--panel2);border:1px solid var(--edge2);border-radius:5px;padding:8px 9px;white-space:nowrap;max-width:165px;overflow:hidden;text-overflow:ellipsis}
.grid-choice select{width:73px;min-height:30px;height:30px;padding:3px 5px;font-size:11px;border-radius:5px}
.grid-choice,.cable-switch{white-space:nowrap}
#show-cables{margin:0}
.catalog-search{display:flex;flex-direction:column;gap:7px;margin-bottom:13px}
.catalog-search input,.catalog-search select{width:100%;min-height:38px}
.device-palette{max-height:calc(100vh - 400px);min-height:160px;overflow:auto;align-content:start;grid-auto-rows:min-content}
.device-palette .palette-item{min-height:43px;overflow-wrap:anywhere}
.svg-device[data-kind="device"]{touch-action:none}
.grid-minor-line{stroke:#e4eaf1;stroke-width:.011}
.grid-major-line{stroke:#bacada;stroke-width:.026}
html[data-theme="dark"] .grid-minor-line{stroke:#374a5e;stroke-width:.011}
html[data-theme="dark"] .grid-major-line{stroke:#607c93;stroke-width:.026}
html[data-theme="dark"] .svg-board-bg{fill:#111f2e}
#app .filter-bar{flex-wrap:wrap}
.snapshot select[data-permission]{min-width:165px;max-width:205px}
@media(max-width:1450px){.user-chip{max-width:110px}.top-actions{gap:5px}.grid-choice{margin:0 3px}}
@media(max-width:1250px){.user-chip{display:none}.grid-choice select{width:61px}.topbar{padding:0 10px}.board-toolbar{height:auto;min-height:59px;flex-wrap:wrap;padding:7px}.tool-group{flex-wrap:wrap}.tool{min-width:42px}.top-actions .quiet-btn{padding:7px;font-size:10px}}
@media(max-width:900px){#app{grid-template-columns:200px minmax(0,1fr)}.inspector{width:265px;flex-basis:265px}.board-toolbar .tool small{display:none}.small-icon,.icon-btn,.tool{min-width:38px;min-height:38px}.grid-choice select{min-width:66px}.side-action{min-height:40px}.modal{max-width:95vw!important}}
@media(max-width:640px){.topbar{height:auto;min-height:62px;padding:7px;flex-wrap:wrap}.crumb{max-width:100%;gap:6px}.top-actions{flex-wrap:wrap;max-width:100%}#app{grid-template-columns:minmax(0,1fr)}.sidebar{display:none}.inspector{flex-basis:240px}.filter-bar select{width:100%}}
/* Ensure all controls retain readable contrast if an older cached stylesheet loads last. */
html[data-theme="dark"] .quiet-btn,
html[data-theme="dark"] .outline-btn,
html[data-theme="dark"] .small-btn,
html[data-theme="dark"] .small-icon,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .canvas-overlay button,
html[data-theme="dark"] .filter-bar button,
html[data-theme="dark"] .palette-item {
  background:#203448!important;color:#e8f4ff!important;border-color:#4b647a!important;
}
html[data-theme="dark"] .project-item.active,
html[data-theme="dark"] .floor-item.active {
  background:#1d4961!important;color:#f1faff!important;border-color:#5390b3!important;
}
html[data-theme="dark"] .tool.active{background:#16435b!important;color:#a0ebff!important;border-color:#529dc2!important}
html[data-theme="dark"] #plan .svg-room-name{fill:#ecf7ff!important}
html[data-theme="dark"] #plan .svg-room-dim{fill:#cee2f2!important}
html[data-theme="dark"] #plan .svg-device-text{fill:#f1fbff!important}
html[data-theme="dark"] .user-chip{background:#203448;color:#f4faff;border-color:#516a80}
html[data-theme="dark"] button,
html[data-theme="dark"] select{appearance:none;-webkit-appearance:none}
html[data-theme="dark"] select{appearance:auto;-webkit-appearance:menulist}
html[data-theme="dark"] .quiet-btn,
html[data-theme="dark"] .outline-btn,
html[data-theme="dark"] .small-btn,
html[data-theme="dark"] .small-icon,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .canvas-overlay button,
html[data-theme="dark"] .filter-bar button {
  background-image:linear-gradient(#203448,#203448)!important;
}

/* v1.6 StageBase bridge */
.stagebase-status{border:1px solid var(--line,#ced8e3);padding:10px 12px;margin:12px 0;border-radius:8px;font-size:12px;font-weight:600;line-height:1.5;color:var(--text,#243447);background:var(--surface,#f4f8fd)}
.stagebase-meta{margin:12px 0;line-height:1.7}#pick-reload{white-space:nowrap}.library-search-results{max-height:53vh;overflow:auto}
