/* Translation Helper. The suite's look (masthead, stripe, cards, buttons) from the other free tools,
   kept in this folder so the tool moves to its own repo on its own. */
@font-face { font-family: 'Noto Sans'; src: url('/fonts/NotoSans-400Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans'; src: url('/fonts/NotoSans-700Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --navy: #1b2a4a; --red: #b22234; --ink: #1d2433; --muted: #59627a; --line: #d5dae3; --bg: #f3f5f9; --card: #fff; --soft: #f6f8fb;
  --warnbg: #fff7e0; --warnline: #c99a1a; --warn: #7a5200; --okbg: #e8f4ea; --ok: #1f6f4a; --link: #1d4f91;
  --eac: #2f5fb8; --eacbg: #eaf0fb; --swap: #1f6f4a; --swapbg: #e3f3ea; --need: #a1172a; --needbg: #fde4e6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8ecf3; --muted: #a9b2c2; --line: #3a4458; --bg: #141a26; --card: #1e2636; --soft: #232c3e;
    --warnbg: #3a3218; --warn: #ffd27a; --okbg: #183327; --ok: #7fd6a8; --link: #9fb7ea;
    --eac: #9cc0f5; --eacbg: #1a2a44; --swap: #7fd6a8; --swapbg: #183327; --need: #ff9aa5; --needbg: #3d1a20;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8ecf3; --muted: #a9b2c2; --line: #3a4458; --bg: #141a26; --card: #1e2636; --soft: #232c3e;
  --warnbg: #3a3218; --warn: #ffd27a; --okbg: #183327; --ok: #7fd6a8; --link: #9fb7ea;
  --eac: #9cc0f5; --eacbg: #1a2a44; --swap: #7fd6a8; --swapbg: #183327; --need: #ff9aa5; --needbg: #3d1a20;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--link); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.mast { background: var(--navy); color: #fff; }
.mast .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 12px; }
.lead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand svg { width: 24px; height: 24px; }
.tool { font-weight: 700; opacity: .9; }
.who { display: flex; align-items: center; gap: 14px; font-size: 15px; flex-wrap: wrap; justify-content: flex-end; }
.who a { color: #fff; }
.stripe { height: 8px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, #fff 40px 52px); }
h1 { font-size: clamp(24px, 3.6vw, 32px); line-height: 1.15; margin: 18px 0 6px; color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h1 { color: #e8ecf3; } }
:root[data-theme="dark"] h1 { color: #e8ecf3; }
h2 { font-size: 19px; margin: 0 0 8px; }
.lede { margin: 0 0 14px; max-width: 80ch; }
.beta { margin: 16px 0 0; padding: 8px 12px; background: var(--warnbg); border-left: 4px solid var(--warnline); border-radius: 4px; font-size: 14px; }
.hint, .foot { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.opt { font-weight: 400; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #2f6fd6; outline-offset: 2px; }
.loading { color: var(--muted); }

button { font: inherit; font-weight: 700; border-radius: 6px; padding: 8px 16px; min-height: 44px; cursor: pointer; border: 1px solid var(--navy); background: var(--navy); color: #fff; }
button.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
button.small { min-height: 36px; padding: 5px 12px; font-size: 14px; }
button.link { background: none; border: 0; color: var(--link); text-decoration: underline; padding: 4px 2px; min-height: 0; font-weight: 400; }
button.danger { background: var(--card); color: var(--red); border-color: var(--red); }
button.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.copy { background: var(--card); color: var(--navy); border-color: var(--navy); }
button.copy.copied { background: var(--okbg); color: var(--ok); border-color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button:not(.secondary):not(.link):not(.copy):not(.danger) { background: #9fb7ea; border-color: #9fb7ea; color: #141a26; } :root:not([data-theme="light"]) button.copy { color: #9fb7ea; border-color: #9fb7ea; } }
:root[data-theme="dark"] button:not(.secondary):not(.link):not(.copy):not(.danger) { background: #9fb7ea; border-color: #9fb7ea; color: #141a26; }
.buttons, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { margin-left: auto; }

.tabs { display: flex; gap: 2px; margin: 8px 0 16px; border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-radius: 0; color: var(--muted); padding: 10px 14px; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom: 4px solid var(--navy); margin-bottom: -2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button { background: none !important; color: var(--muted) !important; } :root:not([data-theme="light"]) .tabs button[aria-selected="true"] { color: var(--ink) !important; border-bottom-color: #9fb7ea; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px 16px; margin: 0 0 16px; }
.gate { max-width: 75ch; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
label, .label { display: block; font-weight: 700; font-size: 16px; margin: 0 0 6px; }
label.topic { font-size: 14px; margin-top: 12px; }
.stepno { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 16px; margin-right: 8px; vertical-align: middle; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stepno { background: #9fb7ea; color: #141a26; } }
textarea, input[type="text"], input[type="search"], select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
textarea { width: 100%; resize: vertical; min-height: 110px; }
input[type="text"] { width: 100%; }
select { min-height: 40px; }
.filters { margin-bottom: 10px; }
.filters input[type="search"] { min-width: min(340px, 100%); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--card); border-radius: 22px; padding: 6px 12px 6px 10px; font-size: 15px; cursor: pointer; min-height: 40px; }
.chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.chip:has(input:checked) { border-color: var(--navy); background: var(--eacbg); font-weight: 700; }
.chip .kind { font-weight: 400; color: var(--muted); }
.chip .kindbtn { font-size: 13px; padding: 0 2px; }

.note { background: var(--warnbg); border-left: 4px solid var(--warnline); border-radius: 4px; padding: 8px 12px; font-size: 14px; margin: 0 0 12px; }
.ok { background: var(--okbg); border-left: 4px solid var(--ok); border-radius: 4px; padding: 8px 12px; font-size: 14px; margin: 12px 0 0; }
.warnline { background: var(--warnbg); border-left: 4px solid var(--warnline); border-radius: 4px; padding: 6px 10px; font-size: 14px; margin: 8px 0 0; }
.empty { color: var(--muted); border: 2px dashed var(--line); border-radius: 10px; padding: 14px 18px; }
.empty p { margin: 0 0 6px; }

.result { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: var(--card); }
.result .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.result .lang { font-weight: 700; }
.result .var { color: var(--muted); font-size: 14px; }
.result .acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.result .text { font-size: 18px; padding: 8px 10px; background: var(--soft); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.result textarea { font-size: 17px; min-height: 90px; }
.result .review { font-size: 14px; margin: 6px 0 0; }
.result.person .text { font-size: 15px; }
[dir="rtl"] { text-align: right; }
.tag { white-space: nowrap; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 8px; display: inline-block; }
.tag.draft { background: var(--warnbg); color: var(--warn); border: 1px solid var(--warnline); }
.tag.checked { background: var(--okbg); color: var(--ok); border: 1px solid var(--ok); }
.tag.saved { background: var(--eacbg); color: var(--eac); border: 1px solid var(--eac); }
.tag.strong { background: var(--okbg); color: var(--ok); }
.tag.check { background: var(--warnbg); color: var(--warn); }
.tag.person { background: var(--needbg); color: var(--need); }
mark.eac { background: var(--eacbg); color: inherit; border-bottom: 2px solid var(--eac); padding: 0 1px; }
mark.eac::after { content: "EAC"; font-size: 10px; font-weight: 700; color: var(--eac); vertical-align: super; margin-left: 2px; }
mark.swap { background: var(--swapbg); color: inherit; border-bottom: 2px solid var(--swap); padding: 0 1px; }
span.eac { background: var(--eacbg); border-bottom: 2px solid var(--eac); }
span.swap { background: var(--swapbg); border-bottom: 2px solid var(--swap); }
.word { font-family: ui-monospace, Menlo, monospace; background: var(--soft); padding: 0 5px; border-radius: 4px; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-size: 13px; }
td .t { font-size: 15px; display: block; white-space: pre-wrap; }
td .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
td button.copy, td button.secondary { min-height: 30px; padding: 1px 8px; font-size: 13px; }
table.lib td:first-child { min-width: 220px; }

dialog { border: 0; border-radius: 10px; padding: 16px 20px 18px; width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--card); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 16, 30, .55); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; position: sticky; bottom: -18px; background: var(--card); padding: 10px 0 4px; }
.search { width: 100%; border: 2px solid var(--navy); margin: 4px 0 10px; }
.place { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
#placeForm { margin: 0 0 8px; }
#placeForm label { margin: 0; font-size: 14px; }
.sect { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
.sect span { text-transform: none; font-weight: 400; letter-spacing: 0; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lrow label { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; min-width: 300px; cursor: pointer; }
.lrow input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--navy); }
.lrow .n { font-weight: 700; min-width: 170px; }
.lrow .native { color: var(--muted); font-weight: 400; }
.lrow .tag { margin-left: auto; }
.lrow .personnote { font-size: 13px; }
.vlist .opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 6px; border-bottom: 1px solid var(--line); margin: 0; font-weight: 400; font-size: 15px; cursor: pointer; }
.vlist input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy); }
.mini { display: inline-block; border: 1px solid var(--navy); color: var(--navy); border-radius: 4px; font-size: 12px; padding: 0 6px; font-weight: 700; margin-left: 4px; }
.turnstile { margin: 8px 0 0; }

dialog.ask { max-width: min(480px, calc(100vw - 24px)); padding: 20px 22px; }
dialog.ask h2 { margin: 0 0 6px; font-size: 1.2rem; }
dialog.ask p { margin: 0 0 14px; }
dialog.ask .ask-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.foot { margin-top: 28px; padding: 18px 0 28px; border-top: 1px solid var(--line); }
.foot p { max-width: 90ch; }

@media print {
  .mast, .stripe, .tabs, .foot, .beta, .lede, h1, #pane-translate, #pane-eac, #pane-backup, .filters, td button { display: none !important; }
  body.print-side #pane-translate { display: block !important; }
  body.print-side #pane-translate .grid > div:first-child, body.print-side .result .acts, body.print-side #resultActs, body.print-side .note, body.print-side .empty { display: none !important; }
  body.print-side #pane-library { display: none !important; }
  .card, .result { border: 1px solid #999; break-inside: avoid; }
}
