/* Shared stock-workspace foundations. Semantic colours remain owned by the
   existing palette/device layers; these components introduce no new theme. */
:root {
  --bb-space-1:4px; --bb-space-2:8px; --bb-space-3:12px;
  --bb-space-4:16px; --bb-space-6:24px; --bb-space-8:32px;
  --bb-panel-radius:3px; --bb-stat-radius:2px; --bb-action-radius:9px;
}
.bb-touch { --bb-panel-radius:12px; }
.bb-panel,.bb-review {
  padding:var(--bb-space-6); border:1px solid var(--line);
  border-radius:var(--bb-panel-radius); background:var(--surface); min-width:0;
}
.bb-panel h2,.bb-review h2 { margin-top:0; }
.bb-action-group { display:flex; align-items:start; flex-wrap:wrap; gap:var(--bb-space-2); margin-bottom:var(--bb-space-4); }
.bb-action-disclosure { flex:1 1 240px; min-width:0; }
.bb-action-disclosure>summary {
  cursor:pointer; min-height:44px; padding:10px 12px;
  border:1px solid var(--border,var(--line)); border-radius:var(--bb-action-radius);
  background:var(--raised); color:var(--text); overflow-wrap:anywhere;
}
.bb-action-disclosure>summary:focus-visible { outline:3px solid var(--focus,var(--accent)); outline-offset:3px; }
.bb-action-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr)); gap:var(--bb-space-2); padding:var(--bb-space-3) 0; }
.bb-action-list>button { white-space:normal; min-height:44px; overflow-wrap:anywhere; }
.bb-review dl { display:grid; grid-template-columns:minmax(90px,1fr) minmax(0,2fr); gap:var(--bb-space-3); }
.bb-review dd { margin:0; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.bb-status { display:inline-flex; gap:var(--bb-space-2); padding:4px 8px; border:1px solid var(--line); border-radius:var(--bb-stat-radius); }
.bb-empty { padding:var(--bb-space-8); text-align:center; color:var(--muted); }
/* Adopt the stock surface geometry without replacing established controls. */
html:not(.bb-touch) #area-app .panel,
html:not(.bb-touch) #cash-app .cash-panel,
html:not(.bb-touch) .vb-panel,
html:not(.bb-touch) .dashboard-panel { border-radius:var(--bb-panel-radius); }
.area-edit-actions>button { flex:0 1 auto; min-height:44px; }
@media(max-width:600px) {
  .bb-panel,.bb-review { padding:var(--bb-space-4); }
  .area-edit-actions { display:grid; grid-template-columns:minmax(0,1fr); }
  .bb-action-list { grid-template-columns:minmax(0,1fr); }
  .bb-action-list>button { justify-content:flex-start; text-align:left; }
}
@media(forced-colors:active) {
  .bb-panel,.bb-review,.bb-action-disclosure>summary { border-color:CanvasText; }
}

/* Editable fields need the control boundary token, not the faint panel divider.
   Scope to venue tools; leave ASCII and system high-contrast rendering intact. */
@media screen and (forced-colors:none) {
  html[data-bb-visual=control]:not([data-display-mode=ascii]) :is(#cash-app,#area-app) :is(input:not([type=checkbox]):not([type=radio]),select,textarea):enabled:not(:focus) {
    border-color:var(--border);
  }
}
