/* docs/literature.md: controls and tables; follows the Material light/dark scheme. */
#lit-app { font-size: .68rem; margin-top: 1rem; }
.lit-tabs { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 1px solid var(--md-default-fg-color--lightest); margin-bottom: .6rem; }
.lit-tabs button {
  font: inherit; font-size: .72rem; padding: .4rem .8rem; border: 0; background: none; cursor: pointer;
  color: var(--md-default-fg-color--light); border-bottom: .12rem solid transparent; margin-bottom: -1px;
}
.lit-tabs button[aria-selected="true"] { color: var(--md-accent-fg-color); border-bottom-color: var(--md-accent-fg-color); font-weight: 700; }
.lit-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem .8rem; }
.lit-fields label { display: flex; flex-direction: column; gap: .15rem; color: var(--md-default-fg-color--light); }
.lit-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; margin-top: .6rem; }
.lit-toggles label { display: flex; align-items: center; gap: .3rem; }
.lit-buttons { display: flex; gap: .4rem; }
#lit-app input:not([type="checkbox"]), #lit-app select, #lit-app textarea, #lit-app .lit-buttons button, .lit-pager button {
  font: inherit; color: var(--md-default-fg-color); background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter); border-radius: .2rem; padding: .25rem .4rem;
  box-sizing: border-box; width: 100%; min-width: 0;
}
#lit-app .lit-buttons button, .lit-pager button { width: auto; cursor: pointer; }
#lit-app .lit-buttons button:hover, .lit-pager button:hover:not([disabled]) { border-color: var(--md-accent-fg-color); }
#lit-app textarea { font-family: var(--md-code-font-family); font-size: .65rem; resize: vertical; }
.lit-status, .lit-hint { color: var(--md-default-fg-color--light); margin: .5rem 0 .4rem; }
.lit-muted { color: var(--md-default-fg-color--light); font-weight: 400; }

.lit-scroll {
  overflow: auto; max-height: 75vh; border: 1px solid var(--md-default-fg-color--lightest);
  -webkit-overflow-scrolling: touch;
}
.md-typeset table.lit-table { display: table; border-collapse: collapse; width: 100%; font-size: .64rem; margin: 0; border: 0; }
.md-typeset .lit-table th, .md-typeset .lit-table td {
  padding: .3rem .5rem; border-bottom: 1px solid var(--md-default-fg-color--lightest);
  text-align: left; vertical-align: top; min-width: 0;
}
.md-typeset .lit-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--md-code-bg-color); font-weight: 700; white-space: nowrap;
}
.md-typeset .lit-table th.lit-sortable { cursor: pointer; }
.md-typeset .lit-table th.lit-sortable:hover { color: var(--md-accent-fg-color); }
.md-typeset .lit-table thead th[draggable="true"] { cursor: grab; }
.md-typeset .lit-table thead th.lit-sortable { cursor: pointer; }
.md-typeset .lit-table thead th.lit-dragging { opacity: .45; }
.md-typeset .lit-table thead th.lit-drop-before { box-shadow: inset 3px 0 0 var(--md-accent-fg-color); }
.md-typeset .lit-table thead th.lit-drop-after { box-shadow: inset -3px 0 0 var(--md-accent-fg-color); }
.md-typeset .lit-table thead th:focus-visible { outline: 2px solid var(--md-accent-fg-color); outline-offset: -2px; }
.md-typeset .lit-table tbody tr[data-i] { cursor: pointer; }
.md-typeset .lit-table tbody tr[data-i]:hover { background: var(--md-accent-fg-color--transparent); }
.md-typeset .lit-table td.lit-num { text-align: right; white-space: nowrap; width: 1%; }
.md-typeset .lit-table tr.lit-group td {
  background: var(--md-primary-fg-color--transparent, rgba(250, 119, 42, .12)); font-size: .62rem; padding: .25rem .5rem;
}
.md-typeset .lit-table tr.lit-best-row td:nth-child(3),
.md-typeset .lit-table td.lit-best-cell,
.lit-best { background: rgba(250, 119, 42, .24); font-weight: 700; }
.md-typeset .lit-table tr.lit-best-row td { font-weight: 600; }
.md-typeset .lit-table.lit-inner { margin-top: .5rem; }
.lit-empty { text-align: center; color: var(--md-default-fg-color--light); padding: 1rem; }
.lit-dir { color: var(--md-default-fg-color--lighter); margin-left: .3rem; }
.lit-badge {
  display: inline-block; font-size: .55rem; line-height: 1.3; padding: 0 .3rem; border-radius: .6rem;
  border: 1px solid var(--md-default-fg-color--lighter); color: var(--md-default-fg-color--light); white-space: nowrap;
}
.lit-badge.lit-proposed { border-color: var(--md-accent-fg-color); color: var(--md-default-fg-color); }
.lit-caution { color: #e65100; cursor: help; }
[data-md-color-scheme="slate"] .lit-caution { color: #ffb74d; }
.lit-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .5rem 0 1rem; }
.lit-pager label { display: flex; align-items: center; gap: .3rem; }
.lit-pager select { width: auto !important; }
.lit-detail {
  position: relative; border-left: .2rem solid var(--md-accent-fg-color); background: var(--md-code-bg-color);
  padding: .5rem 2rem .5rem .8rem; margin-bottom: .5rem; overflow-x: auto;
}
.lit-detail dl { margin: .3rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .1rem .8rem; }
.lit-detail dt { font-weight: 700; margin: 0; }
.lit-detail dd { margin: 0; }
.lit-close { position: absolute; top: .2rem; right: .4rem; border: 0; background: none; color: var(--md-default-fg-color); font-size: 1rem; cursor: pointer; }
.lit-linkbtn { border: 0; background: none; color: var(--md-typeset-a-color); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* Filters in a left sidebar, results on the right; stacked on narrow screens. */
.lit-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.lit-panel[hidden] { display: none; }
.lit-main { min-width: 0; }
.lit-sidebar > .lit-hint:first-child { margin-top: 0; }
@media screen and (min-width: 60em) {
  .lit-panel { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 1.2rem; align-items: start; }
  .lit-sidebar {
    position: sticky; top: 3.4rem; max-height: calc(100vh - 4rem); overflow-y: auto;
    padding: .6rem .7rem; border: 1px solid var(--md-default-fg-color--lightest); border-radius: .2rem;
    background: var(--md-code-bg-color);
  }
  .lit-sidebar .lit-fields { grid-template-columns: minmax(0, 1fr); }
  .lit-sidebar .lit-toggles { flex-direction: column; align-items: flex-start; gap: .45rem; }
  .lit-sidebar .lit-buttons { flex-wrap: wrap; margin-top: .2rem; }
  .lit-main > .lit-status:first-child, .lit-main > .lit-hint:first-child { margin-top: 0; }
}

/* Active-filter chips and the facet-count legend */
.lit-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .4rem; }
.lit-chip {
  border: 1px solid var(--md-default-fg-color--lighter); border-radius: 1rem; background: none;
  color: var(--md-default-fg-color); cursor: pointer; font: inherit; font-size: .65rem; padding: .1rem .55rem;
}
.lit-chip:hover { border-color: var(--md-accent-fg-color); }
.lit-legend { font-size: .62rem; }
