.company-setup {
  --setup-accent: #8c4b32;
  --setup-selection: #f8eee7;
}

.company-setup [hidden],
.company-setup[hidden],
#overview[hidden],
#companySetupNav[hidden] {
  display: none;
}

.company-setup .heading {
  margin: 0 0 22px;
}

.company-setup .heading h1 {
  margin: 0;
}

.company-setup h2 {
  font-size: 17px;
  font-weight: 550;
}

.company-setup h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 550;
}

#setupBreadcrumbCompany::before {
  content: '›';
  padding-right: 10px;
}

.setup-status {
  margin-top: 14px;
  color: var(--ink);
}

#companySetupRetry {
  margin-top: 12px;
}

.setup-views {
  display: flex;
  gap: 18px;
  margin: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.setup-views button {
  margin-bottom: -1px;
  padding: 7px 3px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}

.setup-views button[aria-pressed='true'] {
  border-bottom-color: var(--setup-accent);
  color: var(--setup-accent);
  font-weight: 550;
}

.setup-hierarchy {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.company-setup .panel {
  min-width: 0;
  margin: 0;
  padding: 20px;
}

.setup-tree-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-tree-list .setup-tree-list {
  margin-left: 13px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.setup-tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 3px 0;
}

.setup-expand,
.setup-leaf {
  flex: 0 0 22px;
  width: 22px;
}

.setup-expand {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--setup-accent);
  font-size: 20px;
  line-height: 26px;
}

.setup-expand[aria-expanded='true'] {
  transform: rotate(90deg);
}

.setup-node {
  display: grid;
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  overflow-wrap: anywhere;
}

.setup-node[aria-pressed='true'] {
  border-color: #ead8cb;
  background: var(--setup-selection);
}

.setup-node.setup-root {
  font-weight: 600;
}

.setup-node small,
.setup-child-count,
.setup-entity-path,
.setup-fields dt {
  color: #646565;
  font-size: 12px;
  font-weight: 400;
}

.setup-child-count {
  flex: 0 0 auto;
  margin-right: 4px;
}

.setup-entity-path {
  margin: -4px 0 16px;
  overflow-wrap: anywhere;
}

.setup-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 0;
}

.setup-fields dd {
  margin: 3px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.setup-table-scroll {
  overflow-x: auto;
}

.setup-table-scroll table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
  border-collapse: collapse;
  white-space: normal;
}

.setup-table-scroll th,
.setup-table-scroll td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.setup-table-scroll thead th {
  font-size: 12px;
  font-weight: 550;
}

.setup-table-scroll tbody th {
  background: transparent;
  color: var(--ink);
  font-size: inherit;
  font-weight: 400;
}

@media (max-width: 800px) {
  .setup-hierarchy {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .company-setup .panel {
    padding: 14px;
  }
}

.setup-profile-form .setup-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.setup-profile-actions p {
  flex: 1;
  font-size: 13px;
}
.setup-profile-actions time {
  color: var(--ink);
  margin-left: 6px;
}
.setup-profile-actions .primary {
  background: var(--setup-accent);
  border-color: var(--setup-accent);
  color: #fff;
}
.setup-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.setup-profile-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.setup-profile-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.setup-profile-card h3,
.setup-profile-card .setup-wide {
  grid-column: 1 / -1;
}
.setup-profile-card label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.setup-profile-card .setup-manufacturing {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-profile-card input:not([type='checkbox']),
.setup-profile-card select,
.setup-profile-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}
.setup-profile-card :is(input, select, textarea):disabled {
  background: var(--soft);
  opacity: 1;
}
.setup-profile-error {
  padding: 8px 12px;
  border: 1px solid #d4a496;
  border-radius: 6px;
  color: #803c2d;
  margin-bottom: 12px;
}
@media (max-width: 800px) {
  .setup-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 420px) {
  .setup-profile-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.setup-record-actions,
.setup-detail-heading,
.setup-dialog-head,
.setup-record-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-record-actions {
  justify-content: flex-end;
}
.setup-detail-heading,
.setup-dialog-head {
  justify-content: space-between;
}
.setup-detail-heading h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.setup-record-footer {
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: #fff;
}
#setupRecordDialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
#setupRecordDialog::backdrop {
  background: rgb(29 33 36 / 46%);
}
#setupRecordDialog [hidden] {
  display: none;
}
.setup-record-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.setup-record-fields :is(h3, label.setup-wide) {
  grid-column: 1 / -1;
}
.setup-record-fields h3 {
  margin: 10px 0 0;
  font-size: 15px;
}
.setup-record-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.setup-record-fields :is(select, input:not([type='checkbox'])) {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.setup-record-fields .setup-record-checkbox {
  display: flex;
  align-items: center;
}
.setup-record-footer .primary {
  background: #8c4b32;
  border-color: #8c4b32;
  color: #fff;
}
@media (max-width: 480px) {
  .setup-record-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.setup-views {
  flex-wrap: wrap;
}
.pilot-panel {
  margin: 0 0 16px !important;
}
.pilot-panel h2 {
  margin-bottom: 10px;
}
.pilot-panel fieldset {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pilot-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.pilot-panel form > label {
  display: grid;
  gap: 5px;
  max-width: 420px;
}
#factorSummary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}
#factorSummary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#factorSummary li + li {
  margin-top: 6px;
}
#factorSummary button {
  text-align: left;
  width: 100%;
}
.pilot-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.pilot-filters label {
  display: grid;
  min-width: min(140px, 100%);
  gap: 3px;
  font-size: 13px;
}
.pilot-filters :is(input, select) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
}
.pilot-factor-table small {
  display: block;
  margin-top: 4px;
}
.pilot-factor-table button {
  text-align: left;
  padding: 4px;
}
.pilot-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
#factorDetailDialog {
  width: min(700px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
#factorDetailDialog::backdrop {
  background: rgb(29 33 36 / 46%);
}

#scope1EntryForm .pilot-panel > label,
.scope1-factor-status label {
  display: grid;
  gap: 4px;
  max-width: 420px;
  font-size: 13px;
}
#scope1EntryForm .pilot-panel input {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  padding: 8px;
}
#scope1EntryForm .scope1-entry-fields {
  padding: 0;
  border: 0;
  margin: 0;
  min-width: 0;
}
#scope1EntryForm .scope1-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}
.scope1-factor-status {
  background: var(--setup-selection);
  margin-top: 12px;
  padding: 10px;
}
.scope1-factor-status [hidden] {
  display: none;
}
#scope1SavedEntries button,
#scope1MappingList button,
#scope1RequestList button {
  margin: 3px 0 3px 5px;
}
#scope1EntryForm .setup-record-actions {
  margin: 12px 0;
}

#pilotSignIn[hidden] {
  display: none;
}
#pilotSignIn .panel {
  max-width: 480px;
  margin: 32px auto;
}
