/* Black/white "application" theme (Shopify-admin style) for the authenticated
   /app area — deliberately monochrome, no green/red brand accents. Scoped
   under .app-shell so it never leaks onto the marketing pages. */
.app-shell {
  background: #FFFFFF;
  color: #0A0A0A;
  font-family: var(--font-body);
  min-height: 100vh;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid #E5E5E5;
}

.app-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #0A0A0A;
  text-decoration: none;
}
.app-topbar-logo .logo-icon {
  width: 23px;
  height: 23px;
  color: var(--green);
  --logo-surface: #fff;
}
.app-topbar-logo-context {
  font-weight: 400;
  color: #6E6E6E;
}

/* The admin topbar's right-hand side: who is signed in, and the way out. */
.app-topbar-account {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-topbar-email {
  font-size: 13px;
  color: #6E6E6E;
}

.app-topbar-signout {
  font-size: 14px;
  color: #0A0A0A;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 64px 24px;
}

/* Onboarding only: wide enough that the two-column industry picker fits
   "Mobile Subscription" on one line. */
.app-main--wide {
  max-width: 560px;
}

.app-card {
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  padding: 40px;
}

.app-heading {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
}

.app-subheading {
  font-size: 15px;
  color: #555555;
  margin: 0 0 32px;
}

.app-flash {
  margin: 0 0 20px;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid #C7C7C7;
  border-radius: 6px;
  background: #F7F7F7;
  color: #0A0A0A;
}

/* An alert and a notice look the same: one grey box, the role attribute and
   the longer timer are what tell them apart. A black bar for every "something
   went wrong" read as a system failure when it was usually "you are already
   signed in". */

/* Auto-dismissing flash. The class is added by the flash Stimulus controller,
   so with JS off the box keeps its original padding and neither the timer bar
   nor the close button is ever shown. The right padding is the close button's
   gutter — text must not run under it. */
.app-flash--timed {
  position: relative;
  overflow: hidden;
  padding-inline-end: 44px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-flash--leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.app-flash-timer {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  transform-origin: left center;
  animation: app-flash-drain linear forwards;
}

/* Hovering or focusing the message pauses the bar, and with it the dismissal —
   the animation ending is what removes the flash. */
.app-flash--timed:hover .app-flash-timer,
.app-flash--timed:focus-within .app-flash-timer {
  animation-play-state: paused;
}

@keyframes app-flash-drain {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.app-flash-close {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
}
.app-flash-close:hover { opacity: 1; }
.app-flash-close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .app-flash--timed { transition: none; }
}

/* Shown across the /app shell whenever staff are impersonating a merchant
   from the internal /admin panel — deliberately loud (unlike the rest of
   the monochrome console) since it's a warning, not brand chrome. */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: #A93B2A;
  color: #FFFFFF;
  font-size: 13.5px;
  text-align: center;
}

.impersonation-banner-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.impersonation-banner-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: #FFFFFF;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.75;
}

.impersonation-banner-copy svg {
  display: block;
  width: 12px;
  height: 12px;
}

.impersonation-banner-copy:hover { opacity: 1; border-color: rgba(255, 255, 255, 0.5); }
.impersonation-banner-copy:focus-visible { opacity: 1; outline: 2px solid #FFFFFF; outline-offset: 1px; }

.impersonation-banner-copy-idle,
.impersonation-banner.is-copied .impersonation-banner-copy-done { display: flex; }

.impersonation-banner-copy-done,
.impersonation-banner.is-copied .impersonation-banner-copy-idle { display: none; }

.impersonation-banner.is-copied .impersonation-banner-copy { opacity: 1; }

.impersonation-banner-exit {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  background: none;
  border: 1px solid #FFFFFF;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.app-form-field {
  margin-bottom: 20px;
}

.app-form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.app-checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

.app-checkbox-field input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.app-checkbox-field label {
  font-size: 14px;
  font-weight: 400;
  margin: 0;
}

.app-checkbox-field label a {
  color: #0A0A0A;
  text-decoration: underline;
}

.app-form-field input[type="text"],
.app-form-field input[type="email"],
.app-form-field input[type="password"],
.app-form-field input[type="url"],
.app-form-field input[type="tel"],
.app-form-field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: #0A0A0A;
  background: #FFFFFF;
  border: 1px solid #C7C7C7;
  border-radius: 6px;
}

.app-form-field input:focus,
.app-form-field select:focus {
  outline: none;
  border-color: #0A0A0A;
}

/* Tiled single-choice picker (onboarding's Industry). A <fieldset>/<legend>
   because it's one question with several answers; the radios stay in the DOM
   for keyboard and screen readers and the sibling tile draws the state, so no
   :has() is needed. Radios, not checkboxes: an account has exactly one
   industry. */
.app-choice-field {
  border: none;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}

.app-choice-field legend {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Two fixed columns rather than auto-fit: the card is only ~350px wide, so a
   third column leaves too little room for "E-Commerce" and the label spills
   out of its tile. minmax(0, 1fr) (not 1fr) lets a column be narrower than its
   content, which is what makes the long labels wrap instead. */
.app-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 480px) {
  .app-choice-grid {
    grid-template-columns: 1fr;
  }
}

.app-form-field .app-choice {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

/* Off-screen rather than display:none — a hidden input can't take focus. */
.app-choice input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.app-choice-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #C7C7C7;
  border-radius: 6px;
  background: #FFFFFF;
}

.app-choice-name {
  min-width: 0;
  overflow-wrap: break-word;
}

.app-choice-tile:hover {
  border-color: #8A8A8A;
}

.app-choice-box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1px solid #C7C7C7;
  border-radius: 4px;
  background: #FFFFFF;
}

.app-choice input[type="radio"]:checked + .app-choice-tile {
  border-color: #0A0A0A;
  box-shadow: inset 0 0 0 1px #0A0A0A;
}

.app-choice input[type="radio"]:checked + .app-choice-tile .app-choice-box {
  border-color: #0A0A0A;
  background: #0A0A0A;
}

.app-choice input[type="radio"]:checked + .app-choice-tile .app-choice-box::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin: 1px auto 0;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.app-choice input[type="radio"]:focus-visible + .app-choice-tile {
  outline: 2px solid #0A0A0A;
  outline-offset: 2px;
}

.app-btn {
  display: inline-block;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #FFFFFF;
  background: #0A0A0A;
  border: 1px solid #0A0A0A;
  border-radius: 6px;
  cursor: pointer;
}

.app-btn:hover {
  background: #222222;
}

.app-links {
  margin-top: 24px;
  font-size: 14px;
  text-align: center;
}

.app-links a {
  color: #0A0A0A;
}

.app-error-messages {
  border: 1px solid #0A0A0A;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

.app-error-messages ul {
  margin: 4px 0 0;
  padding-inline-start: 18px;
}

/* ============================================================
   App Console — Shopify-admin-style sidebar shell for the connected
   /app product area (Dashboard, Disputes, Connection, Settings).
   Scoped under .app-console; a distinct token set from the marketing
   --ink/--green/--red system (different semantics — Stripe-style
   destructive/success accents, not "us vs competitor").
   ============================================================ */
/* The tokens also reach /admin's recovery edit form, which renders the
   console's own form fields (app/recovery_cases/_field). */
.app-console,
.admin-recovery-edit {
  --console-canvas: #F6F6F7;
  --console-surface: #FFFFFF;
  --console-border-card: #E3E3E3;
  --console-border-row: #F0F0F0;
  --console-border-input: #C9C9C9;
  --console-text-primary: #1A1A1A;
  --console-text-secondary: #6B6B6B;
  --console-text-disabled: #B5B5B5;
  --console-error: #D82C0D;
  --console-error-border: #E3B3AA;
  --console-won: #0F5132;
  --console-amber: #B7791F;
  --console-amber-bg: #FDF3E7;
  --console-radius-card: 10px;
  --console-radius-control: 7px;
  --console-radius-pill: 999px;
}

.app-console {
  background: var(--console-canvas);
  color: var(--console-text-primary);
  font-family: var(--font-app-body);
  font-size: 14px;
  min-height: 100vh;
}

/* The marketing site's global `a:hover { color: var(--green-dark) }`
   (02_base.css) outranks single-class app-console rules by specificity —
   this blanket override keeps every link in the console black/white/gray.
   Excludes .app-console-btn links so their own hover color isn't clobbered
   (otherwise dark-background buttons like .app-console-btn--primary go
   text-color: inherit on hover and the label disappears). */
.app-console a:not(.app-console-btn):hover {
  color: inherit;
}

.app-console-layout {
  display: flex;
  min-height: 100vh;
}

.app-console-sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--console-surface);
  border-inline-end: 1px solid var(--console-border-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  /* Sticky already makes the rail a stacking context; naming a z-index puts
     that whole context over the page so a nav tooltip can hang outside it. */
  z-index: 5;
}

/* Everything under the logo row. On desktop it's the rail itself — flex:1 with
   the nav at the top and the sign-out block pinned to the bottom, which is what
   the sidebar's own space-between used to do before the burger split the two. */
.app-console-sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Only ever on screen below the mobile breakpoint. */
.app-console-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  color: var(--console-text-primary);
  cursor: pointer;
}

.app-console-nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.app-console-nav-toggle-bars span {
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* 2px bars 3px apart put the outer two 5px off centre, so that's the travel
   each needs to meet in the middle as an X. */
.app-console-sidebar--open .app-console-nav-toggle-bars span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.app-console-sidebar--open .app-console-nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.app-console-sidebar--open .app-console-nav-toggle-bars span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

.app-console-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 20px 18px;
  text-decoration: none;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--console-text-primary);
}
.app-console-logo .logo-icon {
  width: 23px;
  height: 23px;
  color: var(--green);
  --logo-surface: var(--console-surface);
}

.app-console-divider {
  height: 1px;
  background: var(--console-border-card);
  margin: 0 20px 16px;
}

.app-console-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Same 20px inset as the divider and the footer — an item's pill must not
     run wider than the rule under the logo. */
  padding: 0 20px;
}

.app-console-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--console-radius-control);
  font-size: 13.5px;
  font-weight: 600;
  color: #3A3A3A;
  text-decoration: none;
  position: relative;
}

.app-console-nav-item--active {
  background: var(--console-text-primary);
  color: var(--console-surface);
}

.app-console-nav-item:not(.app-console-nav-item--active):hover {
  background: var(--console-canvas);
}

.app-console-nav-item--disabled {
  color: var(--console-text-disabled);
  cursor: not-allowed;
}

.app-console-nav-item--disabled:focus-visible {
  outline: 2px solid var(--console-text-primary);
  outline-offset: 1px;
}

/* The tooltip on a nav item that's switched off. Sits outside the rail on
   desktop — the sidebar carries the z-index that lets it over the page, since
   position:sticky makes the rail its own stacking context and no z-index in
   here can climb out of it. */
.app-console-nav-hint {
  position: absolute;
  inset-inline-start: calc(100% + 12px);
  top: 50%;
  width: max-content;
  max-width: 220px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--console-text-primary);
  color: var(--console-surface);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  pointer-events: none;
  z-index: 10;
}

/* The little beak pointing back at the item. */
.app-console-nav-hint::before {
  content: "";
  position: absolute;
  inset-inline-end: 100%;
  top: 50%;
  border: 5px solid transparent;
  border-inline-end-color: var(--console-text-primary);
  transform: translateY(-50%);
}

.app-console-nav-item--disabled:hover .app-console-nav-hint,
.app-console-nav-item--disabled:focus-visible .app-console-nav-hint {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

@media (prefers-reduced-motion: reduce) {
  .app-console-nav-hint { transition: none; }
}

/* Matches the specificity of the global `.app-console a:not(.app-console-btn):hover`
   color: inherit override above so the active item keeps its white label on hover
   instead of inheriting the dark default nav-item text color onto its dark background. */
.app-console a.app-console-nav-item--active:not(.app-console-btn):hover {
  color: var(--console-surface);
}

.app-console-nav-item svg {
  flex-shrink: 0;
}

.app-console-nav-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 16px;
  flex-shrink: 0;
}

.app-console-nav-bars span {
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.app-console-nav-bars span:last-child {
  width: 60%;
}

.app-console-nav-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--console-text-primary);
  color: var(--console-surface);
  border-radius: var(--console-radius-pill);
  padding: 1px 7px;
  margin-inline-start: auto;
}

.app-console-nav-item--active .app-console-nav-badge {
  background: var(--console-surface);
  color: var(--console-text-primary);
}

.app-console-sidebar-footer {
  padding: 12px 20px 16px;
}

/* The rule sits under Get support, not over it: support is one more thing a
   merchant can do, so it reads with the nav, and the line's job is to fence
   off the account identity underneath. */
.app-console-signed-in-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--console-border-card);
  padding-top: 12px;
}

/* truncated_email() cuts by character count, which can't know glyph widths —
   a wide all-caps address still overruns the column the icon leaves it. Clip
   whatever is left. */
.app-console-signed-in-email {
  font-size: 13.5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-support {
  display: block;
  font-size: 13px;
  color: var(--console-text-secondary);
  text-decoration: none;
  margin-bottom: 12px;
}

.app-console-support:hover {
  color: var(--console-text-primary);
}

.app-console-signout-form {
  flex: none;
  line-height: 0;
}

.app-console-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--console-text-secondary);
  background: none;
  border: none;
  border-radius: var(--console-radius-control);
  cursor: pointer;
  padding: 0;
}

.app-console-signout:hover {
  color: var(--console-text-primary);
  background: var(--console-canvas);
}

/* The work sits in a column of its own rather than stretching to whatever
   width the monitor happens to be: past ~1280px a table row and a card just
   get longer to read, they don't get better. The cap is a side padding rather
   than a max-width on a wrapper so nothing that draws a line — the
   test-mode banner — loses its edges; only the work inside is pulled in. Below the cap the gutter is the plain 32px it always was. */
.app-console-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  --console-column: 1280px;
  --console-gutter: max(32px, (100% - var(--console-column)) / 2);
}

.app-console-banner--testmode {
  background: var(--console-text-primary);
  color: var(--console-surface);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 32px;
  text-align: center;
}

/* The page's title and back link sit on the canvas at the head of the work
   column — no bar, no fill, no rule — so they read as the top of the page
   rather than as chrome above it. The account's name keeps the far end of the
   same row. The content's top padding is what puts the title on the logo's
   line: the wordmark's 23px line sits 20px down the sidebar, and 14px centres
   the title's 34px line on it — change the title's size and redo the sum. */
.app-console-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.app-console-page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-console-back {
  cursor: pointer;
  font-size: 13px;
  color: var(--console-text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.app-console-page-title {
  font-family: var(--font-app-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-console-mode-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--console-radius-pill);
  background: var(--console-border-row);
  color: var(--console-text-secondary);
  border: 1px solid var(--console-border-card);
}

.app-console-mode-badge--live {
  background: var(--console-text-primary);
  color: var(--console-surface);
  border-color: var(--console-text-primary);
}

.app-console-business-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-account-switcher {
  position: relative;
}

.app-console-account-switcher summary {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-account-switcher summary::-webkit-details-marker {
  display: none;
}

.app-console-account-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 220px;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 10;
}

.app-console-account-switcher-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  border-radius: var(--console-radius-control);
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-app-body);
}

.app-console-account-switcher-item:hover {
  background: var(--console-canvas);
}

.app-console-account-switcher-item--active {
  background: var(--console-canvas);
}

.app-console-account-switcher-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--console-text-primary);
}

.app-console-account-switcher-item-role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--console-text-secondary);
  text-transform: capitalize;
}

.app-console-content {
  flex: 1;
  padding: 14px var(--console-gutter) 32px;
  overflow-y: auto;
}

.app-console-card {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  padding: 28px;
}

.app-console-card--centered {
  text-align: center;
  padding: 40px;
}

.app-console-card-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 6px;
}

/* A connect card that leads with the provider's mark. The row owns the bottom
   margin the bare title carries, so a card with a mark and one without sit at
   the same rhythm. */
.app-console-card-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
}

.app-console-card-heading-row .app-console-card-title {
  margin: 0;
}

.app-console-card-body {
  font-size: 13.5px;
  color: var(--console-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* The permission list on the Stripe app connect card — the one place a card
   body is a list rather than a paragraph. */
.app-console-card-list {
  font-size: 13.5px;
  color: var(--console-text-secondary);
  line-height: 1.5;
  margin: 10px 0 0;
  padding-inline-start: 18px;
}

.app-console-card-list li {
  margin-bottom: 4px;
}

.app-console-form-field {
  margin-bottom: 14px;
}

.app-console-form-field:last-child {
  margin-bottom: 0;
}

.app-console-form-field label {
  display: block;
  font-size: 12.5px;
  color: var(--console-text-secondary);
  margin-bottom: 6px;
}

.app-console-form-field input[type="text"],
.app-console-form-field input[type="email"],
.app-console-form-field input[type="password"],
.app-console-form-field input[type="file"],
.app-console-form-field input[type="number"],
.app-console-form-field textarea {
  width: 100%;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-app-body);
  outline: none;
  box-sizing: border-box;
}

.app-console-form-field textarea {
  resize: vertical;
}

/* Not `input.…` — the Apple .p8 paste box is a textarea, and a key is the one
   thing that must never render in a proportional font. */
.app-console-form-field .app-console-input--mono {
  font-family: var(--font-mono);
}

/* A checkbox whose sentence wraps: the second line lines up with the text,
   not with the box. */
.app-console-form-field label.app-console-check-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.app-console-check-label input[type="checkbox"] {
  flex-shrink: 0;
  margin: 2px 0 0;
}

/* An amount typed into the middle of a sentence (the eBay rules). Sized to
   the text around it, and kept with its currency so a wrap never leaves "USD"
   at the end of one line and the box alone on the next. */
.app-console-inline-amount {
  white-space: nowrap;
}

.app-console-form-field input.app-console-input--inline {
  display: inline-block;
  width: 88px;
  margin-inline-start: 4px;
  padding: 3px 8px;
  font-size: 12.5px;
  vertical-align: baseline;
}

.app-console-form-field input:focus,
.app-console-form-field textarea:focus {
  border-color: var(--console-text-primary);
}

.app-console-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-app-body);
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--console-radius-control);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.app-console-btn--primary {
  background: var(--console-text-primary);
  color: var(--console-surface);
}

.app-console-btn--primary:hover {
  background: #333333;
  color: var(--console-surface);
}

/* The one button that sends a response — green, because green is us and the
   money coming back. Only "Approve & Submit" and its per-provider variants. */
.app-console-btn--approve {
  background: var(--console-won);
  color: var(--console-surface);
}

.app-console-btn--approve:hover {
  background: #0B3F27;
  color: var(--console-surface);
}

.app-console-btn--approve:focus-visible {
  outline: 2px solid var(--console-won);
  outline-offset: 2px;
}

.app-console-btn--secondary {
  background: var(--console-surface);
  color: var(--console-text-primary);
  border: 1px solid var(--console-border-input);
  font-weight: 600;
}

/* Destructive actions sit quiet until you're on them: several Disconnect and
   Remove buttons can be on screen at once, and permanently-red ones drown out
   the red that means something is actually broken. */
.app-console-btn--danger {
  background: var(--console-surface);
  color: var(--console-text-secondary);
  border: 1px solid var(--console-border-input);
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s;
}

.app-console-btn--danger:hover {
  color: var(--console-error);
  border-color: var(--console-error-border);
}

.app-console-btn--full {
  width: 100%;
}

.app-console-btn--sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.app-console-btn--xs {
  padding: 6px 11px;
  font-size: 12px;
}

.app-console-btn--link {
  background: none;
  color: var(--console-text-secondary);
  font-weight: 600;
  font-size: 13px;
  padding: 6px;
  text-decoration: underline;
}

.app-console-error-messages {
  border: 1px solid var(--console-error);
  border-radius: var(--console-radius-control);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--console-error);
}

.app-console-error-messages ul {
  margin: 4px 0 0;
  padding-inline-start: 18px;
}

.app-console-scope-checklist {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  margin: 0 0 18px;
  padding-inline-start: 18px;
  line-height: 1.6;
}

.app-console-scope-checklist code {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.app-console-field-hint {
  font-size: 12px;
  color: var(--console-text-secondary);
  margin: 6px 0 0;
}

/* Sits on a span inside an .app-console-field-hint, which owns the size and
   margins — this only recolors the text. */
.app-console-field-hint--error {
  color: var(--console-error);
}

.app-console-connection-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

/* Why a connection failed — prose, so it gets the body font and full card
   width rather than the right-aligned mono treatment the value rows use. */
.app-console-connection-error {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--console-error);
  margin: -6px 0 20px;
}

.app-console-connection-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.app-console-connection-row-label {
  color: var(--console-text-secondary);
  flex-shrink: 0;
}

.app-console-connection-row-value {
  font-family: var(--font-mono);
  text-align: end;
}

/* An order's shipments on the dispute's order card: one right-aligned block
   per box, the carrier and number first, the date muted beneath, so three
   boxes read as three rather than one wrapped paragraph. */
.app-console-shipments {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-console-shipments li {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  overflow-wrap: anywhere;
}

.app-console-shipments-meta {
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-shipments-meta:empty {
  display: none;
}

/* The same boxes once carrier tracking is on (_tracked_boxes): each box is a
   block across the card, because it now carries sentences — the carrier's
   status line, the scan history behind a <details>, the checks' notes and the
   proofs. Warnings are amber and strengths green; never red, which is
   competitors and losses only. */
.app-console-boxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.app-console-boxes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-console-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--console-border-row);
  border-radius: var(--console-radius-control);
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-console-box-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 10px;
}

.app-console-box-label {
  font-family: var(--font-mono);
}

.app-console-box-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--console-text-secondary);
}

.app-console-box-status--delivered {
  color: var(--console-won);
}

.app-console-box-history summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-box-history ol {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 0 10px;
  border-inline-start: 2px solid var(--console-border-row);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
}

.app-console-box-history li {
  display: flex;
  flex-direction: column;
}

.app-console-box-history-when {
  font-family: var(--font-mono);
  color: var(--console-text-secondary);
}

.app-console-box-notes,
.app-console-box-proofs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.45;
}

.app-console-box-notes li {
  padding: 6px 8px;
  border-inline-start: 3px solid;
  border-radius: 0 4px 4px 0;
}

.app-console-box-notes--warning li {
  border-color: var(--console-amber);
  background: var(--console-amber-bg);
}

.app-console-box-notes--strength li {
  border-color: var(--console-won);
  background: #EEF6F1;
}

.app-console-box-notes--note li {
  border-color: var(--console-border-input);
  background: var(--console-canvas);
}

.app-console-box-next-step {
  color: var(--console-text-secondary);
}

.app-console-box-proofs a {
  color: var(--console-text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   Connections page — providers grouped into sections, one tile per
   provider in a grid. Tiles carry their own hairline-sectioned shape
   (head / body / action) rather than reusing the flat .app-console-card,
   so a connected tile and an empty one are the same object with
   different contents instead of two different-looking cards.
   ============================================================ */
.app-console-connections {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 1120px;
}

/* Shown once, to an account that has never connected a processor. Deliberately
   not a card: it's the page's introduction, not another tile competing with the
   nine real ones below it. */

/* Its other form: a store is connected and the processor isn't, so the block
   is asking for something rather than welcoming anyone. The green rule is the
   only difference — enough to read as a step to take, not so much that it
   becomes an alert about a connection that is working fine. */
.app-console-connections-welcome--next {
  border-inline-start: 3px solid var(--green-signal);
  padding-inline-start: 14px;
}

.app-console-connections-welcome-title {
  font-family: var(--font-app-display);
  /* Under the page header's title on purpose — "Connections" stays the
     page's heading and this reads as the sentence below it. */
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.app-console-connections-welcome-body {
  margin: 0;
  max-width: 62ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--console-text-secondary);
}

.app-console-connections-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--console-text-secondary);
  /* The gap to the grid used to come from the group note's margin-bottom; the
     notes are gone, so the label owns it. Kept well under the gap between
     groups, so a title still reads as attached to the tiles below it. */
  margin: 0 0 12px;
}

/* The one group that carries a sentence (ConnectionCatalog::Group#intro): the
   AI assistants, whose tiles can't be pressed to connect. Pulled up under the
   title so title, sentence and tiles read as one block. */
.app-console-connections-group-intro {
  margin: -4px 0 12px;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--console-text-secondary);
}

.app-console-connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  /* Every card here is a live connection with rows of its own, so stretching
     lands each one's actions on the row's baseline however many rows it has. */
  align-items: stretch;
}

/* "Add a connection" — the second half of the page, and deliberately quieter
   than the cards above it. The heading is the page title's size class, the
   group labels underneath it are the same small-caps mono the card grid used. */
.app-console-connections-section-title {
  font-family: var(--font-app-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  /* No margin of its own — the section is a flex column and its gap owns the
     space, or the heading gets it twice over. */
  margin: 0;
}

.app-console-connections-add-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.app-console-connections-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

/* A provider you could connect: mark, name, cue. One line, no button — the
   whole tile is the target, which is why the cue is a hint and not a control. */
.app-console-connection-add {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 14px;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

a.app-console-connection-add:hover {
  border-color: var(--console-text-disabled);
}

.app-console-connection-add .app-console-connection-card-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.app-console-connection-add .app-console-connection-card-mark svg {
  width: 16px;
  height: 16px;
}

.app-console-connection-add-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  /* The console's blanket a:hover { color: inherit } already holds these to the
     body ink; naming it here keeps a linked tile reading like a tile. */
  color: var(--console-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "+" on the ones you can press, "↗" on the ones that finish on somebody else's
   site, and the reason in words on the ones you can't press at all. */
.app-console-connection-add-cue {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--console-text-disabled);
}

a.app-console-connection-add:hover .app-console-connection-add-cue {
  color: var(--console-text-secondary);
}

.app-console-connection-add--locked {
  background: none;
}

.app-console-connection-add--locked .app-console-connection-add-name {
  color: var(--console-text-secondary);
}

.app-console-connection-add--locked .app-console-connection-add-cue {
  font-size: 11.5px;
}

.app-console-connection-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
}

/* mark | name + label | status. min-height is the two-line (named connection)
   case, so the hairline lands at the same y on every tile in a row whether or
   not the merchant labelled that connection. */
.app-console-connection-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 77px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--console-border-row);
}

/* The provider mark sits in a tile rather than bare: at 18px a solid brand
   glyph next to an 18px title reads as a stray inkblot, and the tile gives
   every provider the same footprint however wide its mark is. */
.app-console-connection-card-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--console-canvas);
  color: var(--console-text-primary);
}

.app-console-connection-card-mark svg {
  width: 18px;
  height: 18px;
}

.app-console-connection-card-mark svg.app-console-provider-icon--wide {
  width: 23px;
  height: 23px;
}

/* Our own mark in a provider tile: outlined rather than solid, so it needs a
   couple more px to hold the same optical weight as the brand glyphs, and its
   front card has to be filled with the tile's background to occlude the stack.
   No color of its own — it inherits the tile's ink like every vendor mark, so
   the grid stays monochrome and one tile doesn't shout over the rest. */
.app-console-connection-card-mark .logo-icon {
  width: 21px;
  height: 21px;
  --logo-surface: var(--console-canvas);
}

.app-console-provider-initial {
  font-family: var(--font-app-display);
  font-size: 15px;
  font-weight: 600;
}

.app-console-connection-card-heading {
  flex: 1;
  min-width: 0;
}

.app-console-connection-card-name {
  font-family: var(--font-app-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.app-console-connection-card-sublabel {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--console-text-secondary);
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A dot and a word, not a filled chip — six tiles sit side by side here and
   solid status fills turn the grid into confetti. */
.app-console-connection-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--console-text-secondary);
  white-space: nowrap;
}

.app-console-connection-card-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--console-text-disabled);
}

.app-console-connection-card-status--on {
  color: var(--console-won);
}

.app-console-connection-card-status--on::before {
  background: var(--console-won);
}

.app-console-connection-card-status--pending {
  color: var(--console-amber);
}

.app-console-connection-card-status--pending::before {
  background: var(--console-amber);
}

/* Connected, but something the merchant has to finish — a Shopify shop
   whose billing isn't approved. Amber, never red: nothing is lost. */
.app-console-connection-card-status--attention {
  color: var(--console-amber);
}

.app-console-connection-card-status--attention::before {
  background: var(--console-amber);
}

.app-console-connection-card-status--error {
  color: var(--console-error);
}

.app-console-connection-card-status--error::before {
  background: var(--console-error);
}

/* flex: 1 so every tile in a row is the same height and their actions land on
   one baseline, however many detail rows each provider has. */
.app-console-connection-card-body {
  flex: 1;
  padding: 16px 20px;
  font-size: 13px;
}

.app-console-connection-card-body .app-console-connection-rows {
  gap: 11px;
  margin-bottom: 0;
}

/* A tile is a third of the width the old single-column list had, and account
   ids and store hostnames are long unbroken mono strings — let them wrap
   instead of pushing the tile past its grid track. */
.app-console-connection-card-body .app-console-connection-row-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-console-connection-card-body .app-console-connection-error {
  margin: 14px 0 0;
}

/* A row whose value is a control (the eBay handling dropdown and its gear)
   rather than a mono fact: centred on the control's height, not the text's. */
.app-console-connection-row--control {
  align-items: center;
}

/* The sentence under a control row, saying what the current choice does. */
.app-console-connection-row-note {
  margin: -5px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--console-text-secondary);
}

.app-console-ebay-handling {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.app-console-ebay-handling-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.app-console-ebay-handling-form select {
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: var(--font-app-body);
  color: var(--console-text-primary);
  background: var(--console-surface);
}

.app-console-ebay-handling-form select:disabled {
  color: var(--console-text-disabled);
}

.app-console-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--console-radius-control);
  color: var(--console-text-secondary);
}

.app-console-icon-btn:hover,
.app-console-icon-btn:focus-visible {
  color: var(--console-text-primary);
  background: var(--console-canvas);
}

.app-console-connection-card-copy {
  color: var(--console-text-secondary);
  line-height: 1.55;
  margin: 0;
}

.app-console-connection-card-body .app-console-settings-hint {
  margin: 14px 0 0;
}

.app-console-connection-card-body > .app-console-billing-badge {
  margin-bottom: 12px;
}

/* Wraps because an errored store carries two actions (Reconnect + Disconnect)
   and they won't share a line in a narrow grid track. */
.app-console-connection-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--console-border-row);
}

/* Out-links to the merchant's own storefront. The console's blanket
   `a:hover { color: inherit }` keeps these black, so the underline is what
   marks them clickable. */
.app-console-connection-row-link {
  color: var(--console-text-primary);
  text-decoration: underline;
  text-decoration-color: var(--console-border-input);
  text-underline-offset: 2px;
}

.app-console-connection-row-link:hover {
  text-decoration-color: var(--console-text-primary);
}

/* "Missing a connection you need?" — one small secondary button under the last
   group, quiet enough that it never competes with the tiles above it, opening
   the request popup below. */
.app-console-connection-request {
  margin-top: -12px;
}

.app-console-connection-request-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 7px 12px;
  font-family: var(--font-app-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--console-text-secondary);
  background: var(--console-surface);
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  transition: color 0.15s, border-color 0.15s;
}

.app-console-connection-request-toggle:hover {
  color: var(--console-text-primary);
  border-color: var(--console-text-primary);
}

/* ============================================================
   Console popup — a native <dialog> opened with showModal(). The
   browser owns the backdrop, Esc, the focus trap and the inert page
   behind it; everything here is appearance only. Sized and centred by
   the UA stylesheet's `margin: auto`, so no fixed positioning.
   ============================================================ */
.app-console-dialog {
  width: min(440px, calc(100vw - 40px));
  padding: 24px;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  color: var(--console-text-primary);
  font-family: var(--font-app-body);
}

.app-console-dialog::backdrop {
  background: rgba(10, 15, 13, 0.5);
}

.app-console-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.app-console-dialog-title {
  font-family: var(--font-app-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.app-console-dialog-close {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--console-text-secondary);
}

.app-console-dialog-close:hover {
  color: var(--console-text-primary);
}

.app-console-dialog-intro {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--console-text-secondary);
}

/* Cancel first, send second — the destructive-free pair reads left to right,
   and the primary keeps the corner the eye lands on last. */
.app-console-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ============================================================
   Dashboard / Disputes — stat cards, table rows, chips, toggles.
   Row grid columns match the design spec: 64px 1fr(min0) 90px
   minmax(0,180px) 190px = deadline, customer, amount, reason, chip.
   ============================================================ */
.app-console-panel {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.app-console-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--console-border-card);
  font-weight: 700;
  font-size: 14px;
}

.app-console-panel-header-note {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  font-weight: 400;
  margin-inline-start: 8px;
}

.app-console-panel-empty {
  padding: 20px;
  font-size: 13.5px;
  color: var(--console-text-secondary);
}

.app-console-panel-footer-link {
  display: block;
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--console-text-primary);
  text-decoration: none;
}

.app-console-row {
  display: grid;
  /* 104px, not 64: the first column also holds a settled case's outcome, and
     "No chargeback" (or "Won / Lost") in the mono face is ~100px — at 64 it
     wrapped out of its track and ran into the customer's name. */
  grid-template-columns: 104px minmax(0, 1fr) 90px minmax(0, 180px) 190px;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--console-border-row);
  text-decoration: none;
  color: inherit;
}

/* A row is one link; a light wash under the pointer (or keyboard focus) says
   which case a click opens. */
a.app-console-row {
  transition: background-color 120ms ease;
}

a.app-console-row:hover,
a.app-console-row:focus-visible {
  background: var(--console-canvas);
}

a.app-console-row:focus-visible {
  outline: 2px solid var(--console-won);
  outline-offset: -2px;
}

/* Closed cases on the disputes list: grey, chips included, until hovered or
   focused — then exactly as an open row reads. The open sections above are
   where a merchant's attention belongs, and a long run of green "Won" chips
   used to compete with the one case that still needed them. The filter sits
   on the cells, not the row, so the row's own divider keeps its colour. */
.app-console-row--closed > * {
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter 120ms ease, opacity 120ms ease;
}

.app-console-row--closed:hover > *,
.app-console-row--closed:focus-visible > * {
  filter: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  a.app-console-row,
  .app-console-row--closed > * {
    transition: none;
  }
}

.app-console-panel > .app-console-row:last-of-type {
  border-bottom: none;
}

.app-console-row--header {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--console-text-secondary);
  border-bottom: 1px solid var(--console-border-row);
}

.app-console-row-customer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}

/* The ellipsis moved off the cell and onto the name when the mark joined it —
   on the flex parent it would have clipped the mark instead of the text. */
.app-console-row-customer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tags after the name keep their full width; the name is what ellipsizes. */
.app-console-row-tags {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  font-weight: normal;
}

/* The provider's mark at list size: bare glyph, no tile. The connections page
   and the dispute's deadline card frame theirs because they're the subject
   there; here it's a scanning cue next to a name, and 14px of quiet ink is
   all it should be. `title` rather than the hint bubble — a bubble per row
   would be forty of them on one page. */
.app-console-row-mark {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--console-text-secondary);
}

.app-console-row-mark svg {
  width: 14px;
  height: 14px;
}

/* Whop, Affirm and Woo draw wordmarks in the same 24x24 box, so they read
   smaller at the same height — the connections tile makes the same allowance. */
.app-console-row-mark svg.app-console-provider-icon--wide {
  width: 18px;
  height: 18px;
}

.app-console-row-amount {
  font-family: var(--font-mono);
}

/* The FX disclosure under a converted fee. A second line inside the amount
   cell, quiet enough not to compete with the number it explains — the number is
   what a merchant scans for, the rate is what they check once. */
.app-console-row-note {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--console-text-secondary);
  white-space: normal;
}

.app-console-row-reason {
  color: var(--console-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-console-countdown {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--console-text-primary);
  white-space: nowrap;
}

.app-console-countdown--urgent {
  color: var(--console-error);
}

.app-console-countdown--muted {
  color: var(--console-text-disabled);
}

.app-console-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--console-radius-pill);
  white-space: nowrap;
  max-width: 100%;
}

.app-console-chip--outline {
  border: 1px solid var(--console-text-primary);
  color: var(--console-text-primary);
  background: var(--console-surface);
}

.app-console-chip--outline-gray {
  border: 1px solid var(--console-border-input);
  color: var(--console-text-secondary);
  background: var(--console-surface);
}

.app-console-chip--solid {
  background: var(--console-text-primary);
  color: var(--console-surface);
  border: 1px solid var(--console-text-primary);
}

.app-console-chip--won {
  background: var(--console-won);
  color: var(--console-surface);
  border: 1px solid var(--console-won);
}

.app-console-chip--subtle {
  background: var(--console-border-row);
  color: var(--console-text-secondary);
  border: 1px solid var(--console-border-card);
}

/* CE 3.0 row badge — its own full-width line under the main row so it never
   competes with the 5-column grid's fixed track widths. */
/* Under the customer's name, lined up with it: the customer column, then past
   the provider mark (14px) and the gap after it (8px). A fixed offset from the
   row's edge drifted when the first column widened from 64px to 104px. */
.app-console-row-ce3-badge {
  grid-column: 2 / -1;
  padding-inline-start: 22px;
}

/* The Status column holds the status alone; the case's tags (advisor
   verdict, early warning, autopilot) sit after the customer name instead. */
.app-console-row-chips {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.app-console-chip--ce3 {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-console-chip--amber {
  background: var(--console-amber-bg);
  color: var(--console-amber);
  border: 1px solid var(--console-amber);
}

/* The date portion of the "Auto-submits <date>" inbox chip — numbers in
   Plex Mono, per the no-list. */
.app-console-chip-mono {
  font-family: var(--font-mono);
}

/* Every block on the dashboard carries its own bottom margin; without one here
   the stat row sat flush against the ratio card, and two cards in a row (one
   per connection) touched each other. */
.app-console-ratio-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.app-console-ratio-dial {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-console-ratio-dial-rate {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--console-won);
}

.app-console-ratio-dial--over .app-console-ratio-dial-rate {
  color: var(--console-amber);
}

.app-console-ratio-dial-line {
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-ratio-trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
}

.app-console-ratio-trend-bar {
  flex: 1;
  min-height: 2px;
  background: var(--console-won);
  border-radius: 2px 2px 0 0;
}

.app-console-ratio-trend-bar--over {
  background: var(--console-amber);
}

.app-console-ratio-trend-bar--empty {
  background: var(--console-border-row);
}

.app-console-ratio-trend-line {
  margin: 0;
  color: var(--console-text-secondary);
}

.app-console-ratio-sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-console-ratio-sources-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--console-text-secondary);
}

.app-console-ratio-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--console-text-primary);
}

.app-console-ratio-honesty {
  margin: 0;
  font-size: 11.5px;
  color: var(--console-text-disabled);
}

.app-console-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.app-console-stat {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  padding: 22px;
}

.app-console-stat-label {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  margin-bottom: 10px;
}

.app-console-stat-number {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 500;
}

.app-console-stat-sub {
  font-size: 13px;
  color: var(--console-text-secondary);
  margin-top: 6px;
}

.app-console-stat-next {
  font-size: 12.5px;
  margin-top: 10px;
  font-weight: 600;
  color: var(--console-text-secondary);
}

.app-console-stat-next--urgent {
  color: var(--console-error);
}

/* The dashboard's state cards (importing, nothing yet, the billing prompt)
   keep the same gap as the panels under them; .app-console-card has no margin
   of its own, so a card above the recovery block sat flush against it. */
#dashboard > .app-console-card {
  margin-bottom: 24px;
}

.app-console-backfilling {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 32px;
}

.app-console-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--console-text-primary);
  flex-shrink: 0;
}

.app-console-card--error {
  border-color: var(--console-error);
}

.app-console-card-title--error {
  color: var(--console-error);
}

.app-console-error-link {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  color: var(--console-text-primary);
}

/* ============================================================
   Dispute Detail — deadline card, action card, summary, lifecycle
   timeline, evidence checklist.
   ============================================================ */
.app-console-detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

/* Each column owns the spacing between its own cards, at the same 20px as the
   grid's gap. It's a gap and not a margin on each card because half the cards
   in a column are conditional — a margin has to be repeated on every card that
   might end up last, and the ones that were missed (Order, the checklist, CE
   3.0) sat flush against their neighbours. */
.app-console-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-console-deadline-card {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* The provider's mark on the right of the deadline card, linking to the
   connection this dispute came in on. The mark itself is the connections
   page's (.app-console-connection-card-mark) — the same tile, the same glyph
   sizes — so a merchant recognises it from where they set it up. All this adds
   is the hover, since here it is a link. */
.app-console-deadline-connection {
  display: inline-flex;
}

.app-console-deadline-connection .app-console-connection-card-mark {
  transition: background 0.14s ease;
}

.app-console-deadline-connection:hover .app-console-connection-card-mark,
.app-console-deadline-connection:focus-visible .app-console-connection-card-mark {
  background: var(--console-border-card);
}

/* A connection that has stopped working is the one thing about it that changes
   what the merchant does next, and the console-wide banner is a long way up
   the page by the time they are reading a countdown. */
.app-console-deadline-connection--errored .app-console-connection-card-mark {
  color: var(--console-error);
}

.app-console-deadline-card--urgent {
  border-color: var(--console-error);
}

.app-console-deadline-label {
  font-size: 12px;
  color: var(--console-text-secondary);
  margin-bottom: 8px;
}

.app-console-deadline-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
}

.app-console-deadline-value--urgent {
  color: var(--console-error);
}

.app-console-action-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-console-action-card form {
  margin: 0;
}

/* What a connected assistant did on a case (app/disputes/_agent_actions_card):
   one entry per action, its status or time on the line under it. */
.app-console-agent-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-console-agent-actions .app-console-card-body {
  margin: 0;
}

.app-console-action-note {
  text-align: center;
  margin: 0;
  padding: 8px 0;
}

/* A note that stands alone as a paragraph, with no button to caption. */
.app-console-action-note--prose {
  text-align: start;
}

/* "What came back?" on a returned eBay item: one answer open at a time, each
   holding the step it leads to. */
.app-case-answer {
  border-top: 1px solid var(--console-border-card);
}

.app-case-answer:last-of-type {
  border-bottom: 1px solid var(--console-border-card);
}

.app-case-answer-summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: var(--console-text-primary);
}

.app-case-answer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.app-console-summary-card {
  padding: 26px 28px;
}

.app-console-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.app-console-summary-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
}

.app-console-summary-customer {
  font-size: 14px;
  color: var(--console-text-secondary);
  margin-top: 2px;
}

.app-console-summary-reason {
  border-top: 1px solid var(--console-border-row);
  padding-top: 14px;
}

.app-console-summary-reason-label {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.app-console-summary-reason-body {
  font-size: 13.5px;
  color: var(--console-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.app-console-timeline-card {
  padding: 28px;
}

/* Autopilot dispute-page banner — scheduled/paused read
   as us doing our job (green-family, never the alarm treatment); held is
   neutral; failed is amber, never the competitor red. */
.app-console-autopilot-banner {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.app-console-autopilot-banner--engaged,
.app-console-autopilot-banner--scheduled,
.app-console-autopilot-banner--paused {
  border-inline-start: 3px solid var(--console-won);
}

.app-console-autopilot-banner--held {
  border-inline-start: 3px solid var(--console-border-card);
}

.app-console-autopilot-banner--failed {
  border-inline-start: 3px solid var(--console-amber);
  background: var(--console-amber-bg);
}

.app-console-timeline-autopilot-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--console-won);
  font-weight: 600;
}

.app-console-card-heading {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 24px;
}

.app-console-timeline {
  display: flex;
  align-items: flex-start;
}

.app-console-timeline-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.app-console-timeline-line {
  position: absolute;
  top: 5px;
  height: 2px;
  inset-inline-start: 0;
  inset-inline-end: 0;
  background: var(--console-border-card);
  z-index: 0;
}

.app-console-timeline-node--first .app-console-timeline-line {
  left: 50%;
}

.app-console-timeline-node--last .app-console-timeline-line {
  right: 50%;
}

.app-console-timeline-node--done .app-console-timeline-line {
  background: var(--console-text-primary);
}

/* The step we're on: the stretch arriving from the last done step is done,
   the stretch leaving it isn't. Each node draws its own whole column, so
   without this the current node's grey covered the left half of the
   connector into it. A last node's line is already only that left half. */
.app-console-timeline-node--current:not(.app-console-timeline-node--first) .app-console-timeline-line {
  background: linear-gradient(to right, var(--console-text-primary) 50%, var(--console-border-card) 50%);
}

.app-console-timeline-node--current.app-console-timeline-node--last .app-console-timeline-line {
  background: var(--console-text-primary);
}

.app-console-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 1;
  margin-bottom: 10px;
  background: var(--console-surface);
  border: 2px solid var(--console-border-card);
}

.app-console-timeline-node--done .app-console-timeline-dot {
  background: var(--console-text-primary);
  border-color: var(--console-text-primary);
}

.app-console-timeline-node--current .app-console-timeline-dot {
  border-color: var(--console-text-primary);
}

.app-console-timeline-label {
  font-size: 12px;
  text-align: center;
  max-width: 110px;
  padding: 0 3px;
  overflow-wrap: break-word;
  color: var(--console-text-disabled);
}

/* Five steps in a phone-width card leave each label about 60px: a word like
   "Chargeback" otherwise runs into the next one. */
@media (max-width: 480px) {
  .app-console-timeline-label {
    font-size: 10.5px;
  }
}

.app-console-timeline-node--done .app-console-timeline-label,
.app-console-timeline-node--current .app-console-timeline-label {
  color: var(--console-text-primary);
  font-weight: 600;
}

.app-console-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #F5F5F5;
  font-size: 13.5px;
}

.app-console-checklist-item:last-child {
  border-bottom: none;
}

.app-console-checklist-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  border: 1.5px solid var(--console-border-input);
  color: transparent;
}

.app-console-checklist-mark--done {
  background: var(--console-text-primary);
  color: var(--console-surface);
  border-color: var(--console-text-primary);
}

/* ============================================================
   Fight or Fold advisor — show page "Our recommendation" card.
   ============================================================ */
.app-console-advisor-headline {
  margin-bottom: 12px;
}

.app-console-advisor-signals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--console-text-primary);
}

.app-console-advisor-would-change {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #F5F5F5;
}

.app-console-advisor-would-change-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--console-text-secondary);
  margin-bottom: 6px;
}

.app-console-advisor-would-change ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--console-text-secondary);
}

.app-console-advisor-refund-note {
  font-size: 13px;
  color: var(--console-text-secondary);
  margin: 14px 0 12px;
}

/* ============================================================
   CE 3.0 prior-purchase panel — show page card + evidence editor form.
   ============================================================ */
.app-console-ce3-verdict {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 12px;
}

.app-console-ce3-verdict--eligible {
  color: var(--console-won);
}

.app-console-ce3-note {
  font-size: 13px;
  color: var(--console-text-secondary);
  margin: 8px 0 0;
}

/* The re-check button follows whichever line the panel rendered — a note, a
   verdict, a list — and none of them own the space below them, so the button
   does. Without it "Not checked yet." and the button touch. */
.app-console-ce3-recheck {
  margin-top: 16px;
}

.app-console-ce3-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.app-console-ce3-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid #F5F5F5;
  font-size: 13px;
}

.app-console-ce3-item:last-child {
  border-bottom: none;
}

.app-console-ce3-item--excluded {
  color: var(--console-text-disabled);
}

.app-console-ce3-item-details {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.app-console-ce3-item-amount {
  font-family: var(--font-mono);
}

.app-console-ce3-item-elements {
  color: var(--console-text-secondary);
}

.app-console-ce3-item-excluded-marker {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--console-error);
}

.app-console-ce3-exclude {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--console-text-secondary);
  white-space: nowrap;
}

/* ============================================================
   Settings — toggle switch, row layout, collapsible password card.
   ============================================================ */
.app-console-toggle-track {
  width: 38px;
  height: 22px;
  border-radius: var(--console-radius-pill);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: #D8D8D8;
  border: none;
  padding: 0;
  transition: background 0.15s;
}

.app-console-toggle-track--on {
  background: var(--console-text-primary);
}

.app-console-toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--console-surface);
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  transition: left 0.15s;
}

.app-console-toggle-track--on .app-console-toggle-knob {
  inset-inline-start: 18px;
}

.app-console-settings {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-console-settings .app-console-card {
  padding: 28px;
}

.app-console-settings-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  padding-top: 12px;
}

.app-console-settings-row--divided {
  padding: 12px 0;
  border-bottom: 1px solid var(--console-border-row);
}

.app-console-settings-row-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.app-console-settings-row-body {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  max-width: 400px;
}

.app-console-form-field select {
  width: 100%;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-app-body);
  outline: none;
  box-sizing: border-box;
  background: var(--console-surface);
}

.app-console-settings-hint {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  margin: 12px 0 0;
}

/* Wraps rather than clipping: at 375px the settings card isn't wide enough for
   an email field and a button side by side, and a fixed min-width on the input
   pushed the Erase button off the card's edge. */
.app-console-erasure-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* A text field, not an email one — a mobile merchant's customer identifier is
   an opaque token the browser would refuse. Match the field, not the type it
   used to be. */
.app-console-erasure-form input[type="text"] {
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-app-body);
  outline: none;
  background: var(--console-surface);
  flex: 1 1 150px;
  min-width: 0;
}

.app-console-erasure-form input[type="text"]:focus {
  border-color: var(--console-text-primary);
}

/* The form only appears once the disclosure above it is opened. */
.app-console-danger-zone > .app-console-erasure-form {
  margin-top: 8px;
}

/* Account deletion stays folded away behind a disclosure rather than sitting
   open at the bottom of Settings. The summary reads as a quiet link, not a
   button — the commitment is the typed business name inside, and dressing the
   opener up in red would just be the fear styling the brief rules out. */
.app-console-danger-zone {
  margin-top: 14px;
}

.app-console-danger-zone > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--console-text-secondary);
  width: fit-content;
}

.app-console-danger-zone > summary:hover {
  color: var(--console-error);
}

.app-console-danger-zone[open] > summary {
  margin-bottom: 4px;
}

.app-console-team-member-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-console-team-role-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-console-team-role-form select {
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: var(--font-app-body);
  background: var(--console-surface);
}

.app-console-team-invite {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--console-border-row);
}

.app-console-team-invite-fields {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.app-console-team-invite-fields .app-console-form-field {
  flex: 1 1 200px;
  margin-bottom: 0;
}

.app-console-team-invite-fields .app-console-btn {
  flex-shrink: 0;
}

.app-console-toggle-track--disabled {
  /* The enabled state is a <button> (inline-block by UA default); the
     disabled state renders a plain <span>, which ignores width/height
     unless given a block-ish display. */
  display: inline-block;
  opacity: 0.5;
  cursor: not-allowed;
}

.app-console-inline-notice {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--console-canvas);
  border-radius: var(--console-radius-control);
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-inline-notice--amber {
  background: var(--console-amber-bg);
  color: var(--console-amber);
}

.app-console-inline-notice-amber-line {
  margin-top: 8px;
  color: var(--console-amber);
  font-weight: 600;
}

.app-console-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.app-console-details summary::-webkit-details-marker {
  display: none;
}

.app-console-details-chevron {
  font-size: 14px;
  color: var(--console-text-secondary);
  transition: transform 0.15s;
}

.app-console-details[open] .app-console-details-chevron {
  transform: rotate(180deg);
}

.app-console-details[open] summary {
  margin-bottom: 18px;
}

.app-console-password-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   Tracker — install snippet, verification status, dispute activity card,
   dashboard callout.
   ============================================================ */
.app-console-tracker {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-console-code-block {
  background: var(--console-canvas);
  border-radius: var(--console-radius-control);
  padding: 16px;
  margin-top: 12px;
}

.app-console-code-block pre {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--console-text-primary);
}

/* The Shopify Payments handoff: the finished response, laid out to be copied
   field by field into Shopify's own response form. Not mono like the tracker
   snippet above — this is prose a shopper's dispute turns on, and a merchant
   has to be able to read it before they paste it. `pre` only for the line
   breaks the narrative carries. */
.app-console-handoff-field {
  border-top: 1px solid var(--console-border-row);
  padding-top: 14px;
  margin-top: 14px;
}

.app-console-handoff-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.app-console-handoff-field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--console-text-secondary);
}

.app-console-handoff-field-value {
  margin: 0;
  padding: 12px 14px;
  background: var(--console-canvas);
  border-radius: var(--console-radius-control);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--console-text-primary);
}

.app-console-handoff-files {
  border-top: 1px solid var(--console-border-row);
  padding-top: 14px;
  margin-top: 14px;
}

.app-console-handoff-file-list {
  margin: 8px 0 10px;
  padding-inline-start: 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--console-text-primary);
}

.app-console-tracker-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.app-console-tracker-status--live {
  color: var(--console-won);
}

.app-console-tracker-status-check {
  font-weight: 700;
}

.app-console-tracker-benefits {
  margin: 0 0 12px;
  padding-inline-start: 18px;
  font-size: 13.5px;
  color: var(--console-text-secondary);
}

.app-console-tracker-benefits li {
  margin-bottom: 8px;
}

.app-console-activity-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.app-console-activity-item {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid #F5F5F5;
  font-size: 12.5px;
}

.app-console-activity-item:last-child {
  border-bottom: none;
}

.app-console-activity-item-time {
  font-family: var(--font-mono);
  color: var(--console-text-secondary);
  flex-shrink: 0;
}

.app-console-activity-item-name {
  font-weight: 600;
}

.app-console-activity-item-url {
  color: var(--console-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Below 720px the fixed 228px sidebar would eat most of the viewport, so it
   collapses into a top bar: the logo and a burger stay on screen, and the nav
   and the sign-out block sit behind the burger rather than wrapping across
   several rows of the page. */
@media (max-width: 720px) {
  .app-console-layout {
    flex-direction: column;
  }

  .app-console-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border-inline-end: none;
    border-bottom: 1px solid var(--console-border-card);
    padding: 12px 16px;
  }

  .app-console-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .app-console-nav-toggle {
    display: inline-flex;
  }

  .app-console-logo {
    padding: 0;
  }

  .app-console-divider {
    display: none;
  }

  .app-console-sidebar-body {
    display: none;
  }

  .app-console-sidebar--open .app-console-sidebar-body {
    display: flex;
    flex: 0 1 auto;
    gap: 14px;
    padding-top: 14px;
  }

  .app-console-nav {
    padding: 0;
    gap: 2px;
  }

  .app-console-nav-item {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* There's no hover on a phone and a tap on a dead item fires no
     :focus-visible, so the tooltip stops floating and becomes the second line
     of the item — same words, always readable, and it can't push the page
     wider than the screen. */
  .app-console-nav-item--disabled {
    flex-wrap: wrap;
  }

  .app-console-nav-hint {
    position: static;
    flex-basis: 100%;
    max-width: none;
    width: auto;
    padding: 2px 0 0 26px;
    background: none;
    color: var(--console-text-disabled);
    box-shadow: none;
    font-size: 12px;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .app-console-nav-hint::before {
    display: none;
  }

  .app-console-sidebar-footer {
    padding: 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  /* The footer is already one row here, so the identity keeps no rule of its
     own — the line would cut across the middle of that row. */
  .app-console-signed-in-row {
    border-top: 0;
    padding-top: 0;
    flex: 0 1 auto;
    min-width: 0;
  }

  .app-console-signed-in-email {
    font-size: 12px;
  }

  .app-console-page-header {
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .app-console-page-title {
    font-size: 22px;
  }

  /* The mode and the account's name describe the account, not the page — on a
     narrow screen they wrap onto a second line and push the work down for no
     gain. The test-mode banner above already carries the mode. The account
     switcher stays: with more than one account it's the only way to change. */
  .app-console-page-header .app-console-mode-badge,
  .app-console-page-header .app-console-business-name {
    display: none;
  }

  .app-console-content {
    padding: 28px 20px 20px;
  }

  .app-console-stat-row {
    grid-template-columns: 1fr;
  }

  /* One tile per row — auto-fill's 300px minimum would overflow a 375px
     viewport once the content padding is taken out. */
  .app-console-connections {
    gap: 28px;
  }

  .app-console-connections-grid {
    grid-template-columns: 1fr;
  }

  /* At 375px the mark tile, a long name and a long status can't share a line —
     stepping the name down keeps them on one row instead of wrapping the title. */
  .app-console-connection-card-name {
    font-size: 16.5px;
  }

  /* The 5-column row grid (104px 1fr 90px 180px 190px) needs ~565px of fixed
     columns alone — on a narrow screen that squeezes the customer name to
     zero width. Restack as two lines: countdown/customer/chip, then
     amount/reason below. Column headers don't map to a stacked layout. */
  .app-console-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "countdown customer chip"
      ".         amount   reason"
      "badge     badge    badge";
    row-gap: 4px;
    column-gap: 8px;
  }

  .app-console-row-ce3-badge {
    grid-area: badge;
    padding-inline-start: 0;
  }

  .app-console-row--header {
    display: none;
  }

  .app-console-countdown {
    grid-area: countdown;
    /* Stacked, the column is only as wide as its content, so a two-word
       outcome may wrap rather than squeeze the customer's name to nothing. */
    white-space: normal;
  }

  /* Stacked, the customer cell is too narrow for tags beside the name: they
     take a line of their own under it. A zero basis keeps a long name on the
     mark's line, ellipsized, instead of wrapping below it. */
  .app-console-row-customer {
    grid-area: customer;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .app-console-row-customer-name {
    flex: 1 1 0;
  }

  .app-console-row-tags {
    flex-basis: 100%;
    flex-wrap: wrap;
    min-width: 0;
  }

  /* Block-level so a tag wider than a narrow cell ellipsizes rather than
     running under the status chip. */
  .app-console-row-tags .app-console-chip {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-console-chip {
    grid-area: chip;
  }

  .app-console-row-amount {
    grid-area: amount;
    font-size: 12.5px;
  }

  .app-console-row-reason {
    grid-area: reason;
    font-size: 12.5px;
    text-align: end;
  }

  .app-console-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Internal /admin — staff-only tooling, distinct from .app-console
   (the merchant-facing "app admin"). Plain black/white; the sidebar it
   sits beside is the "/admin sidebar" block at the end of this file.
   ============================================================ */
.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px;
}

.admin-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
}

/* A section heading needs air above it. Without this the h2 sat hard against
   the bottom of the table it followed, so /admin/accounts read as one
   undifferentiated column instead of five sections. */
h2.admin-heading {
  font-size: 17px;
  margin-top: 40px;
}

/* The forms in /admin were raw browser chrome — an Arial 13px select and a
   default text field sitting under tables set in the house type. These are
   the same shape as .admin-btn, which they sit beside. */
.admin-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-input,
.admin-select,
.admin-textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-light-primary);
  background: #FFFFFF;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 6px;
  padding: 6px 10px;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.admin-input { min-width: 240px; }
.admin-select { min-width: 140px; }

.admin-textarea {
  display: block;
  width: 100%;
  max-width: 640px;
  line-height: 1.5;
  resize: vertical;
}

.admin-form--stacked {
  display: block;
}

.admin-form--stacked .admin-btn {
  margin-top: 8px;
}

/* A labelled field in a column, for the settings password form. .admin-form on
   its own is a row of controls sitting beside a button, which has no shape for
   three fields that each need their own label above them. */
.admin-field {
  margin-bottom: 12px;
}

.admin-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid #E5E5E5;
}

.admin-table-muted {
  color: #888888;
}

.admin-btn {
  font-size: 13px;
  font-weight: 600;
  color: #0A0A0A;
  background: #FFFFFF;
  border: 1px solid #0A0A0A;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

/* One button, two doors. A user with a Shopify shop can be opened two ways —
   signed in as them in the console, or read-only on their own embedded Shopify
   screen — and two buttons side by side in a table cell made the row about the
   choice rather than the person. Same <details> menu the console's account
   switcher is, because a dropdown that needs no JavaScript is one that cannot
   break in a back office nobody watches. */
.admin-menu {
  position: relative;
}

.admin-menu summary {
  list-style: none;
  display: inline-block;
}

.admin-menu summary::-webkit-details-marker {
  display: none;
}

.admin-menu-items {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 200px;
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 10;
}

.admin-menu-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #0A0A0A;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.admin-menu-item:hover {
  background: #F4F4F4;
}

.admin-menu-item-note {
  display: block;
  font-size: 11px;
  color: #767676;
}

/* A control the page has nothing to give: Copy command with no stored token
   behind it. Greyed rather than hidden, because the button disappearing would
   read as the page being broken instead of the token being unrecoverable. */
.admin-btn:disabled {
  color: #999999;
  border-color: #CCCCCC;
  cursor: not-allowed;
}

/* Filter chips above the webhook log. */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 12.5px;
}

.admin-filter {
  color: #666666;
  text-decoration: none;
  border: 1px solid #E5E5E5;
  border-radius: 999px;
  padding: 4px 11px;
}

.admin-filter.is-active {
  color: #FFFFFF;
  background: #0A0A0A;
  border-color: #0A0A0A;
}

/* Event ids, account ids and JSON payloads — monospace, per the brand rule
   that machine-readable values aren't set in the display face. */
.admin-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.admin-payload {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: #F7F7F7;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

/* ---- Sent email log (/admin/sent_emails) ---- */

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-search-input {
  font-size: 13px;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  padding: 6px 11px;
  min-width: 280px;
}

/* Two actions per row on the users table — the link needs to clear the button
   rather than sit on its baseline. */
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

/* The table squeezes this column first, and a squeezed button wraps its own
   label: "Open" over "▾", "Sign in" over "as". */
.admin-user-actions .admin-btn {
  white-space: nowrap;
}

/* The email preview itself. White, because a mail client's canvas is white and
   the point of this frame is to show what the recipient saw; the fixed height
   keeps a long receipt from pushing the page metadata off screen. */
.admin-email-preview {
  display: block;
  width: 100%;
  height: 720px;
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
}

/* ---- Internal review queue (/admin/disputes) ---- */

/* The count of disputes waiting on a reviewer. Deliberately loud: an unworked
   review queue is a merchant whose response is sitting still. */
.admin-nav-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  background: #0A0A0A;
  border-radius: 999px;
  padding: 1px 6px;
  margin-inline-start: 4px;
}

.admin-review-panel {
  border: 1px solid #0A0A0A;
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 32px;
}

.admin-review-form {
  margin-top: 14px;
}

.admin-review-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.admin-review-note {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
}

.admin-review-actions {
  margin-top: 8px;
}

.admin-btn--secondary {
  color: #666666;
  border-color: #E5E5E5;
}

/* Inline state flags in the queue table. Red is only ever a deadline that has
   already passed — the house rule is that red means a loss, not a warning. */
.admin-flag {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* A verdict flag with the checker's reason behind an (i): the bubble opens
   above on hover or focus, so it never pushes the row below it around. */
.admin-verdict { display: inline-flex; align-items: center; gap: 4px; }
.admin-info-anchor { position: relative; display: inline-flex; }
.admin-info {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1px solid rgba(var(--ink-rgb), 0.3);
  border-radius: 50%;
  background: #fff;
  color: var(--text-light-body);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
  cursor: help;
}
.admin-info-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #1A1A1A;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
  z-index: 40;
}
.admin-info-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  margin-inline-start: -4px;
  background: #1A1A1A;
  transform: rotate(45deg);
}
.admin-info-anchor:hover .admin-info-hint,
.admin-info-anchor:focus-within .admin-info-hint {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.admin-flag--bad {
  color: #A93B2A;
  background: #FBEDEA;
}

.admin-flag--warn {
  color: #7A5A12;
  background: #FBF3E2;
}

/* Something we hold that the row needed — a contact found. Green is ours. */
.admin-flag--ok {
  color: #0E6B4A;
  background: #E6F4EE;
}

/* A state that is neither good nor bad and should not be coloured as either:
   an address a catch-all server will not answer questions about. Amber here
   would make the genuine warnings invisible by the tenth row. */
.admin-flag--quiet {
  color: #6F6F6F;
  background: #F1F1F1;
}

/* Anything a reviewer needs to know that isn't in the body itself. */
.admin-warnings {
  font-size: 13px;
  line-height: 1.6;
  list-style: disc;
  margin: 0 0 16px;
  padding: 12px 16px 12px 34px;
  border: 1px solid #E5E5E5;
  border-inline-start: 3px solid #7A5A12;
  border-radius: 8px;
  background: #FBF9F4;
}

.admin-checklist {
  font-size: 13.5px;
  line-height: 1.7;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.admin-checklist .is-missing {
  color: #A93B2A;
}

.admin-payload-group {
  margin-bottom: 10px;
}

.admin-payload-group summary {
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

/* ============================================================
   Auth pages (sign in / sign up) — Mission Control dark, on brand
   with the marketing site rather than the monochrome /app console.
   Scoped under .auth-shell (still inside .app-shell for the flash/
   form primitives above).
   ============================================================ */
.auth-shell {
  /* Declares the grid texture itself (matches .engineering-grid in
     02_base.css) rather than relying on that class's cascade position —
     .app-shell's `background: #FFFFFF` shorthand above resets
     background-image to none for any .app-shell element, so depending on
     .engineering-grid loading "late enough" is fragile. background-color
     (not the `background` shorthand) so this doesn't itself reset the
     image it just set. */
  background-color: var(--canvas-dark);
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-on-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
}

.auth-switch-link {
  font-size: 14px;
  color: var(--text-dark-body);
  text-decoration: none;
}
.auth-switch-link:hover { color: var(--text-on-dark); }

/* Forgot-password link sits inside the white .auth-card, so it needs the
   light-surface ink palette, not the dark-surface one above. */
.auth-aux-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
}
.auth-aux-link:hover { text-decoration: underline; }

.auth-main {
  margin: auto;
  width: 100%;
  padding: 40px 24px 80px;
}
.auth-main .app-flash {
  color: var(--ink);
  max-width: 420px;
  margin-inline: auto;
}

/* The Turnstile widget. Most visitors never see one — it renders with
   appearance "interaction-only", so Cloudflare keeps it hidden unless a human
   has to click something, and the field takes no space. The gap below it is
   switched on by turnstile_controller.js only on the visit where the checkbox
   actually appears, so the form looks exactly as it did before this existed
   everywhere else. It can't hang off the iframe: Cloudflare renders that inside
   a closed shadow root, where no selector of ours reaches.

   line-height: 0 because the iframe is inline inside that shadow root and
   would otherwise sit on a text baseline, leaving a few pixels of descender
   under the widget that no margin accounts for. It inherits into the shadow
   tree, which is the only way in. */
.turnstile-field--interactive .turnstile-widget {
  line-height: 0;
  margin-bottom: 20px;
}

/* Shown only while a submit is waiting on the challenge, or once the challenge
   has said it can't finish. Deliberately not red: red is losses and
   competitors, and this is neither — it is the form telling someone what it is
   doing, or what to check. */
.turnstile-message {
  color: var(--text-light-body);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 20px;
}

.auth-card {
  background: #FFFFFF;
  color: var(--ink);
  border: none;
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: var(--shadow-elevated), 0 0 48px rgba(var(--green-signal-rgb), 0.08);
}
.auth-card .app-subheading { color: var(--text-light-body); }

/* The panel a store platform frames inside its own dashboard: the Wix
   dashboard page (Wix::AppController#panel, wix_panel layout) and the
   BigCommerce control-panel app (Bigcommerce::AppController, the
   bigcommerce_panel layout). One vocabulary for both, because a merchant's
   dispute should read the same whichever admin it is framed in. The body
   carries .app-console, so the type, the canvas and — the part that matters —
   the --console-* variables the status chips colour themselves from are all
   already in scope: a dispute reads the same here as in the console, and there
   is one place to change what a state looks like. Everything below is layout.

   No card. Wix has already drawn one around the iframe, and a second border
   inside it reads as a website embedded in a dashboard rather than as part of
   it. */
.frame-panel-body { min-height: 0; background: var(--console-surface); }

.frame-panel {
  max-width: 620px;
  padding: 28px 24px 32px;
}

/* The mark, not the lockup. Wix's own sidebar already says "Chargewood
   Disputes" above this frame, so a full wordmark here would be the app's name
   twice; the icon just tells the merchant whose page they're looking at
   without building a second header inside someone else's dashboard. */
.frame-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
}

.frame-panel-title .logo-icon {
  width: 24px;
  height: 24px;
  --logo-surface: var(--console-surface);
}

.frame-panel-lede {
  font-size: 14px;
  color: var(--console-text-secondary);
  margin: 0;
}

.frame-panel-settings {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 13.5px;
}

.frame-panel-settings li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--console-border-row);
  color: var(--console-text-secondary);
}

.frame-panel-setting-value {
  color: var(--console-text-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* Each toggle is its own one-button form — no JavaScript runs on this page, so
   the form is the save. It only needs to stop being a block-level element in
   the middle of a flex row. */
.frame-panel-switch-form {
  margin: 0;
  display: flex;
  align-items: center;
}

/* The sync state and the control that acts on it, on their own line under the
   lede. */
.frame-panel-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--console-text-secondary);
  margin: 6px 0 0;
}

.frame-panel-sync-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  color: var(--console-text-secondary);
  cursor: pointer;
}

.frame-panel-sync-btn:hover {
  color: var(--console-text-primary);
  border-color: var(--console-border-input);
}

/* The one step left, in the frame the merchant is already looking at. A green
   rule rather than a warning tone: the install worked, and what's missing is
   the next connection rather than a fault with this one. */
.frame-panel-callout {
  border-inline-start: 3px solid var(--green-signal);
  padding: 2px 0 2px 12px;
  margin: 18px 0 0;
}

.frame-panel-callout-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.frame-panel-callout-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--console-text-secondary);
  margin: 0 0 8px;
}

.frame-panel-note {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  margin: 0 0 6px;
}

/* Every link out of the panel is a top-level navigation, so they read as
   destinations rather than as controls — underlined text, not buttons. The
   one button on the page is "Open Chargewood". */
.frame-panel-link {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  margin: 0 0 4px;
}

.frame-panel-actions { margin: 28px 0 0; }

/* The account line sits under the panel's one button, and with no margin of
   its own it read as a caption attached to it. */
.frame-panel-actions + .frame-panel-note { margin-top: 16px; }

.frame-panel-heading {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 26px 0 4px;
}

.frame-panel-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

/* The row is a link into the dispute in Chargewood, so it gets a hit area and
   a hover — the panel's whole job is to be a way in. */
.frame-panel-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 8px;
  margin: 0 -8px;
  border-top: 1px solid var(--console-border-row);
  border-radius: var(--console-radius-control);
  font-size: 13.5px;
  color: inherit;
  text-decoration: none;
}

.frame-panel-row:hover { background: var(--console-canvas); }

/* The console's own narrow-screen rule puts `grid-area: chip` on this class,
   and it isn't scoped to the disputes table — this grid has no such area, so
   the chip was landing on an implicit track *below* the row it belongs to.
   Place it back in the third column. */
.frame-panel-row .app-console-chip {
  grid-area: auto;
  grid-column: 3;
  justify-self: end;
}

/* Money in the mono face, like every other number in the product. */
.frame-panel-row-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.frame-panel-row-reason {
  color: var(--console-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-panel-empty {
  font-size: 14px;
  color: var(--console-text-secondary);
  margin: 20px 0 24px;
}

/* Wix's iframe gets narrow well before a phone does — the dashboard keeps its
   own sidebar and takes the width out of ours. */
@media (max-width: 560px) {
  .frame-panel { padding: 22px 16px 26px; }
  .frame-panel-row {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }
  .frame-panel-row .app-console-chip { grid-area: auto; grid-column: 1 / -1; justify-self: start; }
}

/* "Continue with Google" and "Continue with GitHub", above the password form
   on both auth pages. White on the white card with a hairline border: the
   password submit is the black .app-btn and stays the primary action, so
   these read as the alternatives rather than competing with it — and as each
   other's equals, since neither provider is the one we'd rather you used. */
.auth-alt { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 20px; }
.auth-oauth-form { margin: 0; }
.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid #DADCE0;
}
.auth-oauth-btn:hover { background: #F7F7F7; }
.auth-oauth-mark { flex: none; }

.auth-alt-terms {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light-body);
  margin: 2px 0 0;
}
.auth-alt-terms a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth-alt-terms a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light-body);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #E8E8E8;
}

.auth-signin {
  max-width: 420px;
  margin: 0 auto;
}

/* Default: sits below the form, inside the white .auth-card (signup) —
   use the light-surface ink palette. .auth-switch--on-dark sits outside
   the card on the dark canvas (signin) instead. */
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-light-body);
  margin-top: 24px;
}
.auth-switch a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-switch--on-dark { color: var(--text-dark-body); }
.auth-switch--on-dark a { color: var(--green-signal); }

.auth-dev-login {
  max-width: 420px;
  margin: 24px auto 0;
  padding: 16px 20px;
}
.auth-dev-login-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light-body);
  margin: 0 0 10px;
}
/* One line per account: button, then what the account is. */
.auth-dev-login form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auth-dev-login form:last-child { margin-bottom: 0; }
.auth-dev-login-btn {
  background: #FFFFFF;
  color: var(--ink);
  width: auto;
  min-width: 84px;
  padding: 6px 12px;
  font-size: 13px;
}
.auth-dev-login-btn:hover { background: #F2F2F2; }
.auth-dev-login-description {
  font-size: 12.5px;
  color: var(--text-light-body);
}

.auth-signup {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  gap: 56px;
  align-items: center;
}

.auth-pitch { flex: 1 1 46%; }

.auth-status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-tint);
  margin-bottom: 18px;
}
.auth-status-line::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-signal);
  box-shadow: var(--glow-signal);
}

.auth-pitch-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.auth-pitch-title em {
  font-family: var(--font-serif-accent);
  font-style: italic;
  font-weight: 500;
  color: var(--green-signal);
}

.auth-pitch-body {
  font-size: 15.5px;
  color: var(--text-dark-body);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 380px;
}

.auth-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-checklist li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-dark-body); }
.auth-checklist li::before { content: "✓"; color: var(--green-signal); font-weight: 700; }

.auth-signup .auth-card { flex: 1 1 54%; max-width: 440px; }

.auth-field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.auth-field-label-row label { margin-bottom: 0; }
.auth-field-hint { font-size: 12px; font-weight: 400; color: var(--text-light-muted); }

/* Every password input carries its own eye button — sign-up needs it most,
   since it asks for the password once with no "confirm" field to catch a
   typo. The button sits inside the field's box; the input reserves room for
   it so a long password doesn't run underneath. Shared with the console
   (/app/settings). */
.auth-password-field { position: relative; }
/* Both wrappers set their own input padding with an [type=…] selector, which
   outspecifies a bare `.auth-password-field input` — so the reservation has to
   be stated per surface, and after those rules. */
.app-form-field .auth-password-field input,
.app-console-form-field .auth-password-field input { padding-inline-end: 42px; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px;
  color: var(--text-light-muted);
  cursor: pointer;
}
.auth-password-toggle:hover { color: var(--green); }
.auth-password-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
/* aria-pressed is the single source of truth for which eye shows — the
   controller sets it, the CSS reads it. */
.auth-password-toggle[aria-pressed="true"] { color: var(--green); }
.auth-password-toggle .auth-password-icon--eye-off,
.auth-password-toggle[aria-pressed="true"] .auth-password-icon--eye { display: none; }
.auth-password-toggle[aria-pressed="true"] .auth-password-icon--eye-off { display: block; }

/* The "check your inbox" waiting room: same white card as the auth forms,
   just centred, since there's nothing on it to fill in. */
.auth-pending { text-align: center; }
.auth-pending .auth-status-line { justify-content: center; }
.auth-pending .app-subheading { margin-bottom: 24px; }
.auth-pending form { margin: 0; }

.auth-status-line--on-light { color: var(--green); }

.auth-pending-hint {
  font-size: 12.5px;
  color: var(--text-light-muted);
  margin: 16px 0 0;
}

.auth-pending-escape {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
}

/* A button that has to read as a link: sign-out is a DELETE, so it can't be
   an anchor. */
.auth-inline-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--green-signal);
  font-weight: 600;
  cursor: pointer;
}
.auth-inline-button:hover { text-decoration: underline; }

@media (max-width: 880px) {
  .auth-signup { flex-direction: column; gap: 32px; }
  .auth-pitch { display: none; }
}

/* ============================================================
   Billing — gate banner, ledger rows, invoices. Recovered money is the one
   exception to the console's monochrome theme (brief: recovered $ = green).
   ============================================================ */
/* The gate renders inside the page body of two different layouts — the console
   shell and the narrow onboarding column — so every console token here carries
   its literal fallback: outside .app-console they resolve to nothing. */
.app-billing-gate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--console-amber-bg, #FDF3E7);
  border: 1px solid #EFDCBF;
  border-inline-start: 3px solid var(--console-amber, #B7791F);
  border-radius: var(--console-radius-card, 10px);
}

.app-billing-gate-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--console-radius-pill, 999px);
  background: #F7E5CB;
  color: var(--console-amber, #B7791F);
}

/* The wrap point is the text's min-width, not a breakpoint: this renders both
   in the console's full-width column and in the 480px onboarding one, and only
   the first of those has a viewport width that says anything useful. */
.app-billing-gate-text {
  flex: 1;
  min-width: 260px;
}

.app-billing-gate-title {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: #7C4E12;
}

.app-billing-gate-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--console-text-secondary, #6B6B6B);
}

.app-billing-gate-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-app-body);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--console-radius-control, 7px);
  background: var(--console-text-primary, #1A1A1A);
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
}

.app-billing-gate-cta:hover {
  background: #333333;
  color: #FFFFFF;
}

/* A clock still running is a notice, not a stop: the same shape on the
   canvas tint with the plain border, so a merchant who has seen the amber
   pause knows at a glance which of the two this is. */
.app-billing-gate--warning {
  background: var(--console-surface, #FFFFFF);
  border-color: var(--console-border-card, #E3E3E3);
  border-inline-start-color: var(--console-text-primary, #1A1A1A);
}

.app-billing-gate--warning .app-billing-gate-icon {
  background: var(--console-canvas, #F6F6F7);
  color: var(--console-text-primary, #1A1A1A);
}

.app-billing-gate--warning .app-billing-gate-title {
  color: var(--console-text-primary, #1A1A1A);
}

/* On a phone the copy always runs to three or four lines, so the icon aligns to
   the heading it labels rather than centring against the whole block, and the
   wrapped button takes the full width instead of sitting orphaned at the left. */
@media (max-width: 560px) {
  .app-billing-gate {
    align-items: flex-start;
  }

  /* 260px of text plus the icon doesn't fit a 375px screen, and dropping the
     icon to its own line is the one wrap that reads as a mistake. */
  .app-billing-gate-text {
    min-width: 0;
    flex-basis: calc(100% - 44px);
  }

  .app-billing-gate-cta {
    width: 100%;
    justify-content: center;
  }
}

/* A payment connection that stopped syncing, on every console page until it's
   reconnected (shared/connection_alert_banner). The billing gate's shape so
   the console has one banner grammar; tighter, because the message is one line
   and an account can show two. Error red is the console's own error token —
   the card's "Errored" badge already uses it for the same fact. Same literal
   fallbacks as the gate, for the same reason. */
.app-connection-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--console-surface, #FFFFFF);
  border: 1px solid var(--console-error-border, #E3B3AA);
  border-inline-start: 3px solid var(--console-error, #D82C0D);
  border-radius: var(--console-radius-card, 10px);
}

.app-connection-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--console-radius-pill, 999px);
  background: color-mix(in srgb, var(--console-error, #D82C0D) 10%, transparent);
  color: var(--console-error, #D82C0D);
}

.app-connection-alert-icon svg {
  width: 14px;
  height: 14px;
}

.app-connection-alert-text {
  flex: 1;
  min-width: 220px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--console-text-secondary, #6B6B6B);
}

/* The provider's own identifier for the account, so the merchant can match it
   against their Stripe dashboard — a number, so mono, same as the card rows. */
.app-connection-alert-ref {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--console-text-primary, #1A1A1A);
}

.app-connection-alert-link {
  font-weight: 700;
  color: var(--console-text-primary, #1A1A1A);
  text-decoration: underline;
  text-decoration-color: var(--console-border-input, #C9C9C9);
  text-underline-offset: 2px;
}

.app-connection-alert-link:hover {
  text-decoration-color: var(--console-text-primary, #1A1A1A);
}

/* Quieter than the gate's black block: this is a notice with a way out, not
   a pause, and two of them stacked shouldn't read as two alarms. The hover
   stays quiet too, and not only for that reason — this is a link, so the
   console's blanket `a:not(.app-console-btn):hover { color: inherit }` above
   outranks any color set here, and an inverted hover became a black block
   with a black label. */
/* An <a> for a link-shaped reconnect, a <button> inside a `button_to` form for
   an install-shaped one — the same class on both, and the resets a button
   needs to sit where the link does. */
.app-connection-alert form.button_to {
  flex-shrink: 0;
  display: contents;
}

.app-connection-alert-cta {
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
  line-height: normal;
  align-items: center;
  font-family: var(--font-app-body);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border: 1px solid var(--console-text-primary, #1A1A1A);
  border-radius: var(--console-radius-control, 7px);
  background: var(--console-surface, #FFFFFF);
  color: var(--console-text-primary, #1A1A1A);
  text-decoration: none;
  white-space: nowrap;
}

.app-connection-alert-cta:hover {
  background: var(--console-canvas, #F6F6F7);
}

@media (max-width: 560px) {
  .app-connection-alert {
    align-items: flex-start;
  }

  .app-connection-alert-text {
    min-width: 0;
    flex-basis: calc(100% - 38px);
  }

  .app-connection-alert-cta {
    width: 100%;
    justify-content: center;
  }
}

.app-console-money--recovered {
  color: var(--green);
  font-family: var(--font-mono);
}

.app-console-money--credit {
  color: var(--console-error);
}

.app-console-billing-activate {
  margin-bottom: 24px;
}

.app-console-billing-activate .app-console-card-body {
  margin-bottom: 16px;
}

/* The card on file: detail on the left, Replace/Remove on the right, and on a
   phone the two stack rather than squeezing three controls onto one line. */
.app-console-payment-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.app-console-payment-method-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-console-payment-method-card {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--console-text-primary);
}

/* The glyph labels the row, it doesn't signal anything — secondary weight, so
   the method itself is still the first thing read. */
.app-console-payment-method-card svg {
  flex: none;
  color: var(--console-text-secondary);
}

.app-console-payment-method-meta {
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

/* "No payment method on file" — a sentence, in the body face. The mono face
   above is for a card's own label, which reads like the digits it is. */
.app-console-payment-method-empty {
  font-size: 14px;
  color: var(--console-text-primary);
}

.app-console-payment-method-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* An expired card is a warning, not a failure — the invoice hasn't been
   raised yet — so it takes the amber note, not the error red. */
.app-console-payment-method-note {
  margin: 0;
  padding: 0 20px 16px;
  font-size: 12.5px;
  color: var(--console-amber);
}

@media (max-width: 560px) {
  .app-console-payment-method-actions {
    width: 100%;
  }

  .app-console-payment-method-actions form {
    flex: 1;
  }

  .app-console-payment-method-actions .app-console-btn {
    width: 100%;
  }
}

.app-console-billing-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 130px 120px minmax(0, 220px);
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--console-border-row);
  font-size: 13.5px;
}

.app-console-panel > .app-console-billing-row:last-of-type {
  border-bottom: none;
}

.app-console-billing-row--header {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--console-border-row);
}

/* One row per connection on the billing page: which rail collects its fee.
   The name column is fixed so the explanations line up down the panel. */
.app-console-billing-rail {
  display: flex;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--console-border-row);
  font-size: 13.5px;
}

.app-console-billing-rail:last-child {
  border-bottom: 0;
}

.app-console-billing-rail-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 200px;
  font-weight: 600;
  color: var(--console-text-primary);
}

.app-console-billing-rail-name svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.app-console-billing-rail-body {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--console-text-primary);
}

.app-console-billing-rail-body p {
  margin: 0;
}

.app-console-billing-rail-meta {
  margin-top: 4px !important;
  color: var(--console-text-secondary);
}

.app-console-billing-rail-body .app-console-billing-badge {
  margin-bottom: 8px;
}

/* The panel clips its children to keep its rounded corners, and that would
   clip a badge's tooltip at the row's bottom edge. A panel that holds one
   lets it out instead (the billing page's own panel renders its badges
   without the tooltip, so this is for any other panel a badge lands in), and
   the last row carries the panel's bottom radius itself so a tinted platform
   row still ends in a rounded corner. */
.app-console-panel:has(.app-console-billing-hint) {
  overflow: visible;
}

.app-console-billing-rail:last-child {
  border-radius: 0 0 var(--console-radius-card) var(--console-radius-card);
}

/* A platform row — the shop's fee lands on somebody else's bill — sits on the
   canvas tint rather than the panel's white, so the eye separates "billed
   there" from "billed here" before reading a word. The platform's own mark
   does the naming; no brand colour, because the console is monochrome and
   green here means us. */
.app-console-billing-rail--platform {
  background: var(--console-canvas);
}

.app-console-billing-rail-link {
  color: var(--console-text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------
   The account's rate, at the top of the billing page (app/billings/_pricing):
   the number in mono, the sentence it begins, and — on personal pricing — a
   chip with an (i). Its own card rather than a panel: a panel clips its
   children, and the chip's hint has to hang below the card.
   ------------------------------------------------------------ */
.app-console-pricing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 24px;
  padding: 18px 22px;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
}

.app-console-pricing-main {
  flex: 1 1 320px;
  min-width: 0;
}

.app-console-pricing-main .app-console-stat-label {
  margin-bottom: 8px;
}

/* The number and the sentence it begins share a baseline, so they read as
   one line: "10% of what we recover…". */
.app-console-pricing-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
}

.app-console-pricing-number {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  color: var(--console-text-primary);
}

.app-console-pricing-body {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--console-text-secondary);
}

.app-console-pricing-personal {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ------------------------------------------------------------
   The billing badge: how one connection is billed, in three words, with the
   whole story one hover away. Shared by the connection tiles and the billing
   page (shared/_billing_badge). The hint is the sidebar's nav-hint pattern —
   a dark bubble on desktop, an inline line on a phone (below).
   ------------------------------------------------------------ */
.app-console-billing-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.app-console-billing-badge-label {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--console-radius-pill);
  border: 1px solid var(--console-border-input);
  color: var(--console-text-primary);
  background: var(--console-surface);
  white-space: nowrap;
}

/* The two platform rails and the card read differently at a glance: the
   platforms filled (the money leaves through them), the card outlined (it's
   ours to collect), and "No fee" in the muted tone since nothing happens. */
.app-console-billing-badge--shopify .app-console-billing-badge-label,
.app-console-billing-badge--wix .app-console-billing-badge-label {
  background: var(--console-text-primary);
  border-color: var(--console-text-primary);
  color: var(--console-surface);
}

.app-console-billing-badge--apple-app-store .app-console-billing-badge-label,
.app-console-billing-badge--google-play .app-console-billing-badge-label,
.app-console-billing-badge--shopify-payments .app-console-billing-badge-label {
  color: var(--console-text-secondary);
  border-style: dashed;
}

.app-console-billing-badge-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-pill);
  background: var(--console-surface);
  color: var(--console-text-secondary);
  font-family: var(--font-app-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.app-console-billing-badge-help:focus-visible {
  outline: 2px solid var(--console-text-primary);
  outline-offset: 1px;
}

/* The same bubble, hung off anything: `.app-console-hint-anchor` wraps the
   control, `.app-console-hint` is the bubble, and the control carries
   aria-describedby for it. `--above` opens upward, for a control at the
   bottom of its card. Hover on the anchor or focus inside it shows it. */
.app-console-hint-anchor {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
}

.app-console-billing-hint,
.app-console-hint {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 280px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--console-text-primary);
  color: var(--console-surface);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.005em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  pointer-events: none;
  /* Above the panels and cards that follow in the page, not just above the
     row it hangs off — nothing here creates a stacking context, so this is
     measured against the page. */
  z-index: 40;
}

.app-console-billing-hint::before,
.app-console-hint::before {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: var(--console-text-primary);
  transform: rotate(45deg);
}

.app-console-hint--above {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(4px);
}

/* "Don't fight — accept the dispute" and its (i), on one line under the
   approve button. The whole row is the hint's anchor, so the bubble opens
   below it at the card's own width — never over the approve button, never
   past the edge of a phone screen — and hovering the label explains it too. */
.app-console-accept-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
}

.app-console-accept-row > .app-console-hint {
  max-width: 100%;
  z-index: 10;
}

.app-console-accept-form {
  display: inline;
}

/* An (i) that opens a hint: the same round, quiet control as the billing
   badge's "?", drawn as the info glyph. */
.app-console-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--console-radius-pill);
  background: transparent;
  color: var(--console-text-secondary);
  cursor: help;
}

.app-console-info-button:hover {
  color: var(--console-text-primary);
}

.app-console-info-button:focus-visible {
  outline: 2px solid var(--console-text-primary);
  outline-offset: 1px;
}

/* Right-aligned to the control instead of left, for one that sits against the
   right edge of its card — the default opens the bubble off the side. */
.app-console-hint--end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.app-console-hint--end::before {
  inset-inline-start: auto;
  inset-inline-end: 14px;
}

.app-console-hint--above::before {
  top: auto;
  bottom: -5px;
}

/* A bubble with a link in it takes the pointer, and a transparent strip over
   the 8px gap keeps it open while the pointer travels into it. */
.app-console-hint--interactive {
  pointer-events: auto;
}

.app-console-hint--interactive::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: -10px;
  height: 10px;
}

.app-console-hint--interactive a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.app-console-billing-badge:hover .app-console-billing-hint,
.app-console-billing-badge-help:focus-visible + .app-console-billing-hint,
.app-console-hint-anchor:hover .app-console-hint,
.app-console-hint-anchor:focus-within .app-console-hint {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ------------------------------------------------------------
   The ledger's rail filter, and the two new facts on a ledger line.
   ------------------------------------------------------------ */
.app-console-panel-header:has(.app-console-billing-filter) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.app-console-billing-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-console-billing-filter-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--console-radius-pill);
  border: 1px solid var(--console-border-input);
  color: var(--console-text-secondary);
  background: var(--console-surface);
  text-decoration: none;
  white-space: nowrap;
}

.app-console-billing-filter-chip:hover {
  color: var(--console-text-primary);
  border-color: var(--console-text-primary);
}

.app-console-billing-filter-chip--active {
  background: var(--console-text-primary);
  border-color: var(--console-text-primary);
  color: var(--console-surface);
}

.app-console-billing-row-dispute {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-console-billing-row-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--console-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-billing-row-source svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.app-console-billing-row-rail {
  margin-inline-start: 6px;
  vertical-align: middle;
}

.app-console-panel > .app-console-invoice-row:last-of-type {
  border-bottom: none;
}

.app-console-invoice-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.app-console-invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-console-invoice-total {
  text-align: end;
}

.app-console-invoice-totals-row {
  padding: 14px 20px;
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .app-console-billing-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "date    chip"
      "dispute dispute"
      "recovered fee";
    row-gap: 4px;
  }

  .app-console-billing-row--header {
    display: none;
  }

  .app-console-billing-row span:nth-child(1) { grid-area: date; }
  .app-console-billing-row span:nth-child(2) { grid-area: dispute; }
  .app-console-billing-row span:nth-child(3) { grid-area: chip; justify-self: end; }
  .app-console-billing-row span:nth-child(4) { grid-area: recovered; }
  .app-console-billing-row span:nth-child(5) { grid-area: fee; text-align: end; }

  .app-console-invoice-row-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "period status"
      "amount status";
  }

  /* The areas above only do anything once the spans are placed in them —
     without this the period and the amount share the first cell. */
  .app-console-invoice-row-main span:nth-child(1) { grid-area: period; }
  .app-console-invoice-row-main span:nth-child(2) { grid-area: amount; }
  .app-console-invoice-row-main span:nth-child(3) { grid-area: status; justify-self: end; }

  .app-console-invoice-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-console-billing-rail {
    flex-direction: column;
    gap: 6px;
  }

  .app-console-billing-rail-name {
    flex-basis: auto;
  }

  /* On a phone the rail chip sits under the fee rather than beside it; the
     source line already wraps by being a block of its own. */
  .app-console-billing-row-rail {
    display: inline-flex;
    margin: 4px 0 0;
  }
}

/* There's no hover on a phone and a tap on the "?" fires no :focus-visible,
   so the hint stops floating and becomes a line under the badge — same
   words, always readable, and it can't push the page wider than the screen.
   Same rule the sidebar's nav hint follows. */
@media (max-width: 720px) {
  .app-console-billing-hint,
  .app-console-hint {
    position: static;
    flex-basis: 100%;
    max-width: none;
    width: auto;
    padding: 0;
    background: none;
    color: var(--console-text-secondary);
    box-shadow: none;
    font-size: 12px;
    font-weight: 400;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .app-console-billing-hint::before,
  .app-console-hint::before {
    display: none;
  }

  .app-console-billing-badge-help {
    display: none;
  }

  /* The accept row wraps so its explanation is a line of its own under the
     label, and the (i) goes — the words it would open are already there. */
  .app-console-accept-row {
    flex-wrap: wrap;
  }

  .app-console-accept-row .app-console-info-button {
    display: none;
  }

  /* The rate's chip keeps its words under it on a phone, like the accept
     row; the (i) would open what is already printed. */
  .app-console-pricing .app-console-info-button {
    display: none;
  }

  .app-console-pricing > .app-console-hint-anchor {
    flex-basis: 100%;
  }

  /* A tile's status keeps its one line on a phone: the (i) and its words go,
     and the console banner above every page says the same with the same link. */
  .app-console-connection-card-head .app-console-info-button,
  .app-console-connection-card-head .app-console-hint {
    display: none;
  }

  /* Under the button, full width, the same words. */
  .app-console-hint-anchor .app-console-hint {
    flex-basis: 100%;
    padding-top: 6px;
  }

  /* Except in the deadline card, where the control is a 22px mark: a line
     broken to that width is unreadable, so the anchor takes the card's full
     width and the name sits beside the mark under the countdown. */
  .app-console-deadline-card {
    flex-wrap: wrap;
  }

  .app-console-deadline-card .app-console-hint-anchor {
    width: 100%;
    align-items: center;
    gap: 8px;
  }

  .app-console-deadline-card .app-console-hint-anchor .app-console-hint {
    flex-basis: auto;
    padding-top: 0;
  }
}

/* ============================================================
   The OAuth consent screen (/oauth/authorize). One decision, short.

   Who is asking for which account in one sentence (with the account picker
   inline when an owner has several), the permissions as chips of a few
   words, two short lines, and one footer row: where to undo it on the left,
   Cancel and Approve on the right. The scope strings are never shown.
   ============================================================ */
.app-console-oauth {
  max-width: 560px;
  margin: 0 auto;
}

.app-console-oauth-ask {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* Who is asking: its mark (shared/provider_icon, the same glyph its card on
   Connections wears) in a small tile, then its name. The tile is what keeps
   a lettered fallback (an assistant with no official glyph yet) reading as a
   mark rather than a stray capital. */
.app-console-oauth-client {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
}

.app-console-oauth-client-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--console-canvas);
  border: 1px solid var(--console-border-card);
  color: var(--console-text-primary);
}

.app-console-oauth-client-mark svg {
  width: 15px;
  height: 15px;
}

.app-console-oauth-client-mark .app-console-provider-initial {
  font-size: 13px;
}

/* The console's select treatment, inline: no native arrow, our chevron
   centred on the right with the same right padding every time. */
.app-console-oauth-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  max-width: 100%;
}

.app-console-oauth-select select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--console-text-primary);
  text-overflow: ellipsis;
  cursor: pointer;
}

.app-console-oauth-select select:focus-visible {
  outline: none;
  border-color: #0E6B4A;
  box-shadow: 0 0 0 3px rgba(14, 107, 74, 0.16);
}

.app-console-oauth-select svg {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--console-text-secondary);
  pointer-events: none;
}

.app-console-oauth-chips {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-console-oauth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-pill);
  background: var(--console-canvas);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--console-text-primary);
  cursor: default;
}

.app-console-oauth-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--console-text-secondary);
}

.app-console-oauth-notes {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-console-oauth-notes p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--console-text-secondary);
}

.app-console-oauth-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--console-border-row);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-console-oauth-foot-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-console-oauth-foot-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-oauth-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* On a phone the decision goes under the sentence, full width, Approve first
   where the thumb is. */
@media (max-width: 560px) {
  .app-console-oauth-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .app-console-oauth-actions {
    flex-direction: column-reverse;
  }

  .app-console-oauth-actions form,
  .app-console-oauth-actions .app-console-btn {
    width: 100%;
  }
}

.app-console-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The funnel board: a column per rung, a card per account. Full width because
   nine columns at a readable card width do not fit the 1400px the rest of
   /admin uses, and a board that scrolls the whole page horizontally is worse
   than one that scrolls inside itself. */
.admin-main--wide {
  max-width: none;
}

.funnel-board {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-top: 20px;
}

/* Wide enough that a company name wraps at a space rather than mid-word —
   at 124px "Yesterday Co" came out as "Yesterd / ay Co". Nine of these
   overflow 1440, so the board scrolls inside itself; the page never does. */
.funnel-column {
  flex: 1 0 168px;
  min-width: 168px;
  background: rgba(var(--ink-rgb), 0.03);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px;
}

.funnel-column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.funnel-column-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

.funnel-column-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.funnel-column-stat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-light-muted);
  margin: 4px 0 10px;
  line-height: 1.4;
}

.funnel-column-empty {
  font-size: 12px;
  color: var(--text-light-muted);
  margin: 0;
}

/* A card darkens with time on the rung. Amber, never red — red is
   competitors and losses. */
/* The days are pinned to the corner rather than flexed beside the name.
   Sharing the row left the name ~59px in a 124px column, which broke
   "Yesterday Co" mid-word however the wrapping was set. */
.funnel-card {
  position: relative;
  display: block;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 38px 8px 10px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text-light-primary);
}

.funnel-card:last-child { margin-bottom: 0; }
.funnel-card:hover { border-color: rgba(var(--ink-rgb), 0.3); }

.funnel-card.is-fresh { background: #FFFFFF; }
.funnel-card.is-aging { background: rgba(217, 161, 59, 0.14); border-color: rgba(217, 161, 59, 0.35); }
.funnel-card.is-stale { background: rgba(217, 161, 59, 0.32); border-color: rgba(217, 161, 59, 0.6); }

/* break-word, not anywhere: `anywhere` split "Yesterday Co" as "Yesterda /
   y Co" in a 124px column. Only a single word longer than the card breaks. */
.funnel-card-name {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: break-word;
}

/* The days sit in the card corner, not under the name: nine columns of
   two-line cards is a lot of vertical space for one number. */
.funnel-card-meta {
  position: absolute;
  top: 8px;
  inset-inline-end: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light-body);
  white-space: nowrap;
}

/* Only the board goes full width — the width of the content column beside
   the sidebar, never under it. The heading and everything else stay in the
   1400px column the rest of /admin is set in, and the width was only ever
   for the columns. */
.funnel-board {
  margin-inline-start: calc(50% - (100vw - var(--anav-w, 0px)) / 2);
  margin-inline-end: calc(50% - (100vw - var(--anav-w, 0px)) / 2);
  /* Both edges clear the viewport, not the centred column above. Lining the
     first column up with the heading left a third of a wide screen empty,
     which is the opposite of what the board is for. */
  padding-inline-start: 32px;
  padding-inline-end: 32px;
}

/* An account page is five sections deep, so it gets a rail of its own.
   Sticky, because the reason to look at the notes is usually something you
   just read in the ladder. */
.admin-detail {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.admin-detail-nav {
  position: sticky;
  top: 24px;
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
}

.admin-detail-nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light-body);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}

.admin-detail-nav a:hover {
  background: rgba(var(--ink-rgb), 0.05);
  color: var(--text-light-primary);
}

.admin-detail-nav-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-light-muted);
}

.admin-detail-body {
  flex: 1 1 auto;
  min-width: 0;
}

/* On a phone the rail goes above the section as a row of tabs: beside it, it
   left the section a column a hundred pixels wide. */
@media (max-width: 720px) {
  .admin-detail {
    flex-direction: column;
    gap: 16px;
  }

  .admin-detail-nav {
    position: static;
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 0;
  }

  .admin-detail-body {
    width: 100%;
  }
}

/* The first heading in the body starts the page — it needs no gap above it. */
.admin-detail-body > section:first-child > h2.admin-heading {
  margin-top: 0;
}

.admin-heading--tight { margin-bottom: 8px; }

/* An unclassified account is a question. It is asked once, at the top, and
   disappears the moment it is answered. */
.admin-prompt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(var(--ink-rgb), 0.03);
}

.admin-prompt-label {
  font-size: 13px;
  font-weight: 600;
}

.admin-prompt .admin-form { margin-bottom: 0; }

/* `display: flex` above beats the UA stylesheet`s `[hidden] { display: none }`,
   so the reclassify form rendered anyway — hidden in the HTML and visible on
   the page. Any element given a display value needs its own [hidden] rule. */
.admin-prompt[hidden] { display: none; }

.admin-note-meta {
  white-space: nowrap;
  width: 180px;
  vertical-align: top;
}

/* The rail selects a section rather than scrolling to one, so the active
   entry has to look chosen. */
.admin-detail-nav a.is-active {
  background: rgba(var(--ink-rgb), 0.07);
  color: var(--text-light-primary);
  font-weight: 600;
}

/* A section heading opens its own panel now, so it needs no gap above it. */
.admin-detail-body > section > h2.admin-heading {
  margin-top: 0;
}

/* The classification, beside the company name. Amber when the value excludes
   the account from the funnel's counts, so the reason a merchant is missing
   from the board is legible from the page you land on. */
.admin-badge {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-light-body);
  background: rgba(var(--ink-rgb), 0.06);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 3px 10px;
}

.admin-badge.is-excluded {
  color: #8A6620;
  background: rgba(217, 161, 59, 0.18);
  border-color: rgba(217, 161, 59, 0.4);
}

.admin-prompt--folded {
  display: block;
  padding: 10px 16px;
}

.admin-prompt--folded > summary {
  cursor: pointer;
  list-style: none;
}

.admin-prompt--folded > summary::-webkit-details-marker { display: none; }
.admin-prompt--folded > summary::before { content: "▸ "; }
.admin-prompt--folded[open] > summary::before { content: "▾ "; }
.admin-prompt--folded[open] > summary { margin-bottom: 12px; }

/* The badge is a button now — the pencil opens the classification form. */
button.admin-badge {
  cursor: pointer;
  font-family: var(--font-mono);
}

button.admin-badge:hover { border-color: rgba(var(--ink-rgb), 0.35); }

.admin-badge-edit {
  margin-inline-start: 6px;
  opacity: 0.55;
}

.admin-note-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
}

.admin-btn--quiet {
  border-color: rgba(var(--ink-rgb), 0.18);
  color: var(--text-light-body);
  font-weight: 500;
}

.admin-btn--quiet:hover {
  border-color: var(--ink);
  color: var(--text-light-primary);
}

/* An account's billing section: the rate it pays now, large and in mono, the
   one-field form that changes it, and what saving does. */
.admin-pricing-current {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-light-body);
}

.admin-pricing-rate {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-light-primary);
}

.admin-pricing-warning {
  max-width: 640px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.03);
  font-size: 13px;
  line-height: 1.5;
}

.admin-pricing-form {
  margin-bottom: 8px;
}

.admin-pricing-label {
  font-size: 13px;
  font-weight: 600;
}

/* The "%" sits inside the field's right edge, so the box reads as a rate
   without the merchant-facing label having to say so. */
.admin-pricing-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.admin-input.admin-pricing-input {
  min-width: 0;
  width: 96px;
  padding-inline-end: 26px;
  font-family: var(--font-mono);
  text-align: end;
}

.admin-pricing-suffix {
  position: absolute;
  inset-inline-end: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-light-muted);
  pointer-events: none;
}

.admin-pricing-help {
  max-width: 640px;
  font-size: 13px;
  line-height: 1.5;
}

/* Half a line of chrome for a control that is read far more often than it is
   pressed — the token buttons sit on the same line as the sentence saying when
   the token was issued, and a full-size button there reads as the main thing
   on the page. */
.admin-btn--compact {
  font-size: 12px;
  padding: 4px 10px;
}

/* The whole row on one line: when it was issued, then the button. Its hint
   sits directly under it, so the row keeps only enough margin to clear the
   button's own box. */
.admin-token-row {
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 6px;
}

/* A footnote to the control above it, not a paragraph in its own right. */
.admin-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  max-width: 720px;
}


/* A collapsed section in /admin. The heading is the summary, so it keeps the
   type of the headings around it and gains a chevron. */
.admin-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.admin-details summary::-webkit-details-marker { display: none; }

/* The heading's own 40px of air would sit inside the flex line and drop the
   text below the chevron beside it — it belongs on the <details> instead. */
.admin-details { margin-top: 40px; }
.admin-details summary h2.admin-heading { margin: 0; }

.admin-details-chevron {
  font-size: 13px;
  color: var(--text-light-body);
  transition: transform 0.15s;
}

.admin-details[open] .admin-details-chevron { transform: rotate(180deg); }

.admin-details[open] summary { margin-bottom: 16px; }

/* A user can be on more than one account, so each gets its own line rather
   than a comma-separated run that the badges would break up. */
.admin-account-line {
  display: block;
  margin-bottom: 4px;
}

.admin-account-line:last-child { margin-bottom: 0; }

/* The GMV (12 mo) column. A money column is read by comparing digits down it,
   which only works in the mono face the house reserves for numbers — the
   header stays in the table's own face, and only stops wrapping "(12 mo)"
   onto a line of its own. */
.admin-gmv { white-space: nowrap; }
td.admin-gmv { font-family: var(--font-mono); }
/* The badge sits in its own column now, level with the name it belongs to. */
.admin-account-line .admin-badge { margin-inline-start: 0; }

/* The rung an account is sitting on, in the ladder on its page. */
.admin-table tr.is-current td {
  font-weight: 600;
  background: rgba(var(--ink-rgb), 0.04);
}

/* The `claude mcp add` line on /admin/settings and its copy button. Same box
   as .admin-prompt, because it is the same kind of thing — a strip of chrome
   holding one control. It wraps rather than scrolls: a command you can only
   see half of is one you have to trust the copy button for. */
.admin-code-block {
  max-width: 720px;
  margin-bottom: 6px;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(var(--ink-rgb), 0.03);
}

.admin-code-block pre {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-light-primary);
}

/* The BigCommerce connect screen (Bigcommerce::AppController#connect), on the
   same .frame-panel vocabulary as the connected panel above. Two doors, then
   one form; the markup is the two forms and the chooser is what the page's
   script folds them into. */
.frame-panel-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 0;
}

.frame-panel-door {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: start;
  padding: 16px;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.frame-panel-door:hover { border-color: var(--console-border-input); background: var(--console-canvas); }
.frame-panel-door:focus-visible { outline: 2px solid var(--green-signal); outline-offset: 2px; }

.frame-panel-door-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.frame-panel-door-sub { font-size: 13px; color: var(--console-text-secondary); }

.frame-panel-step { margin-top: 6px; }
.frame-panel-step[hidden] { display: none; }
.frame-panel-step .frame-panel-heading { margin-top: 18px; }
.frame-panel-step .app-form-field { margin-bottom: 14px; }
.frame-panel-step .app-form-field .frame-panel-note { margin: 6px 0 0; }
.frame-panel-step .app-checkbox-field { margin-bottom: 16px; }

.frame-panel-back {
  border: 0;
  padding: 0;
  background: none;
  color: var(--console-text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.frame-panel-back[hidden] { display: none; }
.frame-panel-back:hover { color: var(--console-text-primary); }

/* A failed connect, or a page that can't be shown. Ink on the surface with
   the console's own border — not red, which is competitors and losses only. */
.frame-panel-alert {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--console-border-input);
  border-inline-start: 3px solid var(--console-text-primary);
  border-radius: var(--console-radius-control);
  font-size: 13.5px;
  line-height: 1.5;
}

/* "Store connected." — the one line here that confirms something already
   done. It rides a query parameter rather than the flash, because inside the
   frame there is no session for a flash to live in. */
.frame-panel-toast {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--green-signal);
  font-size: 13.5px;
  font-weight: 600;
}

/* Timed and dismissible, the way the console's flash is (.app-flash--timed).
   The class and both controls are added by the panel's inline script, so with
   the script blocked the line keeps its original padding and neither the bar
   nor the button is ever shown. The right padding is the button's gutter —
   text must not run under it.

   The countdown reuses the flash's own @keyframes: one drain animation in the
   app, not two that can drift apart. */
.frame-panel-toast--timed {
  position: relative;
  overflow: hidden;
  padding-inline-end: 40px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.frame-panel-toast--leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.frame-panel-toast-timer {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: var(--green-signal);
  opacity: 0.35;
  transform-origin: left center;
  animation: app-flash-drain linear forwards;
}
.frame-panel-toast-timer[hidden] { display: none; }

/* Hovering or focusing the toast pauses the bar, and with it the dismissal —
   the animation ending is what removes it. */
.frame-panel-toast--timed:hover .frame-panel-toast-timer,
.frame-panel-toast--timed:focus-within .frame-panel-toast-timer {
  animation-play-state: paused;
}

.frame-panel-toast-close {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
}
/* `display: flex` above beats the UA sheet's `[hidden] { display: none }`, so
   restate it — otherwise a blocked script leaves a button that does nothing. */
.frame-panel-toast-close[hidden] { display: none; }
.frame-panel-toast-close:hover { opacity: 1; }
.frame-panel-toast-close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .frame-panel-toast--timed { transition: none; }
}

.frame-panel-support {
  margin: 28px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--console-border-row);
}

.frame-panel-support p:last-child { margin-bottom: 0; }

/* Support is a safety net, not a destination: the links stay underlined so
   they're still obviously links, but they carry the note's own grey rather
   than the green the rest of the panel uses for the things a merchant came
   here to do. Hover darkens to the body text, the way console links do. */
.frame-panel-support .frame-panel-link { color: var(--console-text-secondary); }
.frame-panel-support .frame-panel-link:hover,
.frame-panel-support .frame-panel-link:focus-visible { color: var(--console-text-primary); }

@media (max-width: 560px) {
  .frame-panel-doors { grid-template-columns: 1fr; }
}

/* A page title with the actions that page offers beside it. An action written
   into the prose under a heading is one nobody clicks. */
.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

/* The register list (/admin/cold-leads): filters held still on the left, the
   list read down the right. The panel is a column rather than the three
   rows of chips it replaced because the register is now filtered on eight
   things at once — traffic, ads, followers, what we hold — and a chip row can
   only ever express one of them at a time. */
.admin-register {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* Nine columns in what is left of a 1440 window: a little less air in each
   cell than the house table, so the last one (Next call) is not pushed off
   the page. The outreach step never breaks — "Follow-up 2" over two lines
   reads as two things. */
.admin-register-results .admin-table td { padding-inline-start: 8px; padding-inline-end: 8px; }
.admin-register-results .admin-table .admin-sort { padding-inline-start: 8px; padding-inline-end: 8px; }
.crm-row-stage { white-space: nowrap; }
.crm-row-due { color: #7A5A12; font-weight: 600; }

.admin-register-panel {
  position: sticky;
  top: 24px;
  /* Its own scroll, so a long list of statuses never pushes the filters under
     it off the bottom of a laptop screen. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-inline-end: 4px;
}

.admin-filter-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-filter-panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.admin-filter-group {
  margin-bottom: 18px;
}

.admin-filter-label,
.admin-filter-legend {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* The one label that reads as a sentence rather than a heading: the visits
   floor needs its unit said out loud. */
.admin-filter-label--quiet {
  font-weight: 400;
  color: #666666;
}

.admin-filter-input {
  display: block;
  width: 100%;
  min-width: 0;
  margin-bottom: 6px;
}

.admin-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.admin-filter-number {
  min-width: 0;
  width: 100%;
}

/* A tick, its label and how many the register holds — the count is what makes
   the list worth reading before anything is filtered. */
.admin-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  margin-bottom: 3px;
  cursor: pointer;
}

.admin-check input { margin: 0; }

.admin-check-count {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888888;
}

/* The results are a turbo-frame — an unknown element, so it is told to be a
   block rather than relying on the grid to blockify it. While the frame is
   fetching, Turbo marks it busy: the list dims instead of jumping, which is
   the only feedback a filter that applies itself needs. */
.admin-register-results {
  display: block;
  min-width: 0;
  transition: opacity 120ms ease;
}

.admin-register-results[busy] {
  opacity: 0.55;
}

.admin-register-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 13px;
  margin-bottom: 12px;
}

.admin-register-summary p { margin: 0; }

@media (max-width: 900px) {
  .admin-register {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .admin-register-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* A row of the cold-lead register: the whole width is the target, so it says
   so before it is clicked. The hover is the same wash the current rung of a
   ladder gets, one step lighter — it marks where the pointer is, not where
   the reader is. */
.admin-table tr.admin-row-link {
  cursor: pointer;
}

.admin-table tr.admin-row-link:hover td {
  background: rgba(var(--ink-rgb), 0.03);
}

/* The store just come back from, when a store page's Back lands on the list:
   marked, and scrolled to with room above it, so the eye finds the place and
   the store before it is still in view. A class rather than :target, which a
   Turbo visit never sets — it moves the address with pushState. */
.admin-table tr.admin-row-link {
  scroll-margin-top: 120px;
}

.admin-table tr.admin-row-link.is-returned td {
  background: rgba(var(--ink-rgb), 0.06);
}

/* A sortable column head. The whole head is the control — the label and the
   caret are one link, so there is no dead strip of th to click on — and the
   caret is always there rather than appearing on hover: a column that only
   admits it sorts once the mouse is already on it is one nobody finds. The
   idle caret is faint, the sorted one is ink and carries the direction. */
.admin-table th.admin-th-sort {
  padding: 0;
}

.admin-sort {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}

.admin-sort:hover {
  background: rgba(var(--ink-rgb), 0.03);
}

.admin-sort-caret {
  font-size: 11px;
  line-height: 1;
  opacity: 0.3;
}

.admin-sort:hover .admin-sort-caret { opacity: 0.6; }

.admin-sort.is-sorted .admin-sort-caret {
  opacity: 1;
  color: var(--green);
}

/* The cold lead's own page (/admin/cold-leads/:id). It is the one /admin page
   somebody works *from* rather than reads: they look at the record, decide
   where the store is in the pipeline, and write down what they found. So the
   record is a column and the two things they do sit in a rail beside it,
   rather than the record being a stack of tables with the note box under the
   last one. */

/* The title line leads with the way back. It was a link on a line of its own
   above the heading, which spent a row of the page on the exit; as a quiet
   button in front of the name it reads as a control and sits where a reader
   looks for it. Centred rather than baseline-aligned, because a 25px button
   hung off the cap line of a 22px heading reads as having slipped. */
.crm-titlebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
}

/* The space under the title belongs to the row, not to the heading: a bottom
   margin on the h1 is part of its box, so centring the row against it hung
   the button half that margin below the title and the two stopped reading as
   one line. */
.crm-titlebar > .admin-heading {
  margin-bottom: 0;
}

/* The arrow is part of the label, not a second word: no gap of its own beyond
   the space between them. */
.crm-back {
  flex-shrink: 0;
  text-decoration: none;
}

.crm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

/* The record is a stack of cards, one per thing the page holds — the estimate,
   what was parsed, what the model answered, where the row came from, how the
   score is composed. It was four headings and four tables running into one
   another, and on a store with a long fact table there was nothing to say
   where one section ended and the next began. Same box as the rail's cards,
   sized for a wide column; the gap replaces the margins the tables carried. */
.crm-record {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* A link that finishes on somebody else's site carries the arrow, as the
   console's connection tiles do. It is aria-hidden and sits inside the link,
   so it never wraps onto a line of its own away from the domain it marks. */
.crm-external {
  white-space: nowrap;
}

.crm-external-cue {
  margin-inline-start: 4px;
  font-size: 12px;
}

/* The card carries the space under it. Inside the record column the stack's
   own gap already does, so it gives the margin back there. */
.crm-panel {
  margin: 0 0 20px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 18px 20px;
  background: rgba(var(--ink-rgb), 0.02);
}

.crm-record > .crm-panel { margin-bottom: 0; }

/* The card's own padding is the space under the last thing in it. */
.crm-panel > :last-child { margin-bottom: 0; }

/* A section heading in the main column stays a sentence at reading size — the
   rail's uppercase labels are for cards 320px wide, and "What the model
   judged" set in small caps reads as shouting. */
.crm-panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
}

.crm-panel > summary .crm-panel-title { margin: 0; }

/* The table is the card: its rows run to the padding rather than being inset
   inside it a second time, and the last one drops its rule, because the card's
   own edge already says the table has ended. */
.crm-panel .admin-table th:first-child,
.crm-panel .admin-table td:first-child { padding-inline-start: 0; }

.crm-panel .admin-table th:last-child,
.crm-panel .admin-table td:last-child { padding-inline-end: 0; }

.crm-panel .admin-table tbody tr:last-child th,
.crm-panel .admin-table tbody tr:last-child td {
  border-bottom: none;
  padding-bottom: 0;
}

/* Sticky, because the reason to write a note is almost always something just
   read in the record beside it. No scroll of its own: it had one, capped at
   the viewport, and with four cards in the rail the notes sat below the cap
   where no page scroll reached them and only the rail's inner scrollbar did.
   Two cards fit a laptop screen; a rail that outgrows one scrolls with the
   page and its foot comes into view at the record's end, which is where a
   long list of contacts is read anyway. */
.crm-side {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* The count beside a card or panel title — how many notes, how many facts —
   set quiet, so a folded card is read as full rather than empty. */
.crm-card-count,
.crm-panel-count {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-light-muted);
}

/* What the store sells, in the source's words, under the meta line. */
.crm-description {
  font-size: 14px;
  color: var(--text-light-body);
  margin: -6px 0 16px;
  max-width: 720px;
}

/* The newest note, read out under the stage track: one line, the stamp and
   the author quiet, the sentence itself at reading colour, and a way to the
   log at the end. It is the state of the conversation and it stands beside
   the rung the store is on, before the record starts. */
.crm-last-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 13px;
  margin: -8px 0 20px;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--green);
  background: rgba(var(--ink-rgb), 0.025);
  border-radius: 0 8px 8px 0;
}

.crm-last-note-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light-muted);
}

.crm-last-note-stamp {
  font-size: 11.5px;
  color: var(--text-light-muted);
}

.crm-last-note-who {
  font-size: 12px;
  color: var(--text-light-muted);
}

.crm-last-note-body {
  flex: 1 1 320px;
  min-width: 0;
  color: var(--text-light-primary);
  overflow-wrap: anywhere;
}

.crm-last-note-link {
  font-size: 12.5px;
  white-space: nowrap;
}

/* Where the row came from, as a line at the foot of the record rather than
   a card of dates. */
.crm-provenance {
  font-size: 12px;
  margin: 0;
}

/* A fact card in the wide column — the checkout, the social pages — holds a
   line or two and a folded form. Its form was drawn for the 320px rail, and
   an input that is 100% of a 900px column is a field nobody can read across,
   so the form keeps the rail's width here. */
.crm-panel--fact .crm-checkout-form,
.crm-panel--fact .crm-social-form {
  max-width: 420px;
}

/* A folded card in the record column; the stack's own gap spaces it, not
   the 40px a folded section carries on the settings page. */
.crm-record > .admin-details { margin-top: 0; }
.crm-record > .admin-details[open] > summary { margin-bottom: 14px; }

.crm-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(var(--ink-rgb), 0.02);
}

.crm-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.crm-card-empty {
  font-size: 12.5px;
  margin: 0;
}

/* One person at the store. A store holds several, so each is its own block
   with a rule between it and the next: the card is read as a short list of
   who there is to write to, not as one contact with extra lines. */
.crm-contact + .crm-contact {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.crm-contact-line {
  font-size: 14.5px;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

/* The profile link, under the number: a link out, with the same cue the
   store's own site carries, because it leaves /admin too. */
.crm-contact-line--link {
  font-size: 12.5px;
}

/* Remove sits at the far end of the edit form, quiet: a second control on
   the same line as Save that looks the same is how the wrong one gets
   pressed. Confirmed, because it is gone. */
.crm-contact-remove {
  font-size: 12.5px;
  color: var(--text-light-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.crm-contact-remove:hover { color: var(--text-light-primary); }

.crm-contact-remove-form {
  display: inline;
  margin: 8px 0 0;
}

/* Who they are at the store, read as a caption to the name above it rather
   than as a second fact of its own — it qualifies the name, it isn't beside
   it. Pulled up under the name, since the two are one line of reading. */
.crm-contact-line--role {
  margin-top: -4px;
  font-size: 12.5px;
  color: #888888;
}

/* An address or a phone number and the button that copies it, on one line.
   The value takes the width and the button keeps its size, so a long address
   wraps inside its own column rather than pushing the button off the card. */
.crm-contact-line--value {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.crm-contact-value {
  font-size: 13.5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* "shared inbox", after the copy button: a qualifier on the address, sized
   and spaced so the address is still what the line is. */
.crm-contact-kind {
  flex-shrink: 0;
  align-self: center;
}

/* The same control as the impersonation banner's, in the back office's own
   colours: the mark swaps to a tick for a moment once it is pressed, which is
   the only confirmation a copy can honestly give. */
.crm-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: -1px;
  padding: 0;
  color: var(--text-light-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.crm-copy svg {
  display: block;
  width: 13px;
  height: 13px;
}

.crm-copy:hover {
  color: var(--text-light-primary);
  border-color: var(--border-light);
}

.crm-copy:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.crm-copy-idle,
.is-copied .crm-copy-done { display: flex; }

.crm-copy-done,
.is-copied .crm-copy-idle { display: none; }

.is-copied .crm-copy { color: var(--green); }

/* The verdict on the address and the control that asks for one, on the line
   under the address they are about. The flag comes first because it is what
   the card is read for; the button is quiet, because most visits to this card
   are to read the address, not to re-check it. */
.crm-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}

.crm-verdict-form {
  display: inline;
  margin: 0;
}

/* Why the verdict says what it says, and when it was asked. Small, grey and
   under the flag: a person who trusts the flag never reads it, and a person
   who doesn't needs the reason more than the colour. */
.crm-verdict-note {
  font-size: 12px;
  color: #888888;
  margin: -2px 0 8px;
}

.crm-card-actions {
  margin: 12px 0 0;
}

/* A contact's edit form is folded away: the card is for looking at who to
   write to, not for filling the same five fields in again. The add form at
   the foot of the card opens itself on a store that holds nobody, where
   filling it in is the only thing to do. */
.crm-card-edit {
  margin-top: 12px;
}

.crm-card-edit > summary {
  font-size: 12.5px;
  color: var(--text-light-muted);
  cursor: pointer;
  list-style: none;
}

.crm-card-edit > summary::-webkit-details-marker { display: none; }
.crm-card-edit > summary::before { content: "▸ "; }
.crm-card-edit[open] > summary::before { content: "▾ "; }
.crm-card-edit[open] > summary { margin-bottom: 10px; }
.crm-card-edit .admin-form { margin-bottom: 0; }

/* One network per line: the name, the count, and the way to the page. The
   count is what the card is read for, so it sits beside the name in the mono
   face every number here is set in, and the link is a word at the end of the
   line rather than a URL that would wrap the 320px rail twice. */
.crm-social-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  margin: 0 0 6px;
}

.crm-social-network {
  min-width: 72px;
}

.crm-social-count {
  flex: 1;
  min-width: 0;
}

.crm-social-link {
  font-size: 12.5px;
}

.crm-social-stamp {
  font-size: 12px;
  color: var(--text-light-muted);
  margin: 4px 0 0;
}

/* The evidence a checkout reading was made from is usually a URL, and a URL
   with no break opportunity would push the 320px card wide. */
.crm-checkout-evidence {
  font-size: 12.5px;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

/* The social form has labels between its boxes, so the boxes need no gap of
   their own — and the last field's margin would otherwise push the hint. */
.crm-social-form .admin-field {
  margin-bottom: 8px;
}

.crm-social-form .admin-field label {
  font-size: 12.5px;
  margin-bottom: 3px;
}

/* The rail is 320px wide; a 240px input with a min-width sets its own. */
.crm-input {
  width: 100%;
  min-width: 0;
}

/* Three bare fields in a column — name, address, number — read as one control
   with two seams in it when they touch. They have no labels between them to
   do the separating, so the gap does. */
.crm-input + .crm-input {
  margin-top: 8px;
}

/* Newest first — a log is appended to, and the reason to open it is what
   somebody wrote last. Each note is its own card: the log used to be entries
   separated by a hairline, and a three-line note next to a one-line note read
   as one paragraph with a stamp in the middle of it. */
.crm-notes {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-note {
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #FFFFFF;
}

/* A note a tool wrote, marked at the edge as well as in the badge: the eye
   reads down the rail for "what did a person say about this store", and the
   stripe answers that before any of the words do. Ink, not green — a tool
   writing a line down is neither good news nor bad. */
.crm-note--agent {
  border-inline-start: 3px solid rgba(var(--ink-rgb), 0.28);
  padding-inline-start: 9px;
}

/* When it was written on the left, the way to take it back on the right. The
   delete stays quiet — it is the rarest thing done on this card, and a note
   people are afraid to write is worse than one nobody deletes. */
.crm-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-note-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light-muted);
  margin: 0;
  /* One line: with the delete button beside it the stamp wrapped, and a date
     broken across two lines reads as two facts. */
  white-space: nowrap;
}

.crm-note-delete-form { margin: 0; }

.crm-note-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--text-light-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0;
  opacity: 0.45;
  cursor: pointer;
}

.crm-note:hover .crm-note-delete,
.crm-note-delete:focus-visible { opacity: 1; }

.crm-note-delete:hover {
  color: var(--text-light-primary);
  border-color: var(--border-light);
}

.crm-note-delete:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* Who wrote it. Three facts on an agent line — that a tool wrote it, which
   tool, and whose token it ran under — so they are three marks, not one
   string. It wraps: the rail is 320px and an address plus a tool name is
   longer than that. */
.crm-note-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-light-muted);
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.crm-note-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4A4A4A;
  background: rgba(var(--ink-rgb), 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}

.crm-note-tool {
  font-size: 11px;
  color: var(--text-light-primary);
}

.crm-note-who {
  color: var(--text-light-body);
}

/* The sentence itself, at reading size and given the room the meta above it
   gave up. */
.crm-note-body {
  font-size: 13px;
  line-height: 1.55;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

/* The note is markdown (NoteMarkdown), so everything markdown can produce has
   to look like it belongs in a 13px card in a sidebar. The rule for all of it
   is the same: no element inside a note may be larger or louder than the note.
   Outer margins are stripped because the list item already spaces them. */
.crm-note-body > :first-child { margin-top: 0; }
.crm-note-body > :last-child { margin-bottom: 0; }

.crm-note-body p,
.crm-note-body ul,
.crm-note-body ol,
.crm-note-body pre,
.crm-note-body blockquote,
.crm-note-body table {
  margin: 0 0 8px;
}

/* A heading in a note is a label on a paragraph, not a heading on the page —
   somebody typed `##` to separate two findings. Same size as the body, told
   apart by weight. */
.crm-note-body h1,
.crm-note-body h2,
.crm-note-body h3,
.crm-note-body h4,
.crm-note-body h5,
.crm-note-body h6 {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
}

.crm-note-body ul,
.crm-note-body ol {
  padding-inline-start: 18px;
}

.crm-note-body li + li { margin-top: 2px; }

.crm-note-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(var(--ink-rgb), 0.05);
  border-radius: 3px;
  padding: 1px 4px;
}

.crm-note-body pre {
  background: rgba(var(--ink-rgb), 0.05);
  border-radius: 4px;
  padding: 8px;
  overflow-x: auto;
}

.crm-note-body pre code {
  background: none;
  padding: 0;
}

/* The green rule is the house's quote mark, at the weight a sidebar can take. */
.crm-note-body blockquote {
  border-inline-start: 2px solid var(--green);
  padding-inline-start: 10px;
  color: var(--text-light-body);
}

.crm-note-body table {
  border-collapse: collapse;
  font-size: 12px;
}

.crm-note-body th,
.crm-note-body td {
  border: 1px solid var(--border-light);
  padding: 3px 6px;
  text-align: start;
}

.crm-note-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 8px 0;
}

/* The older notes, folded under the newest few: the same quiet toggle the
   edit forms use, with the count in it, so a store worked for a month says
   how much of the log is under the fold. */
.crm-notes-more {
  margin-top: 8px;
}

.crm-notes-more > summary {
  font-size: 12.5px;
  color: var(--text-light-muted);
  cursor: pointer;
  list-style: none;
}

.crm-notes-more > summary::-webkit-details-marker { display: none; }
.crm-notes-more > summary::before { content: "▸ "; }
.crm-notes-more[open] > summary::before { content: "▾ "; }
.crm-notes-more > .crm-notes { margin-top: 8px; }

/* Under the textarea, not beside the button: it is about what you type. */
.crm-note-hint {
  font-size: 11px;
  margin: 6px 0 0;
}

/* Where the agent read it. Half of an agent's note is an address, and one
   that can be clicked is the difference between checking a source and taking
   its word for it. */
.crm-note-link {
  color: var(--text-light-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(var(--ink-rgb), 0.35);
}

.crm-note-link:hover {
  text-decoration-color: currentColor;
}

@media (max-width: 1000px) {
  .crm-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .crm-side {
    position: static;
  }
}

/* ── /admin/outreach — the pieces other admin pages borrow, and the hit lists ── */
.outreach-inline-form { display: inline; }
.outreach-error { color: #8A6620; font-size: 13px; }

/* The status pill outside the frame: the store's contact card, mail, calls. */
.outreach-badge { margin-inline-start: 0; }
.admin-badge.is-opened { color: #0E6B4A; border-color: rgba(14, 107, 74, 0.35); }
.admin-badge.is-clicked { color: #0E6B4A; border-color: #0E6B4A; background: rgba(14, 107, 74, 0.08); }
.admin-badge.is-replied { color: #fff; background: #0E6B4A; border-color: #0E6B4A; }

.outreach-open-list { margin: 0; padding-inline-start: 18px; }
.outreach-click-url { word-break: break-all; }
.outreach-body {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow-wrap: anywhere;
}

/* A contact's cold emails, on its card in the register. */
.crm-contact-emails { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.crm-contact-emails li { margin: 0 0 4px; }

/* ── /admin/docs — shared docs, drawn like Drive and Google Docs ─────── */
/* The list is Drive (cards with a miniature of the page, a search pill, a New
   button) and a doc is Google Docs (a paper page on a grey desk, comment cards
   in the margin, version history in a side panel), because those are the
   shapes everybody already knows how to use. Colour stays the house's: ink for
   controls, green only where something was added, never red — a removed word
   is struck through in grey, because a deletion is an edit, not a loss. */
.admin-main--doc {
  max-width: 1480px;
  padding-top: 20px;
}

.drive,
.gdoc {
  --doc-desk: #F2F3EF;
  --doc-paper: #FFFFFF;
  --doc-line: rgba(var(--ink-rgb), 0.10);
  --doc-soft: rgba(var(--ink-rgb), 0.05);
  --doc-hover: rgba(var(--ink-rgb), 0.06);
  --doc-muted: rgba(var(--ink-rgb), 0.56);
  --doc-tint: #E5F2EB;
  --doc-mark: #FBE7AE;
  --doc-mark-strong: #F5CF5F;
  --doc-shadow: 0 1px 2px rgba(16, 24, 20, 0.06), 0 4px 16px rgba(16, 24, 20, 0.06);
  --doc-shadow-lift: 0 2px 6px rgba(16, 24, 20, 0.08), 0 12px 32px rgba(16, 24, 20, 0.12);
  color: var(--ink);
}

.doc-icon { flex-shrink: 0; display: block; }

/* Buttons: pills, ink on paper. */
.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.doc-btn--primary { background: var(--ink); color: #FFFFFF; }
.doc-btn--primary:hover { background: #000000; box-shadow: 0 2px 8px rgba(16, 24, 20, 0.22); color: #FFFFFF; }
.doc-btn--quiet { background: transparent; color: var(--ink); }
.doc-btn--quiet:hover { background: var(--doc-hover, rgba(0, 0, 0, 0.06)); }
.doc-btn--sm { height: 30px; padding: 0 14px; font-size: 12.5px; }

/* A person's round initial; a small dot marks an agent writing on their token. */
.doc-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #FFFFFF;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.doc-avatar--md { width: 32px; height: 32px; font-size: 14px; }
.doc-avatar--sm { width: 24px; height: 24px; font-size: 11px; }
.doc-avatar--xs { width: 18px; height: 18px; font-size: 9.5px; vertical-align: -4px; }
.doc-avatar.tone-1 { background: #3D6FB4; }
.doc-avatar.tone-2 { background: #7A5BA6; }
.doc-avatar.tone-3 { background: #0E7C86; }
.doc-avatar.tone-4 { background: #B07A1E; }
.doc-avatar.tone-5 { background: #4B5563; }
.doc-avatar.tone-6 { background: #2F7D57; }

.doc-avatar-agent {
  position: absolute;
  inset-inline-end: -2px;
  bottom: -2px;
  width: 40%;
  height: 40%;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #FFFFFF;
}

.doc-agent-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--doc-soft, rgba(0, 0, 0, 0.05));
  color: var(--doc-muted, #666);
  font: 600 10px/1.6 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* ── The list (Drive) ── */
.drive-top {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
}

.drive-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 600 24px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.drive-title .doc-icon { color: var(--green); }

.drive-search {
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: #ECEEE9;
  color: var(--doc-muted);
  transition: background-color 0.15s, box-shadow 0.15s;
}

.drive-search:focus-within { background: #FFFFFF; box-shadow: var(--doc-shadow); }

.drive-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.drive-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.drive-new { position: relative; }
.drive-new > summary { list-style: none; }
.drive-new > summary::-webkit-details-marker { display: none; }

.drive-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px 0 16px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: var(--doc-shadow);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: box-shadow 0.15s, background-color 0.15s;
}

.drive-new-btn:hover,
.drive-new[open] .drive-new-btn { box-shadow: var(--doc-shadow-lift); background: #FBFCFA; }

.drive-new-panel {
  position: absolute;
  top: 60px;
  inset-inline-start: 0;
  z-index: 20;
  width: 320px;
  padding: 18px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: var(--doc-shadow-lift);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.drive-new-label { font-size: 12.5px; font-weight: 600; color: var(--doc-muted); }

.drive-new-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--doc-line);
  border-radius: 10px;
  font-size: 14px;
}

.drive-new-input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.drive-chips { display: flex; gap: 8px; }

.drive-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.drive-chip:hover { background: var(--doc-hover); }
.drive-chip.is-active { background: var(--doc-tint); border-color: transparent; color: var(--green-dark); }

.drive-views {
  margin-inline-start: auto;
  display: inline-flex;
  border: 1px solid var(--doc-line);
  border-radius: 999px;
  overflow: hidden;
}

.drive-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  color: var(--doc-muted);
}

.drive-view + .drive-view { border-inline-start: 1px solid var(--doc-line); }
.drive-view:hover { background: var(--doc-hover); }
.drive-view.is-active { background: var(--doc-tint); color: var(--green-dark); }

.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.drive-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: #FFFFFF;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}

.drive-card:hover { box-shadow: var(--doc-shadow-lift); border-color: transparent; transform: translateY(-2px); }

.drive-thumb {
  position: relative;
  height: 172px;
  padding: 16px 20px 0;
  background: var(--doc-desk);
  border-bottom: 1px solid var(--doc-line);
  overflow: hidden;
}

/* The first lines of the doc, drawn small on a sheet, fading out at the foot. */
.drive-thumb-page {
  height: 100%;
  padding: 14px 16px;
  background: var(--doc-paper);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 1px 3px rgba(16, 24, 20, 0.10);
  font-size: 7.5px;
  line-height: 1.45;
  color: rgba(var(--ink-rgb), 0.75);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
  pointer-events: none;
}

.drive-thumb-page > :first-child { margin-top: 0; }
.drive-thumb-page p,
.drive-thumb-page ul,
.drive-thumb-page ol,
.drive-thumb-page table,
.drive-thumb-page pre,
.drive-thumb-page blockquote { margin: 0 0 4px; }
.drive-thumb-page ul,
.drive-thumb-page ol { padding-inline-start: 10px; }
.drive-thumb-page h1 { font-size: 12px; margin: 0 0 5px; }
.drive-thumb-page h2 { font-size: 10px; margin: 6px 0 3px; }
.drive-thumb-page h3,
.drive-thumb-page h4,
.drive-thumb-page h5,
.drive-thumb-page h6 { font-size: 8.5px; margin: 5px 0 2px; }
.drive-thumb-page td,
.drive-thumb-page th { border: 0.5px solid var(--doc-line); padding: 1px 3px; }

.drive-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--doc-mark);
  color: #5C4A12;
  font: 600 11.5px/1 var(--font-mono);
}

.drive-badge--float { position: absolute; top: 10px; inset-inline-end: 10px; box-shadow: 0 1px 2px rgba(16, 24, 20, 0.12); }

.drive-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 14px;
}

.drive-file-icon { color: var(--green); display: inline-flex; }

.drive-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.drive-card-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--doc-muted); }

.drive-list { border: 1px solid var(--doc-line); border-radius: 14px; overflow: hidden; background: #FFFFFF; }

.drive-list-head,
.drive-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 110px 100px;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.drive-list-head {
  height: 44px;
  border-bottom: 1px solid var(--doc-line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--doc-muted);
}

.drive-list-row {
  min-height: 60px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--doc-line);
}

.drive-list-row:last-child { border-bottom: 0; }
.drive-list-row:hover { background: #F7F8F5; }
.drive-list-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drive-list-text { display: flex; flex-direction: column; min-width: 0; }
.drive-list-title { font-size: 14px; font-weight: 600; }
.drive-list-summary { font-size: 12.5px; color: var(--doc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-list-who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.drive-list-when { font-size: 13px; color: var(--doc-muted); }
.drive-list-num { text-align: end; }

.drive-empty { padding: 72px 16px; text-align: center; }

.drive-empty-art {
  display: inline-flex;
  padding: 22px;
  border-radius: 50%;
  background: var(--doc-tint);
  color: var(--green);
  margin-bottom: 16px;
}

.drive-empty-title { font: 600 18px/1.3 var(--font-display); margin: 0 0 6px; }
.drive-empty-hint { color: var(--doc-muted); max-width: 440px; margin: 0 auto; font-size: 14px; line-height: 1.55; }

/* ── One doc (Google Docs) ── */
.gdoc-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 14px;
}

.gdoc-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--green);
  flex-shrink: 0;
}

.gdoc-home:hover { background: var(--doc-tint); }
.gdoc-home--back { color: var(--ink); border-radius: 50%; }

.gdoc-bar-text { flex: 1; min-width: 0; }

.gdoc-title {
  margin: 0;
  font: 600 20px/1.25 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gdoc-title-input {
  width: 100%;
  max-width: 640px;
  margin-inline-start: -8px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: 600 20px/1.25 var(--font-display);
  color: var(--ink);
}

.gdoc-title-input:hover { border-color: var(--doc-line); }
.gdoc-title-input:focus { border-color: var(--ink); outline: none; background: #FFFFFF; }

.gdoc-meta { margin: 3px 0 0; font-size: 12.5px; color: var(--doc-muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gdoc-meta-link { color: inherit; text-decoration: none; }
.gdoc-meta-link:hover { color: var(--ink); text-decoration: underline; }

.gdoc-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--doc-soft);
  color: var(--doc-muted);
  font: 600 11px/1.5 var(--font-mono);
  vertical-align: 3px;
}

.gdoc-chip--current { background: var(--doc-tint); color: var(--green-dark); }

.gdoc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gdoc-actions form { margin: 0; }

.gdoc-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.gdoc-icon-btn:hover { background: var(--doc-hover); }
.gdoc-icon-btn.is-active { background: var(--doc-tint); color: var(--green-dark); }

.gdoc-icon-count {
  position: absolute;
  top: 3px;
  inset-inline-end: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--doc-mark-strong);
  color: #4A3A08;
  font: 700 10px/17px var(--font-mono);
}

.gdoc-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 20px;
  align-items: start;
}

.gdoc-body--single { grid-template-columns: minmax(0, 1fr); }

.gdoc-canvas {
  position: relative;
  padding: 36px 24px 56px;
  border-radius: 20px;
  background: var(--doc-desk);
}

.gdoc-page {
  max-width: 816px;
  min-height: 70vh;
  margin: 0 auto;
  padding: 72px 84px;
  background: var(--doc-paper);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(16, 24, 20, 0.08), 0 10px 30px rgba(16, 24, 20, 0.06);
}

/* The text of a doc, on the page, in the editor and in a diff. */
.gdoc-text {
  font-size: 15.5px;
  line-height: 1.72;
  color: rgba(var(--ink-rgb), 0.88);
  overflow-wrap: anywhere;
}

.gdoc-text > :first-child { margin-top: 0; }
.gdoc-text h1,
.gdoc-text h2,
.gdoc-text h3,
.gdoc-text h4,
.gdoc-text h5,
.gdoc-text h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 1.5em 0 0.45em;
}

.gdoc-text h1 { font-size: 28px; }
.gdoc-text h2 { font-size: 21px; }
.gdoc-text h3 { font-size: 17.5px; }
.gdoc-text h4,
.gdoc-text h5,
.gdoc-text h6 { font-size: 15.5px; }
.gdoc-text p,
.gdoc-text ul,
.gdoc-text ol,
.gdoc-text pre,
.gdoc-text blockquote,
.gdoc-text table { margin: 0 0 1em; }
.gdoc-text ul,
.gdoc-text ol { padding-inline-start: 1.5em; }
.gdoc-text li + li { margin-top: 0.25em; }
.gdoc-text li > ul,
.gdoc-text li > ol { margin: 0.25em 0 0; }
.gdoc-text a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.gdoc-text strong { color: var(--ink); }

.gdoc-text blockquote {
  margin-inline-start: 0;
  padding: 2px 0 2px 16px;
  border-inline-start: 3px solid rgba(var(--ink-rgb), 0.16);
  color: var(--doc-muted);
}

.gdoc-text code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--doc-soft);
  border-radius: 5px;
  padding: 1px 5px;
}

.gdoc-text pre {
  padding: 14px 16px;
  border-radius: 10px;
  background: #F4F5F2;
  font: 13px/1.6 var(--font-mono);
  overflow-x: auto;
  white-space: pre-wrap;
}

.gdoc-text pre code { background: none; padding: 0; font-size: inherit; }
.gdoc-text table { border-collapse: collapse; font-size: 14px; }
.gdoc-text th,
.gdoc-text td { border: 1px solid var(--doc-line); padding: 7px 12px; text-align: start; }
.gdoc-text th { background: #F7F8F5; font-weight: 600; }
.gdoc-text hr { border: 0; border-top: 1px solid var(--doc-line); margin: 2em 0; }

/* A passage an open comment is about, as Google Docs marks it. */
.gdoc-mark {
  background: var(--doc-mark);
  color: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.gdoc-mark.is-active { background: var(--doc-mark-strong); }

/* A version's change: added text in green, removed text struck in grey. */
.doc-ins {
  background: rgba(14, 107, 74, 0.13);
  color: var(--green-dark);
  border-radius: 3px;
  box-shadow: inset 0 -2px 0 rgba(14, 107, 74, 0.45);
  padding: 0 1px;
}

.doc-del {
  color: rgba(var(--ink-rgb), 0.45);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  background: rgba(var(--ink-rgb), 0.05);
  border-radius: 3px;
  padding: 0 1px;
}

.gdoc-legend {
  max-width: 816px;
  margin: -14px auto 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--doc-muted);
}

.gdoc-legend-item { font-weight: 600; }

.gdoc-blank { text-align: center; padding: 18vh 0; color: var(--doc-muted); }
.gdoc-blank p { margin: 0 0 16px; font-size: 15px; }

.gdoc-float-comment {
  position: absolute;
  z-index: 10;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: var(--doc-shadow-lift);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.gdoc-float-comment[hidden] { display: none; }
.gdoc-float-comment:hover { background: var(--doc-tint); color: var(--green-dark); }

/* ── The margin: comments and history ── */
.gdoc-rail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 2px 6px 24px 2px;
}

.gdoc-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 4px 14px;
}

.gdoc-panel-title { margin: 0; font: 600 16px/1.2 var(--font-display); }
.gdoc-panel-count { font-size: 12.5px; color: var(--doc-muted); }
.gdoc-panel-link { font-size: 13px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.gdoc-panel-link:hover { text-decoration: underline; }
.gdoc-panel-foot { margin: 14px 4px 0; font-size: 12px; color: var(--doc-muted); line-height: 1.5; }

.gdoc-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 18px;
  text-align: center;
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.5;
}

.gdoc-panel-empty p { margin: 0; }

.gdoc-threads { display: flex; flex-direction: column; gap: 12px; }

/* A comment thread: a card in the margin. Picked (clicked, or its passage
   clicked), it lifts and steps toward the page, as in Google Docs. */
.gdoc-comment {
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid var(--doc-line);
  box-shadow: 0 1px 2px rgba(16, 24, 20, 0.04);
  cursor: default;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  outline: none;
}

.gdoc-comment:hover { box-shadow: var(--doc-shadow); }

.gdoc-comment.is-active {
  border-color: transparent;
  box-shadow: var(--doc-shadow-lift);
  transform: translateX(-8px);
}

.gdoc-comment.is-resolved { background: #FAFAF8; box-shadow: none; }

.gdoc-comment-quote {
  margin: 0 0 12px;
  padding: 2px 0 2px 10px;
  border-inline-start: 3px solid var(--doc-mark-strong);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--doc-muted);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gdoc-comment-quote.is-gone { text-decoration: line-through; border-inline-start-color: var(--doc-line); }

.gdoc-comment-head { display: flex; align-items: center; gap: 10px; }
.gdoc-comment-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gdoc-comment-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gdoc-comment-when { font-size: 11.5px; color: var(--doc-muted); }
.gdoc-comment-tools { display: flex; align-items: center; gap: 2px; }
.gdoc-comment-tools form { margin: 0; }

.gdoc-round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.gdoc-round-btn:hover { background: var(--doc-hover); }
.gdoc-round-btn--resolve { color: var(--green); }
.gdoc-round-btn--resolve:hover { background: var(--doc-tint); color: var(--green-dark); }
.gdoc-round-btn--quiet { opacity: 0; color: var(--doc-muted); }
.gdoc-comment:hover .gdoc-round-btn--quiet,
.gdoc-comment.is-active .gdoc-round-btn--quiet,
.gdoc-round-btn--quiet:focus-visible { opacity: 1; }

.gdoc-comment-body {
  margin: 8px 0 0 42px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(var(--ink-rgb), 0.86);
  overflow-wrap: anywhere;
}

.gdoc-comment-body > :first-child { margin-top: 0; }
.gdoc-comment-body > :last-child { margin-bottom: 0; }
.gdoc-comment-body p,
.gdoc-comment-body ul,
.gdoc-comment-body ol { margin: 0 0 6px; }
.gdoc-comment-body ul,
.gdoc-comment-body ol { padding-inline-start: 1.2em; }
.gdoc-comment-body h1,
.gdoc-comment-body h2,
.gdoc-comment-body h3,
.gdoc-comment-body h4 { font-size: 14px; margin: 8px 0 4px; }
.gdoc-comment-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--doc-soft); padding: 1px 4px; border-radius: 4px; }
.gdoc-comment-body a { color: var(--green-dark); }

.gdoc-reply {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--doc-line);
}

.gdoc-reply .gdoc-comment-body { margin-inline-start: 34px; }

.gdoc-resolved-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--green-dark);
}

/* Reply and compose boxes: a pill that opens into a box when written in. */
.gdoc-reply-form { margin: 12px 0 0; }

.gdoc-reply-input,
.gdoc-compose-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 20px;
  background: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  resize: none;
  field-sizing: content;
  max-height: 260px;
  transition: border-color 0.15s, border-radius 0.15s, box-shadow 0.15s;
}

.gdoc-reply-input:focus,
.gdoc-compose-input:focus {
  outline: none;
  border-color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(var(--ink-rgb), 0.06);
}

.gdoc-reply-actions,
.gdoc-compose-actions {
  display: none;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.gdoc-reply-form:focus-within .gdoc-reply-actions,
.gdoc-reply-form:has(.gdoc-reply-input:not(:placeholder-shown)) .gdoc-reply-actions,
.gdoc-compose:focus-within .gdoc-compose-actions,
.gdoc-compose.is-open .gdoc-compose-actions,
.gdoc-compose:has(.gdoc-compose-input:not(:placeholder-shown)) .gdoc-compose-actions { display: flex; }

.gdoc-compose {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid var(--doc-line);
}

.gdoc-compose.is-open,
.gdoc-compose:focus-within { box-shadow: var(--doc-shadow-lift); border-color: transparent; }
.gdoc-compose-row { display: flex; align-items: flex-start; gap: 10px; }

.gdoc-compose-quote {
  margin: 0 0 10px;
  padding: 2px 0 2px 10px;
  border-inline-start: 3px solid var(--doc-mark-strong);
  font-size: 12.5px;
  font-style: italic;
  color: var(--doc-muted);
  max-height: 4.5em;
  overflow: hidden;
}

.gdoc-resolved { margin-top: 18px; }

.gdoc-resolved > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--doc-muted);
  cursor: pointer;
  list-style: none;
}

.gdoc-resolved > summary::-webkit-details-marker { display: none; }
.gdoc-resolved[open] > summary { margin-bottom: 8px; }

/* Version history: one row per version — when, a line of what changed, who. */
.gdoc-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.gdoc-version-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s;
}

.gdoc-version-link:hover { background: #FFFFFF; box-shadow: 0 1px 2px rgba(16, 24, 20, 0.05); }
.gdoc-version.is-selected .gdoc-version-link { background: var(--doc-tint); box-shadow: none; }
.gdoc-version-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gdoc-version-when { font-size: 14px; font-weight: 600; }
.gdoc-version-num { font: 500 11.5px/1 var(--font-mono); color: var(--doc-muted); }
.gdoc-version-tag { font-size: 11.5px; font-style: italic; color: var(--green-dark); }
.gdoc-version-summary { font-size: 13px; line-height: 1.45; color: rgba(var(--ink-rgb), 0.82); }
.gdoc-version-note { font-size: 12.5px; font-style: italic; color: var(--doc-muted); }
.gdoc-version-who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--doc-muted); }
.gdoc-version-delta { margin-inline-start: auto; display: inline-flex; gap: 6px; font: 600 11.5px/1 var(--font-mono); }
.gdoc-version-delta .is-added { color: var(--green); }
.gdoc-version-delta .is-removed { color: rgba(var(--ink-rgb), 0.45); }

/* "Show changes", as a switch. */
.gdoc-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.gdoc-switch:hover { background: var(--doc-hover); }

.gdoc-switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.22);
  transition: background-color 0.15s;
}

.gdoc-switch-knob {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.gdoc-switch.is-on .gdoc-switch-track { background: var(--green); }
.gdoc-switch.is-on .gdoc-switch-knob { transform: translateX(14px); }

/* ── The editor ── */
.gdoc-mode { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--doc-soft); }

.gdoc-mode-opt {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--doc-muted);
  text-decoration: none;
}

.gdoc-mode-opt:hover { color: var(--ink); }
.gdoc-mode-opt.is-active { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 20, 0.10); }
.gdoc-mode-opt.is-disabled { opacity: 0.45; cursor: not-allowed; }

.gdoc-note-input {
  width: 240px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--doc-line);
  border-radius: 999px;
  font-size: 13px;
  background: #FFFFFF;
}

.gdoc-note-input:focus { outline: none; border-color: var(--ink); }

.gdoc-toolbar {
  position: sticky;
  top: 8px;
  z-index: 15;
  display: block;
  margin: 0 0 14px;
}

.gdoc-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #EAF0EC;
}

.gdoc-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.gdoc-tool--text { font: 700 12.5px/1 var(--font-display); }
.gdoc-tool:hover { background: rgba(var(--ink-rgb), 0.08); }
.gdoc-tool.trix-active { background: #CFE5D8; color: var(--green-dark); }
.gdoc-tool:disabled { opacity: 0.32; cursor: default; background: transparent; }
.gdoc-tool-sep { width: 1px; height: 20px; margin: 0 6px; background: rgba(var(--ink-rgb), 0.16); }

.gdoc-link-dialog {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: var(--doc-shadow-lift);
  border: 0;
}

.gdoc-link-dialog[data-trix-active] { display: flex; }

.gdoc-link-input {
  width: 300px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  font-size: 13.5px;
}

.gdoc-trix {
  display: block;
  min-height: 60vh;
  border: 0;
  padding: 0;
  margin: 0;
  outline: none;
}

.gdoc-trix:empty::before { color: var(--doc-muted); }

.gdoc-markdown {
  display: block;
  width: 100%;
  min-height: 60vh;
  border: 0;
  padding: 0;
  resize: none;
  field-sizing: content;
  background: transparent;
  font: 13.5px/1.7 var(--font-mono);
  color: var(--ink);
  outline: none;
}

.gdoc-edit-foot { max-width: 816px; margin: 14px auto 0; font-size: 12.5px; color: var(--doc-muted); text-align: center; }
.gdoc-edit-foot a { color: var(--green-dark); }

.gdoc-conflict {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #FFF6DB;
  border: 1px solid #F2D483;
  font-size: 13.5px;
  line-height: 1.5;
}

.gdoc-conflict a { color: var(--green-dark); font-weight: 600; }

@media (max-width: 1000px) {
  .gdoc-body { grid-template-columns: minmax(0, 1fr); }
  .gdoc-rail { position: static; max-height: none; overflow: visible; padding: 0; }
  .gdoc-comment.is-active { transform: none; }
  .drive-list-head,
  .drive-list-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .drive-list-head > :nth-child(2),
  .drive-list-head > :nth-child(3),
  .drive-list-row > .drive-list-who,
  .drive-list-row > .drive-list-when { display: none; }
}

@media (max-width: 640px) {
  .admin-main--doc { padding-inline-start: 12px; padding-inline-end: 12px; }
  .drive-top { flex-direction: column; align-items: stretch; gap: 14px; }
  /* flex: 1 in a column is a height of 0 — the pill keeps its 48px */
  .drive-top .drive-search { flex: none; }
  .drive-grid { grid-template-columns: minmax(0, 1fr); }
  .drive-new-panel { width: calc(100vw - 32px); }
  .gdoc-bar { flex-wrap: wrap; }
  .gdoc-actions { width: 100%; flex-wrap: wrap; }
  .gdoc-note-input { flex: 1; width: auto; min-width: 0; }
  .gdoc-canvas { padding: 12px 8px 24px; border-radius: 14px; }
  .gdoc-page { padding: 28px 20px; min-height: 50vh; }
  .gdoc-link-input { width: 180px; }
}

/* ── /admin/mail — the Gmail-style page over the outreach mailboxes ───── */
/* Full width and the full height under the topbar: three panes that each
   scroll inside themselves, never the page. Desktop-first on purpose. */
.admin-main--mail {
  max-width: none;
  padding: 16px 24px 0;
}
.mail {
  display: grid;
  grid-template-columns: 236px 420px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 40px);
  min-height: 560px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.mail-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 12px;
  border-inline-end: 1px solid var(--border-light);
  overflow-y: auto;
  background: rgba(var(--ink-rgb), 0.02);
}
.mail-compose-btn { width: 100%; padding: 10px 12px; font-size: 14px; }
.mail-folders { list-style: none; margin: 0; padding: 0; }
.mail-folder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-light-body);
  text-decoration: none;
  font-size: 13.5px;
}
.mail-folder:hover { background: rgba(var(--ink-rgb), 0.05); color: var(--text-light-primary); }
.mail-folder.is-active { background: rgba(14, 107, 74, 0.1); color: #0E6B4A; font-weight: 600; }
/* A search looks through every folder, so while the box has words in it no
   folder is the one on screen. CSS rather than the server, because only the
   list reloads as you type and the rail is never redrawn. */
.mail:has(.mail-search-input:not(:placeholder-shown)) .mail-folder.is-active { background: none; color: var(--text-light-body); font-weight: 400; }
.mail-folder-count { font-family: var(--font-mono); font-size: 12px; }
/* Tags: a thread's labels. A quiet ink chip, so they never compete with the
   stage badge; the one the list is narrowed to takes the active folder's
   green. */
.mail-tag-link .mail-tag-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-tag-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: rgba(var(--ink-rgb), 0.35); }
.mail-tag-link.is-active .mail-tag-dot { background: #0E6B4A; }
.mail-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 160px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.07);
  color: var(--text-light-primary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  text-decoration: none;
}
.mail-tag.is-active { background: rgba(14, 107, 74, 0.12); color: #0E6B4A; }
.mail-tag-name { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.mail-tag-name:hover { text-decoration: underline; }
/* The × is a 20px target inside the chip, pulled into its padding so the
   chip doesn't grow; a phone gets a thumb's worth. */
.mail-tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  margin: -2px -4px -2px 0;
  border: 0;
  border-radius: 999px;
  background: none;
  padding: 0;
  color: var(--text-light-body);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.mail-tag-x:hover { color: var(--text-light-primary); background: rgba(var(--ink-rgb), 0.08); }
.mail-tag-x:focus-visible { outline: 2px solid #0E6B4A; outline-offset: 0; }
.mail-tag--filter { margin-inline-start: 8px; vertical-align: middle; font-family: inherit; font-size: 12px; background: rgba(14, 107, 74, 0.12); color: #0E6B4A; }
.mail-tag--filter .mail-tag-x { color: #0E6B4A; min-width: 16px; min-height: 16px; margin: 0 -3px 0 2px; }
.mail-thread-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.mail-thread-tags .mail-tag { font-size: 12px; padding: 2px 6px 2px 9px; max-width: 220px; }
.mail-tag-form { display: inline-flex; align-items: center; gap: 6px; }
/* The same chips beside a subject on /admin/outreach. */
.mail-tag-input { width: 140px; min-width: 0; padding: 3px 8px; font-size: 12.5px; min-height: 0; }
.mail-rail-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light-body);
  margin: 0 0 8px;
  padding: 0 10px;
}
/* The tag list folds under its heading; the chevron turns when it opens. */
.mail-tags-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; user-select: none; }
.mail-tags-toggle::-webkit-details-marker { display: none; }
.mail-tags-toggle::before {
  content: "";
  width: 5px;
  height: 5px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.mail-tags[open] > .mail-tags-toggle::before { transform: rotate(45deg); }
.mail-tags:not([open]) > .mail-tags-toggle { margin-bottom: 0; }
.mail-tags-toggle:hover { color: var(--text-light-primary); }
.mail-tags-toggle:focus-visible { outline: 2px solid #0E6B4A; outline-offset: 2px; border-radius: 4px; }
.mail-tags-count { margin-inline-start: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; font-weight: 400; }
.mail-mailbox { border-top: 1px solid var(--border-light); padding: 6px 0; font-size: 12.5px; }
.mail-mailbox summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px;
  cursor: pointer;
  list-style: none;
}
.mail-mailbox summary::-webkit-details-marker { display: none; }
.mail-mailbox-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mail-mailbox-usage { font-family: var(--font-mono); font-size: 11.5px; color: #0E6B4A; white-space: nowrap; }
.mail-mailbox.is-off .mail-mailbox-usage { color: var(--text-light-body); }
.mail-mailbox-body { padding: 6px 10px 4px; }
.mail-mailbox-body p { margin: 0 0 8px; font-size: 12px; line-height: 1.5; }
.mail-mailbox-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0 0 10px;
  font-size: 12px;
}
.mail-mailbox-stats dt { color: var(--text-light-body); }
.mail-mailbox-stats dd { margin: 0; font-family: var(--font-mono); }
.mail-mailbox-next { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: #0E6B4A; }
.mail-mailbox-form { display: flex; flex-direction: column; gap: 6px; }
.mail-mailbox-form label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--text-light-body); }
.mail-mailbox-form .admin-btn { align-self: flex-start; }
.mail-mailbox-toggle { margin: 8px 0 0; }
.mail-mailbox--add summary { color: #0E6B4A; font-weight: 600; }
.mail-input { min-width: 0; width: 100%; }
.mail-input--short { max-width: 90px; }
.mail-input--wide { max-width: none; }
.mail-select { min-width: 0; max-width: 100%; }

.mail-list {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--border-light);
  overflow-y: auto;
  min-width: 0;
}
.mail-search {
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
/* A magnifier, so the box reads as search before anyone types: every other
   admin input is the same white field. Ink at the body text's weight. */
.mail-search-input {
  width: 100%;
  min-width: 0;
  font-size: 13.5px;
  padding-inline-start: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23182420' stroke-opacity='.6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.6-4.6'/%3E%3C/svg%3E") no-repeat 10px center;
}
.mail-list > turbo-frame { display: block; position: relative; overflow: clip; }
/* A search on its way: Turbo marks the frame busy while the request runs. A
   bar sweeps under the box and the old rows fade, both held back 150ms so a
   quick answer never flickers. */
.mail-list > turbo-frame[busy]::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  z-index: 1;
  width: 35%;
  height: 2px;
  background: #0E6B4A;
  opacity: 0;
  animation: mail-busy-in 0s linear 150ms forwards, mail-busy-sweep 1s ease-in-out 150ms infinite;
}
.mail-list > turbo-frame[busy] > div { opacity: 0.5; transition: opacity 120ms ease-out 150ms; }
@keyframes mail-busy-in { to { opacity: 1; } }
@keyframes mail-busy-sweep { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
  .mail-list > turbo-frame[busy]::before { width: 100%; animation: mail-busy-in 0s linear 150ms forwards; }
}
.mail-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}
.mail-list-head .admin-table-muted { font-family: var(--font-mono); font-size: 12px; }
.mail-list-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0; }
.mail-empty { padding: 32px 16px; color: var(--text-light-body); font-size: 13.5px; line-height: 1.5; }
.mail-rows { list-style: none; margin: 0; padding: 0; }
/* Newer / Older under the last row, the range between them. */
.mail-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 16px;
}
.mail-pager-range { font-size: 12px; color: var(--text-light-body); }
/* The bar above the rows: the tick-all box lines up with the rows' boxes,
   the buttons show once something is ticked (mail_select_controller.js). */
.mail-bulk {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}
.mail-bulk-count { font-size: 12.5px; color: var(--text-light-body); }
.mail-bulk-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.mail-bulk-actions[hidden] { display: none; }
.mail-check { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: #0E6B4A; cursor: pointer; }
.mail-row { display: flex; align-items: flex-start; border-bottom: 1px solid var(--border-light); }
.mail-row-check { margin-top: 12px; margin-inline-start: 16px; }
.mail-row-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px 16px 10px 10px;
  color: var(--text-light-primary);
  text-decoration: none;
  font-size: 13px;
}
.mail-row:hover { background: rgba(var(--ink-rgb), 0.03); }
.mail-row.is-picked { background: rgba(14, 107, 74, 0.05); }
.mail-row.is-open { background: rgba(14, 107, 74, 0.08); }
.mail-row.is-unread .mail-row-who,
.mail-row.is-unread .mail-row-subject { font-weight: 700; }
.mail-row-top, .mail-row-bottom { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.mail-row-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-when { font-size: 11.5px; color: var(--text-light-body); white-space: nowrap; }
.mail-row-subject { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The search's words, marked where they matched: a highlighter stroke,
   not a chip, so the row still reads as a line of text. */
.mail-row-subject-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-mark { background: rgba(250, 204, 21, 0.38); color: inherit; border-radius: 2px; padding: 0 1px; }
.mail-row-snippet { color: var(--text-light-body); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-mailbox { font-size: 11px; color: var(--text-light-body); max-width: 55%; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mail-pane { display: flex; flex-direction: column; overflow-y: auto; min-width: 0; }
.mail-pane-empty { margin: auto; text-align: center; color: var(--text-light-body); font-size: 14px; max-width: 420px; padding: 24px; }
.mail-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--border-light);
}
.mail-thread-subject { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.mail-thread-meta { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-light-body); }
.mail-thread-meta a { color: #0E6B4A; }
.mail-thread-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* Gmail's round icon buttons; the name is the tooltip and the aria-label. */
.mail-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light-body);
  cursor: pointer;
}
.mail-icon-btn:hover,
.mail-icon-btn:focus-visible { background: rgba(var(--ink-rgb), 0.06); color: var(--text-light-primary); }

.mail-messages { list-style: none; margin: 0; padding: 8px 24px; }
.mail-message { border-bottom: 1px solid var(--border-light); }
/* Gmail's thread: every message is a <details> whose header is its
   <summary>. Closed, the header is the whole message on one line — who,
   the first words, when; open, the address and who it went to, then the
   body, set in from the avatar. */
.mail-message-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  font-size: 13px;
  list-style: none;
  cursor: pointer;
}
.mail-message-head::-webkit-details-marker { display: none; }
.mail-message-head:focus-visible { outline: 2px solid rgba(14, 107, 74, 0.5); outline-offset: -2px; }
.mail-message details:not([open]) > .mail-message-head:hover { background: rgba(var(--ink-rgb), 0.03); }
.mail-message details[open] > .mail-message-head { align-items: start; padding-top: 14px; }
.mail-message-who { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.mail-message-from { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 45%; }
.mail-message-from .admin-mono { font-size: 12px; font-weight: 400; }
.mail-message-snippet { min-width: 0; color: var(--text-light-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-message-address, .mail-message-to { display: none; }
.mail-message details[open] .mail-message-who { flex-direction: column; align-items: stretch; gap: 1px; }
.mail-message details[open] .mail-message-from { white-space: normal; max-width: none; overflow-wrap: anywhere; }
.mail-message details[open] .mail-message-address { display: inline; }
.mail-message details[open] .mail-message-to { display: block; font-size: 12px; color: var(--text-light-body); overflow-wrap: anywhere; }
.mail-message details[open] .mail-message-to .admin-mono { font-size: 11.5px; }
.mail-message details[open] .mail-message-snippet { display: none; }
.mail-message-when { font-size: 12px; color: var(--text-light-body); display: flex; gap: 6px; align-items: center; white-space: nowrap; flex-shrink: 0; }
.mail-message-clip { display: inline-flex; }
.mail-message-content { padding: 0 0 16px 44px; }
/* What arrived since the thread was last opened is set bolder, as in the list. */
.mail-message.is-unread .mail-message-from { font-weight: 700; }
/* "N older messages": the run of closed messages Gmail folds into one line,
   drawn as Gmail draws it — a count on two hairlines. */
.mail-fold { border-bottom: 1px solid var(--border-light); }
.mail-fold-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--text-light-body);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.mail-fold-btn::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: 50%;
  height: 5px;
  margin-top: -3px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.mail-fold-count,
.mail-fold-label { position: relative; background: #fff; }
.mail-fold-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 50%;
  color: var(--text-light-primary);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
}
.mail-fold-label { padding-inline-end: 8px; }
.mail-fold-btn:hover .mail-fold-count,
.mail-fold-btn:focus-visible .mail-fold-count { border-color: #0E6B4A; color: #0E6B4A; }
.mail-fold-btn:hover .mail-fold-label { color: var(--text-light-primary); }
/* Expand all / Collapse all: one button, the icon of whichever it would do. */
.mail-toggle-expand, .mail-toggle-collapse { display: inline-flex; }
.mail-toggle-collapse,
.is-expanded > .mail-toggle-expand { display: none; }
.is-expanded > .mail-toggle-collapse { display: inline-flex; }
.mail-message-subject { margin: 0 0 6px; font-size: 13px; }
.mail-message-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.mail-message-body--html { white-space: normal; }
.mail-message-body--html p { margin: 0 0 1em; }
.mail-message-body--html p:last-child { margin-bottom: 0; }
.mail-message-body--html a { color: var(--green); }
.mail-message-small-print { margin-top: 20px; font-size: 12px; line-height: 1.5; color: var(--text-light-body); }
.mail-message-small-print a { color: inherit; }
.mail-message--theirs .mail-message-body {
  padding: 12px 14px;
  background: rgba(var(--ink-rgb), 0.03);
  border-radius: 10px;
}
.mail-message--theirs.is-bounce .mail-message-body { background: #FBF3E2; }
.mail-message.is-pending { opacity: 0.85; }
.mail-message-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.mail-attachments { margin: 8px 0 0; padding-inline-start: 18px; font-size: 12.5px; }
.mail-attachments-note { font-size: 11.5px; margin: 4px 0 0; }
.mail-quote-toggle {
  display: inline-block;
  margin: 6px 0;
  padding: 3px 12px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  color: var(--text-light-body);
}
.mail-quote { color: var(--text-light-body); }

.mail-pane-note { margin: 0; padding: 12px 24px 24px; font-size: 12.5px; }
.mail-editor { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.mail-editor--compose { padding: 0; }
.mail-editor-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
/* The checker's verdict on the recipient and, when Send would refuse, why:
   beside the address, because that is where the decision to send is read. */
.mail-recipient-verdict { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Address, name, verdict and Check share the line beside "To" and wrap as
   whole pieces when the pane is narrow — never a name or a button broken
   across two lines. Only the address may break, so a long one can't
   push the pane wider than the screen. */
.mail-editor-row--to { align-items: baseline; }
.mail-editor-recipient { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: 1 1 0; min-width: 0; }
.mail-editor-recipient > *, .mail-recipient-verdict > * { white-space: nowrap; }
.mail-editor-recipient > .mail-recipient-address { white-space: normal; overflow-wrap: anywhere; }
.mail-recipient-verdict > .mail-recipient-reason { white-space: normal; }
.mail-editor-recipient > .mail-recipient-check { margin-inline-start: auto; }
.mail-recipient-reason { font-size: 12px; }
.mail-editor-row--reply { padding: 2px 0; }
.mail-editor-label { width: 60px; flex-shrink: 0; color: var(--text-light-body); font-size: 12.5px; }
.mail-textarea { max-width: none; font-family: inherit; font-size: 14px; line-height: 1.55; }
/* Files an email carries: chips under the words, each with its size and,
   while it is a draft, an × to take it off. The native picker is hidden
   behind the "Attach files" button; what was picked shows as chips too. */
.mail-files { display: flex; flex-direction: column; gap: 8px; }
.mail-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mail-message .mail-file-list { margin-top: 10px; }
.mail-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.16);
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.03);
  font-size: 12.5px;
  line-height: 1.4;
}
.mail-file--picked { border-style: dashed; padding-inline-end: 10px; }
.mail-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-file-size { color: var(--text-light-body); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; white-space: nowrap; }
.mail-message .mail-file { padding-inline-end: 10px; }
.mail-file-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -2px 0;
  border: 0;
  background: none;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--text-light-body);
  cursor: pointer;
  border-radius: 4px;
}
.mail-file-remove:hover, .mail-file-remove:focus-visible { background: rgba(var(--ink-rgb), 0.08); color: var(--ink); }
/* Relative, so the hidden input is clipped by the pane it scrolls in. Without
   it the input's box hangs off the page itself, as far down as the thread is
   long, and the page scrolls past the panes into blank space. */
.mail-files-pick { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.mail-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mail-files-pick:has(.mail-file-input:focus-visible) .mail-file-button { outline: 2px solid var(--green); outline-offset: 2px; }
.mail-file-reuse { max-width: 280px; height: auto; padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; }
.mail-files-hint { font-size: 12px; }
.mail-files-warning { margin: 0; }
.mail-footer-preview {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 12px;
  background: rgba(var(--ink-rgb), 0.03);
  border: 1px dashed rgba(var(--ink-rgb), 0.18);
  border-radius: 8px;
}
.mail-footer-lock { font-size: 12px; margin-top: 1px; }
.mail-footer-text {
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-light-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mail-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mail-discard { margin-inline-start: auto; text-decoration: none; }
.mail-schedule {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
}
.mail-schedule[hidden] { display: none; }
.mail-schedule .mail-input { width: auto; }
.mail-schedule-hint { font-size: 12px; }

.mail-badge { margin-inline-start: 0; font-size: 10.5px; }
.mail-scheduled-by { color: var(--text-light-body); }
.admin-badge.is-draft { color: var(--text-light-body); }
.admin-badge.is-scheduled { color: #7A5A12; border-color: rgba(122, 90, 18, 0.4); background: #FBF3E2; }
.admin-badge.is-failed { color: #7A5A12; border-color: #7A5A12; }

.mail-dialog {
  width: min(760px, calc(100vw - 40px));
  padding: 20px 24px 24px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(10, 15, 13, 0.25);
}
.mail-dialog::backdrop { background: rgba(10, 15, 13, 0.35); }
/* The bulk Delete's question: small, centred, on a phone too. */
.mail-dialog.mail-dialog--confirm { width: min(420px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; border: 1px solid var(--border-light); border-radius: 12px; }
.mail-confirm-text { margin: 8px 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--text-light-body); }
.mail-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mail-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mail-dialog-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0; }
.mail-dialog-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-light-body); }

@media (max-width: 1100px) {
  .mail { grid-template-columns: 210px 330px minmax(0, 1fr); }
}

/* A phone gets one pane at a time, the way Gmail's app does it: the folders
   as a strip over the list, or the open thread with a way back to it. The
   page scrolls, not the panes, and the mailboxes drop under the list. */
.mail-back { display: none; }

@media (max-width: 800px) {
  .admin-main--mail { padding: 12px 12px 24px; }
  .mail { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .mail-rail { display: contents; }
  .mail-compose-btn { width: auto; margin: 12px 12px 0; }
  .mail-folders { display: flex; gap: 4px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--border-light); }
  .mail-folder { gap: 6px; padding: 8px 12px; white-space: nowrap; }
  .mail-tags { padding: 0; }
  .mail-tags .mail-tags-toggle { margin: 10px 12px 0; padding: 0; }
  .mail-tags:not([open]) .mail-tags-toggle { margin-bottom: 10px; }
  .mail-tag-list { padding-top: 0; }
  .mail--open .mail-tags { display: none; }
  .mail-tag-input { width: 160px; min-height: 36px; }
  .mail-tag-form .admin-btn { min-height: 36px; padding-inline: 14px; }
  .mail-thread-tags .mail-tag-x { min-width: 32px; min-height: 32px; margin: -6px -8px -6px -2px; }
  .mail-list { order: 2; border-inline-end: 0; overflow: visible; }
  .mail-search { position: static; }
  /* 16px or iOS zooms the page on focus; 44px is a thumb. */
  .mail-search-input { font-size: 16px; min-height: 44px; }
  .mail-row-link { padding: 12px 16px 12px 10px; }
  /* A thumb's box: bigger, with the row's tap target around it. */
  .mail-check { width: 20px; height: 20px; }
  .mail-row-check { margin-top: 14px; }
  .mail-pane { order: 3; overflow: visible; }
  .mail-mailboxes { order: 4; padding: 14px 6px 8px; border-top: 1px solid var(--border-light); background: rgba(var(--ink-rgb), 0.02); }

  /* No thread open: the pane has nothing to say but the setup notice. */
  .mail-pane-empty { margin: 0; padding: 0; max-width: none; text-align: start; }
  .mail-pane-empty p:first-child { display: none; }
  .mail-pane-empty p { margin: 0; padding: 14px 16px; border-top: 1px solid var(--border-light); font-size: 12.5px; overflow-wrap: anywhere; }

  /* A thread open: it is the whole page. */
  .mail--open .mail-compose-btn,
  .mail--open .mail-folders,
  .mail--open .mail-list,
  .mail--open .mail-mailboxes { display: none; }
  .mail-back {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: #0E6B4A;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }
  .mail-thread-head { flex-direction: column; gap: 10px; padding: 14px 16px 12px; }
  .mail-thread-meta { overflow-wrap: anywhere; }
  .mail-messages { padding: 4px 16px; }
  .mail-message-head { gap: 10px; }
  .mail-message-head .doc-avatar { width: 28px; height: 28px; font-size: 12px; }
  .mail-message-who { flex-direction: column; align-items: stretch; gap: 1px; }
  .mail-message-from { max-width: none; }
  .mail-message-content { padding-inline-start: 0; }
  .mail-pane-note { padding: 12px 16px 20px; }

  /* 16px in every field: anything smaller and iOS zooms the page on focus. */
  .mail .admin-input, .mail .admin-select, .mail .admin-textarea { font-size: 16px; }
  .mail-editor { padding: 14px 16px 20px; }
  .mail-editor--compose { padding: 0; }
  .mail-editor-row { flex-wrap: wrap; }
  .mail-editor-label { width: 52px; }
  .mail-editor-row .mail-input, .mail-editor-row .mail-select { flex: 1 1 0; width: auto; }
  .mail-schedule .mail-input { flex: 1 1 100%; width: 100%; }
  .mail-file-reuse { max-width: none; flex: 1 1 100%; }
  .mail-file-remove { width: 32px; height: 32px; margin: -6px -2px -6px 0; }

  .mail-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 14px 16px 20px;
    border: 0;
    border-radius: 0;
  }
  .mail-dialog-close { padding: 4px 10px; }
}

/* ============================================================
   Dispute Risk — the Orders pages, the dashboard block and the
   settings card. High wears the console's error red, the one every
   loss and broken state in here wears, and only there (house rule:
   red is never us).
   ============================================================ */
.app-console-mono {
  font-family: var(--font-mono);
}

/* The order page leads with its main column: the band and the reasons on
   the left, the side cards on the right, and the same order on a phone. */
.app-console-detail-grid--main-first {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.app-console-chip--risk-high {
  background: color-mix(in srgb, var(--console-error) 10%, var(--console-surface));
  color: var(--console-error);
  border: 1px solid var(--console-error-border);
}

.app-console-chip--risk-medium {
  background: var(--console-amber-bg);
  color: var(--console-amber);
  border: 1px solid var(--console-amber);
}

.app-console-chip--risk-low {
  background: var(--console-surface);
  color: var(--console-text-secondary);
  border: 1px solid var(--console-border-input);
}

/* A state word in the band column: the same weight as a chip's text, no
   frame, so history sits back and the bands stand out. */
.app-console-order-state {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--console-text-disabled);
  white-space: nowrap;
}

.app-console-orders-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.app-console-order-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--console-border-row);
}

.app-console-order-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--console-radius-pill);
  border: 1px solid var(--console-border-input);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--console-text-secondary);
  text-decoration: none;
}

.app-console-order-filter--active {
  border-color: var(--console-text-primary);
  color: var(--console-text-primary);
}

.app-console-order-filter-count {
  font-family: var(--font-mono);
  font-weight: 500;
}

.app-console-order-placed {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.app-console-order-store {
  font-weight: 400;
  color: var(--console-text-secondary);
}

/* The top reason sits under the band chip, in the chip's column, on a
   second grid line the row only has when there is a reason to give. */
.app-console-order-reason {
  grid-column: 5;
  font-size: 12px;
  color: var(--console-text-secondary);
  text-align: end;
  line-height: 1.3;
  margin-top: -6px;
}

.app-console-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--console-border-row);
}

.app-console-pagination-page {
  font-size: 12.5px;
  color: var(--console-text-secondary);
  font-family: var(--font-mono);
}

.app-console-dispute-risk-lead {
  padding: 14px 20px 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.app-console-risk-reasons {
  display: flex;
  flex-direction: column;
}

.app-console-risk-reason {
  padding: 12px 0;
  border-bottom: 1px solid var(--console-border-row);
}

.app-console-risk-reason:last-child {
  border-bottom: none;
}

.app-console-risk-reason-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-console-risk-reason-label {
  font-size: 14px;
  font-weight: 600;
}

.app-console-risk-reason-detail {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--console-text-primary);
}

.app-console-risk-guidance {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--console-canvas);
  border-radius: var(--console-radius-control);
}

.app-console-risk-guidance .app-console-card-body {
  margin: 0;
}

.app-console-risk-guidance .app-console-card-body + .app-console-card-body {
  margin-top: 8px;
}

.app-console-risk-family {
  margin: 14px 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--console-text-secondary);
}

.app-console-risk-check-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--console-border-input);
}

.app-console-risk-check--raised .app-console-risk-check-mark {
  background: var(--console-amber);
  border-color: var(--console-amber);
}

.app-console-risk-check--clear .app-console-risk-check-mark {
  background: var(--console-border-row);
}

.app-console-risk-check-label {
  flex: 1;
  min-width: 0;
}

.app-console-risk-check-word {
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-risk-check--raised .app-console-risk-check-word {
  color: var(--console-amber);
  font-weight: 600;
}

@media (max-width: 720px) {
  /* A thumb, not a cursor: the chips are the page's controls on a phone. */
  .app-console-order-filter {
    min-height: 44px;
    padding: 10px 14px;
  }

  /* Its own full-width line under the stacked row, like the CE 3.0 badge. */
  .app-console-order-reason {
    grid-area: badge;
    text-align: start;
    margin-top: 0;
  }

  .app-console-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* A slide's preview on /admin/decks/:id/slides/:id: the 1280×720 frame
   scaled to the column, so it reads at the size the player draws it. */
.admin-deck-preview { width: 100%; max-width: 960px; aspect-ratio: 16 / 9; position: relative; overflow: hidden; border: 1px solid var(--line, #ddd); border-radius: 8px; background: #fff; }
.admin-deck-preview iframe { position: absolute; inset-inline-start: 0; top: 0; width: 1280px; height: 720px; border: 0; transform-origin: top left; transform: scale(0.75); }
@media (max-width: 1100px) { .admin-deck-preview iframe { transform: scale(0.5); } }
/* A form that follows a table on the deck pages: air between the last row
   and the first label, so the form reads as its own thing. */
.admin-deck-form { margin-top: 24px; }
/* A hidden slide's row on /admin/decks/:id: still in the order, faded so it
   reads as skipped by the player; its buttons stay at full strength. */
.admin-row--muted td:not(.admin-note-actions) { opacity: 0.5; }
/* The deck's notebook reuses the cold-lead log's note cards; on a full-width
   page they need a measure, or a one-line decision stretches to 1400px. */
.admin-deck-notes { max-width: 760px; }
.admin-table .admin-note-actions { white-space: nowrap; }
.admin-table .admin-note-actions form { display: inline-block; margin: 0 2px 0 0; }

/* A deck room's password on /admin: dots until the eye is pressed, then the
   value, with the copy mark beside it. The eye reuses the copy button's box so
   the two icons sit as a pair. aria-pressed picks which eye shows. */
.admin-secret { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.admin-secret .crm-copy { margin-top: 0; }
.admin-secret-toggle .admin-secret-icon--eye-off,
.admin-secret-toggle[aria-pressed="true"] .admin-secret-icon--eye { display: none; }
.admin-secret-toggle[aria-pressed="true"] .admin-secret-icon--eye-off { display: block; }
.admin-secret-toggle[aria-pressed="true"] { color: var(--text-light-primary); }
.admin-secret-toggle[hidden] { display: none; }

/* A deck room's link and access on /admin/deck-rooms/:id, in the code-block
   box: quiet uppercase labels in one column, values in the other, lined up on
   their baselines. The URL breaks anywhere rather than pushing the box wide,
   and its copy mark sits after it exactly as the password's does. */
.admin-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 20px;
  margin: 12px 0 20px;
  font-size: 13px;
  color: var(--text-light-primary);
}
.admin-facts dt {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light-muted);
}
.admin-facts dd { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0; }
.admin-facts .crm-copy { margin-top: 0; }
.admin-facts-value { min-width: 0; overflow-wrap: anywhere; }
.admin-facts-lock { font-size: 12px; line-height: 1; margin-inline-end: 2px; }

/* ── /admin/calls — the calls page, on the mail page's three panes ───── */
/* The open call is where the work is — a brief to read and notes to write
   on the line — so the rail and the list give it room the mail page keeps
   for its list, and the pane lays its two halves out by its own width. */
.mail.calls { grid-template-columns: 210px 340px minmax(0, 1fr); }
.calls .mail-pane { container-type: inline-size; }
.calls .mail-thread-head { padding: 14px 20px 10px; }
.calls .mail-thread-subject { font-size: 16px; }
.calls .mail-thread-meta a, .calls-local-time { white-space: nowrap; }
/* Icons: one 24×24 stroke set (Admin::CallsHelper#call_icon) before the
   words of every action and heading, never instead of them. */
.calls-icon { flex-shrink: 0; display: inline-block; vertical-align: -3px; }
/* A speaker beside a name in the open call's title: plays how it is said. */
.calls-name { white-space: nowrap; }
.calls-name-sep { color: var(--text-light-body); font-weight: 400; }
.calls-say { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-inline-start: 4px; padding: 0; vertical-align: -4px; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--text-light-body); cursor: pointer; }
.calls-say:hover { border-color: rgba(var(--ink-rgb), 0.18); color: var(--text-light-primary); }
.calls-say:focus-visible { outline: 2px solid #0E6B4A; outline-offset: 1px; }
.calls-say.is-loading { opacity: 0.5; cursor: progress; }
.calls-say.is-playing { color: #0E6B4A; background: rgba(14, 107, 74, 0.1); }
.calls-say.is-failed { color: #8A6620; }
.calls-say .calls-icon { vertical-align: 0; }
.calls-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.calls-btn--call .calls-icon { color: #0E6B4A; }
.calls-heading { display: flex; align-items: center; gap: 6px; }
.calls-heading .calls-icon { width: 13px; height: 13px; }
.calls-flag { font-size: 13px; line-height: 1; letter-spacing: 0; }
.calls-folder-label { display: inline-flex; align-items: center; gap: 8px; }
.calls-folder-label .calls-icon { color: var(--text-light-body); }
.mail-folder.is-active .calls-folder-label .calls-icon { color: inherit; }
.calls-link { display: inline-flex; align-items: center; gap: 3px; }
.calls-link .calls-icon { width: 13px; height: 13px; }
.calls-brief-edit summary .calls-icon { width: 13px; height: 13px; margin-inline-end: 2px; }
.calls-mute .calls-icon:nth-of-type(2), .calls-mute.is-muted .calls-icon:first-of-type { display: none; }
.calls-mute.is-muted .calls-icon:nth-of-type(2) { display: inline-block; }
.calls-empty-icon { display: block; color: var(--text-light-body); opacity: 0.6; margin-bottom: 6px; }
.calls-empty-icon .calls-icon { display: block; margin: 0 auto; }
.calls-rules { border-top: 1px solid var(--border-light); padding-top: 12px; }
.calls-rules-list { margin: 0; padding: 0 10px; list-style: none; font-size: 12px; line-height: 1.5; color: var(--text-light-body); }
.calls-rules-list li { margin: 0 0 6px; }
.calls-local-time { font-size: 11.5px; }
.calls-clocks { border-top: 1px solid var(--border-light); padding: 12px 0 6px; }
.calls-clocks-list { margin: 0; padding: 0 10px; list-style: none; font-size: 12.5px; }
.calls-clock { display: flex; align-items: baseline; gap: 6px; margin: 0 0 4px; color: var(--text-light-body); }
.calls-clock-name { flex: 1; }
.calls-clock-time { font-family: var(--font-mono); }
.calls-clock-day { width: 26px; font-size: 11px; }
.calls-clock.is-open .calls-clock-name::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: #0E6B4A; vertical-align: 1px; }
.calls-clock.is-open { color: inherit; }
/* The Check-line button sits in the meta line beside the number, not under it. */
.calls .mail-thread-meta .outreach-inline-form { display: inline; }
.calls-detail { padding: 4px 20px 20px; }
.calls-section { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.calls-section:last-child { border-bottom: 0; }
.calls-section-title { font-size: 11px; font-weight: 600; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light-body); }
/* A line of state — on the line elsewhere, refused, still transcribing —
   reads as a note, not a section. */
.calls-notice { margin: 12px 0 0; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-light-body); background: rgba(var(--ink-rgb), 0.04); }
.calls-notice--warn { color: #8A6620; background: rgba(138, 102, 32, 0.08); }
.calls-work { border-bottom: 1px solid var(--border-light); }
.calls-work .calls-section { border-bottom: 0; }

/* Store research (/admin/store-research): the calls page's panes, with the
   open research's checklist — a finding, the evidence it rests on (a quote
   copied from the page, the page it was on), or why nothing was found. */
.research-summary { margin: 4px 0 8px; font-size: 13px; line-height: 1.5; color: var(--text-light-primary); }
.research-check-head { gap: 8px; }
.research-check-head .mail-badge { text-transform: none; letter-spacing: 0; }
.research-retry { margin-inline-start: auto; text-transform: none; letter-spacing: 0; }
.research-retry-all { margin-inline-start: 8px; }
.research-value { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.research-reason { margin: 0 0 6px; font-size: 12.5px; line-height: 1.45; color: var(--text-light-body); }
.research-reason.is-failed { color: #8A6620; }
.research-evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.research-evidence li { font-size: 12.5px; line-height: 1.45; color: var(--text-light-body); overflow-wrap: anywhere; }
.research-evidence-label { display: block; color: inherit; }
.research-quote { display: block; margin: 2px 0; padding-inline-start: 8px; border-inline-start: 2px solid var(--border-light); font-style: normal; }
.research-quote::before, .research-quote::after { content: ""; }
.research-evidence-link { font-size: 11.5px; }
.calls-work-outcome { border-top: 1px solid var(--border-light); }
@container (min-width: 760px) {
  .calls-work { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .calls-work-outcome { position: sticky; top: 0; border-top: 0; }
}
.calls-audio { width: 100%; }
.calls-transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.calls-turn { max-width: min(78%, 620px); padding: 6px 10px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.03); }
.calls-turn--operator { align-self: flex-end; background: rgba(14, 107, 74, 0.08); }
.calls-turn-who { display: block; font-size: 11.5px; color: var(--text-light-body); margin-bottom: 2px; }
.calls-turn-who .admin-mono { font-size: 11px; }
.calls-turn-text { margin: 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Live captions: the store's side of the call as it is said, in a panel
   docked to the bottom of the page under the list and the open call
   together — a second grid row the rail runs beside. The two columns shrink
   to make room and keep their own scroll, so the end of the brief or the
   notes is never stuck behind it. Its top edge drags it taller; the height
   is a custom property the controller sets. Big enough to read at a glance;
   grey while Scribe is still guessing, ink once the phrase is final. */
.mail.calls { grid-template-rows: minmax(0, 1fr) auto; }
.mail.calls > .mail-rail { grid-row: 1 / 3; }
.mail.calls > .mail-list { grid-column: 2; grid-row: 1; }
.mail.calls > .mail-pane { grid-column: 3; grid-row: 1; }
.calls-captions { --captions-height: 220px; grid-column: 2 / 4; grid-row: 2; position: relative; z-index: 2; display: flex; flex-direction: column; height: var(--captions-height); min-height: 120px; border-top: 1px solid var(--border-light); background: #fff; box-shadow: 0 -6px 18px rgba(var(--ink-rgb), 0.08); }
.calls-captions[hidden] { display: none; }
.calls-captions-grip { position: absolute; top: -5px; inset-inline-start: 0; inset-inline-end: 0; height: 10px; cursor: ns-resize; touch-action: none; }
.calls-captions-grip::after { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-inline-start: -20px; border-radius: 2px; background: rgba(var(--ink-rgb), 0.18); }
.calls-captions-grip:hover::after, .calls-captions-grip:focus-visible::after { background: #0E6B4A; }
.calls-captions-grip:focus-visible { outline: none; }
.calls-captions-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px 6px; }
.calls-captions-head > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.calls-captions-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; }
.calls-captions-title .calls-icon { color: #0E6B4A; }
.calls-captions-meta { margin: 0; font-size: 12px; color: var(--text-light-body); }
.calls-captions.is-failed .calls-captions-meta { color: #8A6620; }
.calls-captions-close { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-light-body); cursor: pointer; }
.calls-captions-close:hover { border-color: rgba(var(--ink-rgb), 0.18); color: var(--text-light-primary); }
.calls-captions-close:focus-visible { outline: 2px solid #0E6B4A; outline-offset: 1px; }
.calls-captions-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 16px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px); mask-image: linear-gradient(to bottom, transparent 0, #000 16px); }
.calls-captions-note { margin: 0; font-size: 13px; color: var(--text-light-body); }
.calls-captions-lines { display: flex; flex-direction: column; }
.calls-caption { max-width: 72ch; margin: 0 0 10px; font-size: 19px; line-height: 1.45; color: var(--text-light-primary); overflow-wrap: anywhere; }
.calls-caption--partial { color: rgba(var(--ink-rgb), 0.45); }
.calls-captions-follow { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 6px 12px; border: 1px solid var(--border-light); border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.12); font-size: 12.5px; cursor: pointer; }
.calls-captions-follow[hidden] { display: none; }
.calls-phone-buttons .calls-btn[aria-pressed="true"] { background: rgba(14, 107, 74, 0.1); border-color: rgba(14, 107, 74, 0.3); color: #0E6B4A; }
/* The softphone: the line's state and its clock, the sentence the operator
   says first, and the buttons. */
.calls-phone { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; background: rgba(14, 107, 74, 0.04); }
.calls-phone-state { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; }
.calls-phone-clock { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-light-body); }
.calls-phone-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.calls-phone-pad { display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; }
.calls-phone-pad[hidden] { display: none; }
.calls-phone-pad .admin-btn { font-family: var(--font-mono); justify-content: center; }
/* The line's audio, under a hairline: the microphone picker with its live
   level, then the Noise cancellation switch. */
.calls-phone-audio { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(14, 107, 74, 0.14); }
.calls-mic { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.calls-mic-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light-body); }
.calls-mic-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.calls-mic-field { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; max-width: 400px; }
.calls-mic-field > .calls-icon { position: absolute; left: 11px; color: #0E6B4A; pointer-events: none; }
.calls-mic-field > .calls-icon:last-child { left: auto; right: 11px; color: var(--text-light-body); }
.calls-mic-select { appearance: none; -webkit-appearance: none; width: 100%; height: 36px; padding: 0 34px 0 34px; border: 1px solid rgba(var(--ink-rgb), 0.16); border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(var(--ink-rgb), 0.05); font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-light-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.calls-mic-select:hover:not(:disabled) { border-color: rgba(var(--ink-rgb), 0.34); }
.calls-mic-select:focus-visible { outline: none; border-color: #0E6B4A; box-shadow: 0 0 0 3px rgba(14, 107, 74, 0.16); }
.calls-mic-select:disabled { cursor: default; font-weight: 400; color: var(--text-light-body); background: rgba(255, 255, 255, 0.55); box-shadow: none; }
.calls-mic-field:has(.calls-mic-select:disabled) > .calls-icon { opacity: 0.5; }
.calls-mic-meter { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; flex-shrink: 0; }
.calls-mic-meter i { width: 4px; border-radius: 2px; background: rgba(var(--ink-rgb), 0.12); transition: background-color 90ms linear; }
.calls-mic-meter i:nth-child(1) { height: 6px; }
.calls-mic-meter i:nth-child(2) { height: 7.5px; }
.calls-mic-meter i:nth-child(3) { height: 9px; }
.calls-mic-meter i:nth-child(4) { height: 10.5px; }
.calls-mic-meter i:nth-child(5) { height: 12px; }
.calls-mic-meter i:nth-child(6) { height: 13.5px; }
.calls-mic-meter i:nth-child(7) { height: 15px; }
.calls-mic-meter i:nth-child(8) { height: 16.5px; }
.calls-mic-meter i:nth-child(9) { height: 18px; }
.calls-mic-meter i:nth-child(10) { height: 20px; }
.calls-mic-meter i.is-on { background: #0E6B4A; }
.calls-mic-meter i.is-on:nth-child(n+8) { background: #1FA06E; }
.calls-mic-meter.is-muted i.is-on { background: rgba(var(--ink-rgb), 0.3); }
.calls-mic-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-light-body); }
.calls-mic-note.is-warn { color: #8A6620; }
/* Noise cancellation: a switch and its name. */
.calls-phone-switch { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font-size: 13px; font-weight: 600; cursor: pointer; }
.calls-phone-switch input { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 32px; height: 18px; margin: 0; border-radius: 999px; background: rgba(var(--ink-rgb), 0.2); cursor: pointer; transition: background-color 0.15s; }
.calls-phone-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(var(--ink-rgb), 0.25); transition: transform 0.15s; }
.calls-phone-switch input:checked { background: #0E6B4A; }
.calls-phone-switch input:checked::after { transform: translateX(14px); }
.calls-phone-switch input:focus-visible { outline: 2px solid #0E6B4A; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .calls-mic-meter i, .calls-phone-switch input, .calls-phone-switch input::after { transition: none; }
}
.calls-phone-error { margin: 0; font-size: 13px; color: #8A6620; }
.calls-phone-warning { margin: 0; font-size: 13px; color: #8A6620; }
.calls-line-warnings { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.calls-wrap-up { display: flex; flex-direction: column; gap: 8px; }
/* Outcome, name and email on one row while they fit, stacked when not. */
.calls-wrap-up-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.calls-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calls-field-label { font-size: 11.5px; color: var(--text-light-body); }
.calls-field .mail-select { width: 100%; }
.calls-wrap-up .mail-textarea { font-size: 13px; }
.calls-wrap-up-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calls-schedule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calls-schedule .mail-input { flex: 0 1 220px; width: auto; }
.calls-schedule-hint { font-size: 12px; }
.calls-schedule-hint.is-outside { color: #8A6620; }
.calls-when .calls-section-title .calls-due { margin-inline-start: 6px; text-transform: none; letter-spacing: 0; }
.calls-due[data-due="overdue"] { font-weight: 600; }
.calls-wrap-up-row .mail-editor-label { width: 64px; }
.calls-wrap-up-row .mail-input, .calls-wrap-up-row .mail-select { flex: 1 1 220px; width: auto; }
.calls-wrap-up-status { font-size: 12.5px; color: var(--text-light-body); }
/* The brief is read on the line: a touch above a note's size, never a
   page's, so the whole script stays on one screen beside the notes. */
.calls-brief.crm-note-body { font-size: 13.5px; line-height: 1.5; margin: 0 0 6px; }
.calls-brief h1, .calls-brief h2, .calls-brief h3, .calls-brief h4, .calls-brief h5, .calls-brief h6 { font-size: 13.5px; margin: 10px 0 2px; }
.calls-brief-edit summary { cursor: pointer; font-size: 12.5px; margin-bottom: 8px; }
#compose-brief { margin: 0 0 12px; width: 100%; }
/* A phone shows one pane at a time; the rules are read on a desk, and on a
   phone they would push the list under the fold. */
@media (max-width: 1100px) {
  .mail.calls { grid-template-columns: 190px 290px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .calls-rules, .calls-clocks { display: none; }
  .calls-captions { order: 4; position: sticky; bottom: 0; max-height: 45vh; }
  .calls-caption { font-size: 17px; }
  /* The mail page hides the pane's first line on a phone; here an icon
     comes before it. */
  .calls-empty-icon, .calls .mail-pane-empty p:first-of-type { display: none; }
  .calls-turn { max-width: 92%; }
}

/* ---- Evidence page: files in a slot (#1023) --------------------------------
   Each slot lists what's in it before the picker for more: the file, its size,
   a remove button, and — for the exhibit slots — what the photo check found.
   A warning is amber, never red: it's a "check this", not a refusal. */
.app-evidence-hint {
  margin: -2px 0 8px;
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-evidence-files {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
}

.app-evidence-file {
  padding: 9px 12px;
  border-top: 1px solid var(--console-border-row);
  font-size: 13px;
}

.app-evidence-file:first-child {
  border-top: 0;
}

.app-evidence-file-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.app-evidence-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-evidence-file-meta {
  color: var(--console-text-secondary);
  font-size: 12px;
  margin-inline-start: 6px;
}

.app-evidence-file-remove {
  flex-shrink: 0;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--console-text-secondary);
  text-decoration: underline;
  cursor: pointer;
}

.app-evidence-file-remove:hover {
  color: var(--console-text-primary);
}

.app-evidence-file-note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-evidence-file-warning,
.app-evidence-fit {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-radius: var(--console-radius-control);
  background: var(--console-amber-bg);
  color: var(--console-text-primary);
  font-size: 12.5px;
  line-height: 1.45;
}

.app-evidence-fit {
  margin: 0 0 14px;
}

.app-evidence-fit ul {
  margin: 6px 0 0;
  padding-inline-start: 18px;
}

.app-evidence-disclaimer {
  margin-top: 8px;
  font-size: 12.5px;
}

.app-evidence-disclaimer p {
  margin: 0 0 6px;
  color: var(--console-text-secondary);
}

.app-evidence-disclaimer blockquote {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-inline-start: 3px solid var(--console-border-input);
  color: var(--console-text-primary);
}

.app-evidence-hidden-form {
  display: none;
}

/* What the evidence check found missing (#1029). Above the files it's about,
   amber like the per-file warnings: advice, not a refusal. */
.app-evidence-gaps {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: var(--console-radius-control);
  background: var(--console-amber-bg);
  font-size: 12.5px;
  line-height: 1.45;
}

.app-evidence-gaps ul {
  margin: 6px 0 0;
  padding-inline-start: 18px;
}

/* ============================================================
   The evidence document on the case page (app/disputes/_evidence_document).
   Every other card on the page describes the dispute; this one is the
   response itself, word for word — so it reads as a document, not a card:
   a green spine (green is us), a paper-toned letter panel for the written
   response, and the fields set out like a form that has been filled in.
   ============================================================ */
.app-evidence-doc {
  position: relative;
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-inline-start: 4px solid var(--console-won);
  border-radius: var(--console-radius-card);
  padding: 24px 28px 26px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -16px rgba(15, 81, 50, 0.35);
}

/* The response a provider is reviewing that didn't come from us: the same
   document shape, without the green that says "ours". */
.app-provider-evidence {
  border-inline-start-color: var(--console-text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.app-provider-evidence .app-evidence-doc-eyebrow {
  color: var(--console-text-secondary);
}

/* Stripe keeps an address's lines apart with newlines. */
.app-provider-evidence dd {
  white-space: pre-line;
}

.app-evidence-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.app-evidence-doc-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--console-won);
  margin-bottom: 4px;
}

.app-evidence-doc-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.app-evidence-doc-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  color: var(--console-text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: var(--console-surface);
}

.app-console .app-evidence-doc-edit:hover {
  border-color: var(--console-won);
  color: var(--console-won);
}

.app-evidence-doc-edit:focus-visible {
  outline: 2px solid var(--console-won);
  outline-offset: 2px;
}

.app-evidence-doc-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--console-text-secondary);
  margin-bottom: 10px;
}

.app-evidence-doc-letter {
  background: #FBFAF6;
  border: 1px solid #ECE8DC;
  border-radius: 8px;
  padding: 18px 20px;
}

.app-evidence-doc-paragraph {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--console-text-primary);
  margin: 0 0 12px;
  max-width: 72ch;
  overflow-wrap: anywhere;
}

.app-evidence-doc-paragraph:last-child {
  margin-bottom: 0;
}

.app-evidence-doc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 20px 0 0;
}

.app-evidence-doc-field dt {
  font-size: 12px;
  color: var(--console-text-secondary);
  margin-bottom: 3px;
}

.app-evidence-doc-field dd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.app-evidence-doc-files {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--console-border-card);
}

.app-evidence-doc-files ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-evidence-doc-files li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.app-evidence-doc-file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.app-evidence-doc-file-slot {
  color: var(--console-text-secondary);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .app-evidence-doc {
    padding: 18px 16px 20px;
  }

  .app-evidence-doc-letter {
    padding: 14px;
  }

  .app-evidence-doc-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-evidence-doc-files li {
    flex-direction: column;
    gap: 2px;
  }
}

/* ============================================================
   /admin/knowledge — the internal knowledge base, drawn like /admin/docs:
   Drive for the lists (a search pill, page cards with a miniature of the
   page) and Google Docs for one page (a paper page on the desk, a margin
   beside it). It borrows the .drive/.gdoc tokens and parts and adds only
   what a knowledge base has and a doc doesn't — the tree of sections down
   the left, the outline and cross-references in the margin, and the amber
   staff-only block, which is a warning, not a brand mark.
   ============================================================ */
.kb-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.kb-home .doc-icon { color: var(--green); }

.kb-frame {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* ── The tree (Drive's folder rail) ── */
.kb-sidebar {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 0 4px 24px 0;
  font-size: 13.5px;
}

.kb-tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 999px;
  color: rgba(var(--ink-rgb), 0.78);
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.kb-tree-row:hover { background: var(--doc-hover); color: var(--ink); }
.kb-tree-row.is-active { background: var(--doc-tint); color: var(--green-dark); font-weight: 600; }
.kb-tree-row .doc-icon { color: var(--doc-muted); }
.kb-tree-row.is-active .doc-icon { color: var(--green-dark); }

.kb-tree-home { margin-bottom: 10px; font-weight: 600; color: var(--ink); }

.kb-tree-section { margin-bottom: 10px; }
.kb-tree-heading { font-weight: 600; color: var(--ink); }

.kb-tree-pages {
  list-style: none;
  margin: 2px 0 0;
  padding: 0 0 0 28px;
}

.kb-tree-pages .kb-tree-row { min-height: 30px; padding: 4px 12px; }
.kb-tree-row.kb-tree-pending { color: var(--doc-muted); font-size: 12.5px; font-style: italic; }

.kb-tree-nested { margin: 4px 0 0 18px; }

/* ── The lists (Drive) ── */
.kb-content { min-width: 0; }

.kb-heading {
  margin: 0 0 8px;
  font: 600 24px/1.2 var(--font-display);
  letter-spacing: -0.01em;
}

.kb-lede {
  max-width: 760px;
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--doc-muted);
}

.kb-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--doc-muted);
}

.kb-breadcrumbs a { color: inherit; text-decoration: none; }
.kb-breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }

.kb-overview-section { margin-bottom: 40px; }

.kb-section-title { margin: 0 0 4px; font: 600 18px/1.3 var(--font-display); }

.kb-section-title a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.kb-section-title a:hover { color: var(--green-dark); }
.kb-section-title .doc-icon { color: var(--green); }

.kb-section-summary { max-width: 760px; margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; color: var(--doc-muted); }

.kb-cards { margin-bottom: 16px; }
.kb-card-foot { align-items: flex-start; }
.kb-card-foot .drive-file-icon { margin-top: 1px; }
.kb-card .drive-card-title { white-space: normal; }

.kb-card-summary {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--doc-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-pending,
.kb-pending-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb-pending-label { margin-inline-end: 4px; font-size: 12.5px; font-weight: 600; color: var(--doc-muted); }

.kb-pending-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border: 1px dashed rgba(var(--ink-rgb), 0.22);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--doc-muted);
}

/* Search results: Drive's list, one row a page, the snippet under its title. */
.kb-hits { margin: 16px 0 0; padding: 0; list-style: none; }
.kb-hit { border-bottom: 1px solid var(--doc-line); }
.kb-hit:last-child { border-bottom: 0; }
.drive-list-row.kb-hit-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; border-bottom: 0; }
.kb-hit-snippet { font-size: 13px; line-height: 1.5; color: var(--doc-muted); }

/* ── One page (Google Docs) ── */
.kb-bar-search { width: 300px; flex: none; height: 40px; padding: 0 16px; }
.kb-bar-search .drive-search-input { font-size: 14px; }
.kb-doc .gdoc-bar .kb-breadcrumbs { margin: 0 0 2px; }

.kb-doc .gdoc-body {
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  grid-template-areas: "tree canvas rail";
}

.kb-doc .kb-sidebar { grid-area: tree; padding-top: 4px; }
.kb-doc .gdoc-canvas { grid-area: canvas; }
.kb-doc .kb-rail { grid-area: rail; }

.kb-doc .gdoc-page { min-height: 0; padding: 56px 64px 64px; }

.kb-page-lede {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(var(--ink-rgb), 0.70);
}

.kb-meta { margin: 0 0 32px; }
.kb-meta .gdoc-chip { display: inline-block; padding: 3px 11px; line-height: 1.5; font-family: inherit; font-size: 12px; font-weight: 500; vertical-align: 0; }
.kb-meta .doc-icon { display: inline-block; margin-inline-end: 4px; vertical-align: -2px; }
.kb-meta .admin-mono { font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }

.kb-body h2[id],
.kb-body h3[id] { scroll-margin-top: 16px; }

.kb-shot { margin: 8px 0 24px; }

.kb-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--doc-line);
  border-radius: 10px;
  box-shadow: var(--doc-shadow);
}

.kb-shot figcaption { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--doc-muted); }

/* Staff only: true, useful, and never for a client. The badge has to be
   impossible to miss when someone is copying a paragraph into an email. */
.kb-staff {
  margin: 0 0 1.2em;
  padding: 14px 18px 4px;
  border: 1px solid #F2D483;
  border-radius: 14px;
  background: #FFF6DB;
  font-size: 14.5px;
}

.kb-staff-label {
  margin: 0 0 6px;
  font: 700 10.5px/1.6 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8A5A00;
}

.kb-broken-link { color: var(--red); text-decoration: line-through; }

/* The margin: cards, as the docs page stacks its comments. */
.kb-rail { display: flex; flex-direction: column; gap: 12px; }

.kb-rail-card {
  padding: 14px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  background: #FFFFFF;
}

.kb-rail-card .gdoc-panel-title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }

.kb-rail-links { margin: 0 -8px; padding: 0; list-style: none; font-size: 13px; line-height: 1.4; }

.kb-rail-links a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: rgba(var(--ink-rgb), 0.82);
  text-decoration: none;
}

.kb-rail-links a:hover { background: var(--doc-hover); color: var(--ink); }
.kb-rail-links .doc-icon { margin-top: 1px; color: var(--green); }

.kb-gaps { border-style: dashed; background: transparent; }
.kb-gaps ul { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.5; color: var(--doc-muted); }
.kb-gaps li + li { margin-top: 4px; }
.kb-gaps .doc-icon { color: var(--doc-muted); }
.kb-rail .gdoc-panel-foot { margin-top: 2px; }

/* Under 1280 the tree moves into the margin, under the page's own cards. */
@media (max-width: 1280px) {
  .kb-doc .gdoc-body {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "canvas rail" "canvas tree";
  }

  .kb-doc .kb-rail { position: static; max-height: none; overflow: visible; }
  .kb-doc .kb-sidebar { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 1000px) {
  .kb-frame { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .kb-sidebar { position: static; max-height: none; padding-bottom: 12px; border-bottom: 1px solid var(--doc-line); }

  .kb-doc .gdoc-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "canvas" "rail" "tree";
  }

  .kb-doc .kb-sidebar { border-bottom: 0; }
  .kb-bar-search { width: 220px; }
}

@media (max-width: 640px) {
  .kb-doc .gdoc-page { padding: 28px 20px; }
  .kb-bar-search { width: 100%; flex: 1; }
  .kb-heading { font-size: 21px; }
  .gdoc-title.kb-title { white-space: normal; }
}

/* ============================================================
   Recovery — lost disputes a merchant files by hand for us to pursue
   (RecoveryCase). The fork an unconnected account starts on, the list,
   the six-step wizard that saves as it goes, and the filed case's page.
   ============================================================ */

/* The fork: two equal choices, side by side. Each card is one big target
   with a picture on top and one sentence under it — the first thing a new
   merchant reads, so it has to be read at a glance. Both are "us", so both
   are green: night-to-green for the ongoing product, mint-to-highlighter for
   the one-off recovery. */
.app-console-recovery-fork {
  max-width: 1100px;
  container-type: inline-size;
}

.app-console-recovery-fork-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.app-console-recovery-fork-form {
  display: flex;
  margin: 0;
}

.app-console-recovery-fork-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--console-border-card);
  border-radius: 16px;
  background: var(--console-surface);
  color: var(--console-text-primary);
  font: inherit;
  text-align: start;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.app-console-recovery-fork-card:hover,
.app-console-recovery-fork-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -18px rgba(10, 63, 46, 0.45);
  border-color: transparent;
  color: var(--console-text-primary);
}

.app-console-recovery-fork-card:focus-visible {
  outline: 2px solid var(--console-won);
  outline-offset: 3px;
}

.app-console-recovery-fork-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 184px;
  padding: 22px 24px;
  box-sizing: border-box;
  overflow: hidden;
}

/* A soft dot grid over the gradient — texture, not a pattern to read. */
.app-console-recovery-fork-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.4px);
  background-size: 16px 16px;
  mask-image: linear-gradient(120deg, transparent 20%, #000 90%);
  pointer-events: none;
}

.app-console-recovery-fork-card--fight .app-console-recovery-fork-art {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(43, 217, 138, 0.45) 0%, transparent 55%),
    linear-gradient(135deg, #0A3F2E 0%, #0E6B4A 100%);
  color: #FFFFFF;
}

.app-console-recovery-fork-card--recover .app-console-recovery-fork-art {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(221, 242, 122, 0.95) 0%, transparent 60%),
    linear-gradient(135deg, #D7EEDF 0%, #F1F8C9 100%);
  color: #0A3F2E;
}

.app-console-recovery-fork-card--recover .app-console-recovery-fork-art::after {
  background-image: radial-gradient(rgba(10, 63, 46, 0.12) 1px, transparent 1.4px);
}

.app-console-recovery-fork-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
  transition: transform 220ms ease;
}

.app-console-recovery-fork-card--recover .app-console-recovery-fork-badge {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(10, 63, 46, 0.12);
}

.app-console-recovery-fork-card:hover .app-console-recovery-fork-badge {
  transform: scale(1.06);
}

.app-console-recovery-fork-badge svg {
  width: 24px;
  height: 24px;
}

/* The miniatures on the right of each picture. Decoration only, hidden
   from assistive tech. */
.app-console-recovery-fork-scene {
  position: absolute;
  z-index: 1;
  inset-inline-end: 22px;
  top: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44%;
  /* Never narrower than its widest row, so a label never runs under its pill. */
  min-width: max-content;
  transition: transform 220ms ease;
}

.app-console-recovery-fork-card:hover .app-console-recovery-fork-scene {
  transform: translateY(-3px);
}

.app-console-recovery-fork-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5);
}

.app-console-recovery-fork-row:nth-child(2) {
  margin-inline-start: 14px;
  opacity: 0.92;
}

.app-console-recovery-fork-row:nth-child(3) {
  margin-inline-start: 28px;
  opacity: 0.84;
}

.app-console-recovery-fork-row-dot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #D7EEDF;
  color: #0E6B4A;
}

.app-console-recovery-fork-row-dot svg {
  width: 11px;
  height: 11px;
}

.app-console-recovery-fork-row-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #182420;
  white-space: nowrap;
}

.app-console-recovery-fork-row-pill {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--console-radius-pill);
  background: #0E6B4A;
  color: #FFFFFF;
}

/* The won one: the signal green, so it reads before its label does. */
.app-console-recovery-fork-row--won .app-console-recovery-fork-row-pill {
  background: #2BD98A;
  color: #0A3F2E;
}

.app-console-recovery-fork-row--won .app-console-recovery-fork-row-dot {
  background: #2BD98A;
  color: #0A3F2E;
}

.app-console-recovery-fork-scene--letter {
  align-items: flex-end;
}

.app-console-recovery-fork-letter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 78%;
  min-width: max-content;
  padding: 14px 16px 18px;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 10px 22px -12px rgba(10, 63, 46, 0.55);
  transform: rotate(3deg);
}

.app-console-recovery-fork-letter-head {
  font-family: var(--font-app-display);
  font-size: 13px;
  font-weight: 700;
  color: #0A3F2E;
  white-space: nowrap;
}

.app-console-recovery-fork-letter-from {
  font-size: 10.5px;
  color: #5D6B65;
  margin: -4px 0 2px;
}

.app-console-recovery-fork-letter-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px dashed #D9DEDB;
  font-size: 10.5px;
  font-weight: 700;
  color: #0A3F2E;
  white-space: nowrap;
}

.app-console-recovery-fork-letter-blank {
  width: 44px;
  height: 8px;
  border-radius: 3px;
  background: #DDF27A;
}

.app-console-recovery-fork-letter-line {
  height: 6px;
  border-radius: 3px;
  background: #E6E8E7;
}

.app-console-recovery-fork-letter-line--short {
  width: 60%;
}

.app-console-recovery-fork-letter-seal svg {
  width: 16px;
  height: 16px;
}

.app-console-recovery-fork-letter-seal {
  position: absolute;
  inset-inline-end: -12px;
  bottom: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #DDF27A;
  color: #0A3F2E;
  border: 2px solid #FFFFFF;
}

.app-console-recovery-fork-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}

/* What the card works with, under its sentence: quiet chips, so the
   picture above stays the thing the eye lands on. */
.app-console-recovery-fork-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}

.app-console-recovery-fork-chips-label {
  font-size: 11.5px;
  color: var(--console-text-secondary);
  margin-inline-end: 2px;
}

.app-console-recovery-fork-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--console-radius-pill);
  background: var(--console-canvas);
  border: 1px solid var(--console-border-card);
  color: var(--console-text-primary);
}

.app-console-recovery-fork-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--console-won);
  margin-bottom: 6px;
}

.app-console-recovery-fork-title {
  font-family: var(--font-app-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

/* The sentence takes up the slack, so both cards' chips start on the same
   line whatever each sentence runs to: the cards are one grid row tall. */
.app-console-recovery-fork-body {
  flex-grow: 1;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--console-text-secondary);
}

.app-console-recovery-fork-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 20px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--console-text-primary);
}

.app-console-recovery-fork-cta span {
  transition: transform 160ms ease;
}

.app-console-recovery-fork-card:hover .app-console-recovery-fork-cta span {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .app-console-recovery-fork-card,
  .app-console-recovery-fork-badge,
  .app-console-recovery-fork-scene,
  .app-console-recovery-fork-cta span {
    transition: none;
  }

  .app-console-recovery-fork-card:hover,
  .app-console-recovery-fork-card:focus-visible {
    transform: none;
  }
}

/* The list */
.app-console-recovery {
  max-width: 1120px;
}

.app-console-recovery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.app-console-recovery-lead {
  margin: 0;
  font-size: 14px;
  color: var(--console-text-secondary);
  max-width: 62ch;
}

.app-console-recovery-empty {
  max-width: 620px;
}

.app-console-recovery-empty .app-console-card-body {
  margin-bottom: 20px;
}

.app-console-recovery-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 120px minmax(0, 150px) minmax(0, 230px);
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--console-border-row);
  color: inherit;
  text-decoration: none;
  font-size: 13.5px;
}

.app-console-recovery-row--compact {
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 120px minmax(0, 230px);
}

a.app-console-recovery-row {
  transition: background-color 120ms ease;
}

a.app-console-recovery-row:hover,
a.app-console-recovery-row:focus-visible {
  background: var(--console-canvas);
}

a.app-console-recovery-row:focus-visible {
  outline: 2px solid var(--console-won);
  outline-offset: -2px;
}

.app-console-recovery-row--header {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-panel > .app-console-recovery-row:last-child {
  border-bottom: none;
}

.app-console-recovery-row-case {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-console-recovery-row-number {
  font-weight: 700;
}

.app-console-recovery-row-meta {
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-recovery-row-buyer {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-recovery-row-provider,
.app-console-recovery-row-buyer--empty,
.app-console-recovery-row-amount--empty {
  color: var(--console-text-secondary);
  font-weight: 400;
}

.app-console-recovery-row-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-console-recovery-row-continue {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--console-text-primary);
}

/* The wizard: the steps down the left, the step itself on the right. */
.app-console-recovery-wizard {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  max-width: 1080px;
}

.app-console-recovery-steps {
  position: sticky;
  top: 16px;
}

/* The console's content box is a scroll container (overflow-y: auto) that
   never scrolls itself — the window does — so a sticky element inside it
   never sticks. On the wizard, let the window be the scroller. */
.app-console-content:has(.app-console-recovery-wizard) {
  overflow: visible;
}

.app-console-recovery-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-console-recovery-steps a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--console-radius-control);
  color: var(--console-text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

/* Quiet on purpose: giving up on a draft is the rare way out of the form,
   not a step in it. */
.app-console-recovery-delete {
  margin-top: 12px;
}

.app-console-recovery-delete-toggle {
  display: inline-block;
  padding: 6px 10px;
  color: var(--console-text-secondary);
  font-size: 12.5px;
  list-style: none;
  cursor: pointer;
}

.app-console-recovery-delete-toggle::-webkit-details-marker {
  display: none;
}

.app-console-recovery-delete-toggle:hover {
  color: var(--console-text-primary);
  text-decoration: underline;
}

.app-console-recovery-delete-cancel,
.app-console-recovery-delete[open] .app-console-recovery-delete-open {
  display: none;
}

.app-console-recovery-delete[open] .app-console-recovery-delete-cancel {
  display: inline;
}

.app-console-recovery-delete-ask {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  font-size: 13px;
  color: var(--console-text-primary);
}

.app-console-recovery-delete-ask p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.app-console-recovery-delete-form {
  margin: 0;
}

.app-console-recovery-steps a:hover {
  background: var(--console-surface);
  color: var(--console-text-primary);
}

.app-console-recovery-steps-item--current a {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  color: var(--console-text-primary);
  padding: 8px 9px;
}

.app-console-recovery-steps-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--console-border-input);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--console-surface);
}

.app-console-recovery-steps-item--current .app-console-recovery-steps-mark {
  background: var(--console-text-primary);
  border-color: var(--console-text-primary);
  color: var(--console-surface);
}

.app-console-recovery-steps-item--done .app-console-recovery-steps-mark {
  background: var(--console-won);
  border-color: var(--console-won);
  color: var(--console-surface);
}

.app-console-recovery-steps-item--done .app-console-recovery-steps-mark svg {
  width: 12px;
  height: 12px;
}

.app-console-recovery-step {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  padding: 28px 32px 24px;
  min-width: 0;
}

.app-console-recovery-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.app-console-recovery-step-count {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--console-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-console-recovery-step-title {
  font-family: var(--font-app-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.app-console-recovery-step-intro {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--console-text-secondary);
  max-width: 64ch;
}

.app-console-recovery-saved {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--console-text-secondary);
  padding: 4px 10px;
  border-radius: var(--console-radius-pill);
  background: var(--console-canvas);
  white-space: nowrap;
}

.app-console-recovery-saved[data-state="saved"] {
  color: var(--console-won);
}

.app-console-recovery-saved[data-state="error"] {
  color: var(--console-error);
  background: #FDECEA;
}

.app-console-recovery-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.app-console-recovery-field {
  min-width: 0;
  scroll-margin-top: 24px;
}

.app-console-recovery-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--console-text-primary);
  margin: 0 0 6px;
  padding: 0;
}

.app-console-recovery-req {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--console-text-secondary);
  vertical-align: 1px;
}

.app-console-recovery-hint {
  margin: -2px 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--console-text-secondary);
  max-width: 640px;
}

.app-console-recovery-hint--check {
  margin: 4px 0 0 26px;
}

.app-console-recovery-input {
  display: block;
  width: 100%;
  max-width: 640px;
  box-sizing: border-box;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-app-body);
  color: var(--console-text-primary);
  outline: none;
}

textarea.app-console-recovery-input {
  max-width: 640px;
  resize: vertical;
  line-height: 1.5;
}

#recovery-field-currency .app-console-recovery-input,
#recovery-field-state_of_registration .app-console-recovery-input,
#recovery-field-card_last4 .app-console-recovery-input,
#recovery-field-reason_code .app-console-recovery-input {
  max-width: 140px;
}

/* A date picker and a select draw taller than a text box by default; one
   height keeps a row of mixed fields on one line. */
input.app-console-recovery-input,
select.app-console-recovery-input {
  height: 42px;
}

.app-console-recovery-input:focus {
  border-color: var(--console-text-primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.app-console-recovery-field--date .app-console-recovery-input,
.app-console-recovery-field--money .app-console-recovery-input,
.app-console-recovery-field--number .app-console-recovery-input {
  max-width: 220px;
}

.app-console-recovery-input-wrap--money {
  position: relative;
  max-width: 220px;
}

.app-console-recovery-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.app-console-recovery-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-console-recovery-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--console-border-input);
  border-radius: var(--console-radius-control);
  background: var(--console-surface);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.app-console-recovery-choice:hover {
  border-color: var(--console-text-primary);
}

.app-console-recovery-choice input {
  margin: 0;
  accent-color: var(--console-text-primary);
}

.app-console-recovery-choice:has(input:checked) {
  border-color: var(--console-text-primary);
  background: var(--console-canvas);
  box-shadow: inset 0 0 0 1px var(--console-text-primary);
}

.app-console-recovery-choice:has(input:focus-visible) {
  outline: 2px solid var(--console-won);
  outline-offset: 2px;
}

.app-console-recovery-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.app-console-recovery-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--console-text-primary);
}

.app-console-recovery-address {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  max-width: 640px;
}

.app-console-recovery-address .app-console-recovery-input {
  max-width: none;
}

.app-console-recovery-address-line1,
.app-console-recovery-address-line2 {
  grid-column: 1 / -1;
}

/* Shipments: a row per box. */
.app-console-recovery-shipments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.app-console-recovery-shipments > div {
  width: 100%;
}

.app-console-recovery-shipments-head,
.app-console-recovery-shipment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 150px 150px 96px;
  gap: 8px;
  align-items: center;
}

.app-console-recovery-shipments-head {
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-recovery-shipments-head span:last-child {
  visibility: hidden;
}

.app-console-recovery-shipment + .app-console-recovery-shipment {
  margin-top: 8px;
}

.app-console-recovery-shipment .app-console-recovery-input {
  max-width: none;
  height: 40px;
  padding: 9px 10px;
  font-size: 13.5px;
}

.app-console-recovery-shipment-cell {
  display: block;
  min-width: 0;
}

.app-console-recovery-shipment-caption {
  display: none;
  font-size: 11.5px;
  color: var(--console-text-secondary);
  margin-bottom: 3px;
}

.app-console-recovery-shipment-signed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.app-console-recovery-shipment-signed input {
  accent-color: var(--console-text-primary);
}

/* A step's upload area */
.app-console-recovery-files,
.app-console-recovery-submit {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--console-border-row);
}

.app-console-recovery-files--only {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.app-console-recovery-files-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}

.app-console-recovery-files-intro {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--console-text-secondary);
}

.app-console-recovery-checklist,
.app-console-recovery-missing {
  margin: 0 0 16px;
  padding-inline-start: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--console-text-primary);
}

.app-console-recovery-checklist li,
.app-console-recovery-missing li {
  margin-bottom: 3px;
}

.app-console-recovery-missing a {
  color: var(--console-text-primary);
  text-decoration: underline;
  text-decoration-color: var(--console-border-input);
  text-underline-offset: 3px;
}

.app-console-recovery-missing a:hover {
  text-decoration-color: currentColor;
}

@media (min-width: 721px) {
  .app-console-recovery-submit .app-console-recovery-missing {
    columns: 2;
    column-gap: 32px;
  }

  .app-console-recovery-submit .app-console-recovery-missing li {
    break-inside: avoid;
  }
}

.app-console-recovery-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 16px;
  border: 1.5px dashed var(--console-border-input);
  border-radius: var(--console-radius-card);
  background: var(--console-canvas);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.app-console-recovery-drop:hover,
.app-console-recovery-drop:focus-within {
  border-color: var(--console-text-primary);
  background: var(--console-surface);
}

.app-console-recovery-drop-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.app-console-recovery-drop-title {
  font-size: 14px;
  font-weight: 700;
}

.app-console-recovery-drop-sub {
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

/* While Turbo sends the files the form is aria-busy: the box says so and
   takes no second drop until the section comes back. */
.app-console-recovery-drop-busy {
  display: none;
  font-size: 14px;
  font-weight: 700;
}

.app-console-recovery-upload[aria-busy="true"] .app-console-recovery-drop {
  pointer-events: none;
  border-style: solid;
  opacity: 0.7;
}

.app-console-recovery-upload[aria-busy="true"] .app-console-recovery-drop-title {
  display: none;
}

.app-console-recovery-upload[aria-busy="true"] .app-console-recovery-drop-busy {
  display: block;
}

.app-console-recovery-files-alert {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--console-error-border);
  border-radius: var(--console-radius-control);
  color: var(--console-error);
  font-size: 13px;
}

.app-console-recovery-file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
}

.app-console-recovery-file-list--panel {
  margin: 0;
  border: none;
  border-radius: 0;
}

.app-console-recovery-file-list--panel .app-console-recovery-file {
  padding: 11px 20px;
}

.app-console-recovery-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--console-border-row);
  font-size: 13px;
}

.app-console-recovery-file:last-child {
  border-bottom: none;
}

.app-console-recovery-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-recovery-file-name a {
  color: var(--console-text-primary);
  font-weight: 600;
}

.app-console-recovery-file-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--console-text-secondary);
}

.app-console-recovery-file-remove-form {
  flex-shrink: 0;
  margin: 0;
}

.app-console-recovery-file-remove {
  padding: 2px 4px;
  font-size: 12px;
}

.app-console-recovery-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--console-border-row);
}

/* The filed case */
.app-console-recovery-case {
  max-width: 1120px;
}

.app-console-recovery-status {
  background: var(--console-surface);
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-card);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.app-console-recovery-status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-console-recovery-status-meta {
  font-size: 12.5px;
  color: var(--console-text-secondary);
}

.app-console-recovery-status-sentence {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--console-text-primary);
}

.app-console-recovery-status-amount {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--console-won);
}

.app-console-recovery-case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.app-console-recovery-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}

.app-console-recovery-section-note {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--console-text-secondary);
}

.app-console-recovery-missing-box {
  background: var(--console-amber-bg);
  border: 1px solid #F0D9B5;
  border-radius: var(--console-radius-card);
  padding: 16px 20px 4px;
  margin-bottom: 24px;
}

.app-console-recovery-answers-list {
  margin: 0;
}

.app-console-recovery-answer {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--console-border-row);
  font-size: 13.5px;
}

.app-console-recovery-answer:last-child {
  border-bottom: none;
}

.app-console-recovery-answer dt {
  color: var(--console-text-secondary);
}

.app-console-recovery-answer dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.app-console-recovery-side-body {
  padding: 16px 20px 20px;
}

.app-console-recovery-message-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.app-console-recovery-message-form textarea {
  max-width: none;
}

.app-console-recovery-message-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.app-console-recovery-drop--compact {
  padding: 14px 12px;
}

.app-console-recovery-drop--compact .app-console-recovery-drop-title {
  font-size: 13.5px;
}

.app-console-recovery-drop--compact .app-console-recovery-drop-sub {
  font-size: 12px;
}

/* What was picked, before Send (the chips come from mail-files). */
.app-console-recovery-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-console-recovery-picked .mail-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--console-border-card);
  border-radius: var(--console-radius-control);
  background: var(--console-canvas);
  font-size: 12.5px;
}

.app-console-recovery-picked .mail-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-recovery-picked .mail-file-size {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--console-text-secondary);
}

.app-console-recovery-picked-warning {
  margin: 0;
  font-size: 12.5px;
  color: var(--console-error);
}

.app-console-recovery-messages {
  list-style: none;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--console-border-row);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-console-recovery-message-meta {
  font-size: 12px;
  color: var(--console-text-secondary);
  margin-bottom: 4px;
}

.app-console-recovery-message-body {
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.app-console-recovery-message-body p {
  margin: 0 0 6px;
}

.app-console-recovery-message-attachments {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 12.5px;
}

.app-console-recovery-message-attachments li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--console-text-secondary);
}

.app-console-recovery-message-attachments li + li {
  margin-top: 4px;
}

.app-console-recovery-message-attachments svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

.app-console-recovery-message-attachments a {
  color: var(--console-text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-console-recovery-history {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.app-console-recovery-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  font-size: 13px;
}

.app-console-recovery-history-when {
  color: var(--console-text-secondary);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .app-console-recovery-case-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: what the merchant can still do comes before the long record
     of what they already said. */
  .app-console-recovery-case-side {
    order: -1;
  }

  .app-console-recovery-wizard {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .app-console-recovery-steps {
    position: static;
  }

  .app-console-recovery-steps ol {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .app-console-recovery-steps ol::-webkit-scrollbar {
    display: none;
  }

  .app-console-recovery-steps a {
    white-space: nowrap;
  }
}

/* Stack the cards before a card gets too narrow for its picture: below this,
   the dispute rows would run into the badge. The width is the content
   column's, so the console sidebar is already taken off. */
@container (max-width: 680px) {
  .app-console-recovery-fork-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {

  .app-console-recovery-fork-art {
    height: 132px;
    padding: 18px 20px;
  }

  .app-console-recovery-fork-scene {
    width: 60%;
    inset-inline-end: 16px;
    top: 14px;
    bottom: 14px;
    gap: 5px;
  }

  .app-console-recovery-fork-row {
    padding: 4px 8px;
  }

  .app-console-recovery-fork-row:nth-child(2) {
    margin-inline-start: 8px;
  }

  .app-console-recovery-fork-row:nth-child(3) {
    margin-inline-start: 16px;
  }

  /* The letter sits higher on a phone, so its seal isn't cut by the edge. */
  .app-console-recovery-fork-scene--letter {
    top: 10px;
    bottom: 24px;
    width: 52%;
  }

  .app-console-recovery-fork-letter {
    width: 100%;
    padding: 10px 12px 14px;
    gap: 5px;
  }

  .app-console-recovery-fork-text {
    padding: 18px 20px 20px;
  }

  .app-console-recovery-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-console-recovery-row,
  .app-console-recovery-row--compact {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
  }

  .app-console-recovery-row--header {
    display: none;
  }

  .app-console-recovery-row-buyer,
  .app-console-recovery-row-provider {
    grid-column: 1;
  }

  .app-console-recovery-row-amount {
    grid-column: 2;
    grid-row: 1;
    text-align: end;
  }

  .app-console-recovery-row-status {
    grid-column: 1 / -1;
  }

  .app-console-recovery-row-provider:empty,
  .app-console-recovery-row-buyer--empty {
    display: none;
  }

  .app-console-recovery-step {
    padding: 20px 18px;
  }

  .app-console-recovery-steps-label {
    display: none;
  }

  .app-console-recovery-steps-item--current .app-console-recovery-steps-label {
    display: inline;
  }

  .app-console-recovery-address {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .app-console-recovery-shipments-head {
    display: none;
  }

  .app-console-recovery-shipment-caption {
    display: block;
  }

  .app-console-recovery-shipment {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 10px;
    border: 1px solid var(--console-border-row);
    border-radius: var(--console-radius-control);
  }

  .app-console-recovery-answer {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .app-console-recovery-nav .app-console-btn {
    flex: 1;
  }
}

/* /admin/recovery — drawn like /admin/docs and /admin/knowledge (.drive,
   .kb-*): the list with its search pill and status chips, and one case with
   its status rail on the left and the record on the right. */
.rc-chips { gap: 8px; margin-bottom: 18px; }
.rc-chips-gap { flex: 1; }
.drive-chip--quiet { color: var(--doc-muted); }

.rc-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  margin-inline-start: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--doc-soft);
  font: 600 11px/1 var(--font-mono);
  color: var(--doc-muted);
  vertical-align: 1px;
}

.drive-chip.is-active .rc-chip-count { background: #FFFFFF; color: var(--green-dark); }

.rc-count { margin: 0 0 10px; font-size: 12.5px; color: var(--doc-muted); }
.rc-muted { color: var(--doc-muted); }

.rc-list .rc-list-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 120px 170px 80px;
}

.rc-num { text-align: end; }
.rc-cell { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.rc-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.rc-status--new { background: #FFFFFF; border: 1px solid var(--doc-line); color: var(--ink); }
.rc-status--work { background: var(--doc-tint); color: var(--green-dark); }
.rc-status--wait { background: #FBEFD9; color: #8A5A0B; }
.rc-status--won { background: var(--green); color: #FFFFFF; }
.rc-status--quiet { background: var(--doc-soft); color: var(--doc-muted); }

/* One case */
.rc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rc-heading { margin: 0; }

.rc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 22px;
  font-size: 13.5px;
  color: var(--doc-muted);
}

.rc-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #FBEFD9;
  color: #6B4A10;
  font-size: 14px;
  font-weight: 600;
}

.rc-frame { grid-template-columns: 270px minmax(0, 1fr); }

.rc-rail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rc-rail-block {
  padding: 14px 12px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: #FFFFFF;
}

.rc-rail-title {
  margin: 0 0 8px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.rc-action > summary { margin: 0; cursor: pointer; list-style: none; }
.rc-action > summary::-webkit-details-marker { display: none; }
.rc-action > summary::after { content: "+"; float: inline-end; font-size: 15px; line-height: 1; }
.rc-action[open] > summary { margin-bottom: 10px; }
.rc-action[open] > summary::after { content: "–"; }

.rc-steps { list-style: none; margin: 0; padding: 0; }
.rc-step-form { margin: 0; }

.rc-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.78);
  font: inherit;
  font-size: 13.5px;
  text-align: start;
}

button.rc-step-row { cursor: pointer; transition: background-color 0.15s, color 0.15s; }
button.rc-step-row:hover { background: var(--doc-hover); color: var(--ink); }

.rc-step-dot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--ink-rgb), 0.22);
  background: #FFFFFF;
}

.rc-step--done .rc-step-dot { border-color: var(--green); background: var(--green); color: #FFFFFF; }
.rc-step--current .rc-step-row { background: var(--doc-tint); color: var(--green-dark); font-weight: 600; }
.rc-step--current .rc-step-dot { border-color: var(--green-dark); box-shadow: inset 0 0 0 4px var(--green-dark); }
.rc-step--todo span.rc-step-row { color: var(--doc-muted); }

.rc-form { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.rc-form label { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.rc-form .doc-btn { align-self: flex-start; margin-top: 8px; }

.rc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--doc-line);
  border-radius: 10px;
  background: #FFFFFF;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}

.rc-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--doc-tint); }

.rc-content { display: flex; flex-direction: column; gap: 32px; }
.rc-section .kb-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.rc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rc-section-head .kb-section-title { margin: 0; }

.rc-missing {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--doc-soft);
  font-size: 13px;
  color: rgba(var(--ink-rgb), 0.78);
}

.rc-card {
  margin-bottom: 14px;
  padding: 18px 20px 8px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: #FFFFFF;
}

.rc-card-title { margin: 0 0 8px; font: 600 15px/1.3 var(--font-display); }

.rc-answers { margin: 0; }

.rc-answer {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--doc-line);
  font-size: 13.5px;
}

.rc-answer:first-child { border-top: 0; }
.rc-answer dt { color: var(--doc-muted); }
.rc-answer dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }

.rc-file {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--doc-line);
}

.rc-file:last-child { border-bottom: 0; }
.rc-file .drive-list-title a { color: var(--ink); }

.rc-file-receipt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--doc-muted);
  text-align: end;
}

.rc-tag {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--doc-soft);
  color: var(--doc-muted);
  font-size: 11px;
  font-weight: 600;
}

.rc-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rc-message { display: flex; gap: 12px; align-items: flex-start; }
.rc-message-main { flex: 1; min-width: 0; }
.rc-message-meta { font-size: 12.5px; color: var(--doc-muted); }
.rc-message-meta strong { color: var(--ink); font-weight: 600; }
.rc-history-what { margin-top: 2px; font-size: 14px; }

.rc-message-body {
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  background: var(--doc-soft);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.rc-message-body p { margin: 0 0 6px; }
.rc-message-body p:last-child { margin: 0; }
.rc-note { background: #FBF6E4; }

.rc-edit { max-width: 880px; }
.rc-edit .rc-card { padding: 20px 22px 22px; }
.rc-edit .rc-card-title { margin-bottom: 16px; }

.rc-edit-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0;
  background: linear-gradient(to top, #FFFFFF 70%, rgba(255, 255, 255, 0));
}

@media (max-width: 900px) {
  .rc-frame { grid-template-columns: minmax(0, 1fr); }
  .rc-rail { position: static; }
  .rc-list .rc-list-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rc-list .drive-list-head { display: none; }
  .rc-list .rc-list-row > :nth-child(2),
  .rc-list .rc-list-row > :nth-child(5) { display: none; }
  .rc-answer { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rc-file { grid-template-columns: 24px minmax(0, 1fr); }
  .rc-file-receipt { grid-column: 2; align-items: flex-start; text-align: start; }
}

/* On the dashboard the columns follow the dispute rows above (.app-console-row):
   amount under amount, status on the right edge. */
@media (min-width: 721px) {
  .app-console-recovery-row--compact {
    grid-template-columns: 104px minmax(0, 1fr) 90px minmax(0, 180px) 190px;
  }

  .app-console-recovery-row--compact .app-console-recovery-row-status {
    grid-column: 5;
    justify-content: flex-end;
  }
}

/* A phone needs a 44px target for the case page's one action. */
@media (max-width: 720px) {
  .app-console-recovery-message-form .app-console-btn {
    min-height: 44px;
    min-width: 96px;
  }
}

/* Under a connect form: what happens to a finished response on this account. */
.app-console-connect-mode-note {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--console-text-secondary);
}

.app-console-connect-mode-note a {
  color: inherit;
  text-decoration: underline;
}


/* ============================================================
   /admin/marketplaces — the App Store as we watch it, drawn in the frame
   /admin/knowledge uses: the title and search pill on top, a rail of places
   down the left, the screen as white panels on the desk. Numbers are mono;
   green is our own listing and nothing else, a rival is ink, a run that
   needs a look is amber — red is never used. Tables scroll inside their
   own box so a phone never scrolls the page sideways; the position chart
   is a server-drawn SVG whose lines take each app's colour from the group's
   `color`.
   ============================================================ */
.mk {
  --mk-amber: #FBEFD0;
  --mk-amber-ink: #7A5200;
  --mk-panel: #FFFFFF;
}

/* ── The rail ── */
.mk-rail-nav { display: flex; flex-direction: column; gap: 2px; }
.mk-rail-row { justify-content: flex-start; }
.mk-rail-row > span:not(.mk-rail-count):not(.mk-rail-place):not(.mk-rail-dot) { flex: 1; min-width: 0; }
.mk-rail-group { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }

.mk-rail-heading {
  margin: 0 0 4px;
  padding: 0 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.mk-rail-count {
  margin-inline-start: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font: 500 11.5px/1.5 var(--font-mono);
  text-align: center;
  color: var(--doc-muted);
  background: var(--doc-soft);
}

.mk-rail-count--due { background: var(--ink); color: #FFFFFF; }
.kb-tree-row.is-active .mk-rail-count { background: #FFFFFF; color: var(--green-dark); }

.mk-rail-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 5px; flex-shrink: 0; }
.mk-rail-dot--direct { background: var(--ink); }
.mk-rail-dot--adjacent { background: rgba(var(--ink-rgb), 0.45); }
.mk-rail-dot--candidate { border: 1.5px solid rgba(var(--ink-rgb), 0.45); }
.mk-rail-dot--ignored { border: 1.5px dashed rgba(var(--ink-rgb), 0.3); }

.mk-rail-keywords .mk-rail-row { min-height: 30px; padding: 4px 14px; }
.mk-rail-term { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-rail-place { margin-inline-start: auto; font-size: 12px; color: var(--doc-muted); }
.mk-rail-place.is-ranked { color: var(--green); font-weight: 600; }

/* ── Headings, meta, chips ── */
.mk-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mk-title-row .kb-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.mk-heading-count { font-size: 15px; font-weight: 500; color: var(--doc-muted); padding: 2px 10px; border-radius: 999px; background: var(--doc-soft); vertical-align: 3px; }
.mk .kb-heading .mk-heading-count { margin-inline-start: 6px; }
.mk-meta { margin: 0 0 22px; font-size: 13px; line-height: 1.6; color: var(--doc-muted); overflow-wrap: anywhere; }
.mk-meta .mk-chip { vertical-align: 1px; }
.mk-actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-outline { border-color: var(--doc-line); background: #FFFFFF; }
.mk-outline:hover { background: #F7F8F5; }

.mk-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 11.5px/1 var(--font-body, inherit);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: lowercase;
  vertical-align: middle;
  background: var(--doc-soft);
  color: rgba(var(--ink-rgb), 0.7);
}

.mk-chip--ours,
.mk-chip--ok,
.mk-chip--active { background: var(--doc-tint); color: var(--green-dark); }
.mk-chip--direct { background: var(--ink); color: #FFFFFF; }
.mk-chip--adjacent { background: rgba(var(--ink-rgb), 0.1); color: var(--ink); }
.mk-chip--candidate { background: transparent; border-color: rgba(var(--ink-rgb), 0.22); color: rgba(var(--ink-rgb), 0.7); }
.mk-chip--ignored,
.mk-chip--rejected { background: transparent; border: 1px dashed rgba(var(--ink-rgb), 0.25); color: var(--doc-muted); }
.mk-chip--warn,
.mk-chip--proposed { background: var(--mk-amber); color: var(--mk-amber-ink); }
.mk-chip--main { background: transparent; border-color: var(--ink); color: var(--ink); }
.mk-chip--other { background: var(--doc-soft); }
.kb-heading .mk-chip { height: 24px; font-size: 12px; }

/* ── Stat tiles ── */
.mk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.mk-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: var(--mk-panel);
  color: inherit;
  text-decoration: none;
}

.mk-stat-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--doc-muted); }
.mk-stat-value { font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.mk-stat-value--text { font: 600 17px/1.3 var(--font-display); letter-spacing: 0; }
.mk-stat-note { font-size: 12px; line-height: 1.4; color: var(--doc-muted); overflow-wrap: anywhere; }
.mk-stat--ours .mk-stat-label .doc-icon { color: var(--green); }
.mk-stat--ours .mk-stat-value { color: var(--green); }
.mk-stat--link { transition: box-shadow 0.15s, transform 0.15s; }
.mk-stat--link:hover { box-shadow: var(--doc-shadow-lift); transform: translateY(-1px); }
.mk-stats--inner { margin: 4px 0 18px; }
.mk-stats--inner .mk-stat { padding: 12px 16px; background: #F7F8F5; border-color: transparent; }
.mk-stats--inner .mk-stat-value { font-size: 22px; }

/* ── Panels ── */
.mk-panel {
  margin: 0 0 20px;
  padding: 20px 22px;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  background: var(--mk-panel);
  scroll-margin-top: 16px;
}

.mk-panel--flush { padding: 20px 0 6px; }
.mk-panel-pad { padding-inline-start: 22px; padding-inline-end: 22px; }
.mk-panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.mk-panel-head .kb-section-title { display: flex; align-items: center; gap: 10px; margin: 0; }
.mk-panel-head .kb-section-title .mk-chip { font-family: var(--font-mono); }
.mk-panel-aside { font-size: 12.5px; color: var(--doc-muted); }
.mk-panel-aside a { color: inherit; }
.mk-panel-note { margin: -4px 0 14px; max-width: 80ch; font-size: 13px; line-height: 1.55; color: var(--doc-muted); }
.mk-empty { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13.5px; color: var(--doc-muted); }
.mk-empty .doc-icon { color: var(--green); }
.mk-foot { margin: 10px 22px 10px; font-size: 12px; color: var(--doc-muted); }
.mk-panel:not(.mk-panel--flush) .mk-foot { margin-inline-start: 0; margin-inline-end: 0; }

.mk-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--mk-amber);
  color: var(--mk-amber-ink);
  font-size: 13px;
}

/* ── Tables, restyled to sit in a panel ── */
.mk-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mk-scroll .admin-table { min-width: 560px; }
.mk-scroll--boxed { border: 1px solid var(--doc-line); border-radius: 12px; margin-bottom: 8px; }
.mk-table { font-size: 13.5px; }

.mk-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--doc-line);
  background: #FAFBF8;
  font-size: 12px;
  font-weight: 600;
  color: var(--doc-muted);
  white-space: nowrap;
}

.mk-table td { padding: 11px 14px; border-bottom: 1px solid var(--doc-line); vertical-align: top; }
.mk-table tbody tr:last-child td { border-bottom: 0; }
.mk-table tbody tr:hover td { background: #F9FAF7; }
.mk-panel--flush .mk-table th:first-child,
.mk-panel--flush .mk-table td:first-child { padding-inline-start: 22px; }
.mk-panel--flush .mk-table th:last-child,
.mk-panel--flush .mk-table td:last-child { padding-inline-end: 22px; }
.mk-table .admin-table-muted { color: var(--doc-muted); }
.mk-app-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.mk-app-link:hover { color: var(--green-dark); text-decoration: underline; }
.mk-handle { font-size: 11.5px; margin-top: 2px; }
.mk-moved { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: #FFFFFF; text-align: center; }

.mk-num { text-align: end !important; font-variant-numeric: tabular-nums; }
.mk-nowrap { white-space: nowrap; }
.mk-break { overflow-wrap: anywhere; word-break: break-word; }
.mk-change { max-width: 420px; font-size: 13px; overflow-wrap: anywhere; }
.mk-change--before { color: var(--doc-muted); text-decoration: line-through; text-decoration-color: rgba(var(--ink-rgb), 0.25); }
.mk-ours td { background: rgba(14, 107, 74, 0.06); }
.mk-ours td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.mk-table tbody tr.mk-ours:hover td { background: rgba(14, 107, 74, 0.09); }
.mk-ad td:first-child { color: var(--doc-muted); }

.mk-actions { white-space: nowrap; }
.mk-inline { display: inline-block; margin: 0 4px 4px 0; }
.mk-failures-box > summary { cursor: pointer; color: var(--mk-amber-ink); font-weight: 600; }
.mk-failures { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12.5px; }
.mk-failures li + li { margin-top: 6px; }

/* ── The overview's keyword cards ── */
.mk-kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

.mk-kw {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 12px;
  background: #FFFFFF;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.mk-kw:hover { box-shadow: var(--doc-shadow-lift); transform: translateY(-1px); border-color: transparent; }
.mk-kw.is-ranked { background: linear-gradient(180deg, #F3FAF6, #FFFFFF 70%); border-color: rgba(14, 107, 74, 0.22); }
.mk-kw-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; }
.mk-kw-term { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: break-word; min-width: 0; }
.mk-kw-place { font-size: 24px; font-weight: 500; line-height: 1; color: var(--green); }
.mk-kw-place--none { font-size: 12.5px; font-weight: 500; color: var(--doc-muted); }
.mk-kw-ad { font-size: 11.5px; color: var(--doc-muted); }

.mk-term-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-term-chip { gap: 8px; height: 34px; }

/* ── One app ── */
.mk-tier-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 18px; }
.mk-tier-bar .mk-meta { margin: 0; }
.mk-tier-label { font-size: 12.5px; font-weight: 600; color: var(--doc-muted); }
.mk-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #ECEEE9; }
.mk-seg-form { display: inline-flex; margin: 0; }

.mk-seg-btn {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 600 12.5px/1 inherit;
  font-family: inherit;
  text-transform: capitalize;
  color: rgba(var(--ink-rgb), 0.7);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.mk-seg-btn:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.mk-seg-btn.is-active { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 20, 0.14); cursor: default; }
.mk-tier-who { font-size: 12.5px; }

.mk-jump { flex-wrap: wrap; margin: 0 0 18px; }

.mk-facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 13.5px; line-height: 1.5; }
.mk-facts dt { color: var(--doc-muted); font-weight: 600; font-size: 12.5px; padding-top: 1px; }
.mk-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mk-list { margin: 0; padding-inline-start: 18px; }
.mk-list li + li { margin-top: 2px; }
.mk-details { margin: 14px 0 4px; }
.mk-details > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 6px 0; }
.mk-prose { font-size: 13.5px; line-height: 1.6; max-width: 72ch; }
.mk-subhead { font: 600 14px/1.3 var(--font-display); margin: 22px 0 10px; }
.mk-panel-head + .mk-subhead { margin-top: 4px; }

.mk-gallery,
.mk-shots { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.mk-gallery figure,
.mk-shots figure { margin: 0; flex: 0 0 auto; }
.mk-gallery figcaption,
.mk-shots figcaption { font-size: 11.5px; margin-top: 6px; color: var(--doc-muted); }
.mk-thumb { display: block; width: 200px; height: 125px; object-fit: cover; border: 1px solid var(--doc-line); border-radius: 10px; background: #F2F3EF; }
.mk-thumb--none { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--doc-muted); text-decoration: none; }
.mk-shot { display: block; width: 240px; height: 340px; object-fit: cover; object-position: top; border: 1px solid var(--doc-line); border-radius: 10px; box-shadow: var(--doc-shadow); background: #F2F3EF; }
.mk-gallery a:has(.mk-thumb) { cursor: zoom-in; }

/* The gallery's full-screen view (lightbox_controller): one image fitted to
   the viewport on a dark surface, side arrows, counter and caption. */
.mk-lightbox { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0A0F0D; color: #fff; overflow: hidden; }
.mk-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.mk-lightbox::backdrop { background: transparent; }
html:has(.mk-lightbox[open]) { overflow: hidden; }
.mk-lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.mk-lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 72px; }
.mk-lightbox-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #F2F3EF; }
.mk-lightbox-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
.mk-lightbox-button:hover { background: rgba(255, 255, 255, 0.18); }
.mk-lightbox-button[hidden] { display: none; }
.mk-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.mk-lightbox-nav--prev { inset-inline-start: 16px; }
.mk-lightbox-nav--next { inset-inline-end: 16px; }
.mk-lightbox-caption { margin: 0; padding: 12px 16px 18px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.75); }

.mk-stars { display: grid; grid-template-columns: 44px minmax(0, 1fr) 56px; align-items: center; gap: 8px 12px; max-width: 520px; margin: 0 0 8px; }
.mk-stars-label { font-size: 12.5px; color: var(--doc-muted); }
.mk-stars-track { height: 8px; border-radius: 999px; background: #ECEEE9; overflow: hidden; }
.mk-stars-fill { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.78); }
.mk-stars-fill--3 { background: rgba(var(--ink-rgb), 0.4); }
.mk-stars-fill--2,
.mk-stars-fill--1 { background: #D99A1E; }
.mk-stars-count { font-size: 12.5px; text-align: end; }
.mk-review-group { border-top: 1px solid var(--doc-line); margin: 0; padding: 4px 0; }
.mk-review-group:first-of-type { margin-top: 14px; }
.mk-review { padding: 12px 0; border-top: 1px solid var(--doc-soft); font-size: 13.5px; max-width: 80ch; }
.mk-review p { margin: 6px 0 0; line-height: 1.55; }
.mk-review-meta { font-size: 12.5px; color: var(--doc-muted); }
.mk-review-meta strong { color: var(--ink); font-weight: 600; }
.mk-reply { padding-inline-start: 12px; border-inline-start: 2px solid var(--doc-tint); }

/* ── Our listing ── */
.mk-range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 4px 0 20px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: #ECEEE9;
  font-size: 13px;
  color: var(--doc-muted);
  width: fit-content;
  max-width: 100%;
}

.mk-range label { font-weight: 600; }
.mk-range-input { height: 32px; min-width: 0; padding: 0 10px; border: 1px solid var(--doc-line); border-radius: 999px; background: #FFFFFF; font: 13px var(--font-mono); color: var(--ink); }
.mk-range-note { font-size: 12px; padding-inline-end: 8px; }

/* ── The ads import ── */
.mk-drop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px dashed rgba(var(--ink-rgb), 0.2);
  border-radius: 14px;
  background: #FAFBF8;
}

.mk-drop-art { display: inline-flex; padding: 10px; border-radius: 50%; background: var(--doc-tint); color: var(--green); }
.mk-file { flex: 1; min-width: 0; max-width: 100%; font-size: 13px; }

/* ── The position chart ── */
.mk-chart { margin: 0 0 12px; max-width: 820px; }
.mk-chart svg { display: block; width: 100%; height: auto; }
.mk-chart-grid { stroke: rgba(var(--ink-rgb), 0.08); stroke-width: 1; }
.mk-chart-label { font-family: var(--font-mono); font-size: 10px; fill: rgba(var(--ink-rgb), 0.5); }
.mk-chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mk-chart-dot { fill: currentColor; }
.mk-chart-ad { fill: #FFFFFF; stroke: currentColor; stroke-width: 1.5; }
.mk-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-top: 8px; }
.mk-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.mk-chart-ad-key { display: inline-block; width: 8px; height: 8px; border: 1.5px solid rgba(var(--ink-rgb), 0.6); background: #FFFFFF; margin-inline-end: 5px; vertical-align: -1px; }
.mk-chart-empty { font-size: 13px; color: var(--doc-muted); margin: 0 0 14px; }

/* ── The marketplace switch, beside the title ── */
.mk-top { flex-wrap: wrap; row-gap: 14px; }
.mk-title-group { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; min-width: 0; }
.mk-switch { flex-wrap: wrap; gap: 6px; }
.mk-switch-chip { gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 600; background: #FFFFFF; }
.mk-switch-chip.is-active { box-shadow: inset 0 0 0 1.5px var(--green); }
.mk-switch-chip .mk-rail-count { margin-inline-start: 0; }
.mk-crumb-market { font-weight: 600; color: var(--ink); }
.mk-market-heading { margin-top: 4px; }

/* ── Our apps, one card per marketplace, on top of the overview ── */
.mk-our-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin: 10px 0 30px;
}

.mk-our-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  background: #FFFFFF;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.mk-our-card:hover { box-shadow: var(--doc-shadow-lift); transform: translateY(-1px); }
.mk-our-card.is-current { border-color: rgba(14, 107, 74, 0.35); background: linear-gradient(180deg, #F3FAF6, #FFFFFF 60%); }
.mk-our-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mk-our-card-name { font: 600 16px/1.2 var(--font-display); }
.mk-our-card-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.mk-our-card-facts dt { font-size: 11.5px; font-weight: 600; color: var(--doc-muted); }
.mk-our-card-facts dd { margin: 2px 0 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.mk-our-strong { font-size: 18px; font-weight: 500; color: var(--green); }
.mk-our-note { font-size: 12px; color: var(--doc-muted); }
.mk-our-card-empty { font-size: 13px; line-height: 1.5; color: var(--doc-muted); }
.mk-our-card-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--doc-soft); font-size: 12px; color: var(--doc-muted); }
.mk-our-due { color: var(--ink); font-weight: 600; }

/* A platform difference said once, not a warning. */
.mk-notice--quiet { background: #F2F3EF; color: var(--doc-muted); align-items: flex-start; line-height: 1.5; }
.mk-notice--quiet .doc-icon { flex-shrink: 0; margin-top: 2px; color: var(--green); }
.mk-placements { font-size: 12.5px; min-width: 160px; }
/* A table of a few short columns needs no sideways room on a phone. */
.mk-scroll .admin-table.mk-table--narrow { min-width: 0; }

/* The rail folds into one scrolling row of places and tiers; the keywords
   stay on the overview's cards. */
@media (max-width: 1000px) {
  .mk-rail { padding: 0 0 10px; overflow: visible; }
  .mk-rail-nav { flex-direction: row; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .mk-rail-group { display: contents; }
  .mk-rail-heading,
  .mk-rail-keywords { display: none; }
  .mk-rail-row { flex-shrink: 0; white-space: nowrap; border: 1px solid var(--doc-line); }
  .mk-rail-row > span:not(.mk-rail-count):not(.mk-rail-place):not(.mk-rail-dot) { flex: none; }
}

@media (max-width: 720px) {
  .admin-main--marketplaces.admin-main--doc { padding-inline-start: 16px; padding-inline-end: 16px; }
  .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mk-stat { padding: 12px 14px; }
  .mk-stat-value { font-size: 21px; }
  .mk-panel { padding: 16px; border-radius: 14px; }
  .mk-panel--flush { padding: 16px 0 4px; }
  .mk-panel-pad { padding-inline-start: 16px; padding-inline-end: 16px; }
  .mk-panel--flush .mk-table th:first-child,
  .mk-panel--flush .mk-table td:first-child { padding-inline-start: 16px; }
  .mk-foot { margin-inline-start: 16px; margin-inline-end: 16px; }
  .mk-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mk-facts dd { margin-bottom: 10px; }
  .mk-kw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-seg { max-width: 100%; overflow-x: auto; }
  .mk-range { border-radius: 16px; width: auto; }
  .mk-shot { width: 200px; height: 280px; }
  .mk-lightbox-stage { padding: 0 8px; }
  .mk-lightbox-nav { background: rgba(10, 15, 13, 0.6); }
  .mk-lightbox-nav--prev { inset-inline-start: 12px; }
  .mk-lightbox-nav--next { inset-inline-end: 12px; }
  .mk-our-apps { grid-template-columns: minmax(0, 1fr); }
  .mk-title-group { width: 100%; justify-content: space-between; }
}

/* ── /admin/outreach — cold emails, drawn in the Marketplaces frame (.mk):
   the tags and mailboxes down the rail, the month's numbers as tiles, the
   emails as rows in one panel. Green the further an email got; an
   objection is a dashed chip, never red. */
.ox-dot--reading { background: var(--green); }
.ox-dot--paused { border: 1.5px solid rgba(var(--ink-rgb), 0.45); }
.ox-dot--stopped { background: #D9A93F; }
.ox-rail-mailboxes .mk-rail-row { min-height: 30px; padding: 4px 14px; font-size: 12.5px; }

.ox-chip--replied { background: var(--green); color: #FFFFFF; }
.ox-status { text-transform: none; }
.ox-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ox-caveat { margin: -8px 0 22px; font-size: 12px; }
.ox-chips { flex-wrap: wrap; margin: 0 0 14px; }

.ox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 64px 64px 128px 84px;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--doc-line);
  font-size: 13px;
}

.ox-row--head {
  padding-top: 9px;
  padding-bottom: 9px;
  background: #FAFBF8;
  font-size: 12px;
  font-weight: 600;
  color: var(--doc-muted);
}

.ox-row:not(.ox-row--head):hover { background: #F7F8F5; }
.ox-email { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ox-subject { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.ox-subject:hover { color: var(--green-dark); text-decoration: underline; }
.ox-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--doc-muted); }
.ox-recipient { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ox-who a { color: inherit; }
.ox-who a:hover { color: var(--ink); }
.ox-platform { padding: 0 6px; border-radius: 999px; background: var(--doc-soft); font-size: 11.5px; white-space: nowrap; }
.ox-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ox-when { font-size: 12px; color: var(--doc-muted); white-space: nowrap; }
.ox-none { color: var(--doc-muted); }
.ox-actions { display: flex; justify-content: flex-end; }
.ox-delete { gap: 6px; }
.ox-pages { flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; border-top: 1px solid var(--doc-line); }

.ox-mailbox-list { margin: 0; padding: 0; list-style: none; }
.ox-mailbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--doc-line);
}

.ox-mailbox-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.ox-mailbox-address { font-size: 13px; overflow-wrap: anywhere; }
.ox-mailbox-error { flex-basis: 100%; }

.ox-meta .mail-tag { vertical-align: 1px; }
.ox-hits li + li { margin-top: 4px; }
.ox-hits { font-size: 13.5px; line-height: 1.5; }

@media (max-width: 1000px) {
  .ox-rail-mailboxes { display: none; }
}

@media (max-width: 860px) {
  .ox-row--head { display: none; }

  .ox-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "email email" "status actions" "opens clicks" "sent sent";
    gap: 6px 12px;
    padding: 14px 16px;
  }

  .ox-row > :nth-child(1) { grid-area: email; }
  .ox-row > :nth-child(2) { grid-area: status; }
  .ox-row > :nth-child(3) { grid-area: opens; }
  .ox-row > :nth-child(4) { grid-area: clicks; }
  .ox-row > :nth-child(5) { grid-area: sent; }
  .ox-row > :nth-child(6) { grid-area: actions; }
  .ox-row .ox-num::before,
  .ox-row > :nth-child(5)::before { font-size: 12px; color: var(--doc-muted); }
  .ox-row > :nth-child(3)::before { content: "Opens "; }
  .ox-row > :nth-child(4)::before { content: "Clicks "; }
  .ox-row > :nth-child(5)::before { content: "Sent "; }
}

@media (max-width: 720px) {
  .admin-main--outreach.admin-main--doc { padding-inline-start: 16px; padding-inline-end: 16px; }
}

/* ── /admin sidebar ─────────────────────────────────────────────────────
   Replaced the single row of links once there were twenty-one of them. Drawn
   like the Drive rail /admin/docs already uses: pill items on the desk tone,
   the active one tinted green, queue counts in ink. Folds to a 68px icon
   rail; below 900px it is a drawer behind a slim bar. */
.admin-shell {
  --anav-w: 248px;
  --anav-desk: #F4F5F1;
  --anav-line: rgba(var(--ink-rgb), 0.08);
  --anav-hover: rgba(var(--ink-rgb), 0.06);
  --anav-muted: rgba(var(--ink-rgb), 0.52);
  --anav-tint: #E5F2EB;
  display: grid;
  grid-template-columns: var(--anav-w) minmax(0, 1fr);
  align-items: start;
}

.admin-shell.is-compact { --anav-w: 68px; }

.anav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 12px;
  background: var(--anav-desk);
  border-inline-end: 1px solid var(--anav-line);
  overflow: hidden;
  z-index: 40;
}

.anav-icon { flex-shrink: 0; display: block; }

.anav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 4px 8px; min-height: 34px; }
.anav-logo { font-size: 17px; min-width: 0; white-space: nowrap; overflow: hidden; }
.anav-logo .app-topbar-logo-context {
  font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 6px; margin-inline-start: 2px; border-radius: 6px; background: rgba(var(--ink-rgb), 0.07); color: var(--anav-muted);
}

.anav-fold,
.anav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--anav-muted); cursor: pointer;
}
.anav-fold:hover,
.anav-burger:hover { background: var(--anav-hover); color: var(--ink); }

.anav-jump {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px 0 12px; margin: 0 0 4px;
  border: 1px solid var(--anav-line); border-radius: 999px; background: #FFFFFF;
  color: var(--anav-muted); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer;
  transition: box-shadow 0.15s;
}
.anav-jump:hover { box-shadow: 0 1px 2px rgba(16, 24, 20, 0.06), 0 4px 16px rgba(16, 24, 20, 0.06); color: var(--ink); }
.anav-jump span.anav-label { flex: 1; }
.anav-jump kbd,
.apal-hint kbd {
  font: 500 11px/1 var(--font-mono, "IBM Plex Mono", monospace);
  padding: 3px 6px; border-radius: 6px; border: 1px solid var(--anav-line); background: var(--anav-desk); color: var(--anav-muted);
}

.anav-nav {
  display: flex; flex-direction: column; gap: 4px;
  margin: 0; font-size: 13.5px;
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin;
}

.anav-group > summary { list-style: none; }
.anav-group > summary::-webkit-details-marker { display: none; }
.anav-group-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 3px; cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--anav-muted);
}
.anav-group-label .anav-icon { transition: transform 0.15s; opacity: 0.7; }
.anav-group[open] > .anav-group-label .anav-icon { transform: rotate(90deg); }
.anav-group-label:hover { color: var(--ink); }

.anav-nav a.anav-item {
  display: flex; align-items: center; gap: 12px;
  height: 30px; padding: 0 10px 0 12px; margin: 0;
  border-radius: 999px; color: rgba(var(--ink-rgb), 0.78); font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.anav-nav a.anav-item .anav-icon { color: var(--anav-muted); }
.anav-nav a.anav-item:hover { background: var(--anav-hover); color: var(--ink); }
.anav-nav a.anav-item.is-active { background: var(--anav-tint); color: var(--green-dark); font-weight: 600; }
.anav-nav a.anav-item.is-active .anav-icon { color: var(--green); }
.anav-item .anav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.anav-item .admin-nav-count { margin-inline-start: 0; }

.anav-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 0 6px; border-top: 1px solid var(--anav-line);
}
.anav-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--anav-muted); }
.anav-foot form { display: contents; }
.anav-signout {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--anav-muted); cursor: pointer;
}
.anav-signout .anav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.anav-signout:hover { background: var(--anav-hover); color: var(--ink); }

/* Folded: icons only; the group headers become a hairline between groups. */
.is-compact .anav { padding-inline-start: 10px; padding-inline-end: 10px; align-items: stretch; }
.is-compact .anav-label { display: none; }
.is-compact .anav-head { flex-direction: column; padding: 2px 0 8px; }
.is-compact .anav-logo { justify-content: center; }
.is-compact .anav-jump { justify-content: center; padding: 0; }
.is-compact .anav-group-label { padding: 0; margin: 8px 10px; height: 1px; background: var(--anav-line); font-size: 0; overflow: hidden; pointer-events: none; }
.is-compact .anav-group:not([open]) > .anav-item { display: none; }
.is-compact .anav-nav a.anav-item { position: relative; justify-content: center; padding: 0; }
.is-compact .anav-item .admin-nav-count { position: absolute; top: -2px; inset-inline-end: 2px; font-size: 9.5px; min-width: 15px; padding: 1px 4px; }
.is-compact .anav-foot { flex-direction: column; padding: 10px 0 0; }

/* Pages that fill the window measured it from under the old header. */
.admin-shell .admin-main { width: 100%; padding-top: 32px; }
.admin-shell .admin-main--doc,
.admin-shell .admin-main--mail { padding-top: 16px; }


.anav-bar,
.anav-scrim { display: none; }

@media (max-width: 900px) {
  .admin-shell,
  .admin-shell.is-compact { grid-template-columns: minmax(0, 1fr); --anav-w: 280px; }
  .anav-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30; padding: 8px 12px;
    background: var(--anav-desk); border-bottom: 1px solid var(--anav-line);
  }
  .anav {
    position: fixed; inset-inline-start: 0; top: 0; width: var(--anav-w);
    transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: 0 12px 32px rgba(16, 24, 20, 0.18);
  }
  .is-drawer-open .anav { transform: none; }
  .is-drawer-open .anav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 20, 0.32); }
  .anav-fold { display: none; }
  /* The drawer is always the full sidebar, whatever the desktop fold says. */
  .is-compact .anav-label { display: revert; }
  .is-compact .anav-head { flex-direction: row; }
  .is-compact .anav-group-label { padding: 8px 12px 3px; margin: 0; height: auto; background: none; font-size: 11px; pointer-events: auto; }
  .is-compact .anav-nav a.anav-item { justify-content: flex-start; padding: 0 10px 0 12px; }
  .is-compact .anav-item .admin-nav-count { position: static; }
  .is-compact .anav-jump { justify-content: flex-start; padding: 0 10px 0 12px; }
  .is-compact .anav-foot { flex-direction: row; }
  .admin-shell .admin-main { padding: 20px 16px; }
}

/* ── ⌘K palette ── */
.apal {
  width: min(600px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 120px));
  margin: 12vh auto auto; padding: 0; border: 0; border-radius: 16px; background: #FFFFFF; color: var(--ink);
  box-shadow: 0 2px 6px rgba(16, 24, 20, 0.08), 0 24px 64px rgba(16, 24, 20, 0.24);
  overflow: hidden;
}
.apal::backdrop { background: rgba(16, 24, 20, 0.28); }
.apal-box { display: flex; flex-direction: column; max-height: inherit; }
.apal-search { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.08); color: rgba(var(--ink-rgb), 0.5); }
.apal-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.apal-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.apal-row { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-size: 14px; color: rgba(var(--ink-rgb), 0.82); }
.apal-row .anav-icon { color: rgba(var(--ink-rgb), 0.5); }
.apal-row.is-cursor { background: #E5F2EB; color: #0A4F38; }
.apal-row.is-cursor .anav-icon { color: var(--green); }
.apal-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apal-meta { font-size: 12px; color: rgba(var(--ink-rgb), 0.45); }
.apal-empty { padding: 20px 12px; font-size: 14px; color: rgba(var(--ink-rgb), 0.5); text-align: center; }
.apal-hint { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 18px; border-top: 1px solid rgba(var(--ink-rgb), 0.08); font-size: 12px; color: rgba(var(--ink-rgb), 0.5); }
.apal-hint kbd + kbd { margin-inline-start: -2px; }
.apal-hint kbd:not(:first-child) { margin-inline-start: 8px; }
.apal-hint kbd + kbd:not(:first-child) { margin-inline-start: 0; }

/* ============================================================
   Cold lead — the store page as the hub of the conversation with one store
   (Admin::ColdLeadsController#show). Drawn in the frame Knowledge, Outreach
   and Docs share: the title and search pill across the top, then where the
   store stands and the one next step, then the record on the left and the
   activity on the right. Overdue is amber; red is never the store's state.
   ============================================================ */
.lead-page { max-width: 1240px; margin-top: 18px; }
.lead .mk-title-row { margin-top: 2px; }
.lead .kb-heading { margin-bottom: 6px; }
.lead-meta { margin-bottom: 14px; }
.lead-local .admin-mono { font-size: 12.5px; }
.lead-local.is-open { color: var(--green-dark); }

/* The three pills at the right of the title — Status, Outreach, Owner —
   each a <details> that names the answer and opens a menu of the choices. */
.lead-title-row { flex-wrap: wrap; gap: 12px 20px; }
.lead-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-menu { position: relative; }
.lead-menu-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 14px;
  border: 1px solid var(--doc-line); border-radius: 999px; background: var(--doc-paper);
  font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap;
  cursor: pointer; list-style: none; user-select: none;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.lead-menu-trigger::-webkit-details-marker { display: none; }
.lead-menu-trigger:hover { background: var(--doc-soft); border-color: rgba(var(--ink-rgb), 0.18); }
.lead-menu-trigger:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.lead-menu[open] .lead-menu-trigger { border-color: rgba(var(--ink-rgb), 0.22); box-shadow: 0 0 0 3px var(--doc-soft); }
.lead-menu-trigger-label { font-size: 12px; font-weight: 500; color: var(--doc-muted); }
.lead-menu-trigger-value { font-weight: 600; }
.lead-menu-trigger-aside { font-family: var(--font-mono); font-size: 12px; color: var(--doc-muted); }
/* A store out of the pipeline, or lost: the exit's quiet red. Success is the
   house green. Red here is a state of a store in the back office, not the
   brand's red-means-a-competitor rule, which is about what merchants see. */
.lead-menu-trigger--exit .lead-menu-trigger-value { color: var(--red); }
.lead-menu-trigger--won .lead-menu-trigger-value { color: var(--green-dark); }
.lead-menu-caret { color: var(--doc-muted); transition: transform 0.15s; }
.lead-menu[open] .lead-menu-caret { transform: rotate(180deg); }

.lead-menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30;
  width: 240px; max-width: calc(100vw - 32px); margin: 0; padding: 6px;
  background: var(--doc-paper); border: 1px solid var(--doc-line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16, 24, 20, 0.14), 0 2px 6px rgba(16, 24, 20, 0.06);
  animation: lead-menu-in 0.12s ease-out;
}
.lead-menu-panel--wide { width: 300px; }
.owner-menu .lead-menu-panel { width: 280px; }
@keyframes lead-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.lead-menu-head {
  margin: 4px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--doc-muted);
}
.lead-menu-group { margin: 0; }
.lead-menu-option {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; color: var(--ink); text-align: start; cursor: pointer;
}
.lead-menu-option:hover:not(:disabled), .lead-menu-option:focus-visible { background: var(--doc-hover); outline: none; }
.lead-menu-option.is-current { background: var(--doc-tint); cursor: default; }
.lead-menu-option-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.lead-menu-option--exit .lead-menu-option-name { color: var(--doc-muted); }
.lead-menu-option--exit:hover:not(:disabled) .lead-menu-option-name,
.lead-menu-option--exit.is-current .lead-menu-option-name { color: var(--red); }
.lead-menu-option--won.is-current .lead-menu-option-name,
.lead-menu-option--won:hover:not(:disabled) .lead-menu-option-name { color: var(--green-dark); }
.lead-menu-check { display: inline-flex; color: var(--green-dark); }
.lead-menu-rule { height: 1px; margin: 6px 4px; background: var(--doc-line); }
.lead-menu-foot { margin: 6px 8px 4px; font-size: 11.5px; color: var(--doc-muted); }
@media (max-width: 640px) { .lead-menu-panel { inset-inline-start: 0; inset-inline-end: auto; } }

/* The owner's pill carries an avatar, and the people in its menu an email. */
.owner-trigger { padding-inline-start: 4px; }
.owner-trigger .doc-avatar--sm { width: 28px; height: 28px; font-size: 11.5px; }
.owner-trigger.is-empty { color: var(--doc-muted); border-style: dashed; }
.owner-trigger-empty {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px dashed rgba(var(--ink-rgb), 0.28);
}
.owner-option-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.owner-option-email { font-size: 12px; color: var(--doc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-option-you {
  margin-inline-start: 4px; padding: 1px 6px; border-radius: 999px; background: var(--doc-soft);
  font-size: 10.5px; font-weight: 600; color: var(--doc-muted); vertical-align: 1px;
}
.owner-option-none { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 1px dashed rgba(var(--ink-rgb), 0.28); }

/* The owner in the list: the same avatar, smaller, beside the name. */
.crm-row-owner .doc-avatar { margin-inline-end: 6px; vertical-align: -4px; }
.crm-row-owner { white-space: nowrap; }

/* Later's day, as a row of the Outreach menu: a label, the date and the
   button that sets it. Waiting for a day is not a warning — the list and the
   next step turn amber only once the day has passed. */
.lead-later { display: flex; align-items: center; gap: 6px; padding: 4px 8px; }
.lead-later-label { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.lead-later-day { width: 132px; min-width: 0; flex: none; height: 31px; padding: 2px 8px; font-size: 12.5px; font-family: var(--font-mono); }

/* The traffic estimate: label left, number right, what it means on hover. */
.lead-traffic { display: grid; gap: 0; margin: 0 0 6px; }
.lead-traffic-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--doc-line); cursor: help; }
.lead-traffic-row:last-child { border-bottom: 0; }
.lead-traffic dt { font-size: 13.5px; }
.lead-traffic dd { margin: 0; font-size: 13px; white-space: nowrap; }

/* The next step: one strip, one sentence, at most two buttons. */
.lead-next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  padding: 16px 20px;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: var(--doc-shadow);
}
.lead-next-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--doc-tint);
  color: var(--green-dark);
}
.lead-next--warn { border-color: rgba(122, 82, 0, 0.28); background: #FFFCF4; }
.lead-next--warn .lead-next-icon { background: var(--mk-amber); color: var(--mk-amber-ink); }
.lead-next--quiet { box-shadow: none; background: #F7F8F5; }
.lead-next--quiet .lead-next-icon { background: var(--doc-soft); color: var(--doc-muted); }
.lead-next--ours { border-color: rgba(14, 107, 74, 0.3); }
.lead-next-line { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.lead-next-line .mk-chip { margin: 0 4px; }
.lead-next-line .lead-time { font-size: 13px; }
.lead-next-their { color: var(--doc-muted); font-size: 13px; }
.lead-next-quote { color: rgba(var(--ink-rgb), 0.8); }
.lead-next-touch { margin: 3px 0 0; font-size: 12.5px; color: var(--doc-muted); }
.lead-next-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lead-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.lead-actions .outreach-inline-form { display: inline-flex; }
.lead .doc-btn--sm { white-space: nowrap; }

/* Two columns: the record wide, the activity beside it. */
.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 40%);
  grid-template-areas: "record side";
  gap: 22px;
  align-items: start;
}
.lead-record { grid-area: record; display: block; }
.lead-side { grid-area: side; position: static; max-height: none; overflow: visible; }
.lead .mk-panel-head { margin-bottom: 8px; }

.lead-contacts .crm-contact { padding: 12px 0; border-top: 1px solid var(--doc-line); }
.lead-contacts .crm-contact:first-of-type { border-top: 0; padding-top: 0; }
.lead-contacts .crm-card-actions { margin-top: 8px; }

/* Research: the old cards, flattened into one panel. */
.lead-research .crm-description { margin: 0 0 14px; font-size: 13.5px; color: rgba(var(--ink-rgb), 0.78); }
.lead-research .crm-panel {
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--doc-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.lead-research .crm-panel-title { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.lead-fold > summary { cursor: pointer; list-style: none; }
.lead-fold > summary::-webkit-details-marker { display: none; }
.lead-fold > summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--doc-muted); }
.lead-fold[open] > summary::before { content: "▾"; }
.lead-fold[open] > summary { margin-bottom: 10px; }

/* Activity. */
.lead-subhead, .lead-day {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--doc-muted);
}
.lead-day { margin-top: 16px; }
.lead-upcoming { margin: 0 0 14px; padding: 10px 12px 8px; border-radius: 12px; background: #F7F8F5; }
.lead-upcoming-list, .lead-feed, .lead-thread, .lead-transcript, .lead-history-list { list-style: none; margin: 0; padding: 0; }
.lead-upcoming-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13.5px;
}
.lead-upcoming-link:hover { background: #FFFFFF; }
.lead-upcoming-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-upcoming-when { font-size: 12px; color: var(--doc-muted); white-space: nowrap; }
.lead-chevron { color: var(--doc-muted); }
.lead-more { margin: 4px 4px 0; font-size: 12px; color: var(--doc-muted); }

.lead-dot {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--doc-soft);
  color: rgba(var(--ink-rgb), 0.7);
}
.lead-upcoming .lead-dot { width: 22px; height: 22px; background: #FFFFFF; }

.lead-note-form { margin: 0 0 12px; }
.lead-note-input { width: 100%; min-height: 0; resize: vertical; border-radius: 10px; }
.lead-note-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

.lead-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--doc-line); }
.lead-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--doc-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  background: #FFFFFF;
}
.lead-filter:hover { background: #F7F8F5; }
.lead-filter.is-active { background: var(--doc-tint); border-color: transparent; color: var(--green-dark); font-weight: 600; }
.lead-filter.is-empty:not(.is-active) { color: var(--doc-muted); }
.lead-filter-count { font-size: 11.5px; color: var(--doc-muted); }
.lead-empty { margin: 14px 0 4px; }

.lead-entry {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--doc-line);
}
.lead-feed > .lead-entry:last-child { border-bottom: 0; }
.lead-entry-box > summary { list-style: none; cursor: pointer; }
.lead-entry-box > summary::-webkit-details-marker { display: none; }
.lead-entry-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lead-entry-title { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.lead-entry-meta { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--doc-muted); }
.lead-time { font-size: 12px; }
.lead-initials {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 600;
}
.lead-entry-box[open] .lead-entry-summary { margin-bottom: 10px; }
.lead-thread { display: grid; gap: 8px; }
.lead-message { padding: 10px 12px; border-radius: 10px; background: #F7F8F5; font-size: 13px; }
.lead-message--theirs { background: var(--doc-tint); }
.lead-message.is-bounce { background: var(--mk-amber); }
.lead-message-head { margin: 0 0 4px; font-size: 12px; color: var(--doc-muted); overflow-wrap: anywhere; }
.lead-message-body { max-height: 15em; overflow: hidden; overflow-wrap: anywhere; }
.lead-message-body p { margin: 0 0 6px; }
.lead-call { display: grid; gap: 8px; font-size: 13px; }
.lead-call-heard { margin: 0; color: var(--doc-muted); }
.lead-audio { width: 100%; }
.lead-transcript { display: grid; gap: 4px; max-height: 18em; overflow: hidden; font-size: 13px; }
.lead-transcript .is-ours strong { color: var(--green-dark); }
.lead-entry-open { margin: 8px 0 0; font-size: 12.5px; }
.lead-entry--note .crm-note-head { display: flex; justify-content: space-between; align-items: center; }
.lead-entry--note .crm-note-meta { margin: 0; font-size: 12px; color: var(--doc-muted); }
.lead-entry--note .crm-note-body { grid-column: 2; font-size: 13.5px; }
.lead-entry--note > :not(.lead-dot) { grid-column: 2; }

.lead-history { padding: 16px 22px; }
.lead-history-title { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 15px; }
.lead-history-title::-webkit-details-marker { display: none; }
.lead-history-list { display: grid; gap: 4px; margin: 12px 0; font-size: 12.5px; }
.lead-history-who { color: var(--doc-muted); }

@media (max-width: 1100px) {
  .lead-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "record"; }
}

@media (max-width: 640px) {
  .lead-next { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .lead-next-actions { grid-column: 1 / -1; justify-content: stretch; }
  .lead-next-actions > *, .lead-next-actions .lead-actions, .lead-next-actions .lead-actions > * { flex: 1 1 auto; }
  .lead .mk-panel { padding: 16px; }
  .lead-history { padding: 14px 16px; }
}
.lead-entry.crm-note { padding: 10px 0; border: 0; border-bottom: 1px solid var(--doc-line); border-radius: 0; background: transparent; }
.lead-entry.crm-note--agent { border-inline-start: 0; padding-inline-start: 0; }
.lead-entry--note .crm-note-author { margin: 0; font-size: 12px; color: var(--doc-muted); }
.lead-entry--note .crm-note-body { margin-top: 2px; }
.lead-note-controls[hidden] { display: none; }
.lead-entry-box, .lead-entry-summary, .lead-entry-meta { min-width: 0; overflow-wrap: anywhere; }
.lead-entry--note .crm-note-head { min-width: 0; gap: 8px; }
.lead-entry--note .crm-note-meta { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 640px) {
  .lead-upcoming-link { flex-wrap: wrap; }
  .lead-upcoming-title { flex-basis: 100%; order: 3; white-space: normal; padding-inline-start: 30px; }
}
.lead-empty-line { margin: 0 0 10px; }

/* Evidence page: the dispute's tracking numbers and "Add a tracking number"
   (app/views/app/disputes/_tracking_numbers.html.erb). */
.app-tracking-numbers .app-evidence-files { margin-bottom: 16px; }
.app-tracking-number { font-family: var(--font-mono); overflow-wrap: anywhere; }
.app-tracking-remove { display: contents; }
.app-tracking-rows { display: grid; gap: 8px; }
.app-tracking-row { display: flex; align-items: center; gap: 8px; }
.app-console-form-field .app-tracking-row .app-tracking-row-carrier { flex: 0 0 150px; width: 150px; }
.app-console-form-field .app-tracking-row .app-tracking-row-number { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); }
.app-tracking-add-row { margin-top: 10px; }
@media (max-width: 480px) {
  .app-console-form-field .app-tracking-row .app-tracking-row-carrier { flex-basis: 110px; width: 110px; }
}

/* Who answers (/admin/answer-checks): the robot's list, in store research's
   three panes. Only what that layout doesn't already style. */
.answer-checks-setup { margin: 0 0 8px; }
.answer-checks-numbers { min-height: 96px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; resize: vertical; }
.answer-checks-transcript {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(var(--ink-rgb), 0.04);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.answer-checks-audio { display: block; width: 100%; max-width: 360px; height: 36px; }
.answer-checks .mail-dialog input[type="datetime-local"] { flex: 0 1 auto; width: auto; max-width: 100%; }
.answer-checks .mail-dialog .admin-table-muted { font-size: 12.5px; }
