:root {
  --ifv-ui-colors-primary: #1c65ff;
  --ifv-ui-colors-primary-deep: #1c4de0;
  --ifv-ui-colors-primary-soft: #5fa0ff;
  --ifv-ui-colors-muted: #5a6486;
  --ifv-ui-colors-white: #ffffff;
  --ifv-ui-radius-pill: 48px;
  --ifv-ui-radius-card: 28px;
  --ifv-ui-border-soft: rgba(15, 23, 42, 0.09);
  --ifv-ui-shadow-pop: 0 20px 45px rgba(15, 23, 42, 0.18);
  --ifv-ui-blur-surface: 32px;
}

.ifv-theme-shell {
  background: 
    radial-gradient(circle at 15% 20%, rgba(92, 136, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.6), transparent 40%),
    radial-gradient(circle at 30% 80%, rgba(17, 113, 239, 0.18), transparent 35%),
    #f9fbff;
  min-height: 100vh;
  padding: 40px;
}

.ifv-theme-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--ifv-ui-radius-card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--ifv-ui-shadow-pop);
  padding: 28px;
  backdrop-filter: blur(var(--ifv-ui-blur-surface));
}

.ifv-theme-card--highlight {
  border: 1px solid rgba(17, 113, 239, 0.15);
  background: rgba(255, 255, 255, 0.9);
}

.ifv-theme-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.ifv-theme-nav-wrapper {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(33, 82, 255, 0.14);
  border-radius: var(--ifv-ui-radius-pill);
  padding: 4px;
  box-shadow: 0 16px 45px rgba(17, 113, 239, 0.25);
  backdrop-filter: blur(var(--ifv-ui-blur-surface));
}

.ifv-theme-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.ifv-nav-link {
  border-radius: calc(var(--ifv-ui-radius-pill) - 6px);
  padding: 8px 18px;
  font-weight: 600;
  color: var(--ifv-ui-colors-muted);
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

a.ifv-nav-link:hover,
a.ifv-nav-link:focus-visible,
button.ifv-nav-link:hover,
button.ifv-nav-link:focus-visible {
  color: var(--ifv-ui-colors-primary-deep);
  border-color: rgba(33, 82, 255, 0.2);
  text-decoration: none;
}

.ifv-nav-link.ifv-nav-link-active,
.ifv-nav-link.active {
  background: linear-gradient(135deg, var(--ifv-ui-colors-primary-deep), var(--ifv-ui-colors-primary-soft));
  color: var(--ifv-ui-colors-white);
  box-shadow: 0 8px 28px rgba(23, 37, 84, 0.25);
}

.ifv-theme-info-panel {
  border-radius: var(--ifv-ui-radius-card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
  padding: 22px 26px;
}

.ifv-theme-search-card {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.ifv-theme-search-card input,
.ifv-theme-search-card .form-control {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 16px 20px;
  font-size: 1rem;
  box-shadow: inset 0 18px 32px rgba(15, 23, 42, 0.04);
}

.ifv-theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.ifv-theme-option {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ifv-ui-colors-muted);
  transition: border 0.2s ease, transform 0.2s ease;
}

.ifv-theme-option:hover,
.ifv-theme-option:focus-visible {
  border-color: var(--ifv-ui-colors-primary);
  transform: translateY(-1px);
}

.ifv-theme-option svg {
  width: 22px;
  height: 22px;
  color: var(--ifv-ui-colors-primary);
}

@supports (backdrop-filter: blur(0)) {
  .ifv-theme-nav-wrapper,
  .ifv-theme-card {
    backdrop-filter: blur(var(--ifv-ui-blur-surface));
  }
}

/* Company Setup helpers ------------------------------------------------- */
.company-setup-shell {
  width: 100%;
  padding: 48px 24px 72px;
  display: flex;
  justify-content: center;
}

.company-setup-shell__inner {
  width: min(var(--container, 1380px), 100%);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.company-setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 32px;
  flex-wrap: wrap;
}

.company-setup-header__brand {
  max-width: 480px;
}

.company-setup-header__nav {
  flex: 1;
  min-width: 260px;
  display: flex;
  justify-content: flex-end;
}

.company-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 260px);
  gap: 24px;
  align-items: flex-start;
}

.company-setup-progress-card {
  position: sticky;
  top: 32px;
  align-self: start;
}

.company-setup-main-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.company-setup-main-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
}

.company-setup-main-card__body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.company-setup-helper-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.company-setup-helper-card {
  padding: 24px;
}

.company-setup-mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--ifv-ui-radius-pill);
  padding: 4px;
  gap: 6px;
}

.company-setup-mode-switch .company-setup-mode-btn {
  flex: 1;
  border-radius: calc(var(--ifv-ui-radius-pill) - 8px);
  padding: 8px 0;
  font-weight: 600;
  color: var(--ifv-ui-colors-muted);
  border: 1px solid transparent;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.company-setup-mode-switch .company-setup-mode-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.company-setup-mode-switch .company-setup-mode-btn.ifv-nav-link-active {
  background: linear-gradient(135deg, var(--ifv-ui-colors-primary-deep), var(--ifv-ui-colors-primary-soft));
  color: var(--ifv-ui-colors-white);
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(17, 113, 239, 0.25);
}

.company-setup-mode-switch .company-setup-mode-btn:hover {
  border-color: rgba(15, 23, 42, 0.2);
}

.company-setup-structure-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.98));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}

.company-setup-structure-search {
  background: transparent;
  padding: 0;
  border: none;
}

.company-setup-structure-search p {
  margin-bottom: 8px;
}

.company-setup-structure-content {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: flex-start;
}

.company-setup-structure-list {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  max-height: 500px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
}

.company-setup-structure-item {
  border-radius: 14px;
  margin: 6px 0;
  padding: 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid transparent;
}

.company-setup-structure-item.active,
.company-setup-structure-item:hover {
  border-color: rgba(28, 101, 255, 0.45);
  background: rgba(28, 101, 255, 0.08);
  transform: translateY(-1px);
}

.company-setup-structure-details {
  min-height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.company-setup-help-panel {
  margin-top: 18px;
}

.company-setup-help-card .company-setup-help-placeholder {
  text-align: center;
}

.company-setup-help-placeholder button {
  min-width: 180px;
}

@media (max-width: 1200px) {
  .company-setup-grid {
    grid-template-columns: 1fr;
  }

  .company-setup-progress-card {
    position: relative;
    top: auto;
  }

  .company-setup-structure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .company-setup-shell {
    padding: 36px 16px 64px;
  }

  .company-setup-header__nav {
    justify-content: flex-start;
  }

  .company-setup-structure-list {
    max-height: 360px;
  }
}

/* Live bank sync status
   ------------------------------------------------------------------
   The card region that follows a sync while it runs. The spinner is
   decoration: the state is announced in text through role="status", so a
   reader that never sees the spinner loses nothing. */
.bank-sync-status {
  display: block;
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--ifv-border, #d9dee7);
  border-radius: 0.6rem;
  background: var(--ifv-surface-muted, #f7f9fc);
}

.bank-sync-status--running,
.bank-sync-status--queued { border-color: #9db4d8; }
.bank-sync-status--completed { border-color: #8fbf9f; }
.bank-sync-status--stopped_safely { border-color: #d8c48f; }
.bank-sync-status--on_hold { border-color: #d8c48f; }
.bank-sync-status--failed,
.bank-sync-status--stalled { border-color: #d8a19b; }

.bank-sync-status__headline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
}

.bank-sync-status__detail {
  margin: 0;
  color: var(--ifv-text-muted, #4d5668);
}

.bank-sync-status__spinner {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  border: 2px solid var(--ifv-border, #d9dee7);
  border-top-color: var(--ifv-accent, #2f5fd0);
  border-radius: 50%;
  animation: bank-sync-spin 900ms linear infinite;
}

.bank-sync-status__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.4rem 1rem;
  margin: 0.6rem 0 0;
}

.bank-sync-status__facts dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ifv-text-muted, #4d5668);
}

.bank-sync-status__facts dd { margin: 0; font-weight: 600; }

/* The WCAG 2.2.2 stop control and its companion, outside the live region the
   poll rewrites. */
.bank-sync-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
}

@keyframes bank-sync-spin { to { transform: rotate(360deg); } }

/* A turning ring is exactly the motion someone may have asked not to see. The
   state still reads correctly without it. */
@media (prefers-reduced-motion: reduce) {
  .bank-sync-status__spinner {
    animation: none;
    border-top-color: var(--ifv-accent, #2f5fd0);
    border-right-color: var(--ifv-accent, #2f5fd0);
  }
}

trix-editor {
  border: 1px solid #bbb;
  border-radius: 3px;
  margin: 0;
  padding: 0.4em 0.6em;
  min-height: 5em;
  outline: none;
}

trix-toolbar * {
  box-sizing: border-box;
}
trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  overflow-x: auto;
}
trix-toolbar .trix-button-group {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid #bbb;
  border-top-color: #ccc;
  border-bottom-color: #888;
  border-radius: 3px;
}
trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 1.5vw;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button-group:not(:first-child) {
    margin-left: 0;
  }
}
trix-toolbar .trix-button-group-spacer {
  flex-grow: 1;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button-group-spacer {
    display: none;
  }
}
trix-toolbar .trix-button {
  position: relative;
  float: left;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.5em;
  margin: 0;
  outline: none;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  background: transparent;
}
trix-toolbar .trix-button:not(:first-child) {
  border-left: 1px solid #ccc;
}
trix-toolbar .trix-button.trix-active {
  background: #cbeefa;
  color: rgb(0, 0, 0);
}
trix-toolbar .trix-button:not(:disabled) {
  cursor: pointer;
}
trix-toolbar .trix-button:disabled {
  color: rgba(0, 0, 0, 0.125);
}
@media (max-width: 768px) {
  trix-toolbar .trix-button {
    letter-spacing: -0.01em;
    padding: 0 0.3em;
  }
}
trix-toolbar .trix-button--icon {
  font-size: inherit;
  width: 2.6em;
  height: 1.6em;
  max-width: calc(0.8em + 4vw);
  text-indent: -9999px;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button--icon {
    height: 2em;
    max-width: calc(0.8em + 3.5vw);
  }
}
trix-toolbar .trix-button--icon::before {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.6;
  content: "";
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button--icon::before {
    right: 6%;
    left: 6%;
  }
}
trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}
trix-toolbar .trix-button--icon:disabled::before {
  opacity: 0.125;
}
trix-toolbar .trix-button--icon-attach::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  top: 8%;
  bottom: 4%;
}
trix-toolbar .trix-button--icon-bold::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-italic::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-link::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-strike::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-quote::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-heading-1::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-code::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-bullet-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-number-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-undo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-redo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-decrease-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-increase-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-dialogs {
  position: relative;
}
trix-toolbar .trix-dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-size: 0.75em;
  padding: 15px 10px;
  background: #fff;
  box-shadow: 0 0.3em 1em #ccc;
  border-top: 2px solid #888;
  border-radius: 5px;
  z-index: 5;
}
trix-toolbar .trix-input--dialog {
  font-size: inherit;
  font-weight: normal;
  padding: 0.5em 0.8em;
  margin: 0 10px 0 0;
  border-radius: 3px;
  border: 1px solid #bbb;
  background-color: #fff;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
trix-toolbar .trix-input--dialog.validate:invalid {
  box-shadow: #F00 0px 0px 1.5px 1px;
}
trix-toolbar .trix-button--dialog {
  font-size: inherit;
  padding: 0.5em;
  border-bottom: none;
}
trix-toolbar .trix-dialog--link {
  max-width: 600px;
}
trix-toolbar .trix-dialog__link-fields {
  display: flex;
  align-items: baseline;
}
trix-toolbar .trix-dialog__link-fields .trix-input {
  flex: 1;
}
trix-toolbar .trix-dialog__link-fields .trix-button-group {
  flex: 0 0 content;
  margin: 0;
}

trix-editor [data-trix-mutable]:not(.attachment__caption-editor) {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

trix-editor [data-trix-mutable] ::-moz-selection, trix-editor [data-trix-mutable]::-moz-selection,
trix-editor [data-trix-cursor-target]::-moz-selection {
  background: none;
}
trix-editor [data-trix-mutable] ::selection, trix-editor [data-trix-mutable]::selection,
trix-editor [data-trix-cursor-target]::selection {
  background: none;
}

trix-editor [data-trix-mutable].attachment__caption-editor:focus::-moz-selection {
  background: highlight;
}
trix-editor [data-trix-mutable].attachment__caption-editor:focus::selection {
  background: highlight;
}

trix-editor [data-trix-mutable].attachment.attachment--file {
  box-shadow: 0 0 0 2px highlight;
  border-color: transparent;
}
trix-editor [data-trix-mutable].attachment img {
  box-shadow: 0 0 0 2px highlight;
}
trix-editor .attachment {
  position: relative;
}
trix-editor .attachment:hover {
  cursor: default;
}
trix-editor .attachment--preview .attachment__caption:hover {
  cursor: text;
}
trix-editor .attachment__progress {
  position: absolute;
  z-index: 1;
  height: 20px;
  top: calc(50% - 10px);
  left: 5%;
  width: 90%;
  opacity: 0.9;
  transition: opacity 200ms ease-in;
}
trix-editor .attachment__progress[value="100"] {
  opacity: 0;
}
trix-editor .attachment__caption-editor {
  display: inline-block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  text-align: center;
  vertical-align: top;
  border: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
trix-editor .attachment__toolbar {
  position: absolute;
  z-index: 1;
  top: -0.9em;
  left: 0;
  width: 100%;
  text-align: center;
}
trix-editor .trix-button-group {
  display: inline-flex;
}
trix-editor .trix-button {
  position: relative;
  float: left;
  color: #666;
  white-space: nowrap;
  font-size: 80%;
  padding: 0 0.8em;
  margin: 0;
  outline: none;
  border: none;
  border-radius: 0;
  background: transparent;
}
trix-editor .trix-button:not(:first-child) {
  border-left: 1px solid #ccc;
}
trix-editor .trix-button.trix-active {
  background: #cbeefa;
}
trix-editor .trix-button:not(:disabled) {
  cursor: pointer;
}
trix-editor .trix-button--remove {
  text-indent: -9999px;
  display: inline-block;
  padding: 0;
  outline: none;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.8em;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid highlight;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25);
}
trix-editor .trix-button--remove::before {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.7;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 90%;
}
trix-editor .trix-button--remove:hover {
  border-color: #333;
}
trix-editor .trix-button--remove:hover::before {
  opacity: 1;
}
trix-editor .attachment__metadata-container {
  position: relative;
}
trix-editor .attachment__metadata {
  position: absolute;
  left: 50%;
  top: 2em;
  transform: translate(-50%, 0);
  max-width: 90%;
  padding: 0.1em 0.6em;
  font-size: 0.8em;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
}
trix-editor .attachment__metadata .attachment__name {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
trix-editor .attachment__metadata .attachment__size {
  margin-left: 0.2em;
  white-space: nowrap;
}

.trix-content {
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
.trix-content * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.trix-content h1 {
  font-size: 1.2em;
  line-height: 1.2;
}
.trix-content blockquote {
  border: 0 solid #ccc;
  border-left-width: 0.3em;
  margin-left: 0.3em;
  padding-left: 0.6em;
}
.trix-content [dir=rtl] blockquote,
.trix-content blockquote[dir=rtl] {
  border-width: 0;
  border-right-width: 0.3em;
  margin-right: 0.3em;
  padding-right: 0.6em;
}
.trix-content li {
  margin-left: 1em;
}
.trix-content [dir=rtl] li {
  margin-right: 1em;
}
.trix-content pre {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  font-family: monospace;
  font-size: 0.9em;
  padding: 0.5em;
  white-space: pre;
  background-color: #eee;
  overflow-x: auto;
}
.trix-content img {
  max-width: 100%;
  height: auto;
}
.trix-content .attachment {
  display: inline-block;
  position: relative;
  max-width: 100%;
}
.trix-content .attachment a {
  color: inherit;
  text-decoration: none;
}
.trix-content .attachment a:hover, .trix-content .attachment a:visited:hover {
  color: inherit;
}
.trix-content .attachment__caption {
  text-align: center;
}
.trix-content .attachment__caption .attachment__name + .attachment__size::before {
  content: " •";
}
.trix-content .attachment--preview {
  width: 100%;
  text-align: center;
}
.trix-content .attachment--preview .attachment__caption {
  color: #666;
  font-size: 0.9em;
  line-height: 1.2;
}
.trix-content .attachment--file {
  color: #333;
  line-height: 1;
  margin: 0 2px 2px 2px;
  padding: 0.4em 1em;
  border: 1px solid #bbb;
  border-radius: 5px;
}
.trix-content .attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}
.trix-content .attachment-gallery .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}
.trix-content .attachment-gallery.attachment-gallery--2 .attachment, .trix-content .attachment-gallery.attachment-gallery--4 .attachment {
  flex-basis: 50%;
  max-width: 50%;
}
/*
 * Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
 * the trix-editor content (whether displayed or under editing). Feel free to incorporate this
 * inclusion directly in any other asset bundle and remove this file.
 *

*/

/*
 * We need to override trix.css’s image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}
/*
 * Business email workspace.
 *
 * Presentation-only styles for the tabbed Business email connection screen.
 * Everything here builds on the shared DII vocabulary (`.card`, `.dii-card`,
 * `.section-head`, `.status-badge`, `.dashboard-tab-*`) rather than introducing
 * a parallel component system. Every card-like surface below has an explicit
 * padded body, per CODEX/ui_rules.md.
 */

/* ---------------------------------------------------------------- Shared button */

/* `.button--danger` is already used by practice and mailbox destructive actions
   but had no treatment, so destructive buttons read as ordinary secondary ones. */
.button--danger {
  background: linear-gradient(135deg, #e11d48, #b91c1c);
  border-color: rgba(185, 28, 28, 0.35);
  color: #ffffff;
}

.button--danger:hover,
.button--danger:focus-visible {
  background: linear-gradient(135deg, #be123c, #991b1b);
  color: #ffffff;
}

/*
 * `.card-actions .button_to > .button` resets `min-height` to auto, which drops
 * these actions below the 44px touch target the mailbox screens are held to.
 */
.mailbox-workspace .card-actions .button_to > .business-email-action,
.mailbox-workspace .card-actions .business-email-action {
  min-height: 44px;
}

/* ------------------------------------------------------------------- Page header */

.mailbox-workspace-header .mailbox-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.mailbox-status-pill {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.32rem 0.72rem;
  font-size: 0.82rem;
  line-height: 1.25;
}

.mailbox-status-pill__provider {
  font-weight: 800;
  color: var(--ink-strong);
}

.mailbox-status-pill__state {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mailbox-status-pill::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.mailbox-status-pill--ok::before {
  background: var(--ok);
}

.mailbox-status-pill--warn::before {
  background: var(--warn);
}

.mailbox-status-pill--warn {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(254, 243, 199, 0.6);
}

.mailbox-inline-link {
  font-weight: 700;
}

/* `.section-head` is a grid, so an eyebrow would stretch the full card width. */
.mailbox-workspace .section-head > .eyebrow {
  justify-self: start;
}

/* -------------------------------------------------------------------- Tab shell */

.mailbox-workspace {
  display: grid;
  gap: var(--workspace-gap, 24px);
  min-width: 0;
}

/*
 * `.dii-card` carries padding but no surface of its own, so these panels read as
 * bare page background. Give them the shared white card treatment and move all
 * padding onto the explicit `.dii-card__body`, per the padded-body rule.
 */
.mailbox-workspace .dii-card {
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg, 28px);
  background: var(--surface-strong, #ffffff);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

/*
 * Progressive enhancement: the tab strip is only shown once the Stimulus
 * controller has connected and marked the shell. With JavaScript disabled no
 * panel is ever hidden, so the page degrades to plain sequential sections
 * instead of dead buttons over collapsed content.
 */
.mailbox-tabs:not(.is-tabbed) > .dashboard-tab-list {
  display: none;
}

.mailbox-tabs > .dashboard-tab-list {
  position: sticky;
  top: 8px;
  z-index: 3;
  backdrop-filter: blur(10px);
}

.mailbox-tabs .dashboard-tab-button {
  flex: 1 1 auto;
  justify-content: space-between;
  text-align: left;
}

/* --------------------------------------------------------------- Review queue */

/* Overrides `.section-head { display: grid }` so the primary action can sit
   beside the queue heading instead of below it. */
.mailbox-workspace .mailbox-queue-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.mailbox-workspace .mailbox-queue-head > div {
  flex: 1 1 300px;
  min-width: 0;
}

.mailbox-workspace .mailbox-queue-head__actions {
  flex: 0 0 auto;
}

.mailbox-queue-head__actions {
  margin: 0;
}

.mailbox-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md, 20px);
  background: rgba(248, 251, 255, 0.8);
  padding: 24px;
  text-align: center;
}

.mailbox-empty p {
  margin: 0 0 6px;
  color: var(--muted);
}

.mailbox-empty p:last-child {
  margin-bottom: 0;
}

.mailbox-queue {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  min-width: 0;
}

.mailbox-candidate {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md, 20px);
  background: var(--surface-strong, #fff);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

/* Category is the strongest triage signal, so it also drives a colour spine. */
.mailbox-candidate::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--mailbox-category-colour, #94a3b8);
}

.mailbox-candidate__body {
  padding: 18px 18px 18px 22px;
}

.mailbox-candidate--dismissed,
.mailbox-candidate--unavailable,
.mailbox-candidate--redacted {
  opacity: 0.72;
}

.mailbox-candidate__top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.mailbox-category {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.66rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mailbox-category-colour, #475569);
  background: var(--mailbox-category-tint, rgba(148, 163, 184, 0.16));
  border: 1px solid var(--mailbox-category-tint, rgba(148, 163, 184, 0.16));
}

.mailbox-workspace [data-category="sales_invoice"] {
  --mailbox-category-colour: #047857;
  --mailbox-category-tint: rgba(4, 120, 87, 0.12);
}

.mailbox-workspace [data-category="supplier_bill_or_expense"] {
  --mailbox-category-colour: #b45309;
  --mailbox-category-tint: rgba(180, 83, 9, 0.12);
}

.mailbox-workspace [data-category="hmrc_or_statutory"] {
  --mailbox-category-colour: #b91c1c;
  --mailbox-category-tint: rgba(185, 28, 28, 0.12);
}

.mailbox-workspace [data-category="banking_or_payment"] {
  --mailbox-category-colour: #0369a1;
  --mailbox-category-tint: rgba(3, 105, 161, 0.12);
}

.mailbox-workspace [data-category="business_setup_information"] {
  --mailbox-category-colour: #4338ca;
  --mailbox-category-tint: rgba(67, 56, 202, 0.12);
}

.mailbox-workspace [data-category="communication_requiring_reply"] {
  --mailbox-category-colour: #7c3aed;
  --mailbox-category-tint: rgba(124, 58, 237, 0.12);
}

.mailbox-workspace [data-category="contact"] {
  --mailbox-category-colour: #0f766e;
  --mailbox-category-tint: rgba(15, 118, 110, 0.12);
}

.mailbox-workspace [data-category="other"] {
  --mailbox-category-colour: #64748b;
  --mailbox-category-tint: rgba(100, 116, 139, 0.14);
}

.mailbox-candidate__subject {
  margin: 0 0 6px;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mailbox-candidate__subject a {
  color: var(--ink-strong);
  text-decoration: none;
}

.mailbox-candidate__subject a:hover,
.mailbox-candidate__subject a:focus-visible {
  text-decoration: underline;
}

.mailbox-candidate__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.mailbox-candidate__sender {
  font-weight: 700;
  color: var(--ink);
}

.mailbox-candidate__separator {
  color: rgba(100, 116, 139, 0.6);
}

.mailbox-candidate__signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mailbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.9);
  padding: 0.24rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mailbox-chip--attachment {
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

.mailbox-confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.mailbox-confidence__track {
  display: inline-block;
  width: 62px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
  flex: 0 0 auto;
}

.mailbox-confidence__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: currentColor;
}

.mailbox-confidence--high {
  color: #047857;
}

.mailbox-confidence--medium {
  color: #b45309;
}

.mailbox-confidence--low {
  color: #64748b;
}

.mailbox-candidate__actions {
  margin-top: 14px;
}

.mailbox-candidate__note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.mailbox-proposal {
  margin-top: 14px;
}

/* ------------------------------------------------------------------- Digests */

.mailbox-digest-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  margin-top: 16px;
}

.mailbox-digest {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md, 20px);
  background: var(--surface-strong, #fff);
  min-width: 0;
}

.mailbox-digest__body {
  padding: 16px;
}

.mailbox-digest__body h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.mailbox-digest__counts {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mailbox-digest__counts li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

.mailbox-digest__counts strong {
  color: var(--ink-strong);
}

/* ----------------------------------------------------------------- Mailboxes */

.mailbox-provider-grid {
  display: grid;
  gap: var(--workspace-gap, 24px);
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  min-width: 0;
}

.mailbox-provider {
  min-width: 0;
}

.mailbox-boundary-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 1.15rem;
  list-style: disc;
  color: var(--muted);
}

/* ------------------------------------------------------------------ Settings */

.mailbox-settings-split {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
  margin-top: 12px;
}

.mailbox-field-grid {
  --mailbox-field-gap: 12px;
  display: grid;
  gap: var(--mailbox-field-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  /*
   * Bound the row rather than the tracks. A definite `max` inside
   * `repeat(auto-fit, ...)` cuts the repetition count, which collapses a
   * two-field row into a stack; capping the container keeps the pair side by
   * side and adjacent instead of stranding each capped input in an oversized
   * track. Two fields at the shared measure, plus the gap between them.
   */
  max-width: calc(2 * var(--field-max-width) + var(--mailbox-field-gap));
}

.mailbox-form .field {
  min-width: 0;
}

/*
 * Readable form measure. The authenticated shell is viewport-led, so a
 * `width: 100%` control stretches to the full card on a wide monitor and a
 * single-line value ends up a long way from its label. Cap single-line inputs
 * and selects at the shared `--field-max-width`; the multi-line message body
 * keeps the full card width, because a long line of prose is a different case.
 *
 * The `#business-email-connection` prefix is required, not decorative: the
 * screen's existing `#business-email-connection input` overflow guard is an ID
 * selector and outranks any class-only rule here. `min()` keeps that guard's
 * 100% ceiling intact at narrow widths and only adds the measure above it.
 */
#business-email-connection .mailbox-form .field > input:not([type="checkbox"]):not([type="radio"]),
#business-email-connection .mailbox-form .field > select {
  max-width: min(100%, var(--field-max-width));
}

/* `.field` is a grid, which stacks a checkbox above its own label. */
.mailbox-workspace .field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 12px;
}

.mailbox-workspace .field--checkbox label {
  margin: 0;
}

.mailbox-workspace .field--checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.mailbox-detail-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
}

.mailbox-detail-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.mailbox-detail-grid dd {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.mailbox-detail-grid--aside {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 14px);
  background: rgba(248, 251, 255, 0.8);
  padding: 16px;
}

.mailbox-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

/*
 * Held to the same measure as a single-line field: eight categories spread over
 * the full card width put each label a long way from its own box, so the group
 * stops reading as one set of related choices.
 */
.mailbox-checkbox-set {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 14px);
  margin: 12px 0 0;
  padding: 14px 16px;
  min-width: 0;
  max-width: var(--field-max-width);
}

.mailbox-checkbox-set legend {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  padding: 0 6px;
}

.mailbox-checkbox-grid {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.mailbox-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.mailbox-workspace .mailbox-danger-zone {
  border-color: rgba(185, 28, 28, 0.28);
  background: rgba(254, 242, 242, 0.75);
}

.mailbox-danger-zone__actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mailbox-danger-zone__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: var(--radius-sm, 14px);
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 14px;
  min-width: 0;
}

.mailbox-danger-zone__row > span {
  font-weight: 800;
  color: var(--ink-strong);
}

.mailbox-danger-zone__row .button_to {
  margin: 0;
  min-width: 0;
}

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .mailbox-settings-split {
    grid-template-columns: 1fr;
  }

  .mailbox-tabs > .dashboard-tab-list {
    position: static;
  }
}

@media (max-width: 720px) {
  .mailbox-provider-grid {
    grid-template-columns: 1fr;
  }

  /* Block layout rather than column flex: a column flex-basis would be read as
     a height and stretch the primary action into a huge slab. */
  .mailbox-workspace .mailbox-queue-head {
    display: block;
  }

  .mailbox-workspace .mailbox-queue-head__actions {
    margin-top: 14px;
  }

  .mailbox-candidate__body {
    padding: 16px 14px 16px 18px;
  }

  .mailbox-danger-zone__row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mailbox-tabs .dashboard-tab-button,
  .mailbox-candidate,
  .mailbox-confidence__fill {
    transition: none;
  }
}
/* Public MTD for Income Tax readiness checker (Phase 2D D2). Built on the shared card, field-hint, form-errors and
   data-table vocabulary; these rules only lay out the questions and the answer. */

.itsa-readiness__not-filing,
.itsa-readiness__unverified {
  margin-top: 0.75rem;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 150, 54, 0.3);
  background: rgba(255, 247, 237, 0.92);
  color: var(--ink-strong);
}

.itsa-readiness__form {
  display: grid;
  gap: 1.25rem;
}

.itsa-readiness__fieldset {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--control-border);
  border-radius: 14px;
}

.itsa-readiness__fieldset legend {
  padding: 0 6px;
  font-weight: 600;
  color: var(--ink-strong);
}

.itsa-readiness__choices {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.itsa-readiness__choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  align-items: start;
}

.itsa-readiness__choice .field-hint {
  grid-column: 2;
  margin-top: 2px;
}

.itsa-readiness__error {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: #9a3412;
}

.itsa-readiness__notes {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}

.itsa-readiness__marker {
  color: var(--muted);
  font-size: 0.9rem;
}

.itsa-readiness__actions {
  display: flex;
  gap: 0.75rem;
}
/* Statutory accounts preview (Phase 3b S14). Built on the shared card, section-head, status-badge and
   responsive-table vocabulary; these rules only lay out the accounts themselves and their print form. */

.statutory-preview__copies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.statutory-preview__items {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.statutory-preview__items li + li {
  margin-top: 0.4rem;
}

.statutory-preview__warnings {
  margin-top: 1rem;
}

.statutory-preview__warnings summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-strong);
}

.statutory-document {
  display: grid;
  gap: 1.25rem;
}

.statutory-document__banner {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid #b45309;
  border-radius: 999px;
  color: #7c2d12;
  background: #fff7ed;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.statutory-document__subtitle {
  margin: 0.25rem 0 1rem;
}

.statutory-document__identity,
.statutory-signature__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.statutory-document__identity dt,
.statutory-signature__fields dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.statutory-document__identity dd,
.statutory-signature__fields dd {
  margin: 0.15rem 0 0;
}

.statutory-section--omitted {
  border-style: dashed;
  background: #f3f4f6;
}

.statutory-statement {
  width: 100%;
  border-collapse: collapse;
}

.statutory-statement caption {
  text-align: left;
  font-weight: 600;
  color: var(--ink-strong);
  padding-bottom: 0.5rem;
}

.statutory-statement th,
.statutory-statement td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.statutory-statement .statutory-statement__amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.statutory-statement__caption th {
  font-weight: 400;
}

.statutory-statement__subtotal th,
.statutory-statement__subtotal td {
  font-weight: 700;
  color: var(--ink-strong);
  border-top: 1px solid rgba(15, 23, 42, 0.35);
}

.statutory-statement__unit {
  font-weight: 400;
}

.statutory-statements,
.statutory-signature {
  margin-top: 1.25rem;
}

.statutory-statements__text {
  margin: 0 0 0.75rem;
}

.statutory-signature {
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.2);
}

.statutory-note + .statutory-note {
  margin-top: 1.5rem;
}

.statutory-text + .statutory-text {
  margin-top: 0.75rem;
}

.statutory-note h4,
.statutory-text h4,
.statutory-text h5 {
  margin: 0 0 0.4rem;
  color: var(--ink-strong);
}

.statutory-text p {
  margin: 0;
  white-space: pre-line;
}

/* Print: the accounts alone, black on white, each statement kept together where it fits. */
@media print {
  .workspace-sidebar,
  .dii-shell-header,
  .workspace-context-bar,
  .workspace-mobile-bar,
  .workspace-context-banner,
  .skip-link,
  .page-background,
  .statutory-preview__controls,
  #statutory-document-unavailable {
    display: none !important;
  }

  .statutory-document .card {
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .statutory-document,
  .statutory-document * {
    color: #000 !important;
  }

  .statutory-section {
    break-inside: avoid-page;
  }

  .statutory-section--omitted {
    display: none;
  }
}

/* Statutory accounts draft screens (Phase 3b S15): the draft's choices, the readiness checklist and the section
   navigation of the edit form. */

.statutory-draft__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1rem 0 0;
}

.statutory-draft__facts dt {
  font-weight: 600;
  color: var(--ink-strong);
}

.statutory-draft__facts dd {
  margin: 0.25rem 0 0;
}

.statutory-draft__actions {
  margin-top: 1.25rem;
}

.statutory-readiness__groups {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.statutory-readiness__group h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.statutory-readiness__fix {
  margin: 0.5rem 0 0;
}

.statutory-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.statutory-advance + .statutory-advance {
  margin-top: 1.5rem;
}

/* Phase 3c C34: the corporation tax computation, approval and approved return screens. */
.ct-unverified-banner,
.ct-simulated-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #b45309;
  border-radius: 0.5rem;
  color: #7c2d12;
  background: #fff7ed;
}

.ct-unverified-banner h3,
.ct-unverified-banner p,
.ct-simulated-notice p {
  margin: 0;
}

.ct-unverified-banner p + p,
.ct-unverified-banner h3 + p {
  margin-top: 0.35rem;
}

.ct-simulated-notice {
  font-weight: 700;
}

.ct-computation__section + .ct-computation__section {
  margin-top: 1.5rem;
}

/* WCAG 2.5.8: each footnote link is a 24px target, as tall as a table row. */
.ct-computation__source-link {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  min-height: 24px;
}

.ct-computation__sources {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding-left: 1.5rem;
}

.ct-declaration {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #1d4ed8;
  background: #f8fafc;
}

.ct-digest {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{/*
      /*rtl:begin:ignore*/left:0/*
      /*rtl:end:ignore*/}/*
      /*rtl:begin:ignore*/
/*
      /*rtl:end:ignore*/
.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{/*
      /*rtl:begin:ignore*/right:0/*
      /*rtl:end:ignore*/}/*
      /*rtl:begin:ignore*/
/*
      /*rtl:end:ignore*/
.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer + .dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *



 */

:root {
  --bg: #f7fbff;
  --bg-strong: #eef6ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --ink: #4b5563;
  --ink-strong: #0f172a;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(37, 99, 235, 0.12);
  /* WCAG 1.4.11 Non-text Contrast, AA. A form control's boundary is the visual
     information that identifies it as a control, and it needs 3:1 against what
     is behind it. --line-strong is rgba(37, 99, 235, 0.12), which measured
     1.18:1 on every text input, select and textarea in the product - and the
     controls have no fill to be identified by instead, their background being
     within 1.02:1 of the page. This is a neutral ink at an alpha that clears
     the threshold with margin rather than sitting on it. Decorative uses of
     --line-strong, and hover states, are deliberately left alone: only a
     boundary that identifies a control is in scope. */
  --control-border: rgba(15, 23, 42, 0.55);
  --blue-1: #0ea5e9;
  --blue-2: #2563eb;
  --blue-3: #1d4ed8;
  --blue-4: #60a5fa;
  --cyan: #67e8f9;
  --indigo: #6366f1;
  --mint: #4ade80;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow-sm: 0 10px 30px rgba(37, 99, 235, 0.08);
  --shadow-md: 0 16px 40px rgba(37, 99, 235, 0.12);
  --shadow-lg: 0 22px 70px rgba(37, 99, 235, 0.16);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --sidebar: 290px;
  --layout-max-width: 1600px;
  --content-max-width: 900px;
  /* Readable measure for a single-line form control. The workspace shell is
     viewport-led, so a `width: 100%` input inherits the full page width; cap
     single-line fields here rather than narrowing the page. Multi-line prose
     bodies are a separate case and are not held to this measure. */
  --field-max-width: 32rem;
  --container: 1380px;
  --page-gutter: 32px;
  --workspace-gap: 24px;
  --font-sans:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Inter,
    Arial,
    sans-serif;
  --font-display: var(--font-sans);

  /* DII UI Framework v1 token aliases. Keep these mapped to existing app tokens. */
  --dii-blue: #2A6EDC;
  --dii-blue-light: #E8F1FF;
  --dii-white: #FFFFFF;
  --dii-grey-soft: #F5F7FA;
  --dii-text-dark: #1F2D3D;
  /* Darkened from #7A8CA3 (3.44:1 on white) so muted body copy clears 4.5:1. */
  --dii-text-light: #5A6B80;
  --dii-green: #6FCF97;
  --dii-amber: #F2C94C;
  --dii-red: #EB5757;
  --dii-radius-card: 12px;
  --dii-radius-pill: 9999px;
  --dii-space-1: 4px;
  --dii-space-2: 8px;
  --dii-space-4: 16px;
  --dii-space-6: 24px;
  --dii-space-8: 32px;
  --dii-space-12: 48px;

  /* Compatibility aliases for existing app styles. */
  --bg-soft: var(--bg-strong);
  --card: var(--surface-strong);
  --card-muted: rgba(239, 246, 255, 0.94);
  --text: var(--ink-strong);
  --muted-text: var(--muted);
  --accent: var(--blue-2);
  --accent-strong: var(--blue-3);
  --accent-soft: rgba(219, 234, 254, 0.82);
  --success-soft: rgba(22, 163, 74, 0.12);
  /* Text-only token. --ok stays the brand green for icons, borders and fills;
     this darker shade is what carries 4.5:1 over the pale success tint. */
  --success-text: #166534;
  --alert-soft: rgba(217, 119, 6, 0.12);
  /* Darkened from #b45309, which measured 4.26:1 over the pale alert tint. */
  --alert-text: #92400e;
  --shadow: var(--shadow-md);
  --card-pad-y: 24px;
  --card-pad-x: 28px;
  --control-height: 52px;
  /* Focus indicator. Must hold 3:1 against both the surface it sits on and the
     control it surrounds (WCAG 1.4.11). #38bdf8, the previous value, was
     2.1:1 against the page ground. */
  --focus-ring: #0f172a;
}

/* Public landing and pricing redesign (WEB-01). */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10000;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ffffff;
  color: #07152f;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(7, 21, 47, 0.22);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, summary, [tabindex]):focus-visible,
:where(input, select, textarea, [contenteditable="true"]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.public-nav__toggle,
.public-nav__mobile-sign-in {
  display: none;
}

.marketing-page--redesign {
  gap: clamp(56px, 7vw, 104px);
  margin-top: 18px;
}

.marketing-page--redesign > :last-child {
  margin-bottom: 34px;
}

.marketing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: clamp(28px, 5vw, 72px);
  overflow: hidden;
  padding: clamp(36px, 6vw, 84px);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 34px;
  background:
    radial-gradient(circle at 74% 32%, rgba(45, 212, 191, 0.12), transparent 22%),
    radial-gradient(circle at 92% 8%, rgba(99, 102, 241, 0.22), transparent 28%),
    #061127;
  box-shadow: 0 34px 90px rgba(7, 21, 47, 0.22);
  color: #f8fbff;
}

.marketing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
  pointer-events: none;
}

.marketing-hero > * {
  position: relative;
  z-index: 1;
}

.marketing-hero__copy {
  align-self: center;
}

.marketing-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #99f6e4;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.marketing-hero h1,
.pricing-hero h1 {
  max-width: 15ch;
  margin-top: 22px;
  font-size: clamp(2.75rem, 5.6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.marketing-hero__lede {
  max-width: 42rem;
  margin-top: 24px;
  color: #cbd5e1;
  font-size: clamp(1.04rem, 1.6vw, 1.24rem);
}

.marketing-hero__actions .button--secondary,
.marketing-final-cta .button--secondary {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.5);
  color: #f8fafc;
}

.marketing-hero__note {
  margin-top: 16px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.product-proof {
  align-self: center;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.product-proof__topbar,
.product-proof__attention,
.product-proof__grid > div,
.product-proof__summary {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(30, 41, 59, 0.68);
}

.product-proof__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-proof__status {
  color: #5eead4;
}

.product-proof__summary {
  padding: 22px;
  border-radius: 18px;
}

.product-proof__summary span,
.product-proof__grid span {
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-proof__summary strong {
  display: block;
  margin-top: 7px;
  font-size: 1.7rem;
}

.product-proof__summary p {
  margin-top: 7px;
  color: #b9c7d9;
}

.product-proof__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-proof__grid > div {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
}

.product-proof__grid strong {
  display: block;
  margin-top: 9px;
  font-size: 0.94rem;
}

.product-proof__attention {
  padding: 13px 14px;
  border-radius: 13px;
  color: #cbd5e1;
  font-size: 0.86rem;
}

.product-proof__attention span {
  margin-right: 8px;
  color: #fbbf24;
}

.availability-rail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.62);
}

.availability-rail > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
}

.availability-rail > div + div {
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.availability-rail strong {
  color: #f8fafc;
  font-size: 0.86rem;
}

.availability-rail span {
  color: #aebdd0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.marketing-section__heading {
  align-items: end;
}

.marketing-section__heading h2,
.marketing-proof-section h2,
.marketing-boundary h2,
.pricing-comparison h2,
.pricing-boundary h2 {
  max-width: 24ch;
  margin-top: 12px;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  line-height: 1.05;
}

.marketing-outcome-grid,
.home-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.marketing-outcome-card,
.home-plan-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 38px rgba(30, 64, 175, 0.07);
}

.marketing-outcome-card > span,
.home-plan-card > div > span,
.marketing-final-cta > span {
  color: var(--accent-strong);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marketing-outcome-card h3 {
  font-size: 1.55rem;
}

.marketing-step-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  counter-reset: workflow;
}

.marketing-workflow .marketing-step-card {
  border: 0;
  border-top: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.marketing-proof-section,
.marketing-boundary,
.pricing-boundary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
}

.marketing-proof-section__copy > p,
.marketing-boundary > div > p,
.pricing-boundary > div > p {
  margin-top: 18px;
  max-width: 46rem;
}

.marketing-check-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.marketing-check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  line-height: 1.55;
}

.marketing-check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #0f766e;
  font-weight: 900;
}

.marketing-review-board {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  background: #07152f;
  color: #f8fafc;
  box-shadow: 0 24px 54px rgba(7, 21, 47, 0.2);
}

.marketing-review-board > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.72);
}

.marketing-review-board__header {
  display: flex !important;
  justify-content: space-between;
  color: #cbd5e1;
}

.marketing-review-board__header span {
  font-size: 0.78rem;
}

.marketing-review-board p,
.marketing-review-board small {
  display: block;
  color: #cbd5e1;
}

.marketing-review-board small {
  margin-top: 4px;
}

.marketing-review-board em {
  color: #fbbf24;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.marketing-review-board__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fbbf24;
}

.marketing-review-board .is-clear .marketing-review-board__dot {
  background: #5eead4;
}

.marketing-review-board .is-clear em {
  color: #5eead4;
}

.home-plan-card > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.home-plan-card > div strong {
  font-size: 1.35rem;
}

.home-plan-card .button {
  align-self: end;
  margin-top: auto;
}

.home-plan-card--recommended {
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(160deg, rgba(219, 234, 254, 0.86), #ffffff);
}

.marketing-boundary {
  align-items: stretch;
  background: #07152f;
  color: #f8fafc;
}

.marketing-boundary .eyebrow {
  border-color: rgba(94, 234, 212, 0.25);
  background: rgba(15, 118, 110, 0.18);
  color: #99f6e4;
}

.marketing-boundary > div > p,
.marketing-boundary details p {
  color: #b9c7d9;
}

.marketing-boundary details {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* WCAG 2.5.8 Target Size (Minimum), AA in WCAG 2.2.

   A <summary> is the control that opens its <details>, and at the body font
   size it renders 22 CSS pixels tall - two short of the 24 the criterion asks
   for. The record-backed accessibility sweep found it on the historical-import
   column mapping on 2026-09-25, on both the batch form and the source-file
   form. It is set once here rather than per form, for the same reason the
   checkbox rule is: there is no form where 22px is the right answer.

   .marketing-boundary summary below raises its own to 44 and still wins on
   specificity, so nothing that already met the criterion changes. */
summary {
  min-block-size: 24px;
}

.marketing-boundary summary {
  min-height: 44px;
  cursor: pointer;
  color: #f8fafc;
  font-weight: 700;
}

.marketing-boundary details p {
  padding: 4px 0 8px;
}

.marketing-final-cta {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.64);
}

.marketing-final-cta > span {
  color: #99f6e4;
}

.marketing-final-cta h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.pricing-hero {
  display: grid;
  justify-items: center;
  padding: clamp(36px, 6vw, 76px) 24px;
  text-align: center;
}

.pricing-hero .marketing-kicker {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(219, 234, 254, 0.72);
  color: var(--accent-strong);
}

.pricing-hero h1 {
  max-width: 18ch;
  color: var(--text);
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.pricing-hero > p {
  max-width: 52rem;
  margin-top: 20px;
  font-size: 1.08rem;
}

.pricing-hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
}

.pricing-hero__facts span {
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.pricing-page--redesign .pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-page--redesign .pricing-plan-card {
  align-content: start;
  min-width: 0;
  border-radius: 24px;
}

.pricing-page--redesign .pricing-plan-card--recommended {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 24px 58px rgba(37, 99, 235, 0.14);
}

.pricing-plan-card__headline {
  min-height: 4.8em;
}

.pricing-plan-card__audience {
  padding: 16px;
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.82);
}

.pricing-plan-card__audience strong {
  color: var(--text);
}

.pricing-plan-card__features {
  margin-top: 0;
}

.pricing-comparison {
  display: grid;
  gap: 20px;
}

.pricing-comparison__scroll {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.pricing-comparison table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.pricing-comparison th,
.pricing-comparison td {
  padding: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  vertical-align: top;
}

.pricing-comparison thead th {
  background: rgba(219, 234, 254, 0.52);
  color: var(--text);
}

.pricing-comparison tbody th {
  width: 22%;
  color: var(--text);
}

.pricing-boundary {
  background: rgba(255, 255, 255, 0.78);
}

.pricing-boundary__banking {
  padding: 24px;
  border-radius: 20px;
  background: #07152f;
  color: #f8fafc;
}

.pricing-boundary__banking p {
  margin-top: 10px;
  color: #b9c7d9;
}

.marketing-timeline--simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-timeline--simple .marketing-timeline__item {
  grid-template-columns: 1fr;
  border-radius: 22px;
}

.marketing-how-boundary {
  margin-bottom: 34px;
}

@media (max-width: 980px) {
  .marketing-hero,
  .marketing-proof-section,
  .marketing-boundary,
  .pricing-boundary {
    grid-template-columns: 1fr;
  }

  .product-proof {
    width: 100%;
  }

  .pricing-page--redesign .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-plan-card__headline {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .public-nav {
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
  }

  .public-nav__brand {
    min-width: 0;
    margin-right: auto;
    gap: 9px;
  }

  .public-nav__mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .public-nav__brand small {
    display: none;
  }

  .public-nav__mobile-sign-in,
  .public-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 11px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
  }

  .public-nav__toggle {
    box-shadow: none;
  }

  .public-nav__links {
    flex-basis: 100%;
    display: grid;
    width: 100%;
    gap: 6px;
    padding-top: 8px;
  }

  .public-nav--enhanced .public-nav__links[hidden] {
    display: none;
  }

  .public-nav__links .public-nav__link,
  .public-nav__links .button {
    min-height: 44px;
    justify-content: flex-start;
  }

  .marketing-page--redesign {
    gap: 58px;
    margin-top: 8px;
  }

  .marketing-hero {
    gap: 32px;
    padding: 22px;
    border-radius: 26px;
  }

  .marketing-hero h1 {
    margin-top: 12px;
    font-size: 1.9rem;
    line-height: 1;
  }

  .marketing-hero__lede {
    margin-top: 12px;
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .marketing-hero__actions {
    gap: 8px;
    margin-top: 14px;
  }

  .marketing-hero__actions .button {
    min-height: 48px;
  }

  .product-proof__grid,
  .availability-rail,
  .marketing-outcome-grid,
  .home-plan-grid,
  .marketing-step-grid--three,
  .marketing-timeline--simple {
    grid-template-columns: 1fr;
  }

  .availability-rail > div + div {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 0;
  }

  .marketing-proof-section,
  .marketing-boundary,
  .pricing-boundary {
    padding: 24px;
    border-radius: 24px;
  }

  .marketing-section__heading h2,
  .marketing-proof-section h2,
  .marketing-boundary h2,
  .pricing-comparison h2,
  .pricing-boundary h2 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .pricing-hero {
    padding: 34px 8px 12px;
  }

  .pricing-hero h1 {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  .pricing-page--redesign .pricing-plan-card {
    padding: 22px;
  }
}

@media (max-width: 380px) {
  .page-frame {
    padding: 12px;
  }

  .public-shell,
  .auth-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  .public-nav__brand strong {
    font-size: 0.96rem;
  }

  .public-nav__mobile-sign-in,
  .public-nav__toggle {
    padding-right: 8px;
    padding-left: 8px;
  }

  .marketing-hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  .marketing-hero h1 {
    font-size: 2.35rem;
  }

  .marketing-hero__actions .button {
    width: 100%;
  }

  .product-proof {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.22), transparent 22%),
    radial-gradient(circle at left 20%, rgba(14, 165, 233, 0.12), transparent 18%),
    linear-gradient(180deg, #f8fbff 0%, #f3f8ff 35%, #f8fbff 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 92%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-frame {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--page-gutter);
}

.page-background {
  position: fixed;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.8;
  pointer-events: none;
}

.page-background--one {
  top: -120px;
  right: 5%;
  width: 320px;
  height: 320px;
  background: rgba(85, 157, 255, 0.18);
}

.page-background--two {
  bottom: -120px;
  left: 8%;
  width: 280px;
  height: 280px;
  background: rgba(155, 204, 255, 0.22);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 252, 255, 0.96));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(103, 232, 249, 0.4), rgba(37, 99, 235, 0.25), transparent);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

article[class="card"],
section[class="card"] {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.form-notice {
  padding: 18px 20px;
}

.form-notice strong {
  display: block;
}

.form-notice p,
.form-notice ul {
  margin-top: 10px;
}

.form-notice li + li {
  margin-top: 8px;
}

.form-notice--warning,
.invoice-print-warning {
  border: 1px solid rgba(248, 179, 52, 0.34);
  border-radius: 18px;
  background: rgba(255, 244, 214, 0.78);
  color: #6f4c00;
}

/* WCAG 1.4.3 Contrast (Minimum), AA.
   .form-notice--success was used in six templates and defined nowhere, so a
   success notice took the page background and the global muted paragraph
   colour: #6b7280 on #eef4fb measures 4.36:1 on the public customer document
   page, under the 4.5:1 minimum. It went unseen because the one place it
   mattered most was unreachable - the quote accept/decline confirmation 404'd
   before it could render. */
.form-notice--success {
  border: 1px solid rgba(21, 128, 61, 0.3);
  border-radius: 18px;
  background: rgba(220, 247, 232, 0.9);
  color: #14532d;
}

/* The notice colours above are set on the container, and the global
   `p { color: var(--muted) }` rule beats inheritance, so without this the
   paragraph inside a notice keeps the muted grey either modifier was meant to
   replace. */
.form-notice--success p,
.form-notice--success ul,
.form-notice--warning p,
.form-notice--warning ul,
.invoice-print-warning p {
  color: inherit;
}

.workspace-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.workspace-context-banner div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-context-banner strong,
.workspace-context-banner p {
  overflow-wrap: anywhere;
}

.workspace-context-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.workspace-context-switcher label {
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-context-switcher__action {
  margin-top: 10px;
}

.eyebrow,
.workspace-sidebar__eyebrow,
.summary-card__title,
.feature-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.1);
  box-shadow: var(--shadow-sm);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ds-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: none;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button:disabled,
.btn:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.button:disabled:hover,
.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.button[aria-disabled="true"]:hover,
.btn[aria-disabled="true"]:hover {
  cursor: default;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.button--full,
.btn--full {
  width: 100%;
}

.business-email-action {
  max-width: 100%;
  min-height: 44px;
  overflow-wrap: anywhere;
  white-space: normal;
}

#business-email-connection,
#business-mailbox-candidate-review,
#business-mailbox-send-preview {
  min-width: 0;
  overflow-wrap: anywhere;
}

#business-email-connection input,
#business-email-connection select,
#business-email-connection textarea,
#business-mailbox-candidate-review input,
#business-mailbox-candidate-review textarea {
  max-width: 100%;
}

.mailbox-plain-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.button--primary,
.btn-primary {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2), var(--indigo));
  color: #ffffff;
}

/* WCAG 1.4.11. A secondary button is a near-white fill on a near-white page -
   measured at 1:1 against the surface behind it - so its border is the only
   thing that says "control". At rgba(37, 99, 235, 0.1) that border measured
   1.15:1. The primary variant is exempt from this reasoning because its
   gradient fill is itself the boundary. */
.button--secondary,
.btn-secondary {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--control-border);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.button--ghost,
.btn-ghost {
  background: rgba(219, 234, 254, 0.62);
  border-color: rgba(37, 99, 235, 0.1);
  color: var(--accent-strong);
}

.has-tooltip {
  position: relative;
}

/* WCAG 1.4.13 Content on Hover or Focus, AA.
   Hoverable: the tooltip used to sit 10px clear of its trigger with
   pointer-events: none, so moving the pointer towards it crossed a gap where
   :hover was lost and the tooltip vanished before it could be read - measured,
   not assumed. It now reaches down to the trigger's edge with a transparent
   border holding the visual offset, and takes pointer events: a ::after
   hit-tests as part of the element it belongs to, so the pointer resting on the
   tooltip keeps the trigger hovered.
   Dismissible is the other half and cannot be done here - see
   app/javascript/controllers/tooltip_dismiss_controller.js. */
.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  border-bottom: 10px solid transparent;
  background-clip: padding-box;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
}

.has-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease;
  z-index: 20;
}

.has-tooltip:hover::after,
.has-tooltip:focus-visible::after,
.has-tooltip:hover::before,
.has-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

/* Set by tooltip_dismiss_controller when Escape is pressed, and removed as soon
   as the pointer or focus reaches a different trigger.

   This has to sit AFTER the reveal rule above, not beside the base styles.
   `.has-tooltip.is-tooltip-dismissed::after` and `.has-tooltip:hover::after`
   have the SAME specificity - two class-column selectors each - so the cascade
   is decided on source order alone. Declared earlier it loses, the class goes on
   the element, and the tooltip stays on screen: the same shape as the `:where()`
   zero-specificity trap this stylesheet already carries for 2.4.7. */
.has-tooltip.is-tooltip-dismissed::after,
.has-tooltip.is-tooltip-dismissed::before {
  opacity: 0;
  visibility: hidden;
}

.shell {
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.section {
  margin-bottom: 32px;
}

.section-head {
  max-width: 920px;
}

.section-head p {
  margin-top: 14px;
  font-size: 1.02rem;
  line-height: 1.75;
}

.section-head--compact {
  max-width: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric {
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-sm);
}

.metric strong {
  display: block;
  color: var(--ink-strong);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.metric span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.route-pill {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(37, 99, 235, 0.1);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

a.route-pill:hover,
button.route-pill:hover,
label.route-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.route-pill.button--primary,
.route-pill.btn-primary,
.route-pill.button--primary:hover,
.route-pill.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-3), #4338ca);
  color: #ffffff;
}

.side-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 248, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 10px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(239, 246, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2), var(--indigo));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  color: var(--ink-strong);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: 5px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 720px;
}

.flash {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.flash--notice {
  color: var(--success-text);
  background: var(--success-soft);
  border-color: rgba(31, 122, 83, 0.12);
}

.flash--alert {
  color: var(--alert-text);
  background: var(--alert-soft);
  border-color: rgba(166, 89, 41, 0.12);
}

.public-shell,
.auth-shell {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.marketing-page {
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.public-hero,
.auth-shell {
  display: grid;
  gap: 24px;
}

.public-nav {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 255, 0.94)),
    linear-gradient(140deg, rgba(31, 122, 228, 0.08), transparent 60%);
}

.public-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.public-nav__brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.public-nav__brand small {
  color: var(--muted);
}

.public-nav__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #6db7ff 100%);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.public-nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.public-nav__link {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.public-nav__link--active {
  background: rgba(221, 236, 255, 0.72);
  color: var(--accent-strong);
}

.public-hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 420px);
  align-items: stretch;
  margin-bottom: 28px;
}

.public-hero--marketing {
  margin-bottom: 0;
}

.public-hero__copy,
.auth-panel {
  padding: 48px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(239, 247, 255, 0.9)),
    linear-gradient(135deg, rgba(31, 122, 228, 0.12), transparent 60%);
  border: 1px solid rgba(194, 214, 236, 0.8);
  box-shadow: var(--shadow);
}

.public-hero__copy h1,
.auth-panel h1 {
  margin-top: 16px;
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  line-height: 0.98;
  /* 1.4.12 Text Spacing. These are the two largest headings in the product and
     the only ones with no wrap rule. At 320 CSS px with the criterion's
     letter-spacing of 0.12em applied, a single long word in the sign-in
     heading ("workspace.") is wider than the panel and cannot break, which
     gave /users/sign_in 35px of horizontal scroll under the override and 0
     without it. `anywhere` rather than `break-word` because it is the one that
     also reduces the intrinsic min-content width, which is what stops a flex
     or grid parent from being forced wider; it matches the twelve other
     overflow-wrap rules in this file. */
  overflow-wrap: anywhere;
}

.public-hero__copy p,
.auth-panel p {
  margin-top: 18px;
  max-width: 52rem;
  font-size: 1.02rem;
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.marketing-cta-note {
  margin-top: 14px;
  max-width: 36rem;
  font-size: 0.95rem;
}

.marketing-lead-card,
.dashboard-demo-guide {
  padding: 28px 32px;
}

.marketing-lead-card {
  display: grid;
  gap: 18px;
  align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
}

.lead-capture-form {
  display: grid;
  gap: 10px;
}

.lead-capture-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lead-capture-form__input {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.report-detail-stack {
  display: grid;
  gap: 18px;
}

.public-hero__panel,
.auth-card {
  padding: 32px;
}

.public-hero__panel h2,
.auth-card h2 {
  margin-top: 12px;
  font-size: 1.8rem;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.feature-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card-muted);
  color: var(--text);
  font-weight: 600;
}

.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.marketing-proof-card {
  padding: 28px;
}

.marketing-proof-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.marketing-proof-point {
  padding: 18px;
  border-radius: 18px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.86);
}

.marketing-proof-point span,
.marketing-snapshot-card__metric span {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.marketing-proof-point strong,
.marketing-snapshot-card__metric strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.marketing-proof-point p,
.marketing-snapshot-card__metric p {
  margin-top: 8px;
}

.feature-card {
  padding: 24px;
}

.feature-card h3 {
  margin-top: 14px;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.marketing-section {
  display: grid;
  gap: 18px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.article-category-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-category-heading__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.88);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.marketing-feature-grid,
.marketing-step-grid,
.marketing-snapshot-grid,
.testimonial-grid,
.marketing-trust-grid,
.marketing-timeline {
  display: grid;
  gap: 20px;
}

.marketing-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-step-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.marketing-snapshot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.testimonial-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
  display: grid;
  gap: 18px;
  padding: var(--card-pad-y) var(--card-pad-x);
}

.article-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.article-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.article-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--accent-strong);
}

.article-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(194, 214, 236, 0.88);
  color: var(--muted);
}

.article-card__cover {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.74);
  background: rgba(244, 249, 255, 0.92);
}

.article-body {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 36px 40px;
}

.article-hero-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(194, 214, 236, 0.74);
  background: rgba(244, 249, 255, 0.92);
}

.workspace-header .article-hero-image {
  grid-column: 1 / -1;
}

.article-body__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.article-body h2,
.article-body h3 {
  margin: 28px 0 0;
  color: var(--text);
}

.article-body > h2:first-child,
.article-body > h3:first-child {
  margin-top: 0;
}

.article-body h2 + p,
.article-body h3 + p {
  margin-top: 12px;
}

.article-body p,
.article-body div,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre {
  margin: 0 0 18px;
  line-height: 1.8;
}

.article-body blockquote,
.article-body pre {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(244, 249, 255, 0.92);
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body a {
  color: var(--accent-strong);
  font-weight: 700;
}

.article-body figure {
  margin: 28px 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(194, 214, 236, 0.65);
  background: rgba(255, 255, 255, 0.9);
}

.article-body figure.attachment--file,
.article-body figure.attachment--preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.article-body figure .attachment__picture,
.article-body figure picture,
.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.article-body figure img {
  border-radius: 18px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
}

.article-body figure figcaption {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.article-body table {
  width: 100%;
  margin: 24px 0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.article-body th,
.article-body td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(214, 226, 241, 0.92);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.article-body th {
  background: rgba(239, 246, 255, 0.94);
  color: var(--text);
  font-weight: 800;
}

.article-body tr:last-child td {
  border-bottom: 0;
}

.article-body code {
  padding: 0.18rem 0.4rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 0.92em;
}

.article-body pre code {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre-wrap;
}

.article-body input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--accent-strong);
}

.article-cta {
  margin-top: 8px;
}

.article-inline-cta {
  display: grid;
  gap: 16px;
  margin: 18px 0 24px;
  padding: 22px 24px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(255, 255, 255, 0.96)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 62%);
  border: 1px solid rgba(194, 214, 236, 0.92);
}

.article-inline-cta h2 {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.article-inline-cta__note {
  margin-bottom: 0;
  color: var(--muted);
}

.article-reading-layout,
.article-category-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}

.article-reading-layout {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(240px, 280px);
}

.article-category-layout {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(220px, 260px);
}

.article-reading-layout__rail,
.article-category-layout__nav,
.article-category-layout__aside,
.article-category-link,
.article-editor-card,
.article-editor-form > .report-detail-card {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.article-reading-layout__content.article-body {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
}


.article-reading-nav,
.article-toc,
.article-side-list {
  display: grid;
  gap: 12px;
}

.article-reading-nav__item,
.article-toc__item,
.article-side-list__item {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
}

.article-reading-nav__item.is-current {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(219, 234, 254, 0.65);
}

.article-toc__item--h3 {
  margin-left: 18px;
}

.article-side-section {
  display: grid;
  gap: 16px;
}

.article-category-link {
  display: grid;
  gap: 14px;
}

.article-category-layout__content {
  display: grid;
  gap: 18px;
}

.marketing-trust-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-page__header {
  margin-top: 0;
}

.marketing-feature-card,
.marketing-step-card,
.marketing-snapshot-card,
.testimonial-card,
.marketing-trust-card,
.marketing-timeline__item,
.marketing-cta {
  padding: 28px;
}

.marketing-step-card {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    linear-gradient(145deg, rgba(31, 122, 228, 0.06), transparent 60%);
}

.marketing-step-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.marketing-step-card h3,
.marketing-snapshot-card h3,
.marketing-trust-card h3,
.marketing-timeline__item h2,
.marketing-cta h2 {
  margin-top: 14px;
  font-size: 1.4rem;
}

.marketing-snapshot-card {
  display: grid;
  gap: 18px;
}

.testimonials-section--compact .testimonial-grid,
.testimonial-grid--compact {
  grid-template-columns: 1fr;
}

.testimonial-card {
  display: grid;
  gap: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.96)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 65%);
}

.testimonial-card__quote {
  margin: 0;
}

.testimonial-card__quote p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
}

.testimonial-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding-top: 18px;
  border-top: 1px solid rgba(194, 214, 236, 0.88);
}

.testimonial-card__footer strong {
  display: block;
}

.testimonial-card__footer p {
  margin: 6px 0 0;
  color: var(--muted);
}

.testimonial-card__rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.88);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.marketing-snapshot-card__frame {
  padding: 22px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.96)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 60%);
  border: 1px solid rgba(194, 214, 236, 0.88);
}

.marketing-snapshot-card__metric {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.86);
}

.marketing-timeline__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.marketing-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.94)),
    linear-gradient(140deg, rgba(31, 122, 228, 0.1), transparent 60%);
}

.auth-shell {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
  align-items: center;
  min-height: calc(100vh - 64px);
}

.auth-benefit-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-benefit-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(194, 214, 236, 0.72);
  color: var(--text);
  font-weight: 600;
}

.auth-context-card {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.86);
}

.stack-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.stack-form [data-business-profile-wizard-target="section"][hidden] {
  display: none !important;
}

.signup-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth-helper-copy {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.form-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label,
.form-field label,
.checkbox-field label {
  font-weight: 700;
  color: var(--text);
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-input,
.form-select,
.inline-form select,
.inline-form input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: var(--control-height);
  padding: 14px 16px;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.04);
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.form-field input:not([type="checkbox"]):not([type="radio"]):focus,
.form-field select:focus,
.form-input:focus,
.form-select:focus,
.inline-form select:focus,
.inline-form input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: 2px solid rgba(31, 122, 228, 0.18);
  border-color: var(--accent);
}

.field input[type="search"]::-webkit-search-cancel-button,
.form-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  cursor: pointer;
  opacity: 0.45;
}

.field select,
.form-field select,
.form-select,
.filter-select,
.inline-form select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%234b6580' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
}

.field input[type="date"],
.form-field input[type="date"] {
  appearance: none;
  color-scheme: light;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.form-field input[type="date"]::-webkit-calendar-picker-indicator {
  padding: 2px;
  border-radius: 8px;
  opacity: 0.72;
  cursor: pointer;
}

input[data-date-picker-enhanced="true"] {
  padding-right: 44px;
  background-image: linear-gradient(135deg, rgba(31, 122, 228, 0.08), rgba(103, 232, 249, 0.14));
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-errors {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--alert-soft);
  border: 1px solid rgba(166, 89, 41, 0.12);
}

.form-errors strong {
  display: block;
  margin-bottom: 10px;
}

.form-errors ul {
  display: grid;
  gap: 6px;
  list-style: disc;
  padding-left: 18px;
}

/* The summary takes focus when a submission fails (error_summary_controller).
   Programmatic focus on a tabindex="-1" container does not match
   :focus-visible in most browsers, so the indicator is declared on :focus. */
.form-errors:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.form-errors a {
  color: var(--alert-text);
  text-decoration: underline;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  color: var(--accent-strong);
  font-weight: 700;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
}

.auth-links__primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 122, 228, 0.16);
}

.auth-links__secondary {
  background: rgba(239, 246, 255, 0.86);
  color: var(--accent-strong);
}

.auth-links__muted {
  color: var(--muted-text);
  font-weight: 600;
}

.public-footer {
  width: 100%;
  margin: 10px auto 0;
  padding: 22px 4px 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-top: 1px solid rgba(194, 214, 236, 0.88);
  color: var(--muted-text);
}

.public-footer strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  color: var(--text);
}

.app-footer {
  align-self: stretch;
}

.app-footer__identity {
  display: grid;
  gap: 6px;
  max-width: 48rem;
}

.app-footer__credit,
.app-footer__summary {
  font-size: 0.92rem;
}

.app-footer__summary {
  color: var(--muted);
}

/* Statutory trading disclosure. Rendered in the site footer and at the foot of each
   public legal page, so the rules are keyed off the block rather than the footer. */
.company-identity {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.company-identity__name {
  color: var(--text);
}

.legal-document-footer {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border, rgba(15, 23, 42, 0.12));
}

.legal-document-footer__review {
  font-size: 0.88rem;
  color: var(--muted);
}

.public-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--accent-strong);
  font-weight: 700;
  justify-content: flex-end;
}

.pricing-plan-card__actions {
  display: grid;
  gap: 12px;
}

.pricing-plan-card__secondary-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.marketing-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.marketing-trust-strip__item {
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.96)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.06), transparent 60%);
}

.pricing-plan-card__positioning,
.pricing-plan-card__outcome,
.pricing-plan-card__timing {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.88);
}

.pricing-plan-card__positioning strong,
.pricing-plan-card__outcome .eyebrow,
.pricing-plan-card__timing .eyebrow {
  color: var(--accent-strong);
}

.pricing-plan-card__note {
  margin-top: 4px;
  font-size: 0.92rem;
}

.pricing-plan-card__recommended-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.workspace-shell {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 64px);
}

.workspace-sidebar {
  position: fixed;
  top: 24px;
  bottom: 24px;
  left: var(--page-gutter);
  width: var(--sidebar);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 18px 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-right-color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 8px 0 40px rgba(37, 99, 235, 0.08);
  z-index: 30;
  transition: transform 0.35s ease;
}

.workspace-sidebar__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-sidebar__brand {
  flex: 1 1 auto;
}

.workspace-sidebar__close {
  display: none;
  flex: 0 0 auto;
  min-width: 88px;
}

.workspace-sidebar h1 {
  margin-top: 10px;
  font-size: 2rem;
}

.workspace-sidebar__organisation,
.workspace-user-chip {
  display: grid;
  gap: 6px;
}

.workspace-user-chip strong,
.workspace-sidebar__organisation strong {
  font-size: 1.05rem;
}

.workspace-sidebar__plan {
  font-size: 0.88rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.workspace-nav {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.workspace-nav__section-label {
  margin-top: 10px;
  padding: 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-nav__section {
  display: grid;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 248, 255, 0.94)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.04), transparent 62%);
}

/* WCAG 1.4.4 Resize Text. At 200% text a single long label - "Reconciliation",
   "Notifications" - is wider than the rail. These are grid and flex children,
   and a grid item's default `min-width: auto` refuses to shrink below its
   longest word, so the section overflows; the `.card` rule's `overflow: hidden`
   then cuts the label off with nothing to scroll to, which is loss of content,
   not just an ugly layout. Letting the word break keeps the navigation readable
   at 200% and changes nothing at 100%, where no label is that wide.
   Caught by spec/accessibility/resize_text_spec.rb.
   `anywhere`, not `break-word` (2026-09-28): only `anywhere` lets the break
   count when a flex or grid child works out how narrow it may shrink, so with
   `break-word` a label inside a nav item still held the item at the width of
   its longest word. With a wide font - DejaVu Sans, the default sans-serif on
   many Linux desktops - that was still up to 18px wider than the rail. */
.workspace-nav__section > *,
.workspace-nav__section-items > *,
.workspace-nav__section-toggle,
.workspace-nav__section-title,
.workspace-nav__item,
.workspace-nav__item > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-nav__section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.workspace-nav__section-toggle:hover {
  background: rgba(31, 122, 228, 0.06);
}

.workspace-nav__section-title {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-nav__section-label-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent-strong);
}

.workspace-nav__section-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.workspace-nav__section-pill {
  min-height: 28px;
  padding-inline: 10px;
  font-size: 0.72rem;
}

.workspace-nav__section-chevron {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(59, 130, 246, 0.7);
  border-bottom: 2px solid rgba(59, 130, 246, 0.7);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.workspace-nav__section.is-open .workspace-nav__section-chevron {
  transform: rotate(225deg);
}

.workspace-nav__section.is-active .workspace-nav__section-toggle {
  background: rgba(31, 122, 228, 0.08);
}

.workspace-nav__section-items {
  display: grid;
  gap: 6px;
}

.workspace-nav__section-items[hidden] {
  display: none;
}

.workspace-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.2s ease, transform 0.12s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.workspace-nav__item:hover {
  transform: translateY(-1px);
}

.workspace-nav__item.is-active {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.95));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.workspace-nav__item.is-disabled {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(37, 99, 235, 0.12);
  color: #7d92aa;
}

.workspace-sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.dashboard-upgrade-card {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.workspace-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(3px);
  z-index: 25;
}

body.workspace-drawer-open {
  overflow: hidden;
}

.workspace-main {
  display: grid;
  gap: 24px;
  min-width: 0;
  margin-left: calc(var(--sidebar) + var(--workspace-gap));
  padding-left: var(--page-gutter);
  align-content: start;
}

.workspace-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.workspace-mobile-bar__brand {
  display: grid;
  gap: 8px;
}

.workspace-mobile-bar__brand strong {
  color: var(--text);
  font-size: 1.05rem;
}

.workspace-mobile-bar .eyebrow {
  width: fit-content;
  margin-bottom: 0;
}

.workspace-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 30px;
}

/* The meta strip refuses to shrink below its basis, so without a floor of its
   own the heading and its paragraph were the only thing left to give: between
   about 720px and 1100px they were squeezed to one word per line. With a
   floor, the strip wraps onto its own row instead. */
.workspace-header__content {
  flex: 1 1 320px;
  min-width: 0;
}

.workspace-header__content .eyebrow {
  width: fit-content;
  margin-bottom: 0;
}

/* WCAG 1.4.12, measured on /bank_transactions.

   The screen heading is a sentence - "Imported transactions and matching
   review" - and at a measured 320 CSS pixels with the four 1.4.12 overrides
   applied, 0.12em of letter spacing makes its longest word wider than the line
   box it has. `.card { overflow: hidden }` (:1064) then cuts the last 8px of
   that word off: `.workspace-header` measured scrollWidth 290 against
   clientWidth 282, with page-level overflow of 0, so nothing at the page edge
   said anything was wrong. Hiding each child in turn put the whole 8px in
   `.workspace-header__content`, which is the eyebrow and the h1.

   Breaking a word mid-way is not pretty. Losing the end of it is worse, and
   1.4.12 is about what survives the override rather than what looks best under
   it. */
.workspace-header__content h1,
.workspace-header__content h2 {
  overflow-wrap: anywhere;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.pricing-plan-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.pricing-plan-card--current {
  border-color: rgba(31, 122, 228, 0.6);
  box-shadow: 0 24px 60px rgba(31, 122, 228, 0.12);
}

.pricing-plan-card--recommended {
  background:
    linear-gradient(180deg, rgba(221, 236, 255, 0.42), rgba(255, 255, 255, 0.96));
}

.pricing-plan-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pricing-plan-price strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.workspace-header h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.workspace-header--compact {
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 18px;
}

.workspace-header--compact h1 {
  margin-top: 8px;
  font-size: 1.75rem;
}

.workspace-header--compact .section-head p {
  margin-top: 8px;
}

.dashboard-first-value-header .workspace-header__content {
  display: grid;
  align-content: start;
  flex: 1 1 280px;
  gap: 8px;
  max-width: 420px;
}

.dashboard-first-value-header .workspace-header__content .eyebrow {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: auto;
  padding: 6px 10px;
  line-height: 1;
}

.dashboard-first-value-header .workspace-header__content h1 {
  margin-top: 0;
  font-size: 1.6rem;
}

.dashboard-first-value-header .workspace-header__content p {
  margin-top: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.dashboard-first-value-header .workspace-header__actions {
  align-self: center;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.workspace-header__meta {
  display: flex;
  align-items: stretch;
  flex: 1 0 min(100%, 660px);
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  color: var(--muted);
}

.workspace-header__meta-card {
  display: grid;
  gap: 4px;
  flex: 1 1 132px;
  min-width: min(100%, 132px);
  padding: 10px 12px;
}

.workspace-header__meta-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-header__meta-card strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.2;
}

.dashboard-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.summary-card strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.dashboard-card-grid--compact {
  gap: 12px;
}

.dashboard-card-grid--compact .summary-card,
.dashboard-compact-finance .summary-card {
  padding: 14px 16px;
}

.dashboard-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-kpi-grid--compact .summary-card {
  padding: 14px 16px;
  border: 1px solid rgba(194, 214, 236, 0.85);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.summary-card__label {
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-card__value {
  overflow-wrap: anywhere;
}

.dashboard-card-grid--compact .summary-card strong,
.dashboard-compact-finance .summary-card strong {
  font-size: 1.15rem;
}

.summary-card p {
  margin-top: 0;
}

.summary-card__actions {
  margin-top: auto;
}

.summary-card__state {
  align-self: end;
  width: fit-content;
  margin-top: auto;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-card--accent {
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.82), rgba(255, 255, 255, 0.92));
}

.summary-card--success {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.94));
}

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.dashboard-panels > .card {
  padding: 28px;
}

.dashboard-tab-shell {
  display: grid;
  gap: 20px;
}

.dashboard-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(194, 214, 236, 0.82);
  box-shadow: var(--shadow-sm);
}

.dashboard-tab-button {
  appearance: none;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.1;
  min-height: 44px;
  padding: 0.78rem 1rem;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-tab-button__meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 999px;
  background: rgba(23, 50, 77, 0.08);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.18rem 0.46rem;
  white-space: nowrap;
}

.dashboard-tab-button:hover,
.dashboard-tab-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.26);
  color: var(--accent-strong);
}

.dashboard-tab-button.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, #4867f6 100%);
  border-color: rgba(37, 99, 235, 0.44);
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.dashboard-tab-button.is-active .dashboard-tab-button__meta {
  background: rgba(255, 255, 255, 0.22);
}

.dashboard-tab-panel {
  display: grid;
  gap: 20px;
}

.dashboard-tab-panel[hidden] {
  display: none;
}

.dashboard-root-panel-grid {
  margin-bottom: 0;
}

.dashboard-panels--focus,
.dashboard-panels--supporting {
  align-items: start;
}

.dashboard-panels--focus {
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
}

.dashboard-panels--focus .dashboard-card-grid--value {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Home: money first. "Needs attention" then the current-month snapshot. */
.dashboard-panels--single {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.dashboard-money .dashboard-card-grid--value {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
}

.dashboard-money__month-end {
  margin-top: 12px;
}

.dashboard-basis-details {
  margin-top: 16px;
}

.dashboard-attention__list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.dashboard-attention__item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(194, 214, 236, 0.82);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.dashboard-attention__text {
  flex: 1 1 240px;
  min-width: 0;
}

.dashboard-attention__text p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dashboard-attention__empty,
.dashboard-attention__more {
  margin: 12px 0 0;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .dashboard-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .private-beta-status-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .dashboard-panels--focus {
    grid-template-columns: 1fr;
  }
}

.dashboard-tab-panel > .dashboard-panels > .card,
.dashboard-empty-panel {
  padding: 0;
}

.setup-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(194, 214, 236, 0.82);
  box-shadow: var(--shadow-sm);
}

.setup-tab-button {
  appearance: none;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.78rem 1rem;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.setup-tab-button:hover,
.setup-tab-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.26);
  color: var(--accent-strong);
}

.setup-tab-button.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, #4867f6 100%);
  border-color: rgba(37, 99, 235, 0.44);
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.business-identity-summary {
  display: grid;
  gap: 18px;
}

.business-profile-review-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.business-profile-review-header .section-head p {
  margin-top: 6px;
  max-width: 56rem;
  font-size: 0.98rem;
  line-height: 1.55;
}

.business-profile-review-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.68);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.business-profile-review-status strong {
  color: var(--text);
}

.business-profile-review-status--warning {
  border-color: rgba(248, 179, 52, 0.34);
  background: rgba(255, 244, 214, 0.78);
  color: #6f4c00;
}

.business-profile-review-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-profile-review-card .section-head {
  margin-bottom: 14px;
}

.business-profile-review-card .form-notice {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .business-profile-review-header__top {
    display: grid;
  }

  .business-profile-review-cards {
    grid-template-columns: 1fr;
  }
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading .section-head p {
  margin-top: 12px;
}

.section-heading h2 {
  margin-top: 10px;
  font-size: 1.6rem;
}

.route-pill .eyebrow,
.dashboard-demo-card .eyebrow {
  width: fit-content;
  margin-bottom: 0;
}

.organisation-list {
  display: grid;
  gap: 12px;
}

.organisation-list__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.dashboard-card-grid--value {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.onboarding-progress {
  width: 100%;
  height: 12px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(194, 214, 236, 0.45);
  overflow: hidden;
}

.onboarding-progress__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent) 0%, #58a8ff 100%);
}

.dashboard-demo-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 248, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.dashboard-demo-card--loaded {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.82), rgba(255, 255, 255, 0.94));
}

.dashboard-demo-card h3 {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.dashboard-demo-card form {
  margin: 0;
}

.dashboard-demo-card--compact {
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 14px 16px;
}

.dashboard-first-action-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.dashboard-first-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-first-action-option {
  display: grid;
  gap: 10px;
}

.dashboard-first-action-option h4 {
  margin: 0;
  font-size: 1.1rem;
}

.dashboard-first-action-option form {
  margin: 0;
}

.dashboard-tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-tutorial-card {
  display: grid;
  gap: 16px;
  padding: 22px 24px;
}

.dashboard-secondary-details {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(248, 251, 255, 0.78);
}

.dashboard-secondary-details[hidden],
.dashboard-guide-panel[hidden],
.guide-mode-panel[hidden] {
  display: none;
}

.dashboard-guide-scope {
  display: grid;
  gap: 20px;
}

.guide-mode-shell {
  display: grid;
  gap: 12px;
}

.guide-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.guide-mode-toolbar strong {
  display: block;
  margin-top: 2px;
}

.dashboard-secondary-details__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
}

.dashboard-secondary-details__heading strong {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.dashboard-secondary-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.dashboard-secondary-details summary strong {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.dashboard-secondary-details[open] summary {
  margin-bottom: 14px;
}

.dashboard-tutorial-card__content {
  display: grid;
  gap: 10px;
}

.dashboard-tutorial-card__content h3 {
  font-size: 1.22rem;
}

.dashboard-tutorial-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dashboard-tutorial-card__next-step {
  color: var(--muted);
  font-size: 0.94rem;
}

.onboarding-checklist {
  display: grid;
  gap: 14px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px 20px;
}

.onboarding-step--complete {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.82), rgba(255, 255, 255, 0.94));
}

.onboarding-step h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.onboarding-step__meta {
  display: inline-flex;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.onboarding-step__actions {
  align-self: center;
}

.onboarding-step__actions {
  display: flex;
  justify-content: flex-end;
}

.tutorial-path-metrics {
  margin-bottom: 20px;
}

.tutorial-step-list {
  display: grid;
  gap: 14px;
}

.tutorial-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px;
}

.tutorial-step--complete {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.82), rgba(255, 255, 255, 0.94));
}

.tutorial-step__content {
  display: grid;
  gap: 10px;
}

.tutorial-step h3 {
  font-size: 1.15rem;
}

.tutorial-step__why {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.08);
}

.tutorial-step__why strong {
  color: var(--ink-strong);
  font-size: 0.95rem;
}

.tutorial-step__meta {
  display: inline-flex;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.tutorial-step__actions {
  align-self: center;
  display: flex;
  justify-content: flex-end;
}

.tutorial-path-sidebar__grid {
  display: grid;
  gap: 12px;
}

@media (max-width: 1100px) {
  .public-hero,
  .auth-shell,
  .dashboard-panels,
  .article-reading-layout,
  .article-category-layout {
    grid-template-columns: 1fr;
  }

  .workspace-main {
    margin-left: 0;
    padding-left: 0;
  }

  .workspace-mobile-bar {
    display: flex;
  }

  .workspace-sidebar {
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    transform: translateX(calc(-100% - 16px));
    border-radius: 24px;
    /* A CLOSED DRAWER MUST LEAVE THE TAB ORDER, NOT ONLY THE SCREEN.
       `transform` moves the panel out of sight and changes nothing about
       focus, so at 1100px and below the twelve navigation controls inside
       this drawer stayed keyboard-focusable while sitting at left = -294.
       Measured on 2026-10-28 at 305, 320, 375 and 390 CSS pixels: Tab from
       the top of /onboarding/first_run visited Close, MAIN, Dashboard,
       Funding & support, Notifications, Notification Preferences, Business
       Setup, Review centre, Tutorial, Billing & Plans, INCOME TAX and
       SETTINGS - all entirely off screen, each with a focus ring drawn
       somewhere the customer cannot see - before reaching the first control
       on the page. That is WCAG 2.4.11 Focus Not Obscured (Minimum), and in
       practice it is twelve presses of Tab into nothing.
       `visibility: hidden` is what removes a subtree from the tab order;
       the delayed visibility transition keeps the existing 0.35s slide-out
       visible on close rather than making the panel vanish mid-animation. */
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0s linear 0.35s;
  }

  .workspace-shell.is-drawer-open .workspace-sidebar {
    transform: translateX(0);
    /* Visible the instant the drawer starts opening, so the slide-in is seen
       and the controls inside are focusable for the whole of it. */
    visibility: visible;
    transition: transform 0.35s ease, visibility 0s linear 0s;
  }

  .workspace-sidebar__close {
    display: inline-flex;
  }

  .dashboard-card-grid,
  .dashboard-card-grid--value,
  .dashboard-tutorial-grid,
  .dashboard-first-action-grid,
  .public-feature-grid,
  .article-grid,
  .article-category-link-grid,
  .marketing-trust-strip,
  .marketing-feature-grid,
  .marketing-step-grid,
  .marketing-snapshot-grid,
  .testimonial-grid,
  .marketing-trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-nav,
  .marketing-cta,
  .public-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-reading-layout__rail,
  .article-category-layout__nav,
  .article-category-layout__aside {
    position: static;
  }
}

@media (max-width: 992px) {
  .public-shell,
  .auth-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .public-nav {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 720px) {
  :root {
    --page-gutter: 18px;
  }

  .page-frame {
    padding: var(--page-gutter);
  }

  .public-hero__copy,
  .auth-panel,
  .public-hero__panel,
  .auth-card,
  .public-nav,
  .workspace-header,
  .dashboard-panels > .card,
  .summary-card,
  .dii-card,
  .compliance-card,
  .readiness-card,
  .review-panel,
  .dashboard-panel,
  .warning-card,
  .card-body:not(.p-0),
  .marketing-feature-card,
  .marketing-step-card,
  .marketing-snapshot-card,
  .testimonial-card,
  .marketing-trust-card,
  .marketing-timeline__item,
  .marketing-cta {
    padding: 22px;
  }

  .public-hero__copy h1,
  .auth-panel h1 {
    font-size: 2.5rem;
  }

  .dashboard-card-grid,
  .dashboard-card-grid--value,
  .dashboard-first-action-grid,
  .public-feature-grid,
  .article-grid,
  .article-category-link-grid,
  .marketing-trust-strip,
  .marketing-feature-grid,
  .marketing-step-grid,
  .marketing-snapshot-grid,
  .testimonial-grid,
  .marketing-trust-grid {
    grid-template-columns: 1fr;
  }

  .workspace-header__meta,
  .workspace-header__actions {
    width: 100%;
  }

  .workspace-header__meta-card {
    flex-basis: 100%;
  }

  .dashboard-first-value-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .dashboard-first-value-header .workspace-header__content {
    flex: 0 1 auto;
    max-width: none;
    width: 100%;
  }

  .dashboard-first-value-header .workspace-header__meta,
  .dashboard-first-value-header .workspace-header__actions {
    flex: 0 1 auto;
  }

  .dashboard-first-value-header .workspace-header__content h1 {
    font-size: 1.5rem;
  }

  .dashboard-first-value-header .workspace-header__content p {
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .dashboard-first-value-header .workspace-header__content .eyebrow {
    font-size: 0.7rem;
    padding: 6px 9px;
  }

  .dashboard-first-value-header .workspace-header__meta {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-first-value-header .workspace-header__meta-card {
    min-width: 0;
    padding: 8px 10px;
  }

  .dashboard-first-value-header .workspace-header__meta-card span {
    font-size: 0.7rem;
  }

  .dashboard-first-value-header .workspace-header__meta-card strong {
    font-size: 0.88rem;
  }

  .dashboard-first-value-header .workspace-header__actions {
    display: grid;
    gap: 6px;
  }

  .private-beta-readiness-board__heading,
  .private-beta-status-summary,
  .private-beta-section-grid {
    grid-template-columns: 1fr;
  }

  .private-beta-readiness-board__heading {
    flex-direction: column;
  }

  .private-beta-item__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-header,
  .organisation-list__item,
  .dashboard-demo-card,
  .dashboard-tutorial-card__meta,
  .setup-copilot-strip,
  .onboarding-step,
  .tutorial-step,
  .public-footer,
  .workspace-mobile-bar {
    flex-direction: column;
  }

  /* `.workspace-header` carries `flex-wrap: wrap` from its base rule, where it
     wraps a too-wide ROW onto a second row. Turned to `flex-direction: column`
     just above, that same declaration means something else entirely: the main
     axis is now vertical, so a line that does not fit wraps into a second
     COLUMN, side by side with the first.

     An auto-height column-wrap container sizes its main axis to its tallest
     item and then packs the rest beside it. On /bank_transactions at 390px the
     heading block is 753px tall, so the meta strip and the actions each
     started a new column: the actions landed at x=667 inside a container whose
     client width is 337 and whose `overflow-x` is hidden. Both header actions
     were clipped away with no way to scroll to them, which on the bank screen
     is the only "Add account" and on /reconciliation is every settlement start.

     Nothing was wrong with the stacking rules. `.workspace-header__actions`
     did get `width: 100%` and its buttons did get `width: 100%`; they were
     297px wide and correctly stretched, just 330px to the right of the screen.
     The axis was the bug, so the axis is what this fixes. */
  .workspace-header {
    flex-wrap: nowrap;
  }

  /* THE SAME MECHANISM AGAIN, ON THE OTHER AXIS, AND STILL LIVE.
     `flex-wrap: nowrap` above stopped the header packing a second COLUMN
     beside the first. It did not stop the header overflowing its own card
     downwards, because the base rule

       .workspace-header__meta { flex: 1 0 min(100%, 660px); }   (:3067)

     was written for a ROW axis, where `min(100%, 660px)` is a 660px-WIDE meta
     strip that may grow and must not shrink. Turned to `flex-direction: column`
     just above, the basis is a HEIGHT and `flex-shrink: 0` means the strip
     refuses to give any of it back - so a header with four meta cards claims
     660px of vertical space whatever else is in the card.

     MEASURED on /credit_notes/:id at 390 CSS pixels before this rule:
     `.workspace-header` clientHeight 901, scrollHeight 1232 - 331px clipped by
     `.card { overflow: hidden }` (:1064) - with children content 272 + meta 660
     + actions 216 and two 20px gaps. The actions block sat at top 1347 inside a
     card whose box ended at 1255, so ALL FOUR of that screen's controls - Edit
     draft, Print / Save as PDF, Approve credit note and Void - were outside the
     card entirely. Chrome's own displayedness test agreed: `displayed?` was
     false for each of them, and a customer on a phone could not approve or void
     a credit note at all. Swept at the same width, /dashboard, /invoices/:id,
     /contacts and /expenses each measured clientHeight == scrollHeight and zero
     clipped controls, so this was the one screen tall enough to show it - not a
     reason to leave the mechanism in place.

     AFTER this rule, same screen and width: the meta strip is 281px rather
     than 660px, `.workspace-header` measures clientHeight 901 == scrollHeight
     901, zero controls are clipped, and all four are `displayed?`. Re-swept
     across 320, 375, 390 and 1425 CSS pixels over /dashboard, /invoices/:id,
     /credit_notes/:id, /contacts, /expenses, /reconciliation and
     /bank_transactions: every header measures clientHeight == scrollHeight and
     zero clipped controls, and every figure at 1425 is byte-identical to the
     figures before the change. Nothing above 1100px is touched: the row axis
     keeps the 660px basis, which is what it was written for. */
  .workspace-header__meta {
    flex: 0 0 auto;
  }

  .onboarding-step,
  .tutorial-step {
    grid-template-columns: 1fr;
  }

  .marketing-timeline__item {
    grid-template-columns: 1fr;
  }

  .testimonial-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-body {
    padding: 24px;
  }

  .article-reading-layout__content {
    order: 1;
  }

  .article-reading-layout__rail--nav {
    order: 2;
  }

  .article-reading-layout__rail--context {
    order: 3;
  }

  .article-category-layout__content {
    order: 1;
  }

  .article-category-layout__nav {
    order: 2;
  }

  .article-category-layout__aside {
    order: 3;
  }

  .public-nav__links {
    justify-content: flex-start;
  }

  .workspace-mobile-bar {
    align-items: flex-start;
  }
}

.workspace-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
  justify-content: flex-end;
  align-items: center;
}

.invoice-overview-grid,
.payment-overview-grid {
  align-items: stretch;
}

.invoice-overview-card,
.payment-overview-card,
.contact-form-card,
.contact-summary-card,
.invoice-form-card,
.invoice-summary-card,
.payment-summary-card,
.filter-card,
.contacts-filter-card {
  min-height: 100%;
}

.invoice-overview-card p,
.payment-overview-card p,
.contact-form-card p,
.contact-summary-card p,
.invoice-summary-card p,
.payment-summary-card p,
.filter-card p,
.contacts-filter-card p {
  margin-bottom: 0;
}

.contact-card,
.invoice-card,
.payment-card {
  min-height: 100%;
}

.contact-card__header p,
.invoice-card__header p,
.payment-card__header p {
  margin: 0;
  color: var(--muted-text);
  max-width: 52ch;
}

.contact-card__trace,
.invoice-card__trace,
.payment-card__trace {
  align-items: stretch;
}

.contact-card__trace-item,
.invoice-card__trace-item,
.payment-card__trace-item,
.contact-card__meta .metric,
.invoice-card__detail,
.payment-card__detail,
.contact-detail-item,
.payment-context-item,
.invoice-summary-list > div {
  min-height: 100%;
}

.contact-card__actions,
.invoice-card__actions,
.payment-card__actions,
.contact-form-actions {
  align-items: stretch;
}

.contact-form-actions {
  justify-content: flex-start;
  padding-top: 4px;
}

.filter-card form,
.contacts-filter-card form,
.vat-code-filter-card form {
  display: grid;
  gap: 18px;
}

.report-summary-card,
.report-detail-card,
.import-form-card,
.raw-data-card,
.bank-account-card,
.reconciliation-workspace-card,
.reconciliation-queue-card,
.dii-card,
.compliance-card,
.readiness-card,
.review-panel,
.dashboard-panel,
.export-panel,
.evidence-panel,
.banking-panel,
.warning-card,
.settlement-summary-card,
.settlement-form-card,
.report-dashboard-card,
.journal-summary-card,
.accounting-period-card,
.ledger-account-card,
.guided-onboarding-panel {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.report-summary-card,
.report-detail-card,
.import-form-card,
.raw-data-card,
.bank-account-card,
.reconciliation-workspace-card,
.reconciliation-queue-card,
.dii-card,
.compliance-card,
.readiness-card,
.review-panel,
.dashboard-panel,
.export-panel,
.evidence-panel,
.banking-panel,
.warning-card,
.settlement-card,
.settlement-summary-card,
.settlement-form-card,
.report-dashboard-card,
.journal-summary-card,
.accounting-period-card,
.ledger-account-card,
.journal-entry-card,
.guided-onboarding-panel {
  /* display: grid; */
  gap: 18px;
}

.card-body:not(.p-0) {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.card-with-body {
  padding: 0;
}

.dii-card__body {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.dii-card > .section-heading:first-child,
.compliance-card > .section-heading:first-child,
.readiness-card > .section-heading:first-child,
.review-panel > .section-heading:first-child,
.dashboard-panel > .section-heading:first-child,
.export-panel > .section-heading:first-child,
.evidence-panel > .section-heading:first-child,
.banking-panel > .section-heading:first-child {
  margin-bottom: 0;
}

.dii-card .button_to,
.compliance-card .button_to,
.readiness-card .button_to,
.review-panel .button_to,
.dashboard-panel .button_to,
.export-panel .button_to,
.evidence-panel .button_to,
.banking-panel .button_to {
  width: fit-content;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.summary-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-list dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 700;
}

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

.compliance-card .list-unstyled {
  display: grid;
  gap: 12px;
}

.compliance-card .list-unstyled li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.86);
}

.callout {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(194, 214, 236, 0.8);
  background: rgba(245, 249, 255, 0.92);
}

.callout--success {
  border-color: rgba(66, 173, 117, 0.28);
  background: rgba(236, 253, 245, 0.9);
}

.callout--warning {
  border-color: rgba(232, 150, 54, 0.3);
  background: rgba(255, 247, 237, 0.92);
}

.hmrc-sandbox-page {
  display: grid;
  gap: 18px;
  padding-bottom: clamp(48px, 10vw, 96px);
}

.hmrc-sandbox-card {
  overflow: hidden;
}

.hmrc-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.hmrc-status-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hmrc-status-tile {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.86);
}

.hmrc-status-tile__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hmrc-obligations-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(150px, 0.75fr));
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}

.hmrc-obligations-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.hmrc-obligations-form .muted,
.hmrc-obligations-form .form-error {
  margin-top: 8px;
}

.hmrc-obligations-form .filters-grid__actions {
  align-self: end;
}

.hmrc-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.hmrc-table-wrap .table {
  min-width: 720px;
  margin-bottom: 0;
}

.hmrc-json-details {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.86);
}

.hmrc-json-details summary {
  cursor: pointer;
  font-weight: 800;
}

.hmrc-json-block {
  margin: 12px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 12px;
  background: #101828;
  color: #e6edf7;
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .hmrc-sandbox-page {
    padding-bottom: 128px;
  }

  .hmrc-status-grid,
  .hmrc-status-grid--compact,
  .hmrc-obligations-form {
    grid-template-columns: 1fr;
  }

  .hmrc-status-tile,
  .hmrc-json-details,
  .hmrc-json-block {
    padding: 12px 14px;
  }
}

.muted {
  color: var(--muted-text);
}

.section-heading,
.section-head {
  display: grid;
  gap: 10px;
}

.section-heading + .filters-grid,
.section-heading + .form-grid,
.section-heading + .stacked-form,
.section-heading + .stack-form,
.section-heading + .table-shell,
.section-heading + .report-table,
.section-heading + .audit-trail-list,
.section-head + .filters-grid,
.section-head + .form-grid,
.section-head + .stacked-form,
.section-head + .stack-form {
  margin-top: 18px;
}

.table-shell + .pagination-shell,
.audit-trail-list + .pagination-shell,
.report-table + .pagination-shell {
  margin-top: 18px;
}

.contact-form-card .section-head p,
.invoice-form-card .section-head p,
.invoice-summary-card .section-head p,
.payment-summary-card .section-head p,
.filter-card .section-head p,
.contacts-filter-card .section-head p {
  max-width: 48rem;
}

.contact-summary-card,
.invoice-summary-card,
.payment-summary-card {
  display: grid;
  /* WCAG 1.4.4. The implicit `auto` column takes its width from the widest
     item's min-content and refuses to shrink to the card, so at 200% text every
     child measured 297px inside a 278px card and `.card`'s `overflow: hidden`
     cut 79px of it off. `minmax(0, 1fr)` lets the track shrink to its
     container; `min-width: 0` lets the items inside it do the same, which the
     nested summary grid needs too. Caught by
     spec/accessibility/resize_text_spec.rb. */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  /* Inherited, so this one declaration reaches every text descendant: the
     heading that cannot break "Organisation", and the summary list's 104px
     cells that cannot fit "Company number" once it is 32px. */
  overflow-wrap: break-word;
}

.contact-summary-card > *,
.invoice-summary-card > *,
.payment-summary-card > *,
.invoice-summary-list {
  min-width: 0;
}

.contact-summary-card > .eyebrow,
.contact-summary-card > h2,
.contact-summary-card > p {
  margin: 0;
}

.contact-summary-card > h2 {
  font-size: 1.45rem;
}

.invoice-summary-list,
.payment-context-list,
.contact-detail-list {
  align-items: stretch;
}

.contacts-filter-card,
.contact-form-card,
.contact-future-card {
  padding: 24px 28px;
}

.contacts-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(180px, 0.6fr)) auto;
  gap: 16px;
  align-items: end;
  margin-top: 22px;
}

.contacts-filters__actions,
.contact-form-actions,
.contacts-show-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.contact-card {
  padding: 24px;
  display: grid;
  gap: 22px;
}

.contact-card__header,
.contact-card__actions,
.contact-card__badges {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-card__primary {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.contact-card__header h2 {
  font-size: 1.45rem;
}

.contact-card__trace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-card__trace-item {
  display: grid;
  gap: 4px;
}

.contact-card__trace-item span,
.contact-detail-item dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-card__trace-item strong {
  color: var(--text);
  font-size: 1rem;
}

.contact-card__meta,
.contact-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.contact-card__meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card__meta-item {
  display: grid;
  gap: 6px;
}

.contact-card__meta dt,
.contact-detail-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact-card__meta dd,
.contact-detail-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
  /* 1.4.10 Reflow. These <dd>s carry email addresses, which contain no break
     opportunity, so their min-content width is the whole address. The base
     grid above is `repeat(n, minmax(0, 1fr))` precisely so a column cannot be
     forced wider than its share - but the narrow-width blocks below override
     it with a bare `1fr`, which is `minmax(auto, 1fr)` and restores the
     min-content floor. A 24-character address - `accounts@northwind.co.uk`,
     an ordinary one - then set the card's content width to 252px inside a
     219px content box at 305 CSS px, and `article.card`'s `overflow-x:
     hidden` clipped the View and Edit buttons off the right-hand edge of
     every contact card. Measured at a genuine 320 CSS px too: a 33-character
     address clips both buttons there as well, so this is the criterion's own
     width and not a harness artefact. Page overflow stays 0 throughout, which
     is why the scrollWidth sweeps read clean.

     `anywhere` rather than `break-word` because only `anywhere` also reduces
     the intrinsic min-content width, which is what stops the grid parent
     being forced wider; it matches the other overflow-wrap rules in this
     file. */
  overflow-wrap: anywhere;
}

.contact-detail-item {
  display: grid;
  gap: 6px;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.contact-badge--role-customer {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.contact-badge--role-supplier {
  background: rgba(27, 153, 125, 0.12);
  color: #176650;
}

.contact-badge--role-both {
  background: rgba(75, 114, 212, 0.12);
  color: #3d57a8;
}

.contact-badge--status-active {
  background: var(--success-soft);
  color: var(--success-text);
}

.contact-badge--status-archived {
  background: rgba(89, 114, 141, 0.14);
  color: #51697f;
}

.empty-state {
  padding: 36px;
  display: grid;
  gap: 16px;
  justify-items: start;
}

.pagination-shell {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagy.series-nav {
  display: inline-flex;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.pagy.series-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.pagy.series-nav a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(31, 122, 228, 0.14), rgba(88, 168, 255, 0.22));
  color: var(--text);
}

.contact-form-layout {
  display: grid;
  gap: 18px;
}

.contact-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.contact-form-main,
.contact-form-sidebar {
  display: grid;
  gap: 18px;
}

.contact-form-sidebar {
  align-content: start;
}

.contact-form-card,
.contact-summary-card {
  padding: 24px 28px;
}

.contact-form-card .section-head p,
.contact-summary-card p {
  max-width: 48rem;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field textarea,
.form-field textarea,
.filter-select {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.field textarea:focus,
.form-field textarea:focus,
.filter-select:focus {
  outline: 2px solid rgba(31, 122, 228, 0.18);
  border-color: var(--accent);
}

.contacts-show-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.contact-summary-card {
  display: grid;
  gap: 16px;
}

.contact-summary-card h2 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.5rem;
}

.contact-summary-list {
  gap: 12px;
}

.contact-header-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.contact-header-metric {
  display: grid;
  gap: 6px;
}

.contact-header-metric strong {
  font-size: 1.1rem;
}

.contact-address {
  display: grid;
  gap: 6px;
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

.future-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.future-placeholder-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--card-muted);
  border: 1px solid rgba(194, 214, 236, 0.9);
}

.future-placeholder-card strong {
  display: block;
  margin-bottom: 10px;
}

@media (max-width: 1100px) {
  .contact-form-shell,
  .contacts-filters,
  .contacts-grid,
  .contacts-show-grid,
  .future-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .contact-header-metrics,
  .contact-card__trace,
  .contact-card__meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .setup-wizard-progress-summary,
  .contact-form-grid,
  .contact-card__meta,
  .contact-detail-list {
    grid-template-columns: 1fr;
  }

  .contact-form-actions .button,
  .contact-form-actions .button_to,
  .contact-card__actions .button,
  .contact-card__actions .button_to,
  .contacts-show-actions .button,
  .contacts-show-actions .button_to {
    width: 100%;
  }
}

.vat-code-overview-grid,
.vat-code-show-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.vat-code-overview-card,
.vat-code-form-card,
.vat-code-summary-card,
.vat-code-filter-card {
  padding: 24px 28px;
}

.vat-code-overview-card h2,
.vat-code-summary-card h2 {
  margin-top: 12px;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.vat-code-default-list {
  display: grid;
  gap: 14px;
}

.vat-code-default-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vat-code-default-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.vat-code-filter-card {
  margin-top: 18px;
}

.vat-code-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(180px, 0.6fr)) auto;
  gap: 16px;
  align-items: end;
}

.vat-code-filters__actions,
.vat-code-default-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.vat-code-list {
  display: grid;
  gap: 18px;
}

.vat-code-card {
  padding: 24px 28px;
  display: grid;
  gap: 18px;
}

.vat-code-card__header,
.vat-code-card__actions,
.vat-code-card__badges,
.vat-code-card__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.vat-code-card__code {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 122, 228, 0.1);
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.vat-code-card__header h2 {
  font-size: 1.45rem;
}

.vat-code-card__rate strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
}

.vat-code-card__meta {
  max-width: 48rem;
  display: grid;
  gap: 8px;
}

.vat-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.vat-code-badge--usage-sales {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.vat-code-badge--usage-purchases {
  background: rgba(27, 153, 125, 0.12);
  color: #176650;
}

.vat-code-badge--usage-both {
  background: rgba(75, 114, 212, 0.12);
  color: #3d57a8;
}

.vat-code-badge--treatment-standard,
.vat-code-badge--treatment-reduced,
.vat-code-badge--treatment-zero,
.vat-code-badge--treatment-exempt,
.vat-code-badge--treatment-outside_scope,
.vat-code-badge--treatment-reverse_charge,
.vat-code-badge--treatment-postponed_import {
  background: rgba(89, 114, 141, 0.12);
  color: #4d6277;
}

.vat-code-badge--status-active {
  background: var(--success-soft);
  color: var(--success-text);
}

.vat-code-badge--status-archived {
  background: rgba(89, 114, 141, 0.14);
  color: #51697f;
}

.vat-code-badge--default {
  background: rgba(255, 224, 169, 0.4);
  color: #8b6400;
}

.vat-code-form-layout {
  display: grid;
  gap: 18px;
}

.vat-code-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.vat-code-checkboxes,
.vat-code-usage-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.compact-link-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compact-link-list--chips {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .vat-code-overview-grid,
  .vat-code-show-grid,
  .vat-code-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .vat-code-form-grid,
  .vat-code-usage-columns,
  .compact-link-list--chips {
    grid-template-columns: 1fr;
  }
}

.workspace-header__actions .button_to {
  margin: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.currency-valuation-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.currency-valuation-form .section-heading h3 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.currency-valuation-form .section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.currency-valuation-form__preview {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 122, 228, 0.06);
  color: var(--text);
  font-weight: 700;
}

.field-error {
  margin-top: 8px;
  color: var(--alert-text);
  font-size: 0.84rem;
  font-weight: 600;
}

/* The account proposal offered beside a purchase line's picker. Deliberately quiet: it is a suggestion,
   not a warning, and the person is free to ignore it and leave the line on the document default. */
.line-account-suggestion {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.line-account-suggestion[hidden] {
  display: none;
}

.line-account-suggestion__reason {
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.line-account-suggestion__accept {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.line-account-suggestion__accept[hidden] {
  display: none;
}

/* BILLSHIFT-02. The panel floats in the top layer instead of pushing the page down.

   It used to be an ordinary in-flow box, so unhiding it moved the submit button out from under the
   pointer and the form was silently never submitted. Three cheaper fixes were tried and rejected:
   `position: absolute` inside the already-relative `.field` is clipped by `.card { overflow: hidden }`
   (application.css:1064) and makes the accept button unclickable; relaxing that clip is refused on
   precedent, since it is what keeps Edit/Print/Approve/Void inside a card and is load-bearing at 200%
   text and 320px reflow; and reserving the space costs 600-1000px of permanent dead area on a five-line
   bill, because this partial renders once PER LINE.

   `popover` is the only mechanism that leaves the DOM, the live region and the focus order alone. The
   top layer is painted outside every ancestor's clip, and a top-layer element's containing block is the
   viewport - so neither `.card { overflow: hidden }` nor `.invoice-lines-table { container-type:
   inline-size }` (application.css:13817, whose layout containment WOULD trap an ordinary
   `position: fixed` descendant) can reach it.

   Two positioning modes, because CSS anchor positioning is not everywhere yet:

     [data-positioning="anchor"]    anchor() and anchor-size(), set by the controller when the browser
                                    supports them. The browser keeps the panel attached through scroll,
                                    resize and reflow with no JavaScript at all.
     [data-positioning="measured"]  inline top/left/width written by the controller from the select's
                                    rectangle, re-written on scroll, resize and resize-observation.

   The controller picks the mode; `data-line-account-suggestion-positioning-value` forces one, which is
   how the headless-Chrome suite exercises the measured path on a browser that would otherwise always
   take the anchor path. */

/* The author rule that must exist. The UA sheet hides a closed popover, but
   `.line-account-suggestion { display: flex }` above is an AUTHOR declaration and beats it - without
   this the closed panel would render in the flow and the defect would be back. */
.line-account-suggestion[popover]:not(:popover-open) {
  display: none;
}

.line-account-suggestion[popover]:popover-open {
  /* The UA sheet centres an open popover with `inset: 0; margin: auto`. All of that is replaced. */
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 10px 12px;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-sm, 8px);
  background: var(--card, #ffffff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.line-account-suggestion[popover][data-positioning="anchor"]:popover-open {
  top: anchor(bottom);
  left: anchor(left);
  width: anchor-size(width);
  max-width: none;
  margin-block: 6px;
  /* No room below the field - usually the last line of a long bill - so flip above it rather than
     hang off the bottom of the viewport. */
  position-try-fallbacks: flip-block;
}

.field .is-invalid,
.form-field .is-invalid,
.filter-select.is-invalid {
  border-color: var(--alert-text) !important;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14), inset 0 1px 2px rgba(37, 99, 235, 0.04);
}

.business-setup-validation-summary {
  scroll-margin-top: 120px;
}

.business-setup-validation-summary a {
  color: var(--accent-strong);
  font-weight: 700;
}

.invoice-overview-grid,
.invoice-show-grid,
.invoice-form-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.invoice-overview-card,
.invoice-form-card,
.invoice-summary-card,
.invoice-lines-card,
.filter-card {
  padding: 24px 28px;
}

.invoice-overview-card h2,
.invoice-summary-card h2 {
  margin-top: 16px;
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.invoice-overview-card--metric h2 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(180px, 0.7fr)) auto;
  gap: 16px;
  align-items: end;
  margin-top: 22px;
}

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

.invoice-list {
  display: grid;
  gap: 18px;
}

.invoice-card {
  padding: 24px 28px;
  display: grid;
  gap: 22px;
}

.invoice-card__header,
.invoice-card__actions,
.invoice-card__badges {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.invoice-card__primary {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.invoice-card__header h2 {
  font-size: 1.45rem;
}

/* WCAG 1.4.10 and 1.4.12, inside the card rather than at the page edge.

   A list card's heading is a document reference - an invoice number, a bill
   number, a bank account name - and a real one is a single unbreakable token:
   `INV-2026-000148-HOLLINGSWORTH` is 29 characters with no space in it. At a
   measured 320 CSS pixels with the four 1.4.12 overrides applied, that heading
   laid out 299px wide inside a card whose content box is 282px, and
   `.card { overflow: hidden }` (:1064) cut the last 17px off rather than
   letting the page scroll. MEASURED: page-level
   `scrollWidth - clientWidth` was 0 throughout - the document never widened,
   so every page-level reflow assertion in this repository passed over it.
   The same card with `INV-001` measures scrollWidth 282 == clientWidth 282.

   `overflow-wrap: anywhere` rather than `break-word` to match the twelve
   existing rules in this file, and because `anywhere` is also taken into
   account when the intrinsic minimum width is computed - which is what stops
   the card being forced wider than its column in the first place. */
.invoice-card__header h2,
.contact-card__header h2,
.payment-card__header h2,
.bank-account-card__header h2 {
  overflow-wrap: anywhere;
}

.invoice-card__details,
.invoice-summary-list {
  display: grid;
  gap: 14px;
}

.invoice-card__details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-card__detail {
  display: grid;
  gap: 6px;
}

.invoice-card__details dt,
.invoice-summary-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-card__details dd,
.invoice-summary-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.invoice-card__trace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  /* The bank account card renders this as a <dl>; keep it flush like the <div> on the invoice card. */
  margin: 0;
}

.invoice-card__trace-item {
  display: grid;
  gap: 4px;
}

.invoice-card__trace-item span,
.invoice-notes-stack .side-card span,
.invoice-context-item dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-card__trace-item strong {
  color: var(--text);
  font-size: 1rem;
}

.invoice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.invoice-badge--status-draft {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.invoice-badge--status-unmatched {
  background: rgba(255, 224, 169, 0.42);
  color: #8b6400;
}

.invoice-badge--status-suggested {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.invoice-badge--status-review_required {
  background: rgba(248, 179, 52, 0.18);
  color: #8b6400;
}

.invoice-badge--status-issued {
  background: rgba(255, 224, 169, 0.42);
  color: #8b6400;
}

.invoice-badge--status-sent {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.invoice-badge--status-partially_paid {
  background: rgba(75, 114, 212, 0.12);
  color: #3d57a8;
}

.invoice-badge--status-overdue {
  background: rgba(239, 68, 68, 0.12);
  color: var(--alert-text);
}

.invoice-badge--status-matched,
.invoice-badge--status-reconciled {
  background: var(--success-soft);
  color: var(--success-text);
}

.invoice-badge--status-open {
  background: rgba(255, 224, 169, 0.42);
  color: #8b6400;
}

.invoice-badge--status-paid {
  background: var(--success-soft);
  color: var(--success-text);
}

.invoice-badge--status-recorded {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.invoice-badge--status-ignored {
  background: rgba(89, 114, 141, 0.14);
  color: #51697f;
}

.invoice-badge--status-voided,
.invoice-badge--balance {
  background: rgba(89, 114, 141, 0.14);
  color: #51697f;
}

.invoice-form-layout,
.invoice-form-main,
.invoice-form-sidebar {
  display: grid;
  gap: 18px;
}

.invoice-form-sidebar {
  align-self: start;
  position: sticky;
  top: 24px;
}

.invoice-form-shell {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  align-items: start;
}

.invoice-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.invoice-lines-table {
  display: grid;
  gap: 14px;
}

.invoice-lines-header,
.invoice-line-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 2fr) minmax(90px, 0.7fr) minmax(130px, 0.9fr) minmax(220px, 1.2fr) minmax(120px, 0.9fr) auto;
  gap: 14px;
  align-items: start;
}

.invoice-lines-header {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-line-row {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.94));
  box-shadow: var(--shadow-sm);
}

.journal-adjustment-table {
  display: grid;
  gap: 14px;
}

.journal-adjustment-header,
.journal-adjustment-row {
  display: grid;
  /* The description column was minmax(0, 1.25fr), which made it the only track
     allowed to collapse - so when the row ran out of width it took all of the
     loss and rendered 34px wide. A 34px text field is unusable, and axe reported
     it as WCAG 2.5.8 target size, which is the symptom rather than the cause.
     A floor of 160px makes every track share the squeeze; the row wraps below. */
  grid-template-columns: 56px minmax(220px, 1fr) minmax(160px, 1.25fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) auto;
  gap: 14px;
  align-items: start;
}

/* Below the width where all six tracks fit, stack rather than crush. Keeping the
   grid at six columns any narrower is what produced the 34px field. */
@media (max-width: 1100px) {
  .journal-adjustment-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

.journal-adjustment-header {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.journal-adjustment-row {
  padding: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  background: var(--card-muted);
}

.journal-adjustment-row__actions {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.invoice-line-row__position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 16px;
  background: rgba(31, 122, 228, 0.1);
  color: var(--accent-strong);
  font-weight: 800;
}

.invoice-line-row__total {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  font-weight: 800;
  color: var(--text);
}

.invoice-line-row__remove {
  display: grid;
  gap: 8px;
  align-self: stretch;
}

.invoice-line-row__remove .button {
  width: 100%;
}

/* The line's account select (Phase 3b-0) sits on its own row under the amounts:
   it is offered only when there is a choice, so it has no header column. */
.invoice-line-row__account {
  grid-column: 2 / -1;
  max-width: 520px;
}

.invoice-line-row__account-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.invoice-line-row__errors {
  grid-column: 2 / -1;
  color: var(--alert-text);
  font-size: 0.86rem;
  font-weight: 600;
}

/* WCAG 4.1.2: `display: none` removed these from the accessibility tree, so the
   VAT code select on an invoice line had no accessible name at all and the other
   line controls fell back to their placeholder. Clipped instead of hidden: the
   label still does not take space, and a screen reader still reads it. The
   mobile breakpoint below restores it to view. */
.invoice-line-row__field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-summary-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.94)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 60%);
}

.invoice-summary-list .is-total {
  padding-top: 14px;
  border-top: 0;
}

.invoice-show-grid {
  align-items: start;
}

.invoice-header-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.invoice-header-metric {
  display: grid;
  gap: 6px;
}

.invoice-header-metric strong {
  font-size: 1.25rem;
}

.invoice-summary-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-summary-metric {
  display: grid;
  gap: 6px;
}

.invoice-context-item {
  display: grid;
  gap: 6px;
}

.invoice-context-item dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.invoice-lines-card {
  margin-top: 18px;
}

.invoice-show-table {
  display: grid;
  gap: 14px;
}

.invoice-show-table__header,
.invoice-show-table__row {
  display: grid;
  grid-template-columns: var(--invoice-show-table-columns, minmax(0, 2fr) repeat(3, minmax(120px, 0.7fr)) minmax(140px, 0.8fr));
  gap: 16px;
  align-items: center;
}

/* Internal line table with the ledger account each line posts to (Phase 3b-0). */
.invoice-show-table--with-account {
  --invoice-show-table-columns: minmax(0, 2fr) minmax(150px, 1fr) repeat(3, minmax(110px, 0.7fr)) minmax(130px, 0.8fr);
}

.invoice-show-table__header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-show-table__row {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.94));
  box-shadow: var(--shadow-sm);
}

.invoice-show-table__row:last-child {
  border-bottom: 0;
}

.invoice-show-table__row strong,
.invoice-show-table__row span {
  color: var(--text);
}

.invoice-show-table__mobile-label {
  display: none;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-notes-stack {
  display: grid;
  gap: 14px;
}

.customer-invoice {
  display: grid;
  gap: 26px;
  padding: 34px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 24px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.customer-invoice__header,
.customer-invoice__parties,
.customer-invoice__totals,
.customer-invoice__vat,
.customer-invoice__payments {
  display: grid;
  gap: 18px;
}

.customer-invoice__header {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
}

.customer-invoice__header h2 {
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
}

.customer-invoice__status {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.customer-invoice__identity,
.customer-invoice__parties > div,
.customer-invoice__payment {
  display: grid;
  gap: 7px;
}

.customer-invoice__identity {
  justify-items: end;
  text-align: right;
}

.customer-invoice__identity span,
.customer-invoice__parties span,
.customer-invoice__payment p,
.customer-invoice__footer {
  color: var(--muted);
}

.customer-invoice__parties {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Payment instructions and terms: two sections in the same column, so neither
   replaces the other. Their headings carry the label style, not heading sizes. */
.customer-document__section {
  display: grid;
  gap: 7px;
}

.customer-document__section + .customer-document__section {
  margin-top: 12px;
}

.customer-document__section > .customer-invoice__label {
  margin: 0;
  line-height: 1.4;
}

.customer-document__section p {
  margin: 0;
  overflow-wrap: anywhere;
}

.customer-invoice__line-vat-code {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.customer-invoice__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.customer-invoice__table {
  display: grid;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  overflow: hidden;
}

.customer-invoice__row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(70px, 0.45fr) minmax(110px, 0.65fr) minmax(110px, 0.65fr) minmax(120px, 0.75fr);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid rgba(194, 214, 236, 0.75);
}

.customer-invoice__row:first-child {
  border-top: 0;
}

.customer-invoice__row--head {
  background: rgba(243, 248, 255, 0.92);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-invoice__row--statement {
  grid-template-columns: minmax(92px, 0.55fr) minmax(120px, 0.75fr) minmax(0, 1.25fr) minmax(100px, 0.55fr) minmax(100px, 0.55fr) minmax(110px, 0.65fr);
}

.customer-document-copy-grid {
  display: grid;
  gap: 14px;
}

.customer-document-copy-grid textarea {
  min-height: 220px;
  resize: vertical;
}

.customer-document-delivery-card {
  align-self: start;
}

.customer-document-delivery-list {
  display: grid;
  gap: 12px;
}

.customer-document-delivery-list .side-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-document-link-card input {
  width: 100%;
  margin: 6px 0;
}

.customer-document-public-page {
  display: grid;
  gap: 16px;
}

.customer-document-public-actions {
  margin-top: 16px;
}

/* Notices on the public document page (the response confirmation, the expiry
   refusal, the sender's preview banner). The global muted paragraph colour
   falls just under 4.5:1 on the notice tints, so they use the ink colour. */
.customer-document-public-page .form-notice p,
.customer-document-public-page .form-notice strong {
  color: var(--ink);
}

.customer-document-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 760px) {
  .customer-document-response-grid {
    grid-template-columns: 1fr;
  }
}

.customer-invoice__totals {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  align-items: start;
}

.customer-invoice__totals dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.customer-invoice__totals dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.customer-invoice__totals dt,
.customer-invoice__totals dd {
  margin: 0;
}

.customer-invoice__totals dd {
  font-weight: 800;
}

.customer-invoice__grand-total {
  padding-top: 12px;
  border-top: 1px solid rgba(194, 214, 236, 0.9);
  font-size: 1.15rem;
}

.customer-invoice__vat,
.customer-invoice__payments {
  padding-top: 18px;
  border-top: 1px solid rgba(194, 214, 236, 0.9);
}

.customer-invoice__vat div,
.customer-invoice__payments div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.4fr) minmax(120px, 0.4fr);
  gap: 14px;
}

.customer-invoice__footer {
  padding-top: 20px;
  border-top: 1px solid rgba(194, 214, 236, 0.9);
  font-size: 0.86rem;
}

.invoice-print-body {
  min-height: 100vh;
  background: #eef4fb;
}

.invoice-print-page {
  width: min(980px, calc(100vw - 32px));
  margin: 28px auto;
  display: grid;
  gap: 18px;
}

.invoice-print-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-print-toolbar form {
  margin: 0;
}

.invoice-print-warning {
  padding: 18px 20px;
}

@media print {
  .invoice-print-body {
    background: #fff;
  }

  .invoice-print-page {
    width: 100%;
    margin: 0;
  }

  .invoice-print-toolbar,
  .invoice-print-warning {
    display: none;
  }

  .customer-invoice {
    box-shadow: none;
    border-color: #d7e2ed;
    border-radius: 0;
  }
}

.payment-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.payment-show-grid {
  align-items: start;
}

.expense-detail__full-width {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.expense-detail-grid .payment-summary-card {
  align-content: start;
  min-height: 0;
}

.expense-records-review__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.expense-records-review__item {
  min-width: 0;
}

.expense-records-review__item h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.expense-records-review__item h3,
.expense-records-review__item p {
  overflow-wrap: anywhere;
}

.payment-overview-card,
.payment-card {
  padding: 24px 28px;
}

.payment-overview-card h2 {
  margin-top: 16px;
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.payment-overview-card--metric h2 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.payment-list {
  display: grid;
  gap: 18px;
}

.payment-card {
  display: grid;
  gap: 22px;
}

.payment-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.payment-card__primary {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.payment-card__header h2 {
  font-size: 1.45rem;
}

.payment-card__badges {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.payment-card__trace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-card__trace-item {
  display: grid;
  gap: 4px;
}

.payment-card__trace-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-card__trace-item strong {
  color: var(--text);
  font-size: 1rem;
}

.payment-card__details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.payment-card__detail {
  display: grid;
  gap: 6px;
}

.payment-card__details dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payment-card__details dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.payment-card__actions {
  margin-top: 0;
}

.payment-form-layout {
  display: grid;
  gap: 18px;
}

.payment-header-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.payment-header-metric {
  display: grid;
  gap: 6px;
}

.payment-header-metric strong {
  font-size: 1.25rem;
}

.payment-summary-card .section-head,
.payment-allocation-card .section-head {
  max-width: none;
}

.payment-summary-metric {
  display: grid;
  gap: 6px;
}

.payment-context-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-context-item {
  display: grid;
  gap: 6px;
}

.payment-context-item dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.payment-allocation-table {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.payment-allocation-table__header,
.payment-allocation-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(120px, 0.7fr)) minmax(170px, 0.85fr);
  gap: 16px;
  align-items: center;
}

.payment-allocation-table__header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payment-allocation-table__row {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.94));
  box-shadow: var(--shadow-sm);
}

.payment-allocation-table__row strong,
.payment-allocation-table__row span {
  color: var(--text);
}

.payment-allocation-table__status {
  display: grid;
  gap: 8px;
}

.payment-allocation-table__mobile-label {
  display: none;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-allocation-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
}

.payment-allocation-input:focus {
  outline: 2px solid rgba(31, 122, 228, 0.18);
  border-color: var(--accent);
}

.settlement-type-switches {
  align-items: stretch;
}

.settlement-header-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.settlement-header-metric {
  display: grid;
  gap: 6px;
}

.settlement-header-metric strong {
  font-size: 1.15rem;
}

.settlement-form-layout,
.settlement-form-shell {
  display: grid;
  gap: 18px;
}

.settlement-form-card .section-head p,
.settlement-summary-card .section-head p,
.settlement-allocations-card .section-head p,
.settlement-bank-link-card .section-head p {
  max-width: none;
}

.settlement-checklist {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
  color: var(--muted-text);
}

.settlement-allocation-table {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.settlement-allocation-table__header,
.settlement-allocation-table__row {
  display: grid;
  gap: 16px;
  align-items: start;
}

.settlement-allocation-table--form .settlement-allocation-table__header,
.settlement-allocation-table--form .settlement-allocation-table__row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(140px, 0.8fr) minmax(170px, 0.85fr);
}

.settlement-allocation-table--show .settlement-allocation-table__header,
.settlement-allocation-table--show .settlement-allocation-table__row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.7fr) minmax(140px, 0.8fr);
}

.settlement-allocation-table__header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settlement-allocation-table__row {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 255, 0.94));
  box-shadow: var(--shadow-sm);
}

.settlement-allocation-table__record,
.settlement-allocation-table__context,
.settlement-allocation-table__remaining,
.settlement-allocation-table__allocated,
.settlement-allocation-table__input {
  display: grid;
  gap: 6px;
}

.settlement-allocation-table__record strong,
.settlement-allocation-table__remaining strong,
.settlement-allocation-table__allocated strong {
  color: var(--text);
}

.settlement-allocation-table__context span:last-child {
  color: var(--text);
}

.settlement-allocation-table__mobile-label {
  display: none;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settlement-bank-link-grid {
  margin-top: 8px;
}

.settlement-bank-link-actions {
  margin-top: 16px;
}

.settlement-bank-link-form {
  display: grid;
  gap: 16px;
}

.bank-overview-grid,
.bank-account-list,
.bank-transaction-list,
.bank-show-grid,
.payroll-overview-grid,
.payroll-show-grid,
.ledger-overview-grid,
.accounting-control-list,
.ledger-account-list,
.journal-entry-list,
.report-dashboard-grid,
.report-summary-grid,
.report-detail-grid {
  display: grid;
  gap: 18px;
}

.bank-overview-grid,
.bank-show-grid,
.payroll-overview-grid,
.payroll-show-grid,
.ledger-overview-grid,
.report-dashboard-grid,
.report-summary-grid,
.report-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-detail-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reconciliation-backlog-grid,
.reconciliation-workspace-list {
  display: grid;
  gap: 18px;
}

.settlement-list,
.reconciliation-queue {
  display: grid;
  gap: 18px;
}

.report-summary-card,
.report-detail-card,
.import-form-card,
.raw-data-card,
.bank-account-card,
.reconciliation-workspace-card,
.reconciliation-queue-card,
.settlement-card,
.settlement-summary-card,
.settlement-form-card,
.report-dashboard-card,
.journal-summary-card,
.accounting-period-card,
.ledger-account-card,
.journal-entry-card {
  min-height: 100%;
}

.report-summary-card p,
.report-detail-card p,
.import-form-card p,
.raw-data-card p,
.bank-account-card p,
.reconciliation-workspace-card p,
.reconciliation-queue-card p,
.settlement-card p,
.settlement-summary-card p,
.settlement-form-card p,
.report-dashboard-card p,
.journal-summary-card p,
.accounting-period-card p,
.ledger-account-card p,
.journal-entry-card p {
  margin-bottom: 0;
}

.report-summary-card > .eyebrow,
.report-summary-card > h2,
.report-summary-card > p,
.settlement-summary-card > .eyebrow,
.settlement-summary-card > h2,
.settlement-summary-card > p {
  margin: 0;
}

.report-summary-card > h2,
.settlement-summary-card > h2 {
  font-size: 1.5rem;
}

.report-summary-card .section-heading > div,
.report-detail-card .section-heading > div,
.import-form-card .section-heading > div,
.raw-data-card .section-heading > div,
.reconciliation-queue-group .section-heading > div,
.journal-summary-card .section-heading > div {
  display: grid;
  gap: 8px;
  max-width: 48rem;
}

.report-summary-card .section-heading h2,
.report-detail-card .section-heading h2,
.import-form-card .section-heading h2,
.raw-data-card .section-heading h2,
.reconciliation-queue-group .section-heading h2 {
  margin: 0;
}

.report-summary-card .section-heading p,
.report-detail-card .section-heading p,
.import-form-card .section-heading p,
.raw-data-card .section-heading p,
.journal-summary-card .section-heading p,
.reconciliation-queue-group .section-heading p,
.reconciliation-queue-card__panel p,
.reconciliation-queue-card__details p {
  margin: 0;
  max-width: 50rem;
}

.reconciliation-backlog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reconciliation-backlog-actions {
  margin-top: 18px;
}

.reconciliation-workspace-card {
  display: grid;
  gap: 18px;
}

.reconciliation-workspace-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.reconciliation-workspace-card__header h2 {
  margin-top: 10px;
  margin-bottom: 10px;
}

.reconciliation-workspace-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.reconciliation-workspace-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.reconciliation-workspace-card__metrics div {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(245, 249, 255, 0.94);
  border: 1px solid rgba(194, 214, 236, 0.9);
}

.reconciliation-workspace-card__metrics dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reconciliation-workspace-card__metrics dd {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.25rem;
  font-weight: 800;
  /* WCAG 1.4.4, measured on /bank_accounts with a connection on the page.
     The three columns are `minmax(0, 1fr)`, so each cell is free to shrink
     below its content. At 200% text a cell measured 95.5px while the value in
     it - "10 February 2027 17:54", "No successful run yet", "Awaiting a
     distinct no-change run" - needed 180 to 205px, and the card's
     `overflow: hidden` cut 41px off the right of it. The text already wraps;
     what it cannot do is break a word that is on its own wider than the
     column, which at 200% several of these are. */
  overflow-wrap: anywhere;
}

.reconciliation-workspace-card__context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reconciliation-workspace-card__actions {
  justify-content: flex-start;
}

.reconciliation-workspace-card__metrics div,
.reconciliation-queue-card__summary div,
.bank-account-card .invoice-card__details > div,
.settlement-card .payment-card__details > div,
.accounting-period-card__meta > div,
.ledger-account-card__meta > div,
.journal-entry-card__meta > div {
  min-height: 100%;
}

.reconciliation-workspace-card__context,
.reconciliation-queue-card__workflow,
.reconciliation-queue-group__meta,
.settlement-card__context {
  align-items: stretch;
}

.bank-account-card,
.bank-overview-card,
.bank-transaction-card,
.accounting-period-card,
.payroll-batch-card,
.raw-data-card,
.import-form-card,
.ledger-account-card,
.journal-entry-card,
.journal-summary-card,
.vat-workflow-card,
.vat-workflow-notice,
.vat-workflow-list-card,
.report-dashboard-card,
.report-detail-card,
.report-summary-card {
  padding: 24px;
}

.vat-workflow-card,
.vat-workflow-notice,
.vat-workflow-list-card,
.report-option-card {
  display: grid;
  gap: 18px;
}

.bank-account-card__header,
.bank-transaction-card__header,
.accounting-period-card__header,
.ledger-account-card__header,
.journal-entry-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.bank-account-card__header h2,
.bank-transaction-card__header h2,
.accounting-period-card__header h2,
.ledger-account-card__header h2,
.journal-entry-card__header h2 {
  margin-top: 10px;
}

.bank-account-card__badges,
.accounting-period-card__badges,
.journal-entry-card .invoice-card__badges,
.ledger-account-card .invoice-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.accounting-period-card,
.ledger-account-card,
.journal-entry-card,
.report-dashboard-card {
  display: grid;
  gap: 18px;
}

.accounting-period-card__context,
.journal-entry-card__context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.accounting-period-card__actions,
.journal-entry-card__actions,
.ledger-account-card__actions {
  justify-content: flex-start;
}

.bank-transaction-table,
.bank-match-table,
.journal-lines-table {
  display: grid;
  gap: 12px;
}

.bank-transaction-table__header,
.bank-transaction-table__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.6fr) 160px 140px 120px;
  gap: 16px;
  align-items: center;
}

.bank-match-table__header,
.bank-match-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 150px 150px 150px;
  gap: 16px;
  align-items: center;
}

.ledger-account-card__meta,
.journal-entry-card__meta {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ledger-account-card__meta dt,
.journal-entry-card__meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ledger-account-card__meta dd,
.journal-entry-card__meta dd {
  margin: 0;
  font-weight: 700;
}

.report-dashboard-card h2,
.journal-summary-card h2,
.vat-workflow-card h2,
.vat-workflow-notice h2,
.report-summary-card h2 {
  margin-top: 10px;
  margin-bottom: 10px;
}

.workspace-header__content.section-head p {
  margin-bottom: 0;
}

.vat-workflow-overview-grid,
.vat-workflow-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.vat-workflow-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.vat-workflow-list {
  display: grid;
  gap: 18px;
}

.vat-workflow-list-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.vat-workflow-list-card__header h2 {
  margin-top: 10px;
}

.vat-workflow-badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.vat-workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.vat-workflow-badge--neutral {
  background: rgba(89, 114, 141, 0.12);
  color: #51697f;
}

.vat-workflow-badge--info,
.vat-workflow-badge--sandbox {
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.vat-workflow-badge--success {
  background: rgba(112, 188, 161, 0.16);
  color: var(--success-text);
}

.vat-workflow-badge--danger {
  background: rgba(221, 97, 97, 0.14);
  color: var(--alert-text);
}

.vat-workflow-notice {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 250, 255, 0.94)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 65%);
}

/* HMRC provider action carrying the emailed step-up code. The code field sits
   inside the same form as the button because the code is verified in the
   request that starts the HMRC call; the two cannot be separated. */
.hmrc-provider-action--step-up {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.hmrc-step-up-code {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hmrc-step-up-code__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.hmrc-step-up-code__input {
  width: 8.5rem;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  letter-spacing: 0.12em;
}

.vat-workflow-card--success {
  border-color: rgba(112, 188, 161, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 252, 248, 0.95)),
    linear-gradient(145deg, rgba(112, 188, 161, 0.08), transparent 65%);
}

.vat-workflow-card--warning {
  border-color: rgba(221, 97, 97, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 247, 247, 0.95)),
    linear-gradient(145deg, rgba(221, 97, 97, 0.06), transparent 65%);
}

.vat-workflow-json {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: #f5f9ff;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
}

.vat-box-table {
  display: grid;
  gap: 12px;
}

.vat-box-table__header,
.vat-box-table__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.6fr) 180px;
  gap: 16px;
  align-items: center;
}

.vat-box-table__header {
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vat-box-table__row {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: var(--card-muted);
}

.vat-workflow-submit-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(244, 249, 255, 0.92);
}

.vat-workflow-checkbox {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.vat-workflow-checkbox input {
  margin-top: 4px;
}

.vat-workflow-declaration-capacity,
.vat-workflow-declaration-text {
  display: block;
}

.vat-workflow-declaration-capacity {
  margin-bottom: 6px;
}

/* The environment header inside the declaration card. It is read before
   HMRC's declaration below it, not as a footnote underneath it. */
.vat-workflow-test-header {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(214, 176, 108, 0.55);
  background: rgba(253, 248, 236, 0.95);
}

.vat-workflow-test-header h3 {
  margin: 0;
}

.vat-workflow-test-header p {
  margin: 0;
}

/* HMRC's declaration in a test environment: set as a quotation so it reads as
   something being shown, not something being agreed to. The text inside is
   verbatim and untouched. */
.vat-workflow-declaration-quote {
  margin: 0 0 10px;
  padding: 0;
}

.vat-workflow-declaration-quote figcaption {
  display: block;
  margin-bottom: 8px;
}

.vat-workflow-declaration-quote blockquote {
  margin: 0;
  padding: 14px 18px;
  border-left: 4px solid rgba(148, 176, 208, 0.9);
  border-radius: 0 12px 12px 0;
  background: rgba(244, 248, 253, 0.9);
  color: var(--muted-text, inherit);
  font-style: italic;
}

.vat-workflow-declaration-quote-note {
  margin: 0 0 16px;
}

.report-summary-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 250, 255, 0.94)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.08), transparent 65%);
}

.settlement-filters-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(150px, 0.72fr)) auto;
}

.settlement-card .payment-card__badges {
  justify-content: flex-end;
}

.settlement-card .payment-card__actions {
  margin-top: 0;
}

.report-summary-card--positive {
  border-color: rgba(112, 188, 161, 0.45);
}

.report-summary-card--negative {
  border-color: rgba(214, 144, 144, 0.4);
}

.accounting-period-links {
  display: grid;
  gap: 0.75rem;
}

.report-amount {
  display: block;
  margin-top: 10px;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
}

.report-amount--positive {
  color: var(--success-text);
}

.report-amount--negative {
  color: var(--alert-text);
}

.report-filters-grid {
  grid-template-columns: repeat(2, minmax(180px, 0.8fr)) auto;
}

.report-table {
  display: grid;
  gap: 12px;
}

.report-table__header,
.report-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(140px, 0.8fr);
  gap: 16px;
  align-items: center;
}

.report-table--three .report-table__header,
.report-table--three .report-table__row {
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr);
}

.report-table--two .report-table__header,
.report-table--two .report-table__row {
  grid-template-columns: minmax(0, 1.8fr) minmax(140px, 0.8fr);
}

.report-table--four .report-table__header,
.report-table--four .report-table__row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-table--five .report-table__header,
.report-table--five .report-table__row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-table--six .report-table__header,
.report-table--six .report-table__row {
  grid-template-columns: minmax(0, 1.7fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) repeat(3, minmax(110px, 0.7fr));
}

.report-table--seven .report-table__header,
.report-table--seven .report-table__row {
  grid-template-columns: minmax(0, 1.5fr) repeat(6, minmax(96px, 0.75fr));
}

.report-table--eight .report-table__header,
.report-table--eight .report-table__row {
  grid-template-columns: minmax(0, 1.3fr) repeat(7, minmax(88px, 0.7fr));
}

.report-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.report-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.report-option-card p,
.report-note-list {
  margin: 8px 0 0;
}

.report-note-list {
  padding-left: 18px;
}

.report-table__header {
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-table__row {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: var(--card-muted);
}

.report-table__row--total {
  font-weight: 700;
}

.report-table__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.journal-lines-table__header,
.journal-lines-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) 140px 140px;
  gap: 16px;
  align-items: center;
}

.bank-transaction-table__header,
.bank-match-table__header,
.journal-lines-table__header {
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bank-transaction-table__row,
.bank-match-table__row,
.journal-lines-table__row {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: var(--card-muted);
}

.bank-transaction-table--review .bank-transaction-table__header,
.bank-transaction-table--review .bank-transaction-table__row {
  grid-template-columns: minmax(0, 1.1fr) 110px minmax(0, 1.5fr) 140px 130px minmax(0, 1.4fr) 110px;
}

.bank-transaction-amount {
  font-weight: 700;
}

.bank-transaction-amount--inflow {
  color: var(--success-text);
}

.bank-transaction-amount--outflow {
  color: var(--alert-text);
}

.bank-transaction-table__mobile-label {
  display: none;
  width: fit-content;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* WCAG 1.3.1: /journal_entries/:id and /ledger_accounts/:id render their line
 * lists as native tables rather than grids of divs with a header row of spans.
 * These rules give the table the grid layout the divs had, so the four-track
 * desktop row and the stacked phone card are unchanged.
 *
 * `display: contents` on the row groups is what lets every row - header and
 * body alike - be a grid item of the table, which reproduces the single
 * `gap: 12px` the div version had between every row. A thead/tbody left in the
 * box tree would put the gap only between the two groups.
 *
 * Overriding `display` on table parts can drop their implicit semantics, so the
 * markup carries matching explicit roles. That is the trade, not belt and
 * braces.
 *
 * Scoped by element on purpose. `.journal-lines-table` has no remaining div
 * users today, but a `table.` prefix and `th`/`td` descendants cannot reach one
 * if a future view reuses the class names over divs. */
table.journal-lines-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.journal-lines-table__group {
  display: contents;
}

/* The UA centres and bolds a header cell; the header row's own rule already
 * supplies the weight, so `inherit` takes it from there. No padding or border
 * is added: the row carries both, exactly as the div did. */
.journal-lines-table th,
.journal-lines-table td {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: inherit;
  text-align: left;
  vertical-align: top;
}

/* Hidden above the phone breakpoint, like every other per-cell label in this
 * file. Marked aria-hidden in the markup, because unlike the other tables the
 * header row here stays in the accessibility tree at phone width. */
.journal-lines-table__mobile-label {
  display: none;
  width: fit-content;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* WCAG 1.3.1: the four match tables - the match-candidate partial and the
 * transfer, linked-settlement and existing-match lists on /bank_transactions/:id
 * - are native tables rather than grids of divs with a header row of spans.
 * These rules give the table the grid layout the divs had, so the four-track
 * desktop row and the stacked phone card are unchanged.
 *
 * `display: contents` on the row groups is what lets every row - header and
 * body alike - be a grid item of the table, which reproduces the single
 * `gap: 12px` the div version had between every row. A thead/tbody left in the
 * box tree would put the gap only between the two groups.
 *
 * Overriding `display` on table parts can drop their implicit semantics, so the
 * markup carries matching explicit roles. That is the trade, not belt and
 * braces.
 *
 * Scoped by element on purpose, like the two blocks it follows: a `table.`
 * prefix and `th`/`td` descendants cannot reach a div user of these class names
 * if a future view adds one. There is none today. */
table.bank-match-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.bank-match-table__group {
  display: contents;
}

/* The UA centres and bolds a header cell; the header row's own rule already
 * supplies the weight, so `inherit` takes it from there. No padding or border
 * is added: the row carries both, exactly as the div did. */
.bank-match-table th,
.bank-match-table td {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: inherit;
  text-align: left;
  vertical-align: top;
}

/* WCAG 1.3.1: /bank_transactions renders its list as a native <table> rather
 * than a grid of divs with a header row of spans. These rules make the table
 * take the grid layout the divs had, so neither the desktop seven-track row nor
 * the mobile card stack changes by a pixel.
 *
 * `display: contents` on the row groups is what lets every <tr> - the header
 * row and all the body rows - be a grid item of the table, which is what
 * reproduces the single `gap: 12px` the div version had between every row. A
 * thead/tbody left in the box tree would have put the gap only between the two
 * groups.
 *
 * Overriding `display` on table parts can drop their implicit semantics, so the
 * markup carries matching explicit roles. That is the trade recorded in the
 * view, not belt and braces.
 *
 * Scoped by element on purpose: `.bank-transaction-table` is also used by
 * /bank_accounts/:id and /bank_provider_events, which are still div markup. A
 * `table.` prefix and `th`/`td` descendants cannot match those. */
table.bank-transaction-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.bank-transaction-table__group {
  display: contents;
}

/* The UA centres <th> and bolds it; the header row's own rule already supplies
 * the weight, so `inherit` takes it from there rather than fighting it. No
 * padding or border is added: the <tr> carries both, exactly as the div did. */
.bank-transaction-table th,
.bank-transaction-table td {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: inherit;
  text-align: left;
  vertical-align: top;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.field-help {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  margin: 0;
}

.setup-wizard-shell .field > .field-help,
.setup-wizard-shell .form-field > .field-help {
  position: absolute;
  top: -2px;
  right: 0;
}

.setup-wizard-shell .field:has(> .field-help) > label,
.setup-wizard-shell .form-field:has(> .field-help) > label {
  padding-right: 34px;
}

.field-help__summary-row {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: flex-end;
}

.field-help__summary {
  display: none;
}

.field-help__button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #17324d;
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(23, 50, 77, 0.16);
}

.field-help__button:hover,
.field-help__button:focus-visible {
  background: var(--accent);
}

.field-help__button span {
  pointer-events: none;
}

.field-help-drawer-open {
  overflow: hidden;
}

.review-drawer-open {
  overflow: hidden;
}

.field-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  margin: 0;
  padding: 0;
  background: rgba(8, 24, 38, 0.42);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.field-help-backdrop.is-open {
  opacity: 1;
}

#field-help-drawer,
.field-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  width: clamp(360px, 30vw, 520px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-left: 1px solid rgba(194, 214, 236, 0.95);
  box-shadow: -22px 0 46px rgba(8, 24, 38, 0.2);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

/* The block above is `#field-help-drawer, .field-help-drawer`, and an id selector
   outranks `.field-help-drawer[hidden]`, so `display: flex` beat this rule and
   the `hidden` attribute did nothing. The drawer stayed in the layout, pushed
   off-screen by its transform, with its Close button still in the tab order
   while `aria-hidden="true"` hid it from a screen reader - a keyboard user
   tabbed into a dialog they could neither see nor have announced (WCAG 2.4.3,
   4.1.2). Matching the id here restores what `hidden` was always meant to do. */
#field-help-drawer[hidden],
.field-help-backdrop[hidden],
.field-help-drawer[hidden] {
  display: none;
}

#field-help-drawer.is-open,
.field-help-drawer.is-open {
  transform: translateX(0);
}

.field-help > .field-help__drawer {
  display: none !important;
}

.field-help-drawer__header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(194, 214, 236, 0.75);
}

.field-help-drawer h2 {
  margin-top: 6px;
  font-size: 1.1rem;
}

.field-help-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.field-help-drawer__copy {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.field-help-drawer__examples {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.86);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.field-help-drawer__examples ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
}

.field-help-drawer__source {
  margin-top: 22px;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.field-help-drawer__source a {
  color: var(--accent-strong);
  font-weight: 700;
}

.review-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  margin: 0;
  padding: 0;
  background: rgba(8, 24, 38, 0.42);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.review-drawer-backdrop.is-open {
  opacity: 1;
}

.review-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10011;
  display: flex;
  flex-direction: column;
  width: clamp(380px, 34vw, 560px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid rgba(194, 214, 236, 0.95);
  background: var(--card);
  box-shadow: -22px 0 46px rgba(8, 24, 38, 0.2);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.review-drawer-backdrop[hidden],
.review-drawer[hidden] {
  display: none;
}

.review-drawer.is-open {
  transform: translateX(0);
}

.review-drawer__header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(194, 214, 236, 0.75);
  background: rgba(255, 255, 255, 0.96);
}

.review-drawer h2 {
  margin-top: 6px;
  font-size: 1.1rem;
}

.review-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px;
}

.review-drawer__body a,
.review-drawer__body dd,
.review-drawer__body p {
  overflow-wrap: anywhere;
}

.field--autocomplete {
  position: relative;
}

.field--autocomplete .field-hint {
  margin-top: 10px;
}

.industry-autocomplete__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(194, 214, 236, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 44px rgba(23, 50, 77, 0.14);
}

.industry-autocomplete__list[hidden] {
  display: none;
}

.industry-autocomplete__option {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.72rem 0.85rem;
  text-align: left;
}

.industry-autocomplete__option:hover,
.industry-autocomplete__option.is-active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-strong);
}

.bank-raw-data {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: #f5f9ff;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
}

.import-guidance-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.import-guidance-list li {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(244, 249, 255, 0.92);
}

.api-token-grid,
.api-docs-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.api-token-panel {
  display: grid;
  gap: 18px;
  padding: var(--card-pad-y) var(--card-pad-x);
}

.api-token-panel .table-shell {
  margin-top: 4px;
}

.api-token-panel > h2,
.api-token-panel > p,
.article-card > h2,
.article-card > p {
  margin: 0;
}

.api-token-secret-card {
  margin-bottom: 1.5rem;
}

.api-token-secret-card__copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.api-token-secret-card__token,
.api-token-panel pre {
  display: block;
  width: 100%;
  overflow-x: auto;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(116, 153, 205, 0.2);
  background: linear-gradient(180deg, rgba(242, 248, 255, 0.96), rgba(231, 241, 255, 0.92));
  color: #0f2947;
  font-size: 0.92rem;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.api-token-secret-card__status {
  min-height: 1.35rem;
  margin: 0.65rem 0 0;
  color: var(--muted-text);
  font-weight: 700;
}

@media (max-width: 640px) {
  .api-token-secret-card__copy-row {
    grid-template-columns: 1fr;
  }
}

.docs-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted-text);
}

.status-badge--alert {
  background: rgba(196, 97, 79, 0.14);
  color: #8c2f1f;
}

.article-editor-card {
  display: grid;
  gap: 20px;
}

.article-editor-card__summary {
  align-items: stretch;
}

.article-editor-card__workflow {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(245, 249, 255, 0.94);
}

.article-editor-card__workflow strong {
  color: var(--text);
}

.article-editor-card__workflow span {
  color: var(--muted-text);
}

.article-editor-form {
  align-items: start;
}

.article-editor-form__section {
  padding-top: 8px;
  border-top: 1px solid rgba(194, 214, 236, 0.82);
}

.article-editor-form__fieldset {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 20px;
  background: rgba(248, 252, 255, 0.88);
}

.article-editor-form__fieldset legend {
  padding: 0 8px;
  color: var(--text);
  font-weight: 800;
}

.article-media-snippets {
  display: grid;
  gap: 10px;
}

.article-media-snippets__item {
  display: grid;
  gap: 8px;
}

.article-media-snippets__item code {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  white-space: normal;
  word-break: break-all;
}

.article-editor-form .trix-content,
.article-body .trix-content {
  line-height: 1.8;
}

.article-editor-form .marksmith-editor-wrapper {
  min-height: 420px;
  border-color: rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.article-editor-form .marksmith-editor-wrapper textarea {
  min-height: 360px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  line-height: 1.7;
}

.metric-card {
  display: grid;
  gap: 10px;
  padding: 20px 24px;
}

.metric-card strong {
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}

.editor-workflow-note {
  display: grid;
  gap: 18px;
}

.editor-category-card {
  display: grid;
  gap: 18px;
}

.editor-category-card__child {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.editor-category-card__child-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
  color: var(--muted-text);
  font-size: 0.9rem;
}

trix-toolbar {
  margin-bottom: 14px;
}

trix-toolbar .trix-button-group {
  border-radius: 14px;
  border-color: rgba(194, 214, 236, 0.9);
  box-shadow: none;
}

trix-toolbar .trix-button {
  background: rgba(255, 255, 255, 0.94);
}

trix-toolbar .trix-button--icon {
  width: 40px;
}

/* The editor sits in a narrow column and Trix's button row is nowrap with
   overflow-x: auto, so at this width the rightmost groups - attach, undo, redo -
   were cut off at the card edge with only a sideways scroll to reach them.
   Selenium could not click the attach button at all.

   Deliberately NOT claimed as a WCAG 2.5.7 failure. 2.5.7 exempts a dragging
   movement "determined by the user agent and not modified by the author", and a
   native scrollbar is arguably that - it also takes a click on its track, which
   is a single pointer and no drag. So the attach button was still reachable in
   principle. This is an operability fix, and it is what makes the 2.5.7
   alternative usable in practice rather than in principle. Undo and redo were
   clipped by the same overflow and have nothing to do with 2.5.7. */
trix-toolbar .trix-button-row {
  flex-wrap: wrap;
  row-gap: 8px;
  overflow-x: visible;
}

/* WCAG 2.5.7 Dragging Movements. Trix attaches a file dropped onto the editor,
   and this rule used to hide the toolbar group holding "Attach Files" - which
   left dragging as the only way to attach one. The hiding arrived with a bulk
   styling pass (524f2f98), not a decision to drop the feature: the editor's
   CSP allows blob: img-src for attachment previews and a system spec covers
   them. The group is left to Trix's own layout so the single-pointer
   alternative stays available; spec/accessibility/dragging_alternatives_spec.rb
   fails if it is hidden again. */

trix-editor {
  min-height: 420px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

trix-editor:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.webhook-summary-grid,
.webhook-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.webhook-checkbox-grid {
  display: grid;
  gap: 0.9rem;
}

.checkbox-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(244, 249, 255, 0.92);
}

.checkbox-card small {
  display: block;
  color: var(--muted-text);
}

.webhook-payload {
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(116, 153, 205, 0.2);
  background: linear-gradient(180deg, rgba(242, 248, 255, 0.96), rgba(231, 241, 255, 0.92));
  color: #0f2947;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
}

.stacked-form {
  display: grid;
  gap: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.button_to {
  margin: 0;
}

.card-actions .button_to,
.filters-actions .button_to,
.workspace-header__actions .button_to,
.contact-form-actions .button_to,
.payment-card__actions .button_to,
.vat-code-filters__actions .button_to {
  display: inline-flex;
}

.card-actions .button_to > .button,
.filters-actions .button_to > .button,
.workspace-header__actions .button_to > .button,
.contact-form-actions .button_to > .button,
.payment-card__actions .button_to > .button,
.vat-code-filters__actions .button_to > .button {
  width: auto;
  min-height: auto;
}

.workspace-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: var(--card-pad-y) var(--card-pad-x);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 252, 255, 0.96));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.workspace-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.workspace-panel__header > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workspace-panel__header h2 {
  overflow-wrap: anywhere;
}

.workspace-panel__header .filters-bar,
.workspace-panel__header .card-actions {
  flex: 1 1 520px;
  justify-content: flex-end;
}

.filters-bar,
.card-actions,
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filters-bar .form-input,
.filters-bar .form-select {
  flex: 1 1 150px;
  min-width: min(100%, 150px);
}

.definition-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0;
}

.definition-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 14px;
  background: rgba(245, 249, 255, 0.86);
}

.definition-grid dt {
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.definition-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.stacked-form,
.form-grid,
.stacked-list,
.checklist {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stacked-list li,
.checklist li {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 14px;
  background: rgba(245, 249, 255, 0.86);
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  background: rgba(245, 249, 255, 0.92);
}

.empty-state {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(194, 214, 236, 0.78);
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.86);
}

.empty-state h2,
.empty-state h3 {
  overflow-wrap: anywhere;
}

.table-subtext {
  margin-top: 0.3rem;
  color: var(--muted-text);
  font-size: 0.88rem;
}

.table-shell {
  overflow-x: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(245, 249, 255, 0.92);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.9rem 0.95rem;
  border-bottom: 1px solid rgba(194, 214, 236, 0.85);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted-text);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.status-badge--success {
  background: rgba(66, 173, 117, 0.14);
  color: #1b6b42;
}

.status-badge--danger {
  background: rgba(207, 77, 79, 0.14);
  color: #9f2f31;
}

.status-badge--accent {
  background: rgba(232, 150, 54, 0.16);
  color: #9b5a12;
}

.status-badge--info {
  background: rgba(31, 122, 228, 0.14);
  color: var(--accent-strong);
}

.status-badge--muted {
  background: rgba(121, 142, 169, 0.14);
  color: #53657e;
}

.status-badge--warning {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.owner-period-presets,
.owner-section-nav,
.owner-detail-actions,
.owner-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.owner-period-presets {
  margin: 16px 0 4px;
}

.route-pill.is-current {
  border-color: rgba(31, 122, 228, 0.45);
  background: rgba(31, 122, 228, 0.12);
  color: var(--accent-strong);
}

.owner-section-nav {
  margin: 18px 0;
}

.owner-section-heading {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.owner-section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.owner-table-shell--wide {
  max-width: 100%;
  overflow-x: auto;
}

.owner-analytics-table,
.owner-user-table {
  min-width: 720px;
  table-layout: fixed;
}

.owner-analytics-table th,
.owner-analytics-table td,
.owner-user-table th,
.owner-user-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.owner-analytics-table--failures {
  min-width: 1040px;
}

.owner-analytics-table--failures th:nth-child(2),
.owner-analytics-table--failures td:nth-child(2) {
  min-width: 260px;
}

.owner-user-table {
  min-width: 940px;
}

.owner-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.owner-user-actions--inline {
  margin-top: 12px;
}

.owner-inline-action-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.owner-inline-action-form input[type="text"] {
  width: min(180px, 100%);
}

.owner-danger-link {
  border-color: rgba(207, 77, 79, 0.32);
  color: #9f2f31;
}

.owner-definitions .support-detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.owner-user-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.owner-impact-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.owner-impact-list__item {
  justify-content: flex-start;
  white-space: normal;
}

.owner-delete-confirmation {
  border-color: rgba(207, 77, 79, 0.28);
}

@media (max-width: 900px) {
  .owner-user-filter-grid,
  .owner-definitions .support-detail-list,
  .report-detail-grid,
  .report-detail-grid--three {
    grid-template-columns: 1fr;
  }

  .owner-inline-action-form {
    align-items: stretch;
  }
}

.review-centre {
  display: grid;
  gap: 1rem;
}

.review-centre__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.review-centre__header h1 {
  margin: 0.2rem 0 0.35rem;
}

.review-centre__header p,
.review-centre__summary-card p,
.review-centre__item-meta,
.review-centre__item-action p,
.review-centre__history p {
  color: var(--muted-text);
}

.review-centre__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.review-centre__summary-card,
.review-centre__history,
.review-centre__item {
  border-radius: 8px;
}

.review-centre__summary-card--prepared {
  border-color: rgba(31, 122, 228, 0.24);
}

.review-centre__metrics,
.review-centre__facts,
.review-centre__safe-rows {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.review-centre__metrics {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.review-centre__metrics > div,
.review-centre__facts > div,
.review-centre__safe-rows > div {
  min-width: 0;
}

.review-centre__metrics dt,
.review-centre__facts dt,
.review-centre__safe-rows dt {
  color: var(--muted-text);
  font-size: 0.78rem;
}

.review-centre__metrics dd,
.review-centre__facts dd,
.review-centre__safe-rows dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.review-centre__metrics dd {
  font-size: 1.35rem;
  font-weight: 700;
}

.review-centre__explanation,
.review-centre__blocker {
  border-left: 3px solid #d97706;
  padding-left: 0.75rem;
}

.review-centre__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.review-centre__filter {
  border: 1px solid rgba(194, 214, 236, 0.85);
  border-radius: 999px;
  color: var(--muted-text);
  padding: 0.45rem 0.75rem;
  text-decoration: none;
}

.review-centre__filter.is-active,
.review-centre__filter:hover {
  background: rgba(31, 122, 228, 0.08);
  color: var(--text);
}

.review-centre__queue,
.review-centre__group,
.review-centre__items {
  display: grid;
  gap: 0.9rem;
}

.review-centre__group h3 {
  margin: 0.4rem 0 0;
}

.review-centre__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
  gap: 1rem;
}

.review-centre__item-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-centre__item-title h4 {
  margin: 0;
  font-size: 1rem;
}

.review-centre__item-meta {
  margin: 0.35rem 0 0.8rem;
}

.review-centre__facts {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.review-centre__details {
  margin-top: 0.8rem;
}

.review-centre__details summary {
  cursor: pointer;
  font-weight: 700;
}

.review-centre__details h5 {
  margin: 0.9rem 0 0.45rem;
}

.review-centre__item-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.65rem;
}

.review-centre__item-action p {
  margin: 0;
}

.review-centre__history-list {
  display: grid;
  gap: 0.5rem;
}

.review-centre__history-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1.5fr) repeat(5, minmax(6.5rem, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(194, 214, 236, 0.85);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.review-centre__history-row small {
  display: block;
  color: var(--muted-text);
}

.copilot-review-centre-callout {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.8rem;
  border: 1px solid rgba(194, 214, 236, 0.85);
  border-radius: 8px;
  background: rgba(31, 122, 228, 0.08);
}

.copilot-review-centre-callout p {
  margin: 0;
}

@media (max-width: 900px) {
  .review-centre__summary,
  .review-centre__item,
  .review-centre__history-row {
    grid-template-columns: 1fr;
  }

  .review-centre__header {
    display: grid;
  }
}

.funding-opportunities-card,
.funding-opportunities-header,
.dashboard-funding-opportunities-card,
.dashboard-mailbox-invitation-card {
  margin-bottom: 1rem;
}

.dashboard-neutral-link {
  margin: 0 0 1rem;
}

.inline-button-form {
  display: inline;
}

.funding-opportunities-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.funding-opportunity-list {
  display: grid;
  gap: 0.75rem;
}

.funding-opportunity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.funding-opportunity-row h2 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1rem;
  line-height: 1.3;
}

.funding-opportunity-row p {
  margin: 0;
  color: var(--muted-text);
}

.funding-opportunity-row__meta,
.funding-opportunity-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-text);
}

.funding-opportunity-facts div {
  min-width: 10rem;
}

.funding-opportunity-facts dt {
  color: var(--muted-text);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.funding-opportunity-facts dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
  color: var(--text);
}

.funding-opportunity-reasons,
.dashboard-funding-opportunities-card__list,
.dashboard-mailbox-invitation-card__list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted-text);
}

.funding-opportunity-section {
  margin-top: 1rem;
}

.funding-opportunity-section h3 {
  margin: 0;
  font-size: 0.98rem;
}

.funding-opportunity-boundary {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(217, 119, 6, 0.24);
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
}

.funding-opportunity-boundary p,
.funding-opportunities-empty p {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .funding-opportunity-row {
    grid-template-columns: 1fr;
  }
}

.private-beta-readiness-board {
  display: grid;
  gap: 20px;
}

.private-beta-readiness-board__heading {
  align-items: stretch;
  margin-bottom: 0;
}

.private-beta-decision {
  min-width: min(100%, 320px);
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.private-beta-decision span,
.private-beta-status-summary__item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.private-beta-decision strong {
  color: var(--text);
  font-size: 1.05rem;
}

.private-beta-decision--ready {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(236, 253, 245, 0.88);
}

.private-beta-decision--review {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(255, 251, 235, 0.92);
}

.private-beta-decision--not-ready {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(254, 242, 242, 0.92);
}

.private-beta-status-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.private-beta-status-summary__item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.private-beta-status-summary__item strong {
  color: var(--text);
  font-size: 1.18rem;
}

.private-beta-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.private-beta-status--ready {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.private-beta-status--review {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.private-beta-status--missing {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.private-beta-status--deferred {
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
}

.private-beta-status--not-live {
  background: rgba(71, 85, 105, 0.14);
  color: #334155;
}

.private-beta-governance-warning {
  display: grid;
  gap: 8px;
}

.private-beta-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.private-beta-section-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.private-beta-section-card h3 {
  font-size: 1.15rem;
}

.solo-freelancer-records-system-board .private-beta-readiness-board__heading,
.solo-freelancer-readiness-board .private-beta-readiness-board__heading {
  align-items: flex-start;
}

.solo-records-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.solo-records-summary-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.solo-records-summary-card > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.solo-records-summary-card strong {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.2;
}

.solo-records-summary-card p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.solo-records-summary-card--ready {
  border-color: rgba(22, 163, 74, 0.16);
}

.solo-records-summary-card--needs-review {
  border-color: rgba(217, 119, 6, 0.18);
}

.solo-records-action-list,
.solo-records-boundary-list {
  display: grid;
  gap: 10px;
}

.solo-records-action,
.solo-records-boundary {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
}

.solo-records-action p,
.solo-records-boundary p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.solo-records-boundary strong {
  color: var(--text);
}

.dashboard-advanced-details {
  margin-top: 0;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.dashboard-advanced-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-advanced-details > summary::-webkit-details-marker {
  display: none;
}

.dashboard-advanced-details > summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.dashboard-advanced-details[open] > summary {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

.dashboard-advanced-details[open] > summary::after {
  content: "-";
}

.dashboard-advanced-details__body {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.dashboard-advanced-details .solo-operational-feature-matrix,
.dashboard-advanced-details .solo-operational-boundaries {
  margin-top: 0;
}

.solo-operational-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  margin-top: 18px;
}

.solo-operational-feature-matrix {
  margin-top: 18px;
}

.solo-feature-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.solo-feature-matrix-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.solo-feature-list {
  display: grid;
  gap: 12px;
}

.solo-feature-list__item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
}

.solo-feature-list__item p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.solo-operational-panel,
.solo-operational-boundaries {
  min-width: 0;
}

.solo-operational-boundaries {
  margin-top: 16px;
}

.solo-operational-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.solo-operational-metric p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.solo-first-value-journey {
  margin-top: 12px;
}

.solo-first-value-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: stretch;
}

.solo-first-value-summary > div {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.solo-first-value-summary strong {
  color: var(--text);
  font-size: 1.2rem;
}

.solo-first-value-next h3,
.solo-first-value-next p {
  margin: 0;
}

.solo-first-value-progress {
  margin-top: 0;
}

.solo-first-value-status-counts {
  margin-top: 12px;
}

.solo-first-value-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.solo-first-value-step {
  align-content: start;
  padding: 12px 14px;
}

.solo-first-value-evidence-note {
  margin-top: 12px;
  padding: 14px 16px;
}

.solo-first-value-more {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .private-beta-status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solo-operational-grid {
    grid-template-columns: 1fr;
  }

  .solo-feature-matrix-grid {
    grid-template-columns: 1fr;
  }

  .solo-first-value-summary {
    grid-template-columns: 1fr;
  }
}

.private-beta-item-list {
  display: grid;
  gap: 12px;
}

.private-beta-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.private-beta-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.private-beta-item__header strong {
  color: var(--text);
}

.private-beta-item__actions {
  margin-top: 2px;
}

.stack-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.button--small {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.audit-filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.audit-trail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.audit-trail-item {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(194, 214, 236, 0.75);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.98), rgba(243, 248, 255, 0.94));
}

.audit-trail-item p,
.audit-trail-item small {
  margin: 0;
}

.audit-trail-item__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.audit-trail-item__meta div {
  display: grid;
  gap: 4px;
}

.audit-trail-item__meta strong {
  color: var(--muted-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-trail-item__meta span {
  color: var(--text);
  font-weight: 600;
}

.audit-trail-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.audit-trail-item__header time {
  color: var(--muted-text);
  font-size: 0.86rem;
}

.attachments-panel {
  display: grid;
  gap: 1rem;
}

.reconciliation-queue-group {
  display: grid;
  gap: 18px;
}

.reconciliation-queue-group__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reconciliation-queue-card {
  display: grid;
  gap: 18px;
  padding: 24px 28px;
}

.reconciliation-queue-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.reconciliation-queue-card__header h2 {
  margin-top: 10px;
}

.reconciliation-queue-card__badges,
.reconciliation-queue-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.reconciliation-queue-card__workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reconciliation-queue-card__summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reconciliation-queue-card__summary div,
.reconciliation-queue-card__linked-group {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(245, 249, 255, 0.94);
  border: 1px solid rgba(194, 214, 236, 0.9);
}

.reconciliation-queue-card__summary dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reconciliation-queue-card__summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.reconciliation-queue-card__linked {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reconciliation-queue-card__linked-group {
  display: grid;
  gap: 12px;
}

.reconciliation-queue-card__panel,
.reconciliation-queue-card__details {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.98), rgba(243, 248, 255, 0.94));
}

.reconciliation-queue-card__details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.reconciliation-queue-card__details[open] summary {
  margin-bottom: 14px;
}

.reconciliation-queue-group--dense {
  gap: 12px;
  padding: 18px 20px;
}

.reconciliation-queue--dense {
  gap: 8px;
}

.reconciliation-queue-card--dense {
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: none;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__header h2 {
  margin: 4px 0 2px;
  font-size: 1rem;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__header p {
  margin: 0;
  font-size: 0.86rem;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__workflow {
  gap: 6px;
}

.reconciliation-queue-card--dense .route-pill {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__summary {
  gap: 8px;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__summary div,
.reconciliation-queue-card--dense .reconciliation-queue-card__linked-group {
  padding: 8px 10px;
  border-radius: 10px;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__summary dt {
  margin-bottom: 2px;
  font-size: 0.68rem;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__summary dd {
  font-size: 0.88rem;
}

.reconciliation-queue-card--dense .reconciliation-queue-card__details,
.reconciliation-queue-card--dense .reconciliation-queue-card__panel {
  padding: 10px 12px;
  border-radius: 10px;
}

.reconciliation-queue-card__actions--secondary {
  justify-content: flex-start;
  margin-top: 10px;
}

.reconciliation-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 6px;
}

.bank-match-table__mobile-label {
  display: none;
  width: fit-content;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attachments-panel__intro {
  color: var(--muted-text);
}

.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.attachment-list__item {
  border: 1px solid rgba(194, 214, 236, 0.75);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.98), rgba(243, 248, 255, 0.94));
}

.attachment-list__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.attachment-list__identity {
  flex: 1 1 18rem;
  min-width: 0;
}

.attachment-list__filename {
  display: block;
  overflow-wrap: anywhere;
}

.attachment-list__meta,
.attachment-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.attachment-list__meta {
  margin-top: 0.35rem;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.attachment-list__notes {
  margin: 0.75rem 0 0;
  color: var(--muted-text);
}

@media (max-width: 1100px) {
  .invoice-overview-grid,
  .bank-overview-grid,
  .payroll-overview-grid,
  .ledger-overview-grid,
  .vat-workflow-overview-grid,
  .vat-workflow-source-grid,
  .report-dashboard-grid,
  .report-summary-grid,
  .report-detail-grid,
  .api-token-grid,
  .api-docs-grid,
  .webhook-summary-grid,
  .webhook-detail-grid,
  .payment-overview-grid,
  .bank-show-grid,
  .payroll-show-grid,
  .invoice-show-grid,
  .invoice-form-shell,
  .webhook-summary-grid,
  .webhook-detail-grid,
  .report-option-grid,
  .audit-filter-grid,
  .reconciliation-queue-card__header,
  .reconciliation-queue-card__summary,
  .reconciliation-queue-card__linked,
  .filters-grid,
  .invoice-card__details,
  .invoice-show-table__header,
  .invoice-show-table__row,
  .bank-transaction-table__header,
  .bank-transaction-table__row,
  .bank-match-table__header,
  .bank-match-table__row,
  .report-table__header,
  .report-table__row,
  .vat-box-table__header,
  .vat-box-table__row,
  .journal-lines-table__header,
  .journal-lines-table__row,
  .settlement-header-metrics,
  .ledger-account-card__meta,
  .journal-entry-card__meta,
  .payment-allocation-table__header,
  .payment-allocation-table__row,
  .settlement-allocation-table__header,
  .settlement-allocation-table__row,
  .vat-workflow-list-card__header,
  .reconciliation-workspace-card__header,
  .reconciliation-workspace-card__metrics {
    grid-template-columns: 1fr;
  }

  /* A VARIANT MODIFIER OUTRANKS THIS BLOCK UNLESS IT IS NAMED HERE.
   *
   * E-REACH-01: every "Review" link on /bank_transactions rendered at
   * left 538 / right 648 inside a 337px `.invoice-lines-card` that hides its
   * overflow - unreachable on a phone, on all twenty rows. The collapse above
   * selects `.bank-transaction-table__row`, specificity (0,1,0). The desktop
   * seven-track at :7062 selects
   * `.bank-transaction-table--review .bank-transaction-table__row`,
   * specificity (0,2,0). A media query adds no specificity, so the desktop
   * track won at every width and the row never stacked. The mobile labels in
   * this same block DID apply, which is why "DATE 2026-10-25" printed over the
   * account name beside it.
   *
   * `.report-table--two` through `--eight` (:6944-:6975) are the same rule
   * written eight times, and the populated sweep measured one of them live:
   * on /bank_rules the per-row "Edit" sat at left 582 / right 692 inside the
   * same 337px `.invoice-lines-card`, for owner, operator and viewer, at both
   * 320 and 390. They are reset for the same reason, and the base
   * `.report-table__row` they shadow is already in the list above, so this
   * restores an intent that was written and then outranked.
   *
   * `.settlement-allocation-table--form/--show` (:6219, :6224) were the last
   * two, and the owner asked for them to be measured rather than carded. Both
   * are live, and they fail differently:
   *
   *   --form, on /settlements/new, strands the allocation AMOUNT FIELD. Its
   *   track is `minmax(170px, 0.85fr)`, so it never narrows: the field sat at
   *   left 254 / right 424 inside `.settlement-form-card`, whose content box
   *   ends at 357 at 390 and 287 at 320. The customer types the settled
   *   amount into a field with its right-hand end cut off. Owner and
   *   operator; a viewer is redirected away from that screen.
   *
   *   --show, on the settlement itself, starves its two `minmax(0, …fr)`
   *   tracks to 0px and 1px at 320 (29px and 42px at 390) while they still
   *   hold the bill reference and the supplier name. Those cells do not hide
   *   their overflow, so the text spills over the column beside it - the same
   *   symptom as the mobile labels above. No control is clipped, so the
   *   reachability probe reads it clean; it is pinned by measuring cell width
   *   against cell content instead.
   *
   * `grep -nE '^\.[a-z-]*--[a-z-]* \.[a-z_-]*__(header|row)'` over this file
   * finds the whole set. With these two, it is closed.
   */
  .bank-transaction-table--review .bank-transaction-table__header,
  .bank-transaction-table--review .bank-transaction-table__row,
  .report-table--two .report-table__header,
  .report-table--two .report-table__row,
  .report-table--three .report-table__header,
  .report-table--three .report-table__row,
  .report-table--four .report-table__header,
  .report-table--four .report-table__row,
  .report-table--five .report-table__header,
  .report-table--five .report-table__row,
  .report-table--six .report-table__header,
  .report-table--six .report-table__row,
  .report-table--seven .report-table__header,
  .report-table--seven .report-table__row,
  .report-table--eight .report-table__header,
  .report-table--eight .report-table__row,
  .settlement-allocation-table--form .settlement-allocation-table__header,
  .settlement-allocation-table--form .settlement-allocation-table__row,
  .settlement-allocation-table--show .settlement-allocation-table__header,
  .settlement-allocation-table--show .settlement-allocation-table__row {
    grid-template-columns: 1fr;
  }

  .invoice-lines-header,
  .invoice-line-row,
  .journal-adjustment-header,
  .journal-adjustment-row {
    grid-template-columns: 1fr;
  }

  .invoice-line-row__account {
    grid-column: 1 / -1;
  }

  .marketing-lead-card {
    grid-template-columns: 1fr;
  }

  .invoice-form-sidebar {
    position: static;
  }

  .invoice-header-metrics,
  .customer-invoice__header,
  .customer-invoice__parties,
  .customer-invoice__totals,
  .customer-invoice__row,
  .customer-invoice__row--statement,
  .customer-invoice__vat div,
  .customer-invoice__payments div,
  .payment-header-metrics,
  .invoice-summary-list,
  .invoice-card__trace,
  .payment-context-list,
  .payment-card__trace,
  .payment-card__details {
    grid-template-columns: 1fr;
  }

  .reconciliation-backlog-grid {
    grid-template-columns: 1fr;
  }

  .invoice-lines-header {
    display: none;
  }

  .invoice-line-row__field-label {
    position: static;
    display: inline-flex;
    width: fit-content;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .invoice-line-row__remove .button {
    width: fit-content;
  }

  .invoice-show-table__header {
    display: none;
  }

  .invoice-show-table__mobile-label {
    display: inline-flex;
  }

  .customer-invoice__identity {
    justify-items: start;
    text-align: left;
  }

  .payment-allocation-table__header {
    display: none;
  }

  .payment-allocation-table__mobile-label {
    display: inline-flex;
  }

  .settlement-allocation-table__header {
    display: none;
  }

  .settlement-allocation-table__mobile-label {
    display: inline-flex;
  }

  .bank-transaction-table__header {
    display: none;
  }

  .bank-transaction-table__mobile-label {
    display: inline-flex;
  }

  .bank-match-table__header {
    display: none;
  }

  .bank-match-table__mobile-label {
    display: inline-flex;
  }

  /* The match tables stack at this width, and the header row above is
   * `display: none` for the div era. These four tables are now real tables, and
   * their header row is clipped instead, following df977ff1 on the journal
   * lines rather than the five `display: none` tables above.
   *
   * The reason is the same one df977ff1 gave, and it is sharper here. The
   * match-candidate columns are Record, Context, Available, Match amount:
   * "Available" and "Match amount" are adjacent money figures, and the fourth
   * is an editable field into which the user types an amount that posts
   * against a ledger. `display: none` would take the column headers out of the
   * accessibility tree on exactly the viewport where stacking makes the two
   * indistinguishable. Clipped, the table keeps real column headers at every
   * width.
   *
   * `display: grid` is restored explicitly: this rule outranks the
   * `display: none` above on specificity but says nothing about `display`
   * otherwise, so without it the header row would stay out of the box tree and
   * the clip would do nothing.
   *
   * The visible per-cell labels carry aria-hidden in the markup, so a value is
   * not announced with its column name twice.
   *
   * `.bank-transaction-table__header` above was left on `display: none` when
   * this rule was written, because that rule is shared with /bank_transactions
   * and that screen was out of scope then. It is now clipped too, by the rule
   * below this one, for all three of its screens. */
  table.bank-match-table .bank-match-table__header {
    display: grid;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* The same decision as the match tables above, now taken for the
   * `.bank-transaction-table` family as well: /bank_transactions,
   * /bank_provider_events and the recent-activity list on /bank_accounts/:id.
   *
   * `display: none` on `.bank-transaction-table__header` above does not hide
   * the header row from a screen reader. It removes it from the accessibility
   * tree: Chrome reports the column headers as ignored, reason `notRendered`.
   * /bank_transactions is a seven-column review list - Account, Date,
   * Transaction, Amount, State, Next action, row action - and at this width
   * those seven stack into one. A screen-reader user was handed a table whose
   * cells had no column header to be associated with, on the screen where
   * money arriving in a bank account is reviewed. The rule is shared, so the
   * other two screens had it as well.
   *
   * `display: grid` is restored explicitly, and that is load-bearing. This
   * rule outranks the `display: none` above on specificity but says nothing
   * about `display` otherwise, so without it the header row would stay out of
   * the box tree and the clip would do nothing at all. The same trap is
   * recorded against the match tables above.
   *
   * The visible per-cell labels carry aria-hidden in the markup, so a value is
   * not announced with its column name twice.
   *
   * Scoped by element - `table.` - so it cannot reach a div user of these
   * class names if a future view adds one. Pinned by
   * spec/accessibility/bank_transactions_mobile_column_headers_spec.rb. */
  table.bank-transaction-table .bank-transaction-table__header {
    display: grid;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .reconciliation-queue-group .section-heading {
    flex-direction: column;
  }

  .audit-trail-item__meta {
    grid-template-columns: 1fr;
  }

  /* The journal line tables stack at this width, so each value needs its own
   * label. The per-cell labels below supply that for a sighted reader.
   *
   * The header row is NOT `display: none` here, which is what the five tables
   * above do. These four columns are Account/Journal, Description, Debit,
   * Credit, and Debit and Credit each render either a money amount or an em
   * dash: once stacked they are indistinguishable. Removing the header row from
   * the box tree would also remove the column headers from the accessibility
   * tree, on exactly the viewport where that ambiguity bites. It is clipped
   * instead, so the table keeps real column headers at every width.
   *
   * It must be scoped past `.journal-lines-table__header` in the collapse list
   * above, which this rule follows in source order and outranks on specificity
   * through the `table.` prefix. */
  table.journal-lines-table .journal-lines-table__header {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .journal-lines-table__mobile-label {
    display: inline-flex;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .expense-detail .payment-header-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .expense-records-review__grid {
    grid-template-columns: 1fr;
  }

  .expense-detail__full-width .attachment-list__header {
    flex-direction: column;
  }

  .expense-detail__full-width .attachment-list__identity {
    flex-basis: auto;
    width: 100%;
  }

  .expense-detail__full-width .attachment-list__actions {
    width: 100%;
  }

  .expense-detail .workspace-header__actions {
    padding-right: 3.75rem;
  }

  .company-setup-wrapper {
    padding-inline: 12px;
  }

  /* `.setup-wizard-header--compact { position: static }` used to sit here and
     never applied once. See the rule that replaces it, immediately after the
     base rule at the bottom of this stylesheet: an unconditional rule with the
     SAME selector and the same specificity is declared later in the file, and
     source order decides a tie. A media query adds no specificity and does not
     change where a rule sits in the file. */

  .setup-wizard-header,
  .setup-wizard-card {
    padding: 22px 20px;
  }

  .setup-wizard-header,
  .setup-wizard-card__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .setup-copilot-strip {
    align-items: flex-start;
  }

  .company-setup-layout .copilot-launcher {
    right: 18px;
    bottom: 18px;
    max-width: calc(100vw - 36px);
  }

  .setup-wizard-stepper {
    grid-template-columns: 1fr;
  }

  .bank-account-card__badges {
    justify-content: flex-start;
  }

  .reconciliation-queue-card__badges,
  .reconciliation-queue-card__actions,
  .reconciliation-queue-group__meta {
    justify-content: flex-start;
  }

  .reconciliation-queue-card__actions .button {
    width: 100%;
  }

  .reconciliation-workspace-card__badges,
  .reconciliation-workspace-card__actions {
    justify-content: flex-start;
  }

  .reconciliation-backlog-actions .button,
  .reconciliation-workspace-card__actions .button {
    width: 100%;
  }

  .invoice-form-grid,
  .vat-workflow-form-grid {
    grid-template-columns: 1fr;
  }

  .payment-card__actions .button,
  .payment-card__actions .button_to {
    width: 100%;
  }

  .invoice-card__actions .button,
  .invoice-card__actions .button_to,
  .workspace-header__actions .button,
  .workspace-header__actions .button_to {
    width: 100%;
  }

  .invoice-line-row__errors {
    grid-column: 1 / -1;
  }

  .lead-capture-form__fields {
    flex-direction: column;
  }

  .lead-capture-form__input {
    width: 100%;
  }
}

.guided-onboarding-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(55, 108, 255, 0.14);
  box-shadow: 0 18px 40px rgba(18, 42, 88, 0.08);
}

.guided-onboarding-panel--step {
  border-color: rgba(55, 108, 255, 0.2);
}

.guided-onboarding-panel__copy {
  display: grid;
  gap: 16px;
}

.guided-onboarding-panel__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.guided-onboarding-panel__details div {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(245, 249, 255, 0.92);
}

.guided-onboarding-panel__details dt {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.guided-onboarding-panel__details dd {
  margin: 0;
  color: var(--color-text);
  line-height: 1.55;
}

.email-confirmation-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-color: rgba(217, 119, 6, 0.18);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(255, 248, 235, 0.92));
}

.email-confirmation-banner__content {
  display: grid;
  gap: 6px;
}

.email-confirmation-banner h2 {
  font-size: 1.05rem;
  margin: 0;
}

.email-confirmation-banner p {
  margin: 0;
}

.guided-onboarding-highlight {
  position: relative;
  box-shadow: 0 0 0 3px rgba(55, 108, 255, 0.16), 0 14px 28px rgba(55, 108, 255, 0.14);
}

.guided-onboarding-highlight::after {
  content: "Next guided action";
  position: absolute;
  top: -11px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f5f8ff;
  border: 1px solid rgba(55, 108, 255, 0.2);
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.company-setup-layout {
  min-height: 100vh;
}

.company-setup-wrapper {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding-top: 32px;
  padding-bottom: 48px;
  padding-left: 24px;
  padding-right: 24px;
}

.setup-wizard-shell {
  display: grid;
  gap: 24px;
}

.setup-wizard-shell--embedded {
  margin-bottom: 24px;
}

.setup-wizard-card {
  padding: 28px 32px;
}

.setup-wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 14px;
}

.setup-wizard-header--compact {
  position: sticky;
  top: 10px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

/* A STICKY HEADER THAT BECOMES A COLUMN COVERS THE FORM BELOW IT.
   Measured on /business_profile?step=business_type at 375 and 390 CSS pixels:
   the Continue button sat at y=329, inside the viewport, unclipped - and
   `document.elementFromPoint` at its own centre returned the <strong> reading
   "In progress" inside `header.card.setup-wizard-header--compact`
   (position: sticky, z-index: 20). Chrome refused the click:
   "element click intercepted ... Other element would receive the click".
   Neither route of the journey could get past its first step on a phone.

   The narrow rule that stops this was WRITTEN, inside the
   @media (max-width: 720px) block above, and never applied once. The base rule
   directly above has the SAME selector and therefore the same specificity
   (0,1,0), and it is declared LATER in the file; a media query adds no
   specificity and does not move a rule in source order, so the tie went to the
   later declaration at every width. This is the source-order half of the same
   cascade trap that shadowed `.bank-transaction-table--review` behind its own
   narrow-width collapse.

   So the declaration is restated here, after the rule that was beating it,
   rather than given !important or a manufactured extra class. It is one
   declaration, gated at 720px, and desktop never sees it: above 720px the
   header stays a short sticky row, which is what it is for.

   35 other declarations in this stylesheet are dead for the same reason - see
   spec/system/narrow_width_cascade_spec.rb, which measures this one and lists
   the rest. The others are padding, alignment and grid-track declarations;
   none was measured as unreachability, and they are the owner's to decide on. */
@media (max-width: 720px) {
  .setup-wizard-header--compact {
    position: static;
  }
}

.setup-wizard-header__identity {
  display: grid;
  gap: 4px;
  min-width: min(280px, 100%);
}

.setup-wizard-header__identity strong,
.setup-wizard-header__identity .setup-wizard-header__title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* The page name is an <h1> for the document outline. It carries the typography
   of the <strong> it replaced, so nothing about the design moves. */
.setup-wizard-header__identity .setup-wizard-header__title {
  margin: 0;
  font-weight: 700;
}

.setup-wizard-header__identity span:last-child {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.setup-wizard-header__meta {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  flex: 1 1 auto;
}

.setup-wizard-card {
  display: grid;
  gap: 22px;
}

.setup-prefill-draft--compact {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.setup-prefill-draft__summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.setup-prefill-draft__summary p,
.setup-prefill-draft__note,
.setup-prefill-draft__details p {
  margin: 4px 0 0;
  color: var(--muted-text);
}

.setup-prefill-draft__details {
  border-top: 1px solid rgba(194, 214, 236, 0.75);
  padding-top: 10px;
}

.setup-prefill-draft__details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.setup-copilot-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(239, 246, 255, 0.86);
}

.setup-copilot-strip p {
  margin: 6px 0 0;
}

.historical-import-copilot-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.68);
}

.historical-import-copilot-entry strong {
  display: block;
  margin-top: 2px;
  font-size: 0.96rem;
}

.historical-import-copilot-entry__button.field-help__button {
  width: auto;
  height: auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  box-shadow: none;
}

.historical-import-guide-drawer {
  display: grid;
  gap: 16px;
}

.historical-import-guide-drawer p,
.historical-import-guide-drawer ul,
.historical-import-guide-drawer dl {
  margin: 0;
}

.historical-import-guide-drawer ul {
  display: grid;
  gap: 8px;
  padding-left: 1.2rem;
}

.historical-import-guide-drawer__context {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.74);
}

.historical-import-guide-drawer__context div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding-bottom: 6px;
}

.historical-import-guide-drawer__context div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.historical-import-guide-drawer__context dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.historical-import-guide-drawer__context dd {
  font-weight: 800;
  text-align: right;
}

.historical-import-guide-drawer__actions {
  padding-top: 4px;
}

.setup-wizard-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 600;
}

.setup-wizard-progress-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.setup-wizard-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-wizard-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.setup-wizard-step--summary {
  min-height: 100%;
}

.setup-wizard-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-strong);
  font-weight: 700;
}

.setup-wizard-step.is-current {
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: var(--shadow-sm);
}

.setup-wizard-step.is-complete .setup-wizard-step__number {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
}

.setup-wizard-step.is-upcoming {
  opacity: 0.82;
}

.setup-wizard-step strong {
  display: block;
}

.business-setup-company-fetch {
  display: grid;
  gap: 18px;
}

.wizard-fieldset {
  width: 100%;
  margin: 0;
  padding: 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  background: rgba(248, 251, 255, 0.72);
  display: grid;
  gap: 16px;
}

.wizard-fieldset legend {
  padding: 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-reference-chooser {
  display: grid;
  gap: 10px;
}

.payment-reference-chooser__custom {
  margin-top: 0;
}

.payment-reference-chooser__preview {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 700;
}

.setup-inline-section-head {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.card-actions--inline {
  justify-content: flex-start;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
}

.flatpickr-calendar {
  border: 1px solid rgba(194, 214, 236, 0.92);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  box-shadow: 0 18px 44px rgba(18, 42, 88, 0.12);
}

.flatpickr-months {
  padding: 10px 10px 0;
}

.flatpickr-current-month {
  padding-top: 6px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 700;
  color: var(--text);
}

.flatpickr-weekdays {
  padding: 0 12px;
}

span.flatpickr-weekday {
  color: var(--muted);
  font-weight: 700;
}

.flatpickr-days {
  padding: 8px 12px 12px;
}

.flatpickr-day {
  border-radius: 12px;
  color: var(--text);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: rgba(31, 122, 228, 0.08);
  border-color: rgba(31, 122, 228, 0.12);
}

.flatpickr-day.today {
  border-color: rgba(31, 122, 228, 0.24);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.flatpickr-day.inRange {
  background: rgba(31, 122, 228, 0.08);
  border-color: rgba(31, 122, 228, 0.08);
  box-shadow: none;
}

.admin-support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-support-banner {
  margin-bottom: 20px;
}

.admin-support-stack,
.admin-activity-list,
.admin-table-actions {
  display: grid;
  gap: 14px;
}

.admin-activity-row {
  display: grid;
  gap: 4px;
}

.support-detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.support-detail-list div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.72);
  border: 1px solid rgba(194, 214, 236, 0.86);
}

.support-detail-list dt {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-detail-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.copilot-overlay-open {
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.copilot-launcher {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 35;
  min-width: 188px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.company-setup-layout .copilot-launcher {
  bottom: 92px;
}

.copilot-launcher__label,
.copilot-launcher__subtext {
  color: #ffffff;
}

.copilot-launcher__label {
  font-size: 0.95rem;
  font-weight: 700;
}

.copilot-launcher__subtext {
  font-size: 0.8rem;
  opacity: 0.9;
}

body.workspace-body .copilot-launcher {
  right: 12px;
  bottom: 12px;
  width: 48px;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  text-align: center;
}

body.workspace-body .copilot-launcher__label {
  font-size: 0;
}

body.workspace-body .copilot-launcher__label::before {
  content: "AI";
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

body.workspace-body .copilot-launcher__subtext {
  display: none;
}

.copilot-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
}

.copilot-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
}

.copilot-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 32px));
  height: min(92vh, 980px);
  margin: 4vh auto;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
}

.copilot-overlay__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--line);
}

.copilot-overlay__header p {
  max-width: 760px;
}

.copilot-overlay__header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.copilot-overlay__sidebar-toggle[hidden] {
  display: none;
}

.copilot-overlay__body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.copilot-overlay__body.is-sidebar-expanded {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
}

.copilot-overlay__body.is-sidebar-expanded .copilot-conversation {
  display: grid;
}

.copilot-overlay__body.is-sidebar-expanded .copilot-overlay__sidebar {
  border-right: 1px solid var(--line);
}

.copilot-overlay__sidebar {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.92);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: width 160ms ease, padding 160ms ease;
}

.copilot-overlay__sidebar[hidden] {
  display: none;
}

.copilot-overlay__sidebar.is-collapsed {
  display: none;
}

.copilot-sidebar__section {
  min-width: 0;
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 248, 255, 0.94)),
    linear-gradient(145deg, rgba(31, 122, 228, 0.04), transparent 62%);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.copilot-sidebar__section.is-open {
  flex: 1 1 auto;
  min-height: 0;
  border-color: rgba(30, 64, 175, 0.16);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.98);
}

.copilot-overlay__sidebar.is-collapsed .copilot-sidebar__section {
  padding: 8px;
}

.copilot-overlay__sidebar.is-collapsed .copilot-sidebar__section.is-open {
  flex: 0 0 auto;
}

.copilot-sidebar__section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.copilot-sidebar__section-toggle:hover {
  background: rgba(31, 122, 228, 0.06);
}

.copilot-sidebar__section-title {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilot-sidebar__section-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.copilot-sidebar__section-chevron {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(59, 130, 246, 0.7);
  border-bottom: 2px solid rgba(59, 130, 246, 0.7);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.copilot-sidebar__section.is-open .copilot-sidebar__section-chevron {
  transform: rotate(225deg);
}

.copilot-sidebar__section.is-open .copilot-sidebar__section-title {
  color: var(--accent-strong);
}

.copilot-sidebar__section.is-open .copilot-sidebar__section-toggle {
  background: rgba(31, 122, 228, 0.08);
}

.copilot-sidebar__section-items {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 12px;
  padding: 0 12px 12px;
}

.copilot-sidebar__section-items[hidden] {
  display: none;
}

.copilot-sidebar__section.is-open .copilot-sidebar__section-items {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}

.copilot-quick-actions {
  display: grid;
  gap: 10px;
}

.copilot-quick-actions .button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.copilot-conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

.copilot-conversation__messages {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px;
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(245, 249, 255, 0.95));
}

.copilot-message {
  min-width: 0;
  max-width: min(820px, 100%);
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.copilot-message--assistant,
.copilot-message--system {
  justify-self: start;
}

.copilot-message--user {
  justify-self: end;
  background: rgba(219, 234, 254, 0.78);
  border-color: rgba(37, 99, 235, 0.16);
}

.copilot-message__meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.copilot-message__content {
  display: grid;
  gap: 10px;
}

.copilot-message__content p {
  color: var(--text);
}

.copilot-message__progress,
.copilot-document-card__pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-text);
}

.copilot-message__progress {
  margin-top: 12px;
  font-size: 0.9rem;
}

.copilot-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-top-color: rgba(37, 99, 235, 0.84);
  animation: copilot-spin 0.9s linear infinite;
  flex: 0 0 auto;
}

@keyframes copilot-spin {
  to {
    transform: rotate(360deg);
  }
}

.copilot-message__attachments-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-text);
  font-size: 0.85rem;
}

.copilot-message__upload-classification {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

/* The uploaded document, shown above the values read off it. Bounded height so
   a tall receipt cannot push the figures off screen - the point is to compare
   the two, which needs both visible at once. */
.copilot-message__preview {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(247, 250, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.copilot-message__preview-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  object-position: top;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.copilot-message__preview figcaption {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.copilot-message__summary {
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(247, 250, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.copilot-message__details {
  margin-top: 12px;
}

.copilot-message__details > summary {
  cursor: pointer;
  width: fit-content;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.copilot-message__summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.copilot-message__summary dt {
  color: var(--muted-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.copilot-message__summary dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.copilot-message__warnings,
.copilot-message__workflow {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(194, 214, 236, 0.86);
  background: rgba(248, 251, 255, 0.84);
}

.copilot-message__warnings {
  background: rgba(255, 244, 228, 0.72);
  border-color: rgba(245, 158, 11, 0.24);
}

.copilot-message__warnings,
.copilot-message__warning,
.copilot-message__workflow {
  display: none !important;
}

.copilot-message__warnings p,
.copilot-message__workflow p {
  margin: 0;
}

.copilot-message__citations {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 251, 255, 0.86);
}

.copilot-message__citations-title {
  margin: 0 0 8px;
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilot-message__citations ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.copilot-message__citations li {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 0.9rem;
}

.copilot-message__citation-freshness,
.copilot-message__citation-snippet {
  color: var(--muted-text);
}

.copilot-message__workflow-note {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.copilot-message__upload-classification-copy {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.copilot-message__upload-classification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copilot-message__upload-classification-form {
  max-width: 100%;
  margin: 0;
}

.copilot-conversation__composer {
  border-top: 1px solid var(--line);
  padding: 22px 28px 26px;
  background: rgba(255, 255, 255, 0.96);
}

.copilot-conversation__label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-strong);
  font-weight: 600;
}

.copilot-conversation__composer textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
}

.copilot-conversation__upload {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.copilot-conversation__upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.copilot-conversation__upload-note {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.88rem;
}

.copilot-conversation__note,
.copilot-suggestion-card__note,
.copilot-suggestion-card__confidence {
  font-size: 0.9rem;
}

.copilot-conversation__actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.copilot-conversation__status {
  color: var(--muted);
  font-size: 0.9rem;
}

.copilot-suggestions {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.copilot-suggestion-card {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
}

.copilot-suggestion-card__header {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.copilot-suggestion-card__type {
  margin-bottom: 8px;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.copilot-suggestion-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.copilot-suggestion-card__reason,
.copilot-suggestion-card__upload-source {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.copilot-suggestion-card__reason-label {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilot-suggestion-card__reason-text {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.copilot-suggestion-card__form {
  max-width: 100%;
  margin: 0;
}

.copilot-profile-summary__intro,
.copilot-profile-summary__counts,
.copilot-profile-summary__boundary,
.copilot-document-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(247, 250, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.copilot-profile-summary__reason-label {
  margin: 0 0 6px;
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilot-profile-summary__intro-copy {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.copilot-profile-summary__boundary {
  display: grid;
  gap: 6px;
}

.copilot-profile-summary__boundary p:last-child {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.copilot-profile-summary {
  display: grid;
  gap: 10px;
}

.copilot-profile-summary div {
  display: grid;
  gap: 4px;
}

.copilot-profile-summary dt {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilot-profile-summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.copilot-profile-summary__counts {
  display: grid;
  gap: 10px;
}

.copilot-profile-summary__counts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copilot-profile-summary__counts span {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.copilot-documents {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.copilot-document-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  overflow-wrap: anywhere;
}

.copilot-document-card__header,
.copilot-document-card__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.copilot-document-card__header strong,
.copilot-suggestion-card__header strong,
.copilot-suggestion-card__upload-source strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copilot-document-card__meta {
  color: var(--muted-text);
  font-size: 0.88rem;
}

.copilot-document-card__note,
.copilot-document-card__next-step {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.copilot-document-card__summary {
  margin: 0;
  display: grid;
  gap: 6px;
}

.copilot-document-card__summary div {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
}

.copilot-document-card__summary dt {
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.copilot-document-card__summary dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.copilot-document-card__warnings {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 244, 228, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.copilot-document-card__warnings p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
}

.copilot-document-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copilot-document-card__actions .button,
.copilot-message__upload-classification-actions .button,
.copilot-suggestion-card__actions .button {
  max-width: 100%;
  white-space: normal;
}

.copilot-document-card__review {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.copilot-document-card__review-title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.copilot-document-card__review summary {
  cursor: pointer;
  list-style: none;
}

.copilot-document-card__review summary::-webkit-details-marker {
  display: none;
}

.copilot-document-card__review-form {
  display: grid;
  gap: 10px;
}

.copilot-document-card__review-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copilot-document-card__review-grid .field--full {
  grid-column: 1 / -1;
}

.copilot-document-card__review-grid textarea,
.copilot-document-card__review-grid input,
.copilot-document-card__review-grid select {
  width: 100%;
}

.copilot-document-card__raw-text {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.copilot-overlay__panel {
  width: min(1320px, calc(100vw - 20px));
  height: min(96vh, 1040px);
  margin: 2vh auto;
  border-radius: 24px;
  overflow: hidden;
}

.copilot-overlay__panel--with-modes {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.copilot-overlay__assistant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.copilot-overlay__assistant-actions[hidden],
.copilot-overlay__guide[hidden],
.copilot-overlay__body[hidden] {
  display: none;
}

.copilot-overlay__mode-tabs {
  display: flex;
  align-items: end;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.copilot-overlay__mode-tab {
  min-height: 44px;
  padding: 10px 2px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted-text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.copilot-overlay__mode-tab:hover,
.copilot-overlay__mode-tab:focus-visible {
  color: var(--text);
}

.copilot-overlay__mode-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.copilot-overlay__guide {
  min-width: 0;
  min-height: 0;
  padding: 20px 22px 30px;
  background: #ffffff;
  overflow: auto;
  overflow-wrap: anywhere;
}

.business-setup-guide {
  width: min(100%, 1000px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.business-setup-guide__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.business-setup-guide__intro h3 {
  margin: 4px 0 6px;
  font-size: 1.3rem;
  letter-spacing: 0;
}

.business-setup-guide__intro p,
.business-setup-guide__section p {
  margin: 0;
  line-height: 1.55;
}

.business-setup-guide__position {
  min-width: 150px;
  display: grid;
  gap: 4px;
  text-align: right;
}

.business-setup-guide__position span {
  color: var(--muted-text);
  font-size: 0.84rem;
}

.business-setup-guide__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.business-setup-guide__section {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.business-setup-guide__section h4 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0;
}

.business-setup-guide__section ul,
.business-setup-guide__journey {
  margin: 0;
  padding-left: 20px;
}

.business-setup-guide__section li {
  margin: 6px 0;
  line-height: 1.45;
}

.business-setup-guide__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.business-setup-guide__choices > div {
  min-width: 0;
  padding-left: 12px;
  border-left: 3px solid var(--line-strong);
}

.business-setup-guide__choices p {
  margin-top: 4px;
  color: var(--muted-text);
  font-size: 0.86rem;
}

.business-setup-guide__choices small {
  display: block;
  margin-top: 2px;
  color: var(--muted-text);
}

.business-setup-guide__journey {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.business-setup-guide__journey li {
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 72px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.8rem;
}

.business-setup-guide__journey li.is-current {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: #ffffff;
}

.business-setup-guide__journey li.is-complete {
  border-color: #83a98d;
  background: #f4faf5;
}

.business-setup-guide__journey small {
  color: var(--muted-text);
  font-size: 0.7rem;
}

.company-setup-layout .copilot-launcher--business-setup,
body.workspace-body .copilot-launcher--business-setup {
  position: static;
  width: auto;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}

body.workspace-body .copilot-launcher--business-setup .copilot-launcher__label {
  font-size: 0.86rem;
  letter-spacing: 0;
}

body.workspace-body .copilot-launcher--business-setup .copilot-launcher__label::before {
  content: none;
}

button.copilot-launcher.copilot-launcher--business-setup-floating {
  position: fixed;
  right: max(20px, calc(env(safe-area-inset-right, 0px) + 16px));
  bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  z-index: 35;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  flex: 0 0 56px;
  gap: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2), var(--indigo));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.26);
  transition: transform 160ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button.copilot-launcher.copilot-launcher--business-setup-floating:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.34);
  filter: brightness(1.04) saturate(1.06);
}

button.copilot-launcher.copilot-launcher--business-setup-floating:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.24);
  filter: brightness(0.98);
}

button.copilot-launcher.copilot-launcher--business-setup-floating:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--accent), 0 18px 40px rgba(37, 99, 235, 0.32);
}

.copilot-launcher--business-setup-floating .copilot-launcher__icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.copilot-overlay__header {
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.copilot-overlay__title-block {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.copilot-overlay__title-block .eyebrow {
  font-size: 0.7rem;
}

.copilot-overlay__header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.copilot-overlay__header p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.82rem;
}

/* The generative disclosure. Quieter than the title, louder than a caption:
   it has to be read, not skimmed past, but it must not compete with the
   assistant itself. Slightly tighter than body copy because it sits in a
   header, and given a little top margin so it reads as its own statement
   rather than as a continuation of "Guidance only." */
.copilot-overlay__ai-disclosure {
  margin-top: 6px !important;
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 62ch;
}

.copilot-overlay__ai-disclosure strong {
  font-weight: 600;
  color: var(--text);
}

.copilot-overlay__header-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.copilot-overlay__header-actions .button {
  min-height: 0;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.copilot-overlay__body.is-sidebar-expanded {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
}

.copilot-overlay__sidebar {
  padding: 12px;
  gap: 8px;
}

.copilot-sidebar__section {
  gap: 6px;
  padding: 6px;
}

.copilot-sidebar__section-toggle {
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
}

.copilot-sidebar__section-title {
  font-size: 0.7rem;
}

.copilot-sidebar__section-items {
  gap: 8px;
  padding: 0 8px 8px;
}

.copilot-quick-actions {
  gap: 6px;
}

.copilot-conversation__messages {
  padding: 14px 16px;
  align-content: start;
  gap: 10px;
}

.copilot-message {
  padding: 12px 14px;
  border-radius: 16px;
}

.copilot-message__meta {
  margin-bottom: 6px;
}

.copilot-message__content {
  gap: 6px;
}

.copilot-conversation__composer {
  padding: 10px 14px 12px;
}

.copilot-composer {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 40px auto minmax(0, 1fr) 40px 40px;
  align-items: end;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.copilot-composer__upload-copy {
  align-self: center;
  color: var(--muted-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  max-width: 92px;
}

.copilot-composer textarea {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  resize: none;
  box-shadow: none;
  line-height: 1.35;
}

.copilot-composer textarea:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

.copilot-composer__icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.copilot-composer__icon-button:hover:not(:disabled),
.copilot-composer__icon-button:focus-visible {
  background: rgba(219, 234, 254, 0.9);
  transform: translateY(-1px);
}

.copilot-composer__icon-button:disabled {
  color: var(--muted-text);
  cursor: not-allowed;
  opacity: 0.58;
}

.copilot-composer__icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copilot-composer__icon-button--send {
  background: var(--accent);
  color: #ffffff;
}

.copilot-composer__icon-button--send:hover:not(:disabled),
.copilot-composer__icon-button--send:focus-visible {
  background: var(--accent-strong);
  color: #ffffff;
}

.copilot-conversation__status {
  min-height: 16px;
  margin: 0 4px 4px;
  font-size: 0.78rem;
}

.copilot-suggestions,
.copilot-documents {
  gap: 8px;
}

.copilot-suggestion-card,
.copilot-document-card {
  padding: 10px 12px;
  border-radius: 14px;
}

.copilot-suggestion-card__header {
  margin-bottom: 4px;
}

.copilot-suggestion-card__type {
  margin-bottom: 6px;
}

.copilot-suggestion-card__actions {
  gap: 6px;
  margin-top: 8px;
}

.copilot-document-card {
  gap: 6px;
}

.copilot-document-card__note,
.copilot-document-card__next-step {
  font-size: 0.84rem;
}

.copilot-document-card__review {
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
}

.copilot-document-card__review-title {
  font-size: 0.88rem;
}

.copilot-document-card__review-form,
.copilot-document-card__review-grid {
  gap: 8px;
}

@media (max-width: 960px) {
  .admin-support-grid {
    grid-template-columns: 1fr;
  }

  .guided-onboarding-panel__details {
    grid-template-columns: 1fr;
  }

  .copilot-launcher {
    right: 18px;
    bottom: 18px;
    min-width: 164px;
    max-width: calc(100vw - 36px);
  }

  .copilot-overlay__panel {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    margin: 4px;
    border-radius: 18px;
  }

  .business-setup-guide__columns,
  .business-setup-guide__choices {
    grid-template-columns: 1fr;
  }

  .business-setup-guide__journey {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .copilot-overlay__body {
    position: relative;
    grid-template-columns: 1fr;
  }

  .copilot-overlay__header {
    padding: 8px 10px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .copilot-overlay__title-block .eyebrow,
  .copilot-overlay__header p {
    display: none;
  }

  .copilot-overlay__header h2 {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
  }

  .copilot-overlay__header-actions {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 4px;
  }

  .copilot-overlay__header-actions .button {
    padding: 7px 8px;
    font-size: 0.76rem;
  }

  .copilot-overlay__assistant-actions {
    gap: 4px;
  }

  .copilot-overlay__sidebar {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: absolute;
    z-index: 2;
    inset: 0 0 auto 0;
    padding: 10px;
    max-height: 48vh;
    box-shadow: var(--shadow-lg);
  }

  .copilot-overlay__sidebar.is-mobile-open {
    display: flex;
  }

  .copilot-conversation__messages,
  .copilot-conversation__composer {
    padding-left: 10px;
    padding-right: 10px;
  }

  .copilot-conversation__messages {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .copilot-conversation__composer {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .copilot-composer {
    grid-template-columns: 36px minmax(0, 1fr) 36px 36px;
    gap: 4px;
    min-height: 44px;
    padding: 4px;
    border-radius: 16px;
  }

  .copilot-composer__upload-copy {
    display: none;
  }

  .copilot-composer__icon-button {
    width: 34px;
    height: 34px;
  }

  .copilot-composer textarea {
    min-height: 34px;
    max-height: 92px;
    padding: 7px 2px;
    font-size: 16px;
  }

  .copilot-launcher {
    right: 14px;
    bottom: 14px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .copilot-launcher__subtext {
    display: none;
  }

  .copilot-conversation__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .copilot-document-card__summary div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .copilot-message__summary div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .copilot-document-card__summary dd {
    text-align: left;
  }

  .copilot-message__summary dd {
    text-align: left;
  }

  .copilot-document-card__review-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-tab-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-tab-button {
    min-width: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #field-help-drawer,
  .field-help-drawer {
    width: clamp(360px, 30vw, 520px);
  }

  .review-drawer {
    width: clamp(380px, 34vw, 560px);
  }
}

@media (max-width: 640px) {
  .copilot-overlay__guide {
    padding: 16px 14px 24px;
  }

  .business-setup-guide__intro {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .business-setup-guide__position {
    min-width: 0;
    text-align: left;
  }

  .business-setup-guide__journey {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-setup-layout .copilot-launcher--business-setup,
  body.workspace-body .copilot-launcher--business-setup {
    max-width: calc(100vw - 24px);
  }

  /* ON A PHONE THE BUSINESS SETUP LAUNCHER LEAVES THE FIXED LAYER.
   *
   * The base rule above this media query puts it at `position: fixed`,
   * `z-index: 35`, 56px square, pinned to the bottom-right corner. At a 390px
   * viewport that corner is x = 314..370 at every screen size, because there
   * was no media query for this variant at all - and `.field-help__button`
   * ("Explain: ...") sits at x = 309..333 on the Business Setup form. Measured
   * on 2026-11-24 at 390 CSS pixels: scrolled to y = 1560 the launcher
   * occupies 314..370 x 568..624 and a tap at the help button's own centre
   * (321, 592) lands on the launcher instead.
   *
   * Nothing about the page's own layout can fix that. The disc is in the fixed
   * layer, so whatever happens to be under the bottom-right corner at the
   * current scroll position is unreachable; bottom padding or a spacer only
   * changes WHICH control is covered. The only honest repair is to take it out
   * of that layer, so at phone width it is laid out in the document as an
   * ordinary primary button across the width of the page, less a 16px gutter,
   * instead of an overlay. The 56px disc is unchanged above 640px.
   *
   * It carries no text node - `spec/requests/copilot/launcher_visibility_spec.rb`
   * holds the floating variant to icon-only, and the icon is the whole point of
   * a disc - so the in-flow form states its purpose through generated content,
   * the same device as `body.workspace-body .copilot-launcher__label::before`.
   * WCAG 2.5.3 Label in Name is satisfied because the visible string is a
   * substring of the button's `aria-label` ("Open Guide & AI Accountant").
   */
  button.copilot-launcher.copilot-launcher--business-setup-floating {
    position: static;
    /* `calc(100% - 32px)` and not `width: auto`: a `<button>` shrink-wraps its
     * content at `auto` whatever its `display` is, which gave a 198px button
     * floating at the left of a 390px page. The width is taken from the
     * container and the two 16px gutters come out of it, so the button cannot
     * be wider than the room it has and the page does not scroll sideways. */
    display: flex;
    width: calc(100% - 32px);
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 48px;
    max-height: none;
    flex: 0 0 auto;
    gap: 10px;
    margin: 20px 16px 4px;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
  }

  button.copilot-launcher.copilot-launcher--business-setup-floating::after {
    content: "Guide & AI Accountant";
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
  }

  /* `transform: translateY(-2px)` on a disc that floats above the page is
   * feedback; on a button in the flow it is a nudge out of alignment with the
   * content above it. The colour and shadow feedback is kept. */
  button.copilot-launcher.copilot-launcher--business-setup-floating:hover {
    transform: none;
  }

  #field-help-drawer,
  .field-help-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    border-left: 0;
  }

  .review-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    border-left: 0;
  }

  .guided-onboarding-highlight::after {
    position: static;
    display: inline-block;
    margin-top: 8px;
  }
}

.owner-beta-hero,
.owner-beta-panel,
.owner-beta-grid {
  margin-bottom: 24px;
}

.owner-beta-hero__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.owner-beta-hero h1 {
  margin-top: 14px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.owner-beta-actions,
.owner-beta-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.owner-beta-form-actions {
  margin-top: 22px;
}

.owner-beta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.owner-beta-grid--wide {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.owner-beta-panel--warning {
  border-color: rgba(248, 179, 52, 0.34);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.86), rgba(249, 252, 255, 0.96));
}

.owner-beta-run-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.owner-beta-run-card,
.owner-beta-empty-state,
.owner-beta-safe-note {
  padding: 18px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 18px;
  background: var(--card-muted);
}

.owner-beta-run-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.owner-beta-run-card h3,
.owner-beta-empty-state h3,
.owner-beta-panel h3 {
  margin-top: 10px;
  color: var(--text);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.owner-beta-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}

.owner-beta-metadata-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.owner-beta-metadata-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.owner-beta-metadata-grid dd {
  margin: 6px 0 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.owner-beta-form {
  margin-top: 20px;
}

.owner-beta-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.owner-beta-form-grid .field--full {
  grid-column: 1 / -1;
}

.owner-beta-checklist,
.owner-beta-boundary-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
}

.owner-beta-checklist {
  padding-left: 24px;
}

.owner-beta-checklist li,
.owner-beta-boundary-list li {
  padding: 12px 14px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  line-height: 1.5;
}

.owner-beta-boundary-list--compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.owner-beta-copy {
  width: 100%;
  min-height: 260px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.owner-beta-copy--short {
  min-height: 170px;
}

.review-drawer .tax-optimisation-drawer-copy {
  min-height: 0;
  height: auto;
}

.owner-beta-panel h3 + .owner-beta-copy {
  margin-top: 10px;
}

@media (max-width: 960px) {
  .owner-beta-hero__body,
  .owner-beta-run-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .owner-beta-grid,
  .owner-beta-grid--wide,
  .owner-beta-form-grid {
    grid-template-columns: 1fr;
  }
}

/* DII shared app UI foundation: use before adding feature-specific CSS. */
.app-workspace,
.feature-workspace {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.feature-workspace__header {
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.feature-workspace__header--dense {
  padding: 0;
}

.feature-workspace__header--dense .card-body {
  display: grid;
  gap: 8px;
}

.feature-workspace__header h1,
.app-page-title {
  font-size: clamp(1.65rem, 2.1vw, 2.35rem);
  line-height: 1.05;
}

.feature-workspace__header p,
.app-body,
.app-muted {
  font-size: 0.96rem;
  line-height: 1.6;
}

.app-muted {
  color: var(--muted);
}

.app-section-title {
  font-size: clamp(1.25rem, 1.5vw, 1.55rem);
  line-height: 1.18;
}

.app-card-title {
  font-size: 1rem;
  line-height: 1.25;
}

.app-stack {
  display: grid;
  gap: 16px;
}

.app-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.app-stat-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.app-stat-card h3 {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.app-stat-card p {
  font-size: 0.86rem;
  line-height: 1.42;
}

.dii-stepper {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border-radius: 16px;
}

.dii-stepper .dashboard-tab-button {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-height: 38px;
  padding: 0.58rem 0.78rem;
  border-radius: 12px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.dii-stepper .dashboard-tab-button__meta {
  margin-left: 0.35rem;
  font-size: 0.66rem;
  padding: 0.16rem 0.38rem;
}

.import-summary-line {
  max-width: none;
  margin: 0;
}

.import-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.import-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.65rem;
  padding: 0.24rem 0.55rem;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.import-summary-chip strong {
  color: var(--text);
}

.import-summary-chip--success {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.08);
}

.import-summary-chip--warning {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(217, 119, 6, 0.08);
}

.import-summary-next {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.opening-position-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.opening-position-status > div {
  display: grid;
  gap: 0.2rem;
}

.opening-position-status strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.3;
}

.opening-position-subtitle {
  margin: 1.25rem 0 0.65rem;
  color: var(--text);
  font-size: 1rem;
}

.opening-balance-lines-table th,
.opening-balance-lines-table td {
  vertical-align: top;
}

.opening-balance-lines-table--readable {
  border-collapse: separate;
  border-spacing: 0;
}

.opening-balance-lines-table--readable th,
.opening-balance-lines-table--readable td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}

.opening-balance-lines-table--readable tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.025);
}

.opening-balance-lines-table .money-column {
  text-align: right;
  white-space: nowrap;
}

.opening-balance-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.opening-balance-chip--ready,
.opening-balance-chip--system {
  border-color: rgba(22, 101, 52, 0.24);
  background: rgba(240, 253, 244, 0.82);
  color: #166534;
}

.opening-balance-chip--manual,
.opening-balance-chip--row {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.86);
  color: #1d4ed8;
}

.opening-balance-chip--warning {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(255, 251, 235, 0.9);
  color: #92400e;
}

.opening-balance-line-actions {
  min-width: 13rem;
}

.opening-balance-line-actions details {
  margin-bottom: 0.5rem;
}

.opening-balance-line-form {
  display: grid;
  gap: 0.65rem;
  max-width: 22rem;
  margin-top: 0.6rem;
}

.opening-position-source-card {
  margin-top: 1rem;
}

.opening-balance-action-card {
  border-color: rgba(37, 99, 235, 0.22);
}

.opening-balance-progress-callout {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(22, 101, 52, 0.24);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.82);
  color: var(--text);
}

.opening-balance-progress-callout strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.opening-balance-progress-callout span {
  color: var(--muted);
  font-size: 1rem;
}

.opening-balance-primary-action {
  margin-top: 0.75rem;
}

.opening-balance-missing-area,
.opening-balance-final-action {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.opening-balance-missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.5rem;
}

.opening-balance-plain-preview {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.72);
}

.opening-balance-plain-preview ul {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
}

.opening-balance-grouped-summary {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.72);
}

.opening-balance-grouped-summary h3 {
  margin: 0;
  font-size: 1.05rem;
}

.opening-balance-summary-group {
  display: grid;
  gap: 0.35rem;
}

.opening-balance-summary-group ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.opening-balance-summary-group li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.opening-balance-summary-status {
  margin: 0;
  padding-top: 0.4rem;
  color: var(--text);
}

.opening-balance-missing-card {
  display: block;
  min-height: 2.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
  text-decoration: none;
}

.opening-balance-missing-card:hover,
.opening-balance-missing-card:focus,
.opening-balance-missing-card.is-selected {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(239, 246, 255, 0.86);
}

.opening-balance-manual-form {
  margin-top: 1rem;
}

.opening-balance-manual-form summary.button {
  display: inline-flex;
  width: fit-content;
  list-style: none;
  cursor: pointer;
}

.opening-balance-manual-form summary.button::-webkit-details-marker {
  display: none;
}

.opening-balance-accounting-details {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.advanced-panel-title {
  margin: 0.35rem 0 0.4rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.dashboard-starting-position-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(22, 101, 52, 0.22);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.82);
}

.dashboard-starting-position-card h3 {
  margin: 0.25rem 0;
  font-size: 1.05rem;
}

.dashboard-starting-position-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.dashboard-starting-position-card dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.dashboard-starting-position-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-starting-position-card dd {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-weight: 800;
}

.advanced-panel-table {
  font-size: 0.88rem;
}

.dii-table-shell {
  overflow-x: auto;
  padding: 8px;
  border-radius: 16px;
}

.dii-table {
  width: 100%;
  min-width: 980px;
  table-layout: auto;
  border-collapse: collapse;
}

.dii-table--compact th,
.dii-table--compact td {
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
  line-height: 1.25;
  vertical-align: middle;
}

.dii-table--compact th {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
}

.dii-table__col-row {
  width: 3.25rem;
}

.dii-table__col-actions {
  width: 22rem;
}

.dii-table__sort,
.dii-table__sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  font: inherit;
  font-weight: 800;
  text-transform: inherit;
  letter-spacing: inherit;
  box-shadow: none;
}

.dii-table__sort-caret {
  color: var(--accent-strong);
  font-size: 0.72rem;
  line-height: 1;
}

.dii-table__actions {
  white-space: nowrap;
  min-width: 22rem;
}

.dii-table__actions-inner {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}

.dii-table-action-form {
  display: inline-flex;
  margin: 0;
}

.dii-table-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(194, 214, 236, 0.94);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.dii-table-action:disabled {
  cursor: default;
  opacity: 1;
}

.dii-table-action--active {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(219, 234, 254, 0.78);
  color: var(--accent-strong);
}

.dii-table-action--success {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.dii-table-action--warning,
.dii-table-action--primary {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.dii-table-action--muted {
  border-color: rgba(100, 116, 139, 0.22);
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.historical-import-row--ignored {
  opacity: 0.68;
}

.historical-import-row--reviewed {
  background: rgba(236, 253, 245, 0.28);
}

.historical-import-row--needs-review,
.historical-import-row--unsupported,
.historical-import-row--error {
  background: rgba(255, 251, 235, 0.45);
}

.dii-status-chip--note {
  margin-left: 0.35rem;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-strong);
}

.dii-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 6px;
}

.dii-table-toolbar__control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.filter-select--compact {
  width: auto;
  min-width: 72px;
  min-height: 30px;
  padding: 0.22rem 1.8rem 0.22rem 0.55rem;
  font-size: 0.8rem;
}

.dii-status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.22rem 0.54rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dii-status-chip--success {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.dii-status-chip--warning,
.dii-status-chip--accent {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.dii-status-chip--danger {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.dii-status-chip--muted,
.dii-status-chip--inactive {
  background: rgba(71, 85, 105, 0.12);
  color: #475569;
}

.dii-status-chip--neutral {
  background: rgba(42, 110, 220, 0.12);
  /* --dii-blue (#2A6EDC) measured 4.11:1 on this tint at 0.72rem. */
  color: var(--accent-strong);
}

.onboarding-preview-card__body {
  display: grid;
  gap: 18px;
  padding: var(--card-pad-y) var(--card-pad-x);
}

.dii-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.32);
  padding: 18px;
}

.dii-drawer[hidden] {
  display: none;
}

.dii-drawer__panel {
  width: min(100%, 460px);
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  box-shadow: var(--shadow-lg);
}

/* DII UI Framework internal preview */
.dii-framework-preview {
  display: grid;
  gap: var(--dii-space-6);
}

.dii-framework-preview__header-body,
.dii-framework-wireframe__header,
.dii-framework-wireframe__actions,
.dii-framework-button-row,
.dii-framework-status-row {
  display: flex;
  align-items: center;
  gap: var(--dii-space-4);
}

.dii-framework-preview__header-body,
.dii-framework-wireframe__header {
  justify-content: space-between;
}

.dii-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dii-space-2);
  width: 100%;
}

.dii-page-title__copy,
.dii-card__heading,
.dii-card__content,
.dii-table-component,
.dii-table-component__header,
.dii-empty-state__copy {
  display: grid;
  gap: var(--dii-space-2);
}

.dii-page-title__copy {
  max-width: 760px;
}

.dii-page-title__actions,
.dii-card__actions,
.dii-empty-state__action {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--dii-space-2);
}

.dii-page-title h1 {
  color: var(--dii-text-dark);
  font-size: 2rem;
}

.dii-page-title p {
  color: var(--dii-text-light);
}

.dii-framework-preview__header-actions,
.dii-framework-button-row,
.dii-framework-status-row {
  flex-wrap: wrap;
}

.dii-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--dii-radius-card);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.dii-btn--primary {
  background: var(--dii-blue);
  color: var(--dii-white);
}

.dii-btn--secondary {
  border-color: rgba(42, 110, 220, 0.16);
  background: var(--dii-white);
  color: var(--dii-blue);
}

.dii-btn--tertiary {
  background: transparent;
  color: var(--dii-blue);
}

.dii-btn--text {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--dii-blue);
}

.dii-btn:disabled {
  cursor: default;
  opacity: 0.58;
}

.dii-card__body {
  display: grid;
  gap: var(--dii-space-4);
}

.dii-card__header,
.dii-empty-state {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--dii-space-4);
}

.dii-card--insight {
  border-color: rgba(111, 207, 151, 0.24);
}

.dii-dashboard-grid,
.dii-framework-token-grid,
.dii-framework-wireframe__main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--dii-space-4);
}

.dii-dashboard-grid--three,
.dii-framework-token-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dii-framework-token,
.dii-framework-file-placeholder,
.dii-framework-wireframe__panel {
  display: grid;
  gap: var(--dii-space-2);
  padding: var(--dii-space-4);
  border: 1px solid rgba(194, 214, 236, 0.9);
  border-radius: var(--dii-radius-card);
  background: var(--dii-grey-soft);
}

.dii-framework-token__swatch {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(31, 45, 61, 0.12);
  border-radius: var(--dii-radius-card);
}

.dii-kpi > .dii-card__body {
  display: grid;
  gap: var(--dii-space-2);
}

.dii-kpi__copy {
  display: grid;
  gap: var(--dii-space-2);
}

.dii-kpi__title {
  color: var(--dii-text-light);
  font-size: 0.86rem;
  font-weight: 800;
}

.dii-kpi__value {
  color: var(--dii-text-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.8rem;
}

.dii-kpi--positive {
  border-color: rgba(111, 207, 151, 0.3);
}

.dii-kpi--warning {
  border-color: rgba(242, 201, 76, 0.34);
}

.dii-kpi--danger {
  border-color: rgba(235, 87, 87, 0.28);
}

.dii-framework-form {
  display: grid;
  gap: var(--dii-space-4);
  max-width: 720px;
}

.dii-form-field {
  position: relative;
}

.dii-form-field__label {
  display: flex;
  align-items: center;
  gap: var(--dii-space-2);
  margin-bottom: var(--dii-space-2);
  color: var(--dii-text-dark);
  font-weight: 800;
}

.dii-form-field__required {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.12rem 0.42rem;
  border-radius: var(--dii-radius-pill);
  background: rgba(42, 110, 220, 0.12);
  color: var(--dii-blue);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.dii-form-field__control {
  display: grid;
}

.dii-form-field__help {
  margin-top: var(--dii-space-2);
  font-size: 0.86rem;
}

.dii-form-field > .field-help__button {
  position: absolute;
  top: 0;
  right: 0;
}

.dii-form-field textarea {
  resize: vertical;
}

.dii-framework-check {
  display: inline-flex;
  align-items: center;
  gap: var(--dii-space-2);
  color: var(--dii-text-dark);
  font-weight: 800;
}

.dii-framework-rule-list {
  display: grid;
  gap: var(--dii-space-2);
  padding-left: 1.2rem;
  color: var(--dii-text-dark);
  list-style: disc;
}

.dii-framework-wireframe {
  position: relative;
  display: grid;
  gap: var(--dii-space-4);
  padding: var(--dii-space-4);
  border: 1px solid rgba(42, 110, 220, 0.14);
  border-radius: var(--dii-radius-card);
  background: var(--dii-white);
}

.dii-framework-wireframe__main {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.dii-framework-wireframe__main .dii-framework-wireframe__panel:last-child {
  grid-column: 1 / -1;
}

.dii-ai-button {
  position: absolute;
  right: var(--dii-space-4);
  bottom: var(--dii-space-4);
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(42, 110, 220, 0.16);
  border-radius: var(--dii-radius-pill);
  background: var(--dii-blue-light);
  color: var(--dii-blue);
  font-weight: 900;
}

@media (max-width: 900px) {
  .dii-framework-preview__header-body,
  .dii-framework-wireframe__header,
  .dii-page-title,
  .dii-card__header,
  .dii-empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .dii-dashboard-grid,
  .dii-dashboard-grid--three,
  .dii-framework-token-grid,
  .dii-framework-wireframe__main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .feature-workspace__header {
    align-items: stretch;
  }

  .historical-import-copilot-entry {
    align-items: flex-start;
    flex-direction: column;
  }

  .dii-table {
    min-width: 760px;
  }

  .dii-table__actions {
    min-width: 18rem;
  }

  .dii-table__actions-inner {
    flex-wrap: wrap;
  }

  .dii-drawer {
    padding: 10px;
  }
}

@media (max-width: 760px) {
  .workspace-panel,
  .review-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .workspace-panel__header,
  .review-centre__header,
  .review-centre__item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-panel__header .filters-bar,
  .workspace-panel__header .card-actions {
    justify-content: flex-start;
  }

  .workspace-header__actions,
  .filters-bar,
  .card-actions,
  .pagination {
    align-items: stretch;
  }

  .workspace-header__actions .button,
  .filters-bar .button,
  .card-actions .button,
  .pagination .button,
  .filters-bar .form-input,
  .filters-bar .form-select {
    width: 100%;
  }

  .dashboard-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-responsive {
    padding: 12px;
  }

  .review-centre__summary {
    grid-template-columns: 1fr;
  }

  .review-centre__item-title {
    display: grid;
  }

  .review-centre__history-row {
    grid-template-columns: 1fr;
  }
}

/* Keep WEB-01 public-shell overrides after legacy responsive rules. */
/* WCAG 2.4.11 Focus Not Obscured (AA, new in 2.2). The consent panel below is
   sticky at the bottom with z-index 100, so it slides over the page as it
   scrolls - and a control the browser has just scrolled into view can come to
   rest underneath it. On the marketing home page that was both hero calls to
   action, "Start free" and "See how it works": a keyboard user tabbing to them
   got focus on a button hidden behind the panel.

   scroll-padding-bottom on the scroll container is the mechanism for exactly
   this. It has to sit on the root element, because that is what propagates to
   the viewport - the same declaration on body does nothing. Scoped with :has()
   to pages that actually carry the panel, so the workspace keeps its own scroll
   behaviour; where :has() is unsupported this degrades to today's behaviour
   rather than breaking anything. Pinned by the public screen in
   spec/accessibility/keyboard_spec.rb.

   320px clears the panel at the 1400x1200 viewport that spec drives, which is
   the only width this has been measured at. The panel is text and it grows
   taller as it wraps, so a narrow viewport may need more; that is untested
   rather than known-good. */
html:has(.public-body) {
  scroll-padding-bottom: 320px;
}

.analytics-consent {
  position: sticky;
  bottom: 10px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  padding: 18px 20px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.analytics-consent p {
  max-width: 760px;
  margin: 6px 0;
}

.analytics-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-consent__actions form {
  margin: 0;
}

.release-preview-notice {
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--color-primary, #1d4ed8);
}

.public-nav__toggle {
  display: none;
}

.marketing-step-grid.marketing-step-grid--three,
.marketing-timeline.marketing-timeline--simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-page--redesign,
.pricing-page--redesign .pricing-grid,
.pricing-page--redesign .pricing-plan-card,
.pricing-comparison,
.pricing-comparison__scroll {
  min-width: 0;
  max-width: 100%;
}

.pricing-page--redesign .pricing-plan-card {
  overflow-wrap: anywhere;
}

.pricing-page--redesign .pricing-plan-card__header {
  flex-wrap: wrap;
}

/* WEB-01: the public marketing shell is a single-column grid, so every section is
   sized by the widest section's automatic minimum size. `.marketing-final-cta`
   (card padding plus an unbreakable heading word) pinned that floor at ~275px,
   which stopped the whole landing page reflowing at a 320px viewport and pushed
   the document into horizontal scroll. Same min-width/overflow-wrap vocabulary as
   the pricing redesign above. */
.marketing-page--redesign > *,
.marketing-page--redesign .marketing-proof-section > *,
.marketing-page--redesign .marketing-boundary > *,
.marketing-page--redesign .marketing-final-cta,
.marketing-page--redesign .marketing-review-board,
.marketing-page--redesign .marketing-review-board > div,
.marketing-page--redesign .section-heading,
.marketing-page--redesign .section-heading > * {
  min-width: 0;
  max-width: 100%;
}

.marketing-page--redesign .home-plan-card > div {
  flex-wrap: wrap;
}

.marketing-page--redesign h1,
.marketing-page--redesign h2,
.marketing-page--redesign h3,
.marketing-page--redesign p,
.marketing-page--redesign li,
.marketing-page--redesign summary,
.marketing-page--redesign .eyebrow,
.marketing-page--redesign .marketing-kicker {
  overflow-wrap: break-word;
}

@media (max-width: 760px) {
  .analytics-consent,
  .analytics-consent__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-consent {
    /* In normal flow on narrow screens: the tall stacked banner must not float
       over and intercept clicks on page CTAs (Sign in, plan choices). It stays
       a sticky bottom-left bar only on wider screens where it is a short row. */
    position: static;
    bottom: auto;
    left: auto;
    margin: 10px 12px;
  }

  .analytics-consent__actions .button {
    width: 100%;
  }

  .public-nav[data-controller="public-nav"] {
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }

  .public-nav[data-controller="public-nav"] .public-nav__brand {
    gap: 8px;
    margin-right: 0;
  }

  .public-nav[data-controller="public-nav"] .public-nav__mark {
    width: 40px;
    height: 40px;
  }

  .public-nav[data-controller="public-nav"] .public-nav__brand strong {
    font-size: 0.96rem;
  }

  .public-nav[data-controller="public-nav"] .public-nav__mobile-sign-in,
  .public-nav[data-controller="public-nav"] .public-nav__toggle {
    padding-right: 9px;
    padding-left: 9px;
  }

  .public-nav[data-controller="public-nav"] .public-nav__toggle {
    display: inline-flex;
  }

  .public-nav[data-controller="public-nav"] .public-nav__links {
    display: grid;
    flex-basis: 100%;
    width: 100%;
    gap: 6px;
    padding-top: 8px;
  }

  .public-nav[data-controller="public-nav"].public-nav--enhanced .public-nav__links[hidden] {
    display: none;
  }

  .marketing-step-grid.marketing-step-grid--three,
  .marketing-timeline.marketing-timeline--simple {
    grid-template-columns: 1fr;
  }

  .pricing-page--redesign .pricing-plan-card .button,
  .marketing-page--redesign .home-plan-card .button,
  .marketing-page--redesign .marketing-final-cta .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
}

/* Flatpickr focus indicators (WCAG 2.4.7).
   vendor_flatpickr.css is upstream CSS we do not author, and it sets `outline:0`
   on every focusable part of the calendar without a replacement. The vendored
   file stays byte-identical; the replacement indicator lives here, after
   `require_tree`, so it wins the cascade. */
.flatpickr-calendar:focus,
.flatpickr-days:focus,
.flatpickr-day:focus,
.flatpickr-day:focus-visible,
.flatpickr-current-month input.cur-year:focus,
.flatpickr-current-month .flatpickr-monthDropdown-months:focus,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Invoice line rows size to the space they have, not to the viewport.
   The row needs roughly 900px. Inside the workspace shell it rarely gets it:
   at a 1400px viewport the fixed 290px sidebar and the form's own summary
   column leave it about 790px, at which point the flexible description column
   collapsed to 0px and its input overflowed 34px wide across its neighbour -
   unusable to point at, and a WCAG 2.5.8 target-size failure. The stacked
   treatment is the one the 1100px breakpoint already defines; a container query
   is what lets the row reach for it based on the width it actually has. */
.invoice-lines-table {
  container-type: inline-size;
  container-name: invoice-lines;
}

@container invoice-lines (max-width: 900px) {
  .invoice-lines-header {
    display: none;
  }

  .invoice-line-row {
    grid-template-columns: 1fr;
  }

  .invoice-line-row__account {
    grid-column: 1 / -1;
  }

  .invoice-line-row__field-label {
    position: static;
    display: inline-flex;
    width: fit-content;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .invoice-line-row__remove .button {
    width: fit-content;
  }
}

/* ------------------------------------------------------------------ */
/* Banking: connect-a-bank flow, connection cards, account groups       */
/* ------------------------------------------------------------------ */

.section-block {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.section-head--inline {
  display: grid;
  gap: 6px;
  max-width: 920px;
}

.section-head--inline h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-head--inline p {
  margin: 0;
  color: var(--ink-3, #53657e);
  line-height: 1.6;
}

.bank-connect-card {
  display: grid;
  gap: 22px;
}

.bank-connect-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bank-connect-steps .route-pill {
  gap: 6px;
  padding: 16px 18px;
}

.bank-connect-steps strong {
  font-size: 0.98rem;
}

.bank-connect-steps span {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-3, #53657e);
}

.bank-offer-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bank-offer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.bank-offer-row__main {
  display: grid;
  gap: 6px;
  flex: 1 1 320px;
  min-width: 0;
}

.bank-offer-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bank-offer-row__title strong {
  font-size: 1.05rem;
}

.bank-offer-row__main p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-3, #53657e);
}

.bank-offer-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bank-offer-row__actions .button_to {
  margin: 0;
}

.bank-disclosure {
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.55);
}

.bank-disclosure > summary {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.bank-disclosure > summary::-webkit-details-marker {
  display: none;
}

.bank-disclosure > summary::before {
  content: "Show ▾";
  float: right;
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.bank-disclosure[open] > summary::before {
  content: "Hide ▴";
}

.bank-disclosure > summary strong {
  font-size: 1rem;
}

.bank-disclosure > summary span:not(.eyebrow) {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-3, #53657e);
}

.bank-disclosure__body {
  display: grid;
  gap: 12px;
  padding: 4px 20px 20px;
}

.bank-disclosure--compact {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.5);
  border-style: solid;
  border-color: rgba(37, 99, 235, 0.1);
}

.bank-disclosure--compact > summary {
  padding: 12px 16px;
}

.bank-disclosure--compact .bank-disclosure__body {
  padding: 0 16px 16px;
}

.bank-connection-card--attention {
  border-color: rgba(232, 150, 54, 0.45);
  box-shadow: 0 10px 30px rgba(232, 150, 54, 0.12);
}

@media (max-width: 900px) {
  .bank-connect-steps {
    grid-template-columns: 1fr;
  }

  .bank-offer-row {
    padding: 16px;
  }

  .bank-offer-row__actions,
  .bank-offer-row__actions .button,
  .bank-offer-row__actions .button_to {
    width: 100%;
  }

  .bank-offer-row__actions .button {
    justify-content: center;
  }
}

/* Sandbox financial reads (liabilities, payments).
   Each read is one bordered group so the verification code, the scenario and
   the dates visibly belong to the button beneath them, rather than to a page
   with several buttons and one distant code box. Sandbox only. */
.hmrc-sandbox-read {
  border: 1px solid var(--rule, #d9d4cc);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.hmrc-sandbox-read__heading {
  margin: 0;
  font-size: 1rem;
}
.hmrc-sandbox-read__hint {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}
.hmrc-sandbox-read__form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hmrc-sandbox-read__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hmrc-sandbox-read__field-label {
  font-size: 0.78rem;
  font-weight: 600;
}
.hmrc-sandbox-read__input {
  width: 100%;
}
.hmrc-sandbox-read__submit {
  margin-top: 0.2rem;
}

/* The sandbox financial reads are their own full-width section rather than
   items in the page header's action rail. Each read is a tall form - request a
   code, enter it, choose a scenario, run the sync - so in the rail they formed
   a narrow column and left the title block beside them almost empty. Two
   columns on desktop, stacked below it. */
.vat-sandbox-tests {
  margin-top: 20px;
}

.vat-sandbox-tests__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

@media (max-width: 48rem) {
  .vat-sandbox-tests__grid {
    grid-template-columns: 1fr;
  }
}

/* VAT workflow journey: one step per card, in the order a customer performs
   them. The page previously mixed master data, connection state, readiness
   diagnostics and developer tooling with no ordering, and the customer's own
   VAT fields sat last. */
.vat-journey-step {
  margin-top: 20px;
}

.vat-journey-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0 0 0 1.2rem;
}

.vat-journey-list li {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.vat-journey-list strong {
  font-size: 1rem;
}

.vat-journey-list span {
  color: var(--ink-soft, #4a5866);
  font-size: 0.9rem;
}

.vat-journey-actions {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule, #dfdad2);
}

.vat-journey-actions h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.vat-journey-actions p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Collapsed by default: internals a customer filing a return does not need. */
.vat-disclosure {
  border: 1px solid var(--rule, #dfdad2);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  margin-top: 14px;
}

.vat-disclosure > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.vat-disclosure__hint {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

.vat-developer-tools {
  margin-top: 28px;
}

/* HMRC refused the last read for this VAT number. Stated as a pairing problem,
   because either side of it could be the one that is wrong. */
.vat-connection-warning {
  border: 1px solid var(--part, #8a5a12);
  background: var(--part-bg, #fbf0dc);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 16px;
}

.vat-connection-warning p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

/* The verification code belongs to the action it authorises, not to the page. */
.hmrc-step-up-disclosure {
  border: 1px solid var(--rule, #dfdad2);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}

.hmrc-step-up-disclosure > summary {
  cursor: pointer;
  font-weight: 600;
}

.hmrc-step-up-disclosure__hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* ==========================================================================
   DII shell context bar + command palette (Dhruvi OS shell, DII-owned).
   Workspace switcher, Cmd/Ctrl+K search, notifications and profile live here;
   the left rail is accountancy navigation only.
   ========================================================================== */

:root {
  --context-bar-h: 64px;
}

.workspace-context-bar {
  position: sticky;
  top: var(--page-gutter);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--context-bar-h);
  margin-bottom: var(--workspace-gap);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* On desktop the fixed rail must start below the sticky bar. Scoped away from
   the <=1100px drawer, which positions itself. */
@media (min-width: 1101px) {
  .workspace-sidebar {
    top: calc(var(--page-gutter) + var(--context-bar-h) + 12px);
    max-height: calc(100dvh - var(--page-gutter) - var(--context-bar-h) - 36px);
  }
}

.dii-shell__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 0;
}

/* --- Workspace switcher (left) ------------------------------------------- */

.dii-workspace-switcher {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.dii-workspace-switcher__summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 14px;
  cursor: pointer;
  list-style: none;
  min-width: 0;
  transition: background 0.2s ease;
}

.dii-workspace-switcher__summary::-webkit-details-marker {
  display: none;
}

.dii-workspace-switcher__summary:hover,
.dii-workspace-switcher[open] .dii-workspace-switcher__summary {
  background: rgba(31, 122, 228, 0.08);
}

.dii-c-app-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-2), var(--indigo));
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.dii-workspace-switcher__copy {
  display: grid;
  min-width: 0;
}

/* THE WORKSPACE NAME WRAPS. IT DOES NOT CLIP, AND IT DOES NOT ELLIPSE.
   WCAG 1.4.12 Text Spacing and 1.4.4 Resize Text, both AA.

   These two lines carried `white-space: nowrap; overflow: hidden;
   text-overflow: ellipsis`. A 36-character company name fits the box at the
   baseline, so nothing looked wrong - and it is the reader's own settings, not
   the name, that break it. Measured on this branch at a 1370px CSS viewport,
   `clientWidth` against `scrollWidth` on the `strong` itself:

     baseline, 36 chars     304 / 304   fits
     1.4.12 spacing         304 / 360   56px of the name gone
     200% text              304 / 574   270px gone
     1.4.12, 44 chars       304 / 439   135px gone
     200% text, 44 chars    304 / 698   394px gone

   PAGE overflow was 0px in every one of those, because this box hides its own
   overflow - the same mechanism that kept /contacts and the workspace header
   green while both shipped.

   The ellipsis did not rescue it. The organisation name appears nowhere else
   on the screen, so "Northwind Interiors & Conser..." leaves the reader who
   enlarged their text unable to tell whose books are open. That is loss of
   content, which is precisely what both criteria prohibit.

   WRAPS FREELY, with no line cap. A two-line clamp was considered and
   rejected: at 200% text a 44-character name needs 698px across a 304px box,
   which is three lines, so a two-line cap would clip it again and be an
   ellipsis with extra steps. `.workspace-context-bar` uses `min-height`, not
   `height`, so the row grows to fit; nothing here introduces a fixed height,
   and nothing here shrinks the font.

   `overflow-wrap: break-word` is the floor, not the mechanism: ordinary names
   break at their spaces, and this only engages for a single token longer than
   the box. `word-break: break-all` would break every word and is not used.

   The `small` line gets the same treatment rather than keeping its ellipsis.
   Its text is "<plan> plan - <Role> access", where the role is a humanised
   enum and the plan comes from configuration, so its length is not
   author-controlled; and two different overflow mechanisms inside one
   two-line block is a rule nobody will keep straight. */
.dii-workspace-switcher__copy strong {
  font-size: 0.95rem;
  color: var(--text);
  overflow-wrap: break-word;
}

.dii-workspace-switcher__copy small {
  font-size: 0.76rem;
  color: var(--muted);
  overflow-wrap: break-word;
}

.dii-workspace-switcher__chevron .nav-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

/* --- Shared dropdown menu (details-driven, no JS) ------------------------ */

.dii-menu {
  position: absolute;
  z-index: 60;
  margin-top: 8px;
  min-width: 240px;
  max-width: min(340px, 90vw);
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.dii-workspace-switcher__menu {
  left: 0;
}

.dii-menu__identity {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.dii-menu__identity strong {
  color: var(--text);
}

.dii-menu__identity span {
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dii-menu__note {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.dii-menu__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  transition: background 0.2s ease;
}

.dii-menu__link:hover {
  background: rgba(31, 122, 228, 0.08);
}

.dii-menu__link .nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.dii-menu__link--danger {
  color: #b91c1c;
}

.dii-menu__link--danger .nav-icon {
  color: #b91c1c;
}

.dii-workspace-switcher__form {
  display: grid;
  gap: 8px;
}

.dii-workspace-switcher__form label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

/* --- Command trigger (centre) ------------------------------------------- */

.dii-c-command-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 460px;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 14px;
  /* WCAG 1.4.11: the command trigger's fill is within 1.04:1 of the header
     behind it, so this border is the only thing identifying it as a control. */
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.9);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dii-c-command-trigger:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.dii-c-command-trigger .nav-icon {
  color: var(--muted);
}

.dii-c-command-trigger__label {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dii-c-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Icon buttons + avatar (right) -------------------------------------- */

.dii-c-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 251, 255, 0.9);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dii-c-icon-button:hover,
.dii-c-icon-button.is-active {
  background: #fff;
  color: var(--accent-strong);
  border-color: var(--line-strong);
}

.dii-c-icon-button .workspace-nav__badge {
  position: absolute;
  top: -4px;
  right: -4px;
}

.dii-profile-menu {
  position: relative;
}

.dii-c-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--indigo), var(--blue-2));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.dii-c-avatar::-webkit-details-marker {
  display: none;
}

.dii-c-avatar__initials {
  position: relative;
  z-index: 0;
}

.dii-c-avatar__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dii-profile-menu__menu {
  right: 0;
}

/* --- Notifications dropdown ---------------------------------------------- */

.dii-notifications-menu {
  position: relative;
}

.dii-notifications-menu__menu {
  right: 0;
  width: 340px;
  max-width: min(360px, 92vw);
}

.dii-notification-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.dii-notification-item__title {
  font-weight: 600;
  color: var(--text);
}

.dii-notification-item__body {
  font-size: 0.82rem;
  color: var(--muted);
}

.dii-notification-item__time {
  font-size: 0.74rem;
  color: var(--muted);
}

.dii-menu__footer {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dii-menu__footer form {
  margin: 0;
}

.dii-menu__button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(31, 122, 228, 0.08);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.dii-menu__button:hover {
  background: rgba(31, 122, 228, 0.14);
}

/* --- Command palette overlay -------------------------------------------- */

/* Generates no box: keeps the bar's sticky behaviour and lets the palette's
   fixed positioning resolve to the viewport rather than the backdrop-filtered
   bar. */
.dii-shell-header {
  display: contents;
}

.dii-command {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 12vh 16px 16px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(4px);
}

.dii-command[hidden] {
  display: none;
}

.dii-command__panel {
  width: min(620px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.dii-command__field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.dii-command__field .nav-icon {
  color: var(--muted);
  flex: 0 0 auto;
}

.dii-command__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
}

.dii-command__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.dii-command__results {
  overflow-y: auto;
  padding: 8px;
}

.dii-command__group {
  margin: 8px 8px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.dii-command__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
}

.dii-command__item.is-active,
.dii-command__item:hover {
  background: rgba(31, 122, 228, 0.1);
}

.dii-command__item-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.dii-command__item-icon .nav-icon {
  width: 20px;
  height: 20px;
}

.dii-command__item-body {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
}

.dii-command__item-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dii-command__item-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dii-command__item-pills {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.dii-command__pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 600;
}

.dii-command__pill:hover {
  background: rgba(31, 122, 228, 0.1);
}

.dii-command__empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
}

/* --- Search fallback page ------------------------------------------------ */

.search-page__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.search-page__form .form-input {
  flex: 1 1 260px;
}

.search-page__group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.search-page__group-icon {
  display: inline-flex;
  color: var(--accent-strong);
}

.search-page__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.search-page__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.search-page__item-link {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.search-page__item-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

/* On mobile the bar stacks and stops competing with the drawer. */
@media (max-width: 1100px) {
  .workspace-context-bar {
    position: static;
    flex-wrap: wrap;
    row-gap: 10px;
    /* AND IT HAS TO GIVE UP ITS LAYER TOO, WHICH `position: static` DOES NOT DO.
       `z-index` applies to a FLEX ITEM as well as to a positioned element, and
       this bar is a flex item of `.dii-shell-header`; its `backdrop-filter`
       makes it a stacking context of its own besides. So the base rule's
       `z-index: 40` (:13779) kept painting it above the drawer, which is fixed
       at `z-index: 30`, although the bar was taken out of `position: sticky`
       here precisely so it would stop competing.

       MEASURED on /credit_notes/:id at 390 CSS pixels with the drawer OPEN,
       before this declaration: the drawer's own "Close" button occupies
       210,37 88x43 and `document.elementFromPoint` at its centre and at all
       four of its corners returned `.dii-shell__actions` or
       `.workspace-context-bar` - never the button. Every one of the five
       points, so it is WCAG 2.4.11 Focus Not Obscured (Minimum) and not merely
       a partly-covered control: a customer who opens the menu cannot press
       Close, and a keyboard customer who tabs to it is given a focus ring they
       cannot see. Reproduced identically at 320 and 375 CSS pixels.

       AFTER this declaration, same screen and widths: all five points return
       the button itself, and the probe reports zero obscured and zero
       covered-at-centre stops inside the open drawer. Above 1100px nothing
       changes - the bar is sticky there and keeps its layer, and the sidebar
       is a permanent rail that it is not supposed to overlap. */
    z-index: 20; /* not `auto`: independent review proved `auto` sinks this bar
       below `.workspace-shell` and its own dropdowns - workspace switcher,
       notifications, Sign out - are then covered by the first page card,
       trading one obscured control for three. 20 clears the shell, and stays
       below the backdrop (25) and the drawer (30), so the Close-button repair
       this declaration was written for still holds. */
  }

  .dii-c-command-trigger {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
}

/* Onboarding bank step: open-banking explainer dialog. Native <dialog> so focus
   trapping and Escape come from the platform; styling stays token-driven. */
.dii-modal {
  width: min(560px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: inherit;
  box-shadow: var(--shadow-lg);
}

.dii-modal::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
}

.dii-modal__body {
  display: grid;
  gap: 16px;
}

.dii-modal__body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

/* Totals rows read as data, not as headers.
   A <tfoot> row is one row label followed by the totals of each column. Those
   totals were marked up as <th>, which told assistive technology they were
   headers for something - they are values. They are <td> now, and this rule
   keeps the weight the browser's default <th> styling was providing, so the
   correction is invisible on screen and audible only where it matters. */
tfoot th,
tfoot td {
  font-weight: 600;
}

/* Session timeout warning (WCAG 2.2.1).
   Fixed so it cannot be scrolled past, and above the field-help drawer, because
   a warning that something is about to end must not sit behind the thing the
   person is reading. It is only in the DOM when signed in and only visible when
   there is something to warn about. */
.session-timeout {
  position: fixed;
  inset-block-end: calc(1rem + env(safe-area-inset-bottom, 0px));
  inset-inline-end: 1rem;
  z-index: 10002;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 1rem 1.15rem;
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.4);
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.session-timeout h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.session-timeout p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* A11YPICK-02: a failed extension says so inside the warning. Text stays
   CanvasText so it keeps the box's contrast in both colour schemes; the bar
   carries the emphasis without relying on colour alone. */
.session-timeout__error {
  padding-inline-start: 0.6rem;
  border-inline-start: 4px solid CanvasText;
  font-weight: 600;
}

/* The alert region stays in the tree, empty, so that filling it is announced;
   empty, it takes no space. */
.session-timeout__error:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

/* WCAG 2.5.8 Target Size (Minimum), AA in WCAG 2.2.
   Browser-default checkboxes and radios render at 13x13 CSS pixels. The
   criterion asks for 24x24, or for enough space around a smaller control that
   its safe clickable area reaches 24. The accessibility sweep found 11 of them
   on the new-contact form alone on 2026-09-24, and there are 75 across the
   application - so this is set once, globally, rather than per form.

   18px visual with 3px of margin gives a 24px safe clickable area without the
   controls looking oversized next to the text they sit beside. accent-color
   keeps the platform's own checked appearance, so this changes the size and
   nothing else. */
input[type="checkbox"],
input[type="radio"] {
  inline-size: 18px;
  block-size: 18px;
  margin: 3px;
  accent-color: currentColor;
}

/* CSP style-src hardening (drop 'unsafe-inline'): utilities that replace the
   inline style="" attributes formerly used for these fixed values. Dynamic
   widths (progress bars) are applied via the bar_width Stimulus controller. */
.oauth-provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.company-setup-progress-track {
  height: 8px;
}

/* The `hidden` attribute is authoritative everywhere, replacing the inline
   style="display:none !important" that forced it over component CSS. */
[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Onboarding progress tracker (onboarding/_progress_tracker).

   One block, used in two places at two widths: the full-width Business Setup
   page and the narrow AI Accountant overlay sidebar. The stage list is a
   single column in both, so there is no horizontal layout to break at phone
   width; --chat narrows the type only.

   NOT COLOUR ALONE (WCAG 1.4.1). Every state is already in the text -
   Supervisor::Stage#status_label prints "Done", "In progress" or
   "Not started", and the marker is a tick or the stage number. The tints and
   the left border below are redundant reinforcement, and deleting this whole
   block leaves the tracker fully readable and fully distinguishable. Do not
   move a state into colour only.
--------------------------------------------------------------------------- */
.onboarding-tracker {
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.onboarding-tracker__headline {
  margin: 0;
  font-size: 1.15rem;
}

.onboarding-tracker__explanation,
.onboarding-tracker__count {
  margin: 8px 0 0;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.onboarding-tracker__count strong {
  color: var(--text);
}

.onboarding-tracker .onboarding-progress {
  margin: 14px 0 6px;
}

.onboarding-tracker__stages {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.onboarding-tracker__stage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border-left: 4px solid var(--line);
  background: var(--bg-strong);
}

.onboarding-tracker__stage--complete {
  border-left-color: var(--success-text);
  background: var(--success-soft);
}

.onboarding-tracker__stage--in_progress {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.onboarding-tracker__marker {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--control-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.onboarding-tracker__stage-body {
  display: grid;
  gap: 2px;
}

.onboarding-tracker__stage-title {
  font-weight: 600;
  color: var(--text);
}

/* WCAG 1.4.3 Contrast (Minimum), AA. These two carry the stage's state in
   words, so they are not decorative muted text and must clear 4.5:1 - and they
   sit on the pale stage tints, not on the page ground. --muted-text (#6b7280)
   measured 4.11:1 over the in-progress tint (#e1eefe) and the accessibility
   sweep failed on it. This slate clears 4.5:1 over all three stage
   backgrounds: the in-progress tint, the success tint, and --bg-strong. */
.onboarding-tracker__stage-status,
.onboarding-tracker__stage-detail {
  font-size: 0.85rem;
  color: #475569;
}

.onboarding-tracker__stage--complete .onboarding-tracker__stage-status {
  color: var(--success-text);
}

.onboarding-tracker__question {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.onboarding-tracker__question-prompt {
  margin: 0;
  font-size: 1rem;
}

.onboarding-tracker__question-detail {
  margin: 6px 0 12px;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.onboarding-tracker__question-form select {
  width: 100%;
}

.onboarding-tracker__question-defer {
  margin-top: 8px;
}

.onboarding-tracker--chat {
  padding: 14px;
  margin-bottom: 0;
  border: 0;
  background: transparent;
}

.onboarding-tracker--chat .onboarding-tracker__headline {
  font-size: 1rem;
}

.onboarding-tracker--chat .onboarding-tracker__stage {
  padding: 8px 10px;
}

@media (max-width: 640px) {
  .onboarding-tracker {
    padding: 14px;
  }

  .onboarding-tracker__stage {
    padding: 8px 10px;
  }
}

/* The entry routes, shown while the journey is still being worked out. An
   unavailable route keeps its reason visible rather than relying on a dimmed
   appearance, so it is readable without colour (WCAG 1.4.1) and the reader is
   told why rather than left guessing. The status colour matches the stage
   states above for the same contrast reason recorded there. */
.onboarding-tracker__routes {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.onboarding-tracker__route {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-strong);
}

.onboarding-tracker__route-title {
  font-weight: 600;
  color: var(--text);
}

.onboarding-tracker__route-detail,
.onboarding-tracker__route-status {
  font-size: 0.85rem;
  color: #475569;
}

.onboarding-tracker__route--unavailable {
  background: transparent;
  border-style: dashed;
}

/* The tracker's slot at the top of the overlay's conversation column. It is a
   band above the messages, not a sidebar section: the sidebar shows one
   section at a time and starts collapsed on desktop, which left the tracker
   present and invisible. Capped and scrollable so a six-stage journey cannot
   push the message list and composer off a short viewport. */
.copilot-conversation__onboarding {
  flex: 0 0 auto;
  max-height: 40vh;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.copilot-conversation__onboarding:empty {
  display: none;
}

/* ---------------------------------------------------------------------------
   GUIDED SETUP - one question per screen.

   The layout the owner asked for: a stepper across the top that is always
   visible, one question in the middle, Back and Continue under it, and a rail
   that explains the step and takes a document.

   NOT COLOUR ALONE (WCAG 1.4.1). Every stage and every document states its
   state in words - see onboarding/guided_setups/_stepper and _rail - and the
   current stage also carries aria-current="step". The tints and borders below
   are redundant reinforcement; deleting this whole block leaves every screen
   readable and every state distinguishable. Do not move a state into colour.

   ON A PHONE the rail drops BELOW the question and the stepper scrolls
   sideways inside its own strip rather than wrapping over the page. It is not
   sticky at any width, deliberately: a sticky stepper on a 320px screen covers
   the heading, the validation error and the focus ring, which is the specific
   failure this flow exists to avoid.
--------------------------------------------------------------------------- */
.guided-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

/* A grid item's default min-width is AUTO, not zero, so an item whose
   min-content is wider than the track widens the track instead of scrolling
   or wrapping inside it. That is what put 33px of the guided screen past the
   right edge of a 320px phone: the page fitted, its children did not, and the
   whole document scrolled sideways. Every box that can hold a long word, a
   wide strip or a fixed min-width is pinned to zero here. */
.guided-setup > *,
.guided-setup__body > *,
.guided-setup__main > *,
.guided-setup__rail > *,
.guided-stepper__list,
.guided-choice__cards {
  min-width: 0;
}

.guided-setup__header {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.guided-setup__title {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

.guided-setup__honesty {
  margin: 8px 0 0;
  max-width: 52ch;
  color: #475569;
  font-size: 0.92rem;
}

/* --- the mode toggle --- */

.guided-mode-toggle {
  display: grid;
  gap: 8px;
  min-width: min(260px, 100%);
}

.guided-mode-toggle__label {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.guided-mode-toggle__options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guided-mode-toggle__option {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--bg-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
}

.guided-mode-toggle__option--button {
  cursor: pointer;
}

.guided-mode-toggle__option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.guided-mode-toggle__state {
  font-weight: 500;
  font-size: 0.78rem;
  color: #475569;
}

.guided-mode-toggle__note {
  margin: 0;
  max-width: 44ch;
  color: #475569;
  font-size: 0.85rem;
}

/* --- the stepper --- */

.guided-stepper {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.guided-stepper__count {
  margin: 0 0 12px;
  color: #475569;
  font-size: 0.9rem;
}

.guided-stepper__count strong {
  color: var(--text);
}

.guided-stepper__list {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
}

.guided-stepper__stage {
  flex: 1 1 0;
  min-width: min(160px, 100%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border-top: 4px solid var(--line);
  background: var(--bg-strong);
}

.guided-stepper__stage--complete {
  border-top-color: var(--success-text);
  background: var(--success-soft);
}

.guided-stepper__stage--in_progress,
.guided-stepper__stage.is-current {
  border-top-color: var(--accent);
  background: var(--accent-soft);
}

.guided-stepper__marker {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--control-border);
  font-size: 0.8rem;
  font-weight: 600;
}

.guided-stepper__stage-body {
  display: grid;
  gap: 2px;
}

.guided-stepper__stage-title {
  font-weight: 600;
  font-size: 0.92rem;
}

/* Carries the stage's state in words, over the pale stage tints rather than
   over the page ground, so it must clear 4.5:1 there. Same slate as
   .onboarding-tracker__stage-status, measured over all three backgrounds. */
.guided-stepper__stage-status {
  font-size: 0.82rem;
  color: #475569;
}

/* --- the body: question and rail --- */

.guided-setup__body {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1000px) {
  .guided-setup__body {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.guided-setup__error {
  margin-bottom: 14px;
}

.guided-setup__question {
  padding: 22px;
}

.guided-setup__question-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0;
}

.guided-setup__answered {
  font-size: 0.82rem;
  color: #475569;
}

.guided-setup__prompt {
  margin: 8px 0 18px;
  font-size: 1.45rem;
  line-height: 1.3;
}

.guided-setup__prompt:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.guided-choice {
  margin: 0;
  padding: 0;
  border: 0;
}

.guided-choice__hint {
  margin: 0 0 12px;
  color: #475569;
  font-size: 0.9rem;
}

.guided-choice__cards {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .guided-choice__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The whole card is the label, so the whole card is the hit area - which is
   what makes it usable with a thumb as well as a mouse. The input stays in the
   DOM and stays focusable; it is positioned, never display:none, because a
   hidden input is not reachable by keyboard. */
.guided-choice__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px 18px;
  border: 2px solid var(--control-border);
  border-radius: 14px;
  background: var(--bg-strong);
  cursor: pointer;
}

.guided-choice__card:has(.guided-choice__input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.guided-choice__card:has(.guided-choice__input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.guided-choice__input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.guided-choice__card-label {
  font-weight: 600;
  font-size: 1.02rem;
}

.guided-setup__input {
  width: 100%;
}

.guided-setup__saving-note {
  margin: 18px 0 0;
  color: #475569;
  font-size: 0.85rem;
}

/* Where this answer came from. A quiet note under the question, never a
   badge: the state is carried by the words, so it reads the same with
   stylesheets off and at 320px. */
.guided-setup__provenance {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-strong);
  color: #475569;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.guided-setup__provenance-source {
  font-weight: 600;
  color: var(--text);
}

/* A reading and a conclusion are different claims, so the note carrying a
   conclusion is marked as one. The words already say it - "Worked out from
   your document", and the detail names the document and says it does not say
   this - so this is reinforcement, not the mechanism: it reads correctly with
   stylesheets off. */
.guided-setup__provenance--inferred {
  border-left: 3px solid var(--line);
}

.guided-setup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.guided-setup__continue {
  margin-left: auto;
}

@media (max-width: 520px) {
  .guided-setup__actions {
    flex-direction: column-reverse;
  }

  .guided-setup__continue {
    margin-left: 0;
  }
}

/* --- the rail --- */

.guided-setup__rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

.guided-rail__panel {
  padding: 16px 18px;
}

.guided-rail__heading {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.guided-rail__stage,
.guided-rail__body {
  margin: 10px 0 0;
  color: #475569;
  font-size: 0.88rem;
}

.guided-rail__stage strong {
  color: var(--text);
}

.guided-rail__upload {
  margin-top: 14px;
}

/* Where you stand, area by area. The state is a word next to the area name,
   not a colour, so it survives a greyscale screen and a screen reader. */
.guided-rail__domains {
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.guided-rail__domain {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-strong);
}

.guided-rail__domain-name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-weight: 600;
  font-size: 0.88rem;
}

.guided-rail__domain-state {
  font-weight: 500;
  font-size: 0.8rem;
  color: #475569;
}

.guided-rail__domain-explanation {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #475569;
  overflow-wrap: anywhere;
}

.guided-rail__documents {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.guided-rail__document {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-strong);
}

.guided-rail__document-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.guided-rail__document-status {
  font-size: 0.8rem;
  color: #475569;
}

@media (max-width: 640px) {
  .guided-setup__header,
  .guided-stepper {
    padding: 14px;
  }

  .guided-setup__question {
    padding: 16px;
  }

  .guided-setup__prompt {
    font-size: 1.2rem;
  }
}

/* Screen-level help disclosure (see ApplicationHelper#screen_help).
   A quiet inline control, not a card: the explanation it holds is the thing
   being moved out of the way, so the control that reveals it must not take the
   visual weight the prose used to. The name is the whole label - "Explain: the
   invoice list" - so the affordance is the text, not an icon.

   No focus style is declared here on purpose. The global
   `:where(a, button, summary, [tabindex]):focus-visible` rule near the top of
   this file already gives it an indicator, and a local override is how a screen
   quietly loses one. */
.screen-help {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.screen-help__button {
  appearance: none;
  background: none;
  border: 0;
  /* WCAG 2.5.8 Target Size (Minimum), AA, new in 2.2: 24x24 CSS pixels. At
     `padding: 2px 0` this button measured 222x23 and axe failed it - the one
     violation the first run of the new spec found. The padding is what makes
     the target, so it is stated here rather than left to the line box, and
     `min-height` holds the floor if the font ever shrinks. */
  padding: 6px 0;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  /* #1d4ed8 on this page's near-white backgrounds, not a token whose alpha
     makes its measured ratio a guess. */
  color: var(--blue-3);
  /* Underlined, so the control is identifiable without relying on its colour
     (WCAG 1.4.1). */
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}

.screen-help__button::after {
  content: " ▾";
  text-decoration: none;
}

.screen-help__button[aria-expanded="true"]::after {
  content: " ▴";
}

.screen-help__body {
  display: grid;
  gap: 8px;
  max-width: 68ch;
  padding: 12px 16px;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(239, 246, 255, 0.6);
  color: var(--ink-strong);
  font-size: 0.92rem;
  /* No fixed height anywhere in this block: 1.4.12 text-spacing overrides
     raise line-height and the body has to grow rather than clip. */
  line-height: 1.6;
}

.screen-help__body > :first-child { margin-top: 0; }
.screen-help__body > :last-child { margin-bottom: 0; }

/* The invoice list's overview grid holds one card, or two when the invoice
   identity is incomplete. `.invoice-overview-grid` is a fixed two columns and
   is shared with Contacts and Quotes, so this modifier is scoped to the invoice
   list rather than changing a rule three screens depend on.
   `min(260px, 100%)` keeps the track from forcing a horizontal scrollbar at
   320 CSS pixels. */
.invoice-overview-grid--fit {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

/* The one sentence from the bank screen's opening paragraphs that does not go
   behind a control: what DII can and cannot do with a bank connection. The
   rest of that prose explains the screen; this states a boundary, and a
   boundary a reader has to open a disclosure to find is not a boundary they
   have been told about. */
.bank-boundary-line {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-strong);
  line-height: 1.6;
}
