/* BaRaRan — переводчик. Лёгкий тёплый интерфейс; переменные ниже — единая точка смены стиля. */

:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --panel: #fbf8f4;
  --line: #ebe2d7;
  --line-2: #dccfbf;
  --ink: #231c17;
  --ink-2: #5a4f47;
  --ink-3: #75695f;
  --accent: #8e2b2b;
  --accent-2: #74201f;
  --accent-soft: #f7e9e6;
  --accent-line: #e4c3bd;
  --gold: #8a5a24;
  --gold-soft: #fbf0e3;
  --ok: #2f6b3c;
  --focus: #2f5bd3;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(35, 28, 23, .05), 0 18px 40px -22px rgba(35, 28, 23, .28);
  --shadow-pop: 0 2px 6px rgba(35, 28, 23, .08), 0 24px 60px -18px rgba(35, 28, 23, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Armenian", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif Armenian", "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(233, 166, 107, .16), transparent 60%),
    radial-gradient(900px 480px at 100% -5%, rgba(142, 43, 43, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }

/* ----------------------------------------------------------------- Шапка */
.hdr {
  max-width: 1120px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font: 500 25px/1 var(--serif);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font: 700 20px/1.1 var(--serif); letter-spacing: .01em; }
.brand-text small { font-size: 12.5px; color: var(--ink-3); }
.hdr-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(35, 28, 23, .06); color: var(--ink); }

/* Сегментированный переключатель */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #efe7dd; }
.seg > a, .seg > button {
  min-height: 34px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg > a:hover, .seg > button:hover { color: var(--ink); }
.seg > [aria-current="true"], .seg > [aria-pressed="true"], .seg > [aria-selected="true"] {
  background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(35, 28, 23, .14);
}
.seg-ui { margin-right: 6px; }
.seg-sm > button { min-height: 28px; padding: 0 10px; font-size: 12.5px; }

/* --------------------------------------------------------------- Основное */
.main { max-width: 1120px; margin: 0 auto; padding: 8px 24px 24px; }
.intro { text-align: center; margin: 18px auto 26px; max-width: 720px; }
.intro h1 { margin: 0 0 8px; font: 650 34px/1.15 var(--font); letter-spacing: -.015em; text-wrap: balance; }
.intro p { margin: 0; color: var(--ink-2); font-size: 16.5px; text-wrap: pretty; }

/* Окно переводчика */
.tr {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "bar bar" "src dst" "opts opts";
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.tr-bar {
  grid-area: bar; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.lang-pick { position: relative; display: flex; align-items: center; padding: 8px 12px; }
.lang-pick { min-width: 0; }
.lang-pick + .swap + .lang-pick { border-left: 1px solid var(--line); padding-left: 34px; }
.lang-pick select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--ink); padding: 10px 38px 10px 12px; border-radius: 12px;
  min-height: 44px; max-width: 100%;
}
.lang-pick select:hover { background: rgba(35, 28, 23, .05); }
/* Стрелка стоит сразу после названия языка и не перехватывает клики. */
.lang-pick .chev { margin-left: -34px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.swap {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line-2); color: var(--accent); box-shadow: 0 2px 8px rgba(35, 28, 23, .08);
  transition: transform .25s ease, background .15s;
}
.swap:hover { background: var(--accent-soft); }
.swap.is-spin { transform: translate(-50%, -50%) rotate(180deg); }

.pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 250px; }
.pane-src { grid-area: src; }
.pane-dst { grid-area: dst; background: var(--panel); border-left: 1px solid var(--line); }

#src {
  flex: 1; width: 100%; min-height: 190px; max-height: 60vh; resize: none; border: 0; outline: 0; background: transparent;
  padding: 20px 52px 10px 22px; font-size: 21px; line-height: 1.45; color: var(--ink);
}
#src::placeholder { color: #9a8e84; }
#src:focus-visible { outline: none; }
.pane-src:focus-within { box-shadow: inset 0 0 0 2px rgba(47, 91, 211, .18); }
.clear {
  position: absolute; right: 10px; top: 12px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3);
}
.clear:hover { background: rgba(35, 28, 23, .06); color: var(--ink); }

.tools { display: flex; align-items: center; gap: 2px; padding: 6px 12px 10px; }
.tool {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.tool:hover { background: rgba(35, 28, 23, .06); color: var(--ink); }
.tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.tool-star[aria-pressed="true"] svg { fill: currentColor; }
#mic[aria-pressed="true"] { animation: pulse 1.4s ease-out infinite; }
.tool.is-hint { box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.count { margin-left: auto; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.count.is-warn { color: #a5521b; }
.count.is-over { color: var(--accent); font-weight: 600; }

/* Результат */
.dst-head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 12px 16px 0 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--gold); background: var(--gold-soft);
}
.badge.is-dict { color: var(--ok); background: #e9f3ea; }
#translit-mode { margin-left: auto; }
.dst-empty { margin: 0; padding: 8px 22px; color: #9a8e84; font-size: 21px; line-height: 1.45; }
.dst-text {
  padding: 6px 22px 0; font-size: 21px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink); animation: fade .25s ease;
}
.dst-text:lang(hy) { font-size: 22px; }
.dst-translit { margin: 8px 0 0; padding: 0 22px; color: var(--gold); font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.tools-dst { margin-top: auto; padding-top: 12px; }
.skeleton { padding: 14px 22px; display: grid; gap: 12px; }
.skeleton span {
  height: 16px; border-radius: 8px; background: linear-gradient(90deg, #efe7dd 0%, #f8f3ed 40%, #efe7dd 80%); background-size: 300% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton span:nth-child(1) { width: 92%; }
.skeleton span:nth-child(2) { width: 76%; }
.skeleton span:nth-child(3) { width: 54%; }

/* Нижняя панель окна */
.tr-opts {
  grid-area: opts; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px;
  padding: 14px 16px 14px 20px; border-top: 1px solid var(--line); background: #fff;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip[aria-pressed="true"]::before {
  content: ""; width: 14px; height: 14px; margin-left: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-go {
  margin-left: auto; position: relative; min-height: 50px; padding: 0 18px 0 24px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; font-size: 16.5px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 18px -8px rgba(142, 43, 43, .65);
  transition: background .15s, transform .1s;
}
.btn-go:hover { background: var(--accent-2); }
.btn-go:active { transform: translateY(1px); }
.btn-go .go-icon { width: 20px; height: 20px; stroke-width: 2; }
.go-kbd { font: 600 11.5px/1 var(--font); padding: 5px 7px; border-radius: 6px; background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9); }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-go.is-busy .go-icon { display: none; }
.btn-go.is-busy .spinner { display: block; }

/* Армянская клавиатура */
.kbd {
  display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; padding: 12px 14px 14px;
  border-top: 1px solid var(--line); background: var(--panel); animation: fade .2s ease;
}
.key {
  min-height: 46px; border-radius: 9px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.key b { font: 500 18px/1 var(--font); }
.key small { font-size: 10.5px; line-height: 1; color: var(--ink-3); }
.key:hover { border-color: var(--line-2); background: #fffdf9; }
.key:active { transform: translateY(1px); box-shadow: none; }
.key-wide { grid-column: span 2; }
.key-space { grid-column: span 6; }
.key-fn { color: var(--ink-2); font-size: 13px; }
.key-fn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* Дополнительные карточки под окном */
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-top: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px;
  box-shadow: 0 1px 2px rgba(35, 28, 23, .04); animation: rise .3s ease both;
}
.card h3 { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.card p { margin: 0; line-height: 1.55; color: var(--ink-2); }
.card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alt-btn {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid transparent;
  font-size: 16px; line-height: 1.4; color: var(--ink); display: block;
}
.alt-btn:hover { border-color: var(--line-2); background: #fff; }
.tl { display: block; margin-top: 2px; font-size: 13.5px; color: var(--gold); }
.ex-src { display: block; color: var(--ink-2); font-size: 14.5px; }
.ex-dst { display: block; color: var(--ink); font-size: 16px; margin-top: 2px; }
.ex-item { padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.dict-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.dict-word { font-size: 13.5px; color: var(--ink-3); }
.dict-word i { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #efe7dd; font-size: 11.5px; }
.dict-tr { font-size: 17px; color: var(--ink); }
.dict-note { font-size: 13.5px; color: var(--ink-2); }

.demo-note {
  margin: 16px auto 0; max-width: max-content; padding: 8px 14px; border-radius: 999px; font-size: 13.5px;
  color: var(--gold); background: var(--gold-soft); border: 1px dashed #e6c9a3;
}

/* ----------------------------------------------------------------- Подвал */
.ftr { max-width: 1120px; margin: 24px auto 0; padding: 18px 24px 110px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.ftr-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.ftr-links button { padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.ftr-links button:hover { color: var(--ink); background: rgba(35, 28, 23, .05); }
.ftr-meta { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; color: var(--ink-3); }
.ftr-meta a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.ftr-meta a:hover { color: var(--accent); }
.ftr-meta svg { width: 14px; height: 14px; }

/* ----------------------------------------------------------------- Помощник */
.fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 22px 0 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 28px -10px rgba(35, 28, 23, .6); transition: transform .15s, background .15s;
}
.fab svg { color: #f2b77d; width: 22px; height: 22px; }
.fab:hover { transform: translateY(-2px); background: #3a2f27; }
.fab[aria-expanded="true"] { opacity: 0; pointer-events: none; transform: scale(.9); }
.fab-dot { position: absolute; top: 6px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #f2b77d; box-shadow: 0 0 0 2px var(--ink); }

.helper {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50;
  width: 390px; height: min(620px, calc(100dvh - 40px)); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-pop); overflow: hidden;
  transform-origin: bottom right; animation: pop .22s cubic-bezier(.2, .8, .3, 1.1);
}
.helper-backdrop { display: none; }
.helper-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-bottom: 1px solid var(--line); }
.helper-ava { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 500 22px/1 var(--serif); flex: none; }
.helper-titles { flex: 1; min-width: 0; }
.helper-titles h2 { margin: 0; font-size: 15.5px; line-height: 1.2; }
.helper-titles p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.helper-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg {
  max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  animation: rise .2s ease both;
}
.msg-bot { align-self: flex-start; background: #f3ede6; color: var(--ink); border-bottom-left-radius: 6px; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg-act {
  align-self: flex-start; margin-top: -4px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
}
.msg-act svg { width: 16px; height: 16px; }
.msg-typing { display: inline-flex; gap: 4px; padding: 14px; }
.msg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.msg-typing i:nth-child(2) { animation-delay: .15s; }
.msg-typing i:nth-child(3) { animation-delay: .3s; }
.helper-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.helper-chips:empty { display: none; }
.helper-chips button {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; color: var(--ink-2); text-align: left;
}
.helper-chips button:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.helper-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.helper-form input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); font-size: 16px;
}
.helper-form input:focus { outline: none; border-color: var(--focus); background: #fff; box-shadow: 0 0 0 3px rgba(47, 91, 211, .15); }
.helper-send { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.helper-send:hover { background: var(--accent-2); }
.helper-send:disabled { opacity: .5; cursor: default; }

/* Подсветка элемента по кнопке «Показать на странице» */
.is-spot { position: relative; z-index: 5; animation: spot 1.8s ease-out 2; border-radius: 12px; }

/* --------------------------------------------------------- Диалоги (модалки) */
.dlg {
  width: min(560px, calc(100% - 32px)); max-height: min(80vh, 760px); padding: 0; border: 0; border-radius: 22px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop);
}
.dlg[open] { animation: pop .22s cubic-bezier(.2, .8, .3, 1.1); }
.dlg::backdrop { background: rgba(35, 28, 23, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg-in { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 8px 24px; }
.dlg-head h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.dlg-head form { margin: 0; }
.dlg-body { overflow-y: auto; padding: 4px 24px 24px; }
.prose { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose h3 { margin: 18px 0 6px; font-size: 15.5px; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.dlg-tabs { margin: 4px 24px 10px; align-self: flex-start; }
.hist-list { list-style: none; margin: 0; padding: 0 12px 8px; overflow-y: auto; display: grid; gap: 6px; }
.hist-item { display: flex; align-items: flex-start; gap: 4px; padding: 4px; border-radius: 14px; }
.hist-item:hover { background: var(--panel); }
.hist-open { flex: 1; min-width: 0; text-align: left; padding: 8px 10px; border-radius: 10px; display: grid; gap: 2px; }
.hist-src, .hist-dst { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.hist-src { font-size: 14px; color: var(--ink-2); }
.hist-dst { font-size: 16px; color: var(--ink); }
.hist-meta { font-size: 12px; color: var(--ink-3); }
.hist-item .tool { width: 38px; height: 38px; }
.hist-empty { margin: 0; padding: 20px 24px 28px; color: var(--ink-3); text-align: center; }
.dlg-foot { padding: 8px 16px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(35, 28, 23, .06); color: var(--accent); }
.btn-ghost svg { width: 18px; height: 18px; }
.btn-ghost.is-confirm { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ Тосты */
.toasts { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14.5px; line-height: 1.4;
  box-shadow: 0 12px 30px -12px rgba(35, 28, 23, .6); animation: drop .25s ease both; pointer-events: auto;
}
.toast.is-error { background: var(--accent); }
.toast.is-out { animation: fadeout .3s ease forwards; }
.noscript { position: fixed; inset: auto 12px 12px; padding: 12px 16px; border-radius: 12px; background: var(--accent); color: #fff; text-align: center; }

/* -------------------------------------------------------------- Анимации */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(142, 43, 43, .35); } 100% { box-shadow: 0 0 0 12px rgba(142, 43, 43, 0); } }
@keyframes spot { 0% { box-shadow: 0 0 0 0 rgba(233, 166, 107, .9); } 100% { box-shadow: 0 0 0 14px rgba(233, 166, 107, 0); } }

/* ---------------------------------------------------------------- Планшет */
@media (max-width: 900px) {
  .kbd { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .key-space { grid-column: span 4; }
}

/* -------------------------------------------------------------- Смартфон */
@media (max-width: 760px) {
  .hdr { padding: 10px 12px; gap: 8px; }
  .brand-mark { width: 36px; height: 36px; font-size: 22px; border-radius: 11px; }
  .brand-text b { font-size: 18px; }
  .brand-text small { display: none; }
  .seg-ui { margin-right: 0; }
  .seg-ui > a { padding: 0 9px; font-size: 13px; min-height: 32px; }
  .icon-btn { width: 40px; height: 40px; }
  .main { padding: 0 10px 16px; }
  .intro { margin: 8px auto 14px; }
  .intro h1 { font-size: 23px; margin-bottom: 4px; }
  .intro p { font-size: 14.5px; }

  .tr { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "src" "opts" "dst"; border-radius: 20px; }
  .tr-bar { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); align-items: center; }
  .lang-pick { padding: 6px 4px; }
  .lang-pick + .swap + .lang-pick { border-left: 0; padding-left: 4px; }
  .lang-pick select { font-size: 15.5px; padding: 10px 30px 10px 10px; width: 100%; }
  .lang-pick .chev { margin-left: -28px; }
  .swap { position: static; transform: none; width: 42px; height: 42px; justify-self: center; }
  .swap.is-spin { transform: rotate(180deg); }
  .pane { min-height: 0; }
  #src { min-height: 132px; font-size: 18px; padding: 14px 46px 6px 16px; }
  .clear { top: 8px; right: 6px; }
  .tools { padding: 2px 8px 8px; }
  .pane-dst { border-left: 0; border-top: 1px solid var(--line); min-height: 150px; }
  .pane-dst.is-idle { display: none; }
  .dst-head { padding: 10px 12px 0 16px; min-height: 40px; }
  .dst-empty, .dst-text { padding-left: 16px; padding-right: 16px; font-size: 19px; }
  .dst-text:lang(hy) { font-size: 20px; }
  .dst-translit { padding: 0 16px; }
  .skeleton { padding: 12px 16px; }

  .tr-opts { padding: 10px 12px 12px; gap: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; width: calc(100% + 24px); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  #tone { width: 100%; }
  #tone > button { flex: 1; padding: 0 6px; font-size: 13.5px; }
  .btn-go { width: 100%; margin-left: 0; min-height: 52px; font-size: 17px; }
  .go-kbd { display: none; }

  .kbd { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 10px 8px 12px; }
  .key { min-height: 48px; }
  .key b { font-size: 19px; }
  .key-space { grid-column: span 2; }

  .extras { gap: 10px; margin-top: 12px; }
  .ftr { padding-bottom: 100px; }

  .fab { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: 56px; height: 56px; padding: 0; justify-content: center; }
  .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fab svg { width: 26px; height: 26px; }
  .helper-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(35, 28, 23, .38); animation: fade .2s ease; }
  .helper-backdrop[hidden] { display: none !important; }
  .helper {
    left: 0; right: 0; bottom: 0; width: auto; height: min(88dvh, 720px);
    border-radius: 22px 22px 0 0; border-bottom: 0; transform-origin: bottom center;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dlg {
    width: 100%; max-width: none; max-height: 88dvh; margin: auto 0 0; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dlg-head { padding: 14px 10px 6px 18px; }
  .dlg-body { padding: 4px 18px 22px; }
  .dlg-tabs { margin: 4px 18px 10px; }
  .hist-list { padding: 0 6px 8px; }
  html.is-locked, html.is-locked body { overflow: hidden; }
}

/* Узкие телефоны (360–400 px) */
@media (max-width: 400px) {
  .hdr { padding: 10px 8px; }
  .hdr-actions { gap: 2px; }
  .seg-ui > a { padding: 0 7px; }
  .icon-btn { width: 38px; }
  #tone > button { min-width: 0; padding: 0 4px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Approved BaRaRaN design: mint, parchment and illuminated Armenian lettering. */
:root {
 --bg:#c4e5d2; --card:#fff6ea; --panel:#fbf6ef; --line:#dfc7aa; --line-2:#d6b588;
 --ink:#062d15; --ink-2:#173a27; --ink-3:#596b69; --accent:#005323; --accent-2:#003c18;
 --accent-soft:#e6f0e4; --accent-line:#a6c8a9; --gold:#bd7907; --gold-soft:#fff2da;
 --r-lg:26px; --r-md:19px; --shadow:0 10px 14px -8px #396b4299,0 1px 1px #fff inset;
 --font:Arial,"Segoe UI","Noto Sans Armenian",sans-serif; --serif:Georgia,"Times New Roman",serif;
}
body {background:radial-gradient(ellipse at 48% 40%,#e0f0de99,transparent 67%),radial-gradient(ellipse at 4% 75%,#b5dec6aa,transparent 45%),#c4e5d2; color:var(--ink);}
button,a,select {-webkit-tap-highlight-color:transparent;}
button:disabled {cursor:default; opacity:.48;}
button:not(:disabled),a,select {transition:background .16s,color .16s,box-shadow .16s,transform .16s;}
svg {flex-shrink:0;}
.hdr {max-width:1540px;min-height:98px;margin:auto;padding:15px 24px 12px;display:flex;align-items:center;gap:30px;}
.brand {gap:15px;flex-shrink:0;}
.brand-mark {width:66px;height:70px;border:0;border-radius:0;background:none;box-shadow:none;object-fit:contain;}
.brand-text b {font:700 35px/1.03 var(--serif);letter-spacing:0;}
.brand-text small {display:block;font:700 29px/1.12 var(--serif);color:var(--ink);}
.main-nav {display:flex;align-items:center;justify-content:space-between;gap:26px;margin-left:auto;white-space:nowrap;}
.main-nav a,.main-nav button {position:relative;font-size:17px;color:#101c13;text-decoration:none;padding:10px 0;}
.main-nav .is-active {font-weight:700;}
.main-nav .is-active:after {content:"";position:absolute;bottom:-7px;left:0;right:0;height:4px;background:var(--ink);border-radius:5px;}
.main-nav a:hover,.main-nav button:hover {color:var(--accent);}
.hdr-actions {gap:11px;flex-shrink:0;}
.seg {background:linear-gradient(#fff9f0,#faecd9);border:1px solid #ead6bb;box-shadow:0 2px 3px #a7763025;padding:1px;gap:0;}
.seg>a,.seg>button {color:#152118;}
.seg-ui {border-color:#e4b251;margin:0;}
.seg-ui>a {font-size:17px;min-height:38px;padding:0 13px;display:flex;align-items:center;justify-content:center;}
.seg-ui>[aria-current="true"] {background:linear-gradient(#fa1016,#ce0000);color:#fff;box-shadow:0 2px 4px #a9333d44;}
.profile-btn svg {width:31px;height:31px;stroke-width:1.5;}
.main {max-width:1426px;padding:0 24px 8px;margin:auto;}
.intro {position:relative;max-width:none;display:flex;align-items:center;justify-content:center;min-height:200px;margin:0 -30px 10px;gap:32px;text-align:center;}
.hero-art {display:flex;align-items:center;gap:15px;width:425px;flex-shrink:0;}
.hero-bird {width:240px;height:auto;mix-blend-mode:darken;}
.hero-letter {width:145px;height:auto;}
.hero-type {flex:1;max-width:760px;border-left:1px solid #cf9324;padding-left:29px;}
.intro h1 {font:700 clamp(70px,6.7vw,108px)/1.03 var(--serif);letter-spacing:-.035em;margin:0 0 2px;color:#002c0d;text-shadow:0 2px 0 #eff9e1;}
.intro p {font-size:18px;line-height:1.5;font-weight:600;letter-spacing:4px;text-transform:uppercase;color:#b77903;margin:0;}
.ornament {display:flex;align-items:center;gap:8px;margin-top:7px;color:#bd7a04;font:24px/1 var(--serif);}
.ornament:before,.ornament:after {content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,#bd7a04);}
.ornament:after {transform:scaleX(-1);}
.hero-alphabet {position:relative;display:block;width:190px;aspect-ratio:1.08;flex-shrink:0;font:43px/1 var(--serif);letter-spacing:0;color:#70b88b;opacity:.8;user-select:none;text-decoration:none;border-radius:20px;}
.hero-alphabet:hover,.hero-alphabet:focus-visible {color:#267340;opacity:1;background:#f8fff44d;box-shadow:0 0 0 1px #739d7959,0 6px 22px #376e3820;}
.hero-alphabet span {position:absolute;display:block;left:var(--glyph-x);top:var(--glyph-y);font-size:var(--glyph-size,1em);line-height:1;letter-spacing:0;transform:translate(-50%,-50%) rotate(var(--glyph-angle));opacity:var(--glyph-opacity,1);}
.hero-alphabet span:nth-child(1) {--glyph-x:63%;--glyph-y:18%;--glyph-angle:22deg;--glyph-size:1.08em;--glyph-opacity:.86;}
.hero-alphabet span:nth-child(2) {--glyph-x:15%;--glyph-y:25%;--glyph-angle:-24deg;--glyph-size:.96em;--glyph-opacity:.72;}
.hero-alphabet span:nth-child(3) {--glyph-x:40%;--glyph-y:42%;--glyph-angle:15deg;--glyph-size:1.15em;}
.hero-alphabet span:nth-child(4) {--glyph-x:84%;--glyph-y:48%;--glyph-angle:-11deg;--glyph-size:.9em;--glyph-opacity:.85;}
.hero-alphabet span:nth-child(5) {--glyph-x:15%;--glyph-y:68%;--glyph-angle:-17deg;--glyph-size:1.08em;--glyph-opacity:.9;}
.hero-alphabet span:nth-child(6) {--glyph-x:60%;--glyph-y:65%;--glyph-angle:28deg;--glyph-size:1.02em;--glyph-opacity:.76;}
.hero-alphabet span:nth-child(7) {--glyph-x:84%;--glyph-y:82%;--glyph-angle:10deg;--glyph-size:.95em;--glyph-opacity:.82;}
.hero-alphabet span:nth-child(8) {--glyph-x:38%;--glyph-y:85%;--glyph-angle:-13deg;--glyph-size:1.12em;}
.hero-alphabet span:nth-child(9) {--glyph-x:88%;--glyph-y:17%;--glyph-angle:-15deg;--glyph-size:.75em;--glyph-opacity:.9;}
.tr {padding:16px 20px 12px;gap:14px 18px;border:1px solid #efb13f;border-radius:26px;background:linear-gradient(115deg,#fff7ed,#fbefdf);box-shadow:var(--shadow);overflow:visible;}
.tr-bar {grid-template-columns:minmax(0,1fr) 62px minmax(0,1fr);gap:12px;align-items:center;border:0;}
.language-group {display:flex;gap:20px;align-items:center;min-width:0;padding:0 9px 0 27px;}
.language-group:last-child {padding:0 18px 0 18px;}
.language-tabs {flex-shrink:0;}
.language-tabs>button {min-width:66px;min-height:43px;padding:0 14px;font-size:20px;font-weight:600;}
.language-tabs>[aria-pressed="true"] {background:radial-gradient(ellipse at 50% 5%,#40874b,transparent 55%),linear-gradient(#005220,#002a0d);color:#fff;box-shadow:0 2px 5px #4d4c2e55;}
.lang-pick {padding:0;flex:1;border:1px solid #ead6bb;border-radius:30px;background:linear-gradient(#fffaf3,#faeee0);box-shadow:0 2px 3px #b17a3c35;}
.lang-pick select {width:100%;max-width:none;font-size:20px;min-height:43px;padding:8px 38px 8px 23px;border-radius:30px;color:#101a13;}
.lang-pick .chev {width:22px;height:22px;color:#0e2016;}
.swap {position:static;transform:none;justify-self:center;width:54px;height:54px;background:linear-gradient(#fffdf4,#fff5e4);border:1px solid #dda031;box-shadow:0 2px 5px #bb8b2340;}
.swap svg {width:28px;height:28px;stroke-width:1.6;}
.swap.is-spin {transform:rotate(180deg);}
.pane {min-height:180px;border:1px solid #dfc8ad;border-radius:20px;background:radial-gradient(ellipse at 50% 90%,#fffaf3aa,transparent 85%),#f6f0e8;box-shadow:0 1px 1px #fff9 inset;overflow:hidden;}
.pane-dst {border-left:1px solid #dfc8ad;}
.pane-dst.is-idle {display:flex;}
#src {font-size:21px;min-height:126px;max-height:420px;padding:15px 45px 5px 26px;}
#src::placeholder,.dst-empty {color:#58687b;opacity:1;}
.pane-src:focus-within {box-shadow:inset 0 0 0 2px #7aaf8a;}
.tools {padding:3px 16px 7px;gap:14px;margin-top:auto;}
.tool {color:#0c1912;width:38px;height:38px;border-radius:9px;}
.tool svg {width:26px;height:26px;stroke-width:1.7;}
.tool:hover {background:#dce8d5;}
.count {font-size:18px;color:#536b82;}
.dst-head {min-height:0;padding:0 24px;justify-content:space-between;}
.dst-head:has(.badge:not([hidden])) {padding-top:11px;}
.dst-empty {padding:15px 25px;font-size:21px;}
.dst-text {font-size:23px;padding:12px 25px 2px;line-height:1.55;}
.dst-text:lang(hy) {font-size:24px;}
.dst-translit {padding:0 25px;font-size:15px;margin-top:6px;color:#8b6829;}
.tools-dst {justify-content:flex-end;padding-top:3px;gap:17px;}
#fav {display:none;}
#dst-tools.has-result #fav {display:grid;}
.badge {font-size:11px;}
.tr-opts {background:transparent;padding:0 3px;border:0;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.local-mode {display:flex;align-items:center;gap:8px;margin:0;color:#63715d;font-size:12px;}
.status-dot {width:6px;height:6px;border-radius:50%;background:#76a576;}
.translation-actions {display:flex;gap:12px;align-items:center;}
.btn-go {background:linear-gradient(#126333,#00421a);border:1px solid #004318;box-shadow:0 2px 3px #1c482833;min-height:36px;padding:0 17px;border-radius:24px;font-size:14px;gap:12px;margin:0;}
.go-kbd {font-size:10px;opacity:.55;}
.btn-ai {display:flex;align-items:center;gap:7px;font-size:13px;color:#456645;padding:7px 10px;border-radius:20px;}
.btn-ai svg {width:18px;height:18px;}
.btn-ai:hover:not(:disabled) {background:#e4e7d1;}
.lookup-feedback {margin:16px 0 0;padding:18px 22px;border:1px solid #d4b779;border-radius:18px;background:#fff8eb;}
.lookup-feedback h2 {font-size:18px;margin:0 0 5px;}
.lookup-feedback p {color:#556253;font-size:14px;margin:4px 0;}
.suggestion-list {display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
.suggestion-list button {background:#e7efdf;border:1px solid #bdd0b7;border-radius:20px;padding:6px 14px;}
.extras {margin-top:16px;}
.card {background:#fffbf4;border-color:#dfc7a2;border-radius:18px;box-shadow:0 3px 6px #3a614015;}
.dict-item {padding:9px 0;border-bottom:1px solid #e7decf;}
.dict-item:last-child {border:0;}
.dict-source {font-size:11px;color:#65745e;display:block;}
.reference-link {text-decoration:underline;text-underline-offset:3px;color:var(--accent);text-align:left;}
.quick-links {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));margin:21px -1px 25px;}
.quick-links button {position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;min-height:69px;padding:0 8px;font-size:18px;line-height:1.35;color:#102316;}
.quick-links button+button:before {content:"";position:absolute;left:0;top:6px;bottom:0;width:1px;background:#d09c35;}
.quick-links svg {width:34px;height:34px;stroke:#20311b;stroke-width:1.5;filter:drop-shadow(1px 1px 0 #ffebbb);}
.alphabet-icon {font:33px/1.03 var(--serif);height:34px;}
.quick-links button:hover {transform:translateY(-2px);color:var(--accent);}
.partners {display:grid;grid-template-columns:1.08fr 1fr;gap:27px;margin:0 -35px;}
.partner-card {min-width:0;display:flex;align-items:center;gap:18px;padding:6px 27px 6px 22px;min-height:96px;text-align:left;text-decoration:none;color:var(--ink);border:1px solid #ecb044;border-radius:27px;background:linear-gradient(110deg,#fff8ed,#fff0df);box-shadow:var(--shadow);}
.partner-card>img {object-fit:contain;flex-shrink:0;mix-blend-mode:darken;}
.partner-name {font:700 30px/1 var(--serif);white-space:nowrap;}
.partner-copy {display:flex;flex-direction:column;min-width:0;line-height:1.22;gap:6px;flex:1;}
.partner-name+.partner-copy {border-left:1px solid #bf7b12;padding-left:22px;margin-left:3px;}
.partner-copy b {font-size:20px;}
.partner-copy small {font-size:16px;color:#102316;}
.partner-card>svg {width:26px;height:26px;margin-left:auto;}
.partner-card:hover {transform:translateY(-2px);}
.ftr {max-width:1540px;padding:32px 24px 22px;margin:0 auto;display:flex;justify-content:space-between;align-items:center;gap:30px;text-align:left;}
.footer-brand {display:flex;align-items:center;gap:16px;text-decoration:none;color:var(--ink);font:700 25px/1 var(--serif);white-space:nowrap;}
.footer-brand img {object-fit:contain;}
.ftr-links {flex:1;justify-content:space-evenly;border-left:1px solid #bd8b23;padding:6px 0 6px 20px;gap:8px;}
.ftr-links button {font-size:15px;color:#142a1a;padding:8px;}
.footer-help {padding:10px;display:grid;place-items:center;}
.footer-help svg {width:28px;height:28px;}
.fab {width:43px;height:43px;min-height:0;bottom:16px;right:17px;padding:0;justify-content:center;background:#075126;box-shadow:0 3px 10px #214d3738;}
.fab-label {display:none;}
.fab svg {width:22px;height:22px;color:#f3d293;}
.fab-dot {width:6px;height:6px;top:2px;right:3px;}
.dlg {border-color:#cfa76a;background:#fffbf3;}
.phrase-list {display:grid;gap:8px;margin-top:20px;}
.phrase-list button {display:flex;justify-content:space-between;gap:16px;text-align:left;padding:13px 16px;border:1px solid #e2d4bb;border-radius:12px;background:#f6f3e7;}
.phrase-list button:hover {background:#e8f0dd;}
.alphabet-grid {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:20px;}
.alphabet-grid button {padding:10px 4px;background:#ecf1e1;border:1px solid #c5d5b6;border-radius:10px;font:24px/1.4 var(--serif);}
.pane-dst.is-expanded {position:fixed;inset:7vh 8vw;z-index:80;box-shadow:0 0 0 100vmax #122d21b0;background:#fff9ef;overflow:auto;}
.pane-dst.is-expanded .dst-text {font-size:clamp(24px,3vw,42px);}
@media(min-width:1500px) {.hdr {gap:32px;}.intro {min-height:200px;margin-bottom:18px;}.tr {margin-top:1px;}}
@media(max-width:1360px) {
 .hdr {gap:20px;}.main-nav {gap:22px;}.hero-art {width:330px;gap:7px;}.hero-bird {width:195px;}.hero-letter {width:120px;}.hero-alphabet {width:140px;font-size:36px;letter-spacing:8px;}.intro {gap:20px;}.intro p {font-size:15px;letter-spacing:3px;}.language-group {gap:12px;padding:0 2px;}.language-group:last-child {padding:0 2px;}.language-tabs>button {min-width:52px;padding:0 10px;font-size:17px;}.lang-pick select {font-size:17px;padding-left:16px;}.partners {margin:0;}.partner-card {gap:12px;padding-left:15px;padding-right:18px;}.partner-name {font-size:25px;}.partner-copy b {font-size:18px;}.partner-copy small {font-size:14px;}.partner-name+.partner-copy {padding-left:15px;}.partner-card>img {width:72px;height:77px;}.ftr {gap:20px;}.footer-brand {font-size:21px;}.ftr-links {padding-left:12px;}
}
@media(max-width:1050px) {
 .hdr {padding:12px 22px;min-height:85px;}.brand-text b {font-size:29px;}.brand-text small {font-size:24px;}.brand-mark {width:52px;height:57px;}.main-nav {gap:17px;}.main-nav a,.main-nav button {font-size:14px;}.seg-ui>a {font-size:14px;padding:0 10px;}.hero-art {width:230px;}.hero-bird {width:135px;}.hero-letter {width:90px;}.hero-alphabet {width:100px;font-size:30px;letter-spacing:5px;}.intro {margin-left:0;margin-right:0;min-height:175px;}.intro h1 {font-size:76px;}.intro p {font-size:12px;letter-spacing:2px;}.hero-type {padding-left:18px;}.language-tabs {display:none;}.language-group {padding:0 10px;}.language-group:last-child {padding:0 10px;}.quick-links button {font-size:15px;}.partner-card {gap:12px;}.partner-name {display:none;}.partner-name+.partner-copy {border:0;padding-left:0;margin:0;}.ftr {flex-wrap:wrap;}.ftr-links {gap:3px;}.ftr-links button {font-size:13px;}.footer-help {display:none;}
}
/* Mobile layout, November 2026. */
@media(max-width:760px) {
  body { background-attachment:scroll; }
  .hdr { padding:10px 12px;gap:6px;min-height:78px; }
  .brand { gap:7px; }
  .brand-mark { width:40px;height:45px; }
  .brand-text b { font-size:23px; }
  .brand-text small { display:block;font-size:18px; }
  .hdr-actions { margin-left:auto;gap:4px; }
  .seg-ui>a { min-width:44px;min-height:44px;padding:0 8px;font-size:14px; }
  .profile-btn { width:44px;height:44px; }
  .profile-btn svg { width:28px;height:28px; }
  .main-nav { display:none; }
  .main { padding:0 12px 10px; }
  .intro { min-height:112px;margin:0 0 10px;gap:10px; }
  .hero-art { width:60px;display:block; }
  .hero-bird,.hero-alphabet { display:none; }
  .hero-letter { width:60px; }
  .hero-type { min-width:0;padding-left:12px;flex:1; }
  .intro h1 { font-size:clamp(38px,12vw,66px);line-height:1.04;margin-bottom:6px; }
  .intro p { font-size:10px;letter-spacing:1.2px;line-height:1.5; }
  .ornament { font-size:18px;margin-top:7px; }

  .tr { padding:12px;gap:10px;grid-template-columns:minmax(0,1fr);grid-template-areas:"bar" "src" "opts" "dst";border-radius:23px; }
  .tr-bar { grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr);gap:6px; }
  .language-group,.language-group:last-child { padding:0; }
  .lang-pick select { min-width:0;min-height:44px;font-size:16px;padding:8px 28px 8px 10px;text-overflow:ellipsis; }
  .lang-pick .chev { width:18px;height:18px;margin-left:-24px; }
  .swap { width:44px;height:44px; }
  .swap svg { width:25px;height:25px; }
  .pane { min-height:154px;border-radius:16px; }
  .pane-dst { min-height:165px;border:1px solid #dfc8ad; }
  .pane-dst.is-idle { display:flex; }
  #src { min-height:96px;max-height:min(42svh,320px);font-size:18px;padding:14px 46px 5px 16px; }
  .clear { width:44px;height:44px;right:3px;top:4px; }
  .tools { padding:4px 8px 7px;gap:4px; }
  .tool { width:44px;height:44px;min-width:44px;min-height:44px;border-radius:10px; }
  .tool svg { width:23px;height:23px; }
  .count { font-size:14px; }
  .dst-empty { font-size:18px;padding:14px 16px; }
  .dst-head { flex-wrap:wrap;gap:6px;padding:0 14px; }
  .dst-head:has(.badge:not([hidden])) { padding-top:10px; }
  .badge { height:auto;min-height:24px;max-width:100%;padding:4px 8px;line-height:1.25;overflow-wrap:anywhere; }
  .seg-sm>button { min-height:36px;min-width:40px;padding:0 8px; }
  .dst-text,.dst-text:lang(hy) { font-size:22px;padding:10px 16px 2px; }
  .dst-translit { padding:0 16px;font-size:14px; }
  .tools-dst { gap:4px; }
  .tr-opts { flex-direction:column;align-items:stretch;gap:6px;padding:0; }
  .local-mode { order:2;justify-content:center;text-align:center;font-size:12px;line-height:1.3;color:#4b604d;min-height:18px; }
  .translation-actions { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:10px; }
  .btn-go { width:100%;min-height:48px;font-size:16px;padding:0 12px;gap:8px; }
  .go-label { min-width:0;overflow-wrap:anywhere;line-height:1.2; }
  .btn-ai { min-width:0;min-height:48px;font-size:14px;line-height:1.2;justify-content:center;padding:8px 6px;gap:6px; }
  .kbd { grid-template-columns:repeat(8,minmax(0,1fr));padding:10px 6px;gap:4px; }
  .key { min-height:48px; }
  .key-space { grid-column:span 2; }

  .card { min-width:0;padding:16px;border-radius:18px; }
  .dict-item { padding:10px 11px; }
  .dict-word { font-size:14px; }
  .dict-tr { font-size:18px;line-height:1.5;overflow-wrap:anywhere; }
  .dict-note { font-size:14px;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere; }
  .dict-source { font-size:12px;overflow-wrap:anywhere; }
  .ex-item { padding:11px; }
  .ex-src,.ex-dst { overflow-wrap:anywhere; }
  .quick-links { grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 0;margin:24px 0; }
  .quick-links button { min-width:0;min-height:74px;font-size:13.5px;padding:0 4px;overflow-wrap:anywhere; }
  .quick-links button>span { max-width:100%; }
  .quick-links button:nth-child(4):before { display:none; }
  .quick-links svg { width:31px;height:31px; }
  .alphabet-icon { font-size:29px;height:31px; }
  .partners { grid-template-columns:1fr;gap:14px;margin:0; }
  .partner-card { min-height:86px;padding:6px 15px;gap:12px;border-radius:23px; }
  .partner-card>img { width:62px;height:68px; }
  .partner-name { display:block;font-size:24px; }
  .partner-name+.partner-copy { display:none; }
  .partner-copy b { font-size:17px; }
  .partner-copy small { font-size:13px; }
  .partner-card>svg { width:23px;height:23px; }
  .ftr { padding:20px 12px 8px;gap:12px;flex-direction:column;align-items:stretch;margin:0; }
  .footer-brand { justify-content:center;font-size:22px;gap:9px; }
  .footer-brand img { width:40px;height:43px; }
  .ftr-links { border:0;padding:0;justify-content:center;gap:0 6px; }
  .ftr-links button { min-height:44px;font-size:13px;padding:8px; }
  .helper { height:min(82dvh,680px);max-height:calc(100dvh - 12px); }
  .helper-log { min-height:0; }
  .helper-chips { max-height:25dvh;overflow:auto; }
  .helper-form input { font-size:16px; }
  .dlg { width:100%;max-width:none;max-height:88dvh;margin:auto 0 0;border-radius:22px 22px 0 0; }
  .dlg-in { min-height:0;max-height:calc(88dvh - env(safe-area-inset-bottom)); }
  .dlg-head,.dlg-tabs,.dlg-foot { flex-shrink:0; }
  .dlg-body,.hist-list { min-height:0;overflow:auto; }
  .dlg-head .icon-btn,.hist-item .tool,.dlg-tabs>button { min-width:44px;min-height:44px; }
  .alphabet-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .alphabet-grid button { min-height:48px; }
  .phrase-list button { min-height:48px;font-size:14px;flex-wrap:wrap; }
  .pane-dst.is-expanded { inset:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom)); }
  .pane-dst.is-expanded .tools-dst { position:sticky;bottom:0;background:var(--panel); }
  .lookup-feedback { padding:16px; }
  .lookup-feedback h2 { font-size:17px; }
  .suggestion-list button { min-height:44px; }
}
@media(max-width:380px) {
  .hdr { display:grid;grid-template-columns:1fr auto;gap:4px 8px; }
  .brand { grid-column:1;grid-row:1; }
  .hdr-actions { display:contents; }
  .profile-btn { grid-column:2;grid-row:1;justify-self:end; }
  .seg-ui { grid-column:1 / -1;grid-row:2;justify-self:center; }
  .intro { min-height:100px; }
  .main { padding-inline:10px; }
  .tr { padding:10px; }
  .kbd { grid-template-columns:repeat(7,minmax(0,1fr)); }
  .partner-card { gap:10px;padding-inline:12px; }
  .partner-card>img { width:54px;height:62px; }
  .partner-name { font-size:22px; }
  .quick-links:lang(hy) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-links:lang(hy) button:before { display:block; }
  .quick-links:lang(hy) button:nth-child(odd):before { display:none; }
}
@media(pointer:coarse) {
  .icon-btn,.tool,.seg-ui>a { min-width:44px;min-height:44px; }
  .seg-sm>button,.helper-chips button,.msg-act { min-height:44px; }
  .btn-go,.btn-ai { min-height:48px; }
  .lang-pick select { min-height:44px;font-size:16px; }
}
@media(pointer:coarse) and (max-width:950px) and (max-height:500px) {
  .intro { display:none; }
  .hdr { min-height:64px;padding-top:6px;padding-bottom:6px; }
  .brand-mark { width:36px;height:40px; }
  .brand-text b { font-size:22px; }
  .brand-text small { font-size:17px; }
  .main { padding-inline:12px; }
  .tr { grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"bar bar" "src dst" "opts opts";gap:8px 12px;padding:10px; }
  .tr-bar { grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr); }
  .pane { min-height:140px; }
  #src { min-height:80px;max-height:150px;font-size:17px; }
  .tools { gap:4px;padding:2px 6px 4px; }
  .tool { width:44px;height:44px; }
  .tools-dst { gap:0; }
  .tr-opts { flex-direction:row;align-items:center;flex-wrap:nowrap; }
  .translation-actions { order:2;display:flex;flex-shrink:0;gap:8px; }
  .btn-go { width:auto;min-width:140px; }
  .local-mode { order:1;justify-content:flex-start;text-align:left; }
  .helper { height:94dvh; }
}
@media(max-width:1050px) {
  /* Keep help in the page flow, clear of touch controls and partner links. */
  .fab { position:relative;inset:auto;display:flex;width:max-content;max-width:calc(100% - 24px);height:auto;min-height:44px;margin:4px auto calc(20px + env(safe-area-inset-bottom));padding:10px 18px;gap:8px; }
  .fab-label { display:inline;position:static;width:auto;height:auto;overflow:visible;clip:auto; }
  .fab svg { width:21px;height:21px; }
  .fab-dot { top:4px;right:5px; }
}

@media(prefers-reduced-motion:reduce) {*,*:before,*:after {scroll-behavior:auto!important;transition:none!important;animation:none!important;}}
@media(min-width:1500px) {.intro {min-height:180px;}}
@media(min-width:1051px) {.main-nav {gap:25px;}.partner-card:first-child .partner-copy small {font-size:15px;white-space:nowrap;}.partner-card:first-child {gap:14px;padding-right:22px;}.partner-name+.partner-copy {padding-left:18px;}}

/* Fit medium desktop and tablet layouts without clipping the page. */
.hero-type { min-width:0; }
@media(max-width:1495px) {
 .intro { margin-inline:0; }
 .partners { margin-inline:0; }
 .hero-alphabet { width:160px;font-size:36px;letter-spacing:6px; }
 .main-nav { gap:20px; }
 .main-nav a,.main-nav button { font-size:16px; }
}
@media(max-width:950px) {
 .main-nav,.hero-alphabet { display:none; }
}

/* Project name and readable controls for the Armenian reading hint. */
.brand { min-width:0;flex-shrink:1; }
.brand-text { min-width:0; }
.brand-text b { font-size:clamp(22px,2.1vw,30px); }
.brand-text small { font-size:clamp(12px,1.2vw,17px);line-height:1.35; }
#site-title { font-size:clamp(32px,3.4vw,48px);line-height:1.12;letter-spacing:-.025em;text-wrap:balance;overflow-wrap:anywhere; }
.footer-brand { min-width:0;max-width:100%;white-space:normal;font-size:clamp(16px,1.6vw,22px);line-height:1.3; }
.footer-brand img { flex-shrink:0; }
.dst-head { flex-wrap:wrap; }
.translit-control { display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:100%; }
.translit-label { font-size:12px;line-height:1.3;color:var(--ink-3); }
.translit-options { max-width:100%;flex-wrap:wrap; }
.translit-options>button { flex:1;min-width:0;min-height:36px;padding:6px 10px;font-size:12px;line-height:1.35; }
@media(max-width:760px) {
 #site-title { font-size:clamp(25px,5.5vw,38px); }
 .translit-options>button { padding-inline:8px; }
}
@media(max-width:600px) {
 .hdr { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px; }
 .brand { grid-column:1;grid-row:1; }
 .hdr-actions { display:contents; }
 .profile-btn { grid-column:2;grid-row:1;justify-self:end; }
 .seg-ui { grid-column:1 / -1;grid-row:2;justify-self:center; }
}
@media(pointer:coarse) {
 .translit-options>button { min-height:44px; }
}

/* Dictionary suggestions stay beside the source field, including on phones. */
.pane-src { overflow:visible;z-index:4; }
.source-entry { position:relative;display:flex;flex-direction:column;flex:0 0 auto;min-width:0; }
.suggest-anchor { position:relative;flex:none;min-width:0; }
.source-entry #src { border-radius:19px 19px 0 0; }
.source-hint { margin:0;padding:0 18px 8px 26px;color:#58705c;font-size:12px;line-height:1.45; }
.word-suggestions {
 position:absolute;inset:100% -1px auto;z-index:12;background:#fffdf7;
 border:1px solid #bdd0b7;border-radius:14px;box-shadow:0 12px 30px #183e2626;
 overflow:hidden;text-align:left;
}
.suggest-direction { display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:7px 12px;padding:10px 12px;background:#edf3e8;border-bottom:1px solid #d9e3d2; }
.suggest-source { font-size:12px;font-weight:600;color:#34543b; }
.suggest-targets { display:flex;flex-wrap:wrap;align-items:center;gap:5px;min-width:0; }
.suggest-target-label { font-size:11px;color:#596d5b;margin-right:2px; }
.suggest-targets button { min-height:32px;padding:4px 9px;border:1px solid #c2d0ba;border-radius:18px;background:#fffdf7;font-size:12px;line-height:1.3; }
.suggest-targets button[aria-pressed="true"] { background:#145c31;color:#fff;border-color:#145c31; }
.suggest-targets button:focus-visible { outline:2px solid #aa7115;outline-offset:2px; }
.suggest-status { margin:0;padding:14px 16px;color:#596d5b;font-size:13px;line-height:1.5; }
.word-options { margin:0;padding:4px;list-style:none;max-height:min(320px,38dvh);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin; }
.word-options:empty { display:none; }
.word-options [role="option"] { display:flex;align-items:center;min-height:42px;padding:8px 12px;border-radius:8px;cursor:pointer;color:#253d2a;font-size:17px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere; }
.word-options [role="option"] strong { font-weight:700;color:#8b520b;white-space:pre-wrap; }
.suggest-word { min-width:0; }
.word-options [role="option"] svg { width:16px;height:16px;flex-shrink:0;margin-left:auto;opacity:.4; }
.word-options [role="option"]:hover,.word-options [aria-selected="true"] { background:#e7efdf; }
.language-tabs>button:disabled { opacity:.35;cursor:default; }
@media(max-width:760px) {
 .source-entry #src { border-radius:15px 15px 0 0; }
 .source-hint { padding:0 12px 7px;font-size:11px; }
 .suggest-direction { gap:6px;padding:9px 10px; }
 .suggest-targets { gap:4px; }
 .suggest-targets button { min-height:36px;padding:5px 8px; }
 .word-options { max-height:min(260px,32dvh); }
 .word-options [role="option"] { min-height:44px;font-size:16px; }
}
@media(pointer:coarse) { .suggest-targets button { min-height:44px; } }

/* One type style for navigation, resource links and the footer. */
:root { --menu-size:16px; }
.main-nav a,.main-nav button,.quick-links button,.ftr-links button {
 font:400 var(--menu-size)/1.4 var(--font);letter-spacing:normal;
}
.main-nav .is-active { font-weight:600; }
.quick-links button { min-width:0; }
.quick-links button>span { max-width:100%;overflow-wrap:anywhere; }
.brand-mark,.footer-brand img { object-fit:contain;flex-shrink:0; }
.brand-mark,.footer-brand img {
 border:1px solid #dda347;border-radius:9px;background:linear-gradient(135deg,#ffe7a5,#f6b744);
 box-shadow:inset 0 1px 1px #fff5cf,0 1px 2px #85501620;
}

/* Suggestions never cover the site's Armenian keyboard or its toolbar. */
.word-suggestions.is-below-keyboard {
 position:static;inset:auto;flex:none;margin:0 8px 10px;box-shadow:none;
}
@media(max-width:1050px) { :root { --menu-size:14px; } }
@media(max-width:950px) {
 .hdr { flex-wrap:wrap; }
 .main-nav { display:flex;order:3;flex:1 0 100%;justify-content:center;flex-wrap:wrap;gap:2px 20px;margin:4px 0 0;white-space:normal; }
 .main-nav a,.main-nav button { min-height:44px;display:inline-flex;align-items:center; }
 .main-nav .is-active:after { bottom:1px;height:2px; }
}
@media(max-width:600px) {
 .main-nav { grid-column:1 / -1;grid-row:3; }
}
