/* Ordlistan */

.controls { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-3); }
#sok { flex: 1 1 320px; width: auto; font-size: var(--step-0); }
#klass { flex: 0 1 220px; width: auto; }
#antal { color: var(--muted); font-size: var(--step--1); margin-left: auto; font-variant-numeric: tabular-nums; }

#alfabet { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-4); }
#alfabet button {
  min-width: 34px; min-height: 34px; padding: 0 var(--s-2);
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: var(--step--1); font-weight: 600;
}
#alfabet button:hover:not(:disabled) { background: var(--surface); border-color: var(--line-strong); }
#alfabet button.aktiv { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
#alfabet button:disabled { opacity: 0.35; cursor: default; }

.tabell-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
.tabell-wrap table { width: 100%; border-collapse: collapse; min-width: 860px; }
.tabell-wrap th, .tabell-wrap td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tabell-wrap thead th {
  position: sticky; top: 0;
  background: var(--surface-2); color: var(--text);
  font-size: var(--step--1); font-weight: 600;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.tabell-wrap thead th:hover { color: var(--primary); }
.pil { display: inline-block; width: 1em; color: var(--primary); }
.tabell-wrap tbody tr:hover { background: var(--bg); }
.tabell-wrap tbody tr:last-child td { border-bottom: 0; }
.tabell-wrap td:first-child { font-weight: 700; white-space: nowrap; font-size: var(--step-0); }
td.klass { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.tabell-wrap td:nth-child(3) { font-family: var(--font-read); font-size: 0.97rem; line-height: 1.5; }
td.syn { color: var(--muted); }
td.ex { font-family: var(--font-read); font-style: italic; color: var(--muted); font-size: 0.97rem; }
#tomt { padding: var(--s-6) var(--s-4); text-align: center; color: var(--muted); margin: 0; }

@media (max-width: 720px) {
  .tabell-wrap table { min-width: 0; }
  .tabell-wrap thead { display: none; }
  .tabell-wrap tbody tr { display: block; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
  .tabell-wrap td { display: block; padding: 2px 0; border: 0; }
  .tabell-wrap td:first-child { font-size: var(--step-1); }
  #antal { margin-left: 0; width: 100%; }
}

@media print {
  .controls, #alfabet { display: none; }
  .tabell-wrap { border: 0; overflow: visible; }
  .tabell-wrap table { min-width: 0; font-size: 9.5pt; }
  .tabell-wrap thead th { position: static; }
  .tabell-wrap tr { break-inside: avoid; }
}

/* Favorit och "kan inte" */
#lista { flex: 0 1 200px; width: auto; }
.ord-cell { display: flex; flex-direction: column; gap: var(--s-1); align-items: flex-start; }
.ord-tools { display: inline-flex; gap: var(--s-1); align-items: center; }
.fav-btn, .dk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: 0.78rem; font-weight: 600;
}
.fav-btn { width: 30px; padding: 0; }
.fav-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-btn[aria-pressed="true"] { color: #8a5a00; border-color: var(--highlight); background: var(--highlight-soft); }
.fav-btn[aria-pressed="true"] svg { fill: var(--highlight); stroke: #8a5a00; }
:root[data-theme="dark"] .fav-btn[aria-pressed="true"] { color: var(--highlight); }
.dk-btn { padding: 0 var(--s-2); }
.dk-btn[aria-pressed="true"] { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.fav-btn:hover, .dk-btn:hover { border-color: var(--line-strong); color: var(--text); }
@media (max-width: 720px) { .ord-cell { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; } #lista, #klass { flex: 1 1 140px; } }
@media print { .ord-tools { display: none; } }
.box { font-size: 0.72rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-pill); padding: 1px var(--s-2); white-space: nowrap; }
