/* tf-tokens:begin v1 */
:root {
  /* surfaces */
  --tf-page: #e8e2d5;
  --tf-surface: #faf7f0;
  --tf-surface-raised: #faf7f0;        /* always with --tf-shadow-raised */
  --tf-surface-subtle: #ede7da;        /* table head, neutral pill, inline code, disabled field, selected choice card */
  --tf-border: #c4baa6;                /* panel and row lines */
  --tf-border-strong: #77735f;         /* field, button and pill edges */
  /* text */
  --tf-text: #202e3c;
  --tf-text-muted: #585e59;
  --tf-link: #20576b;
  /* brand */
  --tf-accent: #c8882a;                /* amber. On navy only. Never text or a lone mark on a light surface */
  --tf-accent-text: #8a5716;           /* amber that passes on light */
  --tf-header-bg: #0a1628;
  --tf-header-text: #ffffff;
  --tf-header-text-muted: #c5ccd6;
  /* actions */
  --tf-primary: #153848;
  --tf-primary-hover: #204c5e;
  --tf-primary-text: #fff8e9;
  --tf-approve: #1f6f43;               /* the Approve button and nothing else */
  --tf-approve-hover: #185a36;
  --tf-approve-text: #ffffff;
  /* status */
  --tf-warn: #754a13;
  --tf-warn-bg: #f4e5c8;
  --tf-problem: #9a2a1a;
  --tf-problem-bg: #fdf1ee;
  /* focus */
  --tf-focus: #20576b;
  --tf-focus-on-dark: #c8882a;
  /* depth */
  --tf-shadow-raised: 0 1px 3px rgba(10, 22, 40, 0.12);
  --tf-shadow-overlay: 0 12px 32px rgba(10, 22, 40, 0.35);
  --tf-scrim: rgba(10, 22, 40, 0.55);
  /* type */
  --tf-font-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tf-font-wordmark: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --tf-text-sm: 0.875rem;              /* 14px: the floor. Meta lines, pill text, column heads */
  --tf-text-md: 1rem;                  /* 16px: body, cells, labels, controls */
  --tf-text-lg: 1.125rem;              /* 18px: panel title */
  --tf-text-xl: 1.25rem;               /* 20px: section title */
  --tf-text-2xl: 1.5rem;               /* 24px: page title */
  --tf-text-3xl: 2rem;                 /* 32px: the one big number on a tile */
  --tf-weight-regular: 400;
  --tf-weight-strong: 600;
  --tf-leading-body: 1.5;
  --tf-leading-tight: 1.25;
  /* space and shape */
  --tf-space-1: 0.25rem;
  --tf-space-2: 0.5rem;
  --tf-space-3: 0.75rem;
  --tf-space-4: 1rem;
  --tf-space-5: 1.5rem;
  --tf-space-6: 2rem;
  --tf-space-7: 3rem;
  --tf-radius-control: 6px;
  --tf-radius-panel: 10px;
  --tf-radius-pill: 999px;
  --tf-target-min: 44px;
  color-scheme: light;
}

:root[data-tf-appearance="evening"] {
  --tf-page: #14222c;
  --tf-surface: #20323e;
  --tf-surface-raised: #2c414f;
  --tf-surface-subtle: #2c414f;
  --tf-border: #526571;
  --tf-border-strong: #a4b5c2;
  --tf-text: #eeeade;
  --tf-text-muted: #bbc7cd;
  --tf-link: #a9d5df;
  --tf-accent: #e6b565;
  --tf-accent-text: #e6b565;
  --tf-header-bg: #101d26;
  --tf-header-text: #eeeade;
  --tf-header-text-muted: #bbc7cd;
  --tf-primary: #e6b565;
  --tf-primary-hover: #f0cb8c;
  --tf-primary-text: #182936;
  --tf-approve: #7bc796;
  --tf-approve-hover: #9bd5af;
  --tf-approve-text: #14281c;
  --tf-warn: #f3ce89;
  --tf-warn-bg: #443820;
  --tf-problem: #f2a48c;
  --tf-problem-bg: #462e2c;
  --tf-focus: #a9d5df;
  --tf-focus-on-dark: #e6b565;
  --tf-shadow-raised: 0 2px 8px rgba(0, 0, 0, 0.18);
  --tf-shadow-overlay: 0 12px 32px rgba(0, 0, 0, 0.45);
  --tf-scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

.tf-appearance, .tf-appearance * { box-sizing: border-box; }
.tf-appearance { flex: 0 0 auto; color: var(--tf-text); font-family: var(--tf-font-sans); font-size: var(--tf-text-md); }
.tf-appearance > summary {
  display: flex; align-items: center; gap: var(--tf-space-2); min-height: var(--tf-target-min);
  cursor: pointer; list-style: none; text-decoration: underline;
}
.tf-appearance > summary::-webkit-details-marker { display: none; }
.tf-appearance > summary:focus-visible { outline: 3px solid var(--tf-focus); outline-offset: 2px; }
.tf-appearance-footer { display: flex; justify-content: flex-end; flex: 0 0 auto; padding: var(--tf-space-2) var(--tf-space-4); }
.tf-appearance-panel {
  position: fixed; z-index: 1000; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(24rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  display: grid; gap: var(--tf-space-3); padding: var(--tf-space-4);
  background: var(--tf-surface); color: var(--tf-text); border: 1px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-panel); box-shadow: var(--tf-shadow-overlay); line-height: var(--tf-leading-body);
}
.tf-appearance:not([open]) .tf-appearance-panel { display: none; }
.tf-appearance-panel label { margin: 0; color: var(--tf-text); font-size: var(--tf-text-md); font-weight: var(--tf-weight-strong); }
.tf-appearance-panel select, .tf-appearance-panel button {
  width: 100%; min-height: var(--tf-target-min); margin: 0; padding: var(--tf-space-2);
  border: 1px solid var(--tf-border-strong); border-radius: var(--tf-radius-control);
  background: var(--tf-surface); color: var(--tf-text); font-family: var(--tf-font-sans); font-size: var(--tf-text-md);
}
.tf-appearance-panel :focus-visible { outline: 3px solid var(--tf-focus); outline-offset: 2px; }
#tf-appearance-scope, #tf-appearance-status { color: var(--tf-text-muted); font-size: var(--tf-text-md); }
@media print { .tf-appearance, .tf-appearance-footer { display: none !important; } }
/* tf-tokens:end */

/* TF-2447 (design TF-2403 R18): the product typeface, served from this service's own /static/fonts/ (CSP font-src 'self').
   Byte-equal copies of the Cockpit's files. Outside the token block on purpose: the block stays identical in all three files. */
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/worksans-400.418b06936717.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/worksans-600.c536b548fdcb.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Baskerville";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/librebaskerville-700.96fa63376eed.woff2") format("woff2");
}
/* Approval Desk — proposal decision screen (ADR-046 §8.2 story A7).

   Mobile-first: the base rules below target a phone viewport (the sales
   line this whole ADR exists for is "nothing moves money without you —
   from your phone"), and the one @media rule widens spacing/type on a
   desktop-class viewport rather than the other way around. No JS is
   needed for layout — every state (loading, terminal, decision form,
   enrollment) is plain block layout that reflows at any width.
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--tf-font-sans);
  background: var(--tf-page);
  color: var(--tf-text);
  line-height: 1.4;
}

.desk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  /* TF-2405: the same header as the Cockpit (design TF-2403 section 6): navy, the product name in the wordmark, the
     amber rule. Everything inside it takes the header text colours below. */
  background: var(--tf-header-bg);
  color: var(--tf-header-text);
  border-bottom: 2px solid var(--tf-accent);
}

.desk-brand {
  font-family: var(--tf-font-wordmark);
  font-weight: var(--tf-weight-strong);
  color: var(--tf-header-text);
}

.desk-viewer {
  font-size: var(--tf-text-sm);
  color: var(--tf-text-muted);
}

.desk-header .desk-viewer,
.desk-header .desk-link-button {
  color: var(--tf-header-text-muted);
}

.desk-header .desk-header-link {
  color: var(--tf-header-text);
}

.desk-header .desk-logout-status {
  color: var(--tf-header-text);
  font-weight: var(--tf-weight-strong);
  border-left: 3px solid var(--tf-accent);
  padding-left: 0.5rem;
}

.desk-header a:focus-visible,
.desk-header button:focus-visible {
  outline: 3px solid var(--tf-focus-on-dark);
  outline-offset: 2px;
}

.desk-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Sign out (TF-284). Reads as a link but is a real <button>, matching
   Cockpit's own `.link-button` "Log out": it performs an action, so it must
   be a button for keyboard and screen-reader users. Still carries the 44px
   tap target the shared `button` rule below gives every Desk control. */
.desk-link-button {
  background: none;
  border: none;
  padding: 10px 8px;
  font-size: var(--tf-text-sm);
  color: var(--tf-text-muted);
  text-decoration: underline;
}

/* TF-2405 Lane B Minor 1: (0,2,0) here beats `button:disabled` (0,1,1) below, so a Sign out in flight stays a
   transparent link on the navy header instead of drawing the light disabled fill under the header's muted label. */
.desk-link-button[disabled] {
  background: none;
  border: none;
  cursor: default;
  text-decoration: none;
}

.desk-logout-status:empty {
  display: none;
}

.desk-logout-status {
  font-size: var(--tf-text-sm);
  color: var(--tf-problem);
}

main#proposal-root {
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
}

/* TF-1104: a live invoice proposal's `target` is a long run of unbroken JSON text. In the page's
   heading it pushed the page wider than a phone (found in the Chromium walk at 390px and 320px), so
   the heading may break anywhere. Nothing else about the heading changes. */
main#proposal-root h1 {
  overflow-wrap: anywhere;
}

/* Every decision control is a real, tappable target — 44px minimum per
   the platform mobile a11y baseline, not merely styled to look tappable. */
button, .desk-btn {
  min-height: 44px;
  min-width: 44px;
  /* TF-2447: a button does not inherit the page font by default; without this Approve and Reject stay in the
     browser's control font while the rest of the page is Work Sans. */
  font-family: inherit;
  font-size: var(--tf-text-md);
  border-radius: 6px;
  border: 1px solid var(--tf-border-strong);
  background: var(--tf-surface);
  color: var(--tf-text);
  font-weight: var(--tf-weight-strong);
  padding: 10px 16px;
  cursor: pointer;
}

/* TF-287: a decision in flight (fetch -> biometric prompt -> fetch) needs a
   visible busy state, not just a disabled attribute a sighted user might miss. */
/* TF-2405: disabled is the subtle fill with the muted label (5.02:1), not opacity, which dropped every label below its
   measured ratio (design TF-2403 section 6). */
button:disabled, .desk-btn[disabled] {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border);
  color: var(--tf-text-muted);
  cursor: not-allowed;
}

.desk-decision-form[aria-busy="true"] .desk-decision-actions {
  opacity: 0.85;
}

button:focus-visible, .desk-btn:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

/* Approve is the only green control on any owner page (R17). Reject is the outlined problem style: the two differ by
   fill and by word, never by colour alone. */
.desk-btn-approve {
  background: var(--tf-approve);
  border-color: var(--tf-approve);
  color: var(--tf-approve-text);
}

.desk-btn-approve:hover:not(:disabled) {
  background: var(--tf-approve-hover);
  border-color: var(--tf-approve-hover);
}

.desk-btn-reject {
  background: var(--tf-surface);
  border-color: var(--tf-problem);
  color: var(--tf-problem);
}

.desk-btn-reject:hover:not(:disabled) {
  background: var(--tf-problem-bg);
}

.desk-btn-approve:disabled,
.desk-btn-reject:disabled {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border);
  color: var(--tf-text-muted);
}

.desk-decision-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.desk-decision-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.desk-decision-actions > * {
  flex: 1 1 45%;
}

textarea#decision-reason {
  width: 100%;
  min-height: 88px;
  font-size: var(--tf-text-md);
  padding: 10px;
  border: 1px solid var(--tf-border-strong);
  border-radius: 6px;
  font-family: inherit;
}

/* §B-6.1: the detail body is rendered ONLY via textContent by
   proposal.js — this class carries no content-derived styling hook, only
   layout, so nothing here can be abused to hide or reposition injected
   markup (there is none to hide; the point is defence in depth). */
.desk-detail-body {
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 12px;
  background: var(--tf-surface);
  margin: 12px 0;
}

/* TF-998: a send's approval window and touch class, above the message. */
.desk-envelope {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
}

.desk-envelope p {
  margin: 4px 0;
}

.desk-envelope-expired {
  font-weight: var(--tf-weight-strong);
  color: var(--tf-problem);
}

.desk-terminal {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}

.desk-terminal-tamper {
  border-color: var(--tf-problem);
  background: var(--tf-problem-bg);
}

/* TF-285 — the tamper warning (ADR-046 §5.4 residual R-7). Sized ABOVE the
   1rem body text it warns about rather than below it, and given a filled
   ground so it does not read as one more bordered box on a screen that is
   already all bordered boxes. Reversed out of --desk-reject rather than set
   in it: #fff on #8a2c1f is ~8.6:1, comfortably past WCAG AA for the
   bold 1.05rem it carries. */
.desk-tamper-banner {
  font-size: var(--tf-text-md);
  font-weight: var(--tf-weight-strong);
  color: var(--tf-primary-text);
  background: var(--tf-problem);
  border: 2px solid var(--tf-problem);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
}

.desk-enroll-panel {
  border: 1px dashed var(--tf-warn);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}

.desk-status-line {
  font-size: var(--tf-text-md);
  color: var(--tf-text-muted);
  margin-top: 8px;
}

.desk-error-line {
  color: var(--tf-problem);
  font-size: var(--tf-text-md);
  margin-top: 8px;
}

/* TF-1051: who decided. A word chip per kind (the word carries the meaning; the colour only helps
   tell human, policy and override apart), the record reference in the mono face, and a problem
   line that reads as a problem without relying on colour alone ("Needs attention:" leads it). */
.approver-attribution {
  margin: 0.15rem 0 0.4rem;
  font-size: var(--tf-text-md);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  align-items: center;
}

.approver-marker {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: var(--tf-weight-strong);
  white-space: nowrap;
}

.approver-marker--person {
  color: var(--tf-text);
}

.approver-marker--policy {
  color: var(--tf-text);
}

.approver-marker--operator_override {
  color: var(--tf-warn);
}

.approver-marker--slack {
  color: var(--tf-text-muted);
}

.approver-marker--undecided {
  color: var(--tf-text-muted);
  border-style: dashed;
}

.approver-marker--integrity_gap {
  color: var(--tf-problem);
  background: var(--tf-problem-bg);
}

.approver-record-ref {
  font-family: var(--tf-font-sans);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.approver-problem {
  flex: 1 1 100%;
  margin: 0;
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

.approver-note {
  flex: 1 1 100%;
  margin: 0;
}

.approver-record-button {
  font: inherit;
  padding: 0.15rem 0.6rem;
  min-height: 44px;
  cursor: pointer;
}

.approver-record-detail {
  flex: 1 1 100%;
  border-left: 3px solid currentColor;
  padding-left: 0.6rem;
}

.approver-record-line {
  margin: 0.1rem 0;
  overflow-wrap: anywhere;
}

/* TF-1617: "Back to dashboard" in the header of every signed-in Desk page. A real link (keyboard
   reachable, no tabindex), first in the header's right-hand group so it is first in tab order and
   is the first thing a keyboard user lands on after the brand. Same link colour and focus ring as
   the TF-1148 links, underlined so it reads as a link without colour, and the 44px tap target the
   shared control rule gives every Desk control. */
.desk-header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  font-size: var(--tf-text-md);
  font-weight: var(--tf-weight-strong);
  color: var(--tf-focus);
  text-decoration: underline;
}

.desk-header-link:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

/* TF-1148: the way back from a page with nothing left to decide. Two plain
   links, queue first, wrapping on a phone. Same link colour as the drawer
   (#2c5a8f on the page ground, past WCAG AA), underlined so they read as
   links without colour, and the Desk's own 3px focus ring. */
.desk-back-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 16px;
}

.desk-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tf-focus);
  text-decoration: underline;
  padding: 4px 0;
}

.desk-back-link:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

/* TF-1104: "What happened after approval" (row 23). The state is always named in the badge's
   own words; the tone only reinforces it, so nothing relies on colour alone. Every text/ground
   pair below is past WCAG AA (verified #14532d on #e6f4ea, #3b3a36 on #eceae4, #7a2e12 on #fbeadf,
   #8a2c1f on #fdf1ee, #5b3a00 on #fff3d6). Same 3px focus ring as every other Desk control. */
.desk-outcome {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}

.desk-outcome-stale {
  border-style: dashed;
  border-color: var(--tf-warn);
}

.desk-outcome-heading {
  font-size: var(--tf-text-lg);
  margin: 0 0 12px;
}

.desk-outcome-heading:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

.desk-outcome-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--tf-border);
  font-weight: var(--tf-weight-strong);
  font-size: var(--tf-text-sm);
  background: var(--tf-surface-subtle);
  color: var(--tf-text);
}

/* R17: "verified" is good news and neutral, never green; the word carries it. */
.desk-outcome-tone-verified {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border-strong);
  color: var(--tf-text);
}

.desk-outcome-tone-accepted,
.desk-outcome-tone-approved {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border-strong);
  color: var(--tf-text);
}

.desk-outcome-tone-waiting {
  background: var(--tf-warn-bg);
  border-color: var(--tf-warn);
  color: var(--tf-warn);
}

.desk-outcome-tone-uncertain {
  background: var(--tf-warn-bg);
  border-color: var(--tf-warn);
  color: var(--tf-warn);
}

.desk-outcome-tone-stopped {
  background: var(--tf-problem-bg);
  border-color: var(--tf-problem);
  color: var(--tf-problem);
}

.desk-outcome-headline {
  font-weight: var(--tf-weight-strong);
  margin: 0 0 8px;
}

.desk-outcome-line,
.desk-outcome-count,
.desk-outcome-asof {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.desk-outcome-count,
.desk-outcome-asof {
  font-size: var(--tf-text-sm);
  color: var(--tf-text-muted);
}

.desk-outcome-gap {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 4px solid var(--tf-warn);
  background: var(--tf-warn-bg);
  color: var(--tf-warn);
}

.desk-outcome-facts {
  margin: 8px 0 0;
}

.desk-outcome-facts dt {
  font-size: var(--tf-text-sm);
  color: var(--tf-text-muted);
}

.desk-outcome-facts dd {
  margin: 0;
  font-weight: var(--tf-weight-strong);
  overflow-wrap: anywhere;
}

.desk-outcome-status {
  font-size: var(--tf-text-md);
  color: var(--tf-text-muted);
  margin: 8px 0 0;
  min-height: 1.2em;
}

.desk-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.desk-outcome-actions [hidden] {
  display: none;
}

.desk-outcome-actions a.desk-btn {
  display: inline-block;
  text-decoration: none;
  color: var(--tf-focus);
  line-height: 24px;
}

.desk-btn-secondary {
  background: var(--tf-surface);
}

.desk-btn[aria-disabled="true"] {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border);
  color: var(--tf-text-muted);
  cursor: progress;
}

.desk-decision-recovery {
  margin-top: 12px;
}

.desk-decision-recovery a.desk-btn {
  display: inline-block;
  text-decoration: none;
  color: var(--tf-focus);
  line-height: 24px;
}

.desk-outcome [hidden] {
  display: none;
}

#pending-drawer {
  border-top: 1px solid var(--tf-border);
  padding: 12px 16px 24px;
}

/* TF-1379: `hidden` sits on the list, so the toggle above it is always visible. */
#drawer-list[hidden] {
  display: none;
}

#drawer-toggle {
  width: 100%;
}

#drawer-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

#drawer-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--tf-border);
}

#drawer-list a {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  overflow-wrap: anywhere;
  color: var(--tf-focus);
  text-decoration: none;
}

/* -- Record-sync structured screen (TF-664) -------------------------------
   Plain-language screen for a record_sync standing-approval proposal. Phone
   first: the field list is STACKED source->target pairs, never a wide table,
   so a 30-field map reflows down the page and never needs a horizontal
   scroll (scope item 5). No rule here sets `white-space: nowrap` or an
   `overflow-x`, and there is no table element in the markup at all. */

/* Scope item 7: the "it paused because its setup changed" cause banner —
   announced (role="alert" in JS), sized like the body it sits above, and
   given a filled amber ground so it reads as a state notice, not one more
   bordered box. #fff on --desk-warn (#a8641a) is ~4.9:1, past WCAG AA. */
.desk-cause-banner {
  font-size: var(--tf-text-md);
  font-weight: var(--tf-weight-strong);
  color: var(--tf-primary-text);
  background: var(--tf-warn);
  border: 2px solid var(--tf-warn);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
}

.desk-sync-status,
.desk-sync-when,
.desk-sync-which,
.desk-sync-untouched,
.desk-sync-turnoff-stops,
.desk-sync-turnoff-stays {
  margin: 10px 0;
}

.desk-sync-dup {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 12px;
  background: var(--tf-surface);
  margin: 12px 0;
}

.desk-sync-dup-heading,
.desk-sync-fields-heading,
.desk-sync-changes-heading {
  font-weight: var(--tf-weight-strong);
  margin: 0 0 8px;
}

.desk-sync-dup-line {
  margin: 8px 0;
}

.desk-sync-means {
  border-left: 3px solid var(--tf-border);
  padding: 8px 12px;
  margin: 16px 0;
  color: var(--tf-text);
}

/* Scope item 5: stacked source->target pairs. A column flex row wraps down
   the page at any width — no table, no nowrap, no horizontal scroll. */
.desk-sync-field-list,
.desk-sync-changes-list {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
}

.desk-sync-field-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--tf-border-strong);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.desk-sync-field-arrow {
  color: var(--tf-text-muted);
}

.desk-sync-field-transform {
  font-size: var(--tf-text-md);
  color: var(--tf-text-muted);
}

/* Scope item 8: each change row leads with a real TEXT label, never colour
   alone. The label keeps its own weight so it is legible without relying on
   any colour cue. */
.desk-sync-change-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--tf-border);
  word-break: break-word;
}

.desk-sync-change-label {
  font-weight: var(--tf-weight-strong);
}

.desk-sync-fields-collapsed > summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: var(--tf-weight-strong);
}

.desk-sync-reason-label {
  font-weight: var(--tf-weight-strong);
}

.desk-sync-reason-rule {
  font-size: var(--tf-text-md);
  color: var(--tf-text);
  margin: 4px 0 0;
}

/* TF-1103 (§B-13 row 22): the invoice-preview page. A preview never looks
   like a decision: no approve/reject colours, and the "cannot execute"
   badge sits under every heading. */
main#previews-root {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.desk-preview-card {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  background: var(--tf-surface);
}

.desk-preview-card:focus,
#previews-heading:focus,
.desk-preview-card-status:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

.desk-preview-badge {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 2px 8px;
  border: 1px solid var(--tf-warn);
  border-radius: 4px;
  color: var(--tf-warn);
  font-weight: var(--tf-weight-strong);
}

.desk-preview-recovery,
.desk-preview-problem {
  color: var(--tf-warn);
}

.desk-preview-fields,
.desk-preview-line,
.desk-preview-context {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 4px 12px;
  margin: 8px 0;
}

.desk-preview-fields dt,
.desk-preview-line dt,
.desk-preview-context dt {
  font-weight: var(--tf-weight-strong);
}

.desk-preview-fields dd,
.desk-preview-line dd,
.desk-preview-context dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.desk-preview-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.desk-preview-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.desk-preview-wrong {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desk-preview-wrong[hidden] {
  display: none;
}

select:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

.desk-preview-wrong select,
.desk-preview-wrong textarea {
  min-height: 44px;
  font-size: var(--tf-text-md);
}

.desk-preview-card .desk-link-button,
.desk-previews > .desk-link-button {
  min-height: 44px;
}

.desk-preview-reference summary {
  cursor: pointer;
  min-height: 44px;
  line-height: 44px;
}

@media (max-width: 480px) {
  .desk-preview-fields,
  .desk-preview-line,
  .desk-preview-context {
    grid-template-columns: 1fr;
  }

  .desk-preview-fields dd,
  .desk-preview-line dd,
  .desk-preview-context dd {
    margin-bottom: 6px;
  }
}

/* TF-1026 (§B-13 row 24): the shared-exceptions page. Read-only, so it uses no
   approve/reject colours and carries no decision control. */
main#shared-causes-root {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.desk-sc-status {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 1.5em;
}

.desk-sc-card {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  background: var(--tf-surface);
}

#shared-causes-heading:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

.desk-sc-cards {
  list-style: none;
  padding: 0;
  margin: 0;
}

.desk-sc-badge {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 2px 8px;
  border: 1px solid var(--tf-warn);
  border-radius: 4px;
  color: var(--tf-warn);
  font-weight: var(--tf-weight-strong);
}

.desk-sc-problem {
  color: var(--tf-warn);
}

.desk-sc-note {
  color: var(--tf-text);
}

.desk-sc-subheading {
  margin: 12px 0 4px;
  font-size: var(--tf-text-md);
}

.desk-sc-facts {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 4px 12px;
  margin: 8px 0;
}

.desk-sc-facts dt {
  font-weight: var(--tf-weight-strong);
}

.desk-sc-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .desk-sc-facts {
    grid-template-columns: 1fr;
  }

  .desk-sc-facts dd {
    margin-bottom: 6px;
  }
}

/* Desktop-class widening only — the mobile layout above is complete on
   its own and is never hidden behind this query. */
@media (min-width: 720px) {
  main#proposal-root {
    padding: 32px;
  }

  .desk-decision-actions > * {
    flex: 0 0 auto;
    min-width: 160px;
  }
}

/* TF-1379 (ADR-062 §9 S3): the raw action and target sit in a disclosure under the verified
   summary. The summary line is a real 44 px target; the values wrap anywhere so one long JSON
   target cannot widen the page. */
.desk-raw-details {
  margin: 12px 0;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 0 12px;
}

.desk-raw-details summary {
  cursor: pointer;
  min-height: 44px;
  line-height: 44px;
}

.desk-raw-list {
  margin: 0 0 12px;
}

.desk-raw-list dt {
  font-size: var(--tf-text-sm);
  color: var(--tf-text-muted);
}

.desk-raw-list dd {
  margin: 0 0 8px;
  max-height: 8em;
  overflow: auto;
  overflow-wrap: anywhere;
}

/* TF-1379: the setup-code field is 16 px type and a 44 px target. Under 16 px, iOS Safari zooms
   the whole page in when the field takes focus. The reason box below it is already 1rem. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px;
  font-size: var(--tf-text-md);
}

/* TF-936 (ADR-046 Amendment E §E-3.4): "Show a QR code for another device". The QR is a local
   SVG on a white square (the quiet zone is part of the drawing); it never scales past 20 rem, so a
   phone shows it whole and a laptop does not blow it up. */
.desk-add-device {
  margin: 16px 0;
}

.desk-qr-box {
  margin-top: 12px;
}

.desk-qr {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  margin: 0 0 12px;
  border: 1px solid var(--tf-border);
}

/* TF-955 (ADR-046 Amendment F §F-6.2): the owner-link panel on /setup. It sits above the device list;
   the target's name and email are plain text; the QR reuses the TF-936 rules above. */
.desk-owner-link {
  margin: 16px 0;
}

.desk-owner-link-target {
  margin: 12px 0;
}

.desk-owner-link-target[hidden] {
  display: none;
}

.desk-owner-link .desk-link-button {
  margin-left: 12px;
}

/* TF-1558 (TF-1033b): the grouped review panel on the proposal page. Phone first: one column, every
   control a 44 px target, long messages wrap rather than push the page sideways. */
.desk-grouped {
  border-top: 1px solid var(--tf-border);
  padding: 12px 16px 24px;
}

#grouped-toggle {
  width: 100%;
}

#grouped-toggle[hidden],
.desk-gr[hidden] {
  display: none;
}

.desk-gr {
  margin-top: 12px;
  max-width: 720px;
}

.desk-gr-status {
  min-height: 1.5em;
  margin: 0 0 8px;
}

.desk-gr-heading {
  margin: 8px 0;
  font-size: var(--tf-text-lg);
  overflow-wrap: anywhere;
}

.desk-gr-heading:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

.desk-gr-note,
.desk-gr-reason {
  color: var(--tf-text);
  overflow-wrap: anywhere;
}

.desk-gr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.desk-gr-row,
.desk-gr-member,
.desk-gr-outcome {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  background: var(--tf-surface);
}

.desk-gr-fields {
  border: 0;
  margin: 12px 0;
  padding: 0;
  min-width: 0;
}

.desk-gr-fields legend {
  font-weight: var(--tf-weight-strong);
  padding: 0;
}

.desk-gr-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}

.desk-gr-pick input[type="checkbox"] {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 10px 0 0;
}

.desk-gr-title {
  overflow-wrap: anywhere;
  padding-top: 10px;
}

.desk-gr-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}

.desk-gr-read summary,
.desk-gr-tech summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}

.desk-gr-own {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  color: var(--tf-focus);
}

.desk-gr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 0;
}

.desk-gr-actions button,
.desk-gr-signin {
  flex: 1 1 12rem;
}

.desk-gr-signin {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: var(--tf-focus);
  line-height: 24px;
}

/* --desk-warn is about 4.47:1 on the Desk background; this text is read in a state where the outcome matters. */
.desk-gr-problem {
  color: var(--tf-problem);
}

/* TF-1618: the panel's top is where the page scrolls to after a step, with a little air above it. After a refused check
   the picked requests stay listed in the problem box, in the page's ordinary ink, each with its own link. */
#grouped-root {
  scroll-margin-top: 8px;
}

.desk-gr-picked {
  color: var(--tf-text);
  margin-top: 12px;
}

.desk-gr-above {
  border-left: 3px solid var(--tf-border);
  padding-left: 12px;
}

.desk-gr-lead,
.desk-gr-headline {
  font-weight: var(--tf-weight-strong);
  margin: 4px 0;
}

.desk-gr-outcome-unknown,
.desk-gr-outcome-failed,
.desk-gr-outcome-pending {
  border-color: var(--tf-warn);
}

.desk-gr-view[aria-busy="true"] {
  opacity: 0.85;
}

@media (max-width: 480px) {
  .desk-gr-actions button,
  .desk-gr-signin {
    flex-basis: 100%;
  }
}

/* TF-1619: the demo box's invoice step on the Invoice previews page. It reuses the preview card's look; only the
   decision link needs its own rule (a link styled as the Desk's button, with the 44px target the buttons have). */
.desk-demo-step a.desk-btn {
  display: inline-block;
  text-decoration: none;
  line-height: 24px;
}

.desk-demo-step a.desk-btn-approve {
  color: var(--tf-primary-text);
}

.desk-demo-step-body p {
  margin: 8px 0;
}

.desk-preview-jump {
  display: inline-block;
  margin: 0 0 8px;
  padding: 12px 0;
  min-height: 24px;
}

.desk-demo-step:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

/* TF-1707: the Owner promotion pages (target and issuer), built by owner_promotion_desk.js, loaded by the two Desk shells (TF-1631, owner_promotion_shell.py).
   Same 44px targets and 3px focus ring as every other Desk control; the status block takes focus (tabindex -1) when the control
   a person was on is replaced, so a redraw never drops the keyboard on the page. */
[data-owner-promotion-body] {
  max-width: 36rem;
  margin: 0 auto;
  padding: 16px;
}

[data-owner-promotion-body]:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

[data-owner-promotion-body] h1 {
  font-size: var(--tf-text-xl);
  margin: 0 0 12px;
}

[data-owner-promotion-body] p {
  margin: 8px 0;
}

.owner-promotion-keys {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  margin: 12px 0;
  padding: 8px 12px;
}

.owner-promotion-keys-legend {
  margin: 0 0 4px;
  font-weight: var(--tf-weight-strong);
  padding: 0 4px;
}

.owner-promotion-key {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.owner-promotion-key input {
  width: 24px;
  height: 24px;
  flex: none;
}

.owner-promotion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 16px;
}

[data-owner-promotion-notice] {
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

@media (max-width: 480px) {
  .owner-promotion-actions button {
    flex-basis: 100%;
  }
}

#owner-promotion-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* TF-1540: the drafted public review reply above the proposal's detail. The customer's words and the reply are drawn with
   textContent and kept in their own line breaks; a character that does not show is drawn as a visible mark. */
.desk-rr {
  max-width: 720px;
  margin: 16px auto;
  padding: 16px;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  background: var(--tf-surface);
}

.desk-rr[hidden] {
  display: none;
}

.desk-rr h2 {
  margin: 0 0 8px;
  font-size: var(--tf-text-lg);
}

.desk-rr-subhead {
  margin: 16px 0 4px;
  font-size: var(--tf-text-md);
}

.desk-rr-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--tf-border);
  border-radius: 4px;
  background: var(--tf-page);
  unicode-bidi: plaintext;
}

.desk-rr-empty {
  font-style: italic;
}

.desk-rr-mark {
  padding: 0 2px;
  border: 1px solid var(--tf-warn);
  border-radius: 3px;
  color: var(--tf-warn);
  font-family: var(--tf-font-sans);
  font-size: var(--tf-text-sm);
  font-variant-numeric: tabular-nums;
}

.desk-rr-note {
  margin: 12px 0 0;
  font-size: var(--tf-text-sm);
}

.desk-rr-problem {
  margin: 0 0 12px;
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

/* TF-1608: the first-use usage sentence (ADR-061 Amendment A A-9), the footing of the signed-in page and the proposal page. */
.desk-usage-notice {
  margin: 16px 0 0;
  padding: 0 16px;
  font-size: var(--tf-text-sm);
  line-height: 1.4;
  color: var(--tf-text-muted);
  box-sizing: border-box;
  max-width: calc(100vw - 32px);
}
.desk-terminal .desk-usage-notice {
  padding: 0;
}

/* TF-1711: the one-email recipient setup page, built by recipient_setup_desk.js and loaded by the Desk shell at /join/continue (TF-1712).
   One column at every width: 16px gutters, text at least 16px, 44px targets (the global button rule already sets them; the back link
   gets the same), the address and the workspace name wrap anywhere, and the current step is marked by text and aria-current, never
   by colour alone. Only the Desk's own tokens are used. Nothing here animates. */
[data-recipient-setup-body] {
  box-sizing: border-box;
  max-width: 36rem;
  margin: 0 auto;
  padding: 16px;
  font-size: var(--tf-text-md);
  overflow-wrap: anywhere;
}

[data-recipient-setup-body] h1 {
  font-size: var(--tf-text-xl);
  margin: 0 0 12px;
}

[data-recipient-setup-body] h1:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}

[data-recipient-setup-body] p {
  margin: 8px 0;
  font-size: var(--tf-text-md);
}

.recipient-setup-steps {
  margin: 16px 0;
  padding-left: 28px;
}

.recipient-setup-steps li {
  margin: 4px 0;
  min-height: 24px;
}

.recipient-setup-steps li[aria-current="step"] {
  font-weight: var(--tf-weight-strong);
  border-left: 4px solid var(--tf-focus);
  margin-left: -12px;
  padding-left: 8px;
}

[data-recipient-setup-alert] {
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

.recipient-setup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 16px;
}

.recipient-setup-actions .desk-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.recipient-setup-actions button[aria-disabled="true"] {
  background: var(--tf-surface-subtle);
  border-color: var(--tf-border);
  color: var(--tf-text-muted);
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .recipient-setup-actions button,
  .recipient-setup-actions .desk-back-link {
    flex-basis: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-recipient-setup-body] * {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}

#recipient-setup-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The shell ships the back link hidden; the link's own display rule would otherwise show it before the page draws it. */
#recipient-setup-back[hidden] {
  display: none;
}

/* TF-1811 (ADR-060 4.3): the budget banner. #budget-banner is a live region the proposal, previews and shared-exceptions pages ship
   empty; budget_banner.js fills it, and :empty keeps it out of the layout when the box has no router, the budget is fine, or the
   reading is unknown. Three tones, told apart by a left rule as well as by colour: the text carries the meaning, never the colour
   alone. */
.desk-budget-banner {
  padding: 10px 16px;
  background: var(--tf-surface-subtle);
  color: var(--tf-text);
  border-bottom: 1px solid var(--tf-border);
  border-left: 4px solid var(--tf-border);
  font-size: var(--tf-text-md);
}

.desk-budget-banner:empty {
  display: none;
}

.desk-budget-banner[data-budget-tone="degraded"] {
  border-left-color: var(--tf-warn);
}

.desk-budget-banner[data-budget-tone="paused"] {
  border-left-color: var(--tf-problem);
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

/* TF-1971 (RR-1b, D-A): the owner's "Coming due" renewals panel (renewals_panel.js) on the invoice-previews page. #renewals-panel is a live
   region the page ships empty; the script fills it, and :empty keeps it out of the layout for everyone the Cockpit does not show the list to.
   Information only: it holds no control. Overdue is told by the word in the line and by weight and a left rule, never by colour alone. */
.desk-renewals {
  padding: 10px 16px;
  background: var(--tf-surface-subtle);
  color: var(--tf-text);
  border-bottom: 1px solid var(--tf-border);
  font-size: var(--tf-text-md);
  line-height: 1.5;
}

.desk-renewals:empty {
  display: none;
}

.desk-renewals-title {
  margin: 0 0 0.25rem;
  font-size: var(--tf-text-lg);
}

.desk-renewals-intro,
.desk-renewals-note {
  margin: 0 0 0.5rem;
  color: var(--tf-text);
}

.desk-renewals-note {
  margin: 0;
}

.desk-renewals-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.desk-renewals-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  margin: 0 0 0.25rem;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 4px solid var(--tf-border);
  overflow-wrap: anywhere;
}

.desk-renewals-item--due-soon {
  border-left-color: var(--tf-warn);
}

.desk-renewals-item--overdue {
  border-left-color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

.desk-renewals-name {
  font-weight: var(--tf-weight-strong);
}

/* TF-410 (ADR-046 §B-13 row 30): the "Send a request" button and the Cockpit's form dialog (report_issue.js) on the proposal, previews and
   shared-exceptions pages. The dialog is drawn by the shared module with its own class names, so they are styled here with the Desk's
   own tokens and the same shapes as cockpit/web/style.css: one column at every width, 44px targets, text at least 16px, a visible
   focus ring, and no colour that carries meaning alone. The footer sits under the page's own content and is hidden until the module mounts. */
.desk-report {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 16px 16px;
}
.desk-report [hidden] {
  display: none;
}
/* TF-2178: the footer is the page's "Help & Support" section, the destination of the header link; its heading takes focus when the
   link is followed (report_issue_desk.js), so the ring shows for that focus too. */
.desk-report {
  border-top: 1px solid var(--tf-border);
  padding-top: 8px;
}
.desk-help-heading {
  margin: 8px 0 4px;
  font-size: var(--tf-text-md);
}
.desk-help-heading:focus {
  outline: 3px solid var(--tf-focus);
  outline-offset: 3px;
}
.desk-help-more,
.desk-help-context {
  margin: 8px 0 0;
}
.desk-help-more a,
.desk-help-context a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tf-focus);
  font-weight: var(--tf-weight-strong);
  text-decoration: underline;
}
.desk-help-more a:focus-visible,
.desk-help-context a:focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 2px;
}
/* TF-2178: on a narrow phone the header wraps, so the brand keeps the first line and Help & Support stays above the content. */
@media (max-width: 480px) {
  .desk-header {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}
.problem-report-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  background: var(--tf-page);
  color: var(--tf-text);
}
.problem-report-dialog::backdrop {
  background: var(--tf-scrim);
}
.problem-report-dialog textarea {
  display: block;
  width: 100%;
  margin: 4px 0 12px;
  font: inherit;
  font-size: var(--tf-text-md);
  resize: vertical;
}
.report-issue-dialog h2 { margin: 0 0 8px; }
.report-issue-dialog p { margin: 0 0 12px; }
.report-issue-form { display: block; }
.report-issue-fieldset { margin: 0 0 12px; padding: 0; border: 0; }
.report-issue-fieldset legend { padding: 0; font-weight: var(--tf-weight-strong); }
.report-issue-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.report-issue-field label { font-weight: var(--tf-weight-strong); }
.report-issue-preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 0; margin: 0 0 16px; }
.report-issue-preview dt { margin-top: 8px; font-weight: var(--tf-weight-strong); }
.report-issue-preview dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-issue-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; }
.report-issue-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tf-border-strong);
  border-radius: 6px;
  background: var(--tf-page);
  color: var(--tf-text);
  font: inherit;
  cursor: pointer;
}
.report-issue-primary { border-color: var(--tf-primary); background: var(--tf-primary); color: var(--tf-primary-text); } /* R16: blue is links and focus only */
.report-issue-button:disabled { background: var(--tf-surface-subtle); color: var(--tf-text-muted); cursor: default; }
.report-issue-status { min-height: 1.4em; margin: 0; }
.problem-report-dialog :focus-visible {
  outline: 3px solid var(--tf-focus);
  outline-offset: 3px;
}

/* TF-1966 phase 4: the receipt photo and the correction form beside a receipt expense. Text only; the photo is a same-origin image. */
.desk-rv {
  max-width: 720px;
  margin: 16px auto;
  padding: 16px;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  background: var(--tf-surface);
}

.desk-rv[hidden] {
  display: none;
}

.desk-rv h2 {
  margin: 0 0 8px;
  font-size: var(--tf-text-lg);
}

.desk-rv-photo {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  margin: 0 auto 8px;
  border: 1px solid var(--tf-border);
  border-radius: 4px;
  background: var(--tf-page);
}

.desk-rv-note {
  margin: 8px 0;
  font-size: var(--tf-text-sm);
}

.desk-rv-problem {
  margin: 0 0 12px;
  color: var(--tf-problem);
  font-weight: var(--tf-weight-strong);
}

.desk-rv-success {
  margin: 0 0 12px;
  font-weight: var(--tf-weight-strong);
}

.desk-rv-form-host {
  margin-top: 12px;
}

.desk-rv-row {
  margin: 0 0 12px;
}

.desk-rv-label {
  display: block;
  margin: 0 0 4px;
  font-size: var(--tf-text-md);
  font-weight: var(--tf-weight-strong);
}

.desk-rv-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  border: 1px solid var(--tf-border-strong);
  border-radius: 4px;
}

.desk-rv-input[aria-invalid="true"] {
  border-color: var(--tf-problem);
}

.desk-rv-field-error {
  margin: 4px 0 0;
  font-size: var(--tf-text-sm);
  color: var(--tf-problem);
}

.desk-rv-field-error[hidden] {
  display: none;
}

.desk-rv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.desk-rv-status {
  min-height: 1.2em;
}

/* The sign-in chooser (`GET /login` on a Desk with Microsoft sign-in): one centred card, the product's own microlabel and
   heading, then the two provider buttons built to each provider's own button guidelines. The provider colours below are
   Google's and Microsoft's requirements, reproduced literally like the Cockpit's sign-in page does (`cockpit/web/style.css`
   `.provider-button`), not True Fix tokens: white surface, the provider's border and text colour and logo, whatever the
   page's appearance. The two id rules are scoped to the chooser card because the admission refusal page reuses the id
   `desk-signin-microsoft` on a plain text link, which must keep the page's own link colour. Each button is a full-width 44px target with the same focus ring as every control. */
.desk-signin-chooser {
  max-width: 26rem;
  margin: var(--tf-space-6) auto 0;
  padding: var(--tf-space-5) var(--tf-space-5) var(--tf-space-6);
  background: var(--tf-surface);
  border-radius: var(--tf-radius-panel);
  box-shadow: var(--tf-shadow-raised);
  text-align: center;
}

.desk-signin-chooser h1 {
  margin: 0 0 var(--tf-space-2);
  font-size: var(--tf-text-2xl);
  line-height: var(--tf-leading-tight);
}

.desk-signin-microlabel {
  margin: 0 0 var(--tf-space-2);
  font-size: var(--tf-text-sm);
  font-weight: var(--tf-weight-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tf-text-muted);
}

.desk-signin-lede {
  margin: 0 0 var(--tf-space-5);
  color: var(--tf-text-muted);
}

.desk-signin-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 var(--tf-space-3);
  padding: 10px 16px;
  background: #ffffff;
  text-decoration: none;
}

.desk-signin-option:hover {
  background: #f6f6f6;
  box-shadow: var(--tf-shadow-raised);
}

.desk-signin-chooser #desk-signin-google {
  border-color: #747775;
  color: #1f1f1f;
}

.desk-signin-chooser #desk-signin-microsoft {
  border-color: #8c8c8c;
  color: #5e5e5e;
}

.desk-signin-logo {
  flex: 0 0 auto;
  display: block;
}

.desk-signin-chooser .desk-help-context {
  margin: var(--tf-space-5) 0 0;
}
