/* Equivalents page. Uses only tokens + primitives from assets/css/site.css. */

.eq-controls { display: grid; gap: 14px; padding: 16px; }
.eq-search input { font-size: 1.1rem; padding-top: 16px; padding-bottom: 16px; }
.eq-search::before { margin-top: -9px; }

main [hidden] { display: none !important; }

/* ---- direction ---- */
.eq-dir { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.eq-field { display: grid; gap: 4px; min-width: 0; }
.eq-field label { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.eq-dir .eq-field { flex: 1 1 140px; max-width: 260px; }
.eq-select {
    width: 100%; min-height: 44px; padding: 9px 12px;
    font: 600 .98rem var(--font); color: var(--text-1);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
}
.eq-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.eq-swap { min-height: 44px; min-width: 44px; justify-content: center; padding: 0 12px; font-size: 1.15rem; }

.eq-row-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.eq-row-controls .chips { flex: 1 1 auto; }
.eq-inline { flex: 0 1 190px; }
.eq-controls .chip { min-height: 40px; }
.eq-controls .chip:disabled { opacity: .45; cursor: default; }
.eq-controls .chip:disabled:hover { background: var(--surface); color: var(--text-2); }

.eq-az { display: flex; flex-wrap: wrap; gap: 4px; }
.eq-az button {
    min-width: 36px; min-height: 36px; padding: 0 6px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text-1);
    font: 700 .85rem var(--font); cursor: pointer;
}
.eq-az button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.eq-az button:disabled { color: var(--text-3); opacity: .45; cursor: default; }

.eq-statusbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.eq-statusbar .result-count { margin: 0; }
.eq-statusbar .btn { min-height: 40px; }
.eq-hidden { margin: 0 0 10px; }
.eq-hidden button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---- list / table ---- */
.eq-list { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: clip; box-shadow: var(--shadow-1); }
.eq-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.eq-table thead th {
    position: sticky; top: var(--header-h); z-index: 2;
    background: var(--surface-2); padding: 10px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.eq-table th:nth-child(1), .eq-table td:nth-child(1) { width: 27%; }
.eq-table th:nth-child(2), .eq-table td:nth-child(2) { width: 44px; padding-inline: 0; text-align: center; }
.eq-table th:nth-child(3), .eq-table td:nth-child(3) { width: 27%; }
.eq-table td { padding: 16px; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.eq-table tbody tr.eq-row:last-child td { border-bottom: 0; }
.eq-table tbody tr.eq-row:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

.eq-group-h {
    padding: 8px 16px; text-align: left; background: var(--surface-2);
    font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
    border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 52px);
}
.eq-table th.eq-group-h { width: auto; padding: 8px 16px; text-align: left; }
.eq-group-h .badge { margin-left: 8px; text-transform: none; letter-spacing: 0; }

.eq-lbl { display: none; margin-bottom: 4px; }
.eq-arr-d { display: none; }
.eq-arr-r { font-size: 1.5rem; line-height: 1.3; color: var(--text-3); }

.eq-term { font-size: 1.12rem; font-weight: 650; line-height: 1.35; color: var(--text-1); }
.eq-term a { color: var(--text-1); text-decoration-color: var(--border-strong); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.eq-term a:hover { color: var(--link); text-decoration-color: currentColor; }
.eq-ext { font-size: .8em; color: var(--text-3); margin-left: 3px; }
.eq-nodirect { display: grid; gap: 4px; justify-items: start; }
.eq-nodirect .eq-sub { font-size: .9rem; font-weight: 500; color: var(--text-2); }
.eq-none { color: var(--text-3); font-style: italic; font-weight: 500; }

.eq-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-weight: 650; }
.eq-anchor { color: var(--text-3); text-decoration: none; font-weight: 500; padding: 2px 6px; margin-left: -6px; border-radius: var(--radius-sm); }
.eq-anchor:hover { color: var(--link); background: var(--surface-2); }
.eq-cat { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.eq-notes {
    margin: 8px 0 0; padding: 8px 12px; font-size: .92rem; color: var(--text-2);
    border-left: 3px solid var(--warn); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: color-mix(in srgb, var(--warn) 7%, transparent);
}
.eq-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.eq-tag {
    font: 600 .75rem var(--font); color: var(--text-2); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; min-height: 26px; cursor: pointer;
}
.eq-tag:hover { color: var(--text-1); border-color: var(--border-strong); }
.eq-matched { font-size: .78rem; color: var(--text-2); }
.eq-matched strong { color: var(--text-1); }

.eq-row { scroll-margin-top: calc(var(--header-h) + 56px); }
.eq-row.eq-hit td { background: color-mix(in srgb, var(--brand-1) 11%, transparent); }
.eq-row.eq-hit td:first-child { box-shadow: inset 4px 0 0 var(--brand-1); }
@media (prefers-reduced-motion: no-preference) {
    .eq-row.eq-hit td { animation: eq-flash 1.6s ease-out 1; }
    @keyframes eq-flash { from { background-color: color-mix(in srgb, var(--brand-1) 30%, transparent); } }
}

.eq-empty-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.eq-more { display: flex; justify-content: center; margin: 18px 0 0; }
.eq-more .btn { min-height: 44px; }
.eq-foot { margin-top: 26px; max-width: 70ch; }

/* ---- stacked cards on small screens ---- */
@media (max-width: 820px) {
    .eq-table, .eq-table tbody, .eq-table tr, .eq-table td, .eq-table th { display: block; width: auto !important; }
    .eq-table { table-layout: auto; }
    .eq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .eq-table tr.eq-row { padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .eq-table tbody tr.eq-row:last-child { border-bottom: 0; }
    .eq-table td { padding: 0; border: 0 !important; text-align: left !important; }
    .eq-table tbody tr.eq-row:hover td { background: none; }
    .eq-lbl { display: block; }
    .eq-arrow { margin: 2px 0; }
    .eq-arr-r { display: none; }
    .eq-arr-d { display: block; font-size: 1.2rem; line-height: 1.2; color: var(--text-3); }
    .eq-info { margin-top: 12px; padding-top: 12px !important; border-top: 1px dashed var(--border) !important; }
    .eq-row.eq-hit { background: color-mix(in srgb, var(--brand-1) 11%, transparent); box-shadow: inset 4px 0 0 var(--brand-1); }
    .eq-row.eq-hit td, .eq-row.eq-hit td:first-child { background: none; box-shadow: none; animation: none; }
    .eq-term { font-size: 1.15rem; }
    .eq-dir .eq-field { max-width: none; }
    .eq-inline { flex: 1 1 140px; }
}
