.view-tabs {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 6px 20px 0;
  background: #fff;
  border-bottom: 1px solid #cbd7e2;
}
.view-tabs button {
  padding: 9px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
}
.view-tabs button[aria-selected="true"] {
  color: #164e7a;
  border-bottom-color: #246594;
  font-weight: 700;
}
.instruments-view {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
[hidden] { display: none !important; }

.instrument-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}
.instrument-browser {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 24px clamp(12px, 2.4vw, 34px);
}
.instrument-intro h2 { margin: 0 0 7px; font-size: 24px; }
.instrument-intro p, .instrument-reading-key p {
  margin: 0;
  color: #456079;
  font-size: 14px;
  line-height: 1.5;
}
.instrument-controls { margin: 18px 0 12px; }
.instrument-quick-filters, .instrument-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}
.instrument-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}
.instrument-controls input, .instrument-controls select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  min-height: 39px;
  border: 1px solid #a7b9c9;
  border-radius: 5px;
  background: #fff;
  color: #193954;
  font: inherit;
  font-weight: 400;
}
.instrument-quick-filters button { min-height: 39px; }
.instrument-filter-details { margin-top: 12px; }
.instrument-filter-details summary { cursor: pointer; width: fit-content; padding: 5px 0; font-size: 14px; color: #194e76; }
.instrument-filters { margin-top: 9px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.instrument-reading-key {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 8px 0 12px;
  border-top: 1px solid #cbd7e2;
}
#instrument-result { color: #18314b; font-weight: 700; }
.instrument-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 182px), 1fr));
  align-items: start;
  gap: 13px;
}
.instrument-lane {
  min-width: 0;
  background: #e5ebf1;
  border-radius: 8px;
  padding: 9px;
}
.instrument-lane h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  min-height: 2.8em;
  margin: 1px 2px 6px;
  font-size: 14px;
  line-height: 1.35;
}
.instrument-lane-count { color: #48617a; font-weight: 400; }
.instrument-card {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 7px;
  padding: 9px 9px 9px 10px;
  border-left: 3px solid #6087aa;
  text-align: left;
  overflow-wrap: anywhere;
}
.instrument-card[aria-pressed="true"] {
  background: #eaf4ff;
  border-color: #246594;
  box-shadow: inset 0 0 0 1px #246594;
}
.instrument-card-name { font-size: 14px; font-weight: 700; }
.instrument-readiness { font-size: 12px; color: #315470; }
[data-status="conditional"] .instrument-readiness { color: #77501e; }
[data-status="proposed"] .instrument-readiness { color: #634879; }
[data-status="historical"] .instrument-readiness { color: #506071; }
.instrument-card-figure { color: #3f5870; font-size: 12px; line-height: 1.4; }
.instrument-detail { width: min(365px, 40vw); }
.instrument-detail h2 { margin: 5px 40px 10px 0; }
.instrument-detail h3 { margin: 17px 0 6px; font-size: 14px; }
.instrument-detail .instrument-tags { display: grid; grid-template-columns: 105px 1fr; gap: 7px 8px; font-size: 13px; margin: 10px 0 0; }
.instrument-tags dt { font-weight: 700; }
.instrument-tags dd { margin: 0; }
.instrument-detail .instrument-amounts { padding: 10px 12px; border-left: 3px solid #6087aa; background: #eff5fa; }
.instrument-amounts p:last-child { margin-bottom: 0; }
.instrument-detail .instrument-sources { margin: 5px 0 12px; padding-left: 18px; }
.instrument-detail .instrument-sources li { margin: 5px 0; }
.instrument-empty { margin: 12px 0; font-size: 14px; color: #456079; }
.instrument-controls :is(select, input, summary):focus-visible { outline: 3px solid #bd7825; outline-offset: 2px; }
@media (max-width: 760px) {
  .instrument-layout { flex-direction: column; }
  .instrument-detail { width: 100%; height: 45%; border-left: 0; border-top: 1px solid #cfd8e1; }
  .instrument-browser { min-height: 0; }
}
@media (max-width: 550px) {
  .instrument-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instrument-quick-filters label:first-child { grid-column: 1 / -1; }
  .instrument-quick-filters button { justify-self: start; }
  .instrument-controls input, .instrument-controls select { font-size: 16px; }
  .instrument-lane h3 { min-height: 0; }
}
@media print {
  .view-tabs, .instrument-controls { display: none; }
  .instrument-layout { display: block; }
  .instruments-view, .instrument-browser { display: block; overflow: visible; }
  .instrument-card { break-inside: avoid; }
}
