/* Keep the BI workspace centered, with one shared edge for the editor header and cards. */
:root {
  --workspace-max-width:1600px;
  --workspace-gutter:32px;
}
.main { min-width:0; }
.page,
.editor-page {
  width:100%;
  max-width:var(--workspace-max-width);
  margin-inline:auto;
  padding-inline:var(--workspace-gutter);
  min-width:0;
}
.topbar {
  width:100%;
  max-width:var(--workspace-max-width);
  margin-inline:auto;
  padding-inline:var(--workspace-gutter);
}
.topbar .topbar-account {
  display:none;
  max-width:128px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.editor-page-head,
.editor-page-body {
  width:100%;
  max-width:none;
  min-width:0;
  margin-inline:0;
}
.editor-heading,
.page-heading>div:first-child { min-width:0; }
.page-heading h1,
.page-heading p,
.editor-heading p { overflow-wrap:anywhere; }
.editor-card,
.editor-card-content,
.editor-grid,
.editor-field-layout,
.editor-notes-grid,
.basic-grid,
.panel,
#view-content,
.bottom-grid>* { min-width:0; max-width:100%; }
.bottom-grid { grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); }
.table-wrap,
.editor-page .bi-preview-wrap {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.editor-page .bi-inputs>label { flex:0 1 176px; min-width:0; max-width:176px; }
.editor-page .bi-inputs>label:first-child { flex-basis:190px; max-width:190px; }
.editor-page .bi-result-actions { flex-wrap:wrap; min-width:0; }
.editor-page .bi-result-actions small { min-width:0; overflow-wrap:anywhere; }
.editor-page .bi-result-actions .btn { flex:none; }
.editor-card>summary { min-width:0; }
.editor-card>summary strong { min-width:0; overflow-wrap:anywhere; }
.editor-card>summary>span { min-width:0; }
.panel-footer,
.page-footer { overflow-wrap:anywhere; }

@media(max-width:1200px) {
  :root { --workspace-gutter:24px; }
}
@media(max-width:1100px) {
  .page-heading { flex-wrap:wrap; }
  .heading-actions { margin-left:auto; padding-top:0; }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:900px) {
  .topbar .topbar-account { display:inline-block; }
  .editor-page-head { flex-wrap:wrap; gap:16px; }
  .editor-page-actions { margin-left:auto; }
  .bottom-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:680px) {
  .editor-page .editor-section-heading { gap:6px 8px; }
  .editor-page .editor-linked-summary { font-size:10px; }
  .editor-heading { width:100%; }
  .editor-page-actions { width:100%; justify-content:flex-end; flex-wrap:wrap; }
  .editor-page .bi-inputs>label { flex-basis:100%; max-width:100%; }
  .editor-card>summary { flex-wrap:wrap; gap:8px; }
  .editor-card>summary>span { margin-left:0; max-width:none; text-align:left; }
  .editor-card>summary:after { margin-left:auto; }
}
@media(max-width:600px) {
  :root { --workspace-gutter:14px; }
  .compare-table-old .compare-product-info { grid-template-columns:minmax(0,1fr) 96px; }
  .compare-table-new .sticky-cell { width:268px; min-width:268px; max-width:268px; }
  .topbar { padding-inline:var(--workspace-gutter); }
  .editor-page-actions { gap:8px; }
  #toolbar .filter-controls { flex-wrap:wrap; }
  #toolbar .filter-selects { flex-basis:100%; }
  #toolbar .search-box { flex:1 1 150px; }
  #toolbar .filter-selects>select { flex:0 1 auto; min-width:0; }
}

/* A shared inset keeps every single-value selector's arrow clear of its edge. */
body select:not([multiple]):not([size]),
#toolbar .filter-selects>select,
#toolbar #owner-filter,
#toolbar #old-month-filter,
#toolbar #new-month-filter,
#toolbar #bi-group-filter,
#toolbar #operator-filter,
.task-history-filters select,
.editor-type-control select,
.editor-page .form-field select {
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2377807a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 27px center;
  background-size:12px;
  padding-right:49px;
}
.modal:has(>.identity-dialog) { width:min(460px,calc(100vw - 32px)); }
.identity-dialog .identity-account { display:flex; align-items:center; gap:12px; margin:24px 0 12px; }
.identity-avatar { display:grid; place-items:center; width:44px; height:44px; flex:none; background:#f1f3ef; border-radius:10px; color:#344136; font-size:14px; font-weight:600; }
.identity-account strong { display:block; color:#151b16; font-size:16px; font-weight:600; }
.identity-account>div { min-width:0; overflow-wrap:anywhere; }
.identity-account small { display:block; color:#848c85; font-size:12px; margin-top:4px; }
.identity-connected { margin-left:auto; color:#64825a; font-size:12px; white-space:nowrap; }
.identity-dialog .identity-caption { margin:12px 0 22px; color:#7f8780; font-size:12px; line-height:1.7; }
.identity-maintenance { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 16px; border:1px solid #e5e8e1; border-radius:8px; text-decoration:none; color:#2c352e; }
.identity-maintenance:hover { border-color:#b8c3b1; background:#fafbf8; }
.identity-maintenance strong { display:block; font-size:13px; font-weight:500; }
.identity-maintenance small { display:block; margin-top:5px; color:#8b928b; font-size:11px; }
.modal .identity-dialog .modal-buttons { display:flex; gap:10px; align-items:center; margin-top:24px; padding-top:20px; border-top:1px solid #edf0e9; }
.modal .identity-dialog .modal-buttons .btn { min-height:36px; border-radius:8px; padding:8px 16px; }
.identity-dialog .identity-logout { margin-right:auto; }
