:root {
  color-scheme: dark;
  --bg: #0f1923;
  --bg-deep: #091018;
  --panel: #162332;
  --panel-2: #1e2f40;
  --panel-3: #24384b;
  --gold: #c9a84c;
  --gold-2: #e3c66e;
  --text: #f3ead4;
  --body: #d9e1e7;
  --muted: #8fa3b8;
  --line: rgba(201, 168, 76, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --green: #70d18a;
  --red: #ff897d;
  --amber: #f4c96b;
  --fs-xs: 10px;
  --fs-sm: 11px;
  --fs-base: 12px;
  --fs-lg: 14px;
  --fs-xl: 18px;
  --fs-hero: 24px;
}

[hidden] {
  display: none !important;
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100vw;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  background: linear-gradient(180deg, #0f1923 0%, #101b27 48%, #0b1119 100%);
  color: var(--body);
  font: 13px/1.42 "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

body.nav-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

body.teller-connect-shell {
  grid-template-columns: 1fr;
  background:
    radial-gradient(circle at 50% 42%, rgba(201, 168, 76, 0.1), transparent 22rem),
    linear-gradient(180deg, #101b27 0%, #0b141e 58%, #070d14 100%);
}

html.teller-public-route body {
  grid-template-columns: 1fr;
}

html.teller-public-route body:not(.teller-connect-shell) {
  background:
    radial-gradient(circle at 50% 42%, rgba(201, 168, 76, 0.1), transparent 22rem),
    linear-gradient(180deg, #101b27 0%, #0b141e 58%, #070d14 100%);
}

html.teller-public-route body:not(.teller-connect-shell) .sidebar,
html.teller-public-route body:not(.teller-connect-shell) .app-header {
  display: none;
}

html.teller-public-route body:not(.teller-connect-shell) main {
  min-height: 100vh;
  padding: 0;
}

body.teller-connect-shell .sidebar,
body.teller-connect-shell .app-header {
  display: none;
}

body.teller-connect-shell main {
  min-height: 100vh;
  padding: 0;
  display: grid;
  place-items: center;
}

body.teller-connect-shell #pageRoot {
  width: min(620px, calc(100vw - 32px));
}

body.app-loading::before {
  content: "";
  position: fixed;
  z-index: 121;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2), var(--green), transparent);
  background-size: 220% 100%;
  animation: app-loading-sweep 1.05s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(227, 198, 110, 0.28);
  display: none;
}

body.nav-collapsed.app-loading::before {
  left: 72px;
}

.app-loading-status {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(201, 168, 76, 0.12), transparent 26%),
    rgba(7, 12, 18, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
  backdrop-filter: blur(3px);
}

body.nav-collapsed .app-loading-status {
  left: 0;
}

body.app-loading .app-loading-status {
  opacity: 1;
  pointer-events: auto;
}

.app-loading-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 158px;
  min-height: 46px;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.98), rgba(11, 18, 27, 0.98));
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  transform: translateY(4px) scale(0.98);
  transition: transform 0.16s ease;
}

.app-modal-backdrop {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 10, 16, 0.74);
  padding: 18px;
  backdrop-filter: blur(4px);
}

.app-notice-host {
  position: fixed;
  z-index: 210;
  top: 14px;
  right: 14px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.app-notice {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(201, 168, 76, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(22, 35, 50, 0.98), rgba(8, 16, 24, 0.98));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.045) inset;
  padding: 10px 10px 10px 12px;
  pointer-events: auto;
  animation: notice-enter 0.18s ease-out;
}

.app-notice::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold-2);
}

.app-notice.success::before {
  background: var(--green);
}

.app-notice.warning::before {
  background: var(--amber);
}

.app-notice.error::before {
  background: var(--red);
}

.app-notice.is-leaving {
  animation: notice-leave 0.18s ease-in forwards;
}

.app-notice-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 8px;
  background: rgba(201, 168, 76, 0.11);
  color: var(--gold-2);
}

.app-notice.success .app-notice-icon {
  border-color: rgba(112, 209, 138, 0.32);
  background: rgba(112, 209, 138, 0.12);
  color: var(--green);
}

.app-notice.warning .app-notice-icon {
  border-color: rgba(244, 201, 107, 0.34);
  background: rgba(244, 201, 107, 0.12);
  color: var(--amber);
}

.app-notice.error .app-notice-icon {
  border-color: rgba(255, 137, 125, 0.34);
  background: rgba(255, 137, 125, 0.12);
  color: var(--red);
}

.app-notice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-top: 1px;
}

.app-notice-copy strong {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.2;
}

.app-notice-copy p {
  margin: 0;
  color: var(--body);
  font-size: var(--fs-base);
  line-height: 1.35;
}

.app-notice-close {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.app-notice-close:hover {
  color: var(--text);
}

.app-modal {
  width: min(500px, 100%);
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.98), rgba(8, 16, 24, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

.app-modal header,
.app-modal footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.app-modal header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
}

.app-modal header {
  border-bottom: 1px solid var(--line-soft);
}

.app-modal footer {
  border-top: 1px solid var(--line-soft);
  justify-content: space-between;
}

.app-modal header span {
  color: #9eb2c4;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.app-modal h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: var(--fs-lg);
}

.app-modal-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 8px;
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-2);
}

.app-modal-mark.danger {
  border-color: rgba(255, 137, 125, 0.34);
  background: rgba(255, 137, 125, 0.12);
  color: var(--red);
}

.app-modal-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.app-modal-body p {
  margin: 0;
  color: var(--muted);
}

.client-info-modal {
  width: min(620px, calc(100vw - 28px));
}

.client-info-form {
  display: grid;
  gap: 16px;
}

.client-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.72fr);
  gap: 14px;
}

.client-info-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.client-info-field input,
.client-info-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(4, 9, 14, 0.72);
  color: var(--text);
  padding: 9px 10px;
}

.client-info-field input:focus,
.client-info-field textarea:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.68);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.client-info-field small {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.bank-feed-history-option {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.bank-feed-history-option input,
.bank-feed-history-inline input {
  width: auto;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--gold);
}

.bank-feed-history-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  color: var(--text);
  font-size: var(--fs-sm);
}

.client-info-status {
  color: var(--muted);
}

.client-info-toggle {
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.client-info-toggle span {
  display: grid;
  gap: 3px;
  color: var(--text);
}

.client-info-toggle strong {
  font-size: var(--fs-sm);
}

.client-info-toggle small {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.client-info-page {
  max-width: 760px;
}

.client-info-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.client-info-page-head h2 {
  margin: 3px 0 5px;
  font-size: var(--fs-xl);
}

.client-info-page-head p {
  margin: 0;
  color: var(--muted);
}

.client-info-page-form {
  max-width: 640px;
}

.client-info-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 620px) {
  .client-info-grid {
    grid-template-columns: 1fr;
  }

  .client-info-page-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.bank-reconnect-account-list {
  width: min(360px, 100%);
  margin: 4px auto 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.bank-reconnect-account-list li {
  border: 1px solid rgba(201, 168, 76, 0.26);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}

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

.billing-confirm-grid span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.42);
  padding: 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.billing-confirm-grid strong {
  color: var(--text);
  font-size: var(--fs-lg);
}

.danger-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 137, 125, 0.42);
  border-radius: 8px;
  background: rgba(255, 137, 125, 0.13);
  color: #ffd0ca;
  font-weight: 700;
  padding: 0 13px;
}

.app-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(227, 198, 110, 0.22);
  border-top-color: var(--gold-2);
  border-right-color: var(--green);
  animation: spin 0.72s linear infinite;
}

body.app-loading .app-loading-card {
  transform: translateY(0) scale(1);
}

@keyframes app-loading-sweep {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

@keyframes notice-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notice-leave {
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

body.auth-body {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 50% 16%, rgba(201, 168, 76, 0.11), transparent 30%),
    linear-gradient(180deg, #101b27 0%, #0b1119 100%);
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.auth-shell {
  width: min(410px, 100%);
  display: block;
}

.auth-panel {
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 47, 64, 0.98), rgba(18, 30, 43, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.auth-logo {
  width: 142px;
  height: auto;
  display: block;
  margin: 0 auto 4px;
}

.auth-copy {
  text-align: center;
}

.auth-copy h1 {
  margin-bottom: 5px;
  font-size: 22px;
  line-height: 1.2;
}

.auth-copy p:not(.eyebrow) {
  margin-bottom: 0;
  font-size: 13px;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.68);
  color: var(--text);
  padding: 0 10px;
}

.auth-form button {
  width: 100%;
  min-height: 40px;
}

.auth-warning,
.auth-error {
  border: 1px solid rgba(244, 201, 107, 0.32);
  border-radius: 7px;
  background: rgba(244, 201, 107, 0.08);
  padding: 9px 10px;
}

.auth-error {
  border-color: rgba(255, 137, 125, 0.32);
  background: rgba(255, 137, 125, 0.08);
}

.auth-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.auth-meta span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(6, 10, 15, 0.3);
  padding: 4px 8px;
}

.auth-doc-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.auth-doc-links a,
.public-doc-grid a {
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.28);
  color: var(--text);
  text-decoration: none;
  padding: 9px 10px;
  font-weight: 800;
  display: grid;
  justify-items: center;
  text-align: center;
}

.auth-doc-links a:hover,
.public-doc-grid a:hover {
  border-color: rgba(201, 168, 76, 0.46);
  background: rgba(201, 168, 76, 0.08);
}

.auth-small-link {
  color: var(--gold-2);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.docs-shell {
  width: min(720px, 100%);
}

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

.public-doc-grid strong,
.public-doc-grid span {
  display: block;
  text-align: center;
  width: 100%;
}

.public-doc-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  position: relative;
  min-height: 32px;
  border: 1px solid rgba(201, 168, 76, 0.46);
  border-radius: 7px;
  background: var(--gold);
  color: #080b0d;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease,
    transform 0.14s ease;
  will-change: transform;
}

button:hover,
.button-link:hover {
  background: var(--gold-2);
  border-color: rgba(227, 198, 110, 0.74);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.055) inset;
  transform: translateY(-1px);
}

button:active,
.button-link:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 0.06s;
}

button:focus-visible,
.button-link:focus-visible {
  outline: 2px solid rgba(227, 198, 110, 0.72);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

button.button-link:disabled,
.button-link[aria-disabled="true"] {
  background: rgba(201, 168, 76, 0.78);
  border-color: rgba(201, 168, 76, 0.46);
  color: #080b0d;
  opacity: 0.9;
}

button.button-link:disabled svg,
.button-link[aria-disabled="true"] svg {
  color: #080b0d;
  stroke: #080b0d;
}

button[aria-busy="true"],
button.is-loading {
  cursor: default;
  opacity: 0.86;
  border-color: rgba(112, 209, 138, 0.42);
  box-shadow: 0 0 0 1px rgba(112, 209, 138, 0.14) inset, 0 0 18px rgba(112, 209, 138, 0.1);
}

button[aria-busy="true"]::after,
button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(112, 209, 138, 0.16), transparent);
  transform: translateX(-120%);
  animation: button-loading-sheen 1.05s ease-in-out infinite;
  pointer-events: none;
}

button svg,
a svg,
button .app-icon,
a .app-icon {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  display: inline-block;
  flex: 0 0 15px;
  transition: transform 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

button:hover svg,
button:hover .app-icon,
.button-link:hover svg,
.button-link:hover .app-icon {
  transform: translateY(-1px) scale(1.06);
}

.secondary {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(201, 168, 76, 0.22);
  color: var(--text);
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bank-feed-autopost-button.is-active {
  border-color: rgba(112, 209, 138, 0.74);
  background: linear-gradient(135deg, rgba(112, 209, 138, 0.24), rgba(201, 168, 76, 0.3));
  color: #f5ffe8;
  box-shadow:
    0 0 0 1px rgba(112, 209, 138, 0.2) inset,
    0 0 18px rgba(112, 209, 138, 0.18),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.bank-feed-autopost-button.is-active::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -70%;
  width: 90%;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.3) 48%, transparent 78%);
  transform: translateX(-25%) skewX(-18deg);
  animation: autopost-active-sheen 2.2s ease-in-out infinite;
  pointer-events: none;
}

.bank-feed-autopost-button.is-active svg {
  color: var(--green);
  stroke: var(--green);
  filter: drop-shadow(0 0 6px rgba(112, 209, 138, 0.34));
}

.bank-feed-autopost-button.is-active:hover {
  border-color: rgba(152, 229, 168, 0.86);
  background: linear-gradient(135deg, rgba(112, 209, 138, 0.3), rgba(227, 198, 110, 0.35));
}

.secondary.is-loading {
  border-color: rgba(112, 209, 138, 0.42);
  background: rgba(112, 209, 138, 0.09);
}

.secondary.copy-confirmed {
  position: relative;
  overflow: hidden;
  border-color: rgba(112, 209, 138, 0.62);
  background: rgba(112, 209, 138, 0.14);
  color: #d8ffe2;
  animation: copy-confirm-pop 0.26s ease-out;
}

.secondary.copy-confirmed::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(112, 209, 138, 0.22), transparent);
  transform: translateX(-120%);
  animation: copy-confirm-sheen 0.82s ease-out;
  pointer-events: none;
}

.secondary.copy-confirmed svg {
  color: var(--green);
  animation: copy-check-in 0.22s ease-out;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

button.is-loading svg,
button.is-loading .app-icon {
  opacity: 0.96;
  animation: button-loading-pulse 0.82s ease-in-out infinite;
}

button.is-loading[data-loading-motion="spin"] svg,
button.is-loading[data-loading-motion="spin"] .app-icon {
  animation: spin 0.82s linear infinite;
}

button.is-loading span {
  animation: button-label-pulse 0.92s ease-in-out infinite;
}

#connectBankAccountBtn,
#connectFirstBankAccountBtn {
  min-width: 148px;
}

@keyframes button-loading-sheen {
  to {
    transform: translateX(120%);
  }
}

@keyframes autopost-active-sheen {
  0%,
  42% {
    transform: translateX(-25%) skewX(-18deg);
  }
  72%,
  100% {
    transform: translateX(245%) skewX(-18deg);
  }
}

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

@keyframes button-loading-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.08);
  }
}

@keyframes button-label-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes copy-confirm-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(-1px) scale(1.025);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes copy-confirm-sheen {
  to {
    transform: translateX(120%);
  }
}

@keyframes copy-check-in {
  from {
    transform: scale(0.72);
    opacity: 0.45;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button-link,
  button svg,
  a svg {
    transition: none;
  }

  button:hover,
  .button-link:hover,
  button:active,
  .button-link:active,
  button:hover svg,
  .button-link:hover svg {
    transform: none;
  }

  button[aria-busy="true"]::after,
  button.is-loading::after,
  button.is-loading svg,
  button.is-loading .app-icon,
  button.is-loading span {
    animation: none;
  }

  .secondary.copy-confirmed,
  .secondary.copy-confirmed::after,
  .secondary.copy-confirmed svg,
  .bank-feed-autopost-button.is-active::after,
  .app-notice,
  .app-notice.is-leaving {
    animation: none;
  }
}

.danger {
  border-color: rgba(255, 137, 125, 0.35);
  color: #ffd2cc;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: rgba(7, 11, 16, 0.96);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  padding: 0 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  text-decoration: none;
}

.brand img {
  width: 126px;
  height: auto;
  display: block;
}

.brand-logo-mark {
  display: none !important;
}

.sidebar-toggle {
  margin-top: auto;
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(143, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: rgba(201, 168, 76, 0.42);
  color: var(--text);
  outline: none;
}

.sidebar-toggle svg {
  width: 17px;
  height: 17px;
}

nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 7px;
  padding: 7px 9px;
  font-weight: 720;
}

.nav-count-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 91, 91, 0.18);
  color: #ffb9b9;
  box-shadow: inset 0 0 0 1px rgba(232, 91, 91, 0.38);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

nav a span.nav-beta-pill {
  margin-left: auto;
  min-width: auto;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(201, 168, 76, 0.13);
  color: #f3d77e;
  box-shadow: inset 0 0 0 1px rgba(227, 198, 110, 0.32);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

nav a:hover {
  background: rgba(35, 56, 74, 0.58);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(143, 163, 184, 0.12);
}

nav a.active {
  background: linear-gradient(180deg, rgba(41, 60, 77, 0.82), rgba(23, 35, 48, 0.82));
  color: var(--text);
  box-shadow: inset 3px 0 0 rgba(227, 198, 110, 0.86), inset 0 0 0 1px rgba(143, 163, 184, 0.16);
}

nav a.active svg,
nav a.active .app-icon {
  color: var(--gold-2);
}

nav a.nav-auth-link {
  margin-top: auto;
  border-top: 1px solid rgba(143, 163, 184, 0.16);
  border-radius: 0 0 7px 7px;
  color: #d9e4ee;
}

nav svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-basis: 16px;
}

nav .app-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
}

.eyebrow,
.panel-kicker,
.table-head,
.field-label {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.eyebrow {
  font-size: 13px;
}

.client-nav-context {
  margin: -2px 0 0 30px;
  padding: 6px 8px;
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 7px;
  background: rgba(201, 168, 76, 0.07);
  display: grid;
  gap: 2px;
}

.client-nav-context span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.client-nav-context strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-nav-submenu {
  margin: -1px 0 4px 18px;
  padding: 3px 0 3px 12px;
  border-left: 1px solid rgba(143, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

nav a.client-nav-link {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 760;
  background: rgba(9, 16, 24, 0.2);
}

nav a.client-nav-link.has-nav-badge {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
}

nav a.client-nav-link.has-nav-badge svg,
nav a.client-nav-link.has-nav-badge .app-icon {
  grid-row: 1;
  align-self: center;
}

nav a.client-nav-link.has-nav-badge span:not(.nav-beta-pill) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

nav a.client-nav-link.has-nav-badge .nav-beta-pill {
  grid-column: 2;
  justify-self: end;
  margin-left: 0;
}

nav a.client-nav-link.active {
  box-shadow: inset 2px 0 0 rgba(227, 198, 110, 0.86), inset 0 0 0 1px rgba(143, 163, 184, 0.14);
}

body.nav-collapsed .sidebar {
  padding-inline: 10px;
  align-items: center;
}

body.nav-collapsed .brand {
  width: 100%;
  justify-content: center;
  min-height: 52px;
  padding: 0 0 12px;
  margin-bottom: 4px;
}

body.nav-collapsed .brand-logo-full {
  display: none !important;
}

body.nav-collapsed .brand-logo-mark {
  width: 34px;
  height: 34px;
  display: block !important;
  border-radius: 8px;
}

body.nav-collapsed .sidebar-toggle,
body.nav-collapsed nav,
body.nav-collapsed nav a {
  width: 38px;
}

body.nav-collapsed nav a {
  min-height: 36px;
  justify-content: center;
  padding: 0;
  position: relative;
}

body.nav-collapsed nav a span,
body.nav-collapsed .client-nav-context {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.nav-collapsed .nav-count-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 7px;
  width: 7px;
  height: 7px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

body.nav-collapsed .client-nav-submenu {
  width: 38px;
  margin: 0;
  padding: 0;
  border-left: 0;
  gap: 7px;
}

body.nav-collapsed nav svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-basis: 18px;
}

body.nav-collapsed nav .app-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-basis: 18px;
}

main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  padding: 18px;
}

.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  margin: -18px -18px 18px;
  padding: 9px 18px;
  border-bottom: 1px solid rgba(244, 201, 107, 0.36);
  background: rgba(76, 52, 18, 0.96);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.impersonation-banner div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.impersonation-banner span {
  color: #f7dfa2;
}

.app-header {
  min-height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

body.client-scoped .app-header {
  min-height: 54px;
  justify-content: flex-start;
  align-items: flex-start;
}

html.client-route body:not(.client-scoped) .app-header,
html.app-shell-pending.client-route .app-header {
  display: none;
}

html.client-route body.client-scoped .app-header,
body.client-scoped .app-header {
  margin-bottom: 10px;
}

body.client-scoped .app-header > div:first-child {
  display: none;
}

html.client-route body .app-header > div:first-child {
  display: none;
}

body.client-scoped .header-actions {
  width: 100%;
  justify-content: flex-start;
}

html.client-route body .header-actions {
  width: 100%;
  justify-content: flex-start;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

h1[hidden] {
  display: none;
}

h2 {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 16px;
}

h3 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}

p {
  color: var(--muted);
}

.header-actions,
.toolbar,
.table-actions,
.button-row,
.tabs,
.doc-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel,
.drawer-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 56, 76, 0.94), rgba(22, 35, 50, 0.94));
}

.panel {
  padding: 12px;
  min-width: 0;
  max-width: 100%;
}

.panel + .panel,
.page-grid + .panel,
.panel + .page-grid {
  margin-top: 10px;
}

.selected-row {
  background: rgba(201, 168, 76, 0.08);
}

.bank-feed-statement-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.bank-feed-statement-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.bank-feed-statement-chip div {
  min-width: 0;
}

.bank-feed-statement-chip strong,
.bank-feed-statement-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-upload-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.statement-upload-card {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.statement-upload-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.statement-upload-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.statement-upload-head strong,
.statement-upload-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-upload-actions,
.statement-check-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.statement-check-list {
  display: grid;
  gap: 6px;
}

.statement-check-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) auto minmax(180px, 1.1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.28);
  padding: 8px;
}

.statement-check-main,
.statement-check-match {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.statement-check-main strong,
.statement-check-main span,
.statement-check-match span,
.statement-check-match small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-check-empty {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 750;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  padding: 8px;
}

.statements-page {
  display: grid;
  gap: 10px;
}

.statements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.statement-account-card {
  display: grid;
  gap: 10px;
}

.statement-account-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.statement-account-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.statement-account-head strong,
.statement-account-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statements-access-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(201, 168, 76, 0.3);
  background:
    linear-gradient(180deg, rgba(35, 57, 78, 0.96), rgba(20, 33, 47, 0.96));
}

.statement-access-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 13, 20, 0.16);
}

.statement-access-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.statement-access-copy strong {
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 900;
  line-height: 1.2;
}

.statement-access-copy small {
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.35;
}

.statement-access-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.statement-access-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: var(--fs-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.statement-access-chip strong {
  color: var(--text);
  font-size: var(--fs-sm);
}

.statement-access-chip.available {
  color: var(--green);
  border-color: rgba(112, 209, 138, 0.2);
  background: rgba(112, 209, 138, 0.1);
}

.statement-access-chip.unavailable {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.08);
}

.statement-access-chip.checking {
  color: var(--amber);
  border-color: rgba(244, 201, 107, 0.2);
  background: rgba(244, 201, 107, 0.08);
}

.statement-access-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.statement-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.28);
  padding: 10px;
}

.statement-access-row.available {
  border-color: rgba(112, 209, 138, 0.18);
}

.statement-access-row.checking {
  border-color: rgba(244, 201, 107, 0.16);
}

.statement-access-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.statement-access-titleline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.statement-access-titleline strong {
  min-width: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 900;
  line-height: 1.25;
}

.statement-access-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: var(--fs-xs);
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.statement-access-status .app-icon {
  width: 13px;
  height: 13px;
}

.statement-access-status.available {
  color: var(--green);
  background: rgba(112, 209, 138, 0.12);
}

.statement-access-status.unavailable {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.statement-access-status.checking {
  color: var(--amber);
  background: rgba(244, 201, 107, 0.1);
}

.statement-access-meta,
.statement-access-detail {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 750;
  line-height: 1.35;
}

.statement-access-detail {
  color: #c6d4df;
}

.statement-access-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.statement-list {
  display: grid;
  gap: 6px;
}

.statement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.32);
  padding: 8px;
}

.statement-row .button-row {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.statement-row > div:not(.button-row) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.statement-row strong,
.statement-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .statement-access-header,
  .statement-access-row {
    grid-template-columns: 1fr;
  }

  .statement-access-header {
    display: grid;
  }

  .statement-access-summary,
  .statement-access-actions {
    justify-content: flex-start;
  }

  .statement-access-actions {
    flex-wrap: wrap;
  }

  .statement-upload-head,
  .statement-check-row {
    grid-template-columns: 1fr;
  }

  .statement-upload-actions,
  .statement-check-status {
    justify-content: flex-start;
  }
}

.bank-feed-row-action-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1.2;
}

.bank-feed-row-action-note i {
  width: 14px;
  height: 14px;
}

.bank-feed-review-row {
  display: grid;
  grid-template-columns: 86px minmax(220px, 1.8fr) 110px minmax(140px, 0.9fr) minmax(110px, 0.7fr) minmax(210px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.34);
  padding: 10px;
}

.bank-feed-review-row.selected,
.bank-feed-review-row:hover {
  border-color: rgba(227, 198, 110, 0.42);
}

.bank-feed-row-date,
.bank-feed-row-description,
.bank-feed-row-status,
.bank-feed-row-match {
  min-width: 0;
}

.bank-feed-row-description strong,
.bank-feed-row-match strong {
  display: block;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-feed-row-description span,
.bank-feed-row-status small,
.bank-feed-row-match span {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-feed-row-status .danger-text {
  color: #fca5a5;
}

.bank-feed-transfer-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.bank-feed-transfer-match span {
  min-width: 0;
  white-space: normal;
}

.bank-feed-transfer-confidence {
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(143, 163, 184, 0.22);
  background: rgba(143, 163, 184, 0.1);
  color: var(--text);
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
}

.bank-feed-transfer-confidence.high {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
}

.bank-feed-transfer-confidence.medium,
.bank-feed-transfer-confidence.manual {
  border-color: rgba(227, 198, 110, 0.34);
  background: rgba(201, 168, 76, 0.12);
  color: #f7edd1;
}

.bank-feed-transfer-warn {
  color: #f8d17a;
  font-style: normal;
}

.bank-feed-row-amount {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.money-in {
  color: var(--green);
}

.money-out {
  color: var(--red);
}

.bank-feed-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.bank-feed-row-actions button {
  min-height: 32px;
  width: 100%;
  white-space: nowrap;
}

.bank-feed-detail-drawer {
  position: fixed;
  z-index: 88;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid rgba(201, 168, 76, 0.32);
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.99), rgba(8, 14, 21, 0.99));
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

.bank-feed-detail-drawer header,
.bank-feed-detail-drawer footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bank-feed-detail-drawer h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 20px;
}

.bank-feed-detail-drawer header span,
.bank-feed-detail-drawer small {
  color: var(--muted);
}

.bank-feed-detail-drawer .drawer-block {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.28);
  padding: 12px;
}

.bank-feed-detail-drawer .drawer-block strong {
  display: block;
  color: var(--text);
  margin-top: 2px;
}

.bank-feed-detail-drawer label {
  display: grid;
  gap: 6px;
}

.bank-feed-detail-drawer footer {
  position: sticky;
  bottom: 0;
  margin: 16px -16px -16px;
  padding: 12px 16px;
  background: rgba(8, 14, 21, 0.96);
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .bank-feed-review-row {
    grid-template-columns: 82px minmax(180px, 1fr) 110px minmax(180px, auto);
  }

  .bank-feed-row-status,
  .bank-feed-row-match {
    grid-column: span 1;
  }

  .bank-feed-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .bank-feed-review-row {
    grid-template-columns: 1fr;
  }

  .bank-feed-row-amount {
    text-align: left;
  }

  .bank-feed-detail-drawer {
    width: 100vw;
  }
}

.bank-feed-modal-backdrop {
  position: fixed;
  z-index: 92;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 9, 14, 0.68);
  padding: 20px;
}

.bank-feed-ledger-modal {
  width: min(560px, 100%);
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.98), rgba(10, 17, 25, 0.98));
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.48);
  padding: 14px;
}

.bank-feed-ledger-modal header,
.bank-feed-ledger-modal footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bank-feed-ledger-modal header {
  margin-bottom: 14px;
}

.bank-feed-pair-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.bank-feed-ledger-modal h2 {
  margin: 0 0 2px;
}

.bank-feed-ledger-modal header span {
  color: var(--muted);
}

.bank-feed-ledger-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.bank-feed-ledger-form label {
  display: grid;
  gap: 6px;
}

.bank-feed-picker {
  margin-bottom: 10px;
}

.bank-feed-picker-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bank-feed-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.28);
  padding: 10px;
}

.bank-feed-picker-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.bank-feed-picker-row strong,
.bank-feed-picker-row small {
  display: block;
}

.bank-feed-picker-row small,
.bank-feed-picker-row em {
  color: var(--muted);
  font-style: normal;
}

.teller-connect-result {
  max-width: 560px;
  margin: 16vh auto 0;
  text-align: center;
}

.teller-account-picker {
  max-width: 520px;
  margin: 12vh auto 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  background: var(--surface, #0f1722);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.teller-account-picker svg {
  width: 34px;
  height: 34px;
  color: var(--gold-2);
}

.teller-account-picker h2 {
  margin: 8px 0 2px;
  color: var(--text);
}

.teller-account-picker p {
  margin: 0 0 8px;
  max-width: 36rem;
  color: var(--muted);
}

.teller-account-pick-list {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  text-align: left;
}

.teller-account-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.teller-account-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.teller-account-pick:hover {
  border-color: var(--gold-2);
}

.teller-account-pick input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.teller-account-pick-main {
  display: grid;
  gap: 2px;
}

.teller-account-pick-main span {
  font-size: 13px;
  color: var(--muted);
}

body.teller-connect-shell .teller-connect-result {
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.teller-connect-result svg {
  width: 36px;
  height: 36px;
  color: var(--gold-2);
}

.teller-connect-result h2 {
  margin: 12px 0 4px;
  color: var(--text);
}

body.teller-connect-shell .teller-connect-result h2 {
  margin: 16px 0 6px;
  color: var(--text);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.06;
  letter-spacing: 0;
}

body.teller-connect-shell .teller-connect-result p {
  margin: 0 auto;
  max-width: 32rem;
  color: #a9bbcc;
  font-size: 18px;
  font-weight: 650;
}

.teller-public-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 52px;
}

.teller-public-brand img {
  width: 184px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.22));
}

.teller-public-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border: 1px solid rgba(227, 198, 110, 0.34);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.1);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22), 0 0 0 10px rgba(201, 168, 76, 0.035);
}

.teller-public-icon svg {
  width: 32px;
  height: 32px;
  color: var(--gold-2);
  stroke-width: 1.9;
}

.teller-connect-primary {
  min-height: 60px;
  margin-top: 30px;
  padding: 0 28px;
  border-radius: 8px;
  gap: 11px;
  color: #071018;
  font-size: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.teller-connect-primary svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  color: #071018;
  stroke: #071018;
  opacity: 0.92;
}

.teller-connect-primary:hover svg {
  color: #071018;
  stroke: #071018;
}

.teller-connect-spinner {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(225, 183, 93, 0.22);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: teller-connect-spin 0.8s linear infinite;
}

.teller-connect-fallback {
  display: none;
  margin-top: 18px;
}

.teller-connect-fallback.is-visible {
  display: block;
}

.teller-connect-fallback p {
  margin: 0 0 10px;
  color: var(--muted);
}

@keyframes teller-connect-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .teller-connect-spinner {
    animation-duration: 1.6s;
  }
}

.bank-feed-platform-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.bank-feed-platform-head > button {
  align-self: center;
}

.bank-feed-account-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.bank-feed-account-card {
  min-height: 190px;
  text-align: left;
  border: 1px solid rgba(143, 163, 184, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 47, 64, 0.96), rgba(15, 25, 35, 0.96));
  color: var(--body);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.bank-feed-card-main,
.bank-feed-card-footer,
.bank-feed-transaction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.bank-feed-card-main > div {
  min-width: 0;
}

.bank-feed-account-card:hover,
.bank-feed-account-card.active {
  border-color: rgba(227, 198, 110, 0.62);
  box-shadow: 0 0 0 1px rgba(227, 198, 110, 0.16) inset;
}

.bank-feed-account-card strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.bank-feed-account-card span,
.bank-feed-account-card small {
  color: var(--muted);
}

.bank-feed-card-balance {
  display: grid;
  gap: 6px;
  width: 100%;
}

.bank-feed-balance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
}

.bank-feed-balance-row span {
  font-size: 11px;
}

.bank-feed-balance-row strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.bank-feed-balance-row.variance {
  border-top: 1px solid rgba(143, 163, 184, 0.18);
  padding-top: 6px;
}

.bank-feed-balance-row.variance strong {
  color: var(--gold);
}

.bank-feed-card-footer {
  align-items: center;
}

.bank-feed-card-footer small {
  text-align: right;
  max-width: 58%;
}

.bank-feed-reconnect-banner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid rgba(248, 113, 113, 0.34);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.18);
}

.bank-feed-reconnect-banner > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.bank-feed-reconnect-banner strong {
  color: var(--text);
}

.bank-feed-reconnect-banner small {
  color: var(--muted);
}

.bank-feed-reconnect-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bank-feed-card-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.bank-feed-card-counts span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(9, 16, 24, 0.28);
  padding: 3px 7px;
  font-size: 11px;
  color: var(--body);
}

.bank-feed-card-menu {
  flex: 0 0 auto;
}

.bank-feed-card-menu .row-menu-panel {
  min-width: 220px;
}

.bank-feed-card-menu .row-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-feed-card-kicker {
  color: var(--gold-2) !important;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.bank-feed-transaction-head {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.bank-feed-transaction-head strong,
.bank-feed-ledger-modal h2 {
  color: var(--text);
}

.bank-feed-queue-tab strong {
  color: var(--text);
}

.bank-feed-queue-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.bank-feed-queue-tab {
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.bank-feed-queue-tab span {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.bank-feed-queue-tab strong {
  font-size: 12px;
  font-weight: 900;
}

.bank-feed-queue-tab.active {
  background: rgba(214, 166, 91, 0.16);
  border-color: rgba(214, 166, 91, 0.62);
  color: var(--text);
}

.bank-feed-queue-tab:focus-visible {
  outline: 2px solid rgba(214, 166, 91, 0.55);
  outline-offset: 2px;
}

.bank-feed-review-list {
  display: grid;
  gap: 8px;
}

.bank-feed-platform-head .bank-feed-account-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 20px) / 3);
  grid-template-columns: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.bank-feed-platform-head .bank-feed-account-card {
  scroll-snap-align: start;
}

.bank-feed-empty-panel {
  min-height: 280px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.bank-feed-empty-panel h2 {
  margin: 4px 0;
  color: var(--text);
}

.bank-feed-empty-panel p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.bank-feed-transactions-panel {
  margin-top: 10px;
}

.bank-feed-transaction-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: min(100%, max-content);
}

.bank-feed-transaction-tools .search {
  min-width: 0;
  width: 260px;
}

.bank-feed-warning-filters {
  min-height: 32px;
  border-color: var(--line-soft);
  background: rgba(7, 16, 25, 0.46);
}

.bank-feed-warning-filters button {
  min-height: 26px;
  min-width: 0;
  padding-inline: 9px;
  font-size: 11px;
}

.bank-feed-legacy-toggle {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  white-space: nowrap;
}

.bank-feed-legacy-toggle span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

#bankFeedPostSelected:disabled,
#bankFeedPostSelected:disabled span,
#bankFeedPostSelected:disabled svg {
  color: #080b0d !important;
  opacity: 1;
  stroke: #080b0d;
}

.bank-feed-autopilot-summary {
  display: grid;
  gap: 4px;
}

.bank-feed-autopilot-summary span,
.bank-feed-autopilot-summary small {
  color: var(--muted);
  font-size: 12px;
}

.bank-feed-autopilot-modal {
  width: min(760px, 100%);
}

.bank-feed-autopilot-modal .app-modal-body {
  gap: 16px;
}

.bank-feed-autopilot-controls {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
}

.bank-feed-autopilot-controls .compact-input {
  width: 100%;
}

.bank-feed-autopilot-controls .button-link,
.bank-feed-autopilot-controls .secondary {
  flex: 0 0 auto;
}

.bank-feed-autopilot-summary small {
  display: block;
  margin-top: 4px;
}

#bankFeedAutopilotPost,
#bankFeedAutopilotPost span,
#bankFeedAutopilotPost svg {
  color: #080b0d;
  stroke: #080b0d;
}

#bankFeedAutopilotPost:disabled,
#bankFeedAutopilotPost:disabled span,
#bankFeedAutopilotPost:disabled svg {
  color: #080b0d !important;
  opacity: 1;
  stroke: #080b0d;
}

.compact-toggle {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.bank-feed-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bank-feed-slider input {
  width: 96px;
}

.compact-input,
.compact-select {
  min-height: 38px;
  width: auto;
}

.input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.68);
  color: var(--text);
  padding: 0 10px;
}

.compact-input {
  max-width: 150px;
}

.setting-chip {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr);
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.58);
}

.setting-chip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.setting-chip .compact-input {
  min-height: 28px;
  height: 28px;
  max-width: none;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 800;
  text-align: right;
  padding: 0 7px;
}

.money-chip {
  min-width: 164px;
}

.setting-chip .currency-input {
  width: 82px;
}

.setting-chip .count-input {
  width: 48px;
}

.compact-select {
  max-width: 150px;
}

input[type="date"].compact-input {
  color-scheme: dark;
  height: 38px;
  appearance: none;
}

input[type="date"].compact-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.82;
  filter: invert(92%) sepia(12%) saturate(531%) hue-rotate(352deg) brightness(104%) contrast(91%);
}

.bank-feed-platform-table {
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: visible;
}

.bank-feed-platform-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(82px, 0.5fr) minmax(180px, 1.25fr) minmax(96px, 0.55fr) minmax(170px, 1fr) minmax(120px, 0.75fr) minmax(104px, 0.55fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 16, 24, 0.26);
}

.bank-feed-platform-row:has(.bank-feed-category-menu[open]) {
  z-index: 20;
}

.bank-feed-select-cell {
  display: grid;
  place-items: center;
}

.bank-feed-select-cell input {
  accent-color: var(--gold);
}

.bank-feed-platform-row:last-child {
  border-bottom: 0;
}

.bank-feed-platform-row:hover:not(.bank-feed-platform-row-head) {
  background: rgba(201, 168, 76, 0.055);
}

.bank-feed-destination-evidence {
  margin-top: 5px;
}

.bank-feed-destination-evidence summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  color: var(--amber);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.bank-feed-destination-evidence summary::-webkit-details-marker {
  display: none;
}

.bank-feed-destination-evidence summary svg {
  width: 13px;
  height: 13px;
}

.bank-feed-destination-evidence small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.25;
}

.bank-feed-platform-row-head {
  min-height: 36px;
  background: rgba(6, 10, 15, 0.38);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.bank-feed-category-cell {
  min-width: 0;
}

.bank-feed-category-menu {
  position: relative;
  width: 100%;
}

.bank-feed-category-readonly {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.18);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bank-feed-category-readonly svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  stroke-width: 2.2;
}

.bank-feed-category-readonly span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-feed-category-menu summary::-webkit-details-marker {
  display: none;
}

.bank-feed-category-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(201, 168, 76, 0.26);
  border-radius: 7px;
  border-color: rgba(201, 168, 76, 0.26);
  background: linear-gradient(180deg, rgba(23, 32, 43, 0.96), rgba(11, 17, 24, 0.98));
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.bank-feed-category-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-feed-category-trigger span.muted {
  color: var(--muted);
}

.bank-feed-category-trigger svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  transition: transform 0.16s ease;
}

.bank-feed-category-menu[open] .bank-feed-category-trigger {
  border-color: rgba(201, 168, 76, 0.72);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.bank-feed-category-menu[open] .bank-feed-category-trigger svg {
  transform: rotate(180deg);
}

.bank-feed-category-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(360px, 80vw);
  max-height: var(--bank-feed-menu-max-height, 320px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background: #0b1118;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bank-feed-category-menu[open] .bank-feed-category-panel {
  position: fixed;
  top: var(--bank-feed-menu-fixed-top, calc(100% + 6px));
  bottom: auto;
  left: var(--bank-feed-menu-fixed-left, auto);
  right: auto;
  width: var(--bank-feed-menu-fixed-width, min(360px, 80vw));
}

.bank-feed-category-menu.drop-up .bank-feed-category-panel {
  top: auto;
  bottom: calc(100% + 6px);
}

.bank-feed-category-menu[open].drop-up .bank-feed-category-panel {
  top: auto;
  bottom: var(--bank-feed-menu-fixed-bottom, calc(100% + 6px));
}

.chart-account-menu,
.rules-category-menu,
.select-menu {
  width: 100%;
}

.chart-account-trigger,
.rules-category-menu .bank-feed-category-trigger,
.select-menu-trigger {
  min-height: 42px;
}

.chart-account-panel,
.rules-category-panel,
.select-menu-panel {
  left: 0;
  right: auto;
  width: 100%;
  min-width: min(420px, 100%);
}

.bank-feed-ledger-modal .chart-account-panel {
  z-index: 96;
}

.rules-category-panel {
  width: min(420px, 82vw);
}

.toolbar-select-menu {
  min-width: 140px;
}

.toolbar-select-menu .select-menu-panel {
  min-width: 180px;
}

.rules-form .select-menu-panel,
.rules-toolstrip .select-menu-panel,
.filters .select-menu-panel {
  z-index: 44;
}

.chart-account-option small:empty,
.rules-category-panel small:empty {
  display: none;
}

.bank-feed-category-group + .bank-feed-category-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bank-feed-category-group-label {
  padding: 4px 8px 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bank-feed-category-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.bank-feed-category-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 780;
}

.bank-feed-category-option small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bank-feed-category-option:hover,
.bank-feed-category-option.selected {
  background: rgba(201, 168, 76, 0.12);
  color: #f7edd1;
}

.bank-feed-category-option.clear {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bank-feed-category-option.clear:hover {
  color: var(--text);
}

.button-link.small,
button.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .bank-feed-autopilot-controls {
    justify-content: flex-start;
  }

  .bank-feed-platform-head .bank-feed-account-cards {
    grid-auto-columns: calc((100% - 10px) / 2);
  }

  .bank-feed-account-card {
    min-height: 156px;
    padding: 10px;
    gap: 5px;
  }

  .bank-feed-balance-row {
    gap: 8px;
  }

  .bank-feed-card-counts span {
    padding: 2px 6px;
  }

  .bank-feed-platform-row {
    grid-template-columns: 30px 78px minmax(150px, 1fr) 94px minmax(178px, 0.95fr) minmax(92px, auto);
    gap: 8px;
    min-height: 58px;
    padding: 8px 10px;
  }

  .bank-feed-select-cell {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .bank-feed-row-date {
    grid-column: 2;
    grid-row: 1;
  }

  .bank-feed-row-description {
    grid-column: 3;
    grid-row: 1;
  }

  .bank-feed-row-amount {
    grid-column: 4;
    grid-row: 1;
  }

  .bank-feed-platform-row-head {
    display: none;
  }

  .bank-feed-category-cell {
    grid-column: 5;
    grid-row: 1;
  }

  .bank-feed-row-status {
    grid-column: 3 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .bank-feed-row-status .pill {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .bank-feed-row-status small {
    font-size: 10px;
  }

  .bank-feed-row-status small:not(:first-of-type),
  .bank-feed-row-status .danger-text {
    display: none;
  }

  .bank-feed-row-actions {
    grid-column: 6;
    grid-row: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .bank-feed-row-actions {
    align-items: center;
  }

  .bank-feed-row-actions button,
  .bank-feed-row-actions .button-link {
    min-height: 32px;
    white-space: nowrap;
  }

  .bank-feed-row-actions button.secondary span,
  .bank-feed-row-actions .secondary span {
    display: none;
  }

  .bank-feed-category-trigger,
  .bank-feed-category-readonly {
    min-height: 34px;
  }

  .bank-feed-transaction-head {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-feed-transaction-tools {
    width: 100%;
    min-width: 0;
  }

  .bank-feed-transaction-tools .search {
    flex: 1 1 240px;
    width: auto;
  }
}

@media (max-width: 720px) {
  .bank-feed-platform-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-feed-platform-head > button {
    display: none;
  }

  .bank-feed-platform-head .bank-feed-account-cards {
    grid-auto-columns: minmax(272px, 88%);
    margin-inline: -2px;
    padding-inline: 2px;
  }

  .bank-feed-account-card {
    min-height: 148px;
  }

  .bank-feed-platform-row {
    grid-template-columns: 26px minmax(70px, 0.28fr) minmax(0, 1fr) minmax(74px, auto);
    gap: 6px 10px;
    align-items: center;
    min-height: 58px;
    padding: 8px 10px;
  }

  .bank-feed-select-cell {
    grid-column: 1;
    grid-row: 1 / span 2;
    place-items: start center;
    padding-top: 3px;
  }

  .bank-feed-row-date {
    grid-column: 2;
    grid-row: 1;
    color: var(--gold);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: normal;
    line-height: 1.15;
  }

  .bank-feed-row-description {
    grid-column: 3;
    grid-row: 1;
    gap: 1px;
  }

  .bank-feed-row-description span {
    display: none;
  }

  .bank-feed-row-description strong {
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .bank-feed-row-amount {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    text-align: right;
    font-size: 12px;
    line-height: 1;
  }

  .bank-feed-category-cell {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .bank-feed-category-trigger,
  .bank-feed-category-readonly {
    min-height: 32px;
    padding-inline: 9px;
    border-radius: 6px;
    font-size: 12px;
  }

  .bank-feed-row-status {
    grid-column: 3 / 5;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .bank-feed-row-status .pill {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .bank-feed-row-status small {
    font-size: 10px;
    line-height: 1.15;
  }

  .bank-feed-row-status small:not(:first-of-type),
  .bank-feed-row-status .danger-text {
    display: none;
  }

  .bank-feed-row-actions {
    grid-column: 4;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    width: auto;
  }

  .bank-feed-row-actions button,
  .bank-feed-row-actions .button-link {
    width: auto;
    min-height: 32px;
    min-width: 34px;
    padding: 0 9px;
    justify-content: center;
    white-space: nowrap;
  }

  .bank-feed-row-actions button.secondary span,
  .bank-feed-row-actions .secondary span {
    display: none;
  }

  .bank-feed-row-actions .button-link span {
    display: inline;
  }

  .bank-feed-row-action-note {
    min-height: 28px;
    padding: 0 7px;
    white-space: nowrap;
  }

  .bank-feed-queue-tabs {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: auto;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .bank-feed-queue-tab {
    justify-content: center;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 32px;
  }

  .bank-feed-queue-tabs::-webkit-scrollbar {
    display: none;
  }

  .bank-feed-transaction-tools .search {
    flex: 1 1 180px;
    width: auto;
  }

  .bank-feed-transaction-tools > button,
  .bank-feed-transaction-tools .button-link {
    flex: 0 0 auto;
    justify-content: center;
  }

  .bank-feed-legacy-toggle {
    width: auto;
  }

  .bank-feed-reconnect-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-feed-reconnect-actions {
    justify-content: stretch;
  }

  .bank-feed-reconnect-actions button,
  .bank-feed-reconnect-actions .button-link {
    justify-content: center;
    width: 100%;
  }

  .bank-feed-category-panel {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 44px));
  }
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head p {
  margin-bottom: 0;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.clients-first-run {
  min-height: min(650px, calc(100vh - 174px));
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(22px, 4vw, 44px);
  border-color: rgba(201, 168, 76, 0.3);
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(24, 38, 52, 0.98), rgba(11, 18, 27, 0.98));
}

.clients-first-run-main {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
}

.clients-first-run-copy {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.clients-first-run-copy h2 {
  margin: 0;
  max-width: 520px;
  color: var(--text);
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: 1.04;
  letter-spacing: 0;
}

.clients-first-run-copy p:not(.eyebrow) {
  margin: 0;
  max-width: 500px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.58;
}

.clients-first-run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.clients-setup-map {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(143, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.32);
}

.clients-setup-map::before {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 34px;
  width: 1px;
  background: linear-gradient(180deg, rgba(227, 198, 110, 0.75), rgba(143, 163, 184, 0.16));
}

.clients-setup-step {
  position: relative;
  z-index: 1;
  min-height: 82px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(15, 25, 35, 0.9);
}

.clients-setup-step.active {
  border-color: rgba(201, 168, 76, 0.44);
  background: rgba(201, 168, 76, 0.1);
}

.clients-setup-step span {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(201, 168, 76, 0.38);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.76);
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.clients-setup-step strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
}

.clients-setup-step small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.clients-learning-row {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.clients-learning-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid rgba(143, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.34);
}

.clients-learning-card i {
  width: 24px;
  height: 24px;
  color: var(--gold-2);
}

.clients-learning-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.clients-learning-card strong {
  color: var(--text);
  font-size: 13px;
}

.clients-learning-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.36;
}

.clients-learning-card small {
  grid-column: 1 / -1;
  width: fit-content;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.08);
  font-size: 10px;
  font-weight: 850;
  padding: 3px 7px;
  text-transform: uppercase;
}

.client-filter-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  width: 100%;
  gap: 10px;
  align-items: center;
}

.readiness-band {
  border: 1px solid rgba(244, 201, 107, 0.2);
  border-radius: 8px;
  background: rgba(244, 201, 107, 0.07);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.readiness-band div {
  display: grid;
  gap: 2px;
}

.readiness-band strong {
  color: var(--text);
}

.readiness-band span {
  color: var(--muted);
  font-size: 13px;
}

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

.filters.client-filter-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  width: 100%;
  align-items: center;
}

.search,
select {
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.68);
  color: var(--text);
}

.search {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
}

.client-search {
  width: 100%;
  min-width: 0;
  height: 42px;
  border-color: rgba(201, 168, 76, 0.26);
  background: linear-gradient(180deg, rgba(23, 32, 43, 0.96), rgba(11, 17, 24, 0.98));
}

.client-search svg {
  color: var(--gold);
  width: 17px;
  height: 17px;
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.client-integration-filters {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.client-integration-filter {
  min-width: 84px;
  min-height: 42px;
  padding: 0 12px;
}

.client-integration-filter img {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  display: block;
}

.client-integration-filter.active {
  border-color: rgba(201, 168, 76, 0.78);
  background: rgba(201, 168, 76, 0.16);
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.22);
}

select {
  padding: 0 9px;
}

.input,
.rules-form input:not([type="checkbox"]) {
  min-height: 38px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.68);
  color: var(--text);
  padding: 0 9px;
}

textarea,
input[readonly] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(6, 10, 15, 0.52);
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.data-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 9px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: rgba(6, 10, 15, 0.42);
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 850;
  letter-spacing: 0;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: var(--gold-2);
}

.table-sort-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

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

td strong {
  color: var(--text);
}

td small,
.muted,
.activity span,
.job-status,
.doc-card span {
  color: var(--muted);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.14);
  color: #d6dee9;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
}

.pill.good {
  border-color: rgba(112, 209, 138, 0.34);
  color: #baf3c9;
  background: rgba(22, 101, 52, 0.46);
}

.pill.warn {
  border-color: rgba(244, 201, 107, 0.38);
  color: #ffe7a3;
  background: rgba(113, 79, 18, 0.5);
}

.pill.money-in {
  color: #70d18a;
  background: rgba(112, 209, 138, 0.13);
}

.pill.money-out {
  color: #f4c96b;
  background: rgba(244, 201, 107, 0.13);
}

.pill.bad {
  border-color: rgba(255, 137, 125, 0.38);
  color: #ffc2bc;
  background: rgba(127, 29, 29, 0.44);
}

.client-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.client-link:hover {
  color: var(--gold-2);
}

.client-row {
  cursor: pointer;
}

.client-row:hover td {
  background: rgba(201, 168, 76, 0.055);
}

.client-switcher {
  position: relative;
  width: min(560px, 100%);
  min-width: 340px;
  color: var(--text);
  z-index: 18;
}

.client-switcher-field {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 17, 25, 0.94), rgba(6, 10, 15, 0.94));
  color: var(--text);
  padding: 0 13px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.client-switcher-field:hover,
.client-switcher-field:focus-within,
.client-switcher.open .client-switcher-field {
  border-color: rgba(227, 198, 110, 0.62);
  background: linear-gradient(180deg, rgba(23, 37, 51, 0.96), rgba(12, 19, 27, 0.96));
  color: var(--text);
  outline: none;
  transform: none;
}

.client-switcher-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  outline: none;
  appearance: none;
}

.client-switcher-input::placeholder {
  color: var(--muted);
}

.client-switcher-input::-webkit-search-decoration,
.client-switcher-input::-webkit-search-cancel-button {
  appearance: none;
}

.client-menu-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-switcher-field svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--gold-2);
}

.client-switcher-field svg:first-child {
  color: var(--muted);
}

.client-switcher-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  max-height: min(420px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(201, 168, 76, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 25, 35, 0.99), rgba(7, 11, 16, 0.99));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  display: none;
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.5) rgba(255, 255, 255, 0.05);
}

.client-switcher.open .client-switcher-menu {
  display: grid;
  gap: 4px;
}

.client-menu-option {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--body);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 780;
  text-align: left;
  cursor: pointer;
}

.client-menu-option:hover,
.client-menu-option:focus-visible,
.client-menu-option.focused {
  border-color: rgba(201, 168, 76, 0.24);
  background: rgba(35, 56, 74, 0.72);
  color: var(--text);
  outline: none;
}

.client-menu-option.active {
  border-color: rgba(201, 168, 76, 0.34);
  background: rgba(42, 53, 50, 0.78);
  color: var(--text);
}

.client-menu-option.active:hover,
.client-menu-option.active:focus-visible {
  border-color: rgba(201, 168, 76, 0.42);
  background: rgba(45, 63, 78, 0.88);
  color: var(--text);
}

.client-menu-option svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.client-switcher-empty {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.client-switcher-empty[hidden] {
  display: none;
}

.table-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.table-pager,
.table-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pager {
  justify-content: flex-end;
  margin-top: 10px;
}

.table-summary {
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.table-pager span {
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}

.dashboard-overview-panel,
.firm-settings-panel {
  display: grid;
  gap: 14px;
}

.firm-settings-workspace {
  display: grid;
  gap: 12px;
  max-width: 1220px;
}

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

.firm-settings-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.48fr);
  gap: 12px;
  align-items: stretch;
}

.firm-settings-copy,
.firm-settings-checks,
.firm-settings-control,
.firm-integration-card {
  border: 1px solid rgba(143, 163, 184, 0.15);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.24);
}

.firm-settings-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
}

.firm-settings-copy strong,
.firm-settings-control strong,
.firm-integration-card h3 {
  color: var(--text);
}

.firm-settings-copy span,
.firm-settings-control small,
.firm-integration-card p {
  color: var(--muted);
  line-height: 1.45;
}

.firm-settings-checks {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
}

.firm-settings-checks span,
.firm-settings-control > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 850;
}

.firm-settings-checks svg,
.firm-settings-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

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

.firm-integration-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 176px;
  padding: 13px;
}

.firm-integration-card > .pill {
  position: absolute;
  top: 12px;
  right: 12px;
}

.firm-integration-card h3 {
  margin: 3px 0 6px;
  padding-right: 96px;
  font-size: 15px;
}

.firm-integration-card p {
  margin: 0;
  max-width: 620px;
  font-size: 12px;
}

.firm-integration-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 8px;
  background: rgba(5, 150, 105, 0.12);
  color: #34d399;
}

.firm-integration-icon.qbo-icon {
  border-color: rgba(201, 168, 76, 0.28);
  background: rgba(201, 168, 76, 0.11);
  color: var(--gold-2);
}

.firm-integration-actions,
.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.firm-integration-actions {
  margin-top: 12px;
}

.firm-team-invite {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.25fr) minmax(110px, 0.45fr) minmax(120px, 0.5fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(143, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.22);
}

.firm-team-invite .input {
  min-height: 38px;
}

.firm-team-table table {
  min-width: 940px;
}

.firm-team-table td:first-child {
  display: grid;
  gap: 3px;
}

.firm-team-table td:nth-child(4) {
  min-width: 210px;
}

.firm-team-table td:nth-child(4) small {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firm-team-client-access {
  width: 150px;
  min-height: 34px;
  margin-right: 6px;
}

.firm-team-client-button {
  margin-top: 6px;
}

.firm-client-access-modal {
  width: min(680px, calc(100vw - 28px));
}

.firm-client-checklist {
  display: grid;
  gap: 8px;
  max-height: min(420px, 52vh);
  overflow: auto;
}

.firm-client-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(143, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.firm-client-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.firm-client-check span {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firm-client-check small,
.firm-client-checklist-empty {
  color: var(--muted);
  font-size: 11px;
}

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

.firm-settings-control {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 13px;
}

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

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

.dashboard-workflow-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, auto));
  justify-self: start;
  gap: 4px;
  border: 1px solid rgba(143, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.28);
  padding: 4px;
}

.dashboard-workflow-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.dashboard-workflow-tab:hover {
  border-color: rgba(201, 168, 76, 0.2);
  color: var(--text);
}

.dashboard-workflow-tab.active {
  border-color: rgba(201, 168, 76, 0.36);
  background: rgba(201, 168, 76, 0.12);
  color: var(--text);
}

.dashboard-workflow-tab strong {
  min-width: 24px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(143, 163, 184, 0.14);
  color: var(--text);
  padding: 0 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dashboard-workflow-tab.active strong {
  background: rgba(201, 168, 76, 0.22);
  color: var(--gold-2);
}

.dashboard-queue-panel {
  display: grid;
  gap: 10px;
}

.dashboard-queue-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.dashboard-search {
  max-width: 520px;
}

.dashboard-clean-toggle {
  min-height: 34px;
  justify-content: center;
  white-space: nowrap;
}

.dashboard-queue-summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(143, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.28);
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-queue-summary strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dashboard-work-table {
  display: grid;
  gap: 6px;
}

.dashboard-work-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) minmax(170px, 0.78fr) 96px minmax(300px, 1.28fr) minmax(250px, 0.9fr);
  gap: 14px;
  align-items: center;
  min-height: 64px;
  border: 1px solid rgba(143, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.24);
  padding: 10px;
}

.dashboard-work-row:not(.dashboard-work-row-head) {
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.dashboard-work-row:not(.dashboard-work-row-head):hover {
  border-color: rgba(201, 168, 76, 0.4);
  background: rgba(201, 168, 76, 0.07);
  transform: translateY(-1px);
}

.dashboard-posted-work-row {
  border-left: 3px solid rgba(72, 187, 120, 0.45);
  cursor: default;
}

.dashboard-posted-work-row:not(.dashboard-work-row-head):hover {
  border-color: rgba(72, 187, 120, 0.26);
  background: rgba(72, 187, 120, 0.05);
  transform: none;
}

.dashboard-work-row.clean {
  opacity: 0.76;
}

.dashboard-work-row-head {
  min-height: 34px;
  border-color: rgba(201, 168, 76, 0.18);
  background: rgba(201, 168, 76, 0.08);
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-work-row-head span:nth-child(3),
.dashboard-work-row-head span:nth-child(5) {
  text-align: center;
}

.dashboard-client-cell,
.dashboard-account-cell,
.dashboard-next-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-account-cell {
  padding-right: 8px;
}

.dashboard-client-cell strong,
.dashboard-account-row strong,
.dashboard-transaction-main strong {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-client-cell span,
.dashboard-account-cell span,
.dashboard-account-cell small,
.dashboard-next-cell span,
.dashboard-account-row span,
.dashboard-transaction-main span,
.dashboard-drawer small,
.dashboard-drawer p {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-account-cell span,
.dashboard-account-cell small,
.dashboard-next-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-status-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.dashboard-status-cell .pill,
.dashboard-drawer-summary .pill {
  margin-right: 0;
}

.dashboard-work-count {
  display: grid;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.dashboard-work-count strong {
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.dashboard-posted-count strong {
  font-size: 14px;
}

.dashboard-next-cell {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  justify-self: stretch;
}

.dashboard-next-cell span {
  text-align: center;
}

.dashboard-posted-proof-cell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 2px;
}

.dashboard-posted-proof-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.dashboard-empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(143, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.24);
  color: var(--muted);
  text-align: center;
}

.dashboard-empty-state i,
.dashboard-drawer-empty i {
  color: var(--green);
  width: 30px;
  height: 30px;
}

.dashboard-empty-state strong,
.dashboard-drawer-empty strong {
  color: var(--text);
  font-size: 15px;
}

.dashboard-drawer-backdrop {
  position: fixed;
  z-index: 86;
  inset: 0;
  background: rgba(5, 10, 16, 0.54);
}

.dashboard-drawer {
  position: fixed;
  z-index: 88;
  top: 0;
  right: 0;
  width: min(920px, calc(100vw - 72px));
  min-width: min(760px, calc(100vw - 72px));
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid rgba(201, 168, 76, 0.32);
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.99), rgba(8, 14, 21, 0.99));
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

.dashboard-drawer header,
.dashboard-drawer-block-head,
.dashboard-account-row {
  display: flex;
  gap: 10px;
}

.dashboard-drawer header {
  align-items: flex-start;
  justify-content: space-between;
}

.dashboard-drawer-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-drawer h2 {
  margin: 2px 0 2px;
  font-size: 20px;
}

.dashboard-drawer header span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-drawer-summary,
.dashboard-drawer-block {
  border: 1px solid rgba(143, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.28);
  padding: 10px 12px;
}

.dashboard-drawer-summary {
  display: grid;
  gap: 6px;
}

.dashboard-drawer-summary div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.dashboard-drawer-summary p {
  margin: 0;
}

.dashboard-drawer-block {
  display: grid;
  align-content: start;
  gap: 8px;
}

.dashboard-drawer-block:has(.dashboard-transaction-list) {
  padding: 8px 12px 10px;
}

.dashboard-drawer-block-head {
  align-items: center;
  justify-content: space-between;
}

.dashboard-drawer-block-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-drawer-block-head strong {
  color: var(--text);
}

.dashboard-drawer-block-actions > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-drawer-block-actions button span,
.dashboard-drawer-block-actions .button-link span {
  color: inherit;
}

.dashboard-account-list,
.dashboard-transaction-list {
  display: grid;
  gap: 6px;
}

.dashboard-transaction-list {
  gap: 4px;
}

.dashboard-account-row {
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(143, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.dashboard-account-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-transaction-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(500px, 1.35fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(143, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.38);
  padding: 8px 10px;
  min-width: 0;
  min-height: 62px;
}

.dashboard-transaction-left,
.dashboard-transaction-controls,
.dashboard-category-select,
.dashboard-transaction-status,
.dashboard-transaction-actions {
  min-width: 0;
}

.dashboard-transaction-left {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  align-self: center;
  min-height: 30px;
}

.dashboard-transaction-select {
  width: 26px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dashboard-transaction-select input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.dashboard-transaction-select input:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.dashboard-transaction-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(128px, auto) minmax(134px, auto);
  gap: 8px;
  align-items: end;
  align-self: center;
}

.dashboard-transaction-main,
.dashboard-category-select {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-category-select {
  grid-template-rows: 12px 30px;
}

.dashboard-transaction-main strong {
  line-height: 1.15;
}

.dashboard-transaction-main span {
  line-height: 1.2;
}

.dashboard-transaction-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-transaction-amount {
  align-self: center;
  text-align: right;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transform: translateY(1px);
}

.dashboard-category-select > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-transaction-status {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.dashboard-transaction-status .pill,
.dashboard-account-row .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

.dashboard-transaction-status .pill {
  width: 100%;
  padding-inline: 10px;
}

.dashboard-transaction-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dashboard-transaction-actions button,
.dashboard-transaction-actions .button-link {
  width: 100%;
  min-height: 30px;
  white-space: nowrap;
  justify-content: center;
}

.dashboard-category-menu {
  width: 100%;
}

.dashboard-category-hold-note {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(143, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(16, 27, 39, 0.72);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
}

.dashboard-category-hold-note svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  flex: 0 0 14px;
}

.dashboard-category-trigger {
  min-height: 30px;
  height: 30px;
  border-radius: 8px;
  background: #101b27;
  padding: 0 9px;
}

.dashboard-category-trigger span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-category-panel {
  z-index: 96;
  width: min(360px, 72vw);
  max-height: 340px;
}

.dashboard-drawer-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-work-row {
    grid-template-columns: minmax(180px, 1fr) minmax(210px, 1fr) minmax(74px, auto);
    gap: 10px;
  }

  .dashboard-work-row-head span:nth-child(4),
  .dashboard-work-row-head span:nth-child(5),
  .dashboard-account-cell,
  .dashboard-next-cell {
    grid-column: 1 / -1;
  }

  .dashboard-transaction-row {
    grid-template-columns: 1fr;
  }

  .dashboard-transaction-controls {
    grid-template-columns: minmax(180px, 1fr) minmax(126px, auto) minmax(132px, auto);
  }

  .dashboard-drawer {
    width: min(860px, calc(100vw - 28px));
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .dashboard-queue-toolbar,
  .dashboard-work-row,
  .dashboard-transaction-row {
    grid-template-columns: 1fr;
  }

  .dashboard-workflow-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-workflow-tab {
    padding-inline: 8px;
  }

  .metric-grid.dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 2px 2px 4px;
  }

  .dashboard-metric-grid .metric-card {
    min-height: 0;
    align-content: start;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .dashboard-metric-grid .metric-card span {
    font-size: 10px;
    line-height: 1.25;
  }

  .dashboard-metric-grid .metric-card strong {
    margin-top: 2px;
    font-size: 25px;
  }

  .dashboard-metric-grid .metric-card small {
    line-height: 1.25;
  }

  .dashboard-search {
    max-width: none;
  }

  .dashboard-work-row-head {
    display: none;
  }

  .dashboard-work-row {
    align-items: stretch;
    min-height: 0;
  }

  .dashboard-status-cell {
    justify-content: flex-start;
  }

  .dashboard-work-count,
  .dashboard-transaction-amount {
    justify-items: start;
    text-align: left;
  }

  .dashboard-next-cell {
    grid-template-columns: 1fr;
  }

  .dashboard-drawer {
    width: 100vw;
    min-width: 0;
    padding: 12px max(10px, env(safe-area-inset-right)) 14px max(10px, env(safe-area-inset-left));
  }

  .dashboard-drawer header,
  .dashboard-drawer-block-head,
  .dashboard-account-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-drawer-header-actions,
  .dashboard-drawer-block-actions {
    justify-content: stretch;
  }

  .dashboard-drawer-header-actions .button-link,
  .dashboard-drawer-block-actions button,
  .dashboard-drawer-block-actions .button-link {
    justify-content: center;
    width: 100%;
  }

  .dashboard-transaction-left,
  .dashboard-transaction-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-transaction-left,
  .dashboard-transaction-status,
  .dashboard-transaction-actions {
    padding-top: 0;
  }

  .dashboard-transaction-amount {
    justify-self: start;
  }

  .dashboard-transaction-status,
  .dashboard-transaction-actions {
    width: 100%;
  }

  .dashboard-category-select {
    grid-template-rows: auto auto;
  }

  .dashboard-category-panel {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 44px));
  }
}

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

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

.metric-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(143, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.32);
  padding: 12px;
}

.metric-card span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-section-header h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.connection-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.connection-icon img {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 6px;
}

.connection-icon > svg {
  width: 26px;
  height: 26px;
  padding: 5px;
  border: 1px solid rgba(16, 185, 129, 0.44);
  border-radius: 6px;
  background: rgba(5, 150, 105, 0.14);
  color: #34d399;
  stroke: #34d399;
}

.connection-icon span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 137, 125, 0.11);
  order: -1;
}

.connection-icon.connected span {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(112, 209, 138, 0.13);
}

.table-link-button.muted {
  cursor: default;
}

#clientTable th:not(:first-child),
#clientTable td:not(:first-child) {
  text-align: center;
}

#clientTable table {
  min-width: 0;
  table-layout: fixed;
}

#clientTable th:first-child,
#clientTable td:first-child {
  min-width: 0;
  white-space: normal;
}

#clientTable .client-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

#clientTable th:last-child,
#clientTable td:last-child {
  width: 86px;
  max-width: 86px;
  padding-left: 10px;
  padding-right: 10px;
}

#clientTable .table-actions {
  justify-content: center;
}

#clientTable .data-table {
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
}

.financial-cell {
  min-width: 112px;
  display: grid;
  justify-items: center;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.financial-cell strong {
  color: var(--text);
  font-size: 13px;
}

.financial-cell small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  white-space: normal;
}

.financial-cell.unavailable {
  justify-items: center;
  text-align: center;
}

.financial-cell.unavailable strong {
  color: var(--amber);
  font-size: 12px;
}

.rules-page {
  display: grid;
  gap: 10px;
}

.rules-layout {
  display: grid;
  gap: 10px;
}

.rules-match-cell {
  min-width: 0;
}

.rules-row-actions,
.rules-quick-actions,
.rules-form-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rules-row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.rules-row-actions .danger-action {
  color: #f6a7a0;
  border-color: rgba(239, 126, 115, 0.28);
}

.rules-row-actions .danger-action:hover:not(:disabled) {
  color: #ffd0cc;
  border-color: rgba(239, 126, 115, 0.5);
  background: rgba(239, 126, 115, 0.08);
}

.rules-table-panel h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 17px;
}

.rules-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(126px, 0.72fr)) minmax(180px, 1fr);
  gap: 9px;
  align-items: end;
}

.rules-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rules-form .rules-category-field {
  grid-column: span 2;
  min-width: 0;
}

.rules-toggle {
  min-height: 36px;
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.26);
  padding: 8px 9px;
  color: var(--body);
  font-weight: 760;
}

.rules-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}

.rules-form-actions {
  align-self: end;
  justify-content: flex-end;
  padding-top: 0;
  min-width: 0;
}

.rules-form-actions > span {
  display: none;
}

.rules-editor-modal {
  width: min(1040px, calc(100vw - 34px));
}

.rules-editor-modal .app-modal-body {
  padding-top: 10px;
}

.rules-editor-modal .rules-form {
  grid-template-columns: minmax(240px, 1.25fr) repeat(3, minmax(130px, 0.7fr));
}

.rules-editor-modal .rules-name-field,
.rules-editor-modal .rules-category-field {
  grid-column: span 2;
}

.rules-conflict-modal-note {
  margin: 0 16px 4px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 91, 91, 0.26);
  border-radius: 8px;
  background: rgba(232, 91, 91, 0.08);
  display: grid;
  gap: 3px;
}

.rules-conflict-modal-note strong {
  color: #ffd6d6;
  font-size: 13px;
}

.rules-conflict-modal-note span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.rules-conflict-account-list {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
}

.rules-conflict-account-list.compact {
  margin-top: 4px;
  gap: 4px;
  max-height: 52px;
  overflow: hidden;
}

.rules-conflict-account-chip {
  min-width: 0;
  max-width: 220px;
  padding: 5px 7px;
  border: 1px solid rgba(232, 91, 91, 0.24);
  border-radius: 7px;
  background: rgba(9, 16, 24, 0.28);
  display: grid;
  gap: 1px;
}

.rules-conflict-account-chip strong,
.rules-conflict-account-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rules-conflict-account-chip strong {
  color: var(--text);
  font-size: 12px;
}

.rules-conflict-account-chip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.rules-conflict-account-list.compact .rules-conflict-account-chip {
  max-width: 150px;
  padding: 3px 6px;
}

.rules-conflict-account-list.compact .rules-conflict-account-chip strong {
  font-size: 11px;
}

.rules-conflict-account-list.compact .rules-conflict-account-chip small {
  font-size: 9px;
}

.rules-conflict-empty {
  color: var(--muted);
  font-size: 12px;
}

.rules-conflict-band {
  border-color: rgba(232, 91, 91, 0.28);
  background: linear-gradient(180deg, rgba(58, 29, 33, 0.62), rgba(22, 29, 36, 0.72));
}

.rules-conflict-band strong {
  color: #ffd6d6;
}

.rules-conflict-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rules-toolstrip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
}

.rules-filter-group,
.rules-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rules-filter-group {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(128px, 160px) minmax(128px, 160px) auto auto auto;
  align-items: center;
}

.rules-filter-group .search {
  height: 42px;
  max-width: none;
  min-width: 0;
}

.rules-filter-group .select-menu-trigger,
.rules-filter-group .rules-review-filter,
.rules-filter-group .rules-bulk-action {
  min-height: 42px;
}

.rules-command-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.rules-command-actions button,
.rules-filter-group button {
  min-height: 36px;
  padding-inline: 10px;
  white-space: nowrap;
}

.rules-filter-group .rules-bulk-action {
  min-width: 92px;
}

.rules-review-filter {
  min-height: 36px;
  white-space: nowrap;
}

.rules-review-filter.active,
.rules-review-filter[aria-pressed="true"] {
  color: #ffd6d6;
  border-color: rgba(232, 91, 91, 0.34);
  background: rgba(232, 91, 91, 0.1);
}

.rules-platform-table {
  --rules-table-columns: 34px minmax(170px, 1.02fr) minmax(200px, 1.22fr) minmax(180px, 1.04fr) minmax(126px, 0.58fr) minmax(112px, 0.46fr) minmax(128px, auto);
  display: grid;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.rules-platform-row {
  display: grid;
  grid-template-columns: var(--rules-table-columns);
  column-gap: 18px;
  row-gap: 6px;
  align-items: center;
  min-height: 74px;
  padding: 10px 20px 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 16, 24, 0.26);
}

.rules-platform-row:last-child {
  border-bottom: 0;
}

.rules-platform-row:hover:not(.rules-platform-row-head) {
  background: rgba(201, 168, 76, 0.055);
}

.rules-platform-row-conflict {
  background: rgba(232, 91, 91, 0.055);
  box-shadow: inset 3px 0 0 rgba(232, 91, 91, 0.72);
}

.rules-platform-row-conflict:hover:not(.rules-platform-row-head) {
  background: rgba(232, 91, 91, 0.085);
}

.rules-platform-row-head {
  min-height: 36px;
  background: rgba(6, 10, 15, 0.38);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.rules-platform-row-head span,
.rules-sort-button {
  min-width: 0;
}

.rules-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.rules-sort-button:hover,
.rules-sort-button:focus-visible,
.rules-sort-button.active {
  color: var(--text);
}

.rules-sort-button:focus-visible {
  outline: 2px solid rgba(201, 168, 76, 0.44);
  outline-offset: 3px;
  border-radius: 4px;
}

.rules-sort-button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--gold);
  opacity: 0.72;
}

.rules-sort-button:not(.active) svg {
  opacity: 0.42;
}

.rules-platform-row-head > :nth-child(5),
.rules-platform-row-head span:nth-child(7),
.rules-state-cell,
.rules-row-actions {
  justify-self: center;
}

.rules-platform-row-head > :nth-child(6),
.rules-history-cell {
  justify-self: center;
  text-align: right;
}

.rules-platform-row-head > :nth-child(6) {
  justify-content: center;
}

.rules-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.rules-select-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.rules-name-cell,
.rules-match-cell,
.rules-category-cell,
.rules-history-cell,
.rules-state-cell {
  min-width: 0;
}

.rules-name-cell strong,
.rules-match-cell strong,
.rules-category-cell strong,
.rules-history-cell strong {
  display: block;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rules-name-cell span,
.rules-match-cell span,
.rules-category-cell span,
.rules-history-cell span {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rules-state-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}

.rules-history-cell {
  font-variant-numeric: tabular-nums;
  min-width: 96px;
  padding-right: 4px;
}

.rules-row-actions {
  min-width: 116px;
  padding-left: 2px;
}

.logs-page {
  display: grid;
  gap: 14px;
}

.logs-panel {
  display: grid;
  gap: 8px;
}

.logs-day-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
}

.logs-day-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logs-day-toolbar > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.logs-day-toolbar .secondary {
  min-height: 32px;
  padding: 7px 10px;
}

.logs-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.logs-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
}

.logs-day-summary::-webkit-details-marker,
.logs-event summary::-webkit-details-marker {
  display: none;
}

.logs-day-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.logs-day[open] > .logs-day-summary::after {
  transform: rotate(225deg);
}

.logs-day-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.logs-day-date {
  color: var(--text);
  font-weight: 850;
}

.logs-day-count,
.logs-load-older > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.logs-day-events {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.logs-event {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logs-event:last-child {
  border-bottom: 0;
}

.logs-event,
.logs-event summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.logs-event summary {
  cursor: pointer;
  list-style: none;
}

.logs-event.expandable {
  display: block;
  padding: 0;
}

.logs-event-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.logs-event-icon svg {
  width: 15px;
  height: 15px;
}

.logs-event-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.logs-event-main strong,
.logs-event-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logs-event-main span,
.logs-event-time {
  color: var(--muted);
  font-size: 12px;
}

.logs-event-time {
  font-variant-numeric: tabular-nums;
}

.logs-event-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.logs-event-detail {
  margin: 0 14px 12px 52px;
  padding: 10px 12px;
  border-left: 2px solid rgba(201, 168, 76, 0.38);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.14);
}

.logs-event-detail p {
  margin: 0 0 8px;
}

.logs-event-detail dl {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

.logs-event-detail div {
  display: grid;
  gap: 2px;
}

.logs-event-detail dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.logs-event-detail dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.logs-load-older {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.financials-page {
  display: grid;
  gap: 14px;
}

.backup-page {
  display: grid;
  gap: 14px;
}

.backup-action-panel,
.backup-status-header,
.backup-action-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.backup-action-panel p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.backup-action-controls {
  flex-shrink: 0;
}

.backup-action-controls > span {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.backup-status-panel {
  display: grid;
  gap: 16px;
}

.backup-workflow-panel {
  display: grid;
  gap: 14px;
}

.backup-workflow-panel.is-complete {
  gap: 12px;
}

.backup-workflow-panel .backup-status-header p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.backup-wizard-shell {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.backup-wizard-tabs {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 16, 25, 0.22);
}

.backup-wizard-tabs button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.backup-wizard-tabs button.active {
  border-color: rgba(201, 168, 76, 0.48);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(255, 255, 255, 0.035));
  box-shadow: inset 3px 0 0 var(--gold);
}

.backup-wizard-tabs button.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.backup-wizard-tabs button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.34);
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
}

.backup-wizard-tabs button > strong {
  min-width: 0;
  align-self: center;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-step-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 18, 28, 0.34);
  color: rgba(148, 163, 184, 0.68);
}

.backup-step-status svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.backup-step-status.complete {
  border-color: rgba(55, 190, 119, 0.3);
  background: rgba(29, 128, 83, 0.18);
  color: #7ce2a3;
}

.backup-step-status.attention {
  border-color: rgba(201, 168, 76, 0.28);
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.backup-step-status.pending {
  opacity: 0.72;
}

.backup-workflow-steps {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 19, 29, 0.28);
}

.backup-workflow-step {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.backup-workflow-step:not(.active) {
  display: none;
}

.backup-workflow-step.active {
  border-color: rgba(201, 168, 76, 0.28);
  background: linear-gradient(180deg, rgba(36, 56, 75, 0.86), rgba(26, 42, 58, 0.78));
}

.backup-workflow-panel.is-complete .backup-workflow-step {
  padding: 10px 12px;
}

.backup-step-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.backup-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.34);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(201, 168, 76, 0.08);
}

.backup-step-label h3 {
  margin: 0;
  font-size: 0.98rem;
}

.backup-step-label p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.backup-step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.backup-step-actions > span:not(.pill) {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.backup-source-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.backup-source-table {
  min-width: 560px;
}

.backup-workflow-details {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.backup-workflow-details.is-hidden {
  display: none;
}

.backup-step-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.backup-workflow-details > .empty-state {
  min-height: 180px;
  border-color: rgba(201, 168, 76, 0.22);
  background: rgba(7, 16, 25, 0.22);
  color: #b7c4d4;
}

.backup-finish-screen {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(112, 209, 138, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 101, 52, 0.28), rgba(8, 19, 29, 0.36));
  animation: backup-step-arrive 180ms ease-out;
}

.backup-finish-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(112, 209, 138, 0.48);
  background: rgba(22, 101, 52, 0.52);
  color: #baf3c9;
}

.backup-finish-mark i {
  width: 18px;
  height: 18px;
}

.backup-finish-screen h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.backup-finish-screen p:not(.eyebrow) {
  margin: 6px 0 0;
  color: #c6d3e2;
}

.backup-finish-metrics,
.backup-finish-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-finish-metrics div {
  min-width: 128px;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(7, 16, 25, 0.28);
}

.backup-finish-metrics span,
.backup-finish-metrics strong {
  display: block;
}

.backup-finish-metrics span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-finish-metrics strong {
  margin-top: 4px;
  font-size: 1.08rem;
}

.backup-workflow-step.active,
.backup-workflow-details:not(.is-hidden) {
  animation: backup-step-arrive 160ms ease-out;
}

@keyframes backup-step-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .backup-finish-screen,
  .backup-workflow-step.active,
  .backup-workflow-details:not(.is-hidden) {
    animation: none;
  }
}

.backup-import-window {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.backup-import-window button {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.backup-import-window button.active {
  background: rgba(201, 168, 76, 0.14);
  color: var(--gold);
}

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

.backup-complete-summary > div,
.backup-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.backup-complete-summary > div {
  padding: 11px 12px;
}

.backup-complete-summary span,
.backup-complete-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.backup-complete-summary span {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
}

.backup-complete-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

.backup-complete-summary small {
  margin-top: 3px;
}

.backup-accordion {
  overflow: hidden;
}

.backup-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

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

.backup-accordion summary::after {
  content: "Open";
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.backup-accordion[open] summary {
  border-bottom: 1px solid var(--border);
}

.backup-accordion[open] summary::after {
  content: "Close";
}

.backup-accordion summary span,
.backup-accordion summary strong {
  display: block;
}

.backup-accordion summary span {
  color: var(--text);
  font-weight: 900;
}

.backup-accordion summary strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.backup-accordion-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
}

.backup-source-accordion {
  margin-left: 0;
}

.backup-source-accordion .backup-source-table-wrap {
  padding-left: 12px;
}

.backup-created-list {
  display: grid;
  gap: 10px;
}

.backup-created-list h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.backup-created-grid span {
  display: block;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.backup-created-grid strong,
.backup-created-grid small {
  display: block;
}

.backup-created-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-created-grid small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.backup-status-header h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.backup-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.backup-summary div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-subtle);
}

.backup-summary span,
.backup-browser-toolbar strong {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.backup-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

.backup-browser {
  display: grid;
  gap: 12px;
}

.backup-derived {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 8px;
  background: rgba(8, 19, 29, 0.32);
}

.backup-browser-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 360px) auto;
  align-items: end;
  gap: 12px;
}

.backup-derived-toolbar {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.backup-derived-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented-control button,
.segmented-control a {
  min-height: 32px;
  min-width: 48px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.segmented-control button.active,
.segmented-control a.active {
  background: rgba(201, 168, 76, 0.18);
  color: var(--text);
}

.backup-view-switch {
  justify-self: start;
  background: rgba(7, 16, 25, 0.42);
  border-color: rgba(148, 163, 184, 0.16);
}

.backup-view-switch a {
  min-width: 76px;
}

.backup-derived-date {
  display: grid;
  gap: 4px;
  min-width: 138px;
}

.backup-derived-date span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.backup-derived-date .input {
  min-height: 32px;
  padding: 6px 9px;
}

.backup-derived-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.backup-derived-presets button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.backup-derived-presets button.active {
  border-color: rgba(201, 168, 76, 0.72);
  background: rgba(201, 168, 76, 0.16);
  color: var(--text);
}

.backup-derived-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.backup-derived-summary div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-subtle);
}

.backup-derived-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.backup-derived-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.backup-derived-summary strong.negative {
  color: #f87171;
}

.backup-derived-table {
  min-width: 780px;
}

.backup-derived-section-row td {
  background: rgba(201, 168, 76, 0.08);
}

.backup-coa-section-row td {
  background: rgba(201, 168, 76, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.backup-coa-section-row span,
.backup-coa-section-row strong {
  display: inline-block;
  vertical-align: middle;
}

.backup-coa-section-row strong {
  margin-left: 8px;
  color: var(--gold);
}

.backup-coa-table td strong,
.backup-coa-table td small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-coa-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.backup-transaction-table td strong,
.backup-transaction-table td small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-transaction-table td small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-transaction-table {
  min-width: 980px;
}

.backup-transaction-table th:first-child,
.backup-transaction-table td:first-child {
  width: 52px;
  text-align: center;
}

.backup-transaction-table th:nth-child(2),
.backup-transaction-table td:nth-child(2) {
  width: 118px;
}

.backup-transaction-table th:nth-child(4),
.backup-transaction-table td:nth-child(4) {
  width: 34%;
}

.backup-transaction-table th:nth-child(5),
.backup-transaction-table td:nth-child(5) {
  width: 132px;
}

.backup-transaction-table th:nth-child(6),
.backup-transaction-table td:nth-child(6) {
  width: 140px;
}

.backup-skipped-table th:first-child,
.backup-skipped-table td:first-child {
  width: auto;
  text-align: left;
}

.backup-transaction-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.backup-proof-list-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.22);
  color: var(--muted);
  font-size: 0.82rem;
}

.backup-proof-list-note strong {
  color: var(--text);
}

.backup-skipped-review {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.18);
}

.backup-skipped-review summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
}

.backup-skipped-review summary strong {
  color: var(--gold);
}

.backup-skipped-review-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.backup-skipped-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.backup-skipped-reasons div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(11, 18, 32, 0.28);
}

.backup-skipped-reasons strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.backup-skipped-reasons span {
  color: var(--text);
  font-weight: 800;
}

.backup-skipped-reasons small {
  color: var(--muted);
  line-height: 1.35;
}

.backup-coa-override {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-width: 260px;
}

.backup-coa-override span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-coa-override .input {
  min-height: 32px;
  padding: 6px 9px;
}

.backup-derived-account strong,
.backup-derived-account span {
  display: block;
}

.backup-derived-account span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.backup-browser-toolbar > div > span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 4px;
}

.backup-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 0 10px;
}

.backup-search i {
  color: var(--muted);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.backup-search .input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
  width: 100%;
}

.backup-drill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(201, 168, 76, 0.26);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(201, 168, 76, 0.08);
}

.backup-drill-banner strong,
.backup-drill-banner span {
  display: block;
}

.backup-drill-banner span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.backup-gl-table {
  min-width: 1180px;
}

.backup-gl-table th:first-child,
.backup-gl-table td:first-child {
  width: 280px;
}

.backup-gl-table th,
.backup-gl-table td {
  overflow: hidden;
}

.backup-gl-table th:nth-child(6),
.backup-gl-table td:nth-child(6) {
  width: 280px;
}

.backup-gl-table th:nth-child(7),
.backup-gl-table td:nth-child(7) {
  width: 190px;
}

.backup-path {
  color: var(--muted);
  font-size: 0.84rem;
}

.backup-cell-clip {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.backup-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.financials-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
}

.financials-controls,
.financials-actions,
.financials-basis-toggle {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.financials-controls label {
  display: grid;
  gap: 6px;
  min-width: 176px;
}

.financials-menu-field {
  min-width: 190px;
}

.financials-menu {
  width: 100%;
}

.financials-menu-trigger {
  min-width: 190px;
}

.financials-menu-panel {
  right: auto;
  left: 0;
  width: min(380px, 88vw);
}

.financials-menu-option small {
  text-align: right;
}

.financials-controls select.input {
  min-height: 38px;
  height: 38px;
  min-width: 176px;
  border-color: rgba(148, 163, 184, 0.16);
  background-color: rgba(6, 10, 15, 0.72);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 184, 92, 0.95) 50%),
    linear-gradient(135deg, rgba(226, 184, 92, 0.95) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 0 32px 0 10px;
  appearance: none;
}

.financials-controls select.input:hover {
  border-color: rgba(227, 184, 92, 0.38);
  background-color: rgba(12, 20, 29, 0.86);
}

.financials-controls select.input:focus,
.financials-controls select.input:focus-visible {
  border-color: rgba(227, 184, 92, 0.72);
  box-shadow: 0 0 0 3px rgba(227, 184, 92, 0.14), inset 0 0 0 1px rgba(227, 184, 92, 0.16);
  outline: 0;
}

.financials-controls select.input option {
  background: #101b28;
  color: var(--text);
}

.financials-controls input[type="date"].input {
  min-height: 38px;
  height: 38px;
  min-width: 150px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(6, 10, 15, 0.72);
  color: var(--text);
  color-scheme: dark;
  font-weight: 700;
}

.financials-controls input[type="date"].input:hover,
.financials-controls input[type="date"].input:focus {
  border-color: rgba(227, 184, 92, 0.5);
  outline: 0;
}

.financials-controls label.is-hidden {
  display: none;
}

.financials-run-custom {
  align-self: end;
  min-height: 38px;
}

.financials-basis-toggle {
  align-items: center;
}

.financials-basis-toggle .active {
  border-color: rgba(227, 184, 92, 0.72);
  color: var(--gold);
  background: rgba(227, 184, 92, 0.12);
}

.financials-actions {
  justify-content: flex-end;
}

.financials-freshness,
.financials-status {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.financials-status {
  color: var(--gold);
}

.financials-branding-modal {
  width: min(720px, calc(100vw - 28px));
}

.financials-branding-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.financials-branding-form label {
  display: grid;
  gap: 6px;
}

.financials-branding-form textarea.input {
  min-height: 82px;
  resize: vertical;
}

.financials-branding-address,
.financials-branding-logo {
  grid-column: 1 / -1;
}

.financials-branding-check {
  align-items: center;
  display: flex !important;
  flex-direction: row;
  gap: 8px !important;
}

.financials-branding-check input {
  accent-color: var(--gold);
}

.financials-empty-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.financials-empty-panel h2,
.financials-report-title h2 {
  margin: 0;
}

.financials-empty-panel p:not(.eyebrow) {
  color: var(--muted);
  margin: 7px 0 0;
}

.financials-report-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.financials-stale-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(227, 184, 92, 0.44);
  background: rgba(227, 184, 92, 0.12);
  color: #f5d58d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.financials-stale-banner span {
  color: var(--muted);
}

.financials-table-wrap {
  overflow-x: auto;
}

.financials-report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.financials-report-table {
  table-layout: fixed;
}

.financials-report-table th,
.financials-report-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  padding: 10px 12px;
  vertical-align: top;
}

.financials-report-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.025);
}

.financials-report-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.financials-report-table .align-left {
  text-align: left;
}

.financials-report-table .align-center {
  text-align: center;
}

.financials-report-table .summary-row td {
  border-top: 1px solid rgba(227, 184, 92, 0.28);
  font-weight: 800;
  color: var(--text);
}

.financials-report-table .negative {
  color: #f87171;
}

.financials-report-table .lvl-1 {
  padding-left: 26px;
}

.financials-report-table .lvl-2 {
  padding-left: 42px;
}

.financials-report-table .lvl-3 {
  padding-left: 58px;
}

@media (max-width: 980px) {
  .backup-wizard-shell {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 720px) {
  .backup-action-panel,
  .backup-status-header,
  .backup-action-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-wizard-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-wizard-tabs button {
    grid-template-columns: 24px minmax(0, 1fr) max-content;
  }

  .backup-action-controls .button-link {
    justify-content: center;
    width: 100%;
  }

  .backup-workflow-step {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .backup-step-actions {
    justify-content: stretch;
  }

  .backup-step-actions .button-link,
  .backup-step-actions .secondary {
    justify-content: center;
    width: 100%;
  }

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

  .backup-step-footer .button-link,
  .backup-step-footer .secondary {
    justify-content: center;
  }

  .backup-import-window {
    width: 100%;
  }

  .backup-import-window button {
    flex: 1 1 0;
  }

  .backup-source-table-wrap,
  .backup-workflow-details {
    padding-left: 0;
  }

  .backup-complete-summary,
  .backup-created-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-source-accordion {
    margin-left: 0;
  }

  .backup-accordion summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .backup-accordion summary strong {
    text-align: left;
  }

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

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

  .backup-browser-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .backup-browser-toolbar .secondary,
  .backup-search {
    width: 100%;
  }

  .backup-browser-toolbar .secondary {
    justify-content: center;
  }

  .backup-drill-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-derived-toolbar,
  .backup-derived-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-derived-actions .segmented-control,
  .backup-derived-actions .backup-derived-date,
  .backup-derived-actions .secondary {
    width: 100%;
  }

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

  .backup-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-pagination > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .financials-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 12px;
  }

  .financials-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    width: 100%;
  }

  .financials-controls .financials-menu-field {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .financials-custom-field {
    min-width: 0;
  }

  .financials-menu-trigger,
  .financials-controls input[type="date"].input {
    width: 100%;
    min-width: 0;
  }

  .financials-run-custom {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .financials-basis-toggle {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .financials-basis-toggle .secondary {
    justify-content: center;
    width: 100%;
  }

  .financials-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    justify-content: stretch;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.13);
  }

  .financials-status {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .financials-freshness {
    min-width: 0;
    white-space: normal;
  }

  .financials-actions #financialsResync {
    justify-self: end;
  }

  .financials-actions #financialsBranding,
  .financials-actions #financialsDownloadPdf {
    justify-content: center;
  }

  .financials-branding-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .financials-table-wrap {
    overflow-x: visible;
  }

  .financials-report-table {
    min-width: 0;
  }

  .financials-report-table th,
  .financials-report-table td {
    padding: 9px 8px;
  }

  .financials-report-table th:first-child,
  .financials-report-table td:first-child {
    width: 64%;
    overflow-wrap: anywhere;
  }

  .financials-report-table th:not(:first-child),
  .financials-report-table td:not(:first-child) {
    width: 36%;
  }

  .financials-report-table .lvl-1 {
    padding-left: 14px;
  }

  .financials-report-table .lvl-2 {
    padding-left: 24px;
  }

  .financials-report-table .lvl-3 {
    padding-left: 34px;
  }
}

@media (max-width: 1120px) {
  .rules-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rules-form .rules-name-field,
  .rules-form .rules-category-field {
    grid-column: span 2;
  }

  .rules-toolstrip {
    grid-template-columns: 1fr;
  }

  .rules-command-actions {
    justify-content: flex-end;
  }

  .rules-platform-row {
    grid-template-columns: 32px minmax(160px, 1fr) minmax(190px, 1.2fr) minmax(160px, 1fr) 82px;
  }

  .rules-platform-row-head > :nth-child(5),
  .rules-platform-row-head > :nth-child(6) {
    display: none;
  }

  .rules-state-cell,
  .rules-history-cell {
    grid-column: 3 / 5;
    justify-self: start;
    text-align: left;
  }

  .rules-state-cell {
    justify-content: flex-start;
  }

  .rules-history-cell {
    text-align: left;
  }
}

@media (max-width: 920px) {
  .rules-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-form .rules-name-field,
  .rules-form .rules-category-field,
  .rules-toggle,
  .rules-form-actions {
    grid-column: 1 / -1;
  }

  .rules-toolstrip {
    grid-template-columns: 1fr;
  }

  .rules-filter-group {
    grid-template-columns: repeat(5, minmax(0, auto));
  }

  .rules-filter-group .search {
    grid-column: 1 / -1;
  }
}

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

  .rules-platform-row {
    grid-template-columns: 32px 1fr;
    column-gap: 10px;
    padding: 10px;
  }

  .rules-platform-row-head {
    display: none;
  }

  .rules-select-cell {
    grid-column: 1;
    align-self: start;
    padding-top: 2px;
  }

  .rules-name-cell,
  .rules-match-cell,
  .rules-category-cell,
  .rules-state-cell,
  .rules-history-cell,
  .rules-row-actions {
    grid-column: 2;
  }

  .rules-row-actions {
    justify-content: flex-start;
    justify-self: start;
    width: 100%;
  }

  .rules-toolstrip {
    grid-template-columns: 1fr;
  }

  .rules-filter-group {
    grid-template-columns: 1fr;
  }

  .rules-command-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .rules-command-actions button,
  .rules-filter-group button,
  .rules-form-actions button,
  .rules-conflict-actions button,
  .rules-conflict-actions .button-link {
    justify-content: center;
    width: 100%;
  }

  .rules-row-actions button,
  .rules-row-actions .button-link {
    justify-content: center;
    min-width: 96px;
  }

  .rules-conflict-actions,
  .rules-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rules-editor-modal .rules-form {
    grid-template-columns: 1fr;
  }

  .rules-editor-modal .rules-name-field,
  .rules-editor-modal .rules-category-field {
    grid-column: 1;
  }

  .logs-event,
  .logs-event summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .logs-event-time,
  .logs-event-badges {
    grid-column: 2;
    justify-content: flex-start;
  }

  .logs-day-summary {
    align-items: flex-start;
  }

  .logs-day-toolbar,
  .logs-load-older {
    align-items: flex-start;
    flex-direction: column;
  }

  .logs-event-detail {
    margin-left: 42px;
  }
}

.row-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

.row-menu summary {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  list-style: none;
}

.api-row-menu summary {
  width: auto;
  min-width: 96px;
  gap: 7px;
  padding: 0 11px;
  font-weight: 800;
}

.api-row-menu summary span {
  font-size: 12px;
}

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

.row-menu summary svg {
  width: 18px;
  height: 18px;
}

.row-menu[open] summary {
  border-color: rgba(201, 168, 76, 0.7);
  background: rgba(201, 168, 76, 0.14);
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 180px;
  padding: 6px;
  border: 1px solid rgba(201, 168, 76, 0.32);
  border-radius: 8px;
  background: #101a25;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-menu[open] .row-menu-panel {
  position: fixed;
  top: var(--row-menu-fixed-top, calc(100% + 6px));
  right: auto;
  left: var(--row-menu-fixed-left, auto);
  width: var(--row-menu-fixed-width, auto);
  z-index: 120;
}

.row-menu[open].drop-up .row-menu-panel {
  top: auto;
  bottom: var(--row-menu-fixed-bottom, calc(100% + 6px));
}

.api-menu-panel {
  min-width: 220px;
  right: 0;
}

.row-menu-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: var(--text);
  padding: 7px 8px;
  white-space: normal;
  text-align: left;
}

.row-menu-panel a.row-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.row-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.row-menu-item.danger {
  color: #ffd0cc;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(201, 168, 76, 0.32);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

@media (max-width: 980px) {
  .clients-first-run {
    min-height: auto;
    align-content: start;
  }

  .clients-first-run-main,
  .clients-learning-row {
    grid-template-columns: 1fr;
  }

  .clients-first-run-copy {
    max-width: none;
  }
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  body.nav-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  body.tablet-nav-open {
    overflow: hidden;
  }

  body.tablet-nav-open::after {
    content: "";
    position: fixed;
    z-index: 24;
    inset: 58px 0 0;
    background: rgba(5, 9, 14, 0.66);
  }

  body.app-loading::before,
  body.nav-collapsed.app-loading::before {
    left: 0;
  }

  .app-loading-status,
  body.nav-collapsed .app-loading-status {
    left: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 58px;
    min-width: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background:
      linear-gradient(180deg, rgba(15, 25, 35, 0.99), rgba(7, 12, 18, 0.99));
    box-shadow: 0 16px 38px rgba(3, 7, 12, 0.42);
    overflow: visible;
  }

  main {
    padding: 14px;
  }

  html.client-route body main,
  body.client-scoped main {
    padding-top: 10px;
  }

  .app-header {
    min-height: 42px;
    margin-bottom: 8px;
  }

  html.client-route body.client-scoped .app-header,
  body.client-scoped .app-header {
    min-height: auto;
    display: block;
    margin-bottom: 8px;
  }

  .sidebar-toggle {
    order: 2;
    flex: 0 0 38px;
    width: 38px;
    min-height: 38px;
    margin: 0 0 0 auto;
    display: inline-flex;
    border-color: rgba(201, 168, 76, 0.28);
    background: rgba(201, 168, 76, 0.08);
    color: var(--text);
  }

  body.nav-collapsed .sidebar {
    align-items: center;
    padding: 7px 12px;
  }

  .brand,
  body.nav-collapsed .brand {
    order: 1;
    flex: 0 0 auto;
    min-height: 40px;
    height: 40px;
    padding: 0;
    border-bottom: 0;
    border-right: 0;
    margin: 0;
    align-items: center;
    justify-content: flex-start;
  }

  .brand img {
    width: 118px;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
  }

  nav {
    position: absolute;
    z-index: 32;
    top: calc(100% + 6px);
    left: 10px;
    right: 10px;
    order: 3;
    min-width: 0;
    flex: 0 0 auto;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: min(520px, calc(100dvh - 76px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(201, 168, 76, 0.18);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(18, 29, 41, 0.99), rgba(7, 12, 18, 0.99));
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
    scrollbar-width: thin;
  }

  body:not(.tablet-nav-open) nav {
    display: none !important;
  }

  body.tablet-nav-open nav {
    display: grid;
  }

  nav a {
    min-height: 36px;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.025);
  }

  nav a.nav-auth-link {
    margin-top: 0;
    border-top: 0;
    border-radius: 7px;
  }

  nav a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.nav-collapsed .brand-logo-full {
    display: block !important;
  }

  body.nav-collapsed .brand-logo-mark {
    display: none !important;
  }

  body.nav-collapsed nav,
  body.nav-collapsed nav a {
    width: auto;
  }

  body.nav-collapsed .sidebar-toggle {
    width: 38px;
  }

  body.nav-collapsed nav a {
    min-height: 34px;
    justify-content: flex-start;
    padding: 7px 9px;
  }

  body.nav-collapsed nav a span,
  body.nav-collapsed .client-nav-context {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  body.nav-collapsed .client-nav-context {
    width: auto;
    display: grid;
  }

  body.nav-collapsed .client-nav-submenu {
    width: auto;
    margin: 0;
    padding: 0;
    border-left: 0;
    gap: 5px;
  }

  .client-nav-context {
    min-width: 0;
    margin: -1px 0 0 30px;
    padding: 7px 9px;
    gap: 2px;
  }

  .client-nav-context,
  .client-nav-submenu {
    grid-column: 1 / -1;
  }

  .client-nav-submenu {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    border-left: 0;
  }

  nav a.client-nav-link {
    min-height: 36px;
    padding: 7px 9px;
  }

  .client-nav-context strong {
    font-size: 12px;
  }

  #clientTable .data-table {
    overflow-x: auto;
  }

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

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

  .settings-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-actions {
    justify-content: flex-start;
  }

  .firm-settings-overview .metric-grid,
  .firm-integration-grid,
  .firm-settings-split,
  .firm-settings-control-grid,
  .firm-team-invite {
    grid-template-columns: 1fr;
  }

  .firm-integration-card h3 {
    padding-right: 0;
  }

  .firm-integration-card > .pill {
    position: static;
    justify-self: start;
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  .app-loading-card {
    min-width: 150px;
    min-height: 44px;
    padding: 0 15px;
  }

  main {
    padding: 12px max(10px, env(safe-area-inset-right)) 14px max(10px, env(safe-area-inset-left));
  }

  .sidebar {
    height: 52px;
    padding: 6px 10px;
  }

  .brand,
  body.nav-collapsed .brand {
    min-height: 38px;
    height: 38px;
    gap: 8px;
    padding-right: 0;
  }

  .brand-logo-full,
  body.nav-collapsed .brand-logo-full {
    display: none !important;
  }

  .brand-logo-mark,
  body.nav-collapsed .brand-logo-mark {
    width: 32px;
    height: 32px;
    display: block !important;
    border-radius: 7px;
  }

  .brand::after {
    content: none;
  }

  .auth-panel {
    padding: 22px;
  }

  .app-header,
  .panel-head,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  html.client-route body.client-scoped .app-header,
  body.client-scoped .app-header {
    flex-direction: row;
    align-items: stretch;
  }

  .header-actions,
  body.client-scoped .header-actions {
    align-items: stretch;
    width: 100%;
  }

  .button-link,
  button.secondary,
  .icon-button,
  nav a {
    min-height: 40px;
  }

  .client-switcher {
    width: 100%;
    min-width: 0;
  }

  .client-switcher-field {
    min-height: 44px;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .client-filter-row {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .filters.client-filter-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .client-integration-filters {
    justify-content: flex-start;
  }

  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .metric-grid.dashboard-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
  }

  .dashboard-metric-grid .metric-card {
    min-height: 68px;
    align-content: start;
    gap: 2px;
    padding: 8px 7px;
  }

  .dashboard-metric-grid .metric-card span {
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: 0.08em;
  }

  .dashboard-metric-grid .metric-card strong {
    margin-top: 1px;
    font-size: 22px;
  }

  .dashboard-metric-grid .metric-card small {
    font-size: 10px;
    line-height: 1.2;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 12px;
    line-height: 1.38;
  }

  main {
    padding-top: 10px;
  }

  html.client-route body main,
  body.client-scoped main {
    padding-top: 8px;
  }

  .sidebar {
    gap: 8px;
    height: 48px;
    padding: 5px max(8px, env(safe-area-inset-right)) 5px max(8px, env(safe-area-inset-left));
  }

  body.tablet-nav-open::after {
    inset: 48px 0 0;
  }

  .brand,
  body.nav-collapsed .brand {
    min-height: 36px;
    height: 36px;
    padding-right: 0;
  }

  .brand-logo-mark,
  body.nav-collapsed .brand-logo-mark {
    width: 30px;
    height: 30px;
  }

  .brand::after {
    content: none;
  }

  .sidebar-toggle {
    flex-basis: 36px;
    width: 36px;
    min-height: 36px;
  }

  nav {
    grid-template-columns: 1fr;
    top: calc(100% + 5px);
    left: 8px;
    right: 8px;
    max-height: min(560px, calc(100dvh - 60px));
    padding: 7px;
  }

  .client-nav-context {
    margin: 0;
  }

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

  .filters.client-filter-row {
    grid-template-columns: 1fr;
  }

  .client-integration-filters {
    justify-content: flex-start;
    width: 100%;
  }

  .client-integration-filter {
    min-width: 0;
    width: auto;
    max-width: 100%;
  }

  nav a.client-nav-link {
    min-height: 38px;
  }

  .app-header {
    min-height: 0;
    margin-bottom: 6px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .panel {
    padding: 10px;
  }

  .app-modal-backdrop {
    align-items: stretch;
    justify-items: stretch;
    padding: 10px;
  }

  .app-modal,
  .bank-feed-ledger-modal,
  .rules-editor-modal,
  .financials-branding-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .readiness-band,
  .impersonation-banner,
  .table-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .table-pager {
    justify-content: space-between;
    width: 100%;
  }

  .table-pager span {
    min-width: 0;
  }

  .public-doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .clients-first-run {
    padding: 16px;
  }

  .clients-first-run-copy h2 {
    font-size: 25px;
  }

  .clients-first-run-actions,
  .clients-first-run-actions .button-link,
  .clients-first-run-actions button {
    width: 100%;
  }

  .clients-first-run-actions .button-link,
  .clients-first-run-actions button {
    justify-content: center;
  }

  .clients-setup-map {
    padding: 10px;
  }

  .clients-setup-map::before {
    left: 30px;
  }

  .clients-setup-step {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 76px;
    padding: 10px;
  }

  .clients-setup-step span {
    width: 38px;
    height: 38px;
  }

  .clients-learning-card {
    min-height: 92px;
  }

  #clientTable table {
    min-width: 0;
  }

  #clientTable th:nth-child(3),
  #clientTable th:nth-child(4),
  #clientTable td:nth-child(3),
  #clientTable td:nth-child(4) {
    display: none;
  }

  #clientTable th,
  #clientTable td {
    padding: 9px 7px;
  }

  #clientTable th:first-child,
  #clientTable td:first-child {
    width: auto;
  }

  #clientTable th:nth-child(2),
  #clientTable td:nth-child(2) {
    width: 116px;
  }

  #clientTable th:last-child,
  #clientTable td:last-child {
    width: 54px;
    max-width: 54px;
    padding-inline: 6px;
  }

  #clientTable .client-link {
    white-space: normal;
  }

  #clientTable .pill {
    white-space: normal;
    text-align: center;
  }
}

.pricing-body {
  display: block;
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(135deg, rgba(201, 168, 76, 0.12), transparent 30%),
    linear-gradient(180deg, #091018 0%, #0f1923 44%, #0b1119 100%);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.pricing-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 30px 20px 56px;
}

.pricing-header {
  display: grid;
  gap: 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.13), rgba(255, 255, 255, 0.015) 42%, rgba(8, 16, 24, 0.66)),
    rgba(10, 20, 31, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  padding: 20px;
}

.pricing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pricing-topbar .auth-logo {
  margin: 0;
}

.pricing-signin {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
}

.pricing-copy {
  max-width: 720px;
}

.pricing-copy h1 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: var(--fs-hero);
  line-height: 1.12;
}

.pricing-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: var(--fs-base);
}

.pricing-assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pricing-assurance span,
.billing-kicker,
.billing-current-badge,
.pricing-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.1);
  color: #ead484;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 8px;
  text-transform: uppercase;
}

.pricing-grid,
.billing-plan-grid,
.billing-metric-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-card,
.billing-plan-card {
  position: relative;
  display: flex;
  min-height: 318px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(34, 52, 68, 0.98), rgba(12, 25, 37, 0.98)),
    #102033;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  padding: 16px;
  overflow: hidden;
}

.pricing-card {
  gap: 14px;
  min-height: 520px;
}

.pricing-card::before,
.billing-plan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.1), rgba(227, 198, 110, 0.72), rgba(112, 209, 138, 0.28));
}

.pricing-card.featured,
.billing-plan-card.active {
  border-color: rgba(227, 198, 110, 0.74);
  background:
    linear-gradient(180deg, rgba(42, 61, 75, 0.98), rgba(14, 29, 43, 0.98)),
    #142638;
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(227, 198, 110, 0.2);
  transform: translateY(-4px);
}

.pricing-badge {
  position: absolute;
  top: 14px;
  right: 14px;
}

.pricing-card h2,
.billing-plan-card h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-lg);
}

.pricing-card-main {
  display: grid;
  gap: 8px;
  padding-right: 72px;
}

.pricing-card-eyebrow,
.billing-plan-topline span,
.billing-metric-strip span,
.billing-status-card span {
  margin: 0;
  color: #9eb2c4;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pricing-card strong,
.billing-plan-card strong,
.billing-metric-strip strong,
.billing-status-card strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-xl);
  line-height: 1.15;
}

.pricing-price {
  margin-top: 2px;
}

.pricing-card .pricing-price {
  font-size: 30px;
}

.pricing-card strong span {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-left: 4px;
}

.pricing-metric-stack {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pricing-metric-stack div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(3, 9, 15, 0.25);
  padding: 8px 10px;
}

.pricing-metric-stack dt {
  color: #9eb2c4;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.pricing-metric-stack dd {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 800;
  text-align: right;
}

.pricing-tier-strip {
  display: grid;
  gap: 6px;
}

.pricing-tier-strip span {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.11), rgba(112, 209, 138, 0.06));
  color: #f0dfac;
  font-size: var(--fs-xs);
  font-weight: 750;
  padding: 5px 8px;
}

.pricing-fit {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(112, 209, 138, 0.18);
  border-radius: 8px;
  background: rgba(112, 209, 138, 0.06);
  padding: 10px;
}

.pricing-fit span {
  color: #dce6ee;
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.pricing-fit p {
  margin: 0;
}

.pricing-card p,
.billing-plan-card small,
.billing-plan-card p,
.billing-metric-strip small,
.billing-status-card small,
.pricing-note-card p,
.billing-footnote span {
  color: var(--muted);
}

.billing-feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-feature-list li {
  position: relative;
}

.billing-feature-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px 10px;
  color: #dce6ee;
  font-size: var(--fs-sm);
}

.billing-feature-marker {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.11);
  border: 1px solid rgba(201, 168, 76, 0.28);
}

.billing-feature-marker::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 5px;
  border-bottom: 2px solid var(--gold-2);
  border-left: 2px solid var(--gold-2);
  transform: rotate(-45deg);
}

.billing-feature-row.feature-off {
  color: var(--muted);
}

.billing-feature-row.feature-off .billing-feature-marker {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
}

.billing-feature-row.feature-off .billing-feature-marker::before,
.billing-feature-row.feature-off .billing-feature-marker::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 4px;
  width: 8px;
  height: 2px;
  border: 0;
  background: rgba(148, 163, 184, 0.86);
  transform: rotate(45deg);
}

.billing-feature-row.feature-off .billing-feature-marker::after {
  transform: rotate(-45deg);
}

.billing-feature-copy {
  line-height: 1.35;
}

.billing-feature-pill {
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.07);
  color: #ead484;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.feature-off .billing-feature-pill {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
  color: #aeb9c4;
}

.feature-limit .billing-feature-pill,
.feature-billing .billing-feature-pill {
  border-color: rgba(111, 196, 184, 0.22);
  background: rgba(111, 196, 184, 0.08);
  color: #91ded2;
}

.feature-model .billing-feature-pill {
  border-color: rgba(232, 199, 103, 0.28);
  background: rgba(232, 199, 103, 0.1);
  color: #f4d77a;
}

.pricing-note-card,
.billing-footnote {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  background: rgba(12, 25, 37, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  padding: 12px 14px;
}

.pricing-note-card strong,
.billing-footnote strong {
  flex: 0 0 auto;
  color: var(--text);
}

.pricing-compare {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 37, 51, 0.92), rgba(9, 18, 27, 0.92)),
    rgba(12, 25, 37, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.pricing-compare h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: var(--fs-lg);
}

.pricing-compare-grid {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.pricing-compare-head,
.pricing-compare-row {
  display: grid;
  grid-template-columns: 1.05fr repeat(3, minmax(0, 1fr));
}

.pricing-compare-head {
  background: rgba(201, 168, 76, 0.12);
}

.pricing-compare-head span,
.pricing-compare-row span {
  min-height: 44px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #dce6ee;
  font-size: var(--fs-base);
  padding: 10px;
}

.pricing-compare-head span {
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.pricing-compare-row span:first-child {
  color: #f0dfac;
  font-weight: 800;
}

.pricing-compare-head span:last-child,
.pricing-compare-row span:last-child {
  border-right: 0;
}

.pricing-compare-row:last-child span {
  border-bottom: 0;
}

.billing-panel {
  display: grid;
  gap: 16px;
}

.billing-toast {
  border: 1px solid rgba(205, 174, 82, 0.36);
  border-radius: 8px;
  background: rgba(205, 174, 82, 0.12);
  color: var(--text);
  padding: 10px 12px;
}

.billing-official-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.1), transparent 38%),
    rgba(12, 25, 37, 0.74);
  padding: 16px;
}

.billing-official-header h2 {
  margin: 10px 0 7px;
  color: var(--text);
  font-size: var(--fs-xl);
}

.billing-official-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.billing-status-card,
.billing-metric-strip article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.42);
  padding: 12px;
}

.billing-status-card {
  align-content: center;
}

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

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-trial-explainer,
.billing-wall,
.billing-danger-zone {
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  background: rgba(12, 25, 37, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.billing-trial-explainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.billing-trial-explainer.attention {
  border-color: rgba(244, 201, 107, 0.42);
  background: rgba(244, 201, 107, 0.1);
}

.billing-trial-explainer strong,
.billing-danger-zone strong,
.billing-wall h2 {
  color: var(--text);
}

.billing-trial-explainer strong {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-lg);
}

.billing-trial-explainer p,
.billing-danger-zone span,
.billing-wall p,
.billing-inline-warning {
  margin: 4px 0 0;
  color: var(--muted);
}

.billing-wall {
  display: grid;
  gap: 12px;
  max-width: 720px;
  padding: 18px;
}

.billing-wall h2 {
  margin: 0;
  font-size: var(--fs-xl);
}

.billing-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-color: rgba(255, 137, 125, 0.24);
  padding: 13px 14px;
}

.billing-danger-zone span,
.billing-inline-warning {
  display: block;
  font-size: var(--fs-sm);
}

.danger-text {
  color: #ffb7ae !important;
}

.billing-plan-card.recommended {
  border-color: rgba(112, 209, 138, 0.38);
}

.billing-plan-topline {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-current-badge {
  border-color: rgba(112, 209, 138, 0.4);
  background: rgba(112, 209, 138, 0.12);
  color: #9ee7af;
  white-space: nowrap;
}

.billing-current-badge.recommended {
  border-color: rgba(201, 168, 76, 0.34);
  background: rgba(201, 168, 76, 0.1);
  color: #ead484;
}

.billing-plan-main {
  display: grid;
  gap: 8px;
}

.billing-plan-main small {
  display: block;
}

.reconciliation-page {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.reconciliation-page:has(.reconciliation-category-menu[open]) {
  padding-bottom: 360px;
}

.reconciliation-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(35, 56, 75, 0.96), rgba(18, 30, 44, 0.96));
}

.reconciliation-run-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(141, 166, 202, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.reconciliation-run-banner strong {
  color: var(--text);
}

.reconciliation-run-banner.warning {
  border-color: rgba(244, 201, 107, 0.32);
  background: rgba(244, 201, 107, 0.1);
}

.reconciliation-run-banner.success {
  border-color: rgba(112, 209, 138, 0.28);
  background: rgba(112, 209, 138, 0.1);
}

.reconciliation-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(231, 191, 83, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 12, 20, 0.28);
}

.reconciliation-summary-cards {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(240px, 1.25fr) minmax(170px, 0.85fr) minmax(210px, 1fr);
  gap: 10px;
  min-width: 0;
}

.reconciliation-summary-card {
  display: grid;
  grid-template-rows: auto minmax(34px, 1fr) auto;
  align-items: start;
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.055);
}

.reconciliation-summary-card > span,
.reconciliation-grid th span,
.reconciliation-drawer-header span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0;
}

.reconciliation-summary-value {
  display: block;
  align-self: center;
  color: var(--text);
  font-size: clamp(1.05rem, 1.1vw, 1.2rem);
  font-weight: 850;
  line-height: 1.15;
}

.reconciliation-summary-card.metric .reconciliation-summary-value {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.reconciliation-summary small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.32;
}

.reconciliation-summary-action {
  display: flex;
  align-items: stretch;
  min-width: 190px;
}

.reconciliation-summary-action > button {
  inline-size: 100%;
  min-height: 104px;
  justify-content: center;
  padding-inline: 18px;
}

.reconciliation-grid-wrap {
  inline-size: 100%;
  min-width: 0;
  max-width: 100%;
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  contain: inline-size;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 18, 28, 0.22);
  -webkit-overflow-scrolling: touch;
}

.reconciliation-grid-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.reconciliation-grid-section {
  border: 1px solid rgba(141, 166, 202, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 12, 20, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.reconciliation-grid-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reconciliation-grid-section-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.reconciliation-grid-section-header strong {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.reconciliation-grid-section-header span {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.statement-audit-section {
  background: rgba(9, 18, 28, 0.42);
}

.statement-audit-month {
  display: grid;
  gap: 8px;
}

.statement-audit-month-label {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.statement-audit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.statement-audit-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.statement-audit-table th,
.statement-audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: var(--fs-xs);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.statement-audit-table th {
  color: var(--text);
  background: rgba(7, 12, 20, 0.55);
}

.statement-audit-table td:first-child strong,
.statement-audit-detail-summary strong {
  display: block;
  color: var(--text);
}

.statement-audit-table td:first-child span,
.statement-audit-detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.statement-audit-table th:nth-child(2),
.statement-audit-table td:nth-child(2),
.statement-audit-table th:nth-child(3),
.statement-audit-table td:nth-child(3) {
  width: 118px;
}

.statement-audit-table th:last-child,
.statement-audit-table td:last-child {
  width: 104px;
  text-align: right;
}

.statement-audit-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.statement-audit-outcome {
  border: 1px solid rgba(226, 194, 123, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(112, 209, 138, 0.12), rgba(226, 194, 123, 0.06));
}

.statement-audit-outcome > div {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.statement-audit-outcome .pill {
  justify-self: center;
  min-width: 112px;
}

.statement-audit-outcome strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
}

.statement-audit-outcome span:not(.pill) {
  max-width: 760px;
  color: #c3ceda;
  font-size: 13px;
  line-height: 1.45;
}

.statement-audit-detail-summary > div {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.statement-audit-failure-panel {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 99, 99, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 99, 99, 0.11);
}

.statement-audit-failure-panel strong {
  color: #ffb0a8;
  font-size: var(--fs-xs);
}

.statement-audit-failure-panel span {
  color: var(--text);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.statement-audit-exception-table {
  min-width: 920px;
}

.statement-audit-exception-table th:first-child,
.statement-audit-exception-table td:first-child {
  width: 210px;
}

.statement-audit-exception-table th,
.statement-audit-exception-table td {
  width: auto;
}

.statement-audit-aligned-table {
  display: none;
}

.statement-audit-aligned-table th,
.statement-audit-aligned-table td {
  width: 33.333% !important;
}

.statement-audit-aligned-table th {
  padding: 14px 18px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.statement-audit-aligned-table td {
  padding: 17px 18px;
  vertical-align: top;
}

.statement-audit-aligned-table .reconciliation-review-cell {
  gap: 8px;
}

.statement-audit-aligned-table .reconciliation-review-meta {
  gap: 10px;
}

.statement-audit-aligned-table .reconciliation-review-date,
.statement-audit-aligned-table .reconciliation-review-amount {
  font-size: 13px;
  line-height: 1.25;
}

.statement-audit-aligned-table .reconciliation-review-description {
  color: #c0cad6;
  font-size: 12px;
  line-height: 1.4;
}

.statement-audit-aligned-table .muted {
  display: block;
  min-height: 22px;
  color: rgba(143, 163, 184, 0.5);
  font-size: 13px;
}

.statement-audit-proof-list {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(143, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.22);
}

.statement-audit-proof-line {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  gap: 14px;
  align-items: stretch;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(143, 163, 184, 0.12);
}

.statement-audit-proof-line:last-child {
  border-bottom: 0;
}

.statement-audit-proof-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.statement-audit-proof-primary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.statement-audit-proof-primary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.statement-audit-proof-primary strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.statement-audit-proof-amount {
  justify-self: end;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.statement-audit-proof-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.statement-audit-proof-source {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 9px;
  border: 1px solid rgba(143, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(9, 16, 24, 0.34);
}

.statement-audit-proof-source.present {
  border-color: rgba(112, 209, 138, 0.22);
  background: rgba(112, 209, 138, 0.055);
}

.statement-audit-proof-source.missing {
  border-style: dashed;
}

.statement-audit-proof-source.unavailable {
  border-color: rgba(143, 163, 184, 0.1);
  background: rgba(9, 16, 24, 0.2);
}

.statement-audit-proof-source span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statement-audit-proof-source strong {
  color: var(--body);
  font-size: 12px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.statement-audit-proof-source small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-audit-register-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.reconciliation-mobile-cards {
  display: none;
  gap: 10px;
}

.reconciliation-mobile-account {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.reconciliation-mobile-account-header {
  display: grid;
  gap: 2px;
}

.reconciliation-mobile-account-header strong {
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.25;
}

.reconciliation-mobile-account-header span {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.reconciliation-mobile-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.reconciliation-mobile-day {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
}

button.reconciliation-mobile-day {
  cursor: pointer;
}

.reconciliation-mobile-day span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.reconciliation-mobile-day strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.reconciliation-mobile-day.balanced strong {
  color: rgba(112, 209, 138, 0.9);
}

.reconciliation-mobile-day.posted_pending {
  border-color: rgba(112, 209, 138, 0.28);
  background: rgba(112, 209, 138, 0.1);
}

.reconciliation-mobile-day.posted_pending strong {
  color: rgba(133, 229, 161, 0.96);
}

.reconciliation-mobile-day.discrepancies {
  border-color: rgba(255, 137, 125, 0.34);
  background: rgba(255, 137, 125, 0.12);
}

.reconciliation-mobile-day.discrepancies strong {
  color: #ffb7ae;
}

.reconciliation-mobile-day.stale_skipped {
  border-color: rgba(244, 201, 107, 0.36);
  background: rgba(244, 201, 107, 0.12);
}

.reconciliation-mobile-day.empty {
  opacity: 0.42;
}

.reconciliation-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.reconciliation-grid th,
.reconciliation-grid td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 5px;
  text-align: center;
}

.reconciliation-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
}

.reconciliation-grid thead th:first-child {
  left: 0;
  z-index: 4;
  width: 210px;
  text-align: left;
}

.reconciliation-grid tbody th {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 210px;
  background: var(--panel);
  text-align: left;
  vertical-align: middle;
}

.reconciliation-grid tbody th strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-sm);
}

.reconciliation-cell {
  display: inline-grid;
  width: 54px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

button.reconciliation-cell {
  cursor: pointer;
}

.reconciliation-cell.balanced {
  border-color: rgba(112, 209, 138, 0.24);
  background: rgba(112, 209, 138, 0.09);
  color: rgba(133, 229, 161, 0.96);
}

.reconciliation-cell.posted_pending {
  border-color: rgba(112, 209, 138, 0.3);
  background: rgba(112, 209, 138, 0.11);
  color: rgba(133, 229, 161, 0.98);
}

.reconciliation-cell.discrepancies {
  border-color: rgba(255, 137, 125, 0.34);
  background: rgba(255, 137, 125, 0.12);
  color: #ffb7ae;
}

.reconciliation-cell.unverified {
  border-color: rgba(244, 201, 107, 0.3);
  background: rgba(244, 201, 107, 0.08);
  color: #e3cd8d;
}

.reconciliation-cell.failed {
  border-color: rgba(255, 137, 125, 0.4);
  background: rgba(255, 137, 125, 0.08);
  color: #ff9d92;
}

.reconciliation-cell.stale_skipped {
  border-color: rgba(244, 201, 107, 0.36);
  background: rgba(244, 201, 107, 0.12);
  color: #ead484;
}

.reconciliation-cell.no_data {
  color: var(--muted);
}

.reconciliation-cell.empty {
  opacity: 0.35;
}

.reconciliation-match-proof {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.reconciliation-match-proof > strong {
  color: var(--text);
  font-size: var(--fs-sm);
}

.reconciliation-match-proof table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reconciliation-match-proof th,
.reconciliation-match-proof td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: var(--fs-xs);
  text-align: left;
  vertical-align: top;
}

.reconciliation-match-proof th {
  color: var(--text);
}

.reconciliation-review-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.reconciliation-review-table-wrap:has(.reconciliation-category-menu[open]) {
  overflow: visible;
}

.reconciliation-review-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.reconciliation-review-table th,
.reconciliation-review-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: var(--fs-xs);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.reconciliation-review-table th {
  color: var(--text);
  background: rgba(7, 12, 20, 0.58);
}

.reconciliation-review-table th:first-child,
.reconciliation-review-table td:first-child {
  width: 132px;
}

.reconciliation-review-table th:nth-child(2),
.reconciliation-review-table td:nth-child(2) {
  width: auto;
}

.reconciliation-review-table th:nth-child(3),
.reconciliation-review-table td:nth-child(3) {
  width: 380px;
}

.reconciliation-review-cell {
  display: grid;
  gap: 6px;
}

.reconciliation-review-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.reconciliation-review-amount,
.reconciliation-review-date {
  display: inline-block;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.reconciliation-review-description {
  color: #aeb9c8;
  font-weight: 700;
  line-height: 1.35;
}

.reconciliation-review-reason {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.reconciliation-review-table .muted {
  color: var(--muted);
}

.reconciliation-posting-action {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 112px;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.reconciliation-posting-category {
  min-width: 0;
}

.reconciliation-category-menu[open] {
  z-index: 60;
}

.reconciliation-posting-action .bank-feed-category-trigger {
  width: 100%;
  min-height: 46px;
  border-color: rgba(201, 168, 76, 0.38);
  background: rgba(7, 12, 20, 0.72);
}

.reconciliation-posting-action .bank-feed-category-panel {
  min-width: min(320px, calc(100vw - 48px));
  max-height: min(360px, calc(100vh - 140px));
}

.reconciliation-posting-action .reconciliation-post-button {
  min-height: 46px;
  justify-content: center;
}

.reconciliation-posting-action .danger-text,
.reconciliation-posting-action .muted {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.35;
}

.reconciliation-register-details {
  display: grid;
  gap: 10px;
}

.reconciliation-register-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.reconciliation-register-details[open] summary {
  margin-bottom: 10px;
}

.reconciliation-register-proof {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reconciliation-register-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.reconciliation-register-column > strong {
  color: var(--text);
  font-size: var(--fs-sm);
}

.reconciliation-register-column table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reconciliation-register-column th,
.reconciliation-register-column td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: var(--fs-xs);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.reconciliation-register-column th {
  color: var(--text);
}

.reconciliation-register-column th:nth-child(1),
.reconciliation-register-column td:nth-child(1) {
  width: 88px;
}

.reconciliation-register-column th:nth-child(2),
.reconciliation-register-column td:nth-child(2) {
  width: 86px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reconciliation-drawer {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.reconciliation-drawer-header,
.reconciliation-drawer-counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reconciliation-drawer-header strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-lg);
}

.reconciliation-drawer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reconciliation-discrepancy-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reconciliation-discrepancy-list li {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.reconciliation-discrepancy-list p {
  margin: 0;
  color: var(--text);
}

.reconciliation-discrepancy-list dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.reconciliation-discrepancy-list div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
}

.reconciliation-discrepancy-list dt {
  color: var(--muted);
}

.reconciliation-discrepancy-list dd {
  margin: 0;
}

@media (max-width: 900px) {
  .pricing-copy h1 {
    font-size: var(--fs-hero);
  }

  .pricing-grid,
  .billing-plan-grid,
  .billing-metric-strip,
  .billing-official-header {
    grid-template-columns: 1fr;
  }

  .pricing-note-card,
  .billing-footnote,
  .billing-trial-explainer,
  .billing-danger-zone,
  .reconciliation-summary,
  .statement-audit-detail-summary,
  .statement-audit-register-proof {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .reconciliation-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    inline-size: 100%;
  }

  .reconciliation-summary-action {
    inline-size: 100%;
    min-width: 0;
  }

  .reconciliation-summary-action > button {
    min-height: 48px;
  }

  .pricing-card {
    min-height: 0;
  }

  .pricing-card.featured {
    transform: none;
  }

  .pricing-compare-grid {
    overflow-x: auto;
  }

  .pricing-compare-head,
  .pricing-compare-row {
    min-width: 720px;
  }
}

@media (max-width: 520px) {
  .reconciliation-summary-cards {
    grid-template-columns: 1fr;
  }

  .reconciliation-summary-card {
    min-height: 96px;
  }

  .pricing-shell {
    padding: 18px 12px 36px;
  }

  .billing-feature-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .billing-feature-pill {
    grid-column: 2;
    justify-self: start;
  }

  .pricing-header,
  .pricing-card,
  .pricing-compare {
    padding: 14px;
  }

  .pricing-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-card-main {
    padding-right: 0;
  }

  .pricing-badge {
    position: static;
    justify-self: start;
    order: -1;
  }

  .pricing-metric-stack div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pricing-metric-stack dd {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .reconciliation-grid-section > .reconciliation-grid-wrap {
    display: none;
  }

  .reconciliation-mobile-cards {
    display: grid;
  }

  .reconciliation-grid-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .reconciliation-review-table {
    min-width: 0;
  }

  .reconciliation-review-table,
  .reconciliation-review-table thead,
  .reconciliation-review-table tbody,
  .reconciliation-review-table tr,
  .reconciliation-review-table th,
  .reconciliation-review-table td {
    display: block;
  }

  .reconciliation-review-table thead {
    display: none;
  }

  .reconciliation-review-table tr {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .reconciliation-review-table td {
    display: grid;
    gap: 4px;
    width: auto !important;
    padding: 0;
    border-bottom: 0;
  }

  .reconciliation-review-table td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .reconciliation-review-table td:nth-child(1)::before {
    content: "Status";
  }

  .reconciliation-review-table td:nth-child(2)::before {
    content: "Transaction";
  }

  .reconciliation-review-table td:nth-child(3)::before {
    content: "Category / Post";
  }

  .statement-audit-aligned-table td:nth-child(1)::before {
    content: "Statement";
  }

  .statement-audit-aligned-table td:nth-child(2)::before {
    content: "Bank feed";
  }

  .statement-audit-aligned-table td:nth-child(3)::before {
    content: "QBO register";
  }

  .statement-audit-aligned-table {
    display: none;
  }

  .statement-audit-proof-line {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom-color: rgba(143, 163, 184, 0.12);
  }

  .statement-audit-proof-list {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .statement-audit-proof-primary strong,
  .statement-audit-proof-amount {
    font-size: 14px;
  }

  .reconciliation-posting-action {
    grid-template-columns: 1fr;
  }

  .reconciliation-posting-action .reconciliation-post-button {
    width: 100%;
  }
}

.agent-tools-shell {
  display: grid;
  gap: 14px;
}

.agent-console-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
}

.agent-console-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agent-console-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 0;
  border: 0;
  border-radius: 999px;
  color: var(--gold-2);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-console-badge .app-icon {
  width: 14px;
  height: 14px;
}

.agent-console-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.12;
}

.agent-console-copy p {
  max-width: 780px;
  margin: 0;
  color: #c8d5df;
  font-size: 0.95rem;
  line-height: 1.45;
}

.agent-summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 7px;
}

.agent-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--body);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
}

.agent-summary-item .app-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-2);
}

.agent-summary-item > span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.agent-summary-item strong {
  color: var(--text);
}

.agent-console-status {
  display: grid;
  align-content: stretch;
  gap: 10px;
}

.agent-grant-metric {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.28);
}

.agent-grant-metric > .app-icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.12);
}

.agent-grant-metric span,
.agent-install-card-header span,
.agent-category-card p {
  color: var(--muted);
}

.agent-grant-metric strong {
  display: block;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
}

.agent-grant-metric.good > .app-icon {
  color: var(--green);
  background: rgba(112, 209, 138, 0.12);
}

.agent-grant-metric.attention > .app-icon {
  color: var(--amber);
  background: rgba(244, 201, 107, 0.14);
}

.agent-grant-metric.danger > .app-icon {
  color: var(--red);
  background: rgba(255, 137, 125, 0.12);
}

.agent-setup-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.78), rgba(13, 22, 32, 0.82));
}

.agent-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.agent-section-heading h2 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 1.05rem;
}

.agent-section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.agent-setup-list {
  display: grid;
  gap: 8px;
}

.agent-setup-row {
  display: grid;
  grid-template-columns: 34px minmax(190px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.16);
}

.agent-setup-row-primary {
  border-color: rgba(201, 168, 76, 0.2);
  background: rgba(201, 168, 76, 0.055);
}

.agent-setup-row > img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.agent-setup-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-setup-copy > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-setup-copy strong {
  color: var(--text);
  font-size: 0.95rem;
}

.agent-setup-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.agent-setup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-setup-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--body);
  background: rgba(5, 10, 16, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
}

.agent-setup-tags .app-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-2);
}

.agent-setup-row code {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  overflow-wrap: anywhere;
  color: #dce5eb;
  background: rgba(5, 10, 16, 0.22);
  font-size: 0.8rem;
  line-height: 1.35;
}

.agent-install-grid,
.agent-tools-layout,
.agent-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-install-card,
.agent-category-card,
.agent-grant-lane {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 47, 64, 0.92), rgba(18, 30, 43, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.agent-install-card {
  position: relative;
  overflow: hidden;
}

.agent-install-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold-2);
}

.agent-install-card.codex::before {
  background: #9ee8ff;
}

.agent-install-card.claude::before {
  background: #d8a05f;
}

.agent-install-card-header {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-install-card-header img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.agent-install-card-header strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.agent-install-card-header span,
.agent-grant-metric span {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-install-card code {
  display: block;
  min-height: 66px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow-wrap: anywhere;
  color: var(--text);
  background: rgba(5, 10, 16, 0.26);
  font-size: 0.82rem;
  line-height: 1.45;
}

.agent-install-card p {
  margin: 0;
  color: var(--muted);
}

.agent-category-card {
  grid-template-columns: 42px 1fr;
  align-items: start;
}

.agent-category-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.08);
}

.agent-category-icon .app-icon {
  width: 17px;
  height: 17px;
}

.agent-category-card strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 1rem;
}

.agent-category-card p {
  margin: 0 0 10px;
}

.agent-tool-catalog {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.agent-tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.14);
}

.agent-tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.agent-tool-tab:hover,
.agent-tool-tab.active {
  border-color: rgba(201, 168, 76, 0.24);
  color: var(--text);
  background: rgba(201, 168, 76, 0.08);
}

.agent-tool-tab .app-icon {
  width: 15px;
  height: 15px;
  color: var(--gold-2);
}

.agent-tool-tab strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.1);
  font-size: 0.74rem;
}

.agent-tool-tabpanels {
  display: grid;
}

.agent-tool-category-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 35, 50, 0.86), rgba(13, 22, 32, 0.9));
}

.agent-tool-category-panel[hidden] {
  display: none;
}

.agent-tool-list {
  display: grid;
  gap: 8px;
}

.agent-tool-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.4fr) minmax(0, 0.6fr);
  gap: 12px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.14);
}

.agent-tool-row strong,
.agent-tool-row code {
  display: block;
}

.agent-tool-row strong {
  color: var(--text);
  font-size: 0.92rem;
}

.agent-tool-row code {
  margin-top: 3px;
  color: var(--gold-2);
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.agent-tool-row p {
  margin: 0;
  color: #c8d5df;
}

.agent-grant-lane {
  align-content: start;
  min-height: 220px;
}

.agent-lane-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-lane-heading span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.1);
}

.agent-lane-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.agent-empty-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  border: 1px dashed rgba(201, 168, 76, 0.28);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.agent-empty-state .app-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: rgba(227, 198, 110, 0.72);
}

.agent-run-viewer {
  display: grid;
  gap: 14px;
}

.agent-run-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 47, 64, 0.9), rgba(12, 21, 31, 0.94));
}

.agent-run-command-bar h2 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 1.15rem;
}

.agent-run-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.agent-run-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(201, 168, 76, 0.24);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-run-status .app-icon {
  width: 14px;
  height: 14px;
}

.agent-run-status.running .app-icon {
  animation: spin 1s linear infinite;
}

.agent-run-status.complete {
  border-color: rgba(112, 209, 138, 0.32);
  color: var(--green);
  background: rgba(112, 209, 138, 0.1);
}

.agent-run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 14px;
}

.agent-run-main,
.agent-run-side-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 47, 64, 0.94), rgba(15, 26, 38, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.agent-run-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
}

.agent-run-report-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.agent-run-report-header span,
.agent-run-stage span,
.agent-run-side-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-run-report-header h3 {
  margin: 2px 0;
  color: var(--text);
  font-size: 1.45rem;
}

.agent-run-report-header p {
  margin: 0;
  color: #c8d5df;
}

.agent-run-stage {
  min-width: 140px;
  padding: 10px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.18);
  text-align: right;
}

.agent-run-stage strong {
  display: block;
  margin-top: 2px;
  color: var(--gold-2);
  font-size: 1rem;
}

.agent-run-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-run-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.18);
}

.agent-run-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-run-metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.05;
}

.agent-run-metric.strong {
  border-color: rgba(112, 209, 138, 0.34);
  background: rgba(112, 209, 138, 0.09);
}

.agent-run-metric.warn strong {
  color: var(--amber);
}

.agent-run-report-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
}

.agent-run-report-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.agent-run-report-table th,
.agent-run-report-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  text-align: left;
}

.agent-run-report-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.agent-run-report-table tr:last-child td {
  border-bottom: 0;
}

.agent-run-report-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.agent-run-report-table .positive {
  color: var(--green);
}

.agent-run-report-table .negative {
  color: var(--amber);
}

.agent-run-empty-table {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.agent-run-empty-table .app-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  color: rgba(227, 198, 110, 0.72);
}

.agent-run-empty-table strong {
  color: var(--text);
}

.agent-run-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.agent-run-side-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.agent-run-side-heading {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.agent-run-side-heading > .app-icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(201, 168, 76, 0.1);
}

.agent-run-side-heading strong {
  display: block;
  color: var(--text);
}

.agent-run-side-card code {
  display: block;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow-wrap: anywhere;
  color: #c8d5df;
  background: rgba(5, 10, 16, 0.24);
}

.agent-run-timeline-list {
  display: grid;
  gap: 8px;
}

.agent-run-timeline-item {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-left: 3px solid var(--gold-2);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.18);
}

.agent-run-timeline-item.success {
  border-left-color: var(--green);
}

.agent-run-timeline-item span,
.agent-run-timeline-empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.agent-run-timeline-item strong {
  color: #d9e1e7;
  font-size: 0.86rem;
}

.agent-grants-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.agent-grants-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.agent-grants-table th,
.agent-grants-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.agent-grants-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.agent-grants-table td strong,
.agent-grants-table td small {
  display: block;
}

.agent-grants-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.mini-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
}

.agent-grant-status.pending {
  color: #f5c56d;
}

.agent-grant-status.approved {
  color: #8fd3ad;
}

.agent-grant-status.revoked {
  color: #ee9b9b;
}

@media (max-width: 780px) {
  .agent-console-hero,
  .agent-install-grid,
  .agent-tools-layout,
  .agent-category-grid,
  .agent-run-grid,
  .agent-run-metrics,
  .agent-setup-row,
  .agent-tool-row {
    grid-template-columns: 1fr;
  }

  .agent-console-hero,
  .agent-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-summary-strip {
    justify-content: start;
  }

  .agent-plugin-spot {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .agent-plugin-actions {
    justify-content: stretch;
  }

  .agent-plugin-actions > button {
    flex: 1 1 180px;
  }

  .agent-run-command-bar,
  .agent-run-report-header {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-run-stage {
    text-align: left;
  }

  .agent-console-copy h2 {
    font-size: 1.4rem;
  }

  .agent-section-heading p {
    text-align: left;
  }

  .agent-setup-row > button {
    width: 100%;
    justify-content: center;
  }
}

body.admin-shell {
  --bg: #111417;
  --bg-deep: #090c0f;
  --panel: #171d21;
  --panel-2: #1d262b;
  --panel-3: #243137;
  --gold: #55c7bf;
  --gold-2: #8ee7df;
  --text: #edf7f6;
  --body: #d2dcdf;
  --muted: #8ba0a5;
  --line: rgba(85, 199, 191, 0.25);
  grid-template-columns: 226px minmax(0, 1fr);
  background: linear-gradient(180deg, #111417 0%, #10171a 48%, #090c0f 100%);
}

body.admin-shell.nav-collapsed {
  grid-template-columns: 226px minmax(0, 1fr);
}

body.admin-shell main {
  padding: 12px 16px 18px;
}

body.admin-shell .app-header {
  min-height: 36px;
  margin-bottom: 8px;
}

body.admin-shell .sidebar-toggle {
  display: none;
}

body.admin-shell .sidebar {
  background: linear-gradient(180deg, rgba(85, 199, 191, 0.08), transparent 30%), linear-gradient(180deg, #111719 0%, #0b0f12 100%);
  border-right-color: rgba(85, 199, 191, 0.22);
}

body.admin-shell .brand {
  position: relative;
  min-height: 64px;
  border-bottom-color: rgba(85, 199, 191, 0.26);
}

body.admin-shell .brand::after {
  content: "Admin";
  position: absolute;
  right: 10px;
  bottom: 7px;
  padding: 2px 6px;
  border: 1px solid rgba(85, 199, 191, 0.34);
  border-radius: 999px;
  background: rgba(85, 199, 191, 0.12);
  color: #8ee7df;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.admin-shell.nav-collapsed .brand::after {
  display: block;
}

body.admin-shell.nav-collapsed .brand-logo-full {
  width: 126px;
  display: block !important;
}

body.admin-shell.nav-collapsed .brand-logo-mark {
  display: none !important;
}

body.admin-shell.nav-collapsed nav,
body.admin-shell.nav-collapsed nav a,
body.admin-shell.nav-collapsed nav button,
body.admin-shell.nav-collapsed .sidebar-toggle {
  width: 100%;
}

body.admin-shell.nav-collapsed nav a,
body.admin-shell.nav-collapsed nav button {
  min-height: 38px;
  justify-content: flex-start;
  padding: 7px 9px;
}

body.admin-shell.nav-collapsed nav a span,
body.admin-shell.nav-collapsed nav button span,
body.admin-shell.nav-collapsed nav a .nav-count-badge {
  display: inline-flex;
}

.admin-nav-context {
  display: grid;
  gap: 2px;
  padding: 8px 9px 10px;
  border-bottom: 1px solid rgba(85, 199, 191, 0.12);
  margin-bottom: 2px;
}

.admin-nav-context span {
  color: #8ee7df;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav-context strong {
  color: var(--text);
  font-size: 14px;
}

body.admin-shell nav a.active {
  background: linear-gradient(180deg, rgba(85, 199, 191, 0.16), rgba(25, 42, 45, 0.78));
  box-shadow: inset 3px 0 0 rgba(142, 231, 223, 0.92), inset 0 0 0 1px rgba(85, 199, 191, 0.22);
}

body.admin-shell nav a.active svg,
body.admin-shell nav a.active .app-icon {
  color: #8ee7df;
}

.admin-nav-action {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border-radius: 7px;
  padding: 7px 9px;
  font-weight: 720;
}

.admin-nav-action svg,
.admin-nav-action .app-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

body.admin-shell button,
body.admin-shell .button-link {
  border-color: rgba(85, 199, 191, 0.44);
  background: #55c7bf;
  color: #061012;
}

body.admin-shell button:hover,
body.admin-shell .button-link:hover {
  background: #8ee7df;
  border-color: rgba(142, 231, 223, 0.72);
}

body.admin-shell button.secondary,
body.admin-shell .secondary {
  background: rgba(85, 199, 191, 0.08);
  border-color: rgba(85, 199, 191, 0.25);
  color: var(--body);
}

body.admin-shell button.secondary:hover,
body.admin-shell .secondary:hover {
  background: rgba(85, 199, 191, 0.14);
  color: var(--text);
}

body.admin-shell .admin-nav-action {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

body.admin-shell .admin-nav-action:hover {
  border-color: rgba(85, 199, 191, 0.12);
  background: rgba(85, 199, 191, 0.07);
  color: var(--text);
}

body.ghost-active .impersonation-banner,
.impersonation-banner {
  border-bottom-color: rgba(85, 199, 191, 0.42);
  background: linear-gradient(90deg, rgba(11, 38, 40, 0.98), rgba(29, 38, 43, 0.98));
}

.impersonation-banner strong,
.impersonation-banner .app-icon {
  color: #8ee7df;
}

.impersonation-banner .app-icon {
  width: 15px;
  height: 15px;
}

.admin-console {
  display: grid;
  gap: 12px;
  min-height: calc(100vh - 56px);
  align-items: start;
}

.admin-panel,
.admin-drawer {
  border: 1px solid rgba(85, 199, 191, 0.16);
  border-radius: 8px;
  background: rgba(17, 23, 26, 0.86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.admin-table-row strong,
.admin-drawer > header strong,
.admin-drawer-list strong,
.admin-audit-list strong {
  color: var(--text);
}

.admin-table-row span,
.admin-drawer-grid span,
.admin-drawer-list span,
.admin-audit-list span,
.admin-empty,
.admin-drawer-empty {
  color: var(--muted);
  font-size: 11px;
}

.admin-main,
.admin-drawer-list,
.admin-audit-list {
  min-width: 0;
  display: grid;
}

.admin-main {
  gap: 10px;
  align-content: start;
}

.admin-panel-head span,
.admin-drawer-list h3 {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-panel {
  overflow: hidden;
}

.admin-panel + .admin-panel {
  margin-top: 10px;
}

.admin-panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-panel-head > div:first-child {
  display: grid;
  gap: 1px;
}

.admin-panel-head strong {
  color: var(--text);
  font-size: 13px;
}

.admin-filters,
.admin-row-actions,
.admin-drawer-actions,
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-drawer-actions a {
  text-decoration: none;
}

.admin-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-search-field {
  min-width: min(340px, 42vw);
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(85, 199, 191, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 16, 18, 0.84), rgba(5, 9, 10, 0.84));
  padding: 0 7px 0 9px;
}

.admin-search-field:focus-within {
  border-color: rgba(142, 231, 223, 0.58);
  box-shadow: 0 0 0 3px rgba(85, 199, 191, 0.08);
}

.admin-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.admin-search-icon svg {
  width: 15px;
  height: 15px;
  color: #8ee7df;
}

.admin-search-field input {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--body);
  padding: 0;
  outline: none;
}

.admin-search-field input::placeholder {
  color: var(--muted);
}

.admin-search-field input::-webkit-search-decoration,
.admin-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.admin-search-clear {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 6px;
  flex: 0 0 22px;
}

.admin-search-clear svg {
  width: 13px;
  height: 13px;
}

.admin-search-clear:not([hidden]) + .admin-search-icon {
  display: none;
}

.admin-filters > input,
.admin-filters select {
  min-height: 30px;
  border: 1px solid rgba(85, 199, 191, 0.2);
  border-radius: 7px;
  background: rgba(7, 12, 14, 0.72);
  color: var(--body);
  padding: 5px 8px;
}

.admin-filters .admin-search-field input {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.admin-table {
  display: grid;
  overflow-x: auto;
}

.admin-table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(150px, 0.9fr) 96px 110px 84px 86px 120px 118px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 980px;
}

.admin-table-row > div,
.admin-drawer > header div,
.admin-drawer-list article > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-table-row > span {
  min-width: 0;
}

.admin-cell-text {
  justify-items: start;
  text-align: left;
}

.admin-cell-center {
  justify-items: center;
  text-align: center;
}

.admin-cell-center .pill {
  min-width: 88px;
  justify-content: center;
}

.admin-table-head {
  min-height: 30px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-row-actions,
.admin-drawer-actions {
  flex-wrap: nowrap;
  justify-content: center;
}

.admin-row-actions button,
.admin-row-actions a,
.admin-drawer-actions button,
.admin-drawer-list button {
  min-height: 28px;
  padding: 5px 8px;
}

.admin-row-actions a {
  text-decoration: none;
}

.admin-drawer {
  position: sticky;
  top: 10px;
  overflow: hidden;
}

.admin-drawer > header {
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-drawer > header strong,
.admin-drawer-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-drawer-actions,
.admin-drawer-grid,
.admin-tabs,
.admin-drawer-list {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.admin-drawer-grid strong {
  color: var(--text);
  text-align: right;
}

.admin-tabs {
  overflow-x: auto;
}

.admin-tabs button.active {
  border-color: rgba(85, 199, 191, 0.42);
  background: rgba(85, 199, 191, 0.15);
}

.admin-drawer-list {
  gap: 6px;
}

.admin-drawer-list h3 {
  margin: 0;
}

.admin-drawer-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.admin-audit-list article {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-empty,
.admin-drawer-empty {
  padding: 14px;
  font-weight: 700;
}

.admin-billing-titlebar strong,
.admin-billing-section > header span,
.admin-billing-payments > div > strong,
.admin-billing-plan strong,
.admin-billing-row strong {
  color: var(--text);
}

.admin-billing-kv span,
.admin-billing-kv small,
.admin-billing-plan small,
.admin-billing-row span,
.admin-billing-warning {
  color: var(--muted);
  font-size: 11px;
}

.admin-billing-detail {
  overflow: hidden;
}

.admin-billing-titlebar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-billing-titlebar > div:first-child {
  display: grid;
  gap: 6px;
  width: min(520px, 100%);
}

.admin-billing-titlebar .admin-firm-switcher {
  width: min(520px, 100%);
  min-width: min(420px, 100%);
}

.admin-billing-titlebar .client-switcher-field {
  min-height: 38px;
  border-color: rgba(85, 199, 191, 0.28);
  background: linear-gradient(180deg, rgba(14, 21, 24, 0.96), rgba(7, 11, 13, 0.96));
}

.admin-billing-titlebar .client-switcher-field:hover,
.admin-billing-titlebar .client-switcher-field:focus-within,
.admin-billing-titlebar .client-switcher.open .client-switcher-field {
  border-color: rgba(142, 231, 223, 0.56);
  background: linear-gradient(180deg, rgba(21, 34, 37, 0.96), rgba(10, 16, 18, 0.96));
}

.admin-billing-titlebar .client-switcher-input {
  font-size: 13px;
}

.admin-billing-titlebar .client-switcher-field svg {
  color: #8ee7df;
}

.admin-billing-titlebar .client-switcher-menu {
  border-color: rgba(85, 199, 191, 0.38);
  background: linear-gradient(180deg, rgba(17, 24, 27, 0.99), rgba(7, 11, 13, 0.99));
  scrollbar-color: rgba(85, 199, 191, 0.5) rgba(255, 255, 255, 0.05);
}

.admin-billing-titlebar .client-menu-option small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-billing-titlebar span,
.admin-billing-section > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-billing-warning {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(244, 176, 69, 0.2);
  background: rgba(244, 176, 69, 0.08);
  color: #f7d27d;
  font-weight: 800;
}

.admin-billing-actions {
  padding: 8px 10px;
}

.admin-billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0;
}

.admin-billing-section {
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-billing-grid .admin-billing-section:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-billing-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  margin-bottom: 8px;
}

.admin-billing-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-billing-kv {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(85, 199, 191, 0.12);
  border-radius: 7px;
  background: rgba(7, 12, 14, 0.34);
}

.admin-billing-kv strong {
  color: var(--text);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-billing-kv .pill {
  width: max-content;
  min-width: 88px;
  justify-content: center;
}

.admin-billing-plans {
  display: grid;
  gap: 6px;
}

.admin-billing-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(85, 199, 191, 0.12);
  border-radius: 7px;
}

.admin-billing-plan.active {
  border-color: rgba(85, 199, 191, 0.34);
  background: rgba(85, 199, 191, 0.08);
}

.admin-billing-plan > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-billing-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.admin-billing-action-grid button {
  min-height: 30px;
}

.admin-billing-payments {
  display: grid;
  gap: 10px;
}

.admin-billing-payments > div {
  display: grid;
  gap: 5px;
}

.admin-billing-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-billing-row {
  grid-template-columns: minmax(220px, 1fr) 110px minmax(160px, 0.7fr) minmax(150px, auto);
}

.admin-billing-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

@media (max-width: 1180px) {
  body.admin-shell,
  body.admin-shell.nav-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  body.admin-shell main {
    padding: 14px;
  }

  body.admin-shell .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(85, 199, 191, 0.25);
    background:
      linear-gradient(180deg, rgba(18, 27, 30, 0.99), rgba(8, 13, 15, 0.99));
    box-shadow: 0 16px 38px rgba(3, 7, 12, 0.42);
  }

  body.admin-shell .sidebar-toggle {
    display: inline-flex;
    border-color: rgba(85, 199, 191, 0.34);
    background: rgba(85, 199, 191, 0.1);
    color: var(--text);
  }

  body.admin-shell .brand::after {
    display: none;
  }

  body.admin-shell nav {
    border-color: rgba(85, 199, 191, 0.22);
    background:
      linear-gradient(180deg, rgba(20, 32, 35, 0.99), rgba(8, 13, 15, 0.99));
  }

  body.admin-shell .admin-nav-context {
    grid-column: 1 / -1;
    border: 1px solid rgba(85, 199, 191, 0.16);
    border-radius: 7px;
    margin: 0;
    background: rgba(85, 199, 191, 0.07);
  }

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

  .admin-drawer {
    position: static;
  }

  .admin-table-row {
    min-width: 980px;
  }

  .admin-billing-grid {
    grid-template-columns: 1fr;
  }

  .admin-billing-grid .admin-billing-section:first-child {
    border-right: 0;
  }

  .admin-billing-row {
    grid-template-columns: minmax(220px, 1fr) 100px minmax(150px, 0.8fr) minmax(140px, auto);
    min-width: 760px;
  }

  .admin-billing-payments {
    overflow-x: auto;
  }
}
