/* ═══════════════════════════════════════════════════════════════════════════
   wordlens.css — double-click any word, see it in your language.
   ═══════════════════════════════════════════════════════════════════════ */
::highlight(wl) { background: var(--pen); color: var(--ink); }
.wl-tap .lesson-body p, .wl-tap .lesson-body li, .wl-tap .lesson-body blockquote, .wl-tap .ls-hero h1, .wl-tap .ls-hero .lede { cursor: pointer; }

/* the dock */
.wl-dock { position: fixed; z-index: 60; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--cyc); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-2); }
.wl-dock button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; background: transparent; border-radius: 999px; font-family: var(--f-display); font-size: .88rem; color: var(--ink); font-variation-settings: 'opsz' 24, 'wdth' 100, 'wght' 640; cursor: pointer; transition: background .2s, color .2s; }
.wl-dock button:hover { background: var(--cyc-2); }
.wl-dock button:focus-visible, .wl-card button:focus-visible, .wl-chip:focus-visible, .wl-panel button:focus-visible { outline: 3px solid var(--sound); outline-offset: 2px; }
.wl-dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wl-dock .wl-lang { background: var(--sound); color: #fff; }
.wl-dock .wl-lang:hover { background: var(--sound-2); }
.wl-dock .wl-tapmode[aria-pressed="true"] { background: var(--ink); color: var(--cyc); }
.wl-dock .wl-mine b { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--pen); color: var(--ink); font-size: .74rem; }
.wl-dock .wl-mine b[hidden] { display: none; }
.wl-dock .wl-mine.pop svg { animation: wl-pop .6s var(--ease-out); }
@keyframes wl-pop { 0% { transform: scale(1) } 35% { transform: scale(1.7) rotate(-12deg); fill: var(--pen) } 100% { transform: scale(1) } }
.wl-hint { position: absolute; right: 0; bottom: calc(100% + 12px); width: max-content; max-width: min(320px, 82vw); padding: 12px 16px; background: var(--ink); color: var(--cyc); border-radius: 16px; font-size: .95rem; line-height: 1.4; box-shadow: var(--shadow-2); animation: wl-in .5s var(--ease-out); }
.wl-hint::after { content: ''; position: absolute; right: 36px; top: 100%; border: 8px solid transparent; border-top-color: var(--ink); }
.wl-hint[hidden] { display: none; }
@keyframes wl-in { from { opacity: 0; transform: translateY(8px) } }

/* the card */
.wl-card { position: absolute; z-index: 80; width: min(360px, calc(100vw - 24px)); padding: 16px 18px 12px; background: var(--cyc); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 18px 50px rgba(14, 17, 24, .22); color: var(--ink); font-size: 1rem; line-height: 1.4; }
.wl-card[hidden], .wl-chip[hidden], .wl-panel[hidden] { display: none; }
.wl-card.open { animation: wl-card .28s var(--ease-out); }
@keyframes wl-card { from { opacity: 0; transform: translateY(6px) scale(.97) } }
.wl-card > * + * { margin-top: 10px; }
.wl-card p { margin: 0; }
.wl-head { display: flex; align-items: center; gap: 6px; }
.wl-word { flex: 1; font-family: var(--f-display); font-size: 1.15rem; letter-spacing: -.01em; overflow-wrap: anywhere; font-variation-settings: 'opsz' 48, 'wdth' 100, 'wght' 720; }
.wl-ico { flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 999px; background: var(--cyc-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; transition: background .2s; }
.wl-ico:hover { background: var(--cyc-3); }
.wl-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wl-tr { font-size: 1.7rem; line-height: 1.2; font-family: var(--f-display); color: var(--sound); font-variation-settings: 'opsz' 72, 'wdth' 100, 'wght' 700; }
.wl-alt { color: var(--ink-2); font-size: .95rem; margin-top: 2px !important; }
.wl-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-meta span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--cyc-2); color: var(--ink-2); }
.wl-mean { color: var(--ink); }
.wl-ex { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--cyc-2); }
.wl-ex > button { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--cyc); color: var(--sound); cursor: pointer; box-shadow: var(--shadow-1); }
.wl-ex > button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wl-ex p { font-size: .95rem; }
.wl-exTr { color: var(--ink-2); margin-top: 2px !important; }
.wl-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-foot button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--cyc); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; transition: border-color .2s, background .2s; }
.wl-foot button:hover { border-color: var(--ink); }
.wl-foot button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.wl-foot button.on { background: var(--pen); border-color: var(--pen); }
.wl-foot button.on svg { fill: currentColor; }
.wl-foot button:disabled { opacity: .6; cursor: default; }
.wl-sent { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.wl-sent[hidden] { display: none; }
.wl-sen { color: var(--ink-2); font-size: .92rem; }
.wl-senTr { margin-top: 6px !important; font-size: 1.1rem; }
.wl-err, .wl-ask { color: var(--ink-2); }
.wl-change { display: block; width: 100%; margin-top: 8px !important; padding: 6px 0 2px; border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.wl-change:hover { color: var(--sound); text-decoration: underline; }
.wl-load { display: flex; gap: 6px; padding: 14px 0 8px; }
.wl-load i { width: 10px; height: 10px; border-radius: 50%; background: var(--sound); animation: wl-dot 1s ease-in-out infinite; }
.wl-load i:nth-child(2) { animation-delay: .15s; } .wl-load i:nth-child(3) { animation-delay: .3s; }
@keyframes wl-dot { 0%, 100% { opacity: .25; transform: scale(.8) } 50% { opacity: 1; transform: scale(1.15) } }

/* language picker inside the card */
.wl-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 46vh; overflow: auto; padding: 2px; margin-right: -4px; }
.wl-langs button { display: grid; gap: 1px; padding: 9px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cyc); text-align: center; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s; }
.wl-langs button:hover { border-color: var(--sound); background: var(--sound-soft); }
.wl-langs b { font-size: .95rem; line-height: 1.25; }
.wl-langs span { font-size: .7rem; color: var(--ink-3); }

/* phone: a bottom sheet */
.wl-card.sheet { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); top: auto; width: auto; max-height: 82vh; overflow: auto; border-radius: 24px; }
.wl-card.sheet.open { animation: wl-sheet .32s var(--ease-out); }
@keyframes wl-sheet { from { transform: translateY(40px); opacity: 0 } }

/* the "translate this phrase" chip */
.wl-chip { position: absolute; z-index: 70; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 0; border-radius: 999px; background: var(--sound); color: #fff; font-family: var(--f-display); font-size: .88rem; box-shadow: var(--shadow-2); cursor: pointer; font-variation-settings: 'opsz' 24, 'wdth' 100, 'wght' 650; animation: wl-in .25s var(--ease-out); }
.wl-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* My words */
.wl-panel { position: fixed; z-index: 85; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; padding: 14px 16px; background: var(--cyc); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 18px 50px rgba(14, 17, 24, .22); animation: wl-card .28s var(--ease-out); }
.wl-ph { display: flex; align-items: center; justify-content: space-between; }
.wl-ph h2 { font-size: 1.2rem; letter-spacing: -.02em; }
.wl-panel ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.wl-panel li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wl-panel li > div { flex: 1; display: grid; gap: 1px; min-width: 0; }
.wl-panel li b { font-size: 1.02rem; }
.wl-panel li span { color: var(--sound); }
.wl-pf { margin-top: 10px; }
.wl-pf button { padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--cyc); font: inherit; font-size: .9rem; cursor: pointer; }
.wl-empty { color: var(--ink-2); margin: 10px 0 4px; }

@media (max-width: 640px) {
  .wl-dock { right: 50%; transform: translateX(50%); }
  .wl-dock button { padding: 10px 12px; }
  .wl-dock .wl-tapmode span, .wl-dock .wl-mine span { display: none; }
  .wl-hint { right: 50%; transform: translateX(50%); text-align: center; }
  .wl-hint::after { right: calc(50% - 8px); }
  .wl-panel { right: 8px; left: 8px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .wl-card, .wl-panel, .wl-chip, .wl-hint, .wl-card.sheet.open { animation: none; } .wl-load i { animation: none; opacity: .6; } }
@media (max-width: 640px) { .wl-open .wl-dock { opacity: 0; pointer-events: none; } }

/* phrase cards and the Google fallback */
.wl-phr { background: var(--pen-soft); }
.wl-phr > button { color: var(--ink); }
.wl-phr b { font-family: var(--f-display); font-variation-settings: 'opsz' 24, 'wdth' 100, 'wght' 720; }
.wl-pl { margin-left: 6px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.wl-phr .wl-exTr { color: var(--sound); font-size: 1.05rem; }
.wl-phg { color: var(--ink-2); font-size: .88rem; margin-top: 2px !important; }
.wl-gt { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--cyc); color: var(--ink); font-size: .9rem; text-decoration: none; transition: border-color .2s; }
.wl-gt:hover { border-color: var(--ink); color: var(--ink); }
.wl-gt svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wl-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
