/*
 * Operator app styles. The frame (tokens, base, top bar) follows the Painel AEO prototype
 * (docs/ux/prototype-2026-10-spec.md §8, plan 12), mobile first: phone, then 720 px and 960 px.
 * The old screens below the frame keep their rules, written for 1280 px, until plan 12 replaces
 * them; "Old screens at any width" at the end keeps them usable down to 360 px.
 */

/* ---- Fonts (served from @fontsource packages, see src/web/static.ts) ---- */
@font-face {
  font-family: "Instrument Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
}

/* ---- Tokens (spec §8.1). Light on :root; dark twice, per the theme contract. ---- */
:root {
  color-scheme: light dark;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1f1d1a;
  --ink-2: #4a463f;
  --muted: #6f695f;
  --line: #e5e0d6;
  --line-strong: #cfc8ba;
  --accent: #24566b;
  --accent-ink: #ffffff;
  --accent-soft: #e3eef1;
  --prod: #46627a;
  --prod-bg: #e9eef3;
  --you: #8a5a00;
  --you-bg: #fbf0d9;
  --you-line: #e0a63a;
  --ready: #2f6b45;
  --ready-bg: #e6f2ea;
  --done: #2f6b45;
  --done-ink: #ffffff;
  --closed: #6f695f;
  --closed-bg: #efece6;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --hl: #fde9b8;
  --marker-bg: #fff4d6;
  --marker-line: #e0a63a;
  --edited: #2f6b45;
  --scrim: rgb(31 29 26 / 0.36);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-2: 0 12px 32px rgb(0 0 0 / 0.12);

  /* Only the old screens use these; they go with them (plan 12 slice 20). */
  --field-line: #858a80;
  --accent-hover: #1a4252;
  --awaiting-bg: #eee8f8;
  --awaiting-fg: #5a3e9e;
  --opus-bg: #eeedfe;
  --opus-fg: #534ab7;
  --opus-line: #afa9ec;
  --sonnet-bg: #e1f5ee;
  --sonnet-fg: #0f6e56;
  --sonnet-line: #5dcaa5;
  --haiku-bg: #faeeda;
  --haiku-fg: #7a4b00;
  --haiku-line: #fac775;
  --none-bg: #f1efe8;
  --none-fg: #4e4d49;
  --none-line: #b4b2a9;
  --running-row: #f4f7fc;
  --awaiting-row: #f6f2fc;
  --failed-row: #fdf3f1;
  --row-line: #eeefea;
  --marker-outline: #b08a00;
  --code-bg: #1c1e22;
  --code-ink: #e6e8ec;

  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-input: 6px;
  --r-card: 10px;
  --r-dialog: 14px;
  --r-pill: 999px;
  --content-max: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 180ms;

  /* The old screens' names for the same tokens. */
  --ground: var(--bg);
  --nav: var(--surface-2);
  --surface-sunk: var(--surface-2);
  --ink-3: var(--ink-2);
  --line-soft: var(--line);
  --running-bg: var(--prod-bg);
  --running-fg: var(--prod);
  --held-bg: var(--you-bg);
  --held-fg: var(--you);
  --done-bg: var(--ready-bg);
  --done-fg: var(--ready);
  --blocked-bg: var(--closed-bg);
  --blocked-fg: var(--ink-2);
  --failed-bg: var(--danger-bg);
  --failed-fg: var(--danger);
  --ok: var(--ready);
  --danger-line: var(--danger);
  --marker-fg: var(--ink);
  --notice-bg: var(--you-bg);
  --notice-fg: var(--you);
  --sans: var(--font-ui);
  --mono: var(--font-mono);
  --serif: var(--font-serif);
  --radius: var(--r-input);
  --radius-card: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151513;
    --surface: #1e1e1b;
    --surface-2: #252521;
    --ink: #ece9e2;
    --ink-2: #c9c4b9;
    --muted: #9d978c;
    --line: #34332f;
    --line-strong: #4a4842;
    --accent: #86bccd;
    --accent-ink: #0e1a1f;
    --accent-soft: #1f3038;
    --prod: #a9bccd;
    --prod-bg: #232c34;
    --you: #f2c46d;
    --you-bg: #3a2d12;
    --you-line: #c08a2a;
    --ready: #8fd0a5;
    --ready-bg: #1c3024;
    --done: #8fd0a5;
    --done-ink: #0f1f15;
    --closed: #9d978c;
    --closed-bg: #2a2926;
    --danger: #ff8a7a;
    --danger-bg: #3a1d1a;
    --hl: #4a3a12;
    --marker-bg: #3a2d12;
    --marker-line: #c08a2a;
    --edited: #8fd0a5;
    --scrim: rgb(0 0 0 / 0.6);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 12px 32px rgb(0 0 0 / 0.5);
    --field-line: #7d786e;
    --accent-hover: #a6d0dd;
    --awaiting-bg: #2c2440;
    --awaiting-fg: #c8b6f0;
    --opus-bg: #2a2742;
    --opus-fg: #c3bdf5;
    --opus-line: #5d55a8;
    --sonnet-bg: #17302a;
    --sonnet-fg: #8fdcc0;
    --sonnet-line: #2f8a6c;
    --haiku-bg: #3a2d12;
    --haiku-fg: #f2c46d;
    --haiku-line: #8a6420;
    --none-bg: #2a2926;
    --none-fg: #c9c4b9;
    --none-line: #5a5750;
    --running-row: #1f252b;
    --awaiting-row: #241f2e;
    --failed-row: #2c1d1b;
    --row-line: #2c2b27;
    --marker-outline: #c08a2a;
    --code-bg: #10100f;
    --code-ink: #e6e8ec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151513;
  --surface: #1e1e1b;
  --surface-2: #252521;
  --ink: #ece9e2;
  --ink-2: #c9c4b9;
  --muted: #9d978c;
  --line: #34332f;
  --line-strong: #4a4842;
  --accent: #86bccd;
  --accent-ink: #0e1a1f;
  --accent-soft: #1f3038;
  --prod: #a9bccd;
  --prod-bg: #232c34;
  --you: #f2c46d;
  --you-bg: #3a2d12;
  --you-line: #c08a2a;
  --ready: #8fd0a5;
  --ready-bg: #1c3024;
  --done: #8fd0a5;
  --done-ink: #0f1f15;
  --closed: #9d978c;
  --closed-bg: #2a2926;
  --danger: #ff8a7a;
  --danger-bg: #3a1d1a;
  --hl: #4a3a12;
  --marker-bg: #3a2d12;
  --marker-line: #c08a2a;
  --edited: #8fd0a5;
  --scrim: rgb(0 0 0 / 0.6);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 12px 32px rgb(0 0 0 / 0.5);
  --field-line: #7d786e;
  --accent-hover: #a6d0dd;
  --awaiting-bg: #2c2440;
  --awaiting-fg: #c8b6f0;
  --opus-bg: #2a2742;
  --opus-fg: #c3bdf5;
  --opus-line: #5d55a8;
  --sonnet-bg: #17302a;
  --sonnet-fg: #8fdcc0;
  --sonnet-line: #2f8a6c;
  --haiku-bg: #3a2d12;
  --haiku-fg: #f2c46d;
  --haiku-line: #8a6420;
  --none-bg: #2a2926;
  --none-fg: #c9c4b9;
  --none-line: #5a5750;
  --running-row: #1f252b;
  --awaiting-row: #241f2e;
  --failed-row: #2c1d1b;
  --row-line: #2c2b27;
  --marker-outline: #c08a2a;
  --code-bg: #10100f;
  --code-ink: #e6e8ec;
}
:root[data-theme="light"] {
  color-scheme: light;
}

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
html {
  height: 100%;
}
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
/* The prototype's bug, not copied: a display rule must never beat the hidden attribute. */
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: the attribute must beat every display rule */
  display: none !important;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
/* A link the article text gave a relative address: plain text (src/web/markdown.ts). */
a:not([href]) {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-soft);
}
h1,
h2,
h3,
p {
  margin: 0;
}
img,
svg {
  max-width: 100%;
}
svg.icon {
  flex: none;
}
.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.muted {
  color: var(--muted);
}
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Hidden until focused: the first Tab on every page jumps over the top bar. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--r-input);
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.app-main:focus {
  outline: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Visibility by width beats each component's own display rule. */
.only-phone {
  /* biome-ignore lint/complexity/noImportantStyles: must beat the component's display */
  display: none !important;
}
@media (max-width: 719.98px) {
  .only-phone {
    /* biome-ignore lint/complexity/noImportantStyles: must beat the component's display */
    display: block !important;
  }
  .hide-phone {
    /* biome-ignore lint/complexity/noImportantStyles: must beat the component's display */
    display: none !important;
  }
}

/* ---- App frame ---- */
.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.app-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---- Top bar (spec §2.2, §2.3) ---- */
.tb {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tb-inner {
  max-width: calc(var(--content-max) + 64px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px
    max(16px, env(safe-area-inset-left, 0px));
}
@media (min-width: 960px) {
  .tb-inner {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
}
.tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tb-brand:hover {
  color: var(--ink);
}
.tb-brand-mark {
  color: var(--accent);
  font-size: 15px;
}
@media (max-width: 359.98px) {
  .tb-brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
.tb-spacer {
  flex: 1;
}
.tb-menu {
  position: relative;
}
.tb-menu > summary {
  list-style: none;
  cursor: pointer;
}
.tb-menu > summary::-webkit-details-marker {
  display: none;
}
.tb-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  max-width: 280px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
}
.tb-switch strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-switch:hover {
  background: var(--surface-2);
}
.tb-switch.is-wide {
  justify-content: space-between;
  width: 100%;
  max-width: none;
  min-height: 44px;
}
.tb-suavez {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tb-suavez:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.tb-suavez.is-on {
  border-color: var(--you-line);
  background: var(--you-bg);
  color: var(--you);
}
.tb-suavez-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--you-line);
}
.tb-suavez:not(.is-on) .tb-suavez-dot {
  display: none;
}
@media (max-width: 719.98px) {
  .tb-suavez {
    min-height: 40px;
    padding: 0 10px;
  }
}
/* "Sua vez {n}" fits from 360 px (the approved prototype); only narrower is it the count alone,
   with the label kept as aria-label. */
@media (max-width: 359.98px) {
  .tb-suavez.is-on .tb-suavez-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
.tb-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-input);
  color: var(--ink-2);
}
.tb-icon-btn:hover,
.tb-menu[open] > .tb-icon-btn {
  background: var(--surface-2);
  color: var(--ink);
}
.tb-icon-btn[aria-current="page"] {
  color: var(--accent);
}
.tb-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.tb-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: max-content;
  min-width: 240px;
  max-width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.tb-panel.is-start {
  right: auto;
  left: 0;
  min-width: 300px;
}
/* ☰ sheet below the bar (the summary stays visible, so it closes without scripts). */
.tb-panel.is-sheet {
  position: fixed;
  top: 57px;
  right: 0;
  bottom: 0;
  width: min(380px, 100%);
  max-width: none;
  max-height: none;
  border-radius: 0;
  border-width: 1px 0 0 1px;
  padding: 12px max(12px, env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) 12px;
}
/* The phone's client menu as a bottom sheet. */
.tb-panel.is-bottom {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: none;
  max-height: 70%;
  border-radius: var(--r-dialog) var(--r-dialog) 0 0;
  padding: 12px max(16px, env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
/* ☰ while closed, ✕ while open. */
.tb-when-closed,
.tb-when-open {
  display: contents;
}
.tb-menu:not([open]) > summary > .tb-when-open,
.tb-menu[open] > summary > .tb-when-closed {
  display: none;
}
/* The phone sheets dim the page behind them; a click there closes the menu (public/app.js). */
.tb-menu.has-scrim[open]::before {
  content: "";
  position: fixed;
  inset: 57px 0 0;
  z-index: 35;
  background: var(--scrim);
}
.tb-menu.has-scrim.is-full[open]::before {
  inset: 0;
}
.tb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-input);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.tb-item:hover,
.tb-item:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
}
.tb-item.is-current,
.tb-item[aria-current="page"] {
  font-weight: 600;
}
.tb-item-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tb-item-side {
  margin-left: auto;
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.tb-item-side.is-you {
  color: var(--you);
  font-weight: 600;
}
.tb-sep {
  height: 1px;
  margin: 6px 4px;
  border: 0;
  background: var(--line);
}
.tb-heading {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tb-heading.is-name {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.tb-note {
  margin: 2px 10px 6px;
  padding: 6px 8px;
  border-radius: var(--r-input);
  background: var(--you-bg);
  color: var(--you);
  font-size: 12px;
  font-weight: 600;
}
.tb-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}
.tb-form {
  margin: 0;
}
/* Tema (views/theme-switch.tsx): a check beside the theme in use. */
.tb-theme[aria-current="true"] {
  font-weight: 600;
}
.tb-theme-check {
  display: inline-flex;
  margin-left: auto;
  color: var(--accent);
  visibility: hidden;
}
.tb-theme[aria-current="true"] .tb-theme-check {
  visibility: visible;
}
.tb-client-row {
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px
    max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line);
}

/* ---- Worker banner: only when the heartbeat is stale ---- */
.tb-banner {
  border-bottom: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--ink);
  font-size: 14px;
}
.tb-banner-inner {
  max-width: calc(var(--content-max) + 64px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px
    max(16px, env(safe-area-inset-left, 0px));
}
@media (min-width: 960px) {
  .tb-banner-inner {
    padding-left: 32px;
    padding-right: 32px;
  }
}
.tb-banner-inner strong {
  color: var(--danger);
}
.tb-banner-msg {
  display: flex;
  flex: 1 1 260px;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.tb-banner-msg > .icon {
  margin-top: 2px;
  color: var(--danger);
}
.page-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 40px 40px;
}
/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  font-weight: 400;
}
.btn-quiet:hover {
  border-color: transparent;
  background: var(--surface-2);
}
/* A secondary action that still reads as a button: accent text, no border (Início rows). */
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}
.btn-ghost:hover {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}
.btn-danger {
  border-color: var(--danger-line);
  background: var(--surface);
  color: var(--failed-fg);
}
.btn-danger:hover {
  border-color: var(--danger-line);
  background: var(--failed-bg);
  color: var(--failed-fg);
}
.btn-small {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  border-color: var(--line-strong);
  background: var(--line-soft);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 44px;
  padding: 0;
}
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu > summary::after {
  content: "▾";
  font-size: 12px;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.card-pad {
  padding: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
/* Run page: narrower below 1440 so the stage list and the article keep room to read. */

/* ---- Forms ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* A field label with its "?" beside it, outside the <label> so the field's name stays clean. */
.label-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.label {
  font-size: 14px;
  font-weight: 500;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.error-text {
  font-size: 13px;
  color: var(--failed-fg);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 400 14px var(--sans);
}
.textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
.input.mono,
.textarea.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger-line);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
fieldset.card {
  margin: 0;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
fieldset.card > legend {
  padding: 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.checkbox-row input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

/* ---- Tables ---- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  /* Wide old tables scroll inside their card, never the page (plan 12 slice 02). Relative, so
     absolutely placed header content (visually hidden labels) stays inside the scroller. */
  position: relative;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 11px var(--table-pad-x, 14px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: top;
}
.table.compact td {
  padding: 8px var(--table-pad-x, 10px);
  font-size: 13px;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: 20px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 20px;
}
.table .right {
  text-align: right;
}
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
.chip-sm {
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 11.5px;
}
.chip-running {
  background: var(--running-bg);
  color: var(--running-fg);
}
.chip-held {
  background: var(--held-bg);
  color: var(--held-fg);
}
.chip-done {
  background: var(--done-bg);
  color: var(--done-fg);
}
.chip-blocked,
.chip-discarded {
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
.chip-failed {
  background: var(--failed-bg);
  color: var(--failed-fg);
}
/* A count of zero: nothing to look at, so no status colour. */
.chip-zero {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
/* Camadas are a reliability scale, not a status: outlined, darker for the more reliable. */
.chip-layer-1,
.chip-layer-2,
.chip-layer-3,
.chip-layer-4 {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.chip-layer-1 {
  border: 1.5px solid var(--ink);
  font-weight: 600;
}
.chip-layer-2 {
  border-color: var(--ink);
}
.chip-layer-3 {
  color: var(--muted);
}
.chip-layer-4 {
  border-style: dashed;
  color: var(--muted);
  text-decoration: line-through;
}

.model {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--none-line);
  background: var(--none-bg);
  color: var(--none-fg);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.model-opus {
  border-color: var(--opus-line);
  background: var(--opus-bg);
  color: var(--opus-fg);
}
.model-sonnet {
  border-color: var(--sonnet-line);
  background: var(--sonnet-bg);
  color: var(--sonnet-fg);
}
.model-haiku {
  border-color: var(--haiku-line);
  background: var(--haiku-bg);
  color: var(--haiku-fg);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 400 13px var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.filter[aria-pressed="true"],
.filter[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

/* ---- Notices ---- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 14px;
}
.notice-error {
  background: var(--failed-bg);
  color: var(--failed-fg);
}
/* A notice with a list under its line reads from the left, like the page. */
.notice.stack {
  align-items: flex-start;
}
.provisional {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--notice-bg);
  color: var(--notice-fg);
  font-size: 12.5px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 40px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
}

/* ---- Login ---- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-inner {
  width: min(400px, 100% - 32px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
/* The first-admin commands need more than the form's width. */
.login-inner.is-wide {
  width: min(560px, 100% - 32px);
}
.login-brand {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.login-tagline {
  font-size: 15px;
  color: var(--ink-3);
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}
.login-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Phase 02: clients and client setup ---- */
.grow {
  flex: 1;
  min-width: 0;
}
fieldset.bare {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.add-sources {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
}
.item-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.key-ok {
  color: var(--done-fg);
}
.key-warn {
  color: var(--held-fg);
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  font-size: 13.5px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

/* Article */
.article {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow-wrap: break-word;
  padding: 40px 40px 48px;
  font-family: var(--serif);
  color: var(--ink);
}
.answer-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: var(--running-row);
  border: 1px solid var(--line);
}
.answer-block p {
  font-size: 18px;
  line-height: 1.65;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.answer-block .eyebrow {
  color: var(--accent);
}
.article-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  font-size: 18px;
  line-height: 1.7;
}
.article-body .md-h1 {
  margin-top: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.article-body .md-h2 {
  margin-top: 14px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
}
.article-body .md-h3 {
  font-size: 20px;
  font-weight: 600;
}
.article-body ul,
.article-body ol {
  margin: 0;
  padding-left: 24px;
}
.article-body pre {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-sunk);
  border: 1px solid var(--line-soft);
  white-space: pre-wrap;
  font: 13px / 1.5 var(--mono);
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.85em;
}
.article-body table {
  border-collapse: collapse;
  font: 14px / 1.5 var(--sans);
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.article-body :is(th, td) {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.article-body th {
  background: var(--surface-sunk);
  font-weight: 600;
}
.marker {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--marker-bg);
  color: var(--marker-fg);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  outline: 1px dashed var(--marker-outline);
}
.cite {
  font-family: var(--mono);
  font-size: 11px;
  vertical-align: super;
  text-decoration: none;
  margin-left: 2px;
}
.score {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
}
.verdict-publicar {
  background: var(--done-bg);
  color: var(--done-fg);
  font-weight: 600;
}
.verdict-corrigir {
  background: var(--held-bg);
  color: var(--held-fg);
}
.verdict-reescrever {
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
/* SEGURAR produces a Retida run, so it wears the held colour. */
.verdict-segurar {
  background: var(--held-bg);
  color: var(--held-fg);
}

/* Drawer: a modal <dialog> (public/app.js opens it with showModal) docked to the right. */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(720px, 100%);
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-2);
  overflow-y: auto;
}
.drawer::backdrop {
  background: var(--scrim);
}
.drawer-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
#drawer-titulo:focus {
  outline: none;
}
#drawer-titulo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-attempts {
  display: flex;
  gap: 6px;
  padding: 14px 28px 0;
}
.drawer-attempts .filter {
  gap: 6px;
}
.drawer-error {
  margin: 14px 28px 0;
}
.drawer-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.drawer-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-meta dt {
  color: var(--muted);
}
.drawer-meta dd {
  margin: 0;
}
.drawer-body {
  padding: 18px 28px 24px;
}
.drawer-tech .drawer-meta {
  padding: 12px 0;
}
.drawer-body summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}
.code {
  margin: 8px 0 0;
  padding: 16px 18px;
  max-height: 480px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.correction.is-blocking {
  border-color: var(--danger-line);
}
.correction-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.correction-name {
  font-weight: 600;
}
.correction p,
.quote {
  overflow-wrap: anywhere;
}
.quote {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-sunk);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---- Help: tooltips and the guide (docs/ux/audit-2026-09.md) ---- */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.tip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}
/* A 24px target (WCAG 2.5.8) drawn as an 18px circle. */
.tip-trigger {
  position: relative;
  isolation: isolate;
  width: 24px;
  height: 24px;
  margin-left: 1px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: 600 11px var(--sans);
  cursor: help;
}
.tip-trigger::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.tip-trigger:hover,
.tip-trigger:focus-visible {
  color: var(--accent);
}
.tip-trigger:hover::before,
.tip-trigger:focus-visible::before {
  border-color: var(--accent);
}
.tip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font: 400 12.5px / 1.45 var(--sans);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  /* Hidden bubbles take no room, so one near the right edge never widens the page. */
  display: none;
}
/* The bubble can be hovered (WCAG 1.4.13): these bridge the gap to the trigger. */
.tip-bubble::before,
.tip-bubble::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
}
.tip-bubble::before {
  top: 100%;
}
.tip-bubble::after {
  bottom: 100%;
}
/* Table cards clip overflow for their rounded corners; let tooltips out and round the header. */
.table-card:has(.tip) {
  overflow: visible;
}
.table-card:has(.tip) thead tr:first-child th:first-child {
  border-top-left-radius: var(--radius-card);
}
.table-card:has(.tip) thead tr:first-child th:last-child {
  border-top-right-radius: var(--radius-card);
}
/* Header tooltips open downward, into the table. */
:where(th) .tip-bubble {
  top: calc(100% + 8px);
  bottom: auto;
}
:where(th.right) .tip-bubble,
:where(th:last-child) .tip-bubble {
  left: auto;
  right: 0;
  transform: none;
}
.tip-below-end > .tip-bubble {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
  transform: none;
}
.tip:hover > .tip-bubble,
.tip:focus-within > .tip-bubble,
.tip:focus > .tip-bubble {
  display: block;
}
/* Esc dismisses an open tooltip until the pointer or focus leaves (public/app.js). */
.tip.is-dismissed > .tip-bubble {
  display: none;
}

/* Document tables on /fontes and the Fontes tab (src/web/views/source-row.tsx) */
/* A row's actions sit on their own line under it: verify or re-audit first, Excluir at the end. */
.source-actions {
  gap: 8px 16px;
  flex-wrap: wrap;
  align-items: center;
}
.source-verify {
  gap: 6px 10px;
  flex-wrap: wrap;
  align-items: center;
}
.source-verify .select {
  height: 30px;
  width: auto;
  max-width: 100%;
  padding-block: 0;
  font-size: 13px;
}
.source-actions > .source-danger {
  margin-left: auto;
}
/* Unlink and remove read as quiet links under "Quem vê". */
.library-visibility .btn-small {
  height: 28px;
  padding: 0 6px;
  margin-left: -6px;
}
.source-table .col-document {
  width: 30%;
}
.source-table .col-audit {
  width: 26%;
}
.source-table {
  overflow-wrap: break-word;
}
.source-url {
  font-size: 12px;
}
/* Stage 4's candidates in the run drawer (about 660px wide): fixed columns, so long titles and
   URLs wrap inside their cell instead of widening the table. */
.audit-table {
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.audit-table th {
  white-space: normal;
  overflow-wrap: normal;
}
.audit-table .col-origin {
  width: 19%;
}
.audit-table .col-similarity {
  width: 20%;
}
.audit-table .col-situation {
  width: 28%;
}
.source-audit {
  font-size: 13px;
}
.source-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* A rejection reason reads as one line; the full text is under "Ver auditoria". */
.source-reason {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.source-reason .source-clamp {
  -webkit-line-clamp: 1;
}
.source-fields {
  margin: 6px 0 0;
  font-size: 12.5px;
}
.source-fields dt {
  font-weight: 500;
}
.source-fields dd {
  margin: 0 0 6px;
}
.source-counterpoint {
  font-size: 12px;
  color: var(--held-fg);
}

/* Source library page, /fontes (docs/plans/10-source-library.md) */
.library-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.library-site-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1.4fr);
  gap: 12px;
  align-items: start;
}
fieldset.library-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-left: 32px;
}
fieldset.library-clients .checkbox-row input {
  width: 16px;
  height: 16px;
}
.library-filters {
  gap: 8px 16px;
  flex-wrap: wrap;
}
/* Each filter keeps its label beside its select when the row wraps. */
.library-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.library-section-head {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.library-add > summary {
  cursor: pointer;
}
.library-add > form {
  margin-top: 16px;
}
.library-filters .select,
.library-small-select {
  height: 32px;
  width: auto;
  padding-block: 0;
  font-size: 13px;
}
.library-visibility {
  min-width: 110px;
  font-size: 13px;
}
/* A link to /fontes#fonte-<id> lands on the entry's row (and its action line). */
.table tr:target > td {
  background: var(--accent-soft);
}
.table.source-table tr.has-actions > td {
  border-bottom: 0;
  padding-bottom: 6px;
}
.table.source-table tr.source-action-row > td {
  padding-top: 0;
}
.table tr:target + .source-action-row > td,
.table tr:target + .source-action-row + .source-action-row > td {
  background: var(--accent-soft);
}
/* Site-only fields hide while "Usar só esta página" is chosen (no JS needed). */
form:has(input[name="kind"][value="document"]:checked) .library-site-fields {
  display: none;
}
.library-manage > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12.5px;
  width: max-content;
}
/* Controls behind "Alterar" and "Editar" stack and wrap inside their cell. */
.library-manage-body {
  gap: 8px;
  padding-top: 8px;
}
.library-manage-body .row {
  gap: 6px;
  flex-wrap: wrap;
}
.library-runs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  max-width: 280px;
  margin-top: 6px;
}
/* Library rows hold long URLs and pauta topics; let them wrap so the table fits the page. */
:where(tr[id^="fonte-"] > td),
:where(.table td .mono) {
  overflow-wrap: anywhere;
}
/* A long line of numbers wraps like any hint. */
.hint.num {
  white-space: normal;
}
@media (max-width: 1279.98px) {
  .page-body {
    padding-left: 24px;
    padding-right: 24px;
  }
  /* Tables with header tooltips scroll too; the tooltips open downward, inside the card. */
  .table-card:has(.tip) {
    overflow-x: auto;
  }
}
@media (max-width: 959.98px) {
  .page-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .article {
    padding: 24px 16px 32px;
  }
}
@media (max-width: 719.98px) {
  /* Tables outside a table card (the run page's cost list) scroll on their own. */
  .card > .table {
    display: block;
    overflow-x: auto;
  }
}

/* ---- Overlays (plan 12 slice 03): dialogs, drawers, confirm, toasts ---- */
/* The page behind a modal dialog or a phone sheet does not scroll (public/app.js). */
html.is-locked,
html.is-locked body {
  overflow: hidden;
}
@keyframes ov-fade {
  from {
    opacity: 0;
  }
}
@keyframes ov-rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
@keyframes ov-slide {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
/* Native <dialog>: closed ones keep the browser's display: none. */
.ov {
  --ov-w: 580px;
  width: min(var(--ov-w), calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
}
.ov[open] {
  display: flex;
  flex-direction: column;
  animation: ov-rise var(--dur) var(--ease);
}
.ov::backdrop {
  background: var(--scrim);
  animation: ov-fade var(--dur) var(--ease);
}
/* Without scripts a dialog the server rendered open is not modal: same place, a painted scrim. */
.ov[open]:not(:modal) {
  position: fixed;
  inset: 0;
  z-index: 60;
  box-shadow:
    var(--shadow-2),
    0 0 0 100vmax var(--scrim);
}
.ov-sm {
  --ov-w: 440px;
}
.ov-md {
  --ov-w: 580px;
}
.ov-lg {
  --ov-w: 780px;
}
.ov-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 8px;
}
.ov-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.ov-x {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -8px -10px 0 0;
  border: 0;
  border-radius: var(--r-input);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.ov-x:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.ov-body {
  /* Positioned, so visually hidden labels inside stay in its scroller instead of overflowing
     the dialog (which then scrolled its header out of view). */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px 16px;
}
.ov-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ov-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
}
.ov-foot form {
  display: contents;
}
.ov-subtitle {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
}
.ov-text {
  margin: 0;
  color: var(--ink-2);
}
.ov-confirm .field-error {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 14px;
}
/* Drawer: docked right, full screen on phones. */
.ov-drawer {
  --ov-w: 520px;
  width: min(var(--ov-w), 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
}
.ov-drawer[open] {
  animation-name: ov-slide;
}
.ov-drawer .ov-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ov-drawer .ov-head {
  align-items: center;
}
/* The drawer's labelled Fechar (spec §2.3); 44 px tall on phones. */
.ov-close {
  flex: none;
  gap: 6px;
}
.ov-drawer .ov-body {
  flex: 1;
  padding: 16px 20px 32px;
}
@media (max-width: 719.98px) {
  .ov-drawer {
    width: 100%;
    border-width: 0;
  }
  .ov-foot .btn,
  .ov-close {
    min-height: 44px;
  }
}

/* State chips (spec §8.3): 24 px, the state's colour; Sua vez is the only one with a border. */
.chip-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-producao {
  background: var(--prod-bg);
  color: var(--prod);
}
.chip-suavez {
  border: 1px solid var(--you-line);
  background: var(--you-bg);
  color: var(--you);
}
.chip-pronto {
  background: var(--ready-bg);
  color: var(--ready);
  box-shadow: inset 0 0 0 1px var(--ready);
}
.chip-publicado {
  background: var(--done);
  color: var(--done-ink);
}
.chip-encerrado {
  background: var(--closed-bg);
  color: var(--closed);
}

/* "O que significa cada situação". */
.states-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.states-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.states-list p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}
.states-list p + .chip-state {
  margin-top: 8px;
}
.phases-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 1.4em;
  color: var(--ink-2);
  font-size: 14px;
}
.phases-list strong {
  color: var(--ink);
  font-weight: 600;
}

/*
 * Toasts: one at a time, top right from 720 px, top centre under the top bar on phones (at the
 * bottom one covered the field a page opens on, like the wizard's step 4, and the keyboard's
 * edge while typing; QA round 2). With scripts the region
 * is a manual popover (public/app.js), so it sits in the top layer: over menus and, moved into the
 * open dialog, over a modal dialog or drawer too. The first rules undo the popover's UA box.
 * Without scripts (no html.js) a redirect's toast stays in the flow under the top bar, covering
 * nothing, since nothing could take it away.
 */
.toast-region {
  inset: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
  height: auto;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: inherit;
  pointer-events: none;
}
html.js .toast-region {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 90;
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  transform: translateX(-50%);
}
@media (min-width: 720px) {
  html.js .toast-region {
    top: calc(68px + env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    left: auto;
    width: min(400px, calc(100vw - 32px));
    transform: none;
  }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-card);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-2);
  font-size: 14px;
  pointer-events: auto;
  animation: ov-rise var(--dur) var(--ease);
}
html:not(.js) .toast-region .toast {
  margin-top: 12px;
}
.toast-text {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.toast-icon {
  flex: none;
  margin-top: 1px;
}
.toast-ok .toast-icon {
  color: var(--ready-bg);
}
.toast-danger .toast-icon {
  color: var(--danger-bg);
}
.toast-you .toast-icon {
  color: var(--you-line);
}
.toast-action {
  flex: none;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: var(--r-input);
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.toast-action:hover {
  color: inherit;
  background: rgb(255 255 255 / 0.1);
}
.toast-close {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -2px -2px 0 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
}
.toast-close:hover {
  opacity: 1;
}
.toast :focus-visible {
  outline-color: var(--bg);
}
/* Touch targets on phones (spec §8.3): 44 px rows and close button. */
@media (max-width: 719.98px) {
  .tb-item {
    min-height: 44px;
  }
  .toast {
    align-items: center;
  }
  .toast-close {
    width: 44px;
    height: 44px;
    margin: -10px -8px -10px 0;
  }
  .toast-action {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur: 0ms;
  }
  .ov[open],
  .ov::backdrop,
  .toast {
    animation: none;
  }
}

/* ---- Início (plan 12 slice 04, spec §4.1). Mobile first. ---- */
.inicio,
.wz {
  width: 100%;
  max-width: calc(var(--content-max) + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 960px) {
  .inicio,
  .wz {
    max-width: calc(var(--content-max) + 64px);
    padding: 32px 32px 64px;
    gap: 32px;
  }
}
.ih {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ih-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ih-summary {
  font-size: 16px;
  color: var(--ink-2);
}
.ih-link {
  color: var(--accent);
}
/* PO answer 3: the below-standard count reads in the flag's colour, in the summary and Prontos. */
.ih-below,
.ip-below {
  color: var(--danger);
  font-weight: 600;
}
.ip-below {
  font-size: 16px;
}
.ih-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-style: dashed;
}
.ih-empty p {
  max-width: 60ch;
  color: var(--ink-2);
}
.ih-empty-title {
  font-size: 18px;
  font-weight: 600;
}
#sua-vez,
#prontos {
  scroll-margin-top: 128px;
}
@media (min-width: 720px) {
  #sua-vez,
  #prontos {
    scroll-margin-top: 80px;
  }
}
#sua-vez:focus,
#prontos:focus {
  outline: none;
}
#sua-vez:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sua vez queue and Prontos card */
.card-you {
  border-color: var(--you-line);
}
.iq,
.ip {
  padding: 0;
  overflow: hidden;
}
.iq-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 16px 12px;
}
.iq-heading,
.ip-heading {
  font-size: 20px;
  font-weight: 600;
}
.iq-heading {
  color: var(--you);
}
.ip-heading {
  color: var(--ready);
}
.ip-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.ip-lead {
  font-size: 14px;
  color: var(--ink-2);
}
.iq-oldest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  font-size: 14px;
  color: var(--ink-2);
}
.iq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.iq-row,
.ip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.ip-row {
  align-items: center;
  padding: 12px 16px;
}
.iq-row.row-strong {
  box-shadow: inset 3px 0 0 var(--you-line);
}
.iq-main {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.iq-what,
.iq-why,
.iq-extra {
  overflow-wrap: anywhere;
}
.iq-client,
.iq-sep {
  color: var(--muted);
  font-size: 14px;
}
.iq-title {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.iq-title:hover {
  color: var(--accent);
  text-decoration: underline;
}
.iq-why,
.iq-extra {
  font-size: 14px;
  color: var(--ink-2);
}
.ip-why {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.text-danger {
  color: var(--danger);
}
.age-warn {
  color: var(--you);
}
.age-strong {
  color: var(--you);
  font-weight: 600;
}
.iq-tese {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink);
}
.iq-suggest {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.iq-suggest .icon {
  flex: none;
  margin-top: 3px;
  color: var(--accent);
}
.iq-suggest-label {
  font-weight: 600;
  color: var(--accent);
}
.iq-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}
.iq-form {
  display: contents;
}
.iq-done {
  background: var(--ready-bg);
  align-items: center;
}
.ok-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ready);
  font-weight: 500;
}
.iq-more {
  border-top: 1px solid var(--line);
  padding: 8px 12px;
}
.ip-more {
  font-size: 14px;
  color: var(--ink-2);
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
}
.iq-empty {
  color: var(--muted);
}
.iq-empty-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.iq-empty-wrap .iq-done {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
@media (min-width: 720px) {
  .iq-head {
    padding: 16px 20px 14px;
  }
  .iq-oldest {
    width: auto;
  }
  .iq-row {
    padding: 14px 20px;
  }
  .ip-row {
    padding: 12px 20px;
  }
  .ip-more {
    padding: 10px 20px 14px;
  }
  .iq-actions {
    width: auto;
    justify-content: flex-end;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .is-pulse {
    animation: painel-pulse 1.4s var(--ease) 1;
  }
}
@keyframes painel-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--you-line);
  }
  40% {
    box-shadow: 0 0 0 6px var(--you-bg);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* The flag on an artigo approved below the standard (PO answer 3) */
.chip-below {
  height: auto;
  min-height: 24px;
  padding: 2px 9px;
  white-space: normal;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 600;
}

/* Client cards */
.ic-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.ic-head h2 {
  font-size: 22px;
  font-weight: 600;
}
.ic-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 720px) {
  .ic-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
.ic {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  min-width: 0;
}
.ic.ic-has-you {
  border-color: var(--you-line);
}
.ic-name {
  font-size: 18px;
}
.ic-link {
  color: var(--ink);
  text-decoration: none;
}
.ic-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.ic-domain {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.ic-body {
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.ic-you {
  color: var(--you);
  font-weight: 600;
}
.ic-draft {
  margin-top: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.ic-actions {
  margin-top: auto;
  padding-top: 10px;
}
.ic-draft-slot:has(> [hidden]) {
  display: none;
}

/* ---- Client workspace and Artigos (plan 12 slice 05, spec §4.2, §4.3, §4.8.2). Mobile first. ---- */
.ws {
  width: 100%;
  max-width: calc(var(--content-max) + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (min-width: 960px) {
  .ws {
    max-width: calc(var(--content-max) + 64px);
    padding: 32px 32px 64px;
  }
}
/* Today's Marca, Fontes and Ajustes forms sit under the header, inside its gutter. */
.ws .page-body {
  padding: 0;
}
.ws-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ws-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.ws-id {
  min-width: 0;
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ws-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ws-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.ws-sep {
  padding: 0 6px;
}
.ws-domain {
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ws-ready {
  color: var(--ready);
  font-weight: 500;
}
.ws-preparing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
}
@media (max-width: 719.98px) {
  /* On a phone the readiness line goes under the domain. */
  .ws-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .ws-sep {
    display: none;
  }
}
.ws-first {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
}
.ws-first-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-first-steps li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ws-first-steps li + li::before {
  content: "→";
  margin: 0 10px;
  color: var(--ink);
}
.ws-first-steps .is-done {
  color: var(--ready);
}
.ws-first-steps .is-current {
  color: var(--ink);
  font-weight: 600;
}
.ws-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.ws-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.ws-tab:hover {
  color: var(--ink);
}
.ws-tab[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (min-width: 720px) {
  .ws-tabs {
    gap: 4px;
  }
  .ws-tab {
    flex: none;
    padding: 0 14px;
    font-size: 15px;
  }
}
.ws-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid var(--you-line);
  background: var(--you-bg);
  color: var(--you);
  font-size: 12px;
  font-weight: 600;
}

/* Artigos tab */
.ar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.ar-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
}
.ar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--sans);
  cursor: pointer;
}
.ar-chip .num {
  font-weight: 600;
}
.ar-chip:hover {
  border-color: var(--ink-2);
}
.ar-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--prod);
}
.ar-chip-suavez .ar-chip-dot {
  background: var(--you-line);
}
.ar-chip-pronto .ar-chip-dot {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ready);
}
.ar-chip-publicado .ar-chip-dot {
  background: var(--ready);
}
.ar-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.ar-chip-suavez[aria-pressed="true"],
.ar-chip-suavez:not(.is-zero) {
  border-color: var(--you-line);
  background: var(--you-bg);
  color: var(--you);
}
.ar-chip-suavez[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--you-line);
}
.ar-chip.is-zero {
  color: var(--muted);
  border-color: var(--line);
}
.ar-chip.is-zero .ar-chip-dot {
  background: var(--line-strong);
  box-shadow: none;
}
.ar-arrow {
  color: var(--ink-2);
}
.ar-clear {
  height: 36px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 14px var(--sans);
  text-decoration: underline;
  cursor: pointer;
}
.ar-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink-2);
}
.ar-hint p {
  flex: 1;
}
/* With scripts, the hint shows only until this browser dismissed it (public/app.js). */
html.js .ar-hint:not(.is-shown) {
  display: none;
}
.ar-search {
  display: block;
  max-width: 420px;
}
.ar-search form {
  position: relative;
}
.ar-search .input {
  padding-left: 36px;
}
.ar-search-icon {
  position: absolute;
  left: 12px;
  top: 14px;
  display: flex;
  color: var(--muted);
  pointer-events: none;
}
.ar-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ar-group-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ar-group-label.is-you {
  color: var(--you);
}
.ar-none,
.ar-nomatch {
  font-size: 14px;
  color: var(--muted);
}
.ar-nomatch {
  font-size: 15px;
  color: var(--ink-2);
}
.ar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.ar-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 16px;
  min-width: 0;
}
.ar-row + .ar-row {
  border-top: 1px solid var(--line);
}
.ar-row:hover {
  background: var(--surface-2);
}
.ar-row.row-strong {
  box-shadow: inset 3px 0 0 var(--you-line);
}
.ar-main {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ar-title {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
/* The whole row opens the artigo; its own buttons and links stay above this layer. */
.ar-title::after {
  content: "";
  position: absolute;
  inset: 0;
}
.ar-title:focus-visible {
  outline: none;
}
.ar-title:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-card);
}
.ar-sub {
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ar-sub-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.ar-sub-dots {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ar-dots {
  display: inline-flex;
  gap: 4px;
  flex: none;
}
.ar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--prod);
}
.ar-dot.is-done,
.ar-dot.is-now {
  background: var(--prod);
}
@media (prefers-reduced-motion: no-preference) {
  .ar-dot.is-now {
    animation: ar-dot-pulse 1.6s ease-in-out infinite;
  }
}
@keyframes ar-dot-pulse {
  50% {
    opacity: 0.35;
  }
}
.ar-ext,
.ar-actions,
.ar-row .tip,
.ar-row .chip-below {
  position: relative;
  z-index: 1;
}
.ar-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.ar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
}
.ar-form {
  display: contents;
}
.ar-open {
  margin-left: auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
/* The actions band sits above the row's link layer; only its controls take clicks, so a click
   beside them still opens the artigo. */
.ar-actions {
  pointer-events: none;
}
.ar-actions a,
.ar-actions button {
  pointer-events: auto;
}
@media (min-width: 720px) {
  .ar-row {
    padding: 14px 20px;
  }
  .ar-actions {
    width: auto;
  }
}
.ar-closed {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.ar-closed > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ar-closed > summary::-webkit-details-marker {
  display: none;
}
.ar-closed > summary .num {
  font-weight: 400;
  color: var(--ink-2);
}
.ar-closed > summary::after {
  content: "›";
  margin-left: auto;
  font-size: 18px;
  color: var(--ink-2);
  transition: transform var(--dur) var(--ease);
}
.ar-closed[open] > summary::after {
  transform: rotate(90deg);
}
.ar-closed > .ar-list {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.ar-row-encerrado .ar-title {
  color: var(--ink-2);
}

/* Primeiros passos card and the empty client */
.ar-first {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  max-width: 640px;
}
.ar-first-title {
  font-size: 18px;
  font-weight: 600;
}
.ar-check {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.ar-check li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-2);
}
.ar-check-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.ar-check .is-done .ar-check-mark {
  border-color: var(--ready);
  background: var(--ready);
  color: var(--done-ink);
}
.ar-check .is-current {
  color: var(--ink);
  font-weight: 600;
}
.ar-check a {
  color: inherit;
}
.ar-first-note {
  font-size: 14px;
  color: var(--ink-2);
}
.ar-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.ar-empty p {
  max-width: 60ch;
  color: var(--ink-2);
}
.ar-empty-title {
  font-size: 18px;
  font-weight: 600;
}
.ar-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ar-example {
  height: auto;
  min-height: 32px;
  padding: 4px 12px;
  white-space: normal;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.ar-example:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* Without scripts the hint cannot be dismissed, so its × is not offered. */
html:not(.js) .ar-hint-x {
  display: none;
}

/* ---- Artigo page frame and Mode A (plan 12 slice 06, spec §4.5). Mobile first. ---- */
.art {
  width: 100%;
  max-width: calc(var(--content-max) + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
@media (min-width: 960px) {
  .art {
    max-width: calc(var(--content-max) + 64px);
    padding: 32px 32px 64px;
  }
}
.art-deeplink {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
}
.art-deeplink strong {
  color: var(--ink);
}
.art-deeplink.is-neutral {
  background: var(--surface);
}
.art-deeplink > .grow {
  flex: 1 1 200px;
  min-width: 0;
}
.art-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.art-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.art-crumb {
  /* A 44 px tap target without moving the line. */
  display: inline-block;
  padding-block: 13px;
  margin-block: -13px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.art-crumb:hover {
  color: var(--accent);
  text-decoration: underline;
}
.art-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
/* "Copiar link" needs the clipboard: without scripts it is left out, and so is a menu with
   nothing else in it. */
html:not(.js) .art-more.is-copy-only,
html:not(.js) .art-more [data-copy-link] {
  display: none;
}
.art-h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 30ch;
  overflow-wrap: break-word;
}
.art-h1:focus {
  outline: none;
}
@media (min-width: 720px) {
  .art-h1 {
    font-size: 34px;
  }
}
.art-meta {
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.art-scope {
  font-size: 14px;
  color: var(--muted);
}
.art-live-region {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.art-stepper {
  padding: 4px 0;
}
.stepper-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.stepper {
  display: flex;
  align-items: flex-start;
  flex: 1 1 360px;
  min-width: 0;
  max-width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}
.step::before {
  content: "";
  position: absolute;
  top: 11px;
  right: 50%;
  z-index: 0;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.step:first-child::before {
  display: none;
}
.step.step-done::before,
.step.step-current::before {
  background: var(--accent);
}
.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-ink);
}
.step-done .step-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.step-current .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.step-stopped .step-dot {
  border-color: var(--closed);
  background: var(--closed-bg);
}
.step-label {
  font-size: 13px;
  color: var(--muted);
}
.step-done .step-label {
  color: var(--ink-2);
}
.step-current .step-label {
  color: var(--ink);
  font-weight: 600;
}
.step-caption {
  margin-top: -4px;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 719.98px) {
  /* A phone shows one phase label: the current or stopped one, or the last one when done. */
  .step:not(.is-phone-label) .step-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .step:not(.is-phone-label) .step-caption {
    display: none;
  }
}
.art-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.art-chip {
  max-width: 100%;
}
.art-live {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--prod-bg);
  color: var(--ink);
}
.live-sentence {
  max-width: 40ch;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: balance;
}
.art-live-meta {
  font-size: 15px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.art-live-close {
  font-size: 14px;
  color: var(--ink-2);
}
.art-sec-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}
.disc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.disc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.disc-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--ready);
}
.disc-current {
  color: var(--ink-2);
}
.disc-empty {
  color: var(--muted);
}
.spinner {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: art-spin 0.9s linear infinite;
}
@keyframes art-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
.art .page-body {
  padding: 0;
}

/* ---------------------------------------------------------------------------------------------
 * Ver bastidores, Detalhes técnicos (admins) and Encerrado (plan 12 slice 07, spec §4.5, §4.6)
 * ------------------------------------------------------------------------------------------- */
.art-bt-btn {
  gap: 6px;
}
@media (max-width: 719.98px) {
  .art-bt-btn {
    min-height: 40px;
  }
}
.bt {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.bt-summary {
  font-size: 15px;
  color: var(--ink-2);
}
.bt-group {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bt-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.bt-row:first-child {
  border-top: 0;
}
.bt-num {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bt-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.bt-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}
.bt-text {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.bt-name {
  font-weight: 500;
}
.bt-out {
  color: var(--ink-2);
}
.bt-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.bt-side .spinner {
  margin-top: 0;
}
.bt-ok {
  display: inline-flex;
  color: var(--ready);
}
.bt-err {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
  font-weight: 500;
}
.bt-wait {
  color: var(--you);
  font-weight: 500;
}
.bt-dur {
  font-variant-numeric: tabular-nums;
}
.bt-row.is-pending .bt-text,
.bt-row.is-skipped .bt-text,
.bt-row.is-pending .bt-num,
.bt-row.is-skipped .bt-num {
  color: var(--muted);
}
.bt-row.is-pending .bt-out,
.bt-row.is-skipped .bt-out {
  color: var(--muted);
}
.bt-row.is-running .bt-num {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.bt-row.is-failed .bt-num {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}
.bt-row.is-failed .bt-out {
  color: var(--danger);
}
.bt-more > summary,
.bt-sec > summary {
  min-height: 32px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.bt-srcs,
.tech-stages {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.bt-src,
.tech-stage {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.bt-src:first-child,
.tech-stage:first-child {
  border-top: 0;
}
.bt-src-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.bt-src-name {
  font-size: 14px;
  font-weight: 500;
}
.bt-src-url {
  color: var(--muted);
  font-size: 12px;
}
.bt-src-why {
  color: var(--ink-2);
}
.bt-sit {
  font-weight: 500;
  white-space: nowrap;
}
.bt-sit-used {
  color: var(--ready);
}
.bt-sit-rejected {
  color: var(--danger);
}
.bt-sit-offTopic,
.bt-sit-notOpened,
.bt-sit-notUsed {
  color: var(--ink-2);
}
.bt-audit {
  color: var(--ready);
  font-weight: 500;
}
.bt-audit-never {
  color: var(--muted);
  font-weight: 400;
}
.bt-plan {
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.bt-h {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}
.bt-hist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.bt-hist li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  overflow-wrap: anywhere;
}
.bt-meta,
.bt-small {
  font-size: 13px;
  color: var(--muted);
}
.bt-note {
  color: var(--ink-2);
}
@media (max-width: 719.98px) {
  .bt-side {
    white-space: normal;
  }
  /* Tap targets of at least 44 px on a phone, as Fechar and the other slices' controls. */
  .bt-more > summary,
  .bt-sec > summary {
    /* Padding, not flex: a flex summary loses its disclosure triangle. */
    box-sizing: border-box;
    min-height: 44px;
    padding: 11px 0;
  }
  .bt-src-name {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
  }
}
/* Detalhes técnicos (administrators only). */
.tech-stopped {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  color: var(--danger);
  font-weight: 500;
}
.tech {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tech-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.tech-stage-name {
  font-size: 14px;
  font-weight: 500;
}
.tech-ia {
  color: var(--ink-2);
}
.tech-num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tech-kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  font-size: 14px;
}
.tech-kv dt {
  color: var(--muted);
}
.tech-kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The score history is a sentence: it wraps in the drawer instead of running past its edge. */
.tech-kv dd.num {
  white-space: normal;
}
@media (max-width: 479.98px) {
  .tech-kv {
    grid-template-columns: minmax(0, 1fr);
  }
  .tech-kv dd + dt {
    margin-top: 6px;
  }
}
.tech-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tech-items li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.tech-hint {
  color: var(--muted);
  font-size: 13px;
}
.tech-items .tech-hint {
  flex-basis: 100%;
}
.tech-error {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 13px;
}
.tech-part {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tech-label {
  font-size: 14px;
  font-weight: 600;
}
.tech-crit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tech-crit li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tech-crit-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.minibar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.minibar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--prod);
}
.tech-retry {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tech-retry-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-retry-row .select {
  flex: 1 1 200px;
  width: auto;
  min-width: 0;
}
/* The plan, read only (Ver bastidores, Encerrado; the plan approval in slice 09). */
.plan-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.plan-part {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-tese {
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
  overflow-wrap: break-word;
}
.plan-h1 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: break-word;
}
.plan-secs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plan-sec {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.plan-sec-title {
  font-weight: 500;
}
.plan-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
}
/* A long question wraps: the pill grows with it instead of spilling over the next line. */
.plan-q {
  display: inline-block;
  max-width: 100%;
  height: auto;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 8px;
  line-height: 1.35;
  background: var(--prod-bg);
  color: var(--prod);
  white-space: normal;
}
.plan-src-ok {
  color: var(--ready);
  font-weight: 500;
}
.plan-src-none {
  color: var(--muted);
}
.plan-cta {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.plan-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  overflow-wrap: anywhere;
}
/* Mode E · Encerrado. */
.art-mode-e {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.art-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.art-strip-closed {
  border-color: transparent;
  background: var(--closed-bg);
  color: var(--ink);
}
.art-strip-text {
  flex: 1 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.art-closed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
p.art-closed-label .chip-state {
  font-size: 13px;
}
.art-cmp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
@media (min-width: 840px) {
  .art-cmp {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }
}
.art-cmp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
}
.art-cmp-chip {
  display: flex;
  justify-content: center;
}
.chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.art-cmp-pauta {
  font-family: var(--font-serif);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.art-cmp-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.art-cmp-flag {
  margin: 4px 0;
}
.art-cmp-meta {
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.art-cmp-meta .icon {
  margin-left: 2px;
  vertical-align: -1px;
}
.art-cmp-answer {
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
}
.art-archived {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
}
.art-archived .article {
  padding: 0;
}
.article.is-archived {
  opacity: 0.6;
}
.art-sources {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.art-sources-title {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}
.art-sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 1.4em;
  overflow-wrap: anywhere;
}
.art-closed-empty {
  align-items: flex-start;
}

/* ---- Artigo page · Mode B, Sua vez (plan 12 slice 08, spec §4.5 B1, B3, B4) ---- */
.dz-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--you-line);
  border-top: 4px solid var(--you-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}
/* What is judged on the left, the amber panel on the right; one column below 840 px with the
   panel first (it is first in the page too). */
.dz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (min-width: 840px) {
  .dz-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
  }
  /* The panel comes first in the page (focus and reading order), and sits on the right. */
  .dz-grid > * {
    grid-column: 1;
    grid-row: 1;
  }
  .dz-grid > .dz-panel {
    grid-column: 2;
  }
  .dz-grid > .dz-panel:not(.dz-kind-revisao) {
    position: sticky;
    top: 72px;
  }
}
@media (min-width: 1040px) {
  .dz-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}
.dz-title {
  margin-bottom: -4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--you);
}
.dz-lead-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dz-lead {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.dz-lead.dz-fail {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--danger);
}
.dz-fail .icon {
  flex: none;
  margin-top: 3px;
}
.dz-history {
  font-size: 14px;
  color: var(--ink-2);
}
.dz-age {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.dz-age.age-warn {
  color: var(--you);
}
.dz-age.age-strong {
  color: var(--you);
  font-weight: 600;
}
.suggest {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.suggest-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.suggest .field {
  margin: 0;
}
.dz-panel .consequence {
  font-size: 13px;
  color: var(--muted);
}
.dz-panel .reason {
  font-size: 14px;
  color: var(--ink-2);
}
.dz-panel .btn {
  white-space: normal;
  text-align: left;
  height: auto;
  min-height: 40px;
}
.dz-panel .btn-block {
  justify-content: center;
  text-align: center;
}
.dz-opts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 12px;
}
.dz-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.dz-opt .field {
  align-self: stretch;
}
/* "Pedir mais uma correção" and "Refazer" under Outras opções, with their note (R2 rule 0). */
.dz-again {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dz-opt-title {
  font-weight: 600;
}
.dz-override.is-error {
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: var(--r-card);
  align-self: stretch;
}
.dz-restart {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  align-self: stretch;
}
.dz-hint {
  font-size: 14px;
  color: var(--ink-2);
}
.dz-admin {
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.dz-admin-note {
  font-size: 14px;
  color: var(--ink-2);
}
.dz-more {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.dz-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.dz-more > summary::-webkit-details-marker {
  display: none;
}
.dz-chev {
  display: inline-flex;
  transform: rotate(-90deg);
  transition: transform var(--dur, 180ms) ease;
}
.dz-more[open] .dz-chev {
  transform: none;
}
.dz-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dz-h3 {
  font-size: 15px;
  font-weight: 600;
}
.dz-aj-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dz-aj {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 -8px;
  padding: 8px;
  border-radius: var(--r-input);
  transition: background-color 180ms ease;
}
.dz-aj.is-active,
.dz-aj:target {
  background: var(--you-bg);
}
.dz-aj:focus {
  outline: none;
}
.dz-aj-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dz-aj-num {
  display: inline-grid;
  flex: none;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border: 1px solid var(--you-line);
  border-radius: var(--r-pill);
  background: var(--you-bg);
  color: var(--you);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
a.dz-aj-num:hover {
  background: var(--hl);
}
.dz-aj-text {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.dz-aj-quote {
  font-family: var(--font-serif);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.dz-aj-meta {
  font-size: 12px;
  color: var(--muted);
}
.dz-aj-go {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 13px;
}
.dz-lost > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
}
.dz-lost[open] > summary {
  margin-bottom: 8px;
}
.dz-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 24px;
}
.dz-text-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dz-text-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.dz-text-hint {
  font-size: 13px;
  color: var(--muted);
}
.dz-text .article {
  max-width: 68ch;
  padding: 0;
}
mark.hl {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--hl);
  color: inherit;
  text-decoration: underline 2px var(--you-line);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: background-color 600ms ease-out;
}
mark.hl.is-pulse {
  background: var(--you-line);
}
/* The trecho's number: the same amber circle as its item in "Ajustes pedidos", so it never
   reads as a source note beside the [n] cites. */
.hl-num {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 4px;
  border: 1px solid var(--you-line);
  border-radius: var(--r-pill);
  background: var(--you-bg);
  color: var(--you);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.15em;
}
a.hl-num:hover {
  background: var(--hl);
}
.dz-sheet-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.suggest form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dz-stop {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 4px;
  color: var(--danger);
  font-weight: 500;
}
.dz-stop .icon {
  flex: none;
  margin-top: 3px;
}
/* Beside the panel the comparison has less room: side by side only from 1100 px. */
@media (min-width: 840px) and (max-width: 1099.98px) {
  .dz-cmp-wrap .art-cmp {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}
.art-sent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.ok-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--ready);
  font-weight: 500;
}
.ok-line .icon {
  flex: none;
  margin-top: 3px;
}
.art-next {
  font-weight: 500;
}
.tb-form {
  display: contents;
}
@media (max-width: 719.98px) {
  .dz-panel {
    padding: 16px;
  }
  .dz-text {
    padding: 16px;
  }
  .dz-panel .btn,
  .dz-aj-go {
    min-height: 44px;
  }
  .dz-aj-go {
    display: inline-flex;
    align-items: center;
  }
}
/* Administrators' Detalhes técnicos: the latest score against the passing threshold. */
.tech-score {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tech-scorebar {
  position: relative;
  flex: 1;
  max-width: 220px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--line);
}
.tech-scorebar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: var(--you-line);
}
.tech-scorebar-fill.is-pass {
  background: var(--ready);
}
.tech-scorebar-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
}

/* ---- Artigo page · Sua vez · plan approval (plan 12 slice 09, prototype B2) ---- */
.dz-plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 24px;
}
.dz-plan .plan-view {
  gap: 18px;
}
.dz-plan .plan-h1 {
  font-size: 24px;
  line-height: 1.25;
}
.dz-plan .plan-secs {
  gap: 14px;
}
.dz-plan .plan-sec {
  gap: 6px;
}
.dz-plan .plan-sec-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}
.dz-plan .plan-sec-title .muted {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}
/* A section without a checked source is written with a marker: shown in the marker's colours. */
.dz-plan .plan-src-none {
  padding: 1px 6px;
  border: 1px dashed var(--marker-line);
  border-radius: 4px;
  background: var(--marker-bg);
  color: var(--ink-2);
}
.dz-plan .plan-q {
  font-size: 13px;
}
.dz-plan .plan-cta {
  font-size: 15px;
}
.dz-plan .plan-links {
  font-size: 14px;
}
.dz-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.dz-foot a {
  color: inherit;
  text-decoration: underline;
}
.dz-plan-fields .label .req {
  margin-left: 2px;
  color: var(--you);
}
.dz-plan-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dz-secs-fieldset {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dz-secs-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 1.6em;
  list-style: decimal;
}
.dz-sec-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.dz-sec-edit .input {
  flex: 1 1 220px;
  min-width: 0;
  width: auto;
}
.dz-sec-error {
  flex-basis: 100%;
}
.dz-cta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 720px) {
  .dz-cta-row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
.dz-plan-actions {
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 719.98px) {
  .dz-plan {
    padding: 16px;
  }
  .dz-plan .plan-h1 {
    font-size: 21px;
  }
  .dz-plan-actions .btn,
  .dz-sec-edit .btn,
  .dz-secs-fieldset .btn {
    min-height: 44px;
  }
  .dz-more > summary {
    min-height: 44px;
  }
  .dz-foot a {
    display: inline-block;
    padding: 12px 0;
    margin: -12px 0;
  }
}

/* ---- Nova pauta drawer and Artigos › Ideias (plan 12 slice 10, spec §4.4, §4.3). Mobile first. ---- */
.np-form,
.np-notready {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.np-field {
  gap: 8px;
}
.np-field .label {
  font-size: 15px;
  font-weight: 600;
}
.np-input {
  height: 48px;
  font-size: 15px;
}
.np-live {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.np-live:empty {
  display: none;
}
.np-hint,
.np-error,
.np-refusal,
.ar-idea-refusal {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
.np-hint .icon,
.np-error .icon,
.np-refusal .icon,
.ar-idea-refusal .icon {
  flex: none;
  margin-top: 1px;
}
.np-hint-ok .icon {
  color: var(--ready);
}
.np-hint-match {
  color: var(--ink);
}
.np-hint-scope {
  color: var(--muted);
}
.np-error {
  color: var(--danger);
}
.np-refusal {
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--ink);
  font-size: 14px;
}
.np-refusal .icon,
.ar-idea-refusal .icon {
  color: var(--danger);
}
.np-refusal a,
.ar-idea-refusal a {
  color: var(--accent);
  font-weight: 500;
}
.np-restored {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
}
.np-restored button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 14px var(--sans);
  text-decoration: underline;
  cursor: pointer;
}
.np-angle {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--you-line);
  background: var(--you-bg);
  font-size: 14px;
}
.np-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 14px;
}
.np-chip {
  height: auto;
  min-height: 32px;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  white-space: normal;
  text-align: left;
}
.np-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.np-more-sum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
/* Phone: the chips and "Mais detalhes" are tap targets as tall as the drawer's buttons. */
@media (max-width: 719px) {
  .np-examples {
    gap: 8px;
  }
  .np-chip,
  .np-more-sum {
    min-height: 44px;
  }
}
.np-more-sum::-webkit-details-marker {
  display: none;
}
.np-more-sum::before {
  content: "›";
  display: inline-block;
  width: 12px;
  font-size: 18px;
  line-height: 1;
  transition: transform var(--dur) var(--ease);
}
.np-more[open] > .np-more-sum::before {
  transform: rotate(90deg);
}
.np-more-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 12px;
}
.np-eta {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 14px;
}
.np-eta .icon {
  flex: none;
  margin-top: 1px;
}
.np-demo {
  font-size: 13px;
}
/* "Gerar artigo" comes first in the markup (Enter generates); on wider screens it sits right. */
.np-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.np-actions .btn {
  min-height: 44px;
  justify-content: center;
}
@media (min-width: 720px) {
  .np-actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }
  .np-actions .btn {
    min-height: 40px;
  }
}
.np-need {
  margin: 0;
  font-weight: 600;
}
.np-check {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.np-check li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.np-check-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.np-check .is-done {
  color: var(--ink-2);
}
.np-check .is-done .np-check-mark {
  border-color: var(--ready);
  background: var(--ready);
  color: var(--done-ink);
}
.np-check a {
  color: var(--accent);
}
/* Início · "Para qual cliente?" */
.np-chooser-hint {
  margin: 0 0 12px;
  color: var(--ink-2);
}
.np-chooser {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.np-chooser li + li {
  border-top: 1px solid var(--line);
}
.np-chooser-item {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.np-chooser-item:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.np-chooser-item::after {
  content: "›";
  margin-left: auto;
  color: var(--muted);
}

/* Artigos › Ideias: collapsed like Encerrados. */
.ar-ideas {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.ar-ideas-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ar-ideas-sum::-webkit-details-marker {
  display: none;
}
.ar-ideas .ar-ideas-sum > .num {
  font-weight: 400;
  color: var(--ink-2);
}
.ar-ideas-sum::after {
  content: "›";
  margin-left: auto;
  font-size: 18px;
  color: var(--ink-2);
  transition: transform var(--dur) var(--ease);
}
.ar-ideas[open] > .ar-ideas-sum::after {
  transform: rotate(90deg);
}
.ar-ideas > .ar-list {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.ar-ideas > .ar-none {
  margin: 0;
  padding: 0 20px 16px;
}
.ar-idea-title {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ar-idea-refusal {
  margin-top: 6px;
}
/* The reason once, over the list, when no idea can be written now. */
li.ar-idea-refusal {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.ar-idea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ar-idea-actions form {
  margin: 0;
}

/* ---- Fontes tab and the Fontes editor (plan 12 slice 11; the wizard's step 3 reuses it) ---- */
.fx-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
  min-width: 0;
}
.fx-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fx-title {
  font-size: 20px;
  font-weight: 600;
}
.fx-summary {
  color: var(--ink);
  font-weight: 500;
}
.fx-outcome,
.fx-admin {
  color: var(--ink-2);
  font-size: 14px;
}
.fx-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.fx-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}
.fx-count {
  color: var(--ink-2);
  font-weight: 400;
}
.fx-lead {
  color: var(--ink-2);
  font-size: 14px;
}
/* Web switch: a checkbox drawn as a switch, saved on change (public/app.js). */
.fx-web {
  padding: 20px;
}
.fx-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.fx-switch-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fx-switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 1px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.fx-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.fx-switch:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.fx-switch:checked::after {
  transform: translateX(18px);
  background: var(--accent-ink);
}
.fx-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fx-switch-label {
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.fx-switch-help {
  color: var(--muted);
  font-size: 13px;
}
html.js .fx-nojs {
  display: none;
}
/* Phones without scripts: "Salvar" on its own line under the text, aligned with it. */
@media (max-width: 719.98px) {
  .fx-switch-row {
    flex-wrap: wrap;
  }
  .fx-switch-text {
    flex-basis: calc(100% - 56px);
  }
  .fx-switch-row .fx-nojs {
    margin-left: 56px;
  }
}
/* Paste box */
.fx-paste {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.fx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fx-label {
  font-weight: 500;
}
.fx-opt {
  color: var(--muted);
  font-weight: 400;
}
.fx-ta {
  min-height: 84px;
  font-size: 14px;
}
.fx-hint {
  color: var(--muted);
  font-size: 13px;
}
.fx-error {
  color: var(--failed-fg);
  font-size: 14px;
  font-weight: 500;
}
.fx-preview-box:empty {
  display: none;
}
.fx-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fx-prow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface-2);
}
.fx-pline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.fx-purl {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.fx-arrow {
  color: var(--muted);
}
.fx-tag {
  width: auto;
  height: 36px;
  padding: 4px 8px;
  background: var(--surface);
  font-size: 14px;
}
.fx-pbad,
.fx-pwarn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.fx-pbad {
  font-size: 14px;
}
.fx-pbad .icon,
.fx-pwarn .icon {
  flex: none;
  margin-top: 3px;
  color: var(--muted);
}
.fx-pnote {
  color: var(--muted);
  font-size: 13px;
}
.fx-paste-actions {
  display: flex;
  justify-content: flex-end;
}
/* Lists */
.fx-own {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 80px;
}
.fx-own-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.fx-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fx-filter-label {
  color: var(--muted);
  font-size: 13px;
}
.fx-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.fx-chip:hover {
  border-color: var(--ink-2);
}
.fx-chip[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.fx-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-width: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.fx-list > .fx-row:first-child {
  border-top: 0;
}
.fx-main {
  display: flex;
  flex: 1 1 260px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fx-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.fx-kind {
  color: var(--ink-2);
  font-weight: 400;
}
.fx-url {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.fx-why {
  color: var(--ink-2);
  font-size: 13px;
}
.fx-status {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  max-width: 100%;
}
.fx-st {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.fx-st .icon {
  flex: none;
  margin-top: 3px;
}
.fx-ok {
  color: var(--ready);
}
.fx-wait {
  color: var(--muted);
  font-weight: 400;
}
.fx-no {
  color: var(--ink-2);
  font-weight: 400;
}
.fx-used {
  color: var(--muted);
  font-size: 13px;
}
.fx-trust {
  margin: 0;
}
.fx-end {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.fx-more .tb-panel {
  min-width: 200px;
}
.fx-remove {
  color: var(--failed-fg);
}
.fx-none {
  padding: 12px 0;
  color: var(--ink-2);
  font-size: 14px;
}
.fx-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
}
.fx-empty-title {
  font-weight: 600;
}
.fx-empty-text {
  color: var(--ink-2);
  font-size: 14px;
}
/* Read-only groups: found by the Painel, shared by the agency. */
.fx-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.fx-group-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.fx-group-sum::-webkit-details-marker {
  display: none;
}
.fx-group-n {
  color: var(--ink-2);
  font-weight: 400;
}
.fx-group-sum::after {
  content: "›";
  margin-left: auto;
  color: var(--ink-2);
  font-size: 18px;
  transition: transform var(--dur) var(--ease);
}
.fx-group[open] > .fx-group-sum::after {
  transform: rotate(90deg);
}
.fx-group-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px 8px;
  border-top: 1px solid var(--line);
}
.fx-group-body > .fx-lead {
  padding-top: 10px;
}
.fx-group .fx-row {
  padding-inline: 0;
}
@media (max-width: 719.98px) {
  .fx-web,
  .fx-paste {
    padding: 16px;
  }
  .fx-arrow {
    display: none;
  }
  .fx-tag {
    width: 100%;
  }
  .fx-paste-actions .btn {
    width: 100%;
  }
  .fx-row {
    align-items: flex-start;
  }
  .fx-main {
    flex: 1 1 0;
  }
  .fx-status {
    flex-basis: 100%;
    order: 1;
  }
  .fx-end {
    margin-left: 0;
  }
}
/* From 720 px a row is three columns, so a long status wraps inside its own column and the ⋯
   stays on the row (a flex row would push it to a line of its own). */
@media (min-width: 720px) {
  .fx-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) fit-content(45%) auto;
  }
  .fx-status {
    justify-content: flex-end;
  }
}

/* ---- Marca tab and the Marca form (plan 12 slice 12, spec §4.7; the wizard's step 2 reuses it) ---- */
.mk {
  min-width: 0;
}
.mk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.mk-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.mk-side {
  display: none;
}
@media (min-width: 960px) {
  .mk-grid {
    grid-template-columns: minmax(0, 720px) minmax(0, 320px);
    gap: 32px;
  }
  .mk-side {
    display: block;
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 72px);
  }
}
.mk-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.mk-fs {
  margin: 0;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.mk-form > .mk-fs:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.mk-fs:last-of-type {
  padding-bottom: 0;
}
/* A legend sits on the fieldset's border by default; float puts it inside, in the flow. */
.mk-legend {
  float: left;
  width: 100%;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
}
.mk-legend + * {
  clear: both;
}
.mk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mk-req {
  color: var(--you);
  margin-left: 2px;
}
.mk-hint {
  margin: 0;
  max-width: 68ch;
}
.mk-sublabel {
  color: var(--ink-2);
}
.mk-counter {
  align-self: flex-end;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mk-form .textarea {
  field-sizing: content;
  min-height: 4lh;
  max-height: 24lh;
}
.mk-warn,
.mk-flag {
  margin: 0;
  font-size: 13px;
}
.mk-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--accent);
}
.mk-flag::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.mk-group-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.mk-inline-link {
  font-weight: 500;
}
.mk-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
/* Groups of controls are fieldsets; their legend floats into the flow like a label. */
.mk-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.mk-group-legend {
  float: left;
  width: 100%;
  padding: 0;
}
.mk-group-legend + * {
  clear: both;
}
.mk-cta {
  position: relative;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.mk-cta-title {
  float: left;
  padding: 0;
  line-height: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.mk-cta-title + * {
  clear: both;
}
.mk-cta-remove {
  position: absolute;
  top: 8px;
  right: 8px;
}
.mk-cta-remove:hover {
  color: var(--danger);
}
.mk-cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.mk-cta .input {
  background: var(--surface);
}
@media (min-width: 720px) {
  .mk-cta-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
.mk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.mk-empty {
  margin: 0;
}
/* The readiness card and the phone bar */
.mk-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-card-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mk-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.mk-ok {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ready);
  font-weight: 500;
}
.mk-ok .icon {
  flex: none;
  margin-top: 3px;
}
.mk-progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.mk-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.mk-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-check {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.mk-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mk-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
}
.mk-check .is-done .mk-mark {
  background: var(--ready);
  border-color: var(--ready);
  color: var(--surface);
}
.mk-check .is-done a:any-link {
  color: var(--ink-2);
  text-decoration: none;
}
.mk-meta {
  margin: 0;
  font-size: 12px;
}
.mk-dirty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mk-dirty-text {
  margin: 0;
  font-weight: 600;
}
.mk-refused {
  margin: 0;
  color: var(--failed-fg);
  font-weight: 600;
}
.mk-phonebar > .mk-refused {
  font-size: 13px;
}
.mk-dirty .btn-block {
  white-space: normal;
}
.mk-phonebar {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The card beside the form takes over from 960 px. */
@media (min-width: 960px) {
  .mk-phonebar {
    display: none;
  }
}
.mk-phonebar > .hint {
  margin: 0;
}
.mk-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.mk-bar-details {
  flex: 1 1 200px;
  min-width: 0;
}
.mk-bar-summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
}
/* One run of text: it wraps between words, never leaving the separator alone at a line end. */
.mk-bar-text {
  min-width: 0;
}
.mk-nowrap {
  white-space: nowrap;
}
.mk-bar-summary::-webkit-details-marker {
  display: none;
}
.mk-bar-more {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mk-bar-ready {
  color: var(--ready);
  font-weight: 500;
}
.mk-bar-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 4px;
}
.mk-bar-sheet .hint {
  margin: 0;
}
.mk-bar-sheet .mk-check a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
/* Histórico, collapsed */
.mk-hist-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r-card);
}
.mk-hist-summary::-webkit-details-marker {
  display: none;
}
.mk-hist-summary::after {
  content: "›";
  margin-left: auto;
  color: var(--muted);
  transition: transform var(--dur) var(--ease);
}
.mk-hist[open] > .mk-hist-summary::after {
  transform: rotate(90deg);
}
.mk-hist-summary:hover {
  background: var(--surface-2);
}
.mk-hist-title {
  font-weight: 600;
}
.mk-hist-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-hist-body .hint {
  margin: 0;
}
.mk-hist-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.mk-hist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
/* "Ver": a phone-sized target without moving the row's text. */
.mk-hist-view {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  margin: 0 -6px;
}
.mk-in-use {
  color: var(--ready);
  font-weight: 500;
}
/* An older save, read only */
.mk-version {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1072px;
}
.mk-version h2 {
  font-size: 20px;
}
.mk-version .hint {
  margin: 0;
}
.mk-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.mk-version-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.mk-version-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.mk-version-row dt {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.mk-differs {
  margin-left: 6px;
  vertical-align: 1px;
  background: var(--accent-soft);
  /* --accent-ink is for text on --accent; on the soft tint the notices' ink reads. */
  color: var(--accent-hover);
}
.mk-version-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mk-version-row dd p,
.mk-version-row dd ul {
  margin: 0;
}
.mk-version-row dd ul {
  padding-left: 1.2em;
}
.mk-quote {
  font-style: italic;
  color: var(--ink-2);
}
@media (min-width: 720px) {
  .mk-version-row {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 16px;
  }
}
/* "Ver exemplo" */
.mk-example {
  margin: 12px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mk-example-p {
  margin: 0;
}
.mk-example-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--accent-soft);
  font-family: var(--font-ui);
  font-size: 15px;
}
@media (max-width: 719.98px) {
  .mk-form {
    padding: 16px;
  }
  .mk-fs {
    padding: 20px 0;
  }
  .mk-actions > .btn {
    width: 100%;
  }
  .mk-version {
    padding: 16px;
  }
  .mk-version-head > .btn {
    width: 100%;
  }
}

/* ---- Novo cliente wizard (plan 12 slice 13, spec §4.8.1). Mobile first. ---- */
.wz-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.wz-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}
.wz-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.wz-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-2);
}
.wz-client {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}
.wz-exit {
  padding: 6px 0;
  font-weight: 500;
  white-space: nowrap;
}
/* On steps 1 and 2 the exit submits the step's form (saves the draft): a button that reads as
   the link it is on the other steps. */
button.wz-exit {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
button.wz-exit:hover {
  color: var(--accent-hover);
}
.wz .wz-stepper {
  flex: none;
  width: 100%;
  max-width: 640px;
}
.wz-num {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.step-current .wz-num {
  color: var(--accent-ink);
}
.wz-step-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.wz-step-link:hover .step-label {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 719.98px) {
  /* A phone shows only the dot (24 px): the padding makes a 44 px target, the margin keeps the
     dot where it was, on the stepper's line. */
  .wz-step-link {
    min-width: 44px;
    padding: 10px;
    margin: -10px;
  }
}
.wz-narrow {
  width: 100%;
  max-width: 720px;
}
.wz-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wz-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
}
.wz-step-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wz-step-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.wz-step-lead {
  margin: 0;
  color: var(--ink-2);
}
.wz-step-2 .wz-step-head {
  margin-bottom: -8px;
}
.wz-saved {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.wz-saved dt {
  font-size: 13px;
  color: var(--muted);
}
.wz-saved dd {
  margin: 2px 0 0;
}
.wz-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.wz-actions > .hint,
.wz-actions > .field-error {
  margin: 0;
}
.wz-buttons {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 8px;
}
.wz-buttons .btn {
  justify-content: center;
}
.wz-spacer {
  display: none;
}
.wz .field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.wz-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2, var(--bg));
}
.wz-gate-title {
  margin: 0;
  font-weight: 600;
}
.wz-gate .ar-check a {
  color: var(--accent);
}
.wz .mk.is-wizard .mk-actions .wz-buttons {
  width: 100%;
}
@media (max-width: 719.98px) {
  .wz-exit {
    order: -1;
    margin-left: auto;
  }
}
@media (min-width: 720px) {
  .wz-card {
    padding: 24px;
  }
  .wz-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .wz-spacer {
    display: block;
    flex: 1 1 auto;
  }
}

/* ---- Ajustes tab (plan 12 slice 15, prototype §4.10) ---- */
.aj-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
  min-width: 0;
}
.aj-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  min-width: 0;
  /* A write comes back to its card's anchor: keep the card clear of the sticky bars. */
  scroll-margin-top: 128px;
}
.aj-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aj-h {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.aj-help {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
}
.aj-admin-note {
  color: var(--muted);
  font-size: 12.5px;
}
.aj-switch-label {
  font-size: 15px;
}
.aj-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.aj-actions-start {
  justify-content: flex-start;
}
.aj-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* The client's rules: numbered by CSS, so the numbers follow rows added or removed. */
.aj-rules {
  counter-reset: aj-rule;
}
.aj-rules:empty {
  display: none;
}
.aj-rules .item-row {
  counter-increment: aj-rule;
  min-width: 0;
}
.aj-rules .item-row::before {
  content: counter(aj-rule);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.aj-rules .input {
  flex: 1;
  min-width: 0;
}
.aj-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--danger);
}
.aj-empty {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.aj-rules:not(:empty) ~ .aj-empty {
  display: none;
}
.aj-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.aj-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Spend: the month's spend against the limit. */
.aj-usage {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aj-bar {
  flex: 0 1 360px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.aj-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.aj-usage-text {
  flex: none;
  color: var(--ink-2);
  font-size: 12.5px;
}
/* From 80% of the limit: amber. At the limit (new artigos refused): danger, plus a line. */
.aj-usage.is-near .aj-bar > span {
  background: var(--you-line);
}
.aj-usage.is-near .aj-usage-text {
  color: var(--you);
}
.aj-usage.is-full .aj-bar > span {
  background: var(--danger);
}
.aj-usage.is-full .aj-usage-text {
  color: var(--danger);
  font-weight: 600;
}
.aj-reached {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-input);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13.5px;
}
.aj-reached .icon {
  flex: none;
  margin-top: 2px;
}
.aj-limit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.aj-limit {
  margin: 0;
}
.aj-limit-row .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aj-cap-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aj-cap-input {
  max-width: 180px;
}
.aj-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.aj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 720px) {
  .aj-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 719.98px) {
  .aj-card {
    padding: 16px;
  }
  .aj-remove span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------------
   Artigo page, Modes C and D (plan 12 slice 16): the ready article beside "Para publicar",
   "Dados para o Google", and the Artigos nudge "Já foi publicado? Diga onde."
   --------------------------------------------------------------------------- */
html:not(.js) .js-only {
  display: none;
}
.art-mode-c {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.art-strip-ready {
  border-color: transparent;
  background: var(--ready-bg);
  color: var(--ink);
}
.art-strip-below {
  justify-content: flex-start;
  flex-wrap: nowrap;
  align-items: flex-start;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}
.art-strip-note {
  margin-top: 4px;
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.art-strip-below .icon {
  flex: none;
  margin-top: 3px;
}
.pub-url {
  overflow-wrap: anywhere;
}
.pub-url .icon {
  display: inline-block;
  margin-left: 3px;
  vertical-align: -2px;
}
@media (min-width: 840px) {
  .dz-grid > .pub-panel {
    grid-column: 2;
    position: sticky;
    top: 72px;
  }
  /* "Falta preencher" comes first in the page (under the strip on a phone); here it sits above
     the article, beside the panel. */
  .pub-grid.has-missing {
    row-gap: 16px;
  }
  .pub-grid.has-missing > .pub-missing {
    grid-column: 1;
    grid-row: 1;
  }
  .pub-grid.has-missing > .pub-text {
    grid-column: 1;
    grid-row: 2;
  }
  .pub-grid.has-missing > .pub-panel {
    grid-row: 1 / span 2;
  }
}
.pub-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ready);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}
.pub-title {
  font-size: 18px;
  font-weight: 600;
}
.pub-done-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ready);
}
.pub-below {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-input);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.pub-below .icon {
  flex: none;
  margin-top: 2px;
}
.pub-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pub-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.pub-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pub-check,
.pub-step.is-done .pub-num,
.pub-sr-done,
.pub-step.is-done .pub-sr-todo {
  display: none;
}
.pub-step.is-done .pub-check,
.pub-step.is-done .pub-sr-done {
  display: inline-flex;
}
.pub-step.is-done .pub-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.pub-step-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-top: 1px;
}
.pub-step-title {
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.pub-step.is-done .pub-step-title {
  color: var(--ink-2);
}
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.pub-copy-form {
  display: contents;
}
.pub-sum {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  list-style: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.pub-sum::-webkit-details-marker,
.pub-form-sum::-webkit-details-marker,
.ar-nudge-sum::-webkit-details-marker {
  display: none;
}
.pub-chev {
  display: inline-flex;
  transform: rotate(-90deg);
  transition: transform var(--dur) var(--ease);
}
.pub-more[open] .pub-chev,
.pub-again[open] .pub-chev {
  transform: none;
}
.pub-more-body {
  margin-top: 6px;
}
.pub-more-body .btn {
  min-height: 36px;
}
.pub-again-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.pub-off {
  font-size: 14px;
  color: var(--muted);
}
.pub-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.pub-pub-line {
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.pub-form-wrap {
  min-width: 0;
}
.pub-form-sum {
  list-style: none;
  width: fit-content;
}
.pub-form-wrap[open] {
  flex-basis: 100%;
}
.pub-form-wrap[open] .pub-form-sum {
  margin-bottom: 10px;
}
.pub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.pub-form .input {
  width: 100%;
  background: var(--surface);
}
/* The text */
.pub-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 20px 16px;
}
/* One reading column for the text, the CTA and the Fontes: 68ch of the 18px serif body
   (one serif "0" is 10px), in px because .article and .art-sources are set in other
   fonts, so a ch on them would measure the wrong face. */
.pub-text > .article,
.pub-text > .art-sources {
  width: 100%;
  max-width: 680px;
}
.pub-text .article {
  padding: 0;
}
.pub-text .answer-block {
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--r-card) var(--r-card) 0;
}
.pub-text .answer-block p,
.pub-text .article-body {
  font-size: 18px;
  line-height: 1.65;
}
@media (min-width: 720px) {
  .pub-text {
    padding: 32px;
  }
}
.art-cta {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--accent-soft);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-input);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
/* What the review asked to change on an artigo approved below the standard (QA round 2). */
.pub-asked {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  font-size: 14px;
}
.pub-asked-title {
  font-size: 15px;
  font-weight: 600;
}
.pub-asked-hint {
  margin: 4px 0 10px;
  color: var(--muted);
}
.pub-missing {
  padding: 14px 16px;
  border: 1px solid var(--you-line);
  border-radius: var(--r-card);
  background: var(--you-bg);
  font-size: 14px;
}
.pub-missing-title {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--you);
}
.pub-missing-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-left: 1.4em;
  overflow-wrap: anywhere;
}
.pub-text mark.marker[id],
.art-h1 mark.marker[id] {
  scroll-margin-top: 96px;
}
.pub-text mark.marker:target,
.art-h1 mark.marker:target {
  outline: 2px solid var(--you);
  outline-offset: 2px;
  animation: pub-pulse 1.2s var(--ease) 2;
}
@keyframes pub-pulse {
  50% {
    outline-offset: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pub-text mark.marker:target,
  .art-h1 mark.marker:target {
    animation: none;
  }
}
.pub-src-note {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-left: 6px;
  font-size: 13px;
}
.pub-trusted {
  color: var(--ready);
  font-weight: 600;
}
.pub-audit {
  color: var(--muted);
}
/* Dados para o Google */
.pub-g {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.pub-g-sec,
.pub-g-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.pub-g-field {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pub-g-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pub-g-label {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
.pub-g-count {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.pub-g-hint {
  font-size: 13px;
  color: var(--ink-2);
}
.pub-g-value {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-input);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.pub-g-code {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-input);
  background: var(--surface-2);
  font: 13px / 1.5 var(--mono);
  white-space: pre;
}
.pub-g-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 1.2em;
  overflow-wrap: anywhere;
}
.pub-g-img {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.gp {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.gp-url {
  font-size: 13px;
  color: var(--ready);
}
.gp-title {
  font-size: 19px;
  line-height: 1.3;
  color: var(--accent);
}
.gp-desc {
  font-size: 14px;
  color: var(--ink-2);
}
/* Artigos: "Já foi publicado? Diga onde." */
.ar-nudge {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}
.ar-nudge-sum {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  list-style: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.ar-nudge-pop[open] {
  flex-basis: 100%;
}
.ar-nudge-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 420px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.ar-nudge-form .field,
.ar-nudge-form .input {
  width: 100%;
}

/* ---- Pronto: the marker editor and the values he filled in (plan 12 slice 17, N1) ---- */
/* A marker that opens its editor: the amber mark as an inline button (spec §4.5 Mode C). */
.marker-btn {
  position: relative;
  display: inline;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  outline: 0;
  border: 1px solid var(--marker-outline);
  font: 600 12px / 1.5 var(--sans);
  letter-spacing: 0.02em;
  color: var(--marker-fg);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
/* A taller tap target than the 19px pill, without moving the text around it. */
.marker-btn::before {
  content: "";
  position: absolute;
  inset: -8px -4px;
}
.marker-btn:hover {
  background: var(--you-bg);
  border-color: var(--you);
}
.marker-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.marker-static {
  padding: 0 6px;
  border-radius: var(--r-pill);
  outline: 0;
  border: 1px solid var(--marker-outline);
  font: 600 11.5px / 1.5 var(--sans);
}
/* The same pill, read only: a held review's text looks as it will on the Pronto page. */
.marker-pill {
  display: inline;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  outline: 0;
  border: 1px solid var(--marker-outline);
  font: 600 12px / 1.5 var(--sans);
  letter-spacing: 0.02em;
  color: var(--marker-fg);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.pub-text .marker-btn[id],
.art-h1 .marker-btn[id] {
  scroll-margin-top: 96px;
}
.pub-text .marker-btn:target,
.art-h1 .marker-btn:target {
  outline: 2px solid var(--you);
  outline-offset: 2px;
}
.pub-truncated svg {
  color: var(--danger);
}
.pub-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-2);
}
.pub-hint svg {
  flex: none;
}
/* A value he filled in: dotted underline, its date on hover and focus (Tip). */
.tip.edited {
  position: relative;
  display: inline;
  vertical-align: baseline;
  text-decoration: underline dotted var(--edited);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: help;
}
.tip.edited:target {
  animation: pub-edited 2s var(--ease) 1;
  scroll-margin-top: 120px;
}
@keyframes pub-edited {
  0%,
  60% {
    background: color-mix(in srgb, var(--edited) 22%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tip.edited:target {
    animation: none;
    background: color-mix(in srgb, var(--edited) 16%, transparent);
  }
}
.article .tip.edited .tip-bubble {
  font-family: var(--sans);
  font-size: 12.5px;
}
/* app.js keeps the bubble on the screen: from the value's start, or ending at its end. */
.tip.edited > .tip-bubble.tip-at-start {
  left: 0;
  transform: none;
}
.tip.edited > .tip-bubble.tip-at-end {
  left: auto;
  right: 0;
  transform: none;
}
/* Where a removed sentence was: the page lands here after "Remover a frase". */
.edit-point {
  scroll-margin-top: 120px;
}
.edit-point:focus {
  outline: 0;
}
.pub-added {
  color: var(--ink-2);
  font-weight: 600;
}
.pub-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 1.1em;
  font-size: 13px;
  color: var(--ink-2);
}
.pub-g-pending {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--you);
}
.pub-g-pending svg {
  flex: none;
}
/* The editor: a popover beside the marker (app.js places it), a bottom sheet on a phone. */
.ov-pop {
  --ov-w: 380px;
}
.ov-pop .ov-head {
  padding-bottom: 4px;
}
.ov-pop .ov-head h2 {
  font-size: 17px;
}
.ov-pop .ov-body {
  gap: 12px;
  padding-bottom: 18px;
}
.ov-pop .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ov-pop .input {
  width: 100%;
}
.ov-pop .field-error {
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 14px;
}
.pub-pop-for {
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.pub-pop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pub-pop-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pub-pop-q {
  font-weight: 500;
  color: var(--ink);
}
@media (min-width: 720px) {
  .ov-pop.is-placed {
    position: fixed;
    inset: auto;
    margin: 0;
  }
  .ov-pop::backdrop {
    background: transparent;
  }
}
@media (max-width: 719.98px) {
  .ov-pop,
  .ov-pop[open]:not(:modal) {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--r-dialog) var(--r-dialog) 0 0;
  }
  .ov-pop .pub-pop-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

/* ---- Administração (plan 12 slice 18, prototype spec §4.13) ---- */
.adm {
  /* Its tables share the column with the sub-nav: narrower cells (.table th, .table.compact td). */
  --table-pad-x: 8px;
  width: 100%;
  max-width: calc(var(--content-max) + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-width: 0;
}
.adm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.adm-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* Below 960 px the sub-nav is a segmented row; from 960 px, a 220 px column. */
.adm-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface-2);
}
.adm-nav-link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-input);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.adm-nav-link:hover {
  background: var(--surface);
  color: var(--ink);
}
.adm-nav-link[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
@media (min-width: 960px) {
  .adm {
    max-width: calc(var(--content-max) + 64px);
    padding: 32px 32px 64px;
  }
  .adm-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
  }
  .adm-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0;
    border: 0;
    background: transparent;
    position: sticky;
    top: 72px;
  }
  .adm-nav-link {
    padding: 8px 12px;
    font-size: 14px;
  }
  .adm-nav-link:hover {
    background: var(--surface-2);
  }
  .adm-nav-link[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: none;
  }
}
.adm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.adm-head-text {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adm-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.adm-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.adm-lead {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-2);
}
.adm-body,
.adm-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.adm-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.adm-h2 {
  font-size: 18px;
  font-weight: 600;
}
.adm-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}
.adm-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.adm-tile-label {
  font-size: 13px;
  color: var(--muted);
}
.adm-tile-value {
  font-size: 26px;
  font-weight: 600;
}
.adm-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.adm-filter-form {
  flex-wrap: wrap;
  gap: 8px;
}
.adm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.chip-btn:hover {
  color: var(--ink);
}
.chip-btn[aria-current="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.adm .facts {
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 6px 16px;
}
.adm .cell-stack > .chip {
  align-self: flex-start;
}
@media (min-width: 720px) {
  .adm .source-table .col-document {
    min-width: 170px;
  }
}
/* Headers may wrap here: the sub-nav leaves less room than the old full-width pages. */
.adm .table th {
  white-space: normal;
}
@media (max-width: 559.98px) {
  .adm .facts.adm-how {
    grid-template-columns: minmax(0, 1fr);
  }
  .adm-how > dd {
    margin-bottom: 8px;
  }
}
.adm-nowrap {
  white-space: nowrap;
}
.adm-dev-summary {
  cursor: pointer;
  width: max-content;
}
.adm-dev-body {
  margin-top: 10px;
}
.adm-stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.adm-stage-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.adm-ok,
.adm-down {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}
.adm-ok {
  color: var(--ready);
}
.adm-down {
  color: var(--danger);
}
.adm-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ready);
}
.adm-active {
  color: var(--ready);
}
.adm-aside {
  position: relative;
}
.adm-new-summary {
  list-style: none;
  cursor: pointer;
}
.adm-new-summary::-webkit-details-marker {
  display: none;
}
.adm-new-body {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-2);
}
.adm-new-text {
  margin: 0;
}
@media (min-width: 720px) {
  .adm-new-body {
    position: absolute;
    right: 0;
    z-index: 5;
    width: min(520px, calc(100vw - 64px));
  }
}
.adm-command {
  margin: 0;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--r-input);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.adm-callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 14px;
  color: var(--ink-2);
}
.adm-callout > .icon {
  flex: none;
  margin-top: 2px;
}
.adm-bands {
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.adm-crit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
}
.adm-crit-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--r-input);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.adm-pts {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.adm-items {
  margin: 0;
  padding: 0;
  list-style: none;
}
.adm-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.adm-id {
  flex: none;
  width: 2.5em;
  color: var(--muted);
}
.adm-items .grow {
  flex: 1 1 240px;
  min-width: 0;
}
.adm-item-side {
  margin-left: auto;
}
.adm-blocking {
  color: var(--ink);
  font-weight: 600;
}
/* Wide admin tables scroll inside their card, never the page, tooltips or not (their tips open
   downward, inside the card). */
.adm .table-card:has(.tip) {
  overflow-x: auto;
}
/* Tables become label/value cards under 720 px (spec §2.3): each cell shows its data-label. */
@media (max-width: 719.98px) {
  .adm-title {
    font-size: 24px;
  }
  .adm-item-side {
    margin-left: 0;
  }
  .table-card:has(> .table.is-cards) {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .table.is-cards,
  .table.is-cards tbody,
  .table.is-cards tr,
  .table.is-cards td {
    display: block;
    width: 100%;
  }
  .table.is-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table.is-cards tr {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
  }
  .table.is-cards td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }
  .table.is-cards td > * {
    min-width: 0;
  }
  .table.is-cards td::before {
    content: attr(data-label);
    flex: none;
    max-width: 45%;
    text-align: left;
    font-size: 12px;
    color: var(--muted);
  }
  .table.is-cards td:not([data-label])::before,
  .table.is-cards td.is-wide::before,
  .table.is-cards td.is-actions::before {
    display: none;
  }
  .table.is-cards .cell-stack {
    align-items: flex-end;
  }
  .table.is-cards .cell-stack > .chip {
    align-self: flex-end;
  }
  /* A sentence reads left to right under its label, not squeezed beside it. */
  .table.is-cards td.is-text {
    flex-direction: column;
    gap: 2px;
    text-align: left;
  }
  .table.is-cards td.is-text .cell-stack,
  .table.is-cards td.is-text .cell-stack > .chip {
    align-items: flex-start;
    align-self: flex-start;
  }
  .table.is-cards td.is-empty {
    display: none;
  }
  .table.is-cards td.is-wide {
    display: block;
    text-align: left;
  }
  /* A row with an action or message line under it: one card, the line as its foot. */
  .table.is-cards tr.has-actions {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .table.is-cards tr.source-action-row {
    border-top: 1px dashed var(--line);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

/* ---- Como funciona (plan 12 slice 19, prototype spec §4.11) ---- */
.gu-page {
  width: 100%;
  max-width: calc(920px + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}
.gu-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.gu-h2 {
  font-size: 22px;
  font-weight: 600;
}
.gu-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .gu-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.gu-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}
.gu-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gu-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}
.gu-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-card);
  background: var(--accent-soft);
  color: var(--accent);
}
.gu-step-title {
  font-size: 18px;
  font-weight: 600;
}
.gu-step-text {
  flex: 1;
  margin: 0;
  color: var(--ink-2);
}
.gu-step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.gu-step-link:hover {
  text-decoration: underline;
}
.gu-step-empty {
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.gu-faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gu-q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.gu-q-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.gu-q-summary::-webkit-details-marker {
  display: none;
}
.gu-q-summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  opacity: 0.75;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.gu-q[open] > .gu-q-summary::after {
  transform: rotate(45deg);
}
.gu-answer {
  margin: 0;
  padding: 0 16px 16px;
  max-width: 68ch;
  color: var(--ink-2);
}
.gu-more > .gu-q-summary {
  font-size: 16px;
}
.gu-details {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 0 16px 20px;
}
.gu-sub {
  font-size: 16px;
  font-weight: 600;
}
.gu-sub-lead {
  margin: 4px 0 0;
}
.gu-phase-label {
  margin: 12px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.gu-stages {
  margin: 0;
  padding: 0;
  list-style: none;
}
.gu-stage {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}
.gu-stage + .gu-stage {
  border-top: 1px solid var(--line);
}
.gu-stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.gu-stage.is-sub > .gu-stage-num {
  background: transparent;
  border-style: dashed;
}
.gu-stage-name {
  margin: 0;
  font-weight: 600;
}
.gu-stage-text {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}
.gu-gloss {
  margin: 8px 0 0;
}
.gu-gloss-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 16px;
  padding: 8px 0;
}
.gu-gloss-row + .gu-gloss-row {
  border-top: 1px solid var(--line);
}
.gu-gloss-row > dt {
  font-weight: 600;
}
.gu-gloss-row > dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}
@media (min-width: 720px) {
  .gu-gloss-row {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
.gu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---- Minha conta (plan 12 slice 19, prototype spec §4.12) ---- */
/* The page's column starts at the content's left edge, as on the other pages; the cards stay narrow. */
.cn-page {
  width: 100%;
  max-width: calc(var(--content-max) + 32px);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.cn-page > * {
  max-width: 640px;
}
@media (min-width: 960px) {
  .cn-page,
  .gu-page {
    padding-left: 32px;
    padding-right: 32px;
  }
  .cn-page {
    max-width: calc(var(--content-max) + 64px);
  }
}
.cn-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cn-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.cn-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}
.cn-who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cn-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cn-email {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.cn-role {
  margin: 0;
}
.cn-form {
  max-width: 420px;
}
.cn-h {
  font-size: 18px;
  font-weight: 600;
}

/* ---- Final score (brief 2026-11-18, items 3 and 3a; src/web/views/score.tsx) ---- */
.chip-score,
.chip-standard {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chip-score.is-pass,
.chip-standard {
  background: var(--ready-bg);
  color: var(--ready);
  border: 1px solid var(--ready);
}
.chip-score.is-below {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.chip-score.is-unknown {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px dashed var(--line);
}
.sc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--r-input);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  background: var(--surface-2);
}
.sc-card.is-pass {
  border-left-color: var(--ready);
  background: var(--ready-bg);
}
.sc-card.is-below {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}
.sc-card.is-unknown {
  border-left-style: dashed;
}
.sc-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sc-big {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin: 0;
}
.sc-num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.sc-card.is-unknown .sc-num {
  font-size: 18px;
  color: var(--muted);
}
.sc-of {
  color: var(--muted);
  font-size: 14px;
}
.sc-status {
  font-size: 14px;
  font-weight: 600;
}
.sc-verdict {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.sc-verdict .icon {
  flex: none;
  margin-top: 2px;
}
.sc-card.is-pass .sc-status,
.sc-card.is-pass .sc-verdict {
  color: var(--ready);
}
.sc-card.is-below .sc-status,
.sc-card.is-below .sc-verdict {
  color: var(--danger);
}
.sc-bar {
  position: relative;
  display: block;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--line);
}
.sc-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: var(--danger);
}
.sc-card.is-pass .sc-bar-fill {
  background: var(--ready);
}
.sc-bar-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
}
.sc-mark,
.sc-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.sc-crits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.sc-crit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.sc-crit-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.sc-crit-line > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---- Início: sections that fold (brief 2026-11-18, item 2; src/web/views/fold.tsx) ---- */
.fold-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 -4px;
  padding: 2px 6px 2px 4px;
  border: 0;
  border-radius: var(--r-input);
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.fold-btn:hover {
  background: var(--surface-2);
}
.fold-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fold-label {
  display: inline;
}
.fold-chev {
  display: none;
  flex: none;
  transition: transform 0.15s ease;
}
.js .fold-chev {
  display: inline-flex;
}
.fold-btn[aria-expanded="false"] .fold-chev {
  transform: rotate(-90deg);
}
html:not(.js) .fold-btn {
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  .fold-chev {
    transition: none;
  }
}

/* ---- Pronto · "Ajustar o texto (opcional)" (brief 2026-11-18, item 4) ---- */
.pub-step.is-optional .pub-mark {
  border-style: dashed;
}
.pub-optional {
  font-weight: 400;
  color: var(--muted);
}
.pub-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pub-editor-title {
  margin: 0;
  font-size: 20px;
}
.pub-editor-hints {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.pub-editor-text {
  width: 100%;
  min-height: 60vh;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 14px;
  line-height: 1.55;
}
.pub-editor-actions {
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Marca suggestions (brief 2026-11-18, item 1; src/web/views/brand-suggest.tsx) ---- */
.mk-sug-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--accent);
}
.mk-sug-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: var(--accent);
}
.mk-sug-line,
.mk-sug-filled {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.45;
}
.mk-sug-filled {
  color: var(--ready);
  font-weight: 600;
}
.mk-sug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mk-sug-ask {
  display: contents;
}
.mk-sug-slot:empty {
  display: none;
}
.mk-sug {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-input);
  background: var(--surface-2);
  font-size: 14px;
}
.mk-sug.is-used {
  border-left-color: var(--ready);
  opacity: 0.85;
}
.mk-sug-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.mk-sug-text {
  margin: 0;
  white-space: pre-line;
  line-height: 1.5;
  max-width: 65ch;
}
.mk-sug-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}
.mk-sug-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
