/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f0f2f5;
  color: #222;
}

/* ── Toolbar ── */
#toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #1c3d6e;
  color: #fff;
  height: 50px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

#toolbar h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

.tb-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.tb-spacer {
  flex: 1;
}

#modified-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5a623;
  flex-shrink: 0;
  display: none;
}

.tb-btn {
  padding: 6px 13px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}

#load-btn {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}
#load-btn:hover { background: rgba(255, 255, 255, .25); }

#download-btn {
  background: #2e9e4f;
  color: #fff;
}
#download-btn:hover { background: #27893f; }

#file-input { display: none; }

/* ── Search box ── */
#search-wrap {
  flex: 1;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 6px;
  padding: 0 10px;
  transition: background .15s, border-color .15s;
}
#search-wrap:focus-within {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .5);
}

#search-icon {
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  flex-shrink: 0;
  line-height: 1;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
  outline: none;
  font-family: inherit;
  min-width: 0;
}
#search-input::placeholder { color: rgba(255, 255, 255, .4); }

#search-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  line-height: 1;
  display: none;
  flex-shrink: 0;
}
#search-clear:hover { color: #fff; }

/* ── Layout ── */
#layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
  width: 290px;
  background: #fff;
  border-right: 1px solid #d8dde6;
  overflow-y: auto;
  flex-shrink: 0;
}

.tree-root { padding: 6px 0; }

/* ── Tree nodes ── */
.tree-node { user-select: none; }

.tl {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .1s;
}
.tl:hover { background: #f0f4ff; }
.tl.active {
  background: #e6edfc;
  border-left-color: #1c3d6e;
  color: #1c3d6e;
  font-weight: 600;
}

.tl .arrow {
  width: 14px;
  text-align: center;
  font-size: 10px;
  color: #888;
  flex-shrink: 0;
}
.tl .tlabel {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc { display: none; }
.tc.open { display: block; }

/* Level-specific indentation */
.lvl0 > .tl {
  font-weight: 700;
  font-size: 13px;
  color: #1c3d6e;
  background: #f7f8fa;
  border-bottom: 1px solid #eaecf0;
  padding: 7px 10px;
}
.lvl0 > .tl .arrow { font-size: 11px; color: #1c3d6e; }
.lvl1 > .tl { padding-left: 22px; }
.lvl2 > .tl { padding-left: 38px; }
.lvl3 > .tl { padding-left: 54px; font-size: 12.5px; }

/* ── Content area ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

#content-inner { max-width: 860px; }

.view-title {
  font-size: 19px;
  font-weight: 700;
  color: #1c3d6e;
  margin-bottom: 3px;
}
.view-sub {
  font-size: 13px;
  color: #666;
  margin-bottom: 26px;
}

/* ── Question blocks ── */
.qblock {
  margin-bottom: 24px;
  scroll-margin-top: 16px;
}

.qlabel {
  font-size: 12px;
  font-weight: 600;
  color: #1c3d6e;
  line-height: 1.5;
  margin-bottom: 6px;
}

.company-sep {
  height: 1px;
  background: #e2e6ed;
  margin: 22px 0;
}

.company-hdr {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  padding-left: 9px;
  border-left: 3px solid #1c3d6e;
}

/* ── Textarea ── */
.fta {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  color: #222;
  transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.fta:focus {
  outline: none;
  border-color: #1c3d6e;
  box-shadow: 0 0 0 3px rgba(28, 61, 110, .1);
}

/* ── Table editor ── */
.tbl-wrap {
  overflow-x: auto;
  margin-top: 2px;
}

table.ft {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  min-width: 400px;
}

table.ft th {
  background: #1c3d6e;
  color: #fff;
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
}

table.ft td {
  border: 1px solid #dde2ea;
  padding: 1px;
}

table.ft tr:nth-child(even) td { background: #f7f9fc; }

table.ft input.ci {
  width: 100%;
  border: none;
  padding: 5px 7px;
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  color: #222;
}
table.ft input.ci:focus {
  outline: 1px solid #1c3d6e;
  background: #fff;
  border-radius: 2px;
}

table.ft td.del-col {
  width: 28px;
  text-align: center;
  vertical-align: middle;
}

.tbl-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 4px 11px;
  font-size: 12px;
  border: 1px solid #c8cdd6;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  font-family: inherit;
  transition: background .1s, border-color .1s, color .1s;
}
.btn-sm:hover {
  background: #f0f4ff;
  border-color: #1c3d6e;
  color: #1c3d6e;
}
.btn-sm.del { color: #888; }
.btn-sm.del:hover {
  background: #fff5f5;
  border-color: #c00;
  color: #c00;
}

/* ── Summary block ── */
.sum-block {
  border-top: 2px solid #e2e6ed;
  padding-top: 18px;
  margin-top: 8px;
}

.sum-label {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

.sub-label {
  font-size: 11.5px;
  color: #888;
  margin: 10px 0 4px;
}

/* ── Placeholder ── */
.ph {
  color: #aaa;
  font-style: italic;
  padding: 48px 0;
  text-align: center;
  font-size: 15px;
}
.ph strong {
  color: #888;
  font-style: normal;
}

/* ── Search results ── */
.sr-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}
.sr-count {
  font-size: 16px;
  font-weight: 700;
  color: #1c3d6e;
}
.sr-meta {
  font-size: 12.5px;
  color: #888;
}
.sr-hint {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 20px;
}
.sr-hint code {
  font-family: inherit;
  background: #eee;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11.5px;
  color: #555;
}

/* Result card */
.rc {
  background: #fff;
  border: 1px solid #dde2ea;
  border-radius: 7px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.rc:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }

.rc-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 13px;
  background: #f7f9fc;
  border-bottom: 1px solid #eaecf0;
}

.rc-crumbs {
  flex: 1;
  font-size: 12.5px;
  color: #555;
  line-height: 1.55;
  min-width: 0;
}
.rc-crumbs .co { color: #1c3d6e; font-weight: 600; }
.rc-crumbs .sep { color: #bbb; margin: 0 4px; font-size: 11px; }
.rc-crumbs .rc-qlabel { color: #333; }

.rc-score {
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  gap: 3px;
  align-items: center;
}
.rc-score .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0d9e8;
}
.rc-score .dot.on { background: #1c3d6e; }

.rc-nav {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 11.5px;
  color: #1c3d6e;
  cursor: pointer;
  border: 1px solid #b8cde8;
  border-radius: 4px;
  padding: 3px 9px;
  background: #fff;
  font-family: inherit;
  white-space: nowrap;
  transition: background .1s, border-color .1s;
}
.rc-nav:hover {
  background: #e6edfc;
  border-color: #1c3d6e;
}

.rc-body { padding: 10px 13px 9px; }

.rc-frag {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.rc-full {
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  white-space: pre-wrap;
  word-break: break-word;
  display: none;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #dde2ea;
}
.rc-full.open { display: block; }

.rc-toggle {
  margin-top: 7px;
  font-size: 12px;
  color: #1c3d6e;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  opacity: .8;
}
.rc-toggle:hover { opacity: 1; text-decoration: underline; }

mark {
  background: #fff176;
  padding: 0 1px;
  border-radius: 2px;
}

.no-results {
  color: #aaa;
  font-style: italic;
  text-align: center;
  padding: 48px 0;
  font-size: 15px;
}

/* Flash animation when navigating from a search result */
@keyframes flash {
  0%   { background: #fff3a3; }
  100% { background: transparent; }
}
.qblock.flash { animation: flash 1.4s ease-out; }

/* ── Scrollbars ── */
#sidebar::-webkit-scrollbar,
#content::-webkit-scrollbar  { width: 6px; }

#sidebar::-webkit-scrollbar-thumb,
#content::-webkit-scrollbar-thumb  { background: #ccc; border-radius: 3px; }

/* ── Tab bar ── */
#tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #d8dde6;
  padding: 0 14px;
  flex-shrink: 0;
}

.tab-btn {
  padding: 9px 18px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  font-family: inherit;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: #1c3d6e; }
.tab-btn.active {
  color: #1c3d6e;
  border-bottom-color: #1c3d6e;
  font-weight: 600;
}

/* ── Connections pane ── */
#connections-pane {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conn-grid {
  display: grid;
  grid-template-columns: 1fr 240px 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "bc  esd  cm"
    "da  ctr  ea";
  gap: 14px;
  flex: 1;
  min-height: 0;
}

/* Domain box positions */
#conn-box-BC  { grid-area: bc;  }
#conn-box-ESD { grid-area: esd; }
#conn-box-CM  { grid-area: cm;  }
#conn-box-DA  { grid-area: da;  }
#conn-box-EA  { grid-area: ea;  }
#conn-center  { grid-area: ctr; }

/* Domain box */
.domain-box {
  background: #fff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.domain-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: #1c3d6e;
  padding: 7px 12px;
  flex-shrink: 0;
  letter-spacing: .3px;
}

.conn-company-list {
  overflow-y: auto;
  padding: 6px 8px;
  flex: 1;
}
.conn-company-list::-webkit-scrollbar { width: 4px; }
.conn-company-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.conn-empty {
  color: #ccc;
  font-style: italic;
  font-size: 12px;
  padding: 4px 2px;
}

/* Company checkbox rows */
.conn-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px;
  border-radius: 4px;
}
.conn-row:hover { background: #f0f4ff; }

.conn-row input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #1c3d6e;
}
.conn-row input[type="checkbox"]:disabled { opacity: .4; }

.conn-lbl {
  font-size: 12.5px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  user-select: none;
}
.conn-lbl--checked {
  font-weight: 600;
  color: #1c3d6e;
  cursor: pointer;
  text-decoration: underline dotted;
}
.conn-lbl--checked:hover { text-decoration: underline; }

/* Center panel */
#conn-center {
  background: linear-gradient(160deg, #eef2fc 0%, #e6edfa 100%);
  border: 2px solid #1c3d6e;
  border-radius: 10px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-shadow: 0 4px 18px rgba(28, 61, 110, .13);
}

.conn-center-title {
  font-size: 15px;
  font-weight: 800;
  color: #1c3d6e;
  text-align: center;
  letter-spacing: .1px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(28, 61, 110, .18);
}

.conn-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conn-field label {
  font-size: 11px;
  font-weight: 700;
  color: #3a5a96;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.conn-field select,
.conn-field input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #a8bee0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.conn-field select:focus,
.conn-field input[type="text"]:focus {
  outline: none;
  border-color: #1c3d6e;
  box-shadow: 0 0 0 3px rgba(28, 61, 110, .15);
}

.conn-hint {
  font-size: 11.5px;
  color: #aaa;
  text-align: center;
  line-height: 1.6;
  margin-top: auto;
}

/* "View connections" button — now inside .co-nav-bar, margin handled by the bar */
.conn-open-btn {
  color: #1c3d6e;
}

/* ── Connections mode toggle ── */
.conn-mode-bar {
  display: flex;
  gap: 0;
  padding: 10px 16px 0;
  border-bottom: 1px solid #d8dde6;
  flex-shrink: 0;
}

.conn-mode-btn {
  padding: 6px 18px;
  border: 1px solid #d8dde6;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: #f0f2f5;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  font-family: inherit;
  position: relative;
  bottom: -1px;
  transition: background .12s, color .12s;
}
.conn-mode-btn + .conn-mode-btn { margin-left: 4px; }
.conn-mode-btn:hover { background: #e4e8f0; color: #1c3d6e; }
.conn-mode-btn--active {
  background: #fff;
  color: #1c3d6e;
  font-weight: 600;
  border-bottom-color: #fff;
}

/* Editor pane wrapper — inherits the grid inside */
#conn-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
}

/* ── Visual pane ── */
#conn-visual-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#conn-type-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #d8dde6;
  flex-shrink: 0;
}

.conn-filter-btn {
  padding: 4px 13px;
  border-radius: 14px;
  border: 1.5px solid #d8dde6;
  background: #f0f2f5;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: #999;
  transition: opacity .15s, border-color .15s, color .15s;
}
.conn-filter-btn--active {
  border-color: #1c3d6e;
  color: #1c3d6e;
  background: #eef2fc;
  font-weight: 600;
}

#conn-graph-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#conn-cy {
  flex: 1;
  min-height: 0;
}

#conn-legend {
  width: 210px;
  flex-shrink: 0;
  padding: 14px 12px;
  border-left: 1px solid #d8dde6;
  overflow-y: auto;
  background: #fafbfd;
}

.conn-legend-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #888;
  margin-bottom: 10px;
}

.conn-legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: #333;
  line-height: 1.3;
}

.conn-legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Edge hover tooltip (fixed position, follows cursor) */
.conn-tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid #d8dde6;
  border-radius: 5px;
  padding: 7px 11px;
  font-size: 12.5px;
  font-family: system-ui, -apple-system, sans-serif;
  color: #222;
  pointer-events: none;
  z-index: 9999;
  display: none;
  max-width: 240px;
  line-height: 1.5;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.conn-tooltip strong { color: #1c3d6e; }

/* ── Customers pane ── */
#customers-pane {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Table mode */
#cust-table-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  gap: 12px;
}

#cust-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

#cust-search {
  flex: 1;
  min-width: 180px;
  max-width: 340px;
  padding: 7px 12px;
  border: 1.5px solid #d8dde6;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .15s;
}
#cust-search:focus {
  outline: none;
  border-color: #1c3d6e;
  box-shadow: 0 0 0 3px rgba(28,61,110,.1);
}

#cust-sort-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cust-sort-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.cust-sort-btn {
  padding: 5px 13px;
  border-radius: 14px;
  border: 1.5px solid #d8dde6;
  background: #f0f2f5;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: #666;
  transition: border-color .12s, color .12s, background .12s;
}
.cust-sort-btn:hover { background: #e4e8f0; color: #1c3d6e; }
.cust-sort-btn--active {
  border-color: #1c3d6e;
  color: #1c3d6e;
  background: #eef2fc;
  font-weight: 600;
}

#cust-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #fff;
}
#cust-table-wrap::-webkit-scrollbar { width: 5px; }
#cust-table-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

#cust-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#cust-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

#cust-table th {
  background: #1c3d6e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  letter-spacing: .3px;
}

.cust-th-desired { width: 38%; }
.cust-th-name    { width: 24%; }
.cust-th-current { width: 38%; }

.cust-td-desired,
.cust-td-current {
  padding: 8px 14px;
  vertical-align: top;
  border-bottom: 1px solid #edf0f5;
}

.cust-td-name {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a2e;
  vertical-align: middle;
  border-bottom: 1px solid #edf0f5;
  border-left: 2px solid #1c3d6e;
  border-right: 2px solid #1c3d6e;
  background: #fafbfd;
}

#cust-table tbody tr:hover .cust-td-desired,
#cust-table tbody tr:hover .cust-td-name,
#cust-table tbody tr:hover .cust-td-current {
  background: #f0f4ff;
}

.cust-co-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px 3px;
  cursor: default;
  white-space: nowrap;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.cust-co-pill--desired {
  background: #e3f0ff;
  color: #1565c0;
  border: 1px solid #90caf9;
}
.cust-co-pill--current {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.cust-co-pill[title]:hover { text-decoration: underline dotted; }

.cust-empty-row {
  text-align: center;
  padding: 30px;
  color: #aaa;
  font-style: italic;
  font-size: 13px;
}

/* Visual mode */
#cust-visual-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#cust-vis-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #d8dde6;
  flex-shrink: 0;
}

.cust-filter-btn {
  padding: 5px 18px;
  border-radius: 14px;
  border: 2px solid #d8dde6;
  background: #f0f2f5;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: #999;
  transition: border-color .12s, color .12s, background .12s;
}
.cust-filter-btn:hover { background: #e4e8f0; }

.cust-filter-btn[data-status="both"].cust-filter-btn--active {
  border-color: #1c3d6e;
  color: #1c3d6e;
  background: #eef2fc;
  font-weight: 700;
}
.cust-filter-btn[data-status="current"].cust-filter-btn--active {
  border-color: #43a047;
  color: #2e7d32;
  background: #e8f5e9;
  font-weight: 700;
}
.cust-filter-btn[data-status="desired"].cust-filter-btn--active {
  border-color: #1e88e5;
  color: #1565c0;
  background: #e3f0ff;
  font-weight: 700;
}

#cust-graph-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#cust-cy {
  flex: 1;
  min-height: 0;
}

#cust-legend {
  width: 210px;
  flex-shrink: 0;
  padding: 14px 12px;
  border-left: 1px solid #d8dde6;
  overflow-y: auto;
  background: #fafbfd;
}

.cust-legend-sep {
  border-top: 1px solid #e8eaf0;
  margin: 10px 0;
}

.cust-legend-edge-swatch {
  height: 3px !important;
  border-radius: 2px !important;
  margin-top: 5px;
  align-self: center;
}

.cust-legend-node-swatch {
  border: 2px solid;
  border-radius: 3px !important;
}

/* ── Company overview blocks (sectors + customers) ── */
.co-block {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #e2e6ed;
}

.co-section-hdr {
  font-size: 13px;
  font-weight: 700;
  color: #1c3d6e;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

/* Sector rows */
.sector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.sector-cb {
  flex-shrink: 0;
  accent-color: #1c3d6e;
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.sector-name {
  font-size: 13px;
  min-width: 130px;
  color: #999;
  cursor: pointer;
  user-select: none;
}
.sector-row--on .sector-name {
  font-weight: 600;
  color: #1c3d6e;
}

.sector-comment-inp {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12.5px;
  color: #444;
  transition: border-color .15s;
}
.sector-comment-inp:focus {
  outline: none;
  border-color: #1c3d6e;
}
.sector-comment-inp::placeholder { color: #bbb; }

.sector-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.sector-add-inp {
  padding: 5px 9px;
  border: 1px dashed #c8cdd6;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12.5px;
  color: #444;
  width: 160px;
  transition: border-color .15s;
}
.sector-add-inp:focus {
  outline: none;
  border-color: #1c3d6e;
  border-style: solid;
}
.sector-add-inp::placeholder { color: #bbb; }

/* Customer rows */
.customer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.customer-name-wrap {
  flex: 2;
  min-width: 0;
  position: relative;
}

.customer-name-inp {
  width: 100%;
}

/* Autocomplete dropdown */
.ac-list {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #1c3d6e;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(28, 61, 110, .15);
  max-height: 180px;
  overflow-y: auto;
  z-index: 200;
}

.ac-item {
  padding: 6px 10px;
  font-size: 13px;
  color: #222;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item:hover {
  background: #e6edfc;
  color: #1c3d6e;
}

.customer-status {
  flex-shrink: 0;
  width: 100px;
  padding: 5px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12.5px;
  color: #444;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
}
.customer-status:focus {
  outline: none;
  border-color: #1c3d6e;
}

/* Status colour variants */
.status--current {
  border-color: #2e9e4f;
  color: #1a7a3e;
  background: #f3fbf6;
}
.status--desired {
  border-color: #d4930a;
  color: #7a4e00;
  background: #fffbf0;
}

.customer-comment-inp {
  flex: 3;
  min-width: 0;
}

.co-add-btn {
  margin-top: 8px;
}

/* ── Comment popup ── */
.comment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.comment-box {
  background: #fff;
  border-radius: 8px;
  padding: 22px 20px 18px;
  width: 380px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
}

.comment-box-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}
.comment-box-co { font-weight: 700; color: #1c3d6e; }
.comment-box-arrow { color: #aaa; }
.comment-box-type {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.comment-ta { min-height: 90px; }

.comment-box-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Company overview nav bar ── */
.co-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

/* ── Legislation & Standards block ── */
.co-leg-loading {
  color: #bbb;
  font-style: italic;
  font-size: 12px;
  padding: 4px 0;
}

.co-leg-empty {
  color: #aaa;
  font-style: italic;
  font-size: 12.5px;
  padding: 4px 0;
}

.leg-card {
  background: #fff;
  border: 1px solid #d8dde6;
  border-radius: 7px;
  margin-bottom: 12px;
  overflow: hidden;
}

.leg-card-hdr {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid #eaecf0;
}

.leg-type-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  background: #e3eeff;
  color: #1c3d6e;
  border: 1px solid #b8cde8;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.6;
}

.leg-reg-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a1a2e;
}

.leg-reg-name--link {
  cursor: pointer;
  color: #1c3d6e;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  transition: color .12s;
}
.leg-reg-name--link:hover {
  color: #2a5aaa;
  text-decoration: underline;
}

.leg-q-block {
  padding: 9px 14px;
  border-bottom: 1px solid #f0f2f5;
}
.leg-q-block:last-child { border-bottom: none; }

.leg-q-block--nav {
  cursor: pointer;
  transition: background .12s;
}
.leg-q-block--nav:hover { background: #f0f4ff; }

.leg-q-hdr {
  font-size: 12px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.leg-q-key {
  font-weight: 700;
  color: #1c3d6e;
}

.leg-q-text { color: #555; }

.leg-q-nav-hint {
  color: #1c3d6e;
  font-weight: 600;
  opacity: 0;
  transition: opacity .12s;
}
.leg-q-block--nav:hover .leg-q-nav-hint { opacity: 1; }

.leg-snippet {
  font-size: 12.5px;
  color: #444;
  line-height: 1.6;
  background: #fafbfd;
  border-left: 3px solid #b8cde8;
  padding: 5px 10px;
  border-radius: 0 4px 4px 0;
  margin: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Regelgeving modal ─────────────────────────────────────────────────────── */

.rg-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.rg-modal[hidden] { display: none; }

.rg-dialog {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.rg-dialog-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid #e4e8ef;
  flex-shrink: 0;
  position: relative;
}

.rg-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 5px;
  font-family: inherit;
  transition: color .12s, background .12s;
}
.rg-close:hover { color: #333; background: #f0f0f0; }

.rg-header-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 36px;
}

.rg-name {
  font-size: 19px;
  font-weight: 700;
  color: #1c3d6e;
  line-height: 1.3;
}

.rg-abbr {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  background: #e6edfc;
  color: #1c3d6e;
  border-radius: 5px;
  padding: 2px 9px;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.rg-chip {
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 11px;
  white-space: nowrap;
}

/* Type chips */
.rg-chip--type-verordening   { background: #1c3d6e; color: #fff; }
.rg-chip--type-richtlijn     { background: #3a5a96; color: #fff; }
.rg-chip--type-wet           { background: #2e4b85; color: #fff; }
.rg-chip--type-norm          { background: #00796b; color: #fff; }
.rg-chip--type-standaard     { background: #00796b; color: #fff; }
.rg-chip--type-kader         { background: #5e35b1; color: #fff; }
.rg-chip--type-certificering { background: #e65100; color: #fff; }
.rg-chip--type-default       { background: #555;    color: #fff; }

/* Status chips */
.rg-chip--status-van-kracht       { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.rg-chip--status-overgangsperiode { background: #fff8e1; color: #e65100; border: 1px solid #ffcc80; }
.rg-chip--status-in-ontwikkeling  { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.rg-chip--status-gepubliceerd     { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.rg-chip--status-default          { background: #f0f2f5; color: #555;    border: 1px solid #ccc; }

/* Scope chips */
.rg-chip--scope { background: #f0f4ff; color: #444; border: 1px solid #c8d6ef; }

.rg-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.rg-tag {
  font-size: 11.5px;
  background: #f0f2f5;
  color: #555;
  border-radius: 4px;
  padding: 2px 8px;
  border: 1px solid #d8dde6;
}

/* ── Body ── */
.rg-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rg-dialog-body::-webkit-scrollbar { width: 6px; }
.rg-dialog-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.rg-description {
  font-size: 13.5px;
  line-height: 1.75;
  color: #333;
}

.rg-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
}

/* ── Meta grid ── */
.rg-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  background: #f7f9fc;
  border: 1px solid #e4e8ef;
  border-radius: 8px;
  padding: 16px 20px;
}

.rg-meta-item--full { grid-column: 1 / -1; }

.rg-meta-key {
  font-size: 10.5px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

.rg-meta-val {
  font-size: 13px;
  color: #222;
  line-height: 1.5;
}

.rg-meta-val--list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rg-meta-pill {
  font-size: 11.5px;
  background: #eef2f8;
  color: #3a5a96;
  border-radius: 4px;
  padding: 2px 8px;
  border: 1px solid #c8d6ef;
}

.rg-meta-date { font-weight: 500; }
.rg-meta-date--none { color: #bbb; font-style: italic; }

/* ── Applicability cards ── */
.rg-apply-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rg-apply-card {
  border: 1px solid #e4e8ef;
  border-radius: 8px;
  overflow: hidden;
}

.rg-apply-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid #e4e8ef;
}

.rg-apply-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex: 1;
}

.rg-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.rg-badge--yes { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.rg-badge--no  { background: #f5f5f5; color: #888;    border: 1px solid #d0d5dd; }

.rg-apply-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rg-apply-toelichting {
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}

.rg-apply-diensten {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rg-dienst-pill {
  font-size: 11.5px;
  background: #e6edfc;
  color: #1c3d6e;
  border-radius: 4px;
  padding: 2px 8px;
  border: 1px solid #b8cde8;
  font-weight: 500;
}

/* ── Related ── */
.rg-related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rg-related-chip {
  font-size: 12px;
  background: #fff;
  border: 1.5px solid #b8cde8;
  color: #1c3d6e;
  border-radius: 20px;
  padding: 4px 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background .12s, border-color .12s;
}
.rg-related-chip:hover { background: #e6edfc; border-color: #1c3d6e; }

/* ── Notes ── */
.rg-notes-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #8a7000;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

.rg-notes {
  background: #fffbef;
  border: 1px solid #ffe49c;
  border-left: 3px solid #f5a623;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: #5a4a00;
  line-height: 1.65;
}

/* ── Footer ── */
.rg-dialog-footer {
  padding: 12px 24px;
  border-top: 1px solid #e4e8ef;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafbfc;
}

.rg-official-link {
  font-size: 13px;
  color: #1c3d6e;
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration .1s;
}
.rg-official-link:hover { text-decoration: underline; }

.rg-close-btn {
  padding: 6px 18px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: #555;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.rg-close-btn:hover { background: #f0f4ff; border-color: #1c3d6e; color: #1c3d6e; }

/* ── Legislation & Standards tab ───────────────────────────────────────────── */

#legislation-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leg-tab-loading {
  padding: 48px;
  text-align: center;
  color: #aaa;
  font-style: italic;
}

/* Toolbar */
.leg-tab-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid #d8dde6;
  flex-shrink: 0;
}

.leg-tab-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f2f5;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 0 10px;
  flex: 1;
  max-width: 520px;
  transition: border-color .15s, background .15s;
}
.leg-tab-filter-wrap:focus-within {
  background: #fff;
  border-color: #1c3d6e;
  box-shadow: 0 0 0 3px rgba(28, 61, 110, .08);
}

.leg-tab-filter-icon {
  font-size: 13px;
  color: #888;
  flex-shrink: 0;
}

.leg-tab-filter {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: #222;
  padding: 7px 0;
  outline: none;
  min-width: 0;
}

.leg-tab-filter-clear {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color .12s;
}
.leg-tab-filter-clear:hover { color: #555; }

.leg-tab-count {
  font-size: 12.5px;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Table wrap */
.leg-tab-wrap {
  flex: 1;
  overflow: auto;
}
.leg-tab-wrap::-webkit-scrollbar       { width: 6px; height: 6px; }
.leg-tab-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Table */
.leg-tab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leg-tab-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.leg-tab-table th {
  background: #1c3d6e;
  color: #fff;
  padding: 9px 13px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.leg-tab-table th:hover    { background: #24508f; }
.leg-tab-table th.leg-th--sorted { background: #2a5aaa; }

.leg-sort-ind {
  font-size: 11px;
  margin-left: 4px;
  opacity: .85;
}

/* Column widths */
.leg-col-abbr { width: 120px; min-width: 80px; }
.leg-col-naam { min-width: 200px; }
.leg-col-type { width: 130px; min-width: 110px; }
.leg-col-inst { width: 220px; min-width: 160px; }
.leg-col-cos  { min-width: 200px; }

/* Rows */
.leg-tab-table tbody tr {
  border-bottom: 1px solid #eaecf0;
  transition: background .1s;
}
.leg-tab-table tbody tr:hover { background: #f5f7fc; }
.leg-tab-table tbody tr:last-child { border-bottom: none; }

.leg-tab-table td {
  padding: 8px 13px;
  vertical-align: middle;
  color: #222;
  line-height: 1.45;
}

/* Clickable name / abbreviation */
.leg-tab-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: #1c3d6e;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  transition: color .12s;
}
.leg-tab-link:hover { color: #2a5aaa; text-decoration: underline; }

.leg-tab-link--naam { font-weight: 500; }

/* Type chip — reuses rg-chip color classes from the modal */
.leg-tab-type-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 600;
}

/* Company pills */
.leg-co-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.leg-co-pill {
  display: inline-block;
  font-size: 11.5px;
  background: #eef2f8;
  color: #3a5a96;
  border: 1px solid #c8d6ef;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.leg-co-pill:hover {
  background: #e6edfc;
  border-color: #1c3d6e;
  color: #1c3d6e;
}

.leg-none { color: #ccc; font-style: italic; }

/* ── Propositions Tab ──────────────────────────────────────────────────────── */

#propositions-pane {
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 32px;
  gap: 20px;
  min-height: 0;
}

.prop-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1c3d6e;
  padding-bottom: 8px;
  border-bottom: 2px solid #d0d8e8;
  margin-top: 8px;
}

/* Legend */
.prop-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 6px;
  font-size: 12px;
}

.prop-legend-years {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
}

.prop-legend-bar {
  display: inline-block;
  width: 20px;
  height: 10px;
  border-radius: 2px;
}

.prop-legend-bar--25 { background: #666; }
.prop-legend-bar--29 { background: #bbb; }

.prop-legend-sep {
  width: 1px;
  height: 18px;
  background: #dde3ee;
  align-self: center;
  flex-shrink: 0;
}

.prop-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #444;
  white-space: nowrap;
}

.prop-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.prop-legend-swatch--faded {
  opacity: .65;
}

/* Chart */
.prop-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prop-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prop-company-name--nav {
  cursor: pointer;
}
.prop-company-name--nav:hover {
  text-decoration: underline;
  color: #1565c0;
}

.prop-company-name {
  width: 190px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #1c3d6e;
  text-align: right;
  padding-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prop-bars-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prop-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prop-bar-year {
  font-size: 10.5px;
  font-weight: 700;
  color: #999;
  width: 30px;
  flex-shrink: 0;
  text-align: right;
  letter-spacing: .3px;
}

.prop-bar {
  flex: 1;
  height: 24px;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
}

.prop-seg {
  height: 100%;
  flex-shrink: 0;
  transition: filter .1s;
  cursor: default;
}

.prop-seg:hover {
  filter: brightness(.85);
}

/* Tooltip */
.prop-tooltip {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #c8d0e0;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 12.5px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .15);
  pointer-events: none;
  max-width: 300px;
  display: none;
  line-height: 1.5;
}

.prop-tooltip--visible {
  display: block;
}

.prop-tip-head {
  font-weight: 700;
  color: #1c3d6e;
  margin-bottom: 2px;
}

.prop-tip-total {
  font-size: 11.5px;
  color: #888;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.prop-tip-row {
  color: #333;
  padding: 1px 0;
}

/* New propositions */
.prop-new-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prop-new-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 6px;
}

.prop-new-company {
  width: 190px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #1c3d6e;
  padding-top: 1px;
}

.prop-new-content {
  flex: 1;
  min-width: 0;
}

.prop-new-text {
  font-size: 13px;
  color: #333;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prop-new-list {
  list-style: disc;
  padding-left: 18px;
  font-size: 13px;
  color: #333;
  line-height: 1.65;
}

/* ── Sectors Tab ─────────────────────────────────────────────────────────────── */

#sectors-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sect-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid #d8dde6;
  flex-shrink: 0;
}

.sect-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f2f5;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 0 10px;
  flex: 1;
  max-width: 480px;
  transition: border-color .15s, background .15s;
}
.sect-filter-wrap:focus-within {
  background: #fff;
  border-color: #1c3d6e;
  box-shadow: 0 0 0 3px rgba(28, 61, 110, .08);
}

.sect-filter-icon {
  font-size: 13px;
  color: #888;
  flex-shrink: 0;
}

.sect-filter {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: #222;
  padding: 7px 0;
  outline: none;
  min-width: 0;
}

.sect-filter-clear {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color .12s;
}
.sect-filter-clear:hover { color: #555; }

.sect-count {
  font-size: 12.5px;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.sect-wrap {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.sect-wrap::-webkit-scrollbar       { width: 6px; height: 6px; }
.sect-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.sect-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sect-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1c3d6e;
  color: #fff;
}

.sect-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
  white-space: nowrap;
  user-select: none;
}

.sect-col-sector { width: 22%; min-width: 140px; }
.sect-col-cos    { width: 78%; }

.sect-table tbody tr {
  border-bottom: 1px solid #edf0f5;
}
.sect-table tbody tr:hover { background: #f5f7fc; }
.sect-table tbody tr:last-child { border-bottom: none; }

.sect-table td {
  padding: 8px 16px;
  vertical-align: middle;
  color: #222;
}

.sect-col-sector td,
td.sect-col-sector {
  font-weight: 500;
  color: #1c3d6e;
}

.sect-co-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sect-co-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid #a0b4d6;
  background: #eef2fa;
  color: #1c3d6e;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.sect-co-pill:hover {
  background: #1c3d6e;
  border-color: #1c3d6e;
  color: #fff;
}
.sect-co-pill[title]:hover { text-decoration: none; }

.sect-none {
  color: #bbb;
  font-style: italic;
}

.sect-empty-row {
  padding: 32px 16px;
  text-align: center;
  color: #aaa;
  font-style: italic;
}

/* ── Trends tab ──────────────────────────────────────────────────────────────── */

#trends-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.trends-loading {
  padding: 48px;
  text-align: center;
  color: #aaa;
  font-style: italic;
}

.trends-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #e0e4ec;
  background: #f8f9fc;
  flex-shrink: 0;
}

.trends-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eef0f6;
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 320px;
}
.trends-filter-wrap:focus-within {
  background: #fff;
  outline: 2px solid #2a5aaa;
  outline-offset: -1px;
}

.trends-filter-icon { font-size: 13px; color: #888; }

.trends-filter {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #222;
  min-width: 0;
}

.trends-filter-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.trends-filter-clear:hover { color: #555; }

.trends-count {
  font-size: 12.5px;
  color: #888;
  white-space: nowrap;
  margin-left: auto;
}

.trends-wrap {
  flex: 1;
  overflow: auto;
}
.trends-wrap::-webkit-scrollbar       { width: 6px; height: 6px; }
.trends-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.trends-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trends-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.trends-table th {
  background: #1c3d6e;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 13px;
  font-size: 12.5px;
  white-space: nowrap;
  user-select: none;
}
.trends-table th.trends-th--sortable { cursor: pointer; }
.trends-table th.trends-th--sortable:hover { background: #24508f; }
.trends-table th.trends-th--sorted { background: #2a5aaa; }

.trends-sort-ind { margin-left: 4px; opacity: 0.8; }

.tr-col-titel  { width: 20%; min-width: 160px; }
.tr-col-omschr { width: 37%; min-width: 200px; }
.tr-col-tags   { width: 18%; min-width: 120px; }
.tr-col-cos    { width: 25%; min-width: 140px; }

.trends-row { border-bottom: 1px solid #eaecf0; }
.trends-row:hover { background: #f5f7fc; }

.trends-detail-row { border-bottom: 1px solid #dde2ee; }

.trends-table td {
  padding: 8px 13px;
  vertical-align: top;
  line-height: 1.5;
}

/* Titel cell */
.tr-titel-wrap {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.tr-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 9px;
  padding: 3px 1px 0;
  flex-shrink: 0;
  line-height: 1;
}
.tr-expand-btn:hover { color: #1c3d6e; }

.tr-code {
  font-size: 11px;
  color: #aaa;
  font-family: monospace;
  flex-shrink: 0;
  padding-top: 1px;
}

.tr-titel-text {
  font-weight: 500;
  color: #1a2b45;
}

/* Omschrijving */
.tr-omschr-snippet { color: #444; line-height: 1.55; }

/* Tags */
.tr-tag-wrap { display: flex; flex-wrap: wrap; gap: 4px; }

.tr-tag-chip {
  display: inline-block;
  background: #eef2fb;
  color: #2a5aaa;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Company pills */
.tr-co-pills { display: flex; flex-wrap: wrap; gap: 5px; }

.tr-co-pill {
  display: inline-block;
  border: none;
  border-radius: 12px;
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.tr-co-pill--core { background: #1c3d6e; color: #fff; }
.tr-co-pill--core:hover { background: #2a5aaa; }
.tr-co-pill--secondary { background: #e8edf8; color: #1c3d6e; }
.tr-co-pill--secondary:hover { background: #d0d9f0; }

.tr-none { color: #bbb; font-style: italic; }

/* Expanded detail row */
.tr-detail-td {
  padding: 10px 16px 14px 44px;
  background: #f4f6fb;
  border-left: 3px solid #2a5aaa;
}

.tr-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2a5aaa;
  margin-bottom: 5px;
}

.tr-detail-text {
  color: #444;
  font-size: 13px;
  line-height: 1.55;
}

/* ── Tour overlay ──────────────────────────────────────────────────────────── */

/* Click-blocking backdrop; transparent unless target is null (full dim) */
#tour-bg {
  position: fixed;
  inset: 0;
  z-index: 8900;
  background: transparent;
}
#tour-bg.tour-bg--dim {
  background: rgba(0, 0, 0, .55);
}

/* Spotlight — box-shadow dims everything outside this element */
#tour-spot {
  position: fixed;
  z-index: 8950;
  border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .52);
  pointer-events: none;
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
}

/* Popup card */
#tour-pop {
  position: fixed;
  z-index: 9000;
  width: 380px;
  max-width: calc(100vw - 28px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .22);
  padding: 20px 22px 18px;
  transition: top .28s ease, left .28s ease;
}

.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tour-step-num {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.tour-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #bbb;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  font-family: inherit;
  transition: color .12s, background .12s;
}
.tour-close:hover { color: #444; background: #f0f2f5; }

.tour-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #1c3d6e;
  margin-bottom: 10px;
  line-height: 1.3;
}

.tour-body {
  font-size: 13.5px;
  color: #333;
  line-height: 1.68;
  margin-bottom: 18px;
}
.tour-body code {
  background: #f0f2f5;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 12px;
  color: #555;
}
.tour-body kbd {
  background: #e8ecf0;
  border: 1px solid #c8cdd6;
  border-radius: 3px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 12px;
  color: #333;
}
.tour-body strong { color: #1c3d6e; }
.tour-body em { color: #555; }

.tour-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-dots {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8dde6;
  flex-shrink: 0;
  transition: background .18s;
}
.tour-dot--on { background: #1c3d6e; }

.tour-btn {
  padding: 7px 15px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.tour-btn:disabled {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}
.tour-btn--ghost {
  background: #fff;
  border-color: #d0d5dd;
  color: #555;
}
.tour-btn--ghost:hover {
  background: #f0f4ff;
  border-color: #1c3d6e;
  color: #1c3d6e;
}
.tour-btn--primary {
  background: #1c3d6e;
  border-color: #1c3d6e;
  color: #fff;
}
.tour-btn--primary:hover { background: #163260; }

/* Tour trigger button in the toolbar */
#tour-launch-btn {
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
  border: 1.5px solid rgba(255, 255, 255, .22);
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
#tour-launch-btn:hover {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
}

/* Handleiding link in toolbar */
#help-btn {
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
  border: 1.5px solid rgba(255, 255, 255, .22);
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
#help-btn:hover {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
}
