/* =============================================================================
 * styles.css — AWS Quick Suite-inspired design system.
 * Tokens mirror Quick's visual language: a purple→pink brand gradient on white,
 * Cloudscape type scale/spacing/elevation. No frameworks — plain CSS custom
 * properties. The brand accent is defined ONCE (--brand-* + --brand-gradient)
 * and every accent surface (top nav, primary button, logo, avatar, focus)
 * references it, so the palette can be retuned from this block alone.
 * ========================================================================== */

:root {
  /* ---- Color tokens (Cloudscape light) -------------------------------- */
  --bg-canvas: #f4f4f4;            /* app background */
  --bg-surface: #ffffff;           /* cards, panels */
  --bg-surface-alt: #fbfbfb;       /* zebra / subtle fill */
  --bg-input: #ffffff;
  --bg-disabled: #e9ebed;
  --bg-hover: #f2f3f3;
  --bg-selected: #f3ecff;
  --bg-code: #16191f;

  --border: #c6c6cd;
  --border-subtle: #e9ebed;
  --border-strong: #8c8c94;

  --text: #1a1330;                 /* primary (deep plum-ink) */
  --text-secondary: #6b6280;       /* secondary/labels */
  --text-disabled: #a7a0b8;
  --text-link: #7c3aed;            /* Quick violet */
  --text-link-hover: #5b21b6;
  --text-inverse: #ffffff;

  /* ---- Quick brand accents (purple → pink gradient on white) ----------- *
   * Defined once; every accent surface references these so a retune touches
   * only this block. --brand is the solid fallback; --brand-gradient is the
   * signature diagonal used on the nav, primary button, logo, and avatar. */
  --brand: #a021e0;                /* primary brand (violet-magenta) */
  --brand-strong: #7c1fb0;         /* hover/pressed */
  --brand-2: #ec4899;              /* bright pink — accents only (not behind text) */
  --brand-3: #6d28d9;              /* violet start of the gradient */
  /* De-slop (2026-07-16): the purple→pink brand gradient read as AI-generated, so
     the accent surfaces (nav, primary button, logo, avatar) now use the SOLID
     --brand. Kept as named tokens so it's a one-line revert if we want the gradient
     back. #a021e0 clears WCAG AA (~4.5:1) for white text. --brand-2 (#ec4899) stays
     for non-text accents. */
  --brand-gradient: var(--brand);        /* was a purple→pink linear-gradient */
  --brand-gradient-soft: #f5edff;        /* was a soft purple→pink gradient */
  --brand-ink: #ffffff;            /* text ON the brand accent */

  /* Back-compat aliases: existing rules reference these names. Repointed to the
   * brand palette so the whole UI shifts without touching every rule. */
  --aws-orange: var(--brand);
  --aws-squid: #2a1d47;            /* top nav — deep plum instead of squid ink */
  --aws-squid-2: #1e143a;

  --blue-600: #7c3aed;             /* now the Quick violet (focus/selected) */
  --blue-700: #5b21b6;
  --blue-100: #ede4ff;

  /* Status palette */
  --green: #00802f;
  --green-bg: #effff1;
  --red: #d91515;
  --red-bg: #fff7f7;
  --amber: #8d6605;
  --amber-bg: #fffaf0;
  --grey: #5f6b7a;
  --grey-bg: #f1f3f5;
  --blue-status: #7c3aed;
  --blue-status-bg: #f3ecff;

  /* ---- Type ------------------------------------------------------------ */
  --font: "Amazon Ember", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --fs-display: 28px;
  --fs-h1: 22px;
  --fs-h2: 18px;
  --fs-h3: 16px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;

  /* ---- Spacing scale --------------------------------------------------- */
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-s: 12px;
  --sp-m: 16px;
  --sp-l: 20px;
  --sp-xl: 28px;
  --sp-xxl: 40px;

  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 4px rgba(15, 27, 42, 0.08), 0 0 1px rgba(15, 27, 42, 0.10);
  --shadow-pop: 0 4px 20px rgba(15, 27, 42, 0.18);
  --shadow-nav: 0 2px 4px rgba(0, 0, 0, 0.20);

  --nav-h: 48px;
  --side-w: 268px;
  --maxw: 1320px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  /* De-slop (2026-07-16): dropped the decorative violet→pink radial washes behind
     the app — ambient glow read as AI-generated and added noise to a dense data
     tool. Flat neutral canvas now. */
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-s); }

/* =============================================================================
 * Top navigation (Quick brand gradient bar)
 * ========================================================================== */
.topnav {
  height: var(--nav-h);
  background: var(--brand-gradient);
  color: var(--text-inverse);
  display: flex; align-items: center;
  padding: 0 var(--sp-m);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-nav);
  gap: var(--sp-m);
}
.topnav .brand {
  display: flex; align-items: center; gap: var(--sp-xs);
  font-weight: 700; font-size: var(--fs-h3); color: #fff; cursor: pointer;
}
.topnav .brand .logo-cube {
  width: 22px; height: 22px; border-radius: var(--radius-sm);
  /* White chip on the gradient nav — reads as the Quick mark */
  background: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--brand);
}
.topnav .brand .sep { color: rgba(255, 255, 255, 0.7); font-weight: 400; }
.topnav .brand .suite { color: #ffffff; font-weight: 400; font-size: var(--fs-sm); }
.topnav .spacer { flex: 1; }
.topnav .nav-item {
  /* Full white (not 85%) so text over the deep-magenta right end of the gradient
     clears WCAG AA at 13px. */
  color: #ffffff; font-size: var(--fs-sm); padding: 0 var(--sp-xs);
  cursor: pointer; height: 100%; display: flex; align-items: center;
}
.topnav .nav-item:hover { color: #fff; text-decoration: underline; }
.topnav .user-chip {
  display: flex; align-items: center; gap: var(--sp-xs);
  font-size: var(--fs-sm); color: #ffffff;
}
.topnav .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #ffffff; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-xs);
}

/* =============================================================================
 * App shell: side nav + content
 * ========================================================================== */
.shell { display: flex; min-height: calc(100vh - var(--nav-h)); }

.sidenav {
  width: var(--side-w); flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: var(--sp-l) 0;
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidenav .sn-title {
  font-size: var(--fs-h3); font-weight: 700; padding: 0 var(--sp-l) var(--sp-s);
  color: var(--text);
}
.sidenav .sn-section {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary); padding: var(--sp-m) var(--sp-l) var(--sp-xxs); font-weight: 700;
}
.sidenav a.sn-link {
  display: flex; align-items: center; gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-l); color: var(--text); font-size: var(--fs-body);
  border-left: 3px solid transparent; cursor: pointer; text-decoration: none;
}
.sidenav a.sn-link:hover { background: var(--bg-hover); text-decoration: none; }
.sidenav a.sn-link.active {
  background: var(--bg-selected); border-left-color: var(--blue-600);
  color: var(--blue-700); font-weight: 700;
}
.sidenav a.sn-link .sn-ico { width: 16px; text-align: center; opacity: .8; }
.sidenav .sn-divider { height: 1px; background: var(--border-subtle); margin: var(--sp-s) var(--sp-l); }

.content {
  flex: 1; min-width: 0; padding: var(--sp-xl) var(--sp-xxl);
  max-width: var(--maxw); margin: 0 auto; width: 100%;
}

/* =============================================================================
 * Breadcrumbs + page header
 * ========================================================================== */
.breadcrumbs { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--sp-m); }
.breadcrumbs a { color: var(--text-link); }
.breadcrumbs .sep { margin: 0 var(--sp-xs); color: var(--text-disabled); }

.page-header { margin-bottom: var(--sp-xl); }
.page-header .ph-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-m); }
.page-header h1 { font-size: var(--fs-h1); }
.page-header .ph-desc { color: var(--text-secondary); font-size: var(--fs-body); margin-top: var(--sp-xxs); max-width: 820px; }
.page-header .ph-actions { display: flex; gap: var(--sp-xs); flex-shrink: 0; }

/* =============================================================================
 * Buttons
 * ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-xs);
  font-family: var(--font); font-size: var(--fs-body); font-weight: 700;
  padding: 6px 18px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; line-height: 1.4; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.btn-primary { background: var(--brand-gradient); color: var(--brand-ink); border-color: transparent; }
.btn-primary:hover { background: var(--brand-strong); border-color: transparent; }
.btn-primary:disabled { background: var(--bg-disabled); color: var(--text-disabled); border-color: var(--bg-disabled); }
.btn-normal { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-normal:hover { background: var(--bg-hover); }
.btn-link { background: transparent; color: var(--text-link); border: none; padding: 6px 10px; }
.btn-link:hover { background: var(--bg-hover); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
/* Explainer-only affordance (D8): the "ⓘ How it works" buttons open a read-only
 * explainer modal — they take NO live/destructive action. Style them as a muted,
 * lighter-weight secondary control with a dashed underline so they are visually
 * distinct from the live controls (white bordered .btn-normal / brand .btn-primary)
 * and the destructive controls (red .btn-danger / red-tinted .btn-link). */
.btn-explain {
  background: transparent; color: var(--text-secondary); border-color: transparent;
  font-weight: 600; text-decoration: underline dotted var(--border-strong);
  text-underline-offset: 3px;
}
.btn-explain:hover { background: var(--bg-hover); color: var(--text); text-decoration-color: var(--text); }
.btn:disabled { background: var(--bg-disabled); color: var(--text-disabled); border-color: var(--bg-disabled); cursor: not-allowed; }
.btn-sm { padding: 3px 12px; font-size: var(--fs-sm); }

/* =============================================================================
 * Cards / containers
 * ========================================================================== */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.card-head {
  padding: var(--sp-m) var(--sp-l); border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-m);
}
.card-head h2 { font-size: var(--fs-h2); }
.card-head .ch-desc { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }
.card-body { padding: var(--sp-l); }
.card-body.pad-0 { padding: 0; }

.grid { display: grid; gap: var(--sp-l); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* =============================================================================
 * Status indicators (Cloudscape style)
 * ========================================================================== */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-body); font-weight: 400; white-space: nowrap; }
.status::before { content: ""; width: 0; height: 0; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-success { color: var(--green); }
.status-success .dot { background: var(--green); }
.status-error { color: var(--red); }
.status-error .dot { background: var(--red); }
.status-warning { color: var(--amber); }
.status-warning .dot { background: var(--amber); }
.status-info { color: var(--blue-status); }
.status-info .dot { background: var(--blue-status); }
.status-pending { color: var(--grey); }
.status-pending .dot { background: var(--grey); }
.status-progress { color: var(--blue-status); }
.status-progress .dot { background: var(--blue-status); animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Badges / chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs); font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--grey-bg); color: var(--text-secondary); border: 1px solid transparent;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-status-bg); color: var(--blue-status); }
.badge-grey { background: var(--grey-bg); color: var(--text-secondary); }
.badge-outline { background: #fff; border-color: var(--border); color: var(--text-secondary); }

/* =============================================================================
 * Tables
 * ========================================================================== */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
table.tbl thead th {
  /* Cloudscape-style column headers: micro-caps, muted, quiet fill. */
  text-align: left; font-weight: 700; font-size: var(--fs-xs); color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: var(--sp-s) var(--sp-m); border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--bg-surface-alt);
}
table.tbl tbody td { padding: var(--sp-s) var(--sp-m); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
/* Neutral row hover (de-slop 2026-07-16): was the purple --bg-selected wash on
   every hover, which flooded a big board with violet. The purple --bg-selected
   is reserved for a genuinely selected/active row; hover is neutral grey. */
table.tbl tbody tr:hover { background: var(--bg-hover); }
table.tbl tbody tr.clickable { cursor: pointer; }
/* Credentials-only rows (claimed to manage creds, not onboarded) are not tappable. */
table.tbl tbody tr.creds-only-row { cursor: default; }
table.tbl tbody tr.creds-only-row:hover { background: transparent; }
table.tbl .cell-mono { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-secondary); }
/* De-slop (2026-07-16): 600 not 700 — every table row's name cell was heavy 700,
   which read as bold-everything across a dense board. 600 keeps the name distinct
   from secondary cells without shouting; true 700 is reserved for headings. */
table.tbl .cell-strong { font-weight: 600; }

/* =============================================================================
 * Forms
 * ========================================================================== */
.field { margin-bottom: var(--sp-l); }
.field > label { display: block; font-weight: 700; font-size: var(--fs-body); margin-bottom: var(--sp-xxs); }
.field .hint { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--sp-xs); }
.field .req { color: var(--red); margin-left: 3px; }
.control {
  width: 100%; padding: 7px 11px; font-size: var(--fs-body); font-family: var(--font);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text);
}
.control:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); }
.control:disabled { background: var(--bg-disabled); color: var(--text-secondary); cursor: not-allowed; }

/* Segmented tile toggle — two big selectable cards (e.g. Managed | DCR). A
   clearer, larger-hit-area alternative to a plain radio row: each tile shows the
   option name + a one-line description, with a violet selection ring + tick. */
.seg-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-s); margin-top: var(--sp-xs); }
@media (max-width: 640px) { .seg-toggle { grid-template-columns: 1fr; } }
.seg-tile {
  display: flex; align-items: flex-start; gap: 10px; text-align: left; width: 100%;
  padding: 14px 16px; cursor: pointer; font-family: var(--font);
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md, 10px);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.seg-tile:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.seg-tile:focus-visible { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100); }
.seg-tile.selected {
  border-color: var(--brand); background: var(--bg-selected);
  box-shadow: 0 0 0 1px var(--brand);
}
.seg-tile.selected::after {
  content: "✓"; margin-left: auto; align-self: center;
  color: var(--brand-ink); background: var(--brand);
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.seg-tile-icon { font-size: 20px; line-height: 1.4; flex: none; }
.seg-tile-title { font-weight: 700; font-size: var(--fs-body); }
.seg-tile-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }
/* 3-up on wide, 1-up on mobile (gate: section heads collapse to one column). */
.seg-toggle.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .seg-toggle.seg-3 { grid-template-columns: 1fr; } }

/* Numbered sub-steps inside the "Fetch the connector's tools" discovery card —
   turns a flat wall of fields into a clear 1 → 2 → 3 flow. Uses the violet brand
   for the step chips so it reads as part of the same system. */
.disc-step { margin-top: var(--sp-l); }
.disc-step:first-child { margin-top: 0; }
.disc-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-s); }
.disc-step-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-size: var(--fs-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.disc-step-label { font-weight: 700; font-size: var(--fs-body); color: var(--text); }
.disc-step-label .req { color: var(--red); margin-left: 3px; }
/* The step-2 fields sit in a subtle inset so the mode-specific inputs read as a
   grouped unit under their numbered head, not loose in the card. */
.disc-step-fields {
  border-left: 2px solid var(--border-subtle);
  padding-left: var(--sp-m); margin-left: 10px;
}
.disc-step-fields .field:last-child { margin-bottom: 0; }
/* Derived, read-only fields (enum name / capability) — auto-filled from the
   Connector ID and locked. Visually muted so it reads as "generated, not yours". */
.control-derived { background: var(--bg-disabled); color: var(--text-secondary); cursor: default; }
.control-derived:focus { outline: none; border-color: var(--border-strong); box-shadow: none; }
select.control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6b7a' d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
textarea.control { min-height: 84px; resize: vertical; }
.field-row { display: flex; gap: var(--sp-m); }
.field-row > .field { flex: 1; }

/* Multi-select option list (checkbox rows) — Cloudscape "multiselect" feel */
.multiselect { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-input); overflow: hidden; }
.multiselect .ms-opt {
  display: flex; align-items: flex-start; gap: var(--sp-s); padding: var(--sp-s) var(--sp-m);
  border-bottom: 1px solid var(--border-subtle); cursor: pointer;
}
.multiselect .ms-opt:last-child { border-bottom: none; }
.multiselect .ms-opt:hover { background: var(--bg-hover); }
.multiselect .ms-opt.checked { background: var(--bg-selected); }
.multiselect .ms-opt input { margin-top: 3px; accent-color: var(--blue-600); width: 15px; height: 15px; flex-shrink: 0; }
.multiselect .ms-opt .ms-main { font-weight: 700; }
.multiselect .ms-opt .ms-sub { font-size: var(--fs-sm); color: var(--text-secondary); }
.multiselect .ms-opt .ms-tags { margin-top: 3px; display: flex; gap: 5px; flex-wrap: wrap; }
.ms-summary { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: var(--sp-xs); }
.ms-summary .badge { margin-right: 4px; }

/* Sample test-case repeater rows (prompt / tool / expected / remove) */
.tc-row { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 32px; gap: var(--sp-xs); align-items: center; margin-bottom: var(--sp-xs); }
.tc-row.tc-head { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.tc-row.tc-head > div { padding-left: 2px; }
.tc-row .btn-link { padding: 4px 8px; color: var(--text-secondary); }
.tc-row .btn-link:hover { color: var(--red); }
@media (max-width: 720px) { .tc-row { grid-template-columns: 1fr; } .tc-row.tc-head { display: none; } }

/* =============================================================================
 * Misc helpers
 * ========================================================================== */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: var(--sp-s) var(--sp-l); font-size: var(--fs-body); }
.kv dt { color: var(--text-secondary); font-weight: 400; }
.kv dd { margin: 0; color: var(--text); font-weight: 400; }
.kv dd.mono { font-family: var(--mono); font-size: var(--fs-sm); }

.muted { color: var(--text-secondary); }
.mono { font-family: var(--mono); }

/* Click-to-copy code chip. Used for every command/prompt the operator has to paste
 * into a terminal or into Claude — reading a command off the screen and retyping it is
 * where typos come from, and some of these are long (an `ada` line, a whole prompt
 * sentence). Renders as a real code chip so it's visibly a literal, and the whole chip
 * is the copy target. `.copied` is the flash-confirm state. */
.codecopy {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-subtle, rgba(127, 127, 127, 0.12));
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  white-space: pre-wrap;      /* long prompts wrap instead of overflowing the card */
  transition: background 120ms ease, border-color 120ms ease;
}
.codecopy:hover { border-color: var(--accent, #8b5cf6); }
.codecopy:focus-visible { outline: 2px solid var(--accent, #8b5cf6); outline-offset: 1px; }
.codecopy::after {
  content: " ⧉";                /* affordance: this is copyable */
  opacity: 0.45;
  font-size: 0.85em;
}
.codecopy.copied {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.55);
}
.codecopy.copied::after { content: " ✓"; opacity: 1; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: var(--sp-xs); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-m); }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-s { margin-top: var(--sp-s); } .mt-m { margin-top: var(--sp-m); } .mt-l { margin-top: var(--sp-l); } .mt-xl { margin-top: var(--sp-xl); }
.mb-0 { margin-bottom: 0; } .mb-s { margin-bottom: var(--sp-s); } .mb-m { margin-bottom: var(--sp-m); } .mb-l { margin-bottom: var(--sp-l); }

.strike { text-decoration: line-through; color: var(--text-disabled); }
.code-inline { font-family: var(--mono); font-size: 0.92em; background: var(--grey-bg); padding: 1px 6px; border-radius: var(--radius-sm); color: #b8002e; }

.codeblock {
  background: var(--bg-code); color: #e8eaed; font-family: var(--mono); font-size: var(--fs-sm);
  padding: var(--sp-m); border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.6; white-space: pre;
}
.codeblock .tok-key { color: #7ee0ff; }
.codeblock .tok-str { color: #b8e986; }
.codeblock .tok-cmt { color: #6b7785; }

/* Metric / KPI (stat) tiles — Quick / Cloudscape style: white surface, the VALUE
   in ink (color is never the value itself), a status color carried only by a left
   accent rail + a small dot beside the label (secondary encoding, never
   color-alone). --kpi-accent is set per-tile; unset tiles are neutral. */
.kpi { padding: var(--sp-l); position: relative; overflow: hidden; }
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, transparent); border-radius: var(--radius) 0 0 var(--radius);
}
.kpi .kpi-label {
  font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 6px;
}
.kpi .kpi-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kpi-accent, var(--text-secondary)); flex-shrink: 0; }
.kpi .kpi-value {
  font-size: var(--fs-display); font-weight: 700; margin-top: var(--sp-xs);
  letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums;
}
.kpi .kpi-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }

/* Alert / info boxes */
.alert {
  display: flex; gap: var(--sp-s); padding: var(--sp-s) var(--sp-m); border-radius: var(--radius-sm);
  font-size: var(--fs-body); border: 1px solid transparent; align-items: flex-start;
}
.alert .a-ico { font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--blue-status-bg); border-color: var(--blue-100); color: #00305c; }
.alert-info .a-ico { color: var(--blue-600); }
.alert-success { background: var(--green-bg); border-color: #b7ecc4; color: #0a5c27; }
.alert-success .a-ico { color: var(--green); }
.alert-warning { background: var(--amber-bg); border-color: #f3e1b5; color: #6b4e05; }
.alert-warning .a-ico { color: var(--amber); }
.alert-error { background: var(--red-bg); border-color: #f5c4c4; color: #8c0e0e; }
.alert-error .a-ico { color: var(--red); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-l); }
.tab {
  padding: var(--sp-xs) var(--sp-m); cursor: pointer; font-size: var(--fs-body); font-weight: 700;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }

/* =============================================================================
 * Modal (the "backend action explainer" pop-up)
 * ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 27, 42, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 60px var(--sp-m); overflow-y: auto;
  animation: fadein .12s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  width: 100%; max-width: 620px; animation: slideup .16s ease;
}
.modal.wide { max-width: 860px; }
@keyframes slideup { from { transform: translateY(-8px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  padding: var(--sp-l) var(--sp-l) var(--sp-s); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-m);
  border-bottom: 1px solid var(--border-subtle);
}
.modal-head h2 { font-size: var(--fs-h2); }
.modal-head .m-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-secondary); line-height: 1; padding: 2px 6px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: var(--sp-l); }
.modal-foot { padding: var(--sp-s) var(--sp-l) var(--sp-l); display: flex; justify-content: flex-end; gap: var(--sp-xs); }

/* The simulated-backend banner inside modals */
.sim-banner {
  display: flex; gap: var(--sp-s); padding: var(--sp-s) var(--sp-m); border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #fff5e6, #fffaf0); border: 1px solid #f3e1b5; color: #6b4e05;
  font-size: var(--fs-sm); margin-bottom: var(--sp-m); align-items: flex-start;
}
.sim-banner .si { font-size: 15px; }

.action-step { display: flex; gap: var(--sp-s); padding: var(--sp-xs) 0; align-items: flex-start; }
.action-step .as-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue-status-bg); color: var(--blue-700);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 800; flex-shrink: 0;
}
.action-step .as-text { font-size: var(--fs-body); }
.action-step .as-text .as-title { font-weight: 700; }
.action-step .as-text .as-meta { color: var(--text-secondary); font-size: var(--fs-sm); }

/* =============================================================================
 * Pipeline / stepper visual
 * ========================================================================== */
.pipeline { display: flex; align-items: stretch; overflow-x: auto; gap: 0; padding: var(--sp-xs) 0; }
.pl-stage {
  display: flex; flex-direction: column; align-items: center; min-width: 86px; position: relative; padding: 0 2px;
}
.pl-stage .pl-connector { position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.pl-stage.done .pl-connector, .pl-stage.current .pl-connector { background: var(--green); }
.pl-stage:first-child .pl-connector { display: none; }
.pl-node {
  width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 800;
  color: var(--text-secondary); z-index: 1; position: relative;
}
.pl-stage.done .pl-node { background: var(--green); border-color: var(--green); color: #fff; }
.pl-stage.current .pl-node { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 0 0 4px var(--blue-status-bg); }
.pl-stage.blocked .pl-node { background: var(--red); border-color: var(--red); color: #fff; }
.pl-stage.stretch .pl-node { border-style: dashed; }
.pl-label { font-size: 11px; text-align: center; margin-top: var(--sp-xs); color: var(--text-secondary); max-width: 84px; line-height: 1.25; }
.pl-stage.current .pl-label { color: var(--blue-700); font-weight: 700; }
.pl-stage.done .pl-label { color: var(--text); }

/* Empty state */
.empty { text-align: center; padding: var(--sp-xxl); color: var(--text-secondary); }
.empty .e-ico { font-size: 32px; opacity: .35; }

/* Segmented filter control */
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { background: #fff; border: none; padding: 5px 14px; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; color: var(--text-secondary); border-right: 1px solid var(--border-subtle); }
.segmented button:last-child { border-right: none; }
.segmented button.active { background: var(--blue-600); color: #fff; }

/* Connector logo tile */
.logo-tile {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0;
}

.fade-up { animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Onboarding-steps modal (connector detail → "View onboarding steps"): a compact
   per-workspace list of the run's recorded outcome (status · CR link · detail). */
.os-list { display: flex; flex-direction: column; gap: var(--sp-s); }
.os-step { border: 1px solid var(--border-subtle); border-radius: 8px; padding: var(--sp-s) var(--sp-m); }
.os-step .os-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.os-step.os-pending { opacity: .7; }
