/* Translate */
.app-translate { background: var(--surface); container-type: inline-size; }
.tr-scroll { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.tr-panes { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 0 0 auto; }
.tr-pane { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tr-pane:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.tr-pane-out { background: var(--surface-3); }
[data-theme="light"] .tr-pane-out { background: #eef2f8; }
.tr-pane-h { display: flex; align-items: center; padding: 10px 12px 0; }
.tr-lang { height: 32px; border: 0; box-shadow: none; background-color: transparent; font-weight: 700; font-size: 14px; color: var(--accent); padding-left: 6px; max-width: 100%; }
.tr-lang:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.tr-lang option, .tr-lang optgroup { color: var(--text); background: var(--surface); }
.tr-textwrap { position: relative; flex: 1; display: flex; }
.tr-text {
  flex: 1; min-height: 210px; width: 100%; margin: 0; border: 0; outline: none; resize: none; background: none; color: var(--text);
  padding: 10px 44px 10px 18px; font: 400 21px/1.45 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; max-height: 46vh;
}
.tr-text::placeholder { color: var(--text-3); }
.tr-out { user-select: text; -webkit-user-select: text; cursor: text; }
.tr-ph { color: var(--text-3); }
.tr-clear { position: absolute; top: 4px; right: 6px; color: var(--text-3); }
.tr-pane-f { display: flex; align-items: center; gap: 2px; padding: 6px 8px 8px; }
.tr-pane-f .icon-btn { color: var(--text-2); }
.tr-pane-f .icon-btn.on { color: #f5a524; background: none; }
.tr-pane-f .icon-btn.on svg { fill: #f5a524; }
.tr-count { font-size: 11.5px; color: var(--text-3); margin-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tr-credit { font-size: 11px; color: var(--text-3); text-decoration: none; white-space: nowrap; margin-right: 6px; }
.tr-credit:hover { color: var(--text-2); text-decoration: underline; }
.tr-swap {
  position: absolute; left: 50%; top: 21px; transform: translateX(-50%); z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line-2), 0 3px 10px rgba(0, 0, 0, .15); color: var(--accent);
}
.tr-swap:hover { background: var(--surface-2); }
.tr-busy { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; }
.tr-progress { margin-top: 12px; max-width: 280px; }
.tr-stale { margin-top: 12px; opacity: .45; white-space: pre-wrap; }
.tr-err { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.tr-err > span { color: #e5484d; display: grid; padding-top: 2px; }
.tr-err b { display: block; font-size: 15px; }
.tr-err p { margin: 4px 0 10px; color: var(--text-2); font-size: 13px; line-height: 1.45; }

.tr-lower { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tr-lower-h { display: flex; align-items: center; gap: 8px; }
.tr-tabs small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.tr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tr-list-empty { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--text-3); font-size: 13px; border-radius: 14px; border: 1px dashed var(--line-2); }
.tr-item { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 11px 36px 11px 13px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; cursor: default; transition: background .12s; }
.tr-item:hover { background: var(--tile-hover); }
.tr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tr-item-l { font-size: 11px; font-weight: 700; color: var(--accent); }
.tr-item-s, .tr-item-t { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-item-s { color: var(--text-2); }
.tr-item-t { color: var(--text); font-weight: 600; }
.tr-item-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; color: var(--text-3); opacity: 0; }
.tr-item:hover .tr-item-x, .tr-item:focus-within .tr-item-x { opacity: 1; }
@media (hover: none) { .tr-item-x { opacity: 1; } }

@container (max-width: 700px) {
  .tr-scroll { padding: 10px; gap: 12px; }
  .tr-panes { grid-template-columns: 1fr; gap: 8px; }
  .tr-swap { top: auto; bottom: auto; position: relative; left: auto; transform: none; justify-self: center; margin: -22px 0; }
  .tr-text { min-height: 130px; font-size: 18px; max-height: 32vh; }
  .tr-credit { display: none; }
  .tr-pane-out .tr-pane-f::after { content: 'Translations by MyMemory'; font-size: 10.5px; color: var(--text-3); margin-right: 6px; }
  .tr-list { grid-template-columns: 1fr; }
}
