/* AI Translator v2 — layered on aiwa-paraphrase.css (shared app shell) */
.tr-pair { display: flex; align-items: center; gap: 6px; }
.tr-pick { position: relative; }
.tr-pick-btn .pp-mode-btn-text b { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tr-pick-btn.is-target { border-color: #b9d6c3; background: #f7fcf8; }
.tr-swap { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--aiwa-line); border-radius: 50%; background: #fff; cursor: pointer; transition: background-color 140ms, transform 320ms; }
.tr-swap:hover { background: var(--aiwa-brand-soft); border-color: #9bc7aa; }
.tr-swap.is-spun { transform: rotate(180deg); }
.tr-swap .aiwa-ui-icon { width: 15px; height: 15px; }
.tr-menu { width: 380px; padding: 10px; }
.tr-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; }
.tr-search:focus-within { border-color: var(--aiwa-brand); box-shadow: 0 0 0 3px rgba(19, 122, 61, 0.14); }
.tr-search .aiwa-ui-icon { width: 14px; height: 14px; opacity: 0.7; }
.tr-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 13.5px; outline: 0; color: var(--aiwa-ink); }
.tr-quick { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 2px 6px; }
.tr-quick:empty { display: none; }
.tr-chip { min-height: 28px; padding: 3px 11px; border: 1px solid var(--aiwa-line); border-radius: 999px; background: #fff; color: var(--aiwa-text); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.tr-chip:hover { border-color: #9bc7aa; background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.tr-chip.is-on { border-color: var(--aiwa-brand); background: var(--aiwa-brand); color: #fff; }
.tr-list { max-height: min(52vh, 420px); overflow: auto; margin-top: 4px; display: grid; gap: 1px; }
.tr-group { padding: 10px 10px 4px; color: var(--aiwa-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.tr-lang { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--aiwa-text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.tr-lang:hover { background: var(--aiwa-bg); }
.tr-lang.is-on { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); font-weight: 750; }
.tr-lang .aiwa-ui-icon { width: 14px; height: 14px; }
.tr-lang small { margin-left: auto; color: var(--aiwa-muted); font-size: 10px; font-weight: 700; }
.tr-empty { margin: 10px; color: var(--aiwa-muted); font-size: 13px; }
.tr-extras { gap: 10px; }
.tr-formality { height: 42px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; }
.tr-formality select { width: 150px; }
.translator-page .pp-switch-text { display: inline; }
.tr-in-tools { right: 14px; }
.translator-page .pp-pane-in .pp-out-tools { display: flex; }
.translator-page .pp-pane-in .pp-out-tools:has(> [hidden]:only-child) { display: none; }
.tr-output { font-size: 16px; line-height: 1.9; }
.tr-s { border-radius: 4px; cursor: pointer; transition: background-color 120ms; }
.tr-s:hover, .tr-s.is-active { background: #eaf4ee; box-shadow: 0 0 0 2px #eaf4ee; }
.translator-page .pp-backdrop .tr-align { background: #eaf4ee; box-shadow: inset 0 -2px 0 rgba(19, 122, 61, 0.45); }
.translator-page .pp-backdrop .pp-fz { background: rgba(19, 122, 61, 0.14); box-shadow: inset 0 -2px 0 var(--aiwa-brand); }
.tr-output .pp-frozen { background: rgba(19, 122, 61, 0.12); box-shadow: inset 0 -2px 0 var(--aiwa-brand); color: var(--aiwa-brand-dark); font-weight: 650; border-radius: 3px; }
.tr-pop .pp-pop-orig { white-space: normal; overflow: visible; font-size: 11.5px; line-height: 1.35; max-height: 2.7em; overflow: hidden; }
.changes-toggle.is-speaking { color: var(--aiwa-brand-dark); background: var(--aiwa-brand-soft); }
.changes-toggle.is-speaking .aiwa-ui-icon { filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.tr-output[dir="rtl"] { text-align: right; }
@media (max-width: 1500px) { .tr-pick-btn .pp-mode-btn-text b { max-width: 120px; } .tr-formality select { width: 132px; } }
@media (max-width: 900px) {
  .tr-pair { flex: 1 1 100%; }
  .tr-pick { flex: 1 1 0; min-width: 0; }
  .tr-pick-btn { width: 100%; padding: 0 8px; }
  .tr-pick-btn .pp-mode-btn-text { min-width: 0; }
  .tr-pick-btn .pp-mode-btn-text b { max-width: 100%; }
  .tr-menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; padding: 12px 12px max(14px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; box-shadow: 0 -18px 48px rgba(10, 40, 24, 0.22); }
  .tr-list { max-height: 44vh; }
  .tr-extras { flex: 1 1 100%; justify-content: space-between; }
  .tr-formality select { width: 150px; }
}
