/* One index workspace, with one search and one shared table on every viewport. */
.index-workspace { padding-top: 26px; }
.index-heading { margin-bottom: 12px; }
.index-heading h1 { margin: 0; font-size: clamp(23px, 3vw, 32px); font-weight: 500; line-height: 1.4; color: #ff9638; }
.index-heading h1 > span { display: inline-block; margin-inline-start: 8px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; vertical-align: middle; color: var(--ink); }
html[data-theme="light"] .index-heading h1 { color: #aa3b00; }
.index-guide { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.index-guide > summary { cursor: pointer; width: fit-content; padding-block: 6px; }
.index-guide .reading-intro { margin-block: 12px; }
.has-js .record-search {
  display: block;
  margin: 12px 0 16px;
  padding: 0;
}
.record-search-title { display: block; margin-bottom: 12px; color: var(--ink); font-size: 14px; }
.record-search-controls { display: flex; align-items: center; gap: 12px; }
.record-search-controls .search { flex: 1; min-width: 0; margin: 0; }
.record-search input { width: 100%; min-width: 0; min-height: 46px; font-size: 16px; }
.record-search button { flex-shrink: 0; min-height: 44px; }
.record-search p { margin: 10px 0 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.musical-note h3 { line-height: 1.7; }

/* Automatic cards on phones and tablets; the explicit Table option is retained. */
@media (max-width: 860px) {
  #recordsView:not([data-layout="table"]) .table-scroll { overflow: visible; }
  #recordsView:not([data-layout="table"]) table { display: block; min-width: 0; width: 100%; }
  #recordsView:not([data-layout="table"]) thead {
    display: table-header-group; position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  #recordsView:not([data-layout="table"]) #rows {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px;
  }
  #recordsView:not([data-layout="table"]) #rows tr {
    display: grid; grid-template-columns: minmax(0, 64px) minmax(0, 1fr);
    gap: 16px; padding: 18px; position: relative;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  }
  #recordsView:not([data-layout="table"]) #rows td {
    display: block; position: static; min-width: 0; width: auto;
    max-width: none; padding: 0; border: 0; overflow-wrap: anywhere;
  }
  #recordsView:not([data-layout="table"]) #rows td::before {
    display: block; content: attr(data-label); margin-bottom: 6px;
    font-size: 11px; color: var(--muted);
  }
  #recordsView:not([data-layout="table"]) #rows td:nth-child(n+3) { grid-column: 1 / -1; }
  #recordsView:not([data-layout="table"]) .witness-cell { min-width: 0; max-width: none; }
  #recordsView:not([data-layout="table"]) .relationship { max-width: none; }
  #recordsView:not([data-layout="table"]) #rows td:last-child { display: flex; justify-content: flex-end; gap: 8px; }
  #recordsView:not([data-layout="table"]) .row-actions { margin-top: 0; }
}
@media (max-width: 480px) {
  .record-search-controls { align-items: stretch; flex-direction: column; gap: 4px; }
  .record-search button { align-self: flex-start; }
}
