/* ============ Lexicon reference — the AI panel's vocabulary ============ */

:root {
    --accent: #4f46e5;
    --accent-soft: #eef2ff;
    --bg: #f4f6fa;
    --chrome: #ffffff;
    --border: #dde3ec;
    --text: #1f2937;
    --muted: #6b7280;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }
html { scroll-padding-top: 64px; }

/* ---------- Top bar ---------- */
.lr-top {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    height: 52px; padding: 0 18px;
    background: var(--chrome); border-bottom: 1px solid var(--border);
}
.lr-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.lr-brand svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lr-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lr-spacer { flex: 1; }
.lr-search { display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 34px; width: min(380px, 40vw); border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.lr-search:focus-within { border-color: var(--accent); }
.lr-search svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.lr-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 13px; background: transparent; color: var(--text); }
.lr-link { color: var(--accent); text-decoration: none; font-size: 13px; white-space: nowrap; }
.lr-link:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.lr-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0; max-width: 1480px; margin: 0 auto; }
.lr-toc { position: sticky; top: 52px; align-self: start; display: flex; flex-direction: column; gap: 1px; padding: 18px 10px; max-height: calc(100vh - 52px); overflow-y: auto; }
.lr-toc a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; }
.lr-toc a span { color: var(--muted); font-size: 11.5px; }
.lr-toc a:hover, .lr-toc a.on { background: var(--accent-soft); color: var(--accent); }
.lr-toc a.lr-dim { opacity: .4; }

main { padding: 18px 22px 64px; min-width: 0; }
.lr-howto h1 { margin: 2px 0 6px; font-size: 20px; }
.lr-howto p { margin: 0 0 8px; line-height: 1.6; color: #374151; max-width: 980px; }
code { padding: 1px 6px; border-radius: 5px; background: #eef2f7; font-size: 12.5px; color: #334155; }
.lr-empty { padding: 14px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }

.lr-section { margin-top: 26px; }
.lr-section h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 16px; }
.lr-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.lr-intro { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

/* ---------- Entries ---------- */
.lr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lr-grid-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lr-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; min-width: 0;
    border: 1px solid var(--border); border-radius: 9px; background: #fff;
    font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.lr-item:hover { border-color: #a5b4fc; box-shadow: 0 2px 10px rgba(79, 70, 229, .08); }
.lr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lr-wide { flex-direction: column; align-items: stretch; }
.lr-prev { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; min-height: 40px; color: #334155; }
.lr-prev svg { max-width: 64px; max-height: 48px; width: auto; height: auto; }
.lr-example {
    display: flex; align-items: center; justify-content: center;
    height: 170px; padding: 8px; border-radius: 6px;
    background: repeating-conic-gradient(#f6f7fb 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
}
.lr-example svg { max-width: 100%; max-height: 154px; width: auto; height: auto; }
.lr-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-term { font-weight: 650; font-size: 13px; color: #111827; overflow-wrap: anywhere; }
.lr-label { font-size: 12px; color: #4338ca; }
.lr-note { font-size: 11.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }

.lr-licences { margin: 6px 0 0; padding-left: 18px; line-height: 1.65; color: #374151; max-width: 980px; }
.lr-licences a { color: var(--accent); }

.lr-toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    padding: 9px 14px; border-radius: 8px; background: #111827; color: #fff; font-size: 13px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .25); max-width: min(560px, calc(100vw - 32px));
}
.lr-toast a { color: #c7d2fe; margin-left: 8px; }

@media (max-width: 860px) {
    .lr-body { grid-template-columns: 1fr; }
    .lr-toc { display: none; }
    .lr-sub { display: none; }
    .lr-top { padding: 0 12px; gap: 10px; }
    .lr-search { width: auto; flex: 1; }
    main { padding: 14px 16px 48px; }
}
