#tab-lv {
  color-scheme: dark;
  min-width: 0;
}
#tab-lv :is(h2, h3, form, fieldset) { margin: 0; }
#tab-lv #level-page-title { margin: 0 0 14px; font-size: 23px; }
#tab-lv .level-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  border-bottom: 1px solid var(--border);
}
#tab-lv .level-nav button {
  min-height: 42px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#tab-lv .level-nav button[aria-selected="true"] {
  border-bottom-color: var(--green);
  color: var(--text);
}
#tab-lv .level-pane {
  min-width: 0;
  padding: 18px 0 0;
}
#tab-lv .level-pane[hidden] { display: none; }
#tab-lv .level-pane-title { margin-bottom: 8px; font-size: 16px; }
#tab-lv #team-level-settings .tbl-wrap { margin-top: 8px; }
#tab-lv .tbl-wrap { max-width: 100%; overflow-x: auto; }
#tab-lv #level-members > .tbl-wrap table { min-width: 1080px; }
#tab-lv :is(.level-disclosure, #team-business-settlement > details) {
  padding: 8px 0;
  margin: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}
#tab-lv :is(.level-disclosure, #team-business-settlement details) > summary {
  padding: 8px 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
#tab-lv #team-business-settlement fieldset {
  min-width: 0;
  margin: 10px 0;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
}
#tab-lv #team-business-settlement legend {
  padding: 0;
  font-weight: 600;
  color: var(--text);
}
#tab-lv .team-fee-fields { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: end; }
#tab-lv .team-fee-fields .field { margin: 0; max-width: 250px; flex: 1 1 145px; }
#tab-lv .team-fee-fields input[type="checkbox"] { accent-color: var(--green); }
#tab-lv :is(input:not([type="checkbox"]), select, textarea) {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg, #101010);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}
#tab-lv .team-level-table input { border-color: transparent; }
#tab-lv .team-level-table input:hover { border-color: var(--border); }
#tab-lv :is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
#tab-lv [role="status"]:empty { display: none; }
#tab-lv #team-level-settings .team-level-referral { padding: 6px 0; }
@media (max-width: 600px) {
  #tab-lv .level-nav { gap: 4px 12px; font-size: 13px; }
  #tab-lv #level-rules table { min-width: 640px; }
  #tab-lv .level-pane { padding-top: 14px; }
}

#tab-lv #team-business-settlement { margin-top: 24px; }
#tab-lv #team-business-settlement h4 { margin: 18px 0 8px; font-size: 14px; }
#tab-lv #team-business-settlement .desc { margin: 8px 0; }
#tab-lv .level-config-table { min-width: 510px; }
#tab-lv .level-config-table :is(th,td) { vertical-align: middle; }
#tab-lv .level-config-table input[type="number"] { width: 7em; }
#tab-lv .level-config-table input[type="checkbox"] { accent-color: var(--green); }
#tab-lv .level-range-control, #tab-lv .level-role-controls {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
}
#tab-lv .level-range-control small:empty { display: none; }
#tab-lv .level-config-table input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
}
#tab-lv .level-role-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#tab-lv .settlement-record-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card, var(--input-bg));
}
#tab-lv .settlement-record-list:has(> .settlement-record:not([hidden])) {
  display: block;
}
#tab-lv .settlement-record-list:not(:has(> .settlement-record:not([hidden]))) {
  display: none;
}
#tab-lv .settlement-record + .settlement-record {
  border-top: 1px solid var(--border);
}
#tab-lv .settlement-record > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 5px 14px;
  align-items: center;
  min-height: 66px;
  padding: 12px 16px;
  list-style: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
#tab-lv .settlement-record > summary::-webkit-details-marker { display: none; }
#tab-lv .settlement-record > summary::after {
  content: "";
  grid-area: 1 / 2 / 3 / 3;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
#tab-lv .settlement-record[open] > summary::after { transform: rotate(225deg); }
#tab-lv .settlement-record-title {
  grid-column: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
#tab-lv .settlement-record-description {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
#tab-lv .settlement-record-body {
  min-width: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
#tab-lv .settlement-record-body > .desc { margin: 0 0 10px; }
#tab-lv .settlement-record-body details > summary {
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
#tab-lv .settlement-detail-title { margin: 14px 0 8px; font-size: 14px; }

#tab-lv #team-level-settings table { min-width: 850px; }
#tab-lv #team-level-settings input[name="netThresholds"] { max-width: 10em; }
#tab-lv #team-level-settings input[name="brandEnabled"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}
#tab-lv [data-business-paused]:empty { display: none; }

#tab-lv .level-config-table select[name^="mode_"] {
  width: min(100%, 17em);
  min-width: 12em;
}
