/* Translator (/language-tools/translator/). Builds on the Voice to Text styles; site colour tokens only, so light and dark follow the header's theme switch. */
@import url("/assets/css/voice2text.css");

.tr-stage { display: grid; grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; margin: 18px 20px 0; }
.tr-src, .tr-dst { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-2); transition: border-color .2s ease, box-shadow .2s ease; }
.tr-src:focus-within { border-color: var(--a1); box-shadow: 0 0 0 3px var(--ring); }
.tr-src { grid-template-rows: auto 1fr auto; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tr-head small, .tr-pick small { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-head small i { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
.tr-pick { display: flex; align-items: center; gap: 10px; }
.tr select { font: inherit; font-size: .92rem; font-weight: 600; min-height: 40px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; max-width: 100%; }
.tr select:hover { border-color: color-mix(in srgb, var(--a1) 50%, var(--border)); }
.tr select:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 3px var(--ring); }
.tr-detected { font-size: .8rem; font-weight: 700; color: var(--brand-ink); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--a1) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--a1) 28%, var(--border)); animation: vt2-in .25s ease both; }
.tr-detected:empty { display: none; }
.tr-in { width: 100%; min-height: 230px; resize: vertical; font: inherit; font-size: 1.08rem; line-height: 1.65; padding: 14px 16px; border-radius: 14px; border: 1px solid transparent; background: var(--surface); color: var(--text); outline: none; }
.tr-in::placeholder { color: var(--muted); }
.tr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tr-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr-samples span { font-size: .78rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.tr-samples button, .tr-quick button { font: inherit; font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: color .15s ease, border-color .15s ease, transform .15s ease, background .15s ease; }
.tr-samples button:hover, .tr-quick button:hover { color: var(--brand-ink); border-color: var(--a1); transform: translateY(-1px); }
.tr-count { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.tr-count.full { color: var(--bad); font-weight: 700; }
.tr-hinglish { margin: 0; }

.tr-swap { align-self: center; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--a1) 35%, var(--border)); background: var(--surface); color: var(--brand-ink); cursor: pointer; box-shadow: var(--shadow); transition: transform .3s ease, background .2s ease, color .2s ease, box-shadow .2s ease; }
.tr-swap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tr-swap:hover { transform: rotate(180deg); color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; box-shadow: 0 10px 24px color-mix(in srgb, var(--a1) 30%, transparent); }
.tr-swap:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tr-targets { display: flex; flex-wrap: wrap; gap: 8px; min-height: 46px; }
.tr-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 13px; border-radius: 14px; border: 1px solid var(--a1); background: color-mix(in srgb, var(--a1) 10%, var(--surface)); color: var(--text); font-weight: 700; font-size: .92rem; animation: vt2-in .25s ease both; transition: box-shadow .15s ease, transform .15s ease; }
.tr-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--a1) 16%, transparent); }
.tr-chip em { font-style: normal; font-weight: 500; font-size: .85rem; color: var(--brand-ink); }
.tr-chip button { width: 24px; height: 24px; border-radius: 8px; border: 0; display: grid; place-items: center; font: inherit; font-size: 1rem; line-height: 1; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease; }
.tr-chip button:hover { background: var(--bad); color: #fff; }
.tr-add { position: relative; display: inline-flex; align-self: start; }
.tr-add span { pointer-events: none; position: absolute; inset: 0; display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: .9rem; color: var(--brand-ink); border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--a1) 50%, var(--border)); background: var(--surface); transition: border-color .15s ease, background .15s ease; }
.tr-add select { opacity: 0; width: 100%; min-height: 44px; }
.tr-add:hover span { border-style: solid; border-color: var(--a1); background: color-mix(in srgb, var(--a1) 7%, var(--surface)); }
.tr-add select:focus-visible + span, .tr-add:focus-within span { box-shadow: 0 0 0 3px var(--ring); }
.tr-add[hidden] { display: none; }
.tr-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-quick:empty { display: none; }
.tr-go { margin-top: 6px; font-size: 1.05rem; padding: 14px 20px; border: 0; }
.tr-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr-go:disabled { opacity: .7; cursor: wait; filter: saturate(.7); }
.tr-key { text-align: center; font-size: .75rem; color: var(--muted); }

/* result cards */
.tr-results .vt2-card-head .vt2-ic { font-weight: 800; font-size: .95rem; }
.tr-out { width: 100%; min-height: 120px; resize: vertical; font: inherit; font-size: 1.1rem; line-height: 1.7; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.tr-out:focus { border-color: var(--a1); box-shadow: 0 0 0 3px var(--ring); }
.tr-body { display: grid; gap: 10px; padding: 12px 16px 0; }
.tr-back { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--a1) 35%, var(--border)); background: var(--surface); font-size: .92rem; color: var(--text-2); }
.tr-back b { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tr-back[hidden] { display: none; }
.tr-warn { font-size: .85rem; font-weight: 600; color: #b45309; }
:root[data-theme="dark"] .tr-warn { color: #fbbf24; }
.tr-warn:empty { display: none; }
.tr-fonts { margin: 0; font-size: .86rem; color: var(--text-2); }
.tr-fonts summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); padding: 2px 0; }
.tr-fonts ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.tr-fonts b { color: var(--text); }
.tr-engine-tag { font-size: .72rem; font-weight: 700; color: var(--muted); }

@media (max-width: 900px) {
  .tr-stage { grid-template-columns: 1fr; }
  .tr-swap { justify-self: center; transform: rotate(90deg); }
  .tr-swap:hover { transform: rotate(270deg); }
}
@media (max-width: 560px) {
  .tr-stage { margin-left: 14px; margin-right: 14px; }
  .tr-in { min-height: 180px; }
  .tr-add, .tr-add select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tr-swap, .tr-chip, .tr-detected { transition: none; animation: none; } }
@media (hover: none) { .tr-key { display: none; } }
