@import url("./labs.css");

.data-app [hidden] {
  display: none !important;
}

.data-layout {
  max-width: 1640px;
  padding: 30px 32px 60px;
  margin: auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0 28px;
}
.operation-switch {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #cfd7e4;
  margin: 0 0 25px;
}
.operation-switch button {
  padding: 13px 18px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: #4a5d76;
  font-size: 14px;
}
.operation-switch [aria-pressed="true"] {
  color: #163e9b;
  border-color: #2453cc;
  font-weight: 650;
}
.data-controls {
  background: white;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  align-self: start;
}
.data-controls label:not(.data-check),
.data-controls legend {
  font-size: 12px;
  color: #41536c;
  font-weight: 600;
}
.data-controls label:not(.data-check) {
  display: block;
  margin-bottom: 7px;
}
.data-controls select {
  width: 100%;
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid #b9c7d9;
  border-radius: 4px;
  background: white;
  font-size: 12px;
  color: #223b61;
}
.data-controls select + label,
#overlap-control {
  margin-top: 20px;
}
.data-controls .control-description {
  font-size: 12px;
}
.choice-fields {
  border: 0;
  padding: 0;
  margin: 22px 0;
}
.choice-fields legend {
  margin-bottom: 8px;
}
.choice-fields label,
.data-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 12px;
  margin: 0 !important;
  font-weight: 400 !important;
}
.choice-fields input,
.data-check input {
  accent-color: #2453cc;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.data-experiments {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
}
.data-experiments summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.data-experiments[open] summary {
  margin-bottom: 12px;
}
.data-experiments p,
.data-scope {
  font-size: 11px;
  color: #596b81;
  line-height: 1.7;
  margin: 14px 0 0;
}
.data-scope {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 22px;
}
.data-workspace {
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.section-heading h2 {
  font-size: 17px;
  letter-spacing: -0.35px;
  margin: 0;
}
.section-heading > span {
  font-size: 12px;
  color: #566780;
}
.source-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.source-tables.single-source {
  grid-template-columns: minmax(0, 1fr);
}
.source-card {
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid #3c65ad;
  border-radius: 4px;
  min-width: 0;
}
.source-card[data-source="using"] {
  border-top-color: #7d5a91;
}
.source-card header {
  padding: 13px 16px 10px;
}
.source-role {
  font-size: 11px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #536985;
  margin-bottom: 4px;
  display: block;
}
.source-card h3 {
  font-size: 15px;
  letter-spacing: -0.2px;
  margin: 0 0 3px;
}
.source-card header p {
  font-size: 11px;
  color: #576b82;
  margin: 0;
}
.key-audit {
  padding: 9px 16px 11px;
  font-size: 11px;
  color: #445c7b;
  border-top: 1px solid #e3e9f2;
  margin: 0;
  line-height: 1.65;
}
.key-audit strong {
  font-weight: 600;
}
.data-table-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: none;
}
.data-grid {
  width: 100%;
  border-collapse: collapse;
  font: 12px/1.5 var(--mono);
  white-space: nowrap;
}
.data-grid th,
.data-grid td {
  border-bottom: 1px solid #e7ebf1;
  padding: 7px 12px;
  text-align: right;
}
.data-grid thead th {
  background: #f4f6fa;
  color: #455b79;
  font-weight: 500;
  font-size: 11px;
}
.data-grid th.row-position {
  color: #52647d;
  font-size: 10px;
  font-weight: 400;
  width: 32px;
}
.data-grid .key-column {
  background: #f0f4fc;
  color: #234675;
}
.data-grid td.string-value {
  text-align: left;
}
.data-grid th.string-value {
  text-align: left;
}
.data-grid tr:last-child > * {
  border-bottom: 0;
}
.data-grid .missing-value {
  color: #5b6879;
}
.data-grid tr.source-selected > * {
  background: #e1ebff;
  color: #1d416c;
}
.data-grid td.cell-selected {
  box-shadow: inset 0 0 0 2px #2453cc;
  background: #dce8ff;
}
.data-grid tr.source-problem > * {
  background: #fff0e4;
}
.data-result {
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 24px;
  padding: 18px;
}
.operation-command {
  background: #17273e;
  color: #dce8ff;
  padding: 14px 16px;
  font: 12px/1.7 var(--mono);
  overflow-wrap: anywhere;
  border-radius: 4px;
}
.operation-command > span {
  color: #9db7e3;
}
.operation-command code {
  padding: 0;
  color: inherit;
  background: none;
  font: inherit;
}
.merge-composition {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.merge-count {
  flex: 1 1 100px;
  padding: 9px 12px;
  background: #f2f5fa;
  border-left: 3px solid #6f87a9;
  font-size: 11px;
  color: #465c79;
}
.merge-count strong {
  font: 19px/1.3 var(--mono);
  display: block;
  color: #233c5f;
  margin-bottom: 2px;
}
.merge-count.excluded {
  border-left-style: dashed;
  background: #fafafa;
}
.merge-count.code-3 {
  border-color: #2d7280;
}
.merge-count.code-2 {
  border-color: #7d5a91;
}
.merge-count.code-4,
.merge-count.code-5 {
  border-color: #9c6519;
}
.result-explanation {
  margin: 14px 0;
  font-size: 12px;
  color: #445a75;
  line-height: 1.7;
}
.result-caution {
  padding: 12px;
  border-left: 3px solid #b47a28;
  background: #fff6e9;
  color: #75501d;
  font-size: 12px;
  line-height: 1.7;
}
.result-and-trace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 18px;
  align-items: start;
}
.result-and-trace > div {
  min-width: 0;
}
.table-help {
  font-size: 11px;
  color: #586b84;
  margin: 0 0 9px;
}
.result-grid th,
.result-grid td {
  padding: 0;
}
.result-grid th {
  padding: 8px 9px;
}
.result-grid td {
  padding: 8px 9px;
}
.result-grid td:has(button) {
  padding: 0;
}
.result-grid tbody th:has(button) {
  padding: 0;
}
.result-grid button {
  display: block;
  padding: 8px 9px;
  width: 100%;
  min-height: 34px;
  text-align: inherit;
  font: inherit;
  border-radius: 0;
}
.result-grid button:hover {
  background: #eaf0fb;
}
.result-grid button:focus-visible {
  outline-offset: -3px;
}
.result-grid [aria-pressed="true"] {
  background: #dce8ff;
  color: #1d4380;
  box-shadow: inset 0 0 0 2px #2453cc;
}
.result-grid tr.output-selected > * {
  background: #eff4ff;
}
.merge-status {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-size: 11px;
  border: 1px solid #c6d4e7;
  border-radius: 3px;
  padding: 1px 3px;
  color: #34516f;
}
.record-trace {
  border-left: 2px solid #c9d7ed;
  padding: 10px 0 8px 16px;
}
.record-trace h3 {
  font-size: 12px;
  color: #506580;
  margin: 0 0 12px;
}
.trace-selection {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 5px;
}
.trace-key {
  font: 11px/1.7 var(--mono);
  color: #455d7c;
}
.trace-path {
  display: grid;
  gap: 8px;
  margin: 13px 0;
}
.trace-node {
  font-size: 12px;
  border: 1px solid #ced9e9;
  border-left: 3px solid #3c65ad;
  padding: 8px 10px;
  border-radius: 2px;
  background: #f5f8fe;
}
.trace-node.using-node {
  border-left-color: #7d5a91;
}
.trace-node.absent-node {
  border-style: dashed;
  background: #fafafa;
  color: #5b6778;
}
.trace-node small {
  display: block;
  font-size: 11px;
  color: #526985;
  margin-top: 3px;
}
.trace-detail,
.trace-note {
  font-size: 12px;
  line-height: 1.7;
  color: #435a76;
  margin: 12px 0 0;
}
.trace-detail strong {
  display: block;
  color: #263f5e;
}
.trace-detail code {
  background: #eef2f8;
}
.operation-error {
  margin: 16px 0 2px;
  border-left: 3px solid #ac5424;
  padding: 12px 14px;
  background: #fff3e9;
  color: #723a19;
  font-size: 13px;
  line-height: 1.75;
}
.operation-error strong {
  display: block;
}
.operation-error p {
  margin: 6px 0 0;
}
.data-method {
  margin-top: 22px;
  font-size: 12px;
  color: #445b78;
  line-height: 1.8;
}
.data-method summary {
  font-weight: 600;
  cursor: pointer;
  padding: 7px 0;
}
.data-method h3 {
  font-size: 14px;
  margin: 18px 0 8px;
}
.data-method pre {
  overflow: auto;
  padding: 18px;
  background: #eef2f8;
  color: #283f60;
  font: 12px/1.8 var(--mono);
  max-height: 360px;
}
.data-mobile-nav {
  display: none;
}
.data-layout section,
.record-trace,
.data-controls {
  scroll-margin-top: 20px;
}
@media (max-width: 1150px) {
  .data-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0 20px;
    padding: 25px 22px 50px;
  }
  .data-controls {
    padding: 16px;
  }
  .result-and-trace {
    grid-template-columns: minmax(0, 1fr);
  }
  .record-trace {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 0;
  }
  .trace-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .source-tables {
    gap: 10px;
  }
  .data-grid th,
  .data-grid td {
    padding-left: 9px;
    padding-right: 9px;
  }
}
@media (max-width: 800px) {
  .data-layout {
    display: block;
    padding: 23px 16px 90px;
  }
  .data-layout .lab-heading {
    display: block;
    margin-bottom: 18px;
  }
  .lab-prerequisite {
    display: block;
    max-width: none;
    margin-top: 14px;
  }
  .lab-switcher {
    gap: 8px 18px;
    margin-bottom: 16px;
  }
  .data-controls {
    margin-bottom: 24px;
  }
  .operation-switch {
    margin-bottom: 18px;
  }
  .operation-switch button {
    flex: 1;
    padding: 12px 6px;
    font-size: 13px;
  }
  .data-controls select {
    font-size: 14px;
    padding: 10px;
  }
  .data-controls .data-check,
  .choice-fields label {
    min-height: 36px;
  }
  .data-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #c4d0e2;
    z-index: 15;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .data-mobile-nav button {
    flex: 1;
    font-size: 12px;
    min-height: 40px;
    color: #345278;
  }
  .source-tables {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .data-result {
    padding: 14px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading > span {
    max-width: 46%;
    text-align: right;
  }
  .data-grid th,
  .data-grid td {
    padding-left: 10px;
    padding-right: 10px;
  }
  .result-grid button {
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .data-grid td,
  .data-grid th {
    transition: background-color 120ms ease;
  }
}

.trace-values {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  margin: 10px 0 0;
  font: 11px/1.6 var(--mono);
}
.trace-values dt {
  color: #506682;
}
.trace-values dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  color: #263f5e;
}

.investigation-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(220px, 350px) minmax(0, 1fr);
  align-items: center;
  gap: 12px 20px;
  padding: 14px 0 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.investigation-bar > label {
  font-weight: 650;
  color: #34516f;
}
.investigation-bar select,
.investigation-task select {
  background: white;
  color: #304e75;
  border: 1px solid #bbc9dc;
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 12px;
  min-width: 0;
  max-width: 100%;
}
.investigation-bar p {
  margin: 0;
  color: #52677f;
  font-size: 12px;
  line-height: 1.7;
}
.investigation-bar .investigation-warning {
  grid-column: 1 / -1;
  color: #783d1c;
  background: #fff2e6;
  padding: 12px;
  border-left: 3px solid #ac5424;
}
.investigation-task {
  grid-column: 1 / -1;
  margin: -3px 0 24px;
  padding: 18px 22px;
  background: #edf3ff;
  border-left: 3px solid #2453cc;
  scroll-margin-top: 20px;
}
.investigation-task-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 14px;
}
.investigation-task-head p {
  margin: 0;
  font-size: 11px;
  color: #476185;
}
.investigation-task-head select {
  max-width: 460px;
}
.investigation-task-head .text-button {
  margin-left: auto;
  font-size: 12px;
}
.investigation-task h2 {
  font-size: 18px;
  margin-bottom: 8px;
}
.investigation-task > p {
  max-width: 920px;
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 10px;
  color: #344e70;
}
.investigation-task details {
  font-size: 12px;
  color: #415b7c;
}
.investigation-task summary {
  cursor: pointer;
  width: fit-content;
}
.investigation-task details p {
  margin: 9px 0;
  max-width: 850px;
  line-height: 1.75;
}
.investigation-answer-link {
  font-size: 12px;
  color: #1d479f;
  padding: 10px 0 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.investigation-answer {
  margin-top: 22px;
  background: white;
  border: 1px solid #c7d5e9;
  border-top: 3px solid #2453cc;
  border-radius: 4px;
  padding: 20px;
  scroll-margin-top: 20px;
}
.investigation-answer h2 {
  font-size: 17px;
  margin-bottom: 16px;
}
.investigation-answer fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.investigation-answer legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 13px;
  padding: 0;
}
#investigation-inputs label:not(.sr-only) {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13px;
  padding: 8px 0;
  cursor: pointer;
}
#investigation-inputs input[type="radio"] {
  accent-color: #2453cc;
  flex-shrink: 0;
}
#investigation-number {
  width: 180px;
  border: 1px solid #a8bad2;
  padding: 10px 12px;
  border-radius: 4px;
  font: 14px var(--mono);
}
.investigation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}
.investigation-actions button {
  font-size: 12px;
  min-height: 40px;
}
#investigation-feedback {
  font-size: 13px;
  line-height: 1.8;
  color: #784223;
  margin: 16px 0 0;
}
#investigation-feedback:empty {
  display: none;
}
#investigation-feedback.answer-passed {
  color: #254f51;
  border-left: 3px solid #367b7f;
  padding-left: 12px;
}
#investigation-finished {
  font-size: 13px;
  line-height: 1.8;
  padding: 13px;
  background: #f0f5fc;
  margin: 16px 0 0;
}
@media (max-width: 1050px) {
  .investigation-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .investigation-bar > p {
    grid-column: 1 / -1;
  }
}
@media (max-width: 800px) {
  .investigation-bar {
    display: block;
  }
  .investigation-bar > label {
    display: block;
    margin-bottom: 8px;
  }
  .investigation-bar select {
    width: 100%;
    font-size: 14px;
  }
  .investigation-bar > p {
    margin-top: 10px;
  }
  .investigation-task {
    padding: 16px;
  }
  .investigation-task-head {
    gap: 10px;
  }
  .investigation-task-head select {
    width: 100%;
    font-size: 13px;
    order: 3;
  }
  .investigation-task-head p {
    max-width: 55%;
  }
  .investigation-task h2 {
    font-size: 17px;
  }
  .investigation-answer {
    padding: 16px;
  }
}
