/* ⌨️ Lanna Typing Helper — reusable module styles (MUST-DO §3 T5). Uses the host page's tokens when present (--line, --red, --bg…). */
@font-face { font-family: 'Tilok'; src: url('/dict/LN_TILOK_V6_05.TTF') format('truetype'); font-display: swap; }
.lt { --lt-red: var(--red, #B11F24); --lt-line: var(--line, #e5e5e5); --lt-bg: var(--bg, #fff); --lt-soft: var(--red-soft, #fdecec); --lt-muted: var(--muted, #6b7280); --lt-surface: var(--surface, #f7f7f7); position: relative; }
.lt-glyph, .lt-ln { font-family: 'Tilok', sans-serif; }
.lt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.lt-modes { display: inline-flex; background: var(--lt-surface); border: 1px solid var(--lt-line); border-radius: 999px; padding: 3px; }
.lt-modes button, .lt-bar > button, .lt-copy button { font: inherit; font-size: 14px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 999px; padding: 6px 12px; }
.lt-modes button.on { background: var(--lt-red); color: #fff; font-weight: 700; }
.lt-modes .lt-glyph { font-size: 1.15em; }
.lt-hint { font-size: 12.5px; color: var(--lt-muted); }
.lt kbd, .lt-comp kbd { font: inherit; font-size: 11.5px; border: 1px solid var(--lt-line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--lt-bg); }
.lt-bar > button, .lt-copy button { border: 1px solid var(--lt-line); background: var(--lt-bg); }
.lt-keys-btn[aria-expanded="true"] { background: var(--lt-soft) !important; border-color: var(--lt-red) !important; }
.lt-copy { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.lt-editor { min-height: 220px; border: 2px solid var(--lt-line); border-radius: 14px; padding: 14px 16px; background: var(--lt-bg); color: inherit; font-size: 19px; line-height: 2.1; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.lt-editor:focus { border-color: var(--lt-red); }
.lt[data-mode="ln"] .lt-editor { box-shadow: 0 0 0 4px var(--lt-soft); }
.lt[data-mode="raw"] .lt-editor { box-shadow: 0 0 0 4px #e0f2fe; }
.lt-editor:empty::before { content: attr(data-placeholder); color: var(--lt-muted); }
.lt-editor .lt-ln { color: var(--lt-red); font-size: 1.15em; padding: 0 1px; border-radius: 3px; }
.lt-editor .lt-ln:not(.lt-raw) { cursor: default; } .lt-editor .lt-ln:not(.lt-raw):hover { background: var(--lt-soft); }
.lt-editor .lt-raw { color: #0369a1; }
.lt-editor .lt-u { border-bottom: 2px dashed var(--lt-muted); }
.lt-keymap { border: 1px solid var(--lt-line); border-radius: 12px; padding: 8px; margin: 0 0 8px; background: var(--lt-surface); overflow-x: auto; }
.lt-keymap__note { margin: 0 0 6px; font-size: 12.5px; color: var(--lt-muted); }
.lt-keyrow { display: flex; gap: 4px; margin: 0 0 4px; } .lt-keyrow:nth-child(3) { padding-left: 14px; } .lt-keyrow:nth-child(4) { padding-left: 28px; } .lt-keyrow:nth-child(5) { padding-left: 42px; }
.lt-key { position: relative; width: 44px; height: 48px; flex: 0 0 auto; border: 1px solid var(--lt-line); border-radius: 8px; background: var(--lt-bg); cursor: pointer; padding: 0; color: inherit; }
.lt-key:hover { border-color: var(--lt-red); }
.lt-key__p { position: absolute; left: 6px; bottom: 4px; font-size: 20px; color: var(--lt-red); } .lt-key__s { position: absolute; right: 5px; top: 2px; font-size: 13px; color: var(--lt-muted); }
.lt-key small { position: absolute; right: 4px; bottom: 2px; font-size: 10px; color: var(--lt-muted); }
.lt-comp { position: absolute; z-index: 1000; background: var(--bg, #fff); color: var(--text, #111); border: 1px solid var(--line, #e5e5e5); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 8px; box-sizing: border-box; font-size: 15px; }
.lt-comp__in { width: 100%; box-sizing: border-box; font: inherit; font-size: 18px; border: 1px solid var(--red, #B11F24); border-radius: 8px; padding: 6px 10px; outline: none; background: transparent; color: inherit; }
.lt-comp__list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.lt-comp__list li { display: grid; grid-template-columns: 20px auto 1fr auto; column-gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.lt-comp__list li.on, .lt-comp__list li:hover { background: var(--red-soft, #fdecec); }
.lt-comp__n { font-size: 12px; color: var(--muted, #6b7280); }
.lt-comp__ln { font-size: 24px; color: var(--red, #B11F24); line-height: 1.2; } .lt-comp__r small { color: var(--muted, #6b7280); font-size: 12px; }
.lt-comp__m { grid-column: 3; grid-row: 2; color: var(--text-2, #444); font-size: 12.5px; line-height: 1.4; }
.lt-comp__d { grid-column: 4; grid-row: 1 / span 2; text-decoration: none; align-self: center; }
.lt-comp__list li.lt-comp__none { display: block; color: var(--muted, #6b7280); cursor: default; font-size: 14px; }
.lt-comp__foot { margin: 6px 2px 0; font-size: 11.5px; color: var(--muted, #6b7280); }
/* phase 2: AI tools, selection bar, preview, spelling check */
.lt-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lt-tools button { font: inherit; font-size: 14px; border: 1px solid var(--lt-line); background: var(--lt-bg); color: inherit; cursor: pointer; border-radius: 999px; padding: 6px 12px; }
.lt-tools button:hover, .lt-copy button:hover, .lt-bar > button:hover { border-color: var(--lt-red); }
.lt-toast { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--lt-surface); border: 1px solid var(--lt-line); font-size: 14px; }
.lt-toast a { color: var(--lt-red); }
.lt-editor .lt-multi { border-bottom: 2px dotted var(--lt-red); cursor: pointer; }
.lt-editor .lt-bad { background: #fee2e2; text-decoration: underline wavy #dc2626; text-underline-offset: 4px; }
.lt-comp__list li.lt-comp__ai { display: block; font-size: 13px; font-weight: 600; color: var(--red, #B11F24); cursor: default; background: none !important; }
.lt-comp__list li.lt-comp__ai a { color: inherit; }
.lt-comp__list li.lt-comp__ask { display: block; margin-top: 4px; border-top: 1px solid var(--line, #e5e5e5); border-radius: 0 0 8px 8px; color: var(--red, #B11F24); font-weight: 600; font-size: 14px; }
.lt-comp__list li.lt-comp__ask small { font-weight: 400; color: var(--muted, #6b7280); }
.lt-selbar { position: absolute; z-index: 999; display: flex; gap: 4px; background: #1f2937; border-radius: 10px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.lt-selbar button { font: inherit; font-size: 13.5px; color: #fff; background: none; border: 0; border-radius: 7px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.lt-selbar button:hover { background: rgba(255,255,255,.14); }
.lt-pop { position: absolute; z-index: 1000; background: var(--bg, #fff); color: var(--text, #111); border: 1px solid var(--line, #e5e5e5); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px 14px; box-sizing: border-box; font-size: 15px; }
.lt-pop button { font: inherit; font-size: 14px; border: 1px solid var(--line, #e5e5e5); background: var(--bg, #fff); color: inherit; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.lt-pop button.ok { background: var(--red, #B11F24); border-color: var(--red, #B11F24); color: #fff; font-weight: 700; }
.lt-pop__h { margin: 0 0 8px; font-weight: 700; }
.lt-pop__tabs { display: inline-flex; gap: 2px; background: var(--surface, #f7f7f7); border-radius: 999px; padding: 3px; margin-bottom: 8px; }
.lt-pop__tabs button { border: 0; background: none; } .lt-pop__tabs button.on { background: var(--red, #B11F24); color: #fff; font-weight: 700; }
.lt-pop__prev { font-size: 18px; line-height: 2; padding: 8px 10px; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; max-height: 260px; overflow: auto; }
.lt-pop__prev .lt-ln { font-family: 'Tilok', sans-serif; color: var(--red, #B11F24); font-size: 1.15em; } .lt-pop__prev .lt-u { border-bottom: 2px dashed var(--muted, #6b7280); }
.lt-pop__note { margin: 6px 0; font-size: 12.5px; color: var(--muted, #6b7280); }
.lt-pop__acts { display: flex; gap: 6px; }
.lt-pop__ch { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.lt-pop__ch button { width: 100%; display: flex; gap: 10px; align-items: baseline; border-radius: 10px; text-align: left; }
.lt-pop__ch .lt-glyph { font-size: 24px; color: var(--red, #B11F24); } .lt-pop__ch small { color: var(--text-2, #444); }
.lt-wait { display: flex; gap: 6px; padding: 6px 0; } .lt-wait span { width: 8px; height: 8px; border-radius: 50%; background: var(--red, #B11F24); opacity: .3; animation: ltb 1s infinite; }
.lt-wait span:nth-child(2) { animation-delay: .15s; } .lt-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes ltb { 50% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 600px) { .lt-hint { display: none; } .lt-copy { margin-left: 0; } .lt-editor { font-size: 18px; } }
