/* Platform stylesheet, ported from docs/annotation-tool/mockups/v2/assets/mockup.css
   (M1-R30). Plain CSS, no build step (ADR 0002). Component and workspace rules
   follow the base, adapted from the anotar.html mockup to the real markup.
   Colour roles:
   - accent (blue): the person's own answers and primary actions
   - model (amber): anything that came from a model, never used for anything else
   - seed (violet): values pre-filled from other annotators or an import
   - ok / warn / danger: status only */

:root {
  --ink: #16181D;
  --ink-2: #2B303B;
  --ink-3: #3B4150;
  --muted: #565C6B;
  --faint: #8A90A0;
  --line: #DCDFE5;
  --line-2: #EEF0F3;
  --ctrl: #C9CED6;
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --sunk: #FAFBFC;

  --accent: #1D4ED8;
  --accent-ink: #1E3A8A;
  --accent-soft: #E8EEFC;

  --model: #C2620E;
  --model-ink: #6E3300;
  --model-soft: #FFF0DE;
  --model-line: #F1C99F;
  --model-sunk: #FFF8F0;

  --seed: #6D28D9;
  --seed-ink: #4C1D95;
  --seed-soft: #F1EAFE;
  --seed-line: #D9C8F7;

  --ok: #1F5130;
  --ok-soft: #E3EEE6;
  --warn: #8A4500;
  --warn-soft: #FFF4E5;
  --warn-line: #F1C99F;
  --danger: #A3261E;
  --danger-soft: #FDECEA;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
mark { background: #FFE9A8; color: var(--ink); border-radius: 2px; padding: 0 1px; }
/* Producer MathML carries a mathsize hint (24px); author CSS overrides it. */
math { font-size: inherit; }
.mono { font-family: var(--mono); }
.hint { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.h-section { font-size: 15px; font-weight: 600; }
.h-page { font-size: 20px; font-weight: 600; }
.req { color: #A23B00; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 6px;
  border: 1px solid var(--ctrl); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface); color: var(--ink-2);
}

/* App chrome */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); }
.topbar .ctx { font-size: 13px; color: var(--muted); }
.topbar .right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-bottom: 2px solid transparent; color: var(--ink-3); text-decoration: none; white-space: nowrap; font-weight: 500;
}
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
/* Shared topbar (templates/partials/topbar.html). The nav sits after the
   brand and pushes the account menu right. On a phone the brand shares its
   row with the avatar when 160px are left for it, and the nav takes its own
   row below. */
.topbar .brand { white-space: nowrap; }
.topbar .right { margin-left: auto; }
.topbar-nav { gap: 4px; margin-right: auto; }
@media (max-width: 640px) {
  .topbar > .inline:first-child { flex: 1 1 160px; }
  .topbar-nav { order: 3; flex-basis: 100%; }
}
/* Account menu in the shared topbar (inicio.html) */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px;
  box-shadow: 0 6px 20px rgba(22, 24, 29, .12); display: flex; flex-direction: column;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px;
  border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: 13px; cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--line-2); }
.menu-pop .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; overflow-wrap: anywhere; }
/* Project switcher in the topbar nav: opens from the left edge of its button
   and never wider than the phone. One group per project. */
.topbar-switch .menu-pop { left: 0; right: auto; width: max-content; max-width: min(320px, calc(100vw - 32px)); }
.topbar-switch .proj { display: flex; flex-direction: column; padding: 4px 0; }
.topbar-switch .proj + .proj { border-top: 1px solid var(--line-2); }
.topbar-switch .proj .lbl { padding: 4px 10px; overflow-wrap: anywhere; }
.topbar-switch .proj a { padding-left: 18px; }

.page { max-width: 1440px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.page-narrow { max-width: 960px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
/* A flex item, or a select, that may shrink below its content to the row's
   width. A select is otherwise as wide as its longest option. */
.fit-row { min-width: 0; max-width: 100%; }
select.fit-row { text-overflow: ellipsis; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-tight { padding: 14px 16px; }
.well { background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; }
.divider { border: 0; border-top: 1px solid var(--line-2); margin: 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border: 1px solid var(--ctrl); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn-lg { min-height: 44px; font-size: 14px; padding: 0 18px; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #FFFFFF; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; font-weight: 600; }
.btn-danger-outline { color: var(--danger); border-color: #D9A39E; font-weight: 600; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-link { border: 0; background: transparent; padding: 0; min-height: 32px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.btn[aria-disabled=true], .btn:disabled { background: #E3E6EB; border-color: #E3E6EB; color: var(--muted); cursor: not-allowed; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-3); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--line-2); }

/* Segmented and pill controls */
.seg { display: inline-flex; gap: 4px; }
.seg button {
  min-width: 56px; min-height: 36px; padding: 0 12px; border: 1px solid var(--ctrl); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.seg button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.seg button:disabled { cursor: not-allowed; opacity: .55; }
.switcher { display: inline-flex; padding: 3px; gap: 2px; background: #E9EBEF; border-radius: var(--r); }
.switcher button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--ink-3); font-size: 13px; font-weight: 500; cursor: pointer;
}
.switcher button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 24, 29, .14); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--ctrl); border-radius: 999px; background: var(--surface); color: var(--ink-2);
  font-size: 12px; cursor: pointer;
}
.pill[aria-pressed=true], .pill[aria-current=true] { border: 1.5px solid var(--accent); color: var(--ink); font-weight: 600; background: var(--accent-soft); }
a.pill { text-decoration: none; }
.pill .n { font-family: var(--mono); font-size: 11px; opacity: .8; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-3);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-model { background: var(--model-soft); color: var(--model-ink); }
.compare { border: 1.5px solid var(--model-line); }
.cmp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--sunk); }
.cmp-row.pending { background: var(--model-sunk); border-color: var(--model-line); }
.cmp-row .what { flex: 1 1 260px; min-width: 0; }
.cmp-row .vals { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.cmp-row .acts { display: flex; gap: 6px; }
.cmp-row .acts .btn { min-width: 92px; }
.model-rationale { flex-basis: 100%; font-size: 13px; color: var(--ink-2); max-width: 60ch; }
.model-rationale p { margin: 4px 0 0; }
.model-value { color: var(--model-ink); }
.model-inline { color: var(--model-ink); margin-top: 6px; }
.model-pick[hidden] { display: none; }
.model-pick { border-color: var(--model-line); color: var(--model-ink); }
.badge-seed { background: var(--seed-soft); color: var(--seed-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-solid { background: var(--accent); color: #FFFFFF; }

/* Forms */
.input, .select, .textarea {
  display: block; width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--ctrl); border-radius: var(--r); background: var(--surface);
}
.textarea { padding: 10px 12px; resize: vertical; min-height: 64px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.is-disabled { color: var(--muted, #8A90A0); cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; }
.err { font-size: 13px; color: var(--danger); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: var(--sunk); }
.tbl .num { text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.tbl th.num { font-family: inherit; }
.sort-btn { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* Bars */
.bar { position: relative; height: 8px; background: #E3E6EB; border-radius: 4px; overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.bar-target { position: relative; height: 8px; background: #E3E6EB; border-radius: 4px; }
.bar-target > .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.bar-target > .fill.below { background: var(--model); }
.bar-target > .tick { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); }
.bar-target > .ceiling { position: absolute; top: -4px; width: 0; height: 16px; border-left: 2px dashed var(--faint); }

/* Dialogs and toasts */
.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(22, 24, 29, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--surface);
  border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px;
}
.dialog-wide { max-width: 760px; }
.dialog h2 { font-size: 18px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* A form inside a dialog keeps the dialog's 14px rhythm between fields. */
.dialog-form { display: flex; flex-direction: column; gap: 14px; }
/* An empty result region takes no gap, so the footer sits where the mockup
   draws it. It stays rendered so a screen reader still hears the result. */
.dialog-form > [aria-live]:empty { margin-top: -14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95;
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px;
  background: var(--ink); color: #FFFFFF; font-size: 13px; max-width: calc(100% - 32px);
}
.toast .btn { background: transparent; color: #FFFFFF; border-color: #FFFFFF; min-height: 32px; }

/* Native <dialog> elements styled as .dialog. A closed one stays hidden even
   though .dialog sets display: flex. */
dialog.dialog { border: 0; margin: auto; color: var(--ink); }
dialog.dialog:not([open]) { display: none; }
dialog.dialog::backdrop { background: rgba(22, 24, 29, .45); }
.secret {
  font-family: var(--mono); font-size: 15px; padding: 10px 12px;
  background: var(--sunk); border: 1px dashed var(--ctrl); border-radius: var(--r);
}
.secret-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.secret-row .secret { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
pre.code { margin: 0; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); font: 500 12px/1.55 var(--mono); color: var(--ink-2); overflow-x: auto; white-space: pre; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.form-row .field { flex: 1 1 240px; min-width: 0; }
.soon { color: var(--warn); }
.tbl tr.is-new td { background: var(--ok-soft); }
.tbl tr.is-dead td:not(:last-child) { color: var(--muted); }

/* Option rows (radio-like big targets) */
.opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer;
}
.opt[aria-pressed=true] { border: 1.5px solid var(--accent); background: var(--accent-soft); }

/* Empty states */
.empty { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .h-page { max-width: 32ch; }
.empty p { max-width: 56ch; color: var(--ink-3); }

@media (max-width: 640px) {
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .tabs { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Simple form pages (account_password, workspace/queue_state). App pages
   use body.app and the shared topbar. */
body.simple { max-width: 42rem; margin: 2rem auto; padding: 0 1rem; }
body.simple label { display: block; margin-top: 1rem; }
body.simple input { display: block; width: 100%; max-width: 24rem; padding: 0.4rem; }
body.simple button { margin-top: 1rem; }
body.simple header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
ul.projects { list-style: none; padding: 0; }
/* Login (entrar.html): a 400px card centred in the viewport. body.auth keeps
   the simple pages' input and button rules away from it. */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login .brand-mark { font-size: 20px; font-weight: 600; }
.login .btn { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.g-icon { width: 18px; height: 18px; }
ul.projects li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.error { color: var(--danger); }
/* Notices (plataforma.html, entrar.html). A bare .notice reads as info.
   The mockups name the danger one notice-err, kept as an alias. */
.notice { padding: 10px 12px; border-radius: var(--r); font-size: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.notice-info { background: var(--accent-soft); color: var(--accent-ink); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-danger, .notice-err { background: var(--danger-soft); color: var(--danger); }

/* Workspace (anotar.html) */
body.workspace { padding-bottom: 0; }
.ws-topbar { position: sticky; top: 0; z-index: 30; }
.ws { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 8fr); gap: 20px; align-items: start; }
.item-panel { position: sticky; top: 72px; max-height: calc(100vh - 160px); overflow: auto; }
@media (max-width: 980px) { .ws { grid-template-columns: 1fr; } .item-panel { position: static; max-height: none; } }
.item-panel img { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.item-panel .item-body { margin-top: 14px; gap: 12px; }
.item-panel .item-foot-rule { margin: 16px 0 10px; }
/* A layout whose item needs more room (anotar-juiz.html): the columns grow
   1 to 1.3 from 380px and 520px bases, and stack when both no longer fit. */
.ws.ws-wide-item { display: flex; flex-wrap: wrap; }
.ws-wide-item > .item-panel { flex: 1 1 380px; min-width: 0; }
.ws-wide-item > .fields-pane { flex: 1.3 1 520px; min-width: 0; }
.stem { font-size: 16px; line-height: 1.6; white-space: pre-line; }
.alternatives { list-style: none; margin: 0; padding: 0; }
.alt { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.alt .letter { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--line-2); font-family: var(--mono); font-size: 13px; flex: none; }
.item-context { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.item-context > div { display: contents; }
.item-context dd { margin: 0; }
.alt .commentary { font-size: 13px; }
/* The key (anotar-juiz.html .alt.key): 2px accent row, filled letter, tag at the end. */
.alt.key { border: 2px solid var(--accent); }
.alt.key .letter { background: var(--accent); color: #FFFFFF; }
.alt:has(.alt-body) { align-items: flex-start; }
.alt-body { flex: 1 1 auto; min-width: 0; }
.alt-key-tag { color: var(--accent); flex: none; }
.guidance { font-size: 13px; color: var(--ink-2); }
.guidance summary { cursor: pointer; color: var(--muted); }
.guidance h4 { margin: 8px 0 2px; font-size: 13px; }
.guidance p { margin: 4px 0 0; }
.notice-submitted { border-color: var(--ok); background: var(--ok-soft); }
.notice-submitted .lbl, .notice-submitted .hint { color: var(--ok); }

.field-card { display: flex; flex-direction: column; gap: 10px; }
.field-head { display: flex; align-items: baseline; gap: 6px 12px; }
/* The count, tags and save status sit together on the right of the title
   line (mockup .inline). The title wraps before the status does. */
.field-head-end { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; margin-left: auto; flex: none; max-width: 65%; }
.field-head-end > * { white-space: nowrap; }
.field-head h2 { font-size: 15px; flex: 0 1 auto; min-width: 0; }
.field-head .optional { font-weight: 400; }
.save { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.save .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.field-card[data-save-state=saved] .save .dot { background: var(--ok); }
.field-card[data-save-state=saving] .save .dot { background: var(--accent); }
.field-card[data-save-state=failed] .save { color: var(--danger); font-weight: 600; }
.field-card[data-save-state=failed] .save .dot { background: var(--danger); }
.field-help { margin-top: -6px; }
/* Fields as numbered rows of one card (anotar-juiz.html .qrow). A layout opts
   in by wrapping each field in .field-row inside a .field-group card. */
.field-group { display: flex; flex-direction: column; counter-reset: field-row; }
.field-group-head { margin-bottom: 6px; }
.field-row { counter-increment: field-row; display: flex; flex-direction: column; }
.field-row + .field-row { border-top: 1px solid var(--line-2); }
.field-group .field-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 10px; border: 1px solid transparent; border-radius: var(--r); background: transparent; }
.field-group .field-card::before { content: counter(field-row); width: 16px; flex: none; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.field-group .field-card:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.field-group .field-head { flex: 1 1 260px; min-width: 0; flex-wrap: nowrap; align-items: center; }
.field-group .field-head h2 { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 400; }
.field-group .field-head .req { display: none; }
.field-group .field-head .save { white-space: nowrap; }
.field-group .field-help { margin: 0; flex-basis: 100%; }
.field-group .guidance { padding: 0 10px 10px 38px; }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* Segmented radios: a visually hidden radio inside a pressed-looking label */
.seg-wrap { flex-wrap: wrap; gap: 6px; }
.seg-opt { position: relative; display: inline-flex; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; min-height: 36px; padding: 0 12px; border: 1px solid var(--ctrl); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.seg-wrap .seg-opt span { min-width: 84px; }
.seg-opt:hover span { border-color: var(--faint); }
.seg-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* checklist */
.key-rows { display: flex; flex-direction: column; }
.key-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 7px 8px; border-radius: var(--r); }
.key-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.key-row + .key-row { border-top: 1px solid var(--line-2); }
.key-row:focus-within, .key-row:focus { background: var(--accent-soft); outline: none; }
.key-row[data-shortcut-current] { background: var(--accent-soft); }
.field.checklist > fieldset > .hint { margin-top: -8px; }
.field.checklist .key-rows { margin-top: 2px; }

/* row_review (backend/components/row_review.py). Each row is a .key-row in
   a bordered box. Its title runs across the top, its questions sit on the
   left and its derived label in a column on the right. The current row takes
   the accent border. */
.row-review { display: flex; flex-direction: column; gap: 12px; flex-basis: 100%; }
.row-review-callout { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r); }
.row-review-intro { font-size: 13px; font-weight: 600; color: var(--warn); }
.row-review-questions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-2); }
.row-review-questions li { display: flex; align-items: baseline; gap: 10px; }
.row-review-tag { flex: none; width: 22px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--warn); background: var(--surface); border: 1px solid var(--warn-line); border-radius: 4px; }
.row-review-guide { background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); }
.row-review-guide > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 44px; box-sizing: border-box; padding: 12px 14px; cursor: pointer; list-style: none; }
.row-review-guide > summary::-webkit-details-marker { display: none; }
.row-review-guide > summary::before { content: "›"; align-self: center; width: 10px; font-weight: 600; color: var(--muted); transition: transform .15s; }
.row-review-guide[open] > summary::before { transform: rotate(90deg); }
.row-review-guide-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px 32px; }
.row-review-guide table { border-collapse: collapse; width: 100%; font-size: 13px; }
.row-review-guide th { text-align: left; padding: 6px 12px 6px 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.row-review-guide td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.row-review-guide td:first-child { white-space: nowrap; color: var(--ink-2); }
.row-review-guide tr:last-child td { border-bottom: 0; }
.row-review-rows { gap: 10px; }
.row-review-group { margin: 8px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.row-review-rows > .row-review-group:first-child { margin-top: 0; }
.key-row.row-review-row { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); }
.key-row.row-review-row + .key-row.row-review-row { border-top: 1px solid var(--line); }
.key-row.row-review-row:focus-within, .key-row.row-review-row:focus, .key-row.row-review-row[data-shortcut-current] { background: transparent; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.row-review-head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-review-title { font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.row-review-qs { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row-review-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.row-review-qlabel { font-size: 13px; }
.row-review-rel { display: flex; flex-direction: column; gap: 4px; }
.row-review-rel-name { font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .key-row.row-review-row { grid-template-columns: 1fr; } }

/* entry_links (backend/components/entry_links.py). Entries are bordered
   boxes; each payload row is a card with its link checklist, an unlinked
   rating in a dashed box and its note. */
.entry-links { display: flex; flex-direction: column; gap: 14px; flex-basis: 100%; }
.entry-links-entry { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.entry-links-entry .textarea { min-height: 52px; font-size: 13px; }
.entry-links-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.entry-links-q > span { font-size: 13px; }
.entry-links-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.entry-links-row:first-child { border-top: 0; padding-top: 4px; }
.entry-links-row p { font-size: 13px; line-height: 1.5; }
.entry-links-row-head { font-size: 13px; }
.entry-links-pill { max-width: 100%; }
.entry-links-pill .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.entry-links-unlinked { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--ctrl); border-radius: var(--r); background: var(--sunk); }
.entry-links-required { color: var(--warn); }

/* text */
.field.text .textarea { min-height: 64px; }
.field.text .field-help-after { margin: 8px 0 0; }

/* taxonomy_picker */
.taxonomy-picker { display: flex; flex-direction: column; gap: 14px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent); padding: 2px 2px 2px 10px; font-size: 13px; }
.chip-btn { cursor: pointer; padding-right: 10px; font: inherit; font-size: 13px; color: var(--accent-ink); }
.chip.deprecated { background: var(--warn-soft); border-color: var(--warn); }
.chip.deprecated .name { text-decoration: line-through; }
.chip .hint { margin-left: 4px; }
.pick-text { min-width: 0; overflow-wrap: anywhere; }
.pick-text .path { color: var(--muted); }
.pick-text .name { font-weight: 600; }
.pick-text .code { font-size: 12px; }
.chip.deprecated .hint { color: var(--warn); }
.chip .btn-sm { margin-left: 6px; }
.picker { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.picker-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.picker-bar:empty { display: none; }
.picker-bar kbd { margin-left: 4px; }
.picker-slot { max-height: 420px; overflow-y: auto; }
.picker-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.picker-tree-pane > .picker-empty { margin: 0; }
.picker-dims { display: flex; flex-direction: column; gap: 8px; }
.picker-dims .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dim-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill[aria-disabled=true] { opacity: .6; cursor: not-allowed; }
.picker-tree { list-style: none; margin: 0; padding: 0; }
.picker-tree [role=group] { list-style: none; margin: 0; padding: 0 0 0 22px; }
.picker-tree .row { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; min-height: 38px; padding: 2px 12px; }
.picker-tree[role=tree] > li { border-bottom: 1px solid var(--line-2); }
.picker-tree[role=tree] > li:last-child { border-bottom: 0; }
.picker-tree [aria-level="1"] > .row { min-height: 44px; }
.picker-tree [aria-level="2"]:not([data-selectable=true]) > .row { min-height: 40px; }
.picker-tree .row > .label, .picker-tree .row > label { flex-grow: 1; min-width: 0; }
.picker-tree .label:has(> .code) { display: flex; align-items: baseline; gap: 12px; }
.picker-tree .label > .code { width: 76px; flex: none; font-size: 12px; font-weight: 500; }
.picker-tree .label > .desc { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.picker-tree label > .label { min-width: 0; }
.picker-tree .count { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 24px; text-align: right; flex: none; }
.picker-tree [role=treeitem]:focus { outline: none; }
.picker-tree [role=treeitem]:focus > .row { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }
.picker-tree [aria-checked=true] > .row { background: var(--accent-soft); }
.picker-tree [aria-level="1"]:not([data-selectable=true]) > .row .label { font-weight: 600; }
.picker-tree [aria-level="2"]:not([data-selectable=true]) > .row .label { font-weight: 500; }
.picker-tree label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-grow: 1; }
.picker-tree input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.picker input.implied { accent-color: #93A9E8; }
.picker-tree .expand { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-3); cursor: pointer; transition: transform .15s; }
.picker-tree [role=group] .chev { width: 14px; height: 14px; }
.picker-tree .expand:hover { background: var(--line-2); }
.picker-tree [aria-expanded=true] > .row > .expand { transform: rotate(90deg); }
.picker-tree .row:not(:has(.expand)) { padding-left: 48px; }
.label.deprecated { text-decoration: line-through; color: var(--warn); }
.picker-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }

.picker-search { padding: 12px; }
/* search_style: simple (anotar.html BNCC search) */
.picker-search-simple { gap: 8px; }
.simple-result { flex-direction: row; align-items: center; gap: 12px; width: 100%; }
.simple-result:hover { border-color: var(--faint); }
.simple-result:disabled { cursor: default; opacity: .6; }
.simple-code { font-size: 12px; width: 76px; flex: none; }
.simple-text { flex-grow: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.simple-action { font-size: 12px; font-weight: 600; color: var(--accent); flex: none; }
.search-controls { gap: 12px 20px; align-items: flex-end; }
.grow { flex: 1 1 280px; min-width: 0; }
.blend-field { flex: 0 1 260px; }
.lbl-soft { font-weight: 500; }
.blend { width: 100%; accent-color: var(--accent); }
.picker-results { list-style: none; margin: 0 -12px -12px; padding: 0; }
.result { border-top: 1px solid var(--line-2); }
.result.on { background: var(--accent-soft); }
.result label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; cursor: pointer; }
.result input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.result-main { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.result-label { font-weight: 500; overflow-wrap: anywhere; }
.result-label .code { font-size: 12px; }
.result-after { font-weight: 400; font-size: 13px; }
.result-note { color: var(--ink-3); }
.result-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 4px; flex: 0 1 auto; max-width: 45%; }
.badges { gap: 4px; }
.src { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); white-space: nowrap; }
.src.kw { border-color: #93AAEB; }
.src.sem { border-color: #9AC7C1; }

.picker-map-slot .hint[role=status] { padding: 12px; }
.picker-map-wrap { position: relative; }
.picker-map { display: block; width: 100%; aspect-ratio: 16 / 10; background: var(--sunk); }
.picker-map circle { cursor: pointer; }
.picker-map-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.picker-map-tools button { width: 32px; height: 32px; border: 1px solid var(--ctrl); background: var(--surface); border-radius: 6px; cursor: pointer; font-size: 16px; }
.picker-map-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.picker-map-legend button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; cursor: pointer; }
.picker-map-legend button[aria-pressed=false] { opacity: .45; text-decoration: line-through; }
.picker-map-legend .swatch { width: 10px; height: 10px; border-radius: 50%; }
.picker-map-wrap > .hint { padding: 0 12px 12px; }

/* Footer, shortcuts and toast */
.footer { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 24px; }
.footer-inner { max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.req-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-3); }
.req-chip.done { background: var(--ok-soft); color: var(--ok); }
.req-chip .when-done, .req-chip.done .when-open { display: none; }
.req-chip.done .when-done { display: inline; }
kbd.on-primary { background: transparent; color: inherit; border-color: currentColor; }
/* A chip shows its field label on one line and cuts a long one short (the
   title holds the whole label). On a phone two chips share a row and the key
   hints go, so the footer stays under the mockup's 195px at 390px. */
.footer-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.req-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.req-chip { max-width: 30ch; min-width: 0; }
.req-chip svg { flex: none; }
.req-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
[data-submit-blocker]:empty { display: none; }
.btn-primary:disabled, .btn-primary[aria-disabled=true] { font-weight: 500; }
/* The key hint on a disabled Anterior or Próximo fades with its button. */
.btn[aria-disabled=true] kbd, .btn:disabled kbd { background: transparent; color: var(--muted); }
@media (max-width: 640px) {
  .ws-topbar { position: static; }
  .footer { padding: 10px 16px; }
  .footer-inner { gap: 8px; }
  .footer-status { flex: 1 1 100%; }
  .req-chips { flex: 1 1 100%; }
  .req-chip { max-width: calc(50% - 3px); }
  .footer-actions kbd { display: none; }
}
.toast { bottom: 88px; }
.keys-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 13px; }

/* Skip dialog: each reason is an .opt card around a visually hidden radio. */
.skip-reasons { display: flex; flex-direction: column; gap: 6px; }
.skip-reason { position: relative; width: 100%; }
.skip-reason input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.skip-reason:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.skip-reason:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lbl .optional { font-weight: 400; }
[data-skip-error]:empty { display: none; }
[data-skip-error] { color: var(--danger, #B42318); }

/* Skip dialog, as anotar-juiz.html: a 14px intro and one-line reasons. A
   reason's explanation shows once it is chosen. */
.skip-intro { font-size: 14px; }
.skip-reason .hint { display: none; }
.skip-reason:has(input:checked) .hint { display: block; }

/* Workspace chrome. The footer as a card closing the fields column, for a
   layout that places {{ footer }} (anotar-juiz.html). Its chips carry short
   labels, so they are not cut. */
.footer-card { position: sticky; bottom: 0; z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.footer-card .footer-inner { margin: 0; width: 100%; }
.footer-card .req-chip { max-width: none; }
/* The queue bar in the workspace header, 110px as in anotar-juiz.html. */
.ws-bar { width: 110px; flex: none; }
/* The account menu's button is the avatar itself, flush with the topbar's
   right padding. */
/* It keeps the .btn 40px height, so the topbar is 61px as in the mockups. */
.avatar-btn { padding: 0; border: 0; border-radius: 50%; }
.topbar-lead { gap: 14px; }
/* On a phone the workspace header keeps the mockup's 175px. On every topbar
   the context takes one line and ends in an ellipsis (its title holds the
   whole text). In the workspace the brand, context and badge rows sit 6px
   apart. */
@media (max-width: 640px) {
  .ws-topbar .topbar-lead { row-gap: 6px; }
  .topbar .topbar-lead { min-width: 0; max-width: 100%; }
  .topbar .ctx { flex: 1 1 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The review item page has the 120px header of admin/revisao.html, so its
     badge shares the brand row and the context comes second. */
  .ws-review .topbar-lead { row-gap: 8px; }
  .ws-review .topbar-lead .ctx { order: 1; }
}

/* Seeded stages: provenance, locks and the sources panel. */
.prov { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--seed-soft); color: var(--seed-ink); }
.prov:empty { display: none; }
/* A vote's outcome is status, not provenance (admin/revisao.html). */
.prov[data-state=agreed] { background: var(--ok-soft); color: var(--ok); }
.prov[data-state=majority] { background: var(--accent-soft); color: var(--accent-ink); }
.prov[data-state=disagreed] { background: var(--warn-soft); color: var(--warn); }
/* No agreement block: neutral, like the mockup's plain .badge. */
.prov[data-state=unscored] { background: var(--line-2); color: var(--ink-3); }
/* A review field the vote settled: one line until the reviewer opens it. */
details.settled > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; cursor: pointer; }
details.settled > summary::-webkit-details-marker { display: none; }
details.settled[open] > summary .btn-link { display: none; }
.settled-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
/* A review field with no agreement block: the answers as text, the editor
   behind one link. */
.unscored-answers { display: flex; flex-direction: column; gap: 4px; }
.unscored-answers .lbl { font-size: 12px; }
details.unscored { margin-top: 6px; }
details.unscored > summary { list-style: none; cursor: pointer; }
details.unscored > summary::-webkit-details-marker { display: none; }
details.unscored[open] > summary { display: none; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag-locked { background: var(--line-2); color: var(--muted); }
.field-card.locked, .key-row.locked { background: var(--sunk); color: var(--muted); }
/* Source cards (admin/revisao.html .srcs): side by side, full width at 390. */
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.source-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.source-row.model { border-color: var(--model-line); background: var(--model-soft); }
.source-row .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.source-row .btn { margin-top: auto; }
.source-value { font-size: 13px; overflow-wrap: anywhere; }
.notice-seeded { border-color: #C9B8F2; background: var(--seed-soft); }
.notice-seeded .lbl, .notice-seeded .hint { color: var(--seed-ink); }

/* Item import (lotes.html import dialog): drop zone, count tiles, rejected well. */
/* The import page stands in for the 760px .dialog-wide of lotes.html until M3-2. */
.import-panel { width: 100%; max-width: 760px; }
.drop { border: 1.5px dashed var(--ctrl); border-radius: var(--r); padding: 18px; text-align: center; background: var(--sunk); }
.drop-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-weight: 500; }
.drop .hint { margin-top: 4px; }
.drop .btn { margin-top: 10px; }
.drop .btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.report { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.report > div { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.report .v { font-family: var(--mono); font-size: 20px; }
.well-danger { border-color: #E8B4AF; background: var(--danger-soft); }
.well-seed { border-color: var(--seed-line); background: var(--seed-soft); }
.well-seed .lbl { color: var(--seed-ink); }
.well-title { font-weight: 600; color: var(--danger); }
.well-danger .hint { margin-top: 2px; }

/* Platform admin (plataforma.html, templates/platform/). */
.platform .tbl td.mono { font-size: 12px; }
.platform .tbl td.mono, .platform .tbl td.nowrap { white-space: nowrap; }
.platform .cell-name { font-weight: 600; }
.platform .row-actions { display: flex; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.platform .toast { bottom: 24px; width: max-content; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.input-file { padding: 8px 12px; }
.notice pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.notice summary { cursor: pointer; }
/* On a phone the five tabs scroll sideways. An edge fades while more tabs
   sit past it (page.html sets data-more). */
@media (max-width: 640px) {
  .platform .tabs[data-more=right] {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
  }
  .platform .tabs[data-more=left] {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
  }
  .platform .tabs[data-more=both] {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
  }
}

/* Home (inicio.html): project cards and the recent submissions. The
   .sent-list rules style both sent tables, home and the history page. */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; gap: 14px; }
.pcard h3 { font-size: 16px; }
.pcard-head { align-items: flex-start; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcard .stat .v { font-family: var(--mono); font-size: 20px; }
.pcard .stat .v .hint { font-family: 'IBM Plex Sans', sans-serif; }
.pcard .stat .t { font-size: 14px; font-weight: 600; margin-top: 4px; }
.pcard-foot { justify-content: flex-end; margin-top: auto; }
/* On a phone a staff card's three buttons keep one row, at the small size
   the mockup's topbar nav uses at that width. */
@media (max-width: 640px) {
  .pcard-foot-staff { flex-wrap: nowrap; }
  .pcard-foot-staff .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
}
.state-note { padding: 10px 12px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.sent-list td .mono { font-size: 12px; }
.sent-list .proj-sub { display: none; }
.sent-list .title-sub { display: none; }
.sent-list td.act { text-align: right; }
/* The .sr-only header is absolutely placed. Without a positioned wrapper it
   escapes the scroll box and widens the page at 390px. */
.sent-list .tbl-wrap { position: relative; }
/* On a phone the project moves under the item and badges may wrap, so the
   table fits the card without scrolling. */
@media (max-width: 640px) {
  .sent-list .hist-date, .sent-list .proj-col { display: none; }
  .sent-list .proj-sub { display: block; margin-top: 2px; }
  /* The title column moves under the item too. */
  .sent-list .hist-title { display: none; }
  .sent-list .title-sub { display: block; margin-top: 4px; }
  .sent-list .badge { white-space: normal; border-radius: 10px; }
}

/* History page filters (pages/sent.html): the search takes the free width,
   so its placeholder is never cut, and the lote select keeps a usable one. */
.hist-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.hist-q { flex: 1 1 280px; min-width: 0; }
.hist-lote { flex: 0 1 220px; min-width: 160px; }
/* A row whose answer has a revision not yet sent. */
.sent-list tr.row-pending td { background: color-mix(in srgb, var(--warn-soft) 50%, var(--surface)); }

/* Configurações (spec M3-11). An .opt-radio is an .opt card around a
   visually hidden radio, as the skip reasons are. */
.opt-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.opt-radio { position: relative; width: 100%; }
.opt-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.opt-radio:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.opt-radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-title { font-weight: 600; }
.field-model { max-width: 420px; }
.saved { font-size: 12px; font-weight: 600; color: var(--ok); }
.thr { width: 96px; min-height: 34px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.list-row .k { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 160px; }
.list-row .l { flex: 1 1 220px; min-width: 0; }
.list-row.off .l { color: var(--faint); text-decoration: line-through; }

/* Lotes: the table, the create dialog and its preview (mockup v2/admin/lotes) */
.lotes-tbl { min-width: 1000px; }
.batch-name { font-weight: 500; }
.prog { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.prog .bar { flex: 1 1 auto; }
.select-sm { min-height: 32px; width: auto; }
.wf-opts { display: flex; flex-direction: column; gap: 6px; }
.opt-name { font-weight: 600; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.fieldset-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.static-value { min-height: 40px; display: inline-flex; align-items: center; font-family: var(--mono); font-size: 13px; }
/* Radio inputs sit visually hidden inside .pill and .opt, so the label shows the choice. */
label.pill, label.opt { cursor: pointer; }
label.pill:has(input:checked), label.opt:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); }
label.pill:has(input:checked) { color: var(--ink); font-weight: 600; }
label.pill:has(input:focus-visible), label.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Anotadores (docs/annotation-tool/mockups/v2/admin/anotadores.html) */
.kpi .v { font-family: var(--mono); font-size: 22px; margin-top: 4px; }
.flag { color: var(--warn); font-weight: 600; }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.stepper .s { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stepper .s.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.stepper .arrow { color: var(--faint); }
.state-onboarding { background: var(--warn-soft); border-color: var(--model-line); }
.frow { display: grid; grid-template-columns: minmax(0, 170px) 1fr 56px; gap: 8px; align-items: center; font-size: 13px; }
.scatter svg, .hist-svg svg { width: 100%; height: auto; display: block; }
.scatter svg { max-height: 340px; }
.scatter text, .hist-svg text { font-size: 11px; fill: var(--muted); }
.scatter .sc-axis, .hist-svg .sc-axis { stroke: var(--ctrl); }
.sc-corner { fill: var(--model-soft); }
.sc-dot { fill: var(--accent); fill-opacity: .45; }
.sc-dot.me { fill-opacity: 1; stroke: var(--accent-ink); stroke-width: 2; }
.scatter text.sc-me { fill: var(--ink); font-weight: 600; }
.hist-svg { max-width: 560px; }
.hist-svg text { font-size: 10px; }
.hi-bar { fill: var(--accent); }
.hist-svg text.hi-count { fill: var(--ink-3); }

/* Visão geral */
.kpi .v { font-family: var(--mono); font-size: 26px; margin-top: 4px; }
.chart { width: 100%; height: auto; max-height: 220px; display: block; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-bar { fill: var(--accent); }
.chart-bar.weekend { fill: var(--accent); opacity: .5; }
.chart-v { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }
.chart-d { font-size: 11px; fill: var(--muted); }
.attn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); flex-wrap: wrap; }
.attn .t { flex: 1 1 220px; min-width: 0; font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.fcard { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.fcard .val { font-family: var(--mono); font-size: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw-ceil { width: 0; height: 12px; border-left: 2px dashed var(--faint); }

/* Qualidade */
.kgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 200px) 48px auto; gap: 8px 12px; align-items: center; }
.kgrid .bar { height: 10px; }
.hi-bar.hi-low { fill: var(--model); }
.hi-threshold { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cohort { display: grid; grid-template-columns: 80px minmax(0, 1fr) 48px; gap: 6px 10px; align-items: center; }
.matrix { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 520px; }
.matrix th { padding: 8px 6px; color: var(--muted); font-weight: 600; text-align: center; }
.matrix tbody th { text-align: left; white-space: nowrap; }
.matrix .mx-cell { padding: 8px 6px; text-align: center; border-radius: 4px; font-family: var(--mono); color: var(--ink); }
.matrix .mx-diag { background: var(--line-2); }
.matrix .mx-blank { background: var(--sunk); color: var(--muted); }
@media (max-width: 640px) { .kgrid { grid-template-columns: minmax(0, 1fr) 90px 44px; } .kgrid .flagcell { grid-column: 1 / -1; } }

/* Meus retornos: the annotator's answer beside the final result */
.cmp { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) minmax(0, 2fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; font-size: 13px; }
.cmp .h, .cmp [role=cell] { background: var(--surface); padding: 8px 10px; }
.cmp .h { background: var(--sunk); font-size: 12px; font-weight: 600; color: var(--muted); }
.cmp .diff { background: var(--warn-soft); }
.retorno.read { opacity: .7; }
@media (max-width: 560px) { .cmp { grid-template-columns: 1fr; } .cmp .h:not(:first-child) { display: none; } }

/* Inspecionar */
.insp-side { flex: 1 1 280px; }
.insp-main { flex: 3 1 640px; }
.qitem { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; text-decoration: none; }
.qitem[aria-current=true] { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.steps { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.step { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); min-width: 140px; }
.step.cur { border: 1.5px dashed var(--accent); }
.steps .arrow { align-self: center; color: var(--faint); }
.insp-cmp td, .insp-cmp th { min-width: 150px; vertical-align: top; text-align: left; }
.insp-cmp td.diff { background: var(--warn-soft); }
.insp-cmp td.final { background: var(--ok-soft); }
.tbar { flex: 1 1 220px; display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
.tbar span { display: block; height: 100%; }
.tseg-0 { background: #1D4ED8; }
.tseg-1 { background: #5B7FE0; }
.tseg-2 { background: #93AAEB; }
.tseg-3 { background: #C7D3F5; }
.tseg-4 { background: #9AA3B2; }
.legend-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.insp-who { width: 130px; font-size: 13px; flex: none; }
.insp-total { width: 52px; text-align: right; font-size: 12px; flex: none; }

/* Snapshots (docs/annotation-tool/mockups/v2/admin/snapshots.html) */
.snapshots-tbl { min-width: 760px; }
.snapshots-tbl tr.sel td { background: var(--accent-soft); }
.rowlink { color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }

/* Alinhamento */
.alinhamento-tbl { min-width: 760px; }
.alinhamento-tbl tr.sel td { background: var(--accent-soft); }
.fig-value { font-size: 22px; }
.confusion { min-width: 0; width: auto; }

/* Text edits (spec 13, prototype artboard A). Own edits use the accent role;
   A and B in a consolidation use the seed role, solid for A, dashed for B. */
.text-edits { position: relative; }
.te-msg { min-height: 18px; font-size: 13px; color: var(--warn); }
.te-msg:empty { min-height: 0; }

.te-doc { font-size: 16px; line-height: 1.75; color: var(--ink); }
.te-doc h1, .te-doc h2 { font-size: 20px; line-height: 1.3; }
.te-doc h3, .te-doc h4, .te-doc h5, .te-doc h6 { font-size: 17px; line-height: 1.35; }
.te-doc p { margin: 0; }
.te-doc ul, .te-doc ol { margin: 0; padding-left: 1.5em; }
.te-doc blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--ink-2); }
.te-doc hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); }
.te-doc a { cursor: text; }
.te-doc [data-readonly] { overflow-x: auto; padding: 6px 10px; border-radius: var(--r-sm); background: var(--sunk); color: var(--ink-3); }
.te-doc pre { margin: 0; font: 13px/1.5 var(--mono); white-space: pre; }
.te-doc table { border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.te-doc th, .te-doc td { padding: 4px 10px; border: 1px solid var(--line); text-align: left; }
/* html format: outline the innermost editable block under the mouse, where a
   selection is cut. The list is HTML_BLOCKS in edit-marks.js. */
.te-html :is(p, li, h1, h2, h3, h4, h5, h6, td, th, blockquote, figcaption, dt, dd, caption, div):not([data-readonly], [data-readonly] *):hover:not(:has(:is(p, li, h1, h2, h3, h4, h5, h6, td, th, blockquote, figcaption, dt, dd, caption, div):hover)) {
  outline: 1px dashed var(--accent); outline-offset: -1px;
}

/* Marks inside the text. */
.te-mark { border-radius: 3px; cursor: pointer; }
.te-del { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.te-ins { color: var(--accent-ink); background: var(--accent-soft); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; padding: 0 1px; user-select: none; }
.te-del + .te-ins { margin-left: 3px; }
.te-flag { background: #FFE9A8; border-bottom: 2px dotted var(--warn); }
.te-mark.is-active { outline: 2px solid var(--accent); outline-offset: 2px; }
.te-num { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 2px; border-radius: 9px; background: var(--accent); color: #FFFFFF; font: 600 11px/1 var(--mono); vertical-align: 2px; cursor: pointer; user-select: none; }
.te-a-del { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--seed); text-decoration-thickness: 2px; }
.te-a-ins { color: var(--seed-ink); background: var(--seed-soft); text-decoration: underline; text-decoration-color: var(--seed); text-decoration-thickness: 2px; text-underline-offset: 4px; user-select: none; }
.te-b-del { color: var(--muted); text-decoration: line-through; text-decoration-style: dashed; text-decoration-color: var(--seed-ink); text-decoration-thickness: 2px; }
.te-b-ins { color: var(--seed-ink); background: #F8F4FF; text-decoration: underline dashed; text-decoration-color: var(--seed-ink); text-decoration-thickness: 2px; text-underline-offset: 4px; user-select: none; }
.te-a-del + .te-a-ins, .te-b-del + .te-b-ins { margin-left: 3px; }
.te-who { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin: 0 2px; border-radius: 4px; background: var(--seed); color: #FFFFFF; font: 600 10px/1 var(--mono); vertical-align: 2px; cursor: pointer; user-select: none; }
.te-who.b { background: var(--seed-ink); }
.te-who.ab { width: auto; padding: 0 4px; background: var(--accent); }
.te-rejected { opacity: .45; }
.te-a-flag { background: #FFE9A8; border-bottom: 2px dotted var(--seed); }
.te-b-flag { background: #FFF4D1; border-bottom: 2px dashed var(--seed-ink); }
.te-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.te-legend .te-num { cursor: default; }

/* Selection toolbar, placed above the selection by the script. */
.te-toolbar { position: absolute; z-index: 5; max-width: 100%; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 20px rgba(22, 24, 29, .14); }
.te-toolbar-row { display: flex; flex-wrap: wrap; gap: 4px; }
.te-toolbar .btn { min-height: 36px; }
.te-toolbar kbd { font-size: 10px; padding: 0 4px; }

/* Cards */
.te-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.te-card:hover { border-color: var(--faint); }
.te-card.is-active { border: 1.5px solid var(--accent); box-shadow: 0 4px 14px rgba(29, 78, 216, .12); cursor: default; }
.te-card .orig { font-size: 13px; color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.te-card .newtxt { font-size: 13px; color: var(--accent-ink); }
.te-card .snippet { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-card .snippet.orig { color: var(--muted); }
.te-card .snippet.newtxt { color: var(--accent-ink); }
.te-box { display: flex; flex-direction: column; gap: 4px; }
.te-card-end { display: flex; justify-content: flex-end; }
.te-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.te-tags .pill { min-height: 28px; padding: 0 10px; }
.te-op { font-size: 11px; font-weight: 600; text-transform: none; }
/* Consolidation cards: a candidate to decide, a conflict between sources,
   and an accepted candidate. None of them opens for editing. */
.te-card.te-candidate, .te-card.te-conflict, .te-card.te-accepted { cursor: default; }
.te-card.te-conflict { border-color: var(--seed-line); }
.te-card.te-conflict > .lbl { color: var(--seed-ink); }
.te-card.te-accepted { background: var(--accent-soft); border-color: var(--accent); }
.te-card.te-accepted.is-active, .te-card.te-candidate.is-active, .te-card.te-conflict.is-active { border-width: 1.5px; }
.te-card .opt { width: 100%; font: inherit; color: inherit; }
.te-card .opt .snippet { max-width: 100%; }
.te-card .te-note { white-space: normal; overflow-wrap: anywhere; }
.te-card .btn-link { align-self: flex-start; }

/* Layout A. .te-doc and .te-gutters let their children into the .te-rows
   grid. The script sets --te-row on each root block and its gutter, so a
   block's cards sit beside it. Below 900px a gutter takes the row under its
   block (--te-row-n). */
.te-rows { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 28px; row-gap: 18px; align-items: start; }
.te-rows .te-doc, .te-gutters { display: contents; }
.te-doc > * { grid-column: 1; grid-row: var(--te-row); min-width: 0; }
.te-gutter { grid-column: 2; grid-row: var(--te-row); display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 14px; line-height: 1.45; user-select: none; }
.te-gutter textarea { user-select: text; }
@media (max-width: 900px) {
  .te-rows { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .te-rows .te-doc > * { grid-row: var(--te-row-n); margin-bottom: 14px; }
  .te-gutter { grid-column: 1; grid-row: var(--te-row-n); margin-bottom: 14px; }
}

.te-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.te-count { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.er-hint { margin: 0; }
.er-footer { justify-content: flex-start; }

/* verdict (backend/components/verdict.py) */
.verdict { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
.verdict-seed { margin: 0; font-size: 13px; }
.verdict-seed .lbl { margin-right: 6px; }
.verdict-seed-text { font-weight: 600; color: var(--ink); }
.verdict-seed-note { color: var(--ink-3); }
.verdict-fail { padding: 8px 0 0; border-top: 1px dashed var(--line-2); }
.verdict-group { margin: 6px 0 2px; }
.verdict-reason-list .check { display: flex; gap: 8px; align-items: baseline; }
.ms { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ms-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 25; max-height: 280px; overflow: auto; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.ms-opt { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.ms-opt.active, .ms-opt:hover { background: var(--accent-soft); }

/* task.yaml workspace.collapse_passed. A passed card shows its summary until
   workspace.js marks it open (data-expanded) on focus or on Abrir. A mouse
   press inside an open card keeps it open. Components mark what hides
   (data-card-collapsible) and what shows only while collapsed
   (data-card-collapsed-only). */
.card-open, [data-card-collapsed-only] { display: none; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) [data-card-collapsible] { display: none; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) :is(.card-open, [data-card-collapsed-only]) { display: inline-flex; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) { padding-top: 12px; padding-bottom: 12px; }
/* One row: number and title, the seed text cut with an ellipsis, the badge as
   a pill, then Abrir and the save state. The head and the component body use
   display: contents so their children share the card's row. */
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 12px; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head, #workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-body, #workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-body > .field { display: contents; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head h2 { order: 1; flex: none; white-space: nowrap; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .verdict-seed { order: 2; flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .verdict-seed .lbl, #workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .verdict-seed-note { display: none; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) [data-card-collapsed-only] { order: 3; flex: none; align-self: center; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end { display: contents; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end > :not(.card-open):not(.save) { display: none; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end > .card-open, #workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end > .save { order: 4; flex: none; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end > .save { margin-left: 0; }
#workspace[data-collapse-passed] .field-card[data-passed=true]:not([data-expanded]) .field-head-end > .card-open { line-height: 1; min-height: 0; padding: 0; margin: 0; align-self: center; }
#workspace[data-card-keys] .field-card:focus-within { border-color: var(--accent); background: var(--accent-soft); }

/* task.yaml workspace.number_cards */
#workspace[data-number-cards] { counter-reset: card; }
#workspace[data-number-cards] .field-card { counter-increment: card; }
#workspace[data-number-cards] .field-card .field-head h2::before {
  content: counter(card); margin-right: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted);
}
.pick-star[aria-pressed=true] { color: var(--accent); }
.pick-star[aria-pressed=true] svg { fill: currentColor; }

/* The Ordem menu (spec 05, Ordering the queue; mockup option A). .menu-pop
   styles its buttons as menu items, so Aplicar and the arrows take back
   their .btn look here. One bordered row per key, dashed when unchecked. */
.queue-order > .btn[aria-expanded=true] { border-color: var(--accent); color: var(--accent-ink); }
.queue-order-pop { width: 340px; max-width: calc(100vw - 32px); padding: 14px; gap: 12px; }
.queue-order-pop .btn { justify-content: center; min-height: 32px; padding: 0 10px; border-radius: var(--r); font-size: 12px; }
.queue-order-pop .btn-primary { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.queue-order-pop .btn-primary:hover { background: var(--accent-ink); }
.queue-order-pop .btn:disabled { background: transparent; opacity: .4; }
.queue-order-rows { list-style: none; margin: 0; padding: 0 0 0 26px; display: flex; flex-direction: column; gap: 6px; }
.queue-order-rows.is-off { opacity: .55; }
.queue-order-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.queue-order-row.is-unchecked { border-style: dashed; border-color: var(--ctrl); background: transparent; }
.queue-order-row .check { flex: 1 1 auto; min-width: 0; }
.queue-order-place { min-width: 22px; justify-content: center; }
.queue-order-move { display: inline-flex; gap: 2px; }
.queue-order-apply { border-top: 1px solid var(--line-2); padding-top: 10px; }
/* On a phone the header wraps, so the popover hangs from the page's gutters
   below the button instead of from the button's right edge. */
@media (max-width: 640px) {
  .queue-order { position: static; }
  .queue-order-pop { top: auto; left: 16px; right: 16px; width: auto; max-width: none; margin-top: 6px; }
}
/* The group line above the item. A long group name wraps. */
.group-line { gap: 10px; }
.group-line .badge { white-space: normal; overflow-wrap: anywhere; }
/* Submit refusal reasons in the footer, and the elements a rule marks. */
.refusal-list { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
.refusal-list:empty { display: none; }
.refusal-list button { all: unset; cursor: pointer; font-size: 12px; color: var(--ink-3); text-decoration: underline dotted; }
.refusal-list button:hover, .refusal-list button:focus-visible { color: var(--ink); }
[data-rule-problem] { outline: 2px solid var(--warn, #b45309); outline-offset: 2px; }
[data-rule-problem]::after { content: attr(data-rule-problem); display: block; margin-top: 4px; font-size: 12px; font-weight: 400; line-height: 1.3; text-align: left; white-space: normal; color: var(--warn, #b45309); }
.te-tag-hint { flex-basis: 100%; }
[data-rule-flash] { background: var(--accent-soft); transition: background .3s; }
