/* EUS Translator UI: the mindos programme (mindos-se/pm DESIGN.md) in its EU-SOLAR co-brand form.
   design/tokens.css is a verbatim copy of the generated pm file; brand/eu-solar.css holds the
   departures from strict mindos (EU-SOLAR blue, amber and red, Open Sans, cards on a grey page).
   This stylesheet adds the application's components and defines no colour or font of its own. */
@import url("design/tokens.css");
@import url("brand/eu-solar.css");

:root {
  --margin: 64px;
  --gutter: 24px;
  --head-height: 60px;
}

/* ---- base ---------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html {
  background: var(--color-bg); color: var(--color-ink);
  font: var(--font-body-weight) var(--font-body-size) / var(--font-body-leading) var(--font-body-family);
  font-variant-numeric: tabular-nums; scrollbar-color: var(--color-grey-4) var(--color-grey-1);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; caret-color: var(--color-ink);
}
body { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--color-ink); color: var(--color-surface); }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
a { color: inherit; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
p { margin: 0 0 var(--space-3); max-width: 62ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
h1 {
  font: var(--font-display-weight) var(--font-display-size) / var(--font-display-leading) var(--font-display-family);
  letter-spacing: var(--font-display-tracking); margin: 0; text-wrap: balance; overflow-wrap: anywhere;
}
h2 { font: 700 19px / 1.3 var(--font-display-family); margin: var(--space-7) 0 var(--space-3); }
.card > h2:first-child { margin-top: 0; }
.main > h2:first-child, .panel > h2:first-child, section > h2:first-child { margin-top: 0; }
code { font-family: var(--font-mono-family); font-size: 0.9em; }

/* the wordmark: two weights of one face */
.wm { font-family: var(--wordmark-family); color: var(--color-ink); font-weight: 300; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; display: inline-block; text-decoration: none; }
.wm b { font-weight: 800; }

/* ---- running head -------------------------------------------------------------------------- */
.head {
  position: sticky; top: 0; z-index: 10; background: var(--color-surface); border-top: 4px solid var(--brand-blue); border-bottom: 1px solid var(--color-border);
  height: var(--head-height); display: flex; align-items: center; gap: var(--space-5); padding: 0 var(--margin);
}
.head .wm { font-size: 22px; }
.head .client { display: flex; align-items: center; padding-left: var(--space-4); margin-left: calc(-1 * var(--space-2)); border-left: 1px solid var(--color-ink); height: 34px; }
.head .client img { height: 34px; width: auto; display: block; }
.head nav { flex: 1; min-width: 0; }
.head nav ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--space-5); overflow: hidden; }
.head nav li { min-width: 0; }
.head nav a { text-decoration: none; font: 500 13px / 1 var(--font-ui-family); color: var(--color-ink-2); padding: 20px 0 18px; border-bottom: 3px solid transparent; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; max-width: 44ch; }
.head nav a:hover { color: var(--color-ink); }
.head nav a[aria-current="page"] { color: var(--color-ink); border-bottom-color: var(--brand-blue); }
.head-meta { font: 400 13px var(--font-ui-family); color: var(--color-ink-2); white-space: nowrap; }
.head-meta b { font-weight: 700; color: var(--color-ink); }
.live { display: inline-flex; align-items: center; gap: 6px; font: 400 13px var(--font-ui-family); color: var(--color-ink-2); white-space: nowrap; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--brand-red); }

/* ---- page ---------------------------------------------------------------------------------- */
.page { max-width: 1440px; margin: 0 auto; padding: 0 var(--margin) var(--space-8); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 0; align-content: start; }
.page > * { grid-column: 1 / -1; min-width: 0; }
/* the head rule of the co-brand: an ink hairline that starts with a short amber stroke */
.page-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); margin-top: var(--space-6); padding: var(--space-4) 0 var(--space-5); border-top: 1px solid var(--color-ink); flex-wrap: wrap; }
.page-head::before { content: ""; position: absolute; left: 0; top: -2px; width: 60px; height: 3px; background: var(--brand-amber); }
.sub { margin: 6px 0 0; font: 400 14px / 1.9 var(--font-ui-family); color: var(--color-ink-2); max-width: none; }
.sub .tag { vertical-align: 1px; margin-right: 4px; }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.page > .main { grid-column: 1 / span 8; }
.page > .panel { grid-column: 9 / span 4; align-self: start; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: var(--space-5); }
.card--lead { border-top: 4px solid var(--brand-amber); }
.mt { margin-top: var(--space-7); }
.caption { display: block; margin-top: var(--space-3); font: 400 12px / 1.5 var(--font-ui-family); color: var(--color-ink-2); max-width: 72ch; }
.caption b { font-weight: 600; color: var(--color-ink); }
.foot { margin-top: var(--space-7); border-top: 1px solid var(--brand-rule); padding-top: 10px; display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; font: 400 12px / 1.4 var(--font-ui-family); color: var(--color-ink-2); }

/* ---- controls ------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 500 13px / 1 var(--font-ui-family); padding: 9px 14px; border: 1px solid var(--brand-rule); background: var(--color-surface); color: var(--color-ink); cursor: pointer; border-radius: var(--radius-card); text-decoration: none; white-space: nowrap; }
.btn svg { width: 12px; height: 12px; flex: none; }
svg path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--color-grey-1); }
.btn--primary { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--color-primary-ink); }
.btn--primary:hover { background: var(--brand-blue-dark); border-color: var(--brand-blue-dark); }
.btn:disabled { color: var(--color-ink-3); border-color: var(--color-border); text-decoration: line-through; cursor: default; background: var(--color-surface); }

.field { display: grid; gap: 4px; margin: 0 0 var(--space-3); padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font: 500 12px / 1.3 var(--font-ui-family); color: var(--color-ink-2); padding: 0; }
.field legend { margin-bottom: 4px; }
input, select, textarea { font: 400 13px / 1.4 var(--font-ui-family); color: var(--color-ink); padding: 8px 10px; border: 1px solid var(--brand-rule); background: var(--color-surface); border-radius: var(--radius-card); width: 100%; margin: 0; }
input::placeholder { color: var(--color-ink-3); }
input:user-invalid { border-color: var(--brand-red); }
input[type="file"] { padding: 0; cursor: pointer; }
input[type="file"]::file-selector-button { font: 500 13px / 1 var(--font-ui-family); color: var(--color-ink); background: var(--color-surface); border: 0; border-right: 1px solid var(--brand-rule); padding: 9px 14px; margin-right: 10px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--color-grey-1); }
input[type="checkbox"] { width: 14px; height: 14px; padding: 0; margin: 0; accent-color: var(--brand-blue); flex: none; }
.option { display: inline-flex; align-items: center; gap: 6px; font: 400 13px / 1.4 var(--font-ui-family); color: var(--color-ink); white-space: nowrap; cursor: pointer; }
.field .option { margin: 2px 0; }
.error { font: 400 12px / 1.4 var(--font-ui-family); color: var(--brand-red); max-width: none; }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 30px; cursor: pointer; }
.select svg { position: absolute; right: 10px; top: 50%; width: 12px; height: 12px; translate: 0 -50%; pointer-events: none; }
form .btn { margin-top: var(--space-2); }

.toolbar { display: flex; gap: var(--space-2) var(--space-3); align-items: center; flex-wrap: wrap; position: sticky; top: var(--head-height); z-index: 5; background: var(--color-surface); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-top: 0; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.toolbar .select select { width: auto; min-width: 190px; }
.toolbar .count { margin-left: auto; font: 400 12px var(--font-ui-family); color: var(--color-ink-2); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid var(--color-ink); font: 500 12px / 1.4 var(--font-ui-family); color: var(--color-ink); white-space: nowrap; border-radius: var(--radius-md); }
.tag--quiet { border-color: var(--color-border); color: var(--color-ink-2); }
.tag--attn { border-color: var(--brand-amber); color: var(--color-ink); }
.tag--attn::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--brand-amber); }
.tag--fail { border-color: var(--brand-red); color: var(--brand-red); }
.tag--fail::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--brand-red); }
.warn { color: var(--color-warning); }
.fail { color: var(--brand-red); }

/* check line: the state of a running or failed job */
.check { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-top: 4px solid var(--brand-amber); border-radius: var(--radius-card); font-size: 14px; }
.check p { margin: 2px 0 0; max-width: none; overflow-wrap: anywhere; }

/* ---- tables (ruled rows inside a card) ----------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { font: 600 12px / 1.3 var(--font-ui-family); color: var(--color-ink-2); border-bottom-color: var(--brand-rule); }
tbody tr:last-child td { border-bottom-color: var(--brand-rule); }
td.num, th.num { text-align: right; padding-right: 24px; white-space: nowrap; }
td.num { font-weight: 600; }
td .sub { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; }
tbody tr.empty td { color: var(--color-ink-2); padding: 12px 0; }
tbody tr.clickable { cursor: pointer; }

table.jobs td:first-child { overflow-wrap: anywhere; }
table.jobs td:first-child a { font-weight: 700; text-decoration: none; }
table.jobs td:first-child a:hover { color: var(--brand-blue); text-decoration: underline; }

table.segments { table-layout: fixed; }
table.segments td { overflow-wrap: anywhere; }
table.segments td:last-child, table.segments th:last-child { padding-right: 0; }
table.segments .kind { display: block; font: 600 12px / 1.4 var(--font-ui-family); color: var(--color-ink-2); margin-bottom: 2px; }
table.segments td.candidate { color: var(--color-ink-2); }
table.segments td.chosen { color: var(--color-ink); }
table.segments td.chosen .kind { color: var(--color-ink); }
/* selected is a thicker rule, never a tinted row */
table.segments tr.selected td { border-top: 2px solid var(--color-ink); border-bottom: 2px solid var(--color-ink); }
.btn--small { font-size: 12px; padding: 5px 9px; }
textarea { display: block; min-height: 96px; resize: vertical; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-2); }
.cell-note { display: block; margin-top: var(--space-2); font: 400 12px / 1.4 var(--font-ui-family); color: var(--color-ink-2); }
.check .btn { margin-left: auto; flex: none; }
.finding { margin-bottom: var(--space-2); font-size: 12px; line-height: 1.45; }
.finding:last-child { margin-bottom: 0; }
.finding .tag { margin-right: 6px; vertical-align: 1px; }

/* ---- page comparison ------------------------------------------------------------------------ */
.spread { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: var(--space-5); }
.sheet-figure { margin: 0; min-width: 0; }
.sheet { position: relative; border: 1px solid var(--color-border); background: var(--color-surface); min-height: 120px; line-height: 0; }
.sheet img { width: 100%; display: block; }
.sheet p { font: 400 13px / 1.5 var(--font-ui-family); color: var(--color-ink-2); padding: var(--space-5); }
.sheet-figure .caption { margin-top: var(--space-2); }
/* finding marks on the page: a stroke, never a fill; selected is the same stroke at 3px */
.box { position: absolute; border: 1.5px solid var(--color-ink); cursor: pointer; }
.box.critical { border-color: var(--brand-red); }
.box.warning { border-color: var(--brand-amber); }
.box.info { border: 1px dashed var(--color-ink-2); }
.box.selected { border-width: 3px; border-style: solid; z-index: 2; }

/* ---- responsive ------------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  :root { --margin: 32px; }
  .head { flex-wrap: wrap; height: auto; padding-top: 10px; }
  .head nav { flex-basis: 100%; order: 3; }
  .head nav a { padding: 12px 0 10px; }
  .live { margin-left: auto; }
  .page > .main, .page > .panel { grid-column: 1 / -1; }
  .page > .panel { margin-top: var(--space-5); }
  .head-meta { display: none; }
  .toolbar { position: static; }
  .table-wrap { overflow-x: auto; }
  .table-wrap table.segments { min-width: 960px; }
}
@media (max-width: 760px) {
  :root { --margin: 20px; --gutter: 16px; }
  .head { gap: var(--space-4); }
  h1 { font-size: 24px; }
  .page-head { margin-top: var(--space-5); }
  .card { padding: var(--space-4); }
  .toolbar .count { margin-left: 0; flex-basis: 100%; }
  .spread { grid-template-columns: 1fr; }
  .foot { margin-top: var(--space-7); }
  td.num, th.num { padding-right: 12px; }
}
@media (max-width: 480px) {
  table.jobs thead { display: none; }
  table.jobs tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3); padding: 8px 0; border-bottom: 1px solid var(--color-border); }
  table.jobs tbody tr:last-child { border-bottom: 0; }
  table.jobs td { display: block; border: 0; padding: 0; text-align: left; }
  table.jobs td:nth-child(2) { justify-self: end; }
  table.jobs td.num { font-weight: 400; }
  table.jobs td.num::before { content: attr(data-label) " "; color: var(--color-ink-2); }
  table.jobs td.num:nth-child(even) { justify-self: end; }
  table.jobs tr.empty { display: block; }
}

/* Estimate shown before a job is started */
.estimate { padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--brand-amber); border-radius: var(--radius-card); font-size: 13px; }
.estimate p { margin: 0 0 4px; max-width: none; }
.estimate p:last-child { margin-bottom: 0; color: var(--color-ink-2); }

/* ---- source hints and the translation memory ------------------------------------------------ */
.hint { font: 400 12px / 1.4 var(--font-ui-family); color: var(--color-ink-2); overflow-wrap: anywhere; }
.hint:empty { display: none; }
.count { font: 400 12px var(--font-ui-family); color: var(--color-ink-2); }
p.count { margin: 0 0 var(--space-2); max-width: none; }
.memory-bar { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.memory-bar .btn { margin: 0; }
table.memory { table-layout: fixed; }
table.memory td { overflow-wrap: anywhere; }
table.memory th:nth-child(3), table.memory th:nth-child(4) { width: 110px; }
table.memory td:last-child, table.memory th:last-child { padding-right: 0; text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .memory-bar { grid-template-columns: 1fr; }
}

/* ---- sign-in --------------------------------------------------------------------------------- */
.user { display: inline-flex; align-items: center; gap: var(--space-2); font: 400 13px var(--font-ui-family); color: var(--color-ink-2); white-space: nowrap; }
.login { min-height: calc(100vh - 160px); display: flex; align-items: center; justify-content: center; padding: var(--space-5) var(--margin); }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.login-card h1 { font-size: 20px; margin: 0 0 var(--space-2); }
.login-card p { margin: 0 0 var(--space-4); max-width: none; color: var(--color-ink-2); }
.login-card .error { margin: var(--space-3) 0 0; color: var(--brand-red); }
.google-button { display: flex; justify-content: center; min-height: 44px; }
.reauth { position: fixed; inset: 0; z-index: 20; background: rgb(11 31 58 / 0.55); display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
