/* Inline dictionary controls preserve the sentence's rhythm and line wrapping. */
.lookup-word{font:inherit;letter-spacing:inherit;line-height:inherit;color:inherit;display:inline;padding:0;margin:0;border:0;border-radius:3px;background:transparent;text-align:inherit;vertical-align:baseline;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;text-decoration-thickness:1px;cursor:help;white-space:normal;transition:background-color 120ms ease,text-decoration-color 120ms ease}
.lookup-word:active{transform:none!important}
.lookup-word:focus-visible,.lookup-word.lookup-active{background:var(--soft);text-decoration-color:var(--accent);outline-offset:2px}
@media(hover:hover) and (pointer:fine){.lookup-word:hover{background:var(--soft);text-decoration-color:var(--accent)}}
.lookup-popover{position:fixed;inset:auto;margin:0;width:min(330px,calc(100vw - 24px));padding:15px 17px 13px;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:17px;box-shadow:0 12px 40px -12px #202f2855;z-index:100;overflow-y:auto;overscroll-behavior:contain;cursor:default;font-family:'DM Sans','Segoe UI','Microsoft YaHei',sans-serif;text-align:left;line-height:1.65;scrollbar-width:thin;max-height:calc(100dvh - 24px)}
.lookup-popover[hidden]{display:none}
.lookup-popover:popover-open{animation:lookup-enter 150ms var(--ease)}
.lookup-popover::backdrop{background:transparent;pointer-events:none}
.lookup-top{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:10px;color:var(--muted);margin:-3px -4px 3px 0}
.lookup-top button{display:grid;place-items:center;width:32px;height:32px;border-radius:9px}
.lookup-top button:hover,.lookup-speak:hover{background:var(--soft)}
.lookup-top svg{width:15px;height:15px}
.lookup-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.lookup-popover h2{font:500 28px/1.2 Fraunces,Georgia,serif;overflow-wrap:anywhere;margin:0 0 5px;letter-spacing:-.4px}
.lookup-speak{display:grid;place-items:center;width:40px;height:40px;flex-shrink:0;border-radius:12px;color:var(--accent);background:var(--soft)}
.lookup-speak svg{width:19px;height:19px}
.lookup-ipa{color:var(--muted);font-size:12px;overflow-wrap:anywhere;margin:3px 0 9px}
.lookup-form{font-size:11px;color:var(--muted);line-height:1.7;margin:7px 0;overflow-wrap:anywhere}
.lookup-meanings{margin-top:11px;border-top:1px solid var(--line);padding-top:11px}
.lookup-zh{font-size:14px;line-height:1.9;white-space:pre-line;overflow-wrap:anywhere;margin:0}
.lookup-jp{font-size:12px;color:var(--muted);line-height:1.8;white-space:pre-line;margin:10px 0 0;overflow-wrap:anywhere}
.lookup-source{font-size:10px;color:var(--muted);line-height:1.8;margin-top:13px}
.lookup-empty,.lookup-loading{font-size:13px;line-height:1.9;color:var(--muted);margin:7px 0}
.lookup-help{font-size:10px;color:var(--muted);margin:10px 0 0;line-height:1.8}
@keyframes lookup-enter{from{opacity:0;transform:translateY(3px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:520px){.lookup-popover{padding:13px 16px}.lookup-top button{width:38px;height:38px}.lookup-speak{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.lookup-popover:popover-open{animation:none}.lookup-word{transition:none}}
