.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.basis-note {
  margin: -5px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.holding-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(120px, 160px);
  gap: 10px;
  margin-bottom: 12px;
}

.holding-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holding-controls input,
.holding-controls select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.holding-controls input:focus,
.holding-controls select:focus {
  border-color: var(--blue);
  outline: 2px solid color-mix(in srgb, var(--blue) 18%, transparent);
  outline-offset: 1px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--soft);
  font-weight: 680;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.sort-button:hover,
.sort-button[data-active="true"] {
  color: var(--ink);
}

.sort-button span {
  display: inline-block;
  width: 12px;
  color: var(--blue);
  text-align: center;
}

.row-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.row-toggle:hover,
.row-toggle[aria-expanded="true"] {
  border-color: var(--blue);
  color: var(--blue);
}

tr:last-child td {
  border-bottom: 0;
}

.holding-warning {
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.holding-detail-row td {
  padding: 0 10px 12px;
  white-space: normal;
}

.holding-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 82%, var(--soft));
}

.holding-detail div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.holding-detail span {
  color: var(--muted);
  font-size: 12px;
}

.holding-detail strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
}

.holding-detail p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-status {
  display: inline-block;
  max-width: 180px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.table-status.ok {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  color: var(--green);
}

.table-status.warn,
.table-status.error {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  color: var(--amber);
}

@media (max-width: 860px) {
  .holding-controls {
    grid-template-columns: 1fr;
  }

  .holding-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
