/* Tanki ops console — M1.4 baseline styles.
   Matches brand tokens from tanki_master_playbook.md §2.1.
   Pre-M10 sweep: responsive layout + overflow fixes across all
   surfaces (M9.1-M9.8 accumulated UI). */

:root {
  --bg:         #09090b;
  --card:       rgba(10, 11, 14, 0.55);
  --card-solid: #111214;
  --border:     rgba(255, 255, 255, 0.08);
  --txt:        #f0f0f2;
  --txt-dim:    #9ca3af;
  --txt-faint:  #6b7280;
  --silver:     #c2c7cf;
  --silver-dk:  #a5acb8;
  --green:      #22c55e;
  --blue:       #0ea5e9;
  --red:        #ef4444;

  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Responsive breakpoints — referenced by @media queries below.
     Custom properties don't work inside @media values, so these
     are documentation only; keep the literals in sync if you add
     more breakpoints. */
  --bp-mobile: 640px;
  --bp-tablet: 900px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-feature-settings: "tnum";
  /* Belt-and-braces: stop right-edge overflow from horizontally
     scrolling the whole page. Wide tables get their own
     overflow-x via .responsive-table. */
  overflow-x: hidden;
}

.shell {
  /* Widened from 640px (M1.4) so 5- and 6-column settings tables
     can fit at desktop. Auth pages stay narrow because .auth-card
     has its own max-width: 420px. */
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand { display: flex; flex-direction: column; gap: 4px; }

.wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--silver) 0%, var(--silver-dk) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  line-height: 1;
}

.subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-faint);
}

.status-card {
  background: var(--card);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Cards never grow past the shell; their contents (tables) get
     responsive overflow handling via .responsive-table wrappers. */
  min-width: 0;
}

@media (max-width: 639.98px) {
  .status-card { padding: 16px 16px; }
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-faint);
}

.value {
  font-size: 14px;
  color: var(--txt);
}

.mono { font-family: var(--font-mono); }
.dim  { color: var(--txt-faint); }

.status-ok {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 13px;
}

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ─── Utilities (sweep) ───────────────────────────────────────────── */

/* Long technical strings (flag paths, dedup_keys, action_hints).
   Allow break-on-anywhere so they wrap inside narrow cells. */
.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Truncate single-line content with ellipsis. Pair with a title
   attribute on the element for the full value on hover. */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flex-children fix: the default min-width: auto refuses to
   shrink below content size and is the #1 cause of unexpected
   flex overflow. Apply to children that should be allowed to
   shrink (e.g. the flag-path span inside .flag-row). */
.min-w-0 {
  min-width: 0;
}

/* Wrap a wide table; horizontal scroll appears inside the wrapper
   when the viewport is narrower than the table's natural width.
   The wrapper itself never overflows the page. */
.responsive-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.responsive-table table {
  width: 100%;
  min-width: 560px;
}

/* Code spans almost always hold technical strings (paths, ids,
   tokens, command lines). Break-anywhere by default — the few
   places we want exact-no-break can opt out per-instance. */
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Hide-at-breakpoint utilities for non-essential columns.
   Mobile = <640px; tablet = <900px (still includes mobile). */
@media (max-width: 639.98px) {
  .hide-mobile { display: none !important; }
}
@media (max-width: 899.98px) {
  .hide-tablet { display: none !important; }
}

/* Inverse — show only at <tablet width. Used to reflow content
   into the message cell when the dedicated column is hidden
   (see readiness.html action_hint reflow). */
.show-tablet { display: none; }
@media (max-width: 899.98px) {
  .show-tablet { display: block; }
}

/* ─── Status tables (sweep — used by every settings page) ────────── */

.status-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.status-table th {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-faint);
  font-size: 10.5px;
}

.status-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 899.98px) {
  .shell { padding: 32px 20px 48px; gap: 24px; }
}

@media (max-width: 639.98px) {
  .shell { padding: 24px 14px 40px; gap: 20px; }
  .wordmark { font-size: 36px; }
}

/* ─── Auth card (M9.3-A) ──────────────────────────────────────────── */

.auth-card {
  max-width: 420px;
  align-self: center;
  width: 100%;
}

.status-card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-dim);
  font-weight: 500;
  margin-bottom: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 120ms ease;
  width: 100%;
}

.auth-form input:focus {
  border-color: var(--blue);
}

.auth-button {
  background: var(--blue);
  color: #06121b;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: filter 120ms ease;
  margin-top: 4px;
}

.auth-button:hover { filter: brightness(1.1); }

.auth-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--red);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.auth-help {
  color: var(--txt-dim);
  font-size: 13px;
  line-height: 1.45;
}

.auth-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-secret {
  display: block;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
  color: var(--silver);
}

.auth-uri {
  display: block;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  word-break: break-all;
  color: var(--txt-dim);
}

.status-button-disabled {
  background: var(--card-solid);
  color: var(--txt-faint);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: not-allowed;
}

/* ─── Nav (sidebar + mobile drawer) ─────────────────────────────── */

/* M9.3-B's flat top-bar `.nav` block was retired in M16. M17-A
   follow-up retired the fixed bottom-nav strip too; mobile users
   reach all links via the hamburger drawer. Auth pages set `body`
   without `.has-nav` so the shell renders edge-to-edge. */

/* Default layout (mobile, <900px): single column. */
.has-nav .shell {
  padding-bottom: 64px;
}

/* Desktop + tablet (≥900px): grid with sidebar + content. */
@media (min-width: 900px) {
  body.has-nav {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-areas: "sidebar content";
    min-height: 100vh;
  }
  .has-nav .shell {
    grid-area: content;
  }
  .mobile-drawer {
    display: none;
  }
}

/* ── Sidebar ──────────────────────────────────────────────────── */

.sidebar {
  grid-area: sidebar;
  display: none;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-brand-mark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--silver) 0%, var(--silver-dk) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  line-height: 1;
}

.sidebar-brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-faint);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 9px 12px;
  color: var(--txt-dim);
  text-decoration: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt);
}

.sidebar-nav a[aria-current="page"] {
  background: rgba(34, 197, 94, 0.10);
  color: var(--green);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 10px 12px;
  margin: 16px 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
}

.sidebar-status-pill {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-status-label {
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.sidebar-status-reason {
  flex-basis: 100%;
  color: var(--txt-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sidebar-link-trail {
  display: block;
  padding: 9px 12px;
  margin-top: 8px;
  color: var(--txt-faint);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.sidebar-link-trail:hover { color: var(--txt); }

/* ── Status pill colors (shared sidebar + mobile-header) ─────── */

.status-active .sidebar-status-pill,
.status-active .mobile-status-pill {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.20);
}

.status-warning .sidebar-status-pill,
.status-warning .mobile-status-pill {
  background: #eab308;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.20);
}

.status-halted .sidebar-status-pill,
.status-halted .mobile-status-pill {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.20);
}

/* ── Mobile header (<900px) ──────────────────────────────────── */

/* M40: hidden by default; shown only at the mobile breakpoint.
   Mirrors the .sidebar pattern (hidden base + shown at ≥900px) so
   source order can't accidentally re-show it on desktop. */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}

@media (max-width: 899.98px) {
  .mobile-header {
    display: flex;
  }
}

.mobile-brand {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--silver) 0%, var(--silver-dk) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.mobile-brand-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-faint);
  -webkit-text-fill-color: var(--txt-faint);
  margin-left: 4px;
}

.mobile-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.mobile-status-pill {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mobile-status-label {
  font-weight: 600;
}

/* ── Hamburger button ────────────────────────────────────────── */

.hamburger-button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
}

.hamburger-button span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--txt-dim);
  transition: transform 180ms ease, opacity 120ms ease;
}

.hamburger-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Mobile drawer (<900px) ──────────────────────────────────── */

.mobile-drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  max-width: 80vw;
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: left 200ms ease-out;
  z-index: 40;
  overflow-y: auto;
  padding: 72px 14px 32px;
}

.mobile-drawer.open {
  left: 0;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
}

body.drawer-open {
  overflow: hidden;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-drawer-nav a {
  display: block;
  padding: 12px 14px;
  color: var(--txt-dim);
  text-decoration: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.mobile-drawer-nav a:hover { color: var(--txt); }

.mobile-drawer-nav a[aria-current="page"] {
  background: rgba(34, 197, 94, 0.10);
  color: var(--green);
}

.mobile-drawer-trail {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  color: var(--txt-faint) !important;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 11px !important;
}

/* M40: when the drawer is open, the burger sits behind it (drawer
   z-index 40 > header z-index 30) so it's both invisible and
   inert. Hide it explicitly; the in-drawer × button + backdrop
   tap take over the dismiss role. */
body.drawer-open .hamburger-button {
  display: none;
}

/* M40: backdrop dims the page behind the drawer and dismisses the
   drawer on tap-outside (standard mobile pattern). z-index sits
   between mobile-header (30) and the drawer itself (40). */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 35;
}

body.drawer-open .mobile-drawer-backdrop {
  display: block;
}

/* M40: × close button anchored top-right of the open drawer. The
   drawer keeps its 72px top padding so nav links stay clear of
   the button. */
.mobile-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  color: var(--txt-dim);
  cursor: pointer;
  padding: 0;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:focus {
  color: var(--txt);
  border-color: var(--txt-dim);
}

/* ─── Halt status indicator (M9.3-B) ───────────────────────────── */

.halt-status {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--txt);
}

.halt-status-active {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--red);
}

.halt-status-clear {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--green);
}

.halt-status-label {
  font-weight: 700;
  letter-spacing: 0.16em;
}

.halt-status-count {
  flex: 1;
}

.halt-status-cta {
  font-size: 11px;
}

/* ─── Halt button (the big red one) ────────────────────────────── */

.halt-button-primary {
  display: block;
  text-align: center;
  background: var(--red);
  color: #100404;
  border: 0;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.12em;
  padding: 18px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 120ms ease;
  text-transform: uppercase;
  /* Cap width at desktop so the HALT button doesn't stretch
     across a 1100px shell; full-width on mobile via the
     wrapper's width. */
  width: 100%;
  max-width: 360px;
  align-self: center;
}

.halt-button-primary:hover { filter: brightness(1.08); }

.halt-button-submit {
  width: 100%;
  max-width: none;
}

/* ─── Halts page form bits ─────────────────────────────────────── */

.halt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.halt-form select,
.halt-form textarea,
.halt-form input[type="text"] {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  max-width: 100%;
}

/* Native <select> ignores CSS padding on most browsers because the
   OS-level control renders with its own internal metrics. Strip the
   native chrome with appearance: none so our padding actually
   applies, then draw a custom chevron via background-image so the
   "this is a dropdown" affordance survives. */
.halt-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 12px 16px;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}

.halt-form select:focus {
  border-color: var(--blue);
}

.halt-form textarea {
  resize: vertical;
  min-height: 64px;
}

.halt-form select:focus,
.halt-form textarea:focus,
.halt-form input:focus {
  border-color: var(--blue);
}

.halts-table th,
.halts-table td {
  text-align: left;
  padding: 6px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.inline-form {
  display: inline;
}

.halt-resume-btn {
  background: var(--card-solid);
  color: var(--txt);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 4px 10px;
}

.halt-resume-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.halt-flash {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.40);
  color: var(--green);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.resume-all-gate {
  border-color: rgba(239, 68, 68, 0.30);
}

/* ─── Flags page (M9.4) ────────────────────────────────────────── */

.flag-table th,
.flag-table td {
  padding: 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.flag-row code {
  font-size: 12px;
  color: var(--silver);
}

.flag-current-true {
  color: var(--green);
}

.flag-current-false {
  color: var(--txt-faint);
}

.flag-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.flag-reason-input {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--txt);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  flex: 1 1 160px;
  min-width: 0;
  max-width: 240px;
}

@media (max-width: 639.98px) {
  /* On mobile, give the reason input full width and stack the
     button below it. */
  .flag-form { width: 100%; }
  .flag-reason-input { max-width: none; flex: 1 1 100%; }
}

.flag-reason-input:focus {
  border-color: var(--blue);
}

.flag-toggle-button {
  background: var(--card-solid);
  color: var(--txt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.flag-toggle-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ─── Credentials page (M9.7-B) ─────────────────────────────────── */

.cred-status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.cred-status-ok {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.08);
}

.cred-status-warning {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.40);
  background: rgba(250, 204, 21, 0.08);
}

.cred-status-error {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.40);
  background: rgba(239, 68, 68, 0.08);
}

.cred-status-na {
  color: var(--txt-faint);
  border-color: var(--border);
  background: transparent;
}

/* Per-cell expiry display: relative-duration primary line in tone
   colour, absolute Europe/London timestamp underneath in dim mono. */
.credential-expiry-primary {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.3;
}

.credential-expiry-absolute {
  font-size: 11px;
  margin-top: 2px;
}

.credential-expiry-marker {
  color: var(--txt-faint);
  font-size: 11px;
}

.credential-expiry-ok      { color: var(--green); }
.credential-expiry-warn    { color: #facc15; }
.credential-expiry-expired { color: var(--red); }

/* ─── Readiness page (M9.8) ─────────────────────────────────────── */

.readiness-banner {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.readiness-banner-headline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.readiness-banner-counts {
  font-size: 12px;
  color: var(--txt-dim);
  letter-spacing: 0.04em;
}

.readiness-banner-ok {
  border-color: rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.08);
}

.readiness-banner-ok .readiness-banner-headline {
  color: var(--green);
}

.readiness-banner-warning {
  border-color: rgba(250, 204, 21, 0.40);
  background: rgba(250, 204, 21, 0.08);
}

.readiness-banner-warning .readiness-banner-headline {
  color: #facc15;
}

.readiness-banner-error {
  border-color: rgba(239, 68, 68, 0.40);
  background: rgba(239, 68, 68, 0.08);
}

.readiness-banner-error .readiness-banner-headline {
  color: var(--red);
}

.readiness-count-pass { color: var(--green); }
.readiness-count-warn { color: #facc15; }
.readiness-count-fail { color: var(--red); }

.action-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
}

/* ─── Cutover page (M10) ────────────────────────────────────────── */

.cutover-banner {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cutover-banner-headline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cutover-banner-sub {
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* dry_run is the safe state — green; live is operationally elevated
   — red. Counterintuitive at first ("isn't live good?") but the
   banner's job is to convey "the system can post to real accounts
   right now", which is the high-attention state. */
.cutover-banner-dry_run {
  border-color: rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.08);
}
.cutover-banner-dry_run .cutover-banner-headline {
  color: var(--green);
}

.cutover-banner-live {
  border-color: rgba(239, 68, 68, 0.40);
  background: rgba(239, 68, 68, 0.08);
}
.cutover-banner-live .cutover-banner-headline {
  color: var(--red);
}

.cutover-readiness-pass { color: var(--green); }
.cutover-readiness-warn { color: #facc15; }
.cutover-readiness-fail { color: var(--red); }

.smoke-result-pass { color: var(--green); }
.smoke-result-warn { color: #facc15; }
.smoke-result-fail { color: var(--red); }

.cutover-flip-form {
  border-color: rgba(239, 68, 68, 0.35);
}

.cutover-rollback-form {
  border-color: rgba(250, 204, 21, 0.35);
}

.halt-form input[type="text"]:disabled,
.halt-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── /posts list (M17-A) ──────────────────────────────────────────
   Filterable post log: filter form + responsive table. The table
   collapses to card-style at <640px so each row is readable on a
   phone without horizontal scroll. */

.posts-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.posts-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.posts-filter-field .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--txt-dim);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.posts-filter-field select {
  background: var(--card-solid);
  color: var(--txt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.posts-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--txt-dim);
}

.posts-filter-submit {
  align-self: end;
  justify-self: start;
}

.posts-table {
  min-width: 720px;
}

.posts-count {
  font-size: 0.75rem;
  margin-left: 6px;
}

.post-row {
  vertical-align: middle;
}

.post-row-dry-run td {
  background: rgba(14, 165, 233, 0.04);
}

.post-thumbnail {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.post-asset-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--txt);
}

.post-asset-link:hover {
  color: var(--blue);
}

.post-asset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 80px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1.4rem;
  color: var(--silver-dk);
}

.post-asset-label {
  font-size: 0.75rem;
  color: var(--txt-dim);
}

.post-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.post-status-succeeded {
  color: var(--green);
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.35);
}

.post-status-failed {
  color: var(--red);
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.35);
}

.post-status-skipped {
  color: #facc15;
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.30);
}

.post-status-pending {
  color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.post-skip-reason {
  font-size: 0.7rem;
  margin-top: 2px;
}

.post-dry-run-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--blue);
}

.posts-pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

@media (max-width: 639.98px) {
  /* On phone, collapse the table to stacked cards. Each <tr> becomes a
     card, each <td> becomes a labelled row. We use the column header
     name as the label via data-label (set inline below as a fallback,
     but the simpler trick is to let mobile users live with horizontal
     scroll on the existing .responsive-table wrapper). Keeping it
     simple: rely on .responsive-table's overflow-x for now. */
  .posts-table {
    min-width: 560px;
  }
  .posts-filter-form {
    grid-template-columns: 1fr 1fr;
  }
  .posts-filter-submit {
    grid-column: 1 / -1;
  }
}

/* ─── /posts/{id} detail (M17-B partial) ───────────────────────────
   Single-post detail surface: meta-pills header, asset preview
   (image or HTML5 video), platform fan-out table, raw fields
   definition list with diagnostic-gap notice. */

.post-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.post-detail-back {
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--txt-dim);
  text-decoration: none;
}
.post-detail-back:hover {
  color: var(--blue);
}

.post-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.post-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-detail-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt-dim);
}

.post-detail-pill-format {
  color: var(--silver);
}
.post-detail-pill-fuel {
  color: var(--silver-dk);
}
.post-detail-pill-platform {
  color: var(--silver);
}
.post-detail-pill-dry-run {
  color: var(--blue);
  border-color: rgba(14, 165, 233, 0.35);
}
.post-detail-pill-live {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.35);
}

.post-detail-asset-image,
.post-detail-asset-video {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 600px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.post-detail-asset-image {
  height: auto;
}

.post-detail-asset-link {
  display: inline-block;
}

.post-detail-asset-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.post-detail-asset-path {
  font-size: 0.7rem;
  word-break: break-all;
}

.post-detail-empty {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
}

.post-detail-platforms .post-detail-current-row td {
  background: rgba(34, 197, 94, 0.06);
  border-top: 1px solid rgba(34, 197, 94, 0.25);
  border-bottom: 1px solid rgba(34, 197, 94, 0.25);
}

.post-detail-error {
  font-size: 0.7rem;
}

.post-detail-error-pre {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.30);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.post-detail-raw {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 0.85rem;
}

.post-detail-raw dt {
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.post-detail-raw dd {
  word-break: break-word;
  min-width: 0;
}

.post-detail-link {
  color: var(--txt);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.post-detail-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

@media (max-width: 639.98px) {
  .post-detail-raw {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .post-detail-raw dd {
    margin-bottom: 8px;
  }
}

/* ─── /bg-review (M21 V1) ──────────────────────────────────────────
   AI bg pending-review queue. Each row is a card with embedded
   <video> on the left, metadata + actions on the right. On phones
   the card stacks (video on top, meta below).
*/

.bg-counters {
  margin-left: 8px;
  font-size: 0.85em;
}

.bg-review-filter-form {
  /* Inherits from .posts-filter-form; nothing extra at desktop. */
}

.bg-review-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bg-asset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.bg-asset-video {
  width: 100%;
  max-width: 100%;
  border-radius: 4px;
  background: #000;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.bg-asset-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bg-asset-meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 12px;
  row-gap: 2px;
  margin: 0;
  font-size: 0.9em;
}
.bg-asset-meta-list dt {
  font-weight: 600;
  opacity: 0.7;
}
.bg-asset-meta-list dd {
  margin: 0;
}

.bg-asset-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.bg-approve-btn {
  background: #1f6f3f;
  border-color: #2e8754;
  color: #e8fff0;
}
.bg-approve-btn:hover {
  background: #267d49;
}

.bg-reject-btn {
  background: #6f1f1f;
  border-color: #8a2a2a;
  color: #ffeaea;
}
.bg-reject-btn:hover {
  background: #7d2626;
}

.bg-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85em;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  border: 1px solid currentColor;
  margin-top: 4px;
}
.bg-status-pill.bg-status-approved {
  color: #6ed28a;
}
.bg-status-pill.bg-status-rejected {
  color: #999;
}

/* M38: caption visibility on /posts detail. */
.post-detail-caption-cell {
  max-width: 380px;
  vertical-align: top;
}

.post-detail-caption-preview {
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 6px;
}

.post-detail-copy-button {
  font-size: 0.7rem;
  padding: 3px 10px;
  margin-right: 6px;
}

.post-detail-caption-full {
  margin-top: 6px;
  font-size: 0.75rem;
}

.post-detail-caption-full summary {
  cursor: pointer;
}

.post-detail-caption-pre {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 6px;
}

/* ─── Outreach (Phase 1) ───────────────────────────────────────────
   Reuses .status-card / .status-row / .label / .value / .auth-button.
   Only adds page-head, banner, record grid, count strip, progress
   bar, and a status-bad mono colour (mirrors .status-ok).
*/

.status-bad {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 13px;
}

.outreach-page-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.outreach-page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.outreach-phase-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--txt-faint);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
}

.outreach-card-sub {
  font-size: 11px;
  margin-left: 8px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.outreach-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.outreach-banner-label {
  font-size: 13px;
  font-weight: 600;
}

.outreach-banner-sub {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

.outreach-banner-ok {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
}
.outreach-banner-ok .outreach-banner-label { color: var(--green); }

.outreach-banner-fail {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}
.outreach-banner-fail .outreach-banner-label { color: var(--red); }

.outreach-banner-neutral {
  background: rgba(255, 255, 255, 0.03);
}

.outreach-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.outreach-record {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.outreach-record-ok {
  border-color: rgba(34, 197, 94, 0.35);
}
.outreach-record-ok .value { color: var(--green); }

.outreach-record-fail {
  border-color: rgba(239, 68, 68, 0.35);
}
.outreach-record-fail .value { color: var(--red); }

.outreach-record-neutral {
  border-color: rgba(255, 255, 255, 0.10);
}
.outreach-record-neutral .value { color: var(--txt-dim); }

@media (max-width: 639.98px) {
  .outreach-record-grid { grid-template-columns: 1fr; }
}

.outreach-records-detail {
  margin-top: 8px;
}

.outreach-records-detail summary {
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.outreach-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.outreach-refresh-btn {
  padding: 6px 14px;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}

.outreach-count-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.outreach-count-num {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--silver);
}

.outreach-count-sep {
  font-size: 24px;
  color: var(--txt-faint);
}

.outreach-count-cap {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--txt-dim);
}

.outreach-count-label {
  margin-left: 8px;
}

.outreach-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.outreach-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--silver-dk), var(--silver));
  transition: width 200ms ease;
}

.outreach-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
}

/* ─── Outreach (Phase 2) ───────────────────────────────────────────
   Contacts list, contact form, compose UI with inline slot editor,
   preview page, status badges, contact-status chips. Reuses Phase 1
   .status-card / .label / .value tokens; only adds layout-specific
   bits.
*/

/* Filters bar above the contacts list. */
.outreach-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.outreach-search { min-width: 240px; flex: 1 1 240px; }
/* `.outreach-select` was the Phase 2 styling for filter / form
   <select>s. It's superseded by the .outreach-form / .outreach-filters
   select rules below — the class is left on templates as harmless
   residue; the rule is removed so it can't compete in the cascade. */
.outreach-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--txt-dim);
}

/* Status chips strip on dashboard + contacts list. */
.outreach-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  margin-top: 6px;
}
.outreach-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  text-transform: lowercase;
}
.outreach-status-chip-label { font-weight: 500; }
.outreach-status-chip-count {
  font-family: var(--font-mono);
  color: var(--silver);
  font-variant-numeric: tabular-nums;
}

/* Contact-row status badge — coloured by status. */
.outreach-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.outreach-status-not_contacted   { color: var(--silver);  background: rgba(255, 255, 255, 0.04); }
.outreach-status-contacted       { color: var(--blue);    background: rgba(14, 165, 233, 0.10); border-color: rgba(14, 165, 233, 0.30); }
.outreach-status-replied         { color: var(--green);   background: rgba(34, 197, 94, 0.10);  border-color: rgba(34, 197, 94, 0.30); }
.outreach-status-declined        { color: var(--txt-dim); background: rgba(255, 255, 255, 0.04); }
.outreach-status-featured        { color: var(--green);   background: rgba(34, 197, 94, 0.16);  border-color: rgba(34, 197, 94, 0.45); }
.outreach-status-do_not_contact  { color: var(--red);     background: rgba(239, 68, 68, 0.10);  border-color: rgba(239, 68, 68, 0.35); }

/* Contacts table refinements. */
.outreach-contacts-table .outreach-contact-name {
  font-weight: 600;
  color: var(--txt);
  text-decoration: none;
}
.outreach-contacts-table .outreach-contact-name:hover { color: var(--silver); }
.outreach-contacts-table .outreach-contact-email {
  font-size: 11px;
  margin-top: 2px;
}
.outreach-row-action {
  padding: 4px 10px;
  font-size: 11px;
  text-decoration: none;
  display: inline-block;
}

/* Contact form layout. */
.outreach-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 4px;
}
.outreach-form-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.outreach-form-row .outreach-field { flex: 1 1 200px; min-width: 0; }
.outreach-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--txt-dim);
}
.outreach-field .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* Larger, comfortably-clickable inputs inside outreach forms only.
   Scoped to .outreach-form / .outreach-filters so /posts, /halts,
   /settings, login etc. keep their existing tighter input styles.
   Overrides the .lock-input defaults (which the templates also apply). */
.outreach-form input[type="text"],
.outreach-form input[type="email"],
.outreach-form input[type="url"],
.outreach-form input[type="number"],
.outreach-form input[type="search"],
.outreach-form input[type="password"],
.outreach-form input[type="file"],
.outreach-form select,
.outreach-form textarea,
.outreach-filters input[type="text"],
.outreach-filters select {
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
}

/* <select> needs the appearance: none + custom chevron treatment to
   render padding consistently across browsers — same pattern the
   halts page uses (see `.halt-form select` above for the rationale).
   Background / border / border-radius / focus colour mirror
   `.halt-form select` exactly so outreach selects sit in the same
   visual idiom as the rest of the ops dashboard. The chevron SVG and
   stroke colour are byte-for-byte identical. Padding stays at the
   Phase 3.1 outreach values (12/14, font 15) plus 40px right-padding
   so the chevron has clearance, matching the halt-form approach. */
.outreach-form select,
.outreach-filters select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--card-solid);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  cursor: pointer;
  outline: none;
  padding-right: 40px;
}
.outreach-form select:focus,
.outreach-filters select:focus {
  border-color: var(--blue);
}

.outreach-textarea { font-family: inherit; min-height: 96px; resize: vertical; }
.outreach-field-error {
  color: var(--red);
  font-size: 11px;
  font-family: var(--font-mono);
}
.outreach-personal-confirm {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 10px 12px;
  border-radius: 8px;
}
.outreach-personal-confirm input { margin-top: 2px; }
.outreach-source { word-break: break-word; }

/* Compose — body preview + slot inline-editor. */
.outreach-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.outreach-template-chip {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--txt-dim);
  text-decoration: none;
}
.outreach-template-chip-active {
  background: var(--silver);
  color: #09090b;
  border-color: var(--silver);
}

.outreach-body-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.outreach-body-static {
  font-family: var(--font-sans);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--txt);
}
.outreach-slot {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.outreach-slot-ok   { border-color: rgba(34, 197, 94, 0.40); background: rgba(34, 197, 94, 0.05); }
.outreach-slot-fail { border-color: rgba(245, 158, 11, 0.40); background: rgba(245, 158, 11, 0.05); }
.outreach-slot-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.outreach-slot-tag {
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.outreach-slot-hint { flex: 1 1 240px; min-width: 0; }
.outreach-slot-count { font-variant-numeric: tabular-nums; }
.outreach-slot-input {
  font-family: inherit;
  min-height: 60px;
  resize: vertical;
}

/* Preview page. */
.outreach-preview-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  align-items: baseline;
}
.outreach-preview-row:last-of-type { border-bottom: none; }
.outreach-preview-row .label { min-width: 90px; }
.outreach-preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 12px;
}
.outreach-issues {
  margin: 8px 0 0 16px;
  padding: 0;
  font-size: 12px;
  color: var(--red);
}

/* Danger button (DNC, delete). */
.auth-button.outreach-danger {
  background: rgba(239, 68, 68, 0.18);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.40);
}
.auth-button.outreach-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  filter: none;
}
.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Outreach (Phase 3) — follow-ups + replies + reporting ─── */

.outreach-followup-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.auth-button.outreach-skip-btn {
  background: transparent;
  color: var(--txt-dim);
  border: 1px solid var(--border);
}
.auth-button.outreach-skip-btn:hover { color: var(--txt); border-color: var(--silver); filter: none; }

.outreach-checkbox-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
}
.outreach-checkbox-row input { margin-top: 3px; flex-shrink: 0; }
.outreach-checkbox-row span { font-size: 12px; color: var(--txt); }

.outreach-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.outreach-note {
  border-left: 2px solid var(--border);
  padding: 4px 12px;
}
.outreach-note-when {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.outreach-note-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  color: var(--txt);
  margin-top: 2px;
}

/* Reporting page volume tiles + sparkline. */
.outreach-volume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.outreach-volume-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.outreach-volume-cell .label { display: block; }
.outreach-volume-cell .outreach-count-num {
  font-size: 28px;
  margin-top: 4px;
}
.outreach-sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.outreach-sparkline {
  color: var(--silver);
  display: block;
}

/* Right-aligned numeric column in tables. */
.status-table th.num,
.status-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── Pro-code duration picker (pill-button toggle) ──────────────
   Used by templates/outreach/_duration_picker.html. Shared between
   the contact-detail "Generate Pro code" form and /outreach/codes
   standalone-codes form. Pure CSS — the pill row is a set of
   visually-hidden radios + their labels styled as pills, so
   :checked + sibling/general-sibling selectors carry the active
   state without any JS. */

.duration-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.duration-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Hide the radios themselves; the labels become the click target.
   Avoid `display: none` so keyboard focus still lands on the radio
   and the surrounding label gets the focus-visible treatment. */
.duration-pill-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.duration-pill {
  cursor: pointer;
  user-select: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--silver);
  font-size: 14px;
  line-height: 1;
  transition: border-color 150ms ease, color 150ms ease, border-width 150ms ease;
}

.duration-pill:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.duration-pill-radio:checked + .duration-pill {
  color: var(--blue);
  border-color: var(--blue);
  border-width: 1.5px;
  /* match pill height despite the thicker border */
  padding: calc(8px - 0.5px) calc(16px - 0.5px);
}

.duration-pill-radio:focus-visible + .duration-pill {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Custom-days row: hidden by default, revealed only when the "Custom"
   pill is the :checked radio. We use :has() on the .duration-picker
   wrapper because the radio is nested inside .duration-pills (so the
   general-sibling combinator wouldn't reach .duration-custom-row).
   :has() is supported in every browser the ops dashboard targets
   (Chrome 105+, Safari 15.4+, Firefox 121+). */

.duration-custom-row {
  display: none;
  align-items: center;
  gap: 10px;
}

.duration-picker:has(.duration-pill-radio-custom:checked) .duration-custom-row {
  display: flex;
}

.duration-custom-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

.duration-custom-input {
  max-width: 120px;
}
