/*
  Language pill + picker styles (LANG_SPEC §5, §7) — the visual half of
  assets/tms-lang.js. Loaded by both hosts, after assets/tms.css.

  SCOPING: unlike view-audit.css, which re-scopes generic class names onto a
  [data-av-surface] marker because the two hosts mean different things by
  #view-findings, nothing here can be id- or surface-scoped: the pill is rendered
  into the workflow bar, Project Management rows, pane headings and dialogs in
  both hosts. What keeps it from bleeding is the name — every selector below is
  under a `tms-lang-*` class this module alone emits, and the one generic child
  name (`.dot`, which tms.css also uses for #claude-status) is always qualified by
  its parent.

  NO NEW TOKENS: colours come from tms.css's palette (--line, --ink, --mut,
  --blue, --panel, --red). The two literals are deliberate — #7da7d9 / #d9a77d are
  the original/translation border colours tms.css already gives `.fdetail .q.en`
  and `.fdetail .q.ceb`, so a source pill and a source quote read as the same
  side of the document.
*/

/* ---------- the pill ---------- */
.tms-lang-pill{display:inline-flex;align-items:center;gap:5px;vertical-align:middle;white-space:nowrap;
  font-size:11.5px;font-weight:600;line-height:1;padding:3px 8px;border:1px solid var(--line);
  border-radius:9px;background:#fff;color:var(--ink)}
.tms-lang-pill .dot{width:8px;height:8px;border-radius:50%;flex:none;background:#bbb}
.tms-lang-pill.src .dot{background:#7da7d9}
.tms-lang-pill.tgt .dot{background:#d9a77d}
/* Unset is a gap in the project's data, not a value: dashed and quiet, so it
   reads as "still to do" rather than as a language called "not set". */
.tms-lang-pill.unset{border-style:dashed;font-weight:400;font-style:italic;color:var(--mut);background:transparent}
.tms-lang-pill.unset .dot{background:transparent;border:1px solid var(--line)}
/* Only a host that has wired the click adds .is-click — the unset tooltip says
   "click to set it" and a pointer cursor on an inert pill would be a lie. */
.tms-lang-pill.is-click{cursor:pointer}
.tms-lang-pill.is-click:hover{border-color:var(--blue);color:var(--blue)}
.tms-lang-pill.is-click:focus-visible{outline:2px solid var(--blue);outline-offset:1px}

.tms-lang-pair{display:inline-flex;align-items:center;vertical-align:middle}
.tms-lang-arrow{color:var(--mut);font-size:12px;margin:0 5px}

/* ---------- the picker ---------- */
/* Wraps rather than overflows: it sits in a dialog row on the installed app and
   in a narrow card on the web, and the free-text pair is wider than either. */
.tms-lang-picker{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:13px;max-width:100%}
/* Class selectors, not `.tms-lang-picker select` — inside a `.field` (the New
   Project dialog) tms.css's `.field select{width:100%}` carries the same
   specificity and would win on source order alone. */
.tms-lang-picker .tlp-sel,
.tms-lang-picker .tlp-name,
.tms-lang-picker .tlp-marker{font:inherit;width:auto;padding:5px 7px;border:1px solid var(--line);
  border-radius:5px;background:#fff;color:var(--ink)}
.tms-lang-picker .tlp-sel{min-width:200px;max-width:100%;font-weight:600}
.tms-lang-picker .tlp-free{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.tms-lang-picker .tlp-name{min-width:150px}
.tms-lang-picker .tlp-marker{width:120px}
.tms-lang-picker .tlp-ok,
.tms-lang-picker .tlp-cancel{font:inherit;font-size:12.5px;padding:5px 11px;border:1px solid var(--line);
  border-radius:5px;background:#fff;color:var(--ink);cursor:pointer}
.tms-lang-picker .tlp-ok{background:var(--blue);border-color:var(--blue);color:#fff;font-weight:600}
.tms-lang-picker .tlp-ok:hover,
.tms-lang-picker .tlp-cancel:hover{filter:brightness(1.06)}
/* The status line owns the full width so a sentence never squeezes the controls. */
/* The side's name, on its own line above the select: two pickers sit together
   on the New Project page and nothing said which was which (bug-260901-050330). */
.tms-lang-picker .tlp-lbl{flex-basis:100%;font-size:11.5px;font-weight:600;color:var(--mut)}
.tms-lang-picker .tlp-note{flex-basis:100%;font-size:11.5px;color:var(--mut)}
.tms-lang-picker .tlp-note:empty{display:none}
.tms-lang-picker .tlp-note.err{color:var(--red)}

/* ---------- the add-a-language confirmation ---------- */
/* Narrower than the 680px default: three buttons and two short fields. */
dialog.tms-lang-confirm{max-width:460px}
.tms-lang-confirm .tlc-lead{margin:0 0 12px;font-size:13.5px}
.tms-lang-confirm .tlc-row{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.tms-lang-confirm .tlc-row label{flex:none;width:92px;font-size:12.5px;color:var(--mut)}
.tms-lang-confirm .tlc-code,
.tms-lang-confirm .tlc-marker{flex:1;min-width:0;font:inherit;padding:6px 8px;
  border:1px solid var(--line);border-radius:4px;background:#fff;color:var(--ink)}
.tms-lang-confirm .tlc-code{text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.tms-lang-confirm .tlc-help{margin:12px 0 0}
/* Why "Save to database" is off. Sits above the buttons it explains, and is
   empty (and gone) whenever the database is reachable. */
.tms-lang-confirm .tlc-why{margin-top:10px;padding:7px 10px;background:var(--panel);
  border:1px solid var(--line);border-radius:5px}
.tms-lang-confirm .tlc-why:empty{display:none}
.tms-lang-confirm .tlc-err{margin-top:10px;color:var(--red);font-size:12.5px}
.tms-lang-confirm .tlc-err:empty{display:none}
