/*
 * Recon on Sneat (ADR 0071, docs/ui/THEME.md). Loaded after vendor/sneat/core.css, on every Recon page.
 *
 * 1. Tokens: what Recon changes in Sneat's palette, and Recon's own variables.
 * 2. Dark mode: Sneat's free version is light only; this is Recon's dark, on Bootstrap's colour modes.
 * 3. Recon's own components (#268): only what Bootstrap and Sneat don't have, built from their variables.
 *
 * Every colour here is a token, so the components follow the colour mode. Text pairs meet WCAG AA in both
 * modes; ThemeTokensTests checks them.
 */

/* ---- 1. Tokens ------------------------------------------------------------------------- */

:root,
[data-bs-theme=light] {
  /* Secondary text and links, a shade darker than Sneat's, for AA on white (Sneat's are 2.3:1 and 4.05:1). */
  --bs-secondary-color: #6f7780;
  --bs-secondary-color-rgb: 111, 119, 128;
  --bs-link-color: #5f61e6;
  --bs-link-color-rgb: 95, 97, 230;
  --bs-link-hover-color: #4b4dcc;
  --bs-link-hover-color-rgb: 75, 77, 204;
  --bs-custom-link-color: var(--bs-link-color);

  /* Soft badges' text (bg-label-*): Bootstrap's emphasis shades, for AA on their tint. */
  --recon-label-primary: #2a2b66;
  --recon-label-secondary: #353a41;
  --recon-label-success: #2d5816;
  --recon-label-info: #014e5e;
  --recon-label-warning: #664400;
  --recon-label-danger: #66190c;
  --recon-label-dark: #353a41;

  /* Code, ids and commands. */
  --recon-mono: var(--bs-font-monospace);
  --recon-mono-size: 0.8125rem;

  /* Code in a diff (#277): keywords, strings, comments, numbers and literals, each AA on the page. */
  --recon-code-key: #7a2a9f;
  --recon-code-str: #0b6b3a;
  --recon-code-com: #646d78;
  --recon-code-num: #9a4100;
  --recon-code-lit: #1f5fbf;

  /* Buttons (#279): Sneat's, a shade darker where its text missed AA (white on primary was 4.05:1, on danger 3.5:1;
     the outline buttons' text 3.2 and 3.5:1). */
  --recon-btn-primary: #5f61e6;
  --recon-btn-primary-hover: #5456cc;
  --recon-btn-danger: #d43217;
  --recon-btn-danger-hover: #b92c14;
  --recon-btn-outline-secondary: #646c75;
  --recon-btn-outline-danger: #c42f15;
}

/* ---- 2. Dark mode ---------------------------------------------------------------------- */
/* theme.js sets data-bs-theme from the device, before the page draws. Bootstrap's dark block in core.css gives the
   base; this adds what Sneat builds its components from: the paper, the base colour, shadows, menu and navbar. */

[data-bs-theme=dark] {
  --bs-body-bg: #232333;
  --bs-body-bg-rgb: 35, 35, 51;
  --bs-body-color: #b2b2c4;
  --bs-body-color-rgb: 178, 178, 196;
  --bs-heading-color: #d5d5e2;
  --bs-emphasis-color: #e6e6f1;
  --bs-emphasis-color-rgb: 230, 230, 241;
  --bs-secondary-color: #a1a2b5;
  --bs-secondary-color-rgb: 161, 162, 181;
  --bs-secondary-bg: #3a3b52;
  --bs-secondary-bg-rgb: 58, 59, 82;
  --bs-tertiary-bg: #323349;
  --bs-tertiary-bg-rgb: 50, 51, 73;
  --bs-border-color: #444564;
  --bs-border-color-translucent: rgba(230, 230, 241, 0.12);
  --bs-link-color: #8f91ff;
  --bs-link-color-rgb: 143, 145, 255;
  --bs-link-hover-color: #abacff;
  --bs-link-hover-color-rgb: 171, 172, 255;
  --bs-custom-link-color: var(--bs-link-color);
  --bs-code-color: #f38cbd;

  --bs-base-color: #e6e6f1;
  --bs-base-color-rgb: 230, 230, 241;
  --bs-paper-bg: #2b2c40;
  --bs-paper-bg-rgb: 43, 44, 64;
  --bs-box-shadow: 0 0.1875rem 0.5rem 0 rgba(0, 0, 0, 0.3);
  --bs-box-shadow-xs: 0 0.0625rem 0.3175rem 0 rgba(0, 0, 0, 0.2);
  --bs-box-shadow-sm: 0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.25);
  --bs-box-shadow-lg: 0 0.25rem 0.75rem 0 rgba(0, 0, 0, 0.35);
  --bs-box-shadow-xl: 0 0.3125rem 1.375rem 0 rgba(0, 0, 0, 0.4);
  --bs-floating-component-shadow: 0 0.1875rem 0.5rem 0 rgba(0, 0, 0, 0.3);
  --bs-navbar-box-shadow: 0 0 10px #1a1b28;

  --bs-menu-color: #d5d5e2;
  --bs-menu-color-rgb: 213, 213, 226;
  --bs-menu-hover-bg: #34354d;
  --bs-menu-hover-color: #e6e6f1;
  --bs-menu-active-toggle-bg: #3a3b52;
  --bs-menu-box-shadow: 0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.3);
  --bs-menu-divider-color: #444564;

  /* Soft badges' text: lighter shades, for AA on their dark tint. */
  --recon-label-primary: #b4b5ff;
  --recon-label-secondary: #c3cad3;
  --recon-label-success: #8fe55f;
  --recon-label-info: #4dd4f1;
  --recon-label-warning: #ffc44d;
  --recon-label-danger: #ff9a87;
  --recon-label-dark: #c3cad3;

  /* Code in a diff: the same roles, light on dark. */
  --recon-code-key: #d2a8ff;
  --recon-code-str: #7ee787;
  --recon-code-com: #9ea7b3;
  --recon-code-num: #ffa657;
  --recon-code-lit: #79c0ff;

  /* Buttons: the solid ones keep white text on the same shades; the outline ones' text is lighter. */
  --recon-btn-primary: #5f61e6;
  --recon-btn-primary-hover: #5456cc;
  --recon-btn-danger: #d43217;
  --recon-btn-danger-hover: #b92c14;
  --recon-btn-outline-secondary: #a1a2b5;
  --recon-btn-outline-danger: #ff7a63;
}

.bg-label-primary { color: var(--recon-label-primary) !important; }
.bg-label-secondary { color: var(--recon-label-secondary) !important; }
.bg-label-success { color: var(--recon-label-success) !important; }
.bg-label-info { color: var(--recon-label-info) !important; }
.bg-label-warning { color: var(--recon-label-warning) !important; }
.bg-label-danger { color: var(--recon-label-danger) !important; }
.bg-label-dark { color: var(--recon-label-dark) !important; }

/* Alerts: the same text shades and tint as soft badges, so their text meets AA in both modes (Sneat's is the bright
   level colour itself: 1.6 to 3:1). */
.alert-primary { --bs-alert-color: var(--recon-label-primary); --bs-alert-link-color: var(--recon-label-primary); --bs-alert-link-hover-color: var(--recon-label-primary); --bs-alert-close-icon: var(--recon-label-primary); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-primary)); }
.alert-secondary { --bs-alert-color: var(--recon-label-secondary); --bs-alert-link-color: var(--recon-label-secondary); --bs-alert-link-hover-color: var(--recon-label-secondary); --bs-alert-close-icon: var(--recon-label-secondary); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-secondary)); }
.alert-success { --bs-alert-color: var(--recon-label-success); --bs-alert-link-color: var(--recon-label-success); --bs-alert-link-hover-color: var(--recon-label-success); --bs-alert-close-icon: var(--recon-label-success); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-success)); }
.alert-info { --bs-alert-color: var(--recon-label-info); --bs-alert-link-color: var(--recon-label-info); --bs-alert-link-hover-color: var(--recon-label-info); --bs-alert-close-icon: var(--recon-label-info); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-info)); }
.alert-warning { --bs-alert-color: var(--recon-label-warning); --bs-alert-link-color: var(--recon-label-warning); --bs-alert-link-hover-color: var(--recon-label-warning); --bs-alert-close-icon: var(--recon-label-warning); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-warning)); }
.alert-danger { --bs-alert-color: var(--recon-label-danger); --bs-alert-link-color: var(--recon-label-danger); --bs-alert-link-hover-color: var(--recon-label-danger); --bs-alert-close-icon: var(--recon-label-danger); --bs-alert-bg: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-danger)); }

/* Buttons whose text meets AA in both modes (#279): the standard's variants, on the tokens above. */
.btn-primary { --bs-btn-bg: var(--recon-btn-primary); --bs-btn-border-color: var(--recon-btn-primary); --bs-btn-hover-bg: var(--recon-btn-primary-hover); --bs-btn-hover-border-color: var(--recon-btn-primary-hover); --bs-btn-active-bg: var(--recon-btn-primary-hover); --bs-btn-active-border-color: var(--recon-btn-primary-hover); }
.btn-danger { --bs-btn-bg: var(--recon-btn-danger); --bs-btn-border-color: var(--recon-btn-danger); --bs-btn-hover-bg: var(--recon-btn-danger-hover); --bs-btn-hover-border-color: var(--recon-btn-danger-hover); --bs-btn-active-bg: var(--recon-btn-danger-hover); --bs-btn-active-border-color: var(--recon-btn-danger-hover); }
.btn-outline-secondary { --bs-btn-color: var(--recon-btn-outline-secondary); }
.btn-outline-danger { --bs-btn-color: var(--recon-btn-outline-danger); --bs-btn-border-color: var(--recon-btn-outline-danger); --bs-btn-hover-bg: var(--recon-btn-danger); --bs-btn-hover-border-color: var(--recon-btn-danger); --bs-btn-active-bg: var(--recon-btn-danger-hover); --bs-btn-active-border-color: var(--recon-btn-danger-hover); }

/* Motion is meaning: only what's live animates, and not at all for those who ask. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---- 3. Recon's own components (#268) -------------------------------------------------- */
/* Only what Bootstrap and Sneat don't have; each is in docs/ui/THEME.md, with an example on /ops/theme. Every one
   is named recon-*, so a view's classes say which are Bootstrap's and which are Recon's. */

/* Page header: an eyebrow, the title, a lede, and the page's actions on the right. */
.recon-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.recon-page-head h1 { font-size: 1.5rem; line-height: 2rem; margin-bottom: 0.25rem; }
.recon-page-head p { color: var(--bs-secondary-color); max-width: 46rem; margin: 0; }
.recon-eyebrow { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bs-link-color); margin-bottom: 0.35rem; }
.recon-eyebrow a { color: inherit; }

/* A card's header: its title and a line about it on the left, its actions on the right (with .card-header). */
.recon-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.recon-card-head h2, .recon-card-head h3 { font-size: 1.125rem; margin: 0 0 0.25rem; }
.recon-card-head p { color: var(--bs-secondary-color); margin: 0; max-width: 44rem; }
/* Tabs keep each label on one line: a wrapped one is taller than its neighbours. */
.nav-tabs .nav-link { white-space: nowrap; }

/* A segmented control: a few views of one thing (Reports' reports, Pull Review's lists), side by side in a track with
   the current one raised. Always one row: on a narrow screen the track scrolls sideways rather than stacking.
   Not Sneat's pills, which stretch each link to the full width. Links carry aria-current or aria-selected. */
.recon-segmented {
  display: inline-flex; flex-wrap: nowrap; gap: 0.25rem; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  padding: 0.25rem; border-radius: var(--bs-border-radius-lg);
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
}
.recon-segmented::-webkit-scrollbar { display: none; }
.recon-segmented .nav-link {
  flex: none; white-space: nowrap; padding: 0.4rem 0.9rem; border-radius: var(--bs-border-radius);
  font-size: 0.875rem; font-weight: 500; color: var(--bs-secondary-color);
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.recon-segmented .nav-link:hover, .recon-segmented .nav-link:focus-visible { color: var(--bs-heading-color); }
.recon-segmented .nav-link.active {
  background: var(--bs-paper-bg); color: var(--bs-link-color); font-weight: 600;
  box-shadow: 0 0.0625rem 0.25rem rgba(var(--bs-black-rgb), 0.12);
}
[data-bs-theme="dark"] .recon-segmented .nav-link.active { box-shadow: 0 0.0625rem 0.25rem rgba(0, 0, 0, 0.4); }
/* A step the person is past, folded to its heading: section.card.recon-folded, opened by its button[data-fold]; the heading's other actions ([data-fold-with]) show only once it's open. */
.recon-folded > :not(.card-header), .recon-folded > .card-header [data-fold-with] { display: none; }
.recon-folded > .card-header { padding-bottom: 1.5rem; }
/* A choice between ways of working (#424): button.recon-choice cards in a div.recon-choices, one pressed at a time
   (aria-pressed); one that isn't built yet is aria-disabled, and says so in a badge. */
.recon-choices { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.recon-choice {
  display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 1rem 1.25rem; text-align: left;
  border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg);
  background: var(--bs-paper-bg); color: var(--bs-body-color); transition: background-color 0.15s, border-color 0.15s;
}
.recon-choice:hover, .recon-choice:focus-visible { border-color: var(--bs-primary); }
.recon-choice[aria-pressed="true"] { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.recon-choice[aria-disabled="true"] { opacity: 0.65; cursor: not-allowed; }
.recon-choice[aria-disabled="true"]:hover { border-color: var(--bs-border-color); }
.recon-choice-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--bs-heading-color); }
/* The card for the step a person is on: the primary colour's ring. */
.recon-card-current { border: 1px solid var(--bs-primary) !important; box-shadow: 0 0 0 3px var(--bs-primary-bg-subtle) !important; }

/* Cards in a grid that fills the width. */
.recon-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin-bottom: 1.5rem; }

/* Actions in a row: buttons, links and inline forms, wrapping as needed. */
.recon-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Headline numbers: a grid of stat cards. The value takes a level's colour with .recon-stat-ok, -warn or -bad. */
.recon-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.recon-stat-label { display: block; color: var(--bs-secondary-color); font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.recon-stat-value { display: block; color: var(--bs-heading-color); font-size: 1.75rem; font-weight: 600; line-height: 1.2; margin: 0.25rem 0; }
.recon-stat-sub { display: block; color: var(--bs-secondary-color); font-size: 0.8125rem; }
.recon-stat-ok .recon-stat-value { color: var(--recon-label-success); }
.recon-stat-warn .recon-stat-value { color: var(--recon-label-warning); }
.recon-stat-bad .recon-stat-value { color: var(--recon-label-danger); }

/* A key-value list: terms on the left, values on the right; one column on a phone. */
.recon-kv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.recon-kv dt { color: var(--bs-secondary-color); font-weight: 400; }
.recon-kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) { .recon-kv { grid-template-columns: 1fr; gap: 0.15rem 0; } .recon-kv dd { margin-bottom: 0.5rem; } }

/* Nothing to show yet. */
.recon-empty { text-align: center; padding: 2rem 1rem; color: var(--bs-secondary-color); border: 1px dashed var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg); }
.recon-empty h3 { color: var(--bs-heading-color); font-size: 1.125rem; }

/* A second line under a value (in tables, lists and labels). */
.recon-sub { display: block; color: var(--bs-secondary-color); font-size: 0.8125rem; overflow-wrap: anywhere; }

/* A value shown once: a token, an enrolment key, an invitation link. Selected whole with one click. */
.recon-secret { border: 1.5px dashed var(--bs-primary); background: var(--bs-primary-bg-subtle); border-radius: var(--bs-border-radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.recon-secret-label { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--recon-label-primary); margin-bottom: 0.35rem; }
.recon-secret-value { display: block; font-family: var(--recon-mono); font-size: var(--recon-mono-size); word-break: break-all; background: var(--bs-paper-bg); color: var(--bs-heading-color); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 0.65rem 0.75rem; margin: 0.5rem 0; user-select: all; }

/* A command to copy into a terminal: light on dark in both modes, as a terminal is. */
.recon-command { display: block; font-family: var(--recon-mono); font-size: var(--recon-mono-size); line-height: 1.5; white-space: pre-wrap; word-break: break-all; background: #22303e; color: #e6e6f1; border-radius: var(--bs-border-radius); padding: 0.6rem 0.8rem; margin: 0.4rem 0; user-select: all; }

/* Numbered steps: a guided setup, one action per step. */
.recon-steps { list-style: none; counter-reset: recon-step; margin: 0; padding: 0; }
.recon-steps > li { counter-increment: recon-step; position: relative; padding: 0 0 1.25rem 2.75rem; }
.recon-steps > li:last-child { padding-bottom: 0; }
.recon-steps > li::before { content: counter(recon-step); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.8125rem; font-weight: 600; background: var(--bs-primary-bg-subtle); color: var(--recon-label-primary); }
.recon-steps h3 { margin: 0.2rem 0 0.35rem; font-size: 1rem; }
.recon-steps p { margin: 0 0 0.45rem; color: var(--bs-secondary-color); }

/* A track: a guided flow across pages, each step done, current or to come; .recon-track-compact on a card. */
.recon-track { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0 0 1.5rem; padding: 0; counter-reset: recon-track; }
.recon-track > li { counter-increment: recon-track; position: relative; text-align: center; padding: 2.6rem 0.5rem 0; min-width: 0; }
.recon-track > li::before { content: counter(recon-track); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.875rem; font-weight: 600; background: var(--bs-secondary-bg); color: var(--bs-secondary-color); border: 2px solid var(--bs-paper-bg); }
.recon-track > li:not(:last-child)::after { content: ""; position: absolute; top: 1rem; left: calc(50% + 1.1rem); right: calc(-50% + 1.1rem); height: 2px; background: var(--bs-border-color); }
.recon-track > li.recon-track-done::before { content: "\2713"; background: var(--bs-success); color: #fff; }
.recon-track > li.recon-track-done:not(:last-child)::after { background: var(--bs-success); }
.recon-track > li.recon-track-current::before { background: var(--bs-primary); color: #fff; box-shadow: 0 0 0 4px var(--bs-primary-bg-subtle); }
.recon-track > li.recon-track-bad::before { content: "!"; background: var(--bs-danger); color: #fff; }
.recon-track a { color: inherit; }
.recon-track a:hover .recon-track-name { text-decoration: underline; }
.recon-track-name { display: block; font-weight: 600; color: var(--bs-heading-color); }
.recon-track-state { display: block; font-size: 0.8125rem; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.recon-track-current .recon-track-name { color: var(--bs-link-color); }
.recon-track-compact { margin: 0.5rem 0 0.75rem; }
.recon-track-compact > li { padding-top: 2rem; }
.recon-track-compact > li::before { width: 1.5rem; height: 1.5rem; font-size: 0.75rem; }
.recon-track-compact > li:not(:last-child)::after { top: 0.75rem; left: calc(50% + 0.85rem); right: calc(-50% + 0.85rem); }
.recon-track-compact .recon-track-name { font-size: 0.8125rem; }
@media (max-width: 40rem) {
  .recon-track { grid-auto-flow: row; }
  .recon-track > li { text-align: left; padding: 0 0 1rem 2.75rem; }
  .recon-track > li::before { left: 0; transform: none; }
  .recon-track > li:not(:last-child)::after { top: 2.1rem; bottom: 0.2rem; left: calc(1rem - 1px); right: auto; width: 2px; height: auto; }
}

/* A status dot on its own (tables, compact rows), and a badge with one; .recon-live pulses for a live connection. */
.recon-dot { display: inline-block; width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--bs-secondary); flex: none; vertical-align: middle; }
.recon-dot-success { background: var(--bs-success); }
.recon-dot-warning { background: var(--bs-warning); }
.recon-dot-danger { background: var(--bs-danger); }
.recon-dot-info { background: var(--bs-info); }
.recon-dot-primary { background: var(--bs-primary); }
.badge.recon-badge-dot::before { content: ""; display: inline-block; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; margin-right: 0.35rem; vertical-align: 0.05em; }
.badge.recon-live::before { animation: recon-pulse 2.2s ease-out infinite; }
@keyframes recon-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* A part of a card shown on request: a details element whose summary is a button, with a chevron. No script. */
.recon-disclosure { margin-top: 1rem; }
.recon-disclosure > summary { list-style: none; display: inline-flex; }
.recon-disclosure > summary::-webkit-details-marker { display: none; }
.recon-disclosure > summary::after { content: ""; width: 0.35rem; height: 0.35rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 0.5rem; align-self: center; }
.recon-disclosure[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.recon-disclosure-body { margin-top: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }

/* Forms: fields in a column with Bootstrap's controls; .recon-form-row puts fields side by side, aligned by label. */
.recon-form { display: grid; gap: 1rem; max-width: 34rem; }
.recon-form-wide { max-width: 48rem; }
.recon-form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.recon-form-row .recon-field { flex: 1 1 14rem; align-self: flex-start; }
.recon-field { display: grid; gap: 0.25rem; margin: 0; }
.recon-field > .form-label { margin-bottom: 0; }
.recon-form fieldset { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); padding: 1rem 1.1rem; margin: 0; display: grid; gap: 1rem; }
.recon-form legend { float: none; width: auto; font-size: 0.9375rem; font-weight: 600; color: var(--bs-heading-color); padding: 0 0.4rem; margin: 0; }

/* A setting with its current value and the control to change it. */
.recon-setting { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.85rem 1rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: var(--bs-body-bg); }

/* Pickers: a search over a list of people or repositories, each row with a tick and what goes with it. */
.recon-picker { display: grid; gap: 0.75rem; }
.recon-picker-search { flex: 1 1 18rem; }
.recon-picker-count { margin: 0 0 0.6rem; }
.recon-picker-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); max-height: 22rem; overflow-y: auto; background: var(--bs-paper-bg); }
.recon-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.8rem; border-top: 1px solid var(--bs-border-color); }
.recon-picker-row:first-child { border-top: 0; }
.recon-picker-row:hover { background: var(--bs-body-bg); }
.recon-picker-row .form-select { width: auto; min-width: 9rem; }
.recon-picker-who { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; min-width: 0; margin: 0; }
.recon-picker-who .form-check-input { flex: none; margin: 0; }
@media (max-width: 34rem) { .recon-picker-row { flex-wrap: wrap; } .recon-picker-row .form-select { width: 100%; } }
.recon-picker-combo { position: relative; }
.recon-picker-list.recon-picker-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem); z-index: 20; max-height: 18rem; box-shadow: var(--bs-box-shadow-lg); }
.recon-picker-dropdown .recon-picker-row:focus-within, .recon-picker-dropdown .recon-picker-row[aria-selected="true"] { background: var(--bs-body-bg); }

/* Tables outside a card get a card's edge; numbers line up on the right; rows can be grouped with subtotals. */
.recon-table-wrap { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background: var(--bs-paper-bg); box-shadow: var(--bs-box-shadow-sm); margin-bottom: 1.5rem; }
.card .recon-table-wrap { box-shadow: none; }
.recon-table-wrap > .table { margin-bottom: 0; }
.table .recon-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A row's first cell keeps a readable width for its second line, so the table scrolls sideways before a name breaks
   every few letters; a note under a row's actions wraps within a set width, so a long one can't take the row (#296). */
.table td:first-child > .recon-sub { min-width: 10rem; }
.table td.text-end.text-nowrap .recon-sub { white-space: normal; max-width: 22rem; margin-left: auto; }
/* Sneat gives a table's icon buttons the table's text colour; a primary one (a row's main action) keeps its own, or its
   icon is grey on the primary colour. */
.table .btn-icon.btn-primary { color: var(--bs-btn-color); }
.table tr.recon-group-head th { text-transform: none; letter-spacing: 0; font-size: 0.875rem; color: var(--bs-heading-color); }
.table tr.recon-subtotal td { font-weight: 600; background: var(--bs-body-bg); }
.table th .recon-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.table th[aria-sort="ascending"] .recon-sort::after { content: " \25B2"; }
.table th[aria-sort="descending"] .recon-sort::after { content: " \25BC"; }

/* A dialog: a native <dialog> opened by a script, closed by its button, Esc or the backdrop, styled as a modal. */
.recon-dialog { border: 0; border-radius: var(--bs-border-radius-lg); background: var(--bs-paper-bg); color: var(--bs-body-color); box-shadow: var(--bs-box-shadow-xl); padding: 1.5rem; width: min(56rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); }
.recon-dialog::backdrop { background: rgba(34, 48, 62, 0.5); }
/* Shown in place, as on the reference page, rather than opened as a modal. */
.recon-dialog[open]:not(:modal) { position: static; margin: 1rem 0 0; }
.recon-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.recon-dialog-head h2 { margin: 0 0 0.25rem; font-size: 1.125rem; overflow-wrap: anywhere; }
.recon-dialog-head p { color: var(--bs-secondary-color); margin: 0; }

/* The session's time left (session.js), in the navbar; the warning colour for its last five minutes. */
/* The session timer: a pill with a ring that empties over the idle hour (session.js sets --recon-session-left, 1 to 0,
   through the CSSOM, which the CSP allows) and the time left. Amber in the last five minutes, when the ring counts
   those down. The ring's progress is
   a registered property so it eases from second to second rather than jumping. */
@property --recon-session-left { syntax: "<number>"; inherits: true; initial-value: 1; }
.recon-session {
  --recon-session-color: var(--bs-primary);
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem; border-radius: 50rem;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--bs-secondary-color);
  transition: --recon-session-left 1s linear, background-color 0.3s, color 0.3s, border-color 0.3s;
}
.recon-session-ring {
  width: 1.125rem; height: 1.125rem; flex: none; border-radius: 50%;
  background: conic-gradient(var(--recon-session-color) calc(var(--recon-session-left) * 1turn), var(--bs-border-color) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}
.recon-session-warn {
  --recon-session-color: var(--recon-label-warning);
  color: var(--recon-label-warning); font-weight: 600;
  background: color-mix(in sRGB, var(--bs-paper-bg) 84%, var(--bs-warning));
  border-color: color-mix(in sRGB, var(--bs-paper-bg) 60%, var(--bs-warning));
}

/* The navbar's status bar (#346): .recon-activity, a pill for each of tasks and reviews (a.recon-activity-item), a link
   to its list. activity.js sets the count, and .recon-activity-on while any is running: the brand colour, and its icon
   a spinner (still for those who ask for less motion). */
.recon-activity { display: flex; gap: 0.5rem; align-items: center; }
.recon-activity-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem 0.3rem 0.5rem; border-radius: 50rem;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--bs-secondary-color);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.recon-activity-item:hover, .recon-activity-item:focus-visible { color: var(--bs-body-color); border-color: var(--bs-primary); }
.recon-activity-item .bx { font-size: 1.125rem; }
.recon-activity-on {
  color: var(--bs-primary); font-weight: 600;
  background: color-mix(in sRGB, var(--bs-paper-bg) 88%, var(--bs-primary));
  border-color: color-mix(in sRGB, var(--bs-paper-bg) 55%, var(--bs-primary));
}
.recon-activity-on:hover, .recon-activity-on:focus-visible { color: var(--bs-primary); }
.recon-activity-on .bx { animation: recon-activity-spin 1.1s linear infinite; }
@keyframes recon-activity-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .recon-activity-on .bx { animation: none; } }
/* On a phone (#405): icon and number only, wrapping if need be; the pill's title and label keep the words. */
@media (max-width: 767.98px) {
  .recon-activity { flex-wrap: wrap; gap: 0.25rem; }
  .recon-activity-item { padding: 0.25rem 0.5rem; }
  .recon-activity-word { display: none; }
}

/* Text as it is (a write-up, a log): wraps, in the monospace font, on the page's background. */
.recon-pre { font-family: var(--recon-mono); font-size: var(--recon-mono-size); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bs-body-bg); color: var(--bs-body-color); border-radius: var(--bs-border-radius); padding: 0.6rem 0.75rem; margin: 0; }

/* Recon's mark in the menu's brand, in the primary colour. */
.recon-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.recon-mark .recon-mark-ring { fill: none; stroke: var(--bs-primary); stroke-width: 2; }
.recon-mark .recon-mark-inner { opacity: 0.45; }
.recon-mark .recon-mark-sweep { fill: var(--bs-primary); opacity: 0.25; }
.recon-mark .recon-mark-dot { fill: var(--bs-primary); }

/* The brand at the top of the menu, as Sneat's demo sizes it (its demo.css isn't vendored). */
.menu .app-brand.recon-brand { height: 64px; margin-top: 0.75rem; }
/* The wordmark: "Reconnaissance" in the heading colour, ".dev" lighter in the link colour (AA in both modes, as links are). */
.recon-brand .app-brand-text { font-size: 1.375rem; letter-spacing: -0.5px; color: var(--bs-heading-color); white-space: nowrap; }
.recon-brand .recon-brand-tld { font-weight: 500; color: var(--bs-link-color); }
/* In the menu it shares 16.25rem with the mark (and, as a drawer, the close button), so it is smaller there. */
.menu .recon-brand .app-brand-text { font-size: 1.125rem; letter-spacing: -0.25px; }
/* The mark where a page can't draw it (the workspace host's pages and the Dev IdP, which carry no inline SVG): the
   same drawing as a mask, in the primary colour. */
.recon-mark-image { display: inline-block; width: 1.75rem; height: 1.75rem; flex: none; background-color: var(--bs-primary); -webkit-mask: url(../img/recon-mark.svg) center / contain no-repeat; mask: url(../img/recon-mark.svg) center / contain no-repeat; }

/* ---- Stacks (#272): only for StackHealth's partials, _Stacks, _StackCard and _FleetTile ----------------------- */
/* A part takes its level's colour from a modifier named as Levels.Color names it: success, warning, danger, info
   or secondary. --recon-level is its line or edge, --recon-level-text its text, in the AA shade. */
.recon-level-success { --recon-level: var(--bs-success); --recon-level-text: var(--recon-label-success); }
.recon-level-warning { --recon-level: var(--bs-warning); --recon-level-text: var(--recon-label-warning); }
.recon-level-danger { --recon-level: var(--bs-danger); --recon-level-text: var(--recon-label-danger); }
.recon-level-info { --recon-level: var(--bs-info); --recon-level-text: var(--recon-label-info); }
.recon-level-secondary { --recon-level: var(--bs-secondary); --recon-level-text: var(--bs-secondary-color); }
.recon-dot-secondary { background: var(--bs-secondary); }

/* A stack's card: what it is and its verdict in the header, its topology and checks, its actions in the footer. */
.recon-stack-title { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.recon-stack-title h3 { margin: 0; font-size: 1.0625rem; }
.recon-stack-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--bs-border-color); }

/* Recon control plane ══ tunnel ══ [ connector ── database ── ingest proxy ] ══ devices */
.recon-topology { display: flex; align-items: stretch; min-width: 0; }
.recon-zone { position: relative; border-radius: var(--bs-border-radius-lg); padding: 1.75rem 0.75rem 0.75rem; display: flex; align-items: stretch; }
.recon-zone-label { position: absolute; top: 0.5rem; left: 0.85rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bs-secondary-color); }
.recon-zone-recon { flex: 1 1 0; max-width: 15rem; background: var(--bs-primary-bg-subtle); border: 1px solid color-mix(in sRGB, var(--bs-primary) 25%, transparent); }
.recon-zone-client { flex: 3 1 0; border: 1.5px dashed var(--bs-border-color); background: var(--bs-body-bg); }
.recon-zone-devices { flex: 1 1 0; max-width: 15rem; padding-left: 0; padding-right: 0; }

.recon-node { position: relative; flex: 1 1 0; min-width: 6rem; max-width: 15rem; hyphens: auto; display: flex; flex-direction: column; gap: 0.3rem; padding: 0.75rem 0.85rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); box-shadow: var(--bs-box-shadow-sm); }
.recon-node::after { content: ""; position: absolute; left: 0; top: 0.65rem; bottom: 0.65rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--recon-level, var(--bs-border-color)); }
.recon-node.recon-level-danger { border-color: color-mix(in sRGB, var(--bs-danger) 40%, var(--bs-border-color)); }
.recon-node-head { display: flex; align-items: center; gap: 0.5rem; }
.recon-node-head .bx { flex: none; font-size: 1.125rem; color: var(--recon-level-text, var(--bs-secondary-color)); }
.recon-node-name { font-weight: 600; font-size: 0.875rem; color: var(--bs-heading-color); }
.recon-node-summary { font-size: 0.8125rem; font-weight: 500; color: var(--recon-level-text, var(--bs-secondary-color)); }
.recon-node-detail { margin: 0; padding: 0; list-style: none; font-size: 0.75rem; line-height: 1.45; color: var(--bs-secondary-color); overflow-wrap: anywhere; }

/* A connection between two parts: a line in its level's colour, its name above and a note below. A working one
   flows; a broken or unknown one is dashed. */
.recon-link { flex: 0 1 6rem; min-width: 4.5rem; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.3rem; padding: 0 0.35rem; text-align: center; }
.recon-link-short { flex-basis: 3.5rem; min-width: 2.75rem; }
.recon-link-line { position: relative; overflow: hidden; width: 100%; height: 4px; border-radius: 4px; background: var(--recon-level, var(--bs-border-color)); }
.recon-link-label { font-size: 0.6875rem; font-weight: 600; line-height: 1.2; color: var(--bs-body-color); }
.recon-link-meta { font-size: 0.6875rem; line-height: 1.2; color: var(--bs-secondary-color); }
.recon-link.recon-level-danger .recon-link-label { color: var(--recon-label-danger); }
.recon-link.recon-level-success .recon-link-line::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.55) 10px 16px); animation: recon-flow 1.2s linear infinite; }
.recon-link.recon-level-danger .recon-link-line,
.recon-link.recon-level-secondary .recon-link-line { background: repeating-linear-gradient(90deg, var(--recon-level) 0 6px, transparent 6px 11px); }
@keyframes recon-flow { from { transform: translateX(-16px); } to { transform: translateX(0); } }
@keyframes recon-flow-down { from { transform: translateY(-16px); } to { transform: translateY(0); } }

/* The checks beside the diagram. */
.recon-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; }
.recon-check { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0.85rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); }
.recon-check .recon-dot { margin-top: 0.4rem; }
.recon-check-name { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bs-secondary-color); }
.recon-check-summary { font-size: 0.875rem; font-weight: 500; color: var(--bs-heading-color); }
.recon-check-detail { font-size: 0.75rem; color: var(--bs-secondary-color); overflow-wrap: anywhere; }

/* The fleet: a compact tile per stack, each a link to its organisation (the operator dashboard). */
.recon-fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.recon-tile { display: block; padding: 1rem 1.125rem; color: var(--bs-body-color); background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); transition: border-color 0.15s, box-shadow 0.15s; }
.recon-tile:hover, .recon-tile:focus-visible { color: var(--bs-body-color); border-color: var(--bs-primary); box-shadow: var(--bs-box-shadow); }
.recon-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.recon-tile-org { font-weight: 600; color: var(--bs-heading-color); }
.recon-tile-meta { font-size: 0.8125rem; color: var(--bs-secondary-color); margin-bottom: 0.75rem; }
.recon-tile-parts { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.recon-part { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem 0.1rem 0.4rem; font-size: 0.75rem; font-weight: 500; color: var(--bs-body-color); background: var(--bs-secondary-bg); border-radius: 50rem; }
.recon-part .recon-dot { width: 0.4375rem; height: 0.4375rem; }

/* Below Bootstrap's lg width the topology runs down the page. */
@media (max-width: 991.98px) {
  .recon-topology, .recon-zone-client { flex-direction: column; }
  .recon-node, .recon-zone-recon, .recon-zone-devices { max-width: none; }
  .recon-zone { flex: none; }
  .recon-link { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 0.75rem; padding: 0.35rem 0 0.35rem 1.4rem; min-width: 0; text-align: left; }
  .recon-link-short { flex-basis: auto; }
  .recon-link-line { flex: none; width: 4px; height: 2.25rem; }
  .recon-link.recon-level-success .recon-link-line::after { background: repeating-linear-gradient(180deg, transparent 0 10px, rgba(255, 255, 255, 0.55) 10px 16px); animation-name: recon-flow-down; }
  .recon-link.recon-level-danger .recon-link-line,
  .recon-link.recon-level-secondary .recon-link-line { background: repeating-linear-gradient(180deg, var(--recon-level) 0 6px, transparent 6px 11px); }
  .recon-zone-devices { padding: 0; }
}

/* ---- Changes (#277): review-ui.js's diff, Key changes, Findings and line comments ------------------------- */
/* On the tasks app and the review page. A bar of view switches, the file list (a .table.recon-diff-list), then a
   .recon-diff-file per file: its head (toggle, path, badges, counts, Viewed) and its lines, in a .recon-diff-table
   (unified: old, new, code; .recon-diff-split: old, code, new, code). */
.recon-diff-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin: 0 0 0.75rem; }
.recon-diff-grow { flex: 1 1 auto; }
.recon-diff-summary { margin: 0 0 0.5rem; color: var(--bs-secondary-color); font-size: 0.875rem; }
.recon-diff-list td:first-child { word-break: break-all; }
.recon-diff-plus { color: var(--recon-label-success); font-weight: 600; font-variant-numeric: tabular-nums; }
.recon-diff-minus { color: var(--recon-label-danger); font-weight: 600; font-variant-numeric: tabular-nums; }
.recon-diff-stat { margin-left: auto; white-space: nowrap; font-size: 0.8125rem; }
.recon-diff-progress { font-size: 0.8125rem; font-weight: 600; color: var(--bs-secondary-color); }
.recon-diff-group { margin: 1.25rem 0 0.5rem; }
.recon-diff-group h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.recon-diff-group p { margin: 0; color: var(--bs-secondary-color); }
.recon-diff-file { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); margin: 0.75rem 0; background: var(--bs-paper-bg); }
.recon-diff-file-head { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; padding: 0.4rem 0.65rem; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; position: sticky; top: 0; z-index: 1; }
.recon-diff-path { min-width: 0; font-family: var(--recon-mono); font-size: var(--recon-mono-size); font-weight: 600; color: var(--bs-heading-color); word-break: break-all; }
.recon-diff-note { margin: 0; padding: 0.55rem 0.75rem; color: var(--bs-secondary-color); font-size: 0.875rem; }
.recon-diff-scroll { overflow-x: auto; container-type: inline-size; }
.recon-diff-table { width: 100%; border-collapse: collapse; font-family: var(--recon-mono); font-size: var(--recon-mono-size); line-height: 1.5; color: var(--bs-body-color); }
.recon-diff-table td { padding: 0 0.5rem; vertical-align: top; }
.recon-diff-ln { width: 1%; min-width: 2.5rem; text-align: right; color: var(--bs-secondary-color); white-space: nowrap; user-select: none; border-right: 1px solid var(--bs-border-color); }
.recon-diff-code { white-space: pre-wrap; word-break: break-word; }
.recon-diff-row:hover .recon-diff-ln { color: var(--bs-body-color); }
.recon-diff-sign { display: inline-block; width: 1.1em; color: var(--bs-secondary-color); user-select: none; }
.recon-diff-add { background: color-mix(in sRGB, var(--bs-paper-bg) 86%, var(--bs-success)); }
.recon-diff-del { background: color-mix(in sRGB, var(--bs-paper-bg) 86%, var(--bs-danger)); }
.recon-diff-empty { background: var(--bs-body-bg); }
.recon-diff-hunk td { padding: 0.15rem 0.6rem; color: var(--recon-label-info); background: color-mix(in sRGB, var(--bs-paper-bg) 88%, var(--bs-info)); }
.recon-diff-split .recon-diff-code { width: 49%; }
.recon-diff-raw { white-space: pre; overflow: auto; max-height: 44rem; }
.recon-tok-k { color: var(--recon-code-key); }
.recon-tok-s { color: var(--recon-code-str); }
.recon-tok-c { color: var(--recon-code-com); font-style: italic; }
.recon-tok-n { color: var(--recon-code-num); }
.recon-tok-l { color: var(--recon-code-lit); }
/* A finding's marker on its line (a dot in its level's colour), and the line a finding's link brought into view. */
.recon-diff-flag { float: right; padding: 0 0.2rem; line-height: 1.5; border: 0; background: none; }
.recon-diff-target { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
/* Line comments: a line number picks lines; comments and the form follow their last line in a comment row. */
.recon-diff-pick { cursor: pointer; }
.recon-diff-pick:hover { color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.recon-diff-picked .recon-diff-ln { color: var(--bs-primary); font-weight: 700; background: var(--bs-primary-bg-subtle); }
.recon-diff-picked .recon-diff-ln:first-child { box-shadow: inset 3px 0 0 var(--bs-primary); }
.recon-diff-picked .recon-diff-code { box-shadow: inset 0 0 0 9999px var(--bs-primary-bg-subtle); }
.recon-diff-comment-row td { padding: 0.5rem 0.75rem; font-family: var(--bs-body-font-family); font-size: 0.875rem; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); }
.recon-diff-comment { margin: 0 0 0.5rem; padding: 0.55rem 0.75rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); }
.recon-diff-comment:last-child { margin-bottom: 0; }
.recon-diff-comment-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.recon-diff-comment-where { color: var(--bs-secondary-color); font-size: 0.8125rem; }
.recon-diff-comment-form { display: grid; gap: 0.5rem; }
.recon-diff-outdated { margin: 0.75rem 0; padding: 0.75rem 0.9rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-left: 4px solid var(--bs-warning); border-radius: var(--bs-border-radius); }
.recon-diff-outdated h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.recon-diff-outdated > p { margin: 0 0 0.6rem; color: var(--bs-secondary-color); }
.recon-diff-outdated-item { margin: 0.6rem 0 0; }
.recon-diff-comment-file { margin: 0 0 0.25rem; font-family: var(--recon-mono); font-size: var(--recon-mono-size); font-weight: 600; word-break: break-all; }
/* What a hunk does: Explain, in the hunk's header, opens the reviewer's explanation in a comment row under it. It keeps
   to the width on screen (the diff's own, .recon-diff-scroll) when a long line makes the table wider. */
.recon-diff-hunk .btn { font-family: var(--bs-body-font-family); }
.recon-diff-explain { position: sticky; left: 0.75rem; display: grid; gap: 0.3rem; max-width: min(calc(100cqi - 1.5rem), 60rem); padding: 0.55rem 0.75rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-left: 4px solid var(--bs-info); border-radius: var(--bs-border-radius); }
.recon-diff-explain p { margin: 0; }
.recon-diff-explain-by { color: var(--bs-secondary-color); font-size: 0.8125rem; font-weight: 600; }
/* Compare: the Changes tab's picker. */
.recon-diff-versions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0 0 0.75rem; }

/* Key changes: a change's summary, then its files' groups by purpose, the main change first. */
.recon-key-changes { margin: 0 0 1.5rem; padding: 1rem 1.25rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-left: 4px solid var(--bs-primary); border-radius: var(--bs-border-radius-lg); }
.recon-key-changes h2 { margin: 0 0 0.35rem; font-size: 1.0625rem; }
.recon-key-list { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.recon-key-list li { margin: 0.25rem 0; }

/* Findings: each a .recon-finding with its level's edge (recon-level-{colour}), its head, where, why, a suggested
   fix and the buttons that mark it; .recon-finding-done once marked. */
.recon-findings-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0 0 0.75rem; }
.recon-finding { margin: 0 0 0.65rem; padding: 0.75rem 0.9rem; background: var(--bs-paper-bg); border: 1px solid var(--bs-border-color); border-left: 4px solid var(--recon-level, var(--bs-secondary)); border-radius: var(--bs-border-radius); }
.recon-finding-done { opacity: 0.65; }
.recon-finding-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
/* A review's scanners (#347, ADR 0072): ul.recon-scans, a li.recon-scan.recon-level-{colour} for each, its state as an
   icon in that colour (bx-check-circle, bx-error-circle, bx-error), its name, version and what it found. */
.recon-scans { list-style: none; display: grid; gap: 0.375rem; margin: 0 0 0.9rem; padding: 0; }
.recon-scan { display: flex; gap: 0.5rem; align-items: flex-start; }
.recon-scan > .bx { flex: none; font-size: 1.375rem; line-height: 1.5rem; color: var(--recon-level, var(--bs-secondary-color)); }
.recon-scan-name { font-weight: 600; }
.recon-scan-note { color: var(--bs-secondary-color); }
.recon-finding-where { margin: 0.3rem 0; font-family: var(--recon-mono); font-size: var(--recon-mono-size); color: var(--bs-secondary-color); word-break: break-all; }

/* Text as its author wrote it: line breaks kept, long words wrapped (a comment, a finding, a description). */
.recon-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- The tasks app (#277) ------------------------------------------------------------------------------- */
/* A task's activity: the stream as a terminal shows it, light on dark in both modes; each line by its kind. */
.recon-log { max-height: 32rem; overflow: auto; margin: 0; padding: 0.75rem; font-family: var(--recon-mono); font-size: var(--recon-mono-size); line-height: 1.45; white-space: pre-wrap; color: #c9d1d9; background: #161b22; border-radius: var(--bs-border-radius); }
.recon-log-phase { color: #79c0ff; }
.recon-log-tool { color: #9ea7b3; }
.recon-log-claude { color: #e6edf3; }
.recon-log-error { color: #ff7b72; }
.recon-log-evidence { color: #d2a8ff; }
.recon-log-done, .recon-log-review { color: #56d364; }
/* A write-up in Markdown (sanitised): its images fit, its code scrolls. */
.recon-md img { max-width: 100%; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); }
.recon-md pre { padding: 0.65rem; overflow: auto; background: var(--bs-body-bg); border-radius: var(--bs-border-radius); }
.recon-md table td { width: 50%; }
/* A list to pick from that scrolls (the open issues). */
.recon-pick-list { max-height: 16rem; overflow: auto; }
/* The browser terminal's page: the theme's navbar, then the terminal filling the rest, light on dark as a terminal is. */
.recon-terminal-page { display: flex; flex-direction: column; height: 100vh; margin: 0; background: var(--bs-body-bg); }
.recon-terminal-screen { flex: 1 1 auto; min-height: 0; margin: 0 0.75rem 0.75rem; padding: 0.5rem; background: #161b22; border-radius: var(--bs-border-radius-lg); }
