/* Общая панель: бумага и киноварь, цвета наследуются от системной темы приложения. */
.lookup-open { overflow: hidden; }
.lookup {
  width: 100%; max-width: 560px; height: 100%; height: 100dvh; max-height: 100dvh;
  margin: 0 auto; padding: 0; border: 0; background: var(--bg); color: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.lookup::backdrop { background: rgb(0 0 0 / .45); }
.lookup__header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.lookup__header h2 { margin: 0; font-size: 19px; }
.lookup__icon { border: 0; background: none; font-size: 30px; width: 44px; height: 44px; cursor: pointer; }
.lookup__body { padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
.lookup__intro { font-size: 14px; margin: 14px 0; }
.lookup__input, .lookup__translation {
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.lookup__label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.lookup textarea {
  display: block; width: 100%; box-sizing: border-box; resize: vertical; border: 0; background: none;
  color: var(--ink); font: inherit; font-size: 18px; min-height: 90px; padding: 4px 0; line-height: 1.6;
}
.lookup textarea:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.lookup button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lookup button:disabled { opacity: .5; cursor: default; }
.lookup__actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.lookup__tool {
  display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 44px;
  font-size: 14px; cursor: pointer;
}
.lookup__tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lookup__tool--recording { color: var(--accent); border-color: var(--accent); }
.lookup__send {
  margin-left: auto; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 28px; cursor: pointer;
}
.lookup__hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.lookup__photo { display: block; max-height: 180px; width: 100%; object-fit: contain; border-radius: 12px; }
.lookup__recording, .lookup__status { padding: 14px; border-radius: 12px; background: var(--surface); }
.lookup__recording { color: var(--accent); font-size: 14px; }
.lookup__pulse { display: inline-block; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; }
.lookup__status::before { content: '◌'; display: inline-block; margin-right: 8px; animation: lookup-spin 1.3s linear infinite; }
@keyframes lookup-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lookup__status::before { animation: none; } }
.lookup__error { padding: 0 4px; color: var(--accent); }
.lookup__result { margin-top: 20px; }
.lookup__chinese { font: 26px/1.55 var(--hanzi-font); margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lookup__reading { color: var(--muted); margin: 6px 0; overflow-wrap: anywhere; }
.lookup__russian { font-size: 18px; white-space: pre-wrap; margin: 10px 0; }
.lookup__explanation { font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.lookup h3 { font-size: 14px; font-weight: 500; margin: 20px 0 10px; color: var(--muted); }
.lookup__word {
  display: grid; grid-template-columns: minmax(48px, auto) 1fr auto 8px; align-items: center; gap: 10px;
  padding: 13px 10px; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 0; cursor: pointer;
}
.lookup__word:first-of-type { border-radius: 12px 12px 0 0; }
.lookup__word:last-child { border-bottom-width: 1px; border-radius: 0 0 12px 12px; }
.lookup__word:only-of-type { border-radius: 12px; }
.lookup__hanzi { font: 22px/1.4 var(--hanzi-font); overflow-wrap: anywhere; max-width: 100px; }
.lookup__pinyin { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.lookup__meaning { display: block; font-size: 13px; overflow-wrap: anywhere; }
.lookup__badge { background: var(--line); color: var(--ink); padding: 4px 6px; border-radius: 8px; font-size: 10px; }
.lookup__badge--outside { background: var(--surface); border: 1px solid var(--line); max-width: 70px; }
.lookup__back { border: 0; background: none; padding: 14px 0; color: var(--accent); cursor: pointer; }
button.nav__item { background: none; border: 0; cursor: pointer; font-family: inherit; }
