:root {
  color-scheme: dark;
  --app-bg: #0b0b0b;
  --app-surface: #121212;
  --app-surface-soft: #171612;
  --app-ink: #ededed;
  --app-muted: #aaa38f;
  --app-line: rgba(198, 173, 97, 0.2);
  --app-line-strong: rgba(224, 203, 123, 0.38);
  --app-green: #c6ad61;
  --app-green-dark: #a88938;
  --app-green-soft: rgba(198, 173, 97, 0.14);
  --app-gold: #c6ad61;
  --app-gold-light: #e0cb7b;
  --app-gold-dark: #8f6f28;
  --app-blue: #315f8e;
  --app-blue-soft: #e7eff8;
  --app-amber: #8c5a12;
  --app-amber-soft: #fff0cc;
  --app-red: #a63d35;
  --app-red-soft: #fbe3e0;
  --app-sidebar: #060606;
  --app-sidebar-muted: #a49d8a;
  --app-focus: #e0cb7b;
  --app-radius: 8px;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--app-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: inherit;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--app-focus) 28%, transparent);
  outline-offset: 2px;
}

summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--app-focus) 28%, transparent);
  outline-offset: 2px;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

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

.member-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.member-brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

/* Authentication */
.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.auth-header {
  display: flex;
  width: min(1120px, calc(100% - 40px));
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-bottom: 1px solid var(--app-line);
}

.auth-home-link {
  color: var(--app-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-home-link:hover {
  color: var(--app-ink);
}

.auth-main {
  display: grid;
  width: min(1120px, calc(100% - 40px));
  place-items: center;
  margin: 0 auto;
  padding: 54px 0 70px;
}

.auth-panel {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: 0 16px 44px rgba(23, 25, 22, 0.08);
}

.auth-kicker,
.view-kicker,
.section-kicker {
  margin: 0;
  color: var(--app-green);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-kicker {
  margin-bottom: 8px;
  font-size: 12px;
}

.auth-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.auth-copy {
  margin: 10px 0 0;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #383b35;
  font-size: 13px;
  font-weight: 750;
}

.field-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8ccc4;
  border-radius: 7px;
  background: #fff;
  color: var(--app-ink);
  font-size: 15px;
}

.field-input:hover {
  border-color: #969c91;
}

.field-input:focus {
  border-color: var(--app-focus);
  outline: 3px solid color-mix(in srgb, var(--app-focus) 15%, transparent);
}

.mfa-code-input {
  max-width: 220px;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.password-field {
  position: relative;
}

.password-field .field-input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-green);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover {
  color: var(--app-green-dark);
  text-decoration: underline;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--app-green);
  background: var(--app-green);
  color: #fff;
}

.primary-button:hover {
  border-color: var(--app-green-dark);
  background: var(--app-green-dark);
}

.secondary-button {
  border: 1px solid var(--app-line-strong);
  background: var(--app-surface);
  color: var(--app-ink);
}

.secondary-button:hover {
  border-color: #aeb3aa;
  background: #f8f9f7;
}

.danger-button {
  border: 1px solid #e8c1bd;
  background: #fff;
  color: var(--app-red);
}

.danger-button:hover {
  background: var(--app-red-soft);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.compact-button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.form-status {
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.form-status:empty {
  display: none;
}

.form-status[data-tone="error"] {
  background: var(--app-red-soft);
  color: #7e2b25;
}

.form-status[data-tone="success"] {
  background: var(--app-green-soft);
  color: #115139;
}

.form-status[data-tone="info"] {
  background: var(--app-amber-soft);
  color: #71490e;
}

.auth-footer {
  padding: 0 20px 28px;
  color: var(--app-muted);
  font-size: 12px;
  text-align: center;
}

/* Application shell */
.route-loader {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--app-muted);
  font-size: 14px;
  font-weight: 700;
}

.member-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 230px minmax(0, 1fr);
}

.member-sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--app-sidebar);
  color: #f5f6f3;
}

.member-sidebar .member-brand {
  min-height: 42px;
  padding: 0 8px;
}

.member-sidebar .sidebar-close {
  display: none;
}

.sidebar-section-label {
  margin: 28px 10px 9px;
  color: #7f857b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.member-nav {
  display: grid;
  gap: 3px;
}

.member-nav-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--app-sidebar-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.member-nav-button:hover {
  background: #282b27;
  color: #fff;
}

.member-nav-button[aria-current="page"] {
  background: #30352f;
  color: #fff;
}

.sidebar-account {
  display: grid;
  gap: 11px;
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid #353934;
}

.sidebar-account-copy {
  min-width: 0;
}

.sidebar-account-name,
.sidebar-account-email {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-name {
  color: #f1f2ef;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-account-email {
  margin-top: 2px;
  color: #8f958b;
  font-size: 11px;
}

.sidebar-logout {
  min-height: 36px;
  border: 1px solid #41463f;
  border-radius: 7px;
  background: transparent;
  color: #d9ddd6;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-logout:hover {
  border-color: #62695f;
  background: #282b27;
}

.member-main {
  min-width: 0;
}

.member-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fff;
  color: var(--app-ink);
  font-size: 22px;
  cursor: pointer;
}

.topbar-community {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.topbar-title {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

.topbar-community-name {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: #fff;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 750;
}

.connection-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #b5bab1;
  content: "";
}

.connection-status[data-connected="true"] {
  border-color: #b8ddca;
  background: #f3fbf7;
  color: #165a41;
}

.connection-status[data-connected="true"]::before {
  background: #27a574;
}

.member-content {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 26px 26px 64px;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.view-kicker {
  margin-bottom: 5px;
}

.view-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.view-subtitle {
  margin: 6px 0 0;
  color: var(--app-muted);
  font-size: 13px;
}

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

.community-picker select,
.inline-select select {
  min-height: 40px;
  padding: 7px 34px 7px 11px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--app-ink);
  font-size: 12px;
  font-weight: 750;
}

.community-picker select {
  width: min(260px, 34vw);
}

.sync-feedback {
  margin: 0 0 16px;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sync-feedback[data-tone="warning"] {
  color: var(--app-gold-light);
}

.stale-data-notice {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: var(--app-surface);
}

.stale-data-notice[hidden] {
  display: none;
}

.stale-data-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--app-green-soft);
  color: var(--app-gold-light);
}

.stale-data-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stale-data-copy strong {
  color: var(--app-ink);
  font-size: 13px;
}

.stale-data-copy span {
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.45;
}

.stale-data-notice .primary-button {
  flex: 0 0 auto;
  margin-left: auto;
}

/* Learn */
.learn-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 30px;
}

.learn-video {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #000;
}

.learn-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.learn-copy {
  min-width: 0;
  padding-top: 4px;
}

.learn-episode {
  margin: 0 0 9px;
  color: var(--app-gold-light);
  font-size: 12px;
  font-weight: 700;
}

.learn-copy h2 {
  margin: 0;
  color: var(--app-ink);
  font-size: 25px;
  line-height: 1.25;
}

.learn-intro {
  margin: 14px 0 0;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.6;
}

.learn-copy h3 {
  margin: 24px 0 8px;
  color: var(--app-ink);
  font-size: 13px;
}

.learn-topics {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-topics li {
  position: relative;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.45;
}

.learn-topics li::before {
  position: absolute;
  top: 17px;
  left: 1px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--app-gold);
  content: "";
}

.learn-youtube-link {
  gap: 8px;
  margin-top: 22px;
  text-decoration: none;
}

/* Dashboard summary */
.metrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
}

.metrics-period-context {
  margin: 0;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-period-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.metric-period-filter > span {
  color: var(--app-gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-period-filter select {
  width: 210px;
  min-height: 40px;
  padding: 7px 34px 7px 11px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: var(--app-surface);
  color: var(--app-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.metric-period-filter select:hover {
  border-color: rgba(224, 203, 123, 0.64);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.metric {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--app-line);
  border-bottom: 1px solid var(--app-line);
}

.metric:nth-child(4n) {
  border-right: 0;
}

.metric:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.metric-label {
  margin: 0;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  overflow: hidden;
  margin: 7px 0 0;
  font-size: 25px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-foot {
  overflow: hidden;
  margin: 5px 0 0;
  color: #858a82;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-band {
  margin-top: 22px;
  padding: 18px 0 2px;
  border-top: 1px solid var(--app-line);
}

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

.compact-heading {
  align-items: center;
}

.section-kicker {
  margin-bottom: 4px;
}

.section-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.section-meta {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 11px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: 7px;
}

.status-chip {
  display: flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #fff;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.status-chip:hover,
.status-chip[aria-pressed="true"] {
  border-color: #9ec8b4;
  background: #f3faf6;
}

.status-chip strong {
  color: var(--app-ink);
  font-size: 17px;
}

.workspace-section {
  scroll-margin-top: 78px;
  margin-top: 34px;
  padding-top: 4px;
}

.sort-menu-heading {
  background: #17150f;
  color: var(--app-gold-light);
  font-weight: 800;
}

.sort-menu-separator {
  background: #11110f;
  color: #665d45;
}

/* Community business */
.business-sync-status {
  padding: 11px 13px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: 12px;
}

.business-sync-status[data-tone="warning"] {
  border-color: rgba(224, 203, 123, 0.42);
  color: var(--app-gold-light);
}

.business-section {
  margin-top: 30px;
  padding-top: 4px;
}

.business-plan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.business-plan {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.business-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--app-line);
}

.business-plan-header p {
  margin: 0 0 3px;
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.business-plan-header h3 {
  margin: 0;
  font-size: 17px;
}

.business-plan-header > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(81, 181, 129, 0.34);
  border-radius: 999px;
  background: rgba(33, 105, 70, 0.14);
  color: #77d5a2;
  font-size: 10px;
  font-weight: 800;
}

.business-plan-prices {
  display: grid;
  gap: 4px;
  padding: 14px 0 2px;
}

.business-plan-prices strong {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.business-plan ul {
  display: grid;
  gap: 6px;
  margin: 13px 0 0;
  padding: 12px 0 0 17px;
  border-top: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.45;
}

.business-empty {
  grid-column: 1 / -1;
  min-height: 90px;
  padding: 24px;
  border-block: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 12px;
}

.business-share-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 11px 13px;
  border-block: 1px solid var(--app-line);
}

.business-share-link {
  overflow: hidden;
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-share-link[aria-disabled="true"] {
  color: var(--app-muted);
  pointer-events: none;
  text-decoration: none;
}

.business-payout-status {
  min-height: 34px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--app-line);
  border-bottom: 0;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: 11px;
}

.business-payout-table-frame {
  max-height: 480px;
  border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.business-payout-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.business-payout-table th,
.business-payout-table td {
  height: 44px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-surface);
  font-size: 11px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-payout-table th:first-child,
.business-payout-table td:first-child {
  width: 58%;
}

.business-payout-table th:last-child,
.business-payout-table td:last-child {
  width: 42%;
}

.business-payout-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.business-payout-table tbody tr:nth-child(even) td {
  background: var(--app-surface-soft);
}

.business-payout-table tr:last-child td {
  border-bottom: 0;
}

.business-payout-table th:last-child,
.business-payout-table td:last-child {
  text-align: right;
}

.business-payout-amount {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Member filters and table */
.members-heading {
  align-items: center;
}

.filter-panel {
  padding: 13px;
  border: 1px solid var(--app-line);
  border-bottom: 0;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  background: var(--app-surface);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 9px;
}

.member-filter-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.65fr);
  gap: 12px;
}

.member-filter-primary .compact-field {
  grid-column: auto;
}

.member-filters {
  margin-top: 12px;
  border-top: 1px solid var(--app-line);
}

.member-filters > summary,
.member-export-menu > summary,
.template-editor > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--app-ink);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.member-filters > summary::-webkit-details-marker,
.member-export-menu > summary::-webkit-details-marker,
.template-editor > summary::-webkit-details-marker,
.mobile-member-details > summary::-webkit-details-marker {
  display: none;
}

.member-filters > summary .disclosure-icon {
  margin-left: auto;
}

.template-editor > summary {
  justify-content: space-between;
}

.template-editor[open] > summary {
  margin-bottom: 8px;
}

details[open] > summary > .disclosure-icon {
  transform: rotate(180deg);
}

.filter-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--app-green-soft);
  color: var(--app-ink);
  font-size: 12px;
  text-align: center;
}

.member-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--app-line);
  background: var(--app-surface);
}

.member-selection-controls,
.member-selection-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.member-selection-actions .selection-count {
  margin: 0 6px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.member-export-menu {
  position: relative;
}

.member-export-menu > summary {
  min-height: 36px;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: var(--app-surface);
}

.member-export-menu > summary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.member-export-options {
  position: absolute;
  z-index: 16;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  max-width: calc(100vw - 32px);
  padding: 4px;
  border: 1px solid var(--app-line-strong);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 8px 24px #0003;
}

.member-export-options button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--app-ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.member-export-options button:hover {
  background: var(--app-surface-soft);
}

.mobile-member-list,
.chart-inspector {
  display: none;
}

.compact-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.compact-field > span {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-field input,
.compact-field select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--app-ink);
  font-size: 12px;
  font-weight: 650;
}

.sort-field,
.search-field {
  grid-column: span 2;
}

.filter-footer {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 8px;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-search-button {
  min-width: 110px;
  min-height: 44px;
}

.filter-footer #filtered-count {
  margin-left: auto;
}

.selection-count {
  margin-left: auto;
  color: var(--app-ink);
}

.table-frame {
  overflow: auto;
  border: 1px solid var(--app-line);
  background: var(--app-surface);
}

.member-table-frame {
  max-height: 620px;
  border-top: 0;
  border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.member-table {
  width: 100%;
  min-width: 2450px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.member-table th,
.member-table td {
  height: 45px;
  padding: 8px 10px;
  border-bottom: 1px solid #e6e8e3;
  background: #fff;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.member-table th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 42px;
  border-bottom: 1px solid var(--app-line-strong);
  background: #f8f9f7;
  color: var(--app-muted);
  font-weight: 800;
}

.member-table tbody tr:nth-child(even) td {
  background: #f5f7f3;
}

.member-table tbody tr:hover td {
  background: #fbfcfa;
}

.member-table th:first-child,
.member-table td:first-child {
  position: sticky;
  z-index: 5;
  left: 0;
  width: 44px;
  padding: 0;
  text-align: center;
}

.member-table th:nth-child(2),
.member-table td:nth-child(2) {
  position: sticky;
  z-index: 5;
  left: 44px;
  width: 170px;
  box-shadow: 1px 0 0 var(--app-line);
}

.member-table th:first-child,
.member-table th:nth-child(2) {
  z-index: 7;
  background: #f8f9f7;
}

.member-table th:nth-child(3) { width: 210px; }
.member-table th:nth-child(4) { width: 110px; }
.member-table th:nth-child(5) { width: 118px; }
.member-table th:nth-child(6) { width: 128px; }
.member-table th:nth-child(7) { width: 108px; }
.member-table th:nth-child(8) { width: 112px; }
.member-table th:nth-child(9) { width: 114px; }
.member-table th:nth-child(10) { width: 116px; }
.member-table th:nth-child(11) { width: 114px; }
.member-table th:nth-child(12) { width: 84px; }
.member-table th:nth-child(13) { width: 126px; }
.member-table th:nth-child(14) { width: 92px; }
.member-table th:nth-child(15) { width: 70px; }
.member-table th:nth-child(16) { width: 78px; }
.member-table th:nth-child(17) { width: 82px; }
.member-table th:nth-child(18) { width: 126px; }
.member-table th:nth-child(19) { width: 80px; }

.member-table input[type="checkbox"],
.opportunity-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--app-green);
  cursor: pointer;
}

.member-name-cell {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
}

.sort-button {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.sort-indicator {
  color: #a1a69d;
  font-size: 10px;
}

.sort-button[data-active="true"] {
  color: var(--app-ink);
}

.sort-button[data-active="true"] .sort-indicator {
  color: var(--app-green);
}

.status-pill,
.message-state,
.priority-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eceee9;
  color: #555a52;
  font-size: 10px;
  font-weight: 800;
}

.status-pill.paid,
.status-pill.active,
.message-state.read {
  background: var(--app-green-soft);
  color: #146044;
}

.status-pill.card_declined,
.status-pill.churned,
.message-state.unread {
  background: var(--app-red-soft);
  color: #88342d;
}

.status-pill.cancelling,
.status-pill.trial_canceled,
.status-pill.free_trial,
.status-pill.pending {
  background: var(--app-amber-soft);
  color: #71490e;
}

.empty-table-cell {
  position: static !important;
  height: 150px !important;
  color: var(--app-muted);
  text-align: center !important;
  box-shadow: none !important;
}

/* Opportunities and campaigns */
.section-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--app-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.section-toggle::after {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.section-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.section-toggle:hover {
  border-color: rgba(224, 203, 123, 0.64);
}

.opportunities-panel {
  min-width: 0;
}

.opportunity-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.opportunity-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.opportunity-list {
  display: grid;
  max-height: min(62vh, 620px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.opportunity-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--app-line);
  border-bottom: 1px solid var(--app-line);
  background: #fff;
}

.opportunity-item:nth-child(2n) {
  border-right: 0;
}

.opportunity-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.opportunity-item[data-priority="urgent"] {
  box-shadow: inset 3px 0 0 var(--app-red);
}

.opportunity-copy {
  min-width: 0;
}

.opportunity-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.opportunity-title-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-pill {
  flex: 0 0 auto;
  background: var(--app-blue-soft);
  color: var(--app-blue);
}

.opportunity-item[data-priority="urgent"] .priority-pill {
  background: var(--app-red-soft);
  color: var(--app-red);
}

.opportunity-copy h3 {
  margin: 7px 0 0;
  font-size: 13px;
}

.opportunity-copy p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.45;
}

.opportunity-actions {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.mini-action {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: #fff;
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.mini-action:hover {
  border-color: #aeb3aa;
  color: var(--app-ink);
}

.empty-workspace {
  display: grid;
  min-height: 120px;
  grid-column: 1 / -1;
  place-items: center;
  padding: 24px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.campaign-history {
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.campaign-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: minmax(160px, 1fr) 110px 120px 100px;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--app-line);
  font-size: 11px;
}

.campaign-row:last-child {
  border-bottom: 0;
}

.campaign-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-row span {
  color: var(--app-muted);
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.analytics-wide {
  grid-column: 1 / -1;
}

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

.analytics-heading h3 {
  margin: 0;
  font-size: 14px;
}

.analytics-heading p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 10px;
  line-height: 1.4;
}

.chart {
  position: relative;
  margin-top: 12px;
  overflow: visible;
  border-top: 1px solid #eef0ec;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #eef0ec;
}

.chart-summary-item {
  min-width: 0;
  padding: 10px 9px;
  border-right: 1px solid #eef0ec;
}

.chart-summary-item:last-child {
  border-right: 0;
}

.chart-summary-item span,
.chart-summary-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-summary-item span {
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-summary-item strong {
  overflow: visible;
  margin-top: 4px;
  color: var(--app-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.chart-stage {
  position: relative;
  min-height: 220px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 220px;
  overflow: visible;
}

.chart-grid-line {
  stroke: #e8ebe5;
  stroke-width: 1;
}

.chart-area {
  fill: #dceee5;
}

.chart-line {
  fill: none;
  stroke: var(--app-green);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-line-secondary {
  fill: none;
  stroke: var(--app-blue);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-bar {
  fill: #cbded5;
}

.chart-series-bar {
  fill: var(--chart-series);
}

.chart-label {
  fill: #747970;
  font-size: 10px;
}

.chart-axis-label {
  fill: #8a8f87;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.chart-axis-secondary {
  fill: #668db0;
}

.chart-point {
  pointer-events: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-point-primary {
  fill: #fff;
  stroke: var(--app-green);
}

.chart-point-secondary {
  fill: #fff;
  stroke: var(--app-blue);
}

.chart-point.is-active {
  r: 5px;
  stroke-width: 3;
}

.chart-hit {
  cursor: pointer;
  outline: none;
}

.chart-hit-column {
  fill: transparent;
  pointer-events: all;
  transition: fill 120ms ease;
}

.chart-hit:hover .chart-hit-column,
.chart-hit:focus-visible .chart-hit-column,
.chart-hit.is-active .chart-hit-column {
  fill: rgba(198, 173, 97, 0.1);
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: min(210px, calc(100% - 16px));
  padding: 10px 11px;
  border: 1px solid rgba(224, 203, 123, 0.5);
  border-radius: 6px;
  background: rgba(14, 14, 13, 0.97);
  color: #f3f3f1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(198, 173, 97, 0.2);
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.chart-tooltip dl {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
}

.chart-tooltip dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-tooltip dt,
.chart-tooltip dd {
  margin: 0;
  font-size: 10px;
}

.chart-tooltip dt {
  display: inline-flex;
  align-items: center;
  color: #aaa38f;
}

.chart-tooltip dd {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.chart-tooltip i,
.chart-legend i {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--chart-series);
}

.chart-legend {
  display: flex;
  min-height: 31px;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 5px 4px 7px;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 700;
}

.chart-legend > span {
  display: inline-flex;
  align-items: center;
}

.chart-legend i[data-kind="line"] {
  width: 12px;
  height: 2px;
  border-radius: 0;
}

.chart-legend small {
  margin-left: auto;
  color: var(--app-muted);
  font-size: 9px;
  font-weight: 600;
}

.chart-data {
  border-top: 1px solid #eef0ec;
}

.chart-data > summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--app-muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  list-style-position: inside;
}

.chart-data > summary:hover {
  color: var(--app-gold-light);
}

.chart-data > summary span:last-child {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
}

.chart-table-scroll {
  max-height: 250px;
  margin: 0 0 7px;
  overflow: auto;
  border: 1px solid var(--app-line);
  border-radius: 6px;
}

.chart-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.chart-table-scroll th,
.chart-table-scroll td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--app-line);
  color: var(--app-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.chart-table-scroll th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-weight: 800;
}

.chart-table-scroll th:first-child,
.chart-table-scroll td:first-child {
  text-align: left;
}

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

.chart-empty {
  display: grid;
  min-height: 210px;
  margin: 0;
  place-items: center;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.discovery-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.discovery-list > div {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #e9ebe7;
}

.discovery-list dt {
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.discovery-list dd {
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Account and access */
.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(280px, 360px);
  align-items: start;
  gap: 20px;
}

.settings-form {
  display: grid;
  width: min(100%, 560px);
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.membership-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.membership-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.membership-panel-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: var(--app-surface-soft);
  color: var(--app-gold-light);
}

.membership-panel h2 {
  margin: 0;
  font-size: 18px;
}

.membership-panel p {
  margin: 7px 0 0;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.5;
}

.membership-action {
  gap: 8px;
  justify-self: start;
  text-decoration: none;
}

.access-blocked {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.access-blocked-panel {
  width: min(100%, 520px);
  padding: 30px;
  border: 1px solid #e5c78f;
  border-radius: var(--app-radius);
  background: #fffdf8;
}

.access-blocked-panel h1 {
  margin: 0;
  font-size: 25px;
}

.access-blocked-panel p {
  margin: 10px 0 0;
  color: var(--app-muted);
  line-height: 1.55;
}

.access-blocked-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.mobile-overlay {
  display: none;
}

/* Campaign modal */
.campaign-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--app-radius);
  background: #fff;
  color: var(--app-ink);
  box-shadow: 0 24px 80px rgba(22, 25, 21, 0.2);
}

.campaign-dialog::backdrop {
  background: rgba(25, 28, 24, 0.5);
}

.campaign-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.campaign-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.campaign-dialog-header h2 {
  margin: 0;
  font-size: 21px;
}

.campaign-dialog-header p:last-child {
  margin: 5px 0 0;
  color: var(--app-muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--app-muted);
  font-size: 24px;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--app-surface-soft);
  color: var(--app-ink);
}

.campaign-template-box {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
}

.template-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.campaign-message {
  min-height: 136px;
  resize: vertical;
  line-height: 1.45;
}

.campaign-fields {
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(220px, 1fr);
  gap: 12px;
}

.campaign-preview {
  min-height: 90px;
  padding: 13px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.campaign-preview strong {
  font-size: 12px;
}

.campaign-preview p {
  margin: 7px 0 0;
  white-space: pre-wrap;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.campaign-preview img {
  display: block;
  max-width: min(260px, 100%);
  max-height: 180px;
  margin-top: 10px;
  object-fit: contain;
}

.confirm-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.confirm-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--app-green);
}

.campaign-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

/* SuperSkool brand theme */
::selection {
  background: var(--app-gold);
  color: #090909;
}

html,
body,
.auth-page,
.member-main {
  background: var(--app-bg);
}

.member-brand {
  color: #f3f3f1;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.member-brand-logo {
  filter: drop-shadow(0 0 10px rgba(198, 173, 97, 0.16));
}

.auth-header {
  border-color: var(--app-line);
}

.auth-home-link,
.auth-copy,
.auth-footer {
  color: var(--app-muted);
}

.auth-panel,
.settings-form,
.access-blocked-panel {
  border-color: var(--app-line-strong);
  background: var(--app-surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

.auth-panel::before {
  display: block;
  width: 74px;
  height: 2px;
  margin: -33px auto 29px;
  background: linear-gradient(90deg, transparent, var(--app-gold-light), transparent);
  content: "";
}

.auth-title,
.view-title,
.section-title,
.campaign-dialog-header h2,
.access-blocked-panel h1 {
  color: #f3f3f1;
  font-family: "Bebas Neue", "JetBrains Mono", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-title {
  font-size: 34px;
}

.view-title {
  font-size: 29px;
}

.section-title {
  font-size: 20px;
}

.auth-kicker,
.view-kicker,
.section-kicker,
.metric-label,
.compact-field > span,
.sidebar-section-label {
  color: var(--app-gold);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0;
}

.field-label {
  color: #d8c370;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.field-input,
.compact-field input,
.compact-field select,
.community-picker select,
.inline-select select {
  border-color: var(--app-line-strong);
  background: #0d0d0c;
  color: #f3f3f1;
}

.field-input::placeholder,
.compact-field input::placeholder {
  color: #716b5d;
}

.field-input:hover,
.compact-field input:hover,
.compact-field select:hover,
.community-picker select:hover,
.inline-select select:hover {
  border-color: rgba(224, 203, 123, 0.64);
}

.field-input:focus,
.compact-field input:focus,
.compact-field select:focus {
  border-color: var(--app-gold-light);
  outline-color: rgba(224, 203, 123, 0.16);
}

.field-input:disabled {
  color: #8b8577;
  background: #0a0a09;
}

.password-toggle,
.text-button {
  color: var(--app-gold-light);
}

.text-button:hover {
  color: #fff1bd;
}

.primary-button {
  border-color: var(--app-gold-light);
  background: linear-gradient(180deg, #e0cb7b 0%, #b89a4a 100%);
  color: #090909;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-button:hover {
  border-color: #f0dc91;
  background: linear-gradient(180deg, #f0dc91 0%, #c6ad61 100%);
  color: #050505;
}

.secondary-button {
  border-color: var(--app-line-strong);
  background: #121212;
  color: #e7e3d8;
}

.secondary-button:hover {
  border-color: rgba(224, 203, 123, 0.72);
  background: #1b1913;
  color: #fff1bd;
}

.danger-button {
  border-color: rgba(209, 92, 82, 0.4);
  background: #121212;
  color: #ef9187;
}

.danger-button:hover {
  background: rgba(166, 61, 53, 0.16);
}

.form-status[data-tone="error"] {
  background: rgba(166, 61, 53, 0.18);
  color: #ef9187;
}

.form-status[data-tone="success"] {
  background: rgba(47, 143, 96, 0.18);
  color: #77d5a2;
}

.form-status[data-tone="info"] {
  background: rgba(198, 173, 97, 0.13);
  color: #e0cb7b;
}

.member-sidebar {
  border-right: 1px solid rgba(198, 173, 97, 0.24);
  background: #060606;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.28);
}

.sidebar-section-label {
  color: #786a3f;
}

.member-nav-button {
  color: #a49d8a;
}

.member-nav-button:hover {
  background: #12110e;
  color: #ead994;
}

.member-nav-button[aria-current="page"] {
  background: #1b1913;
  color: #f0dc91;
  box-shadow: inset 3px 0 0 var(--app-gold);
}

.sidebar-account {
  border-color: rgba(198, 173, 97, 0.18);
}

.sidebar-account-name {
  color: #f3f3f1;
}

.sidebar-account-email {
  color: #817a69;
}

.sidebar-logout {
  border-color: rgba(198, 173, 97, 0.28);
  color: #c8bea2;
}

.sidebar-logout:hover {
  border-color: rgba(224, 203, 123, 0.58);
  background: #17150f;
  color: #f0dc91;
}

.member-topbar {
  min-height: 64px;
  border-top: 3px solid var(--app-gold);
  border-bottom-color: rgba(198, 173, 97, 0.2);
  background: rgba(8, 8, 8, 0.96);
}

.mobile-menu-button {
  border-color: var(--app-line-strong);
  background: #121212;
  color: var(--app-gold-light);
}

.topbar-title {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.topbar-community-name {
  color: #817a69;
}

.connection-status {
  border-color: rgba(198, 173, 97, 0.28);
  background: #11110f;
  color: #a9a087;
}

.connection-status::before {
  background: #746a4c;
}

.connection-status[data-connected="true"] {
  border-color: rgba(81, 181, 129, 0.38);
  background: rgba(33, 105, 70, 0.14);
  color: #77d5a2;
}

.member-content {
  background: #0b0b0b;
}

.view-subtitle,
.section-meta {
  color: var(--app-muted);
}

.metrics-grid,
.filter-panel,
.table-frame,
.opportunity-list,
.campaign-history,
.analytics-panel {
  border-color: var(--app-line);
  background: var(--app-surface);
}

.metric {
  border-color: var(--app-line);
  background: #121212;
}

.metric-value,
.status-chip strong,
.discovery-list dd {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.metric-foot {
  color: #777163;
}

.status-band {
  border-color: var(--app-line);
}

.status-chip {
  border-color: var(--app-line);
  background: #121212;
  color: #aaa38f;
}

.status-chip:hover,
.status-chip[aria-pressed="true"] {
  border-color: rgba(224, 203, 123, 0.62);
  background: #1b1913;
  color: #f0dc91;
}

.filter-panel {
  background: #10100f;
}

.filter-footer,
.opportunity-toolbar {
  color: #8f8877;
}

.selection-count {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
}

.member-table th,
.member-table td {
  border-color: rgba(198, 173, 97, 0.12);
  background: #111110;
  color: #dedbd2;
}

.member-table th {
  border-bottom-color: rgba(224, 203, 123, 0.34);
  background: #17150f;
  color: #cbb873;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.member-table tbody tr:nth-child(even) td {
  background: #171612;
}

.member-table tbody tr:hover td {
  background: #201d15;
}

.member-table th:first-child,
.member-table th:nth-child(2) {
  background: #17150f;
}

.member-table th:nth-child(2),
.member-table td:nth-child(2) {
  box-shadow: 1px 0 0 rgba(224, 203, 123, 0.25);
}

.member-table input[type="checkbox"],
.opportunity-item input[type="checkbox"],
.confirm-field input {
  accent-color: var(--app-gold);
}

.member-name-cell {
  color: #f3f3f1;
}

.sort-indicator {
  color: #756c52;
}

.sort-button[data-active="true"],
.sort-button[data-active="true"] .sort-indicator {
  color: #f0dc91;
}

.status-pill,
.message-state,
.priority-pill {
  background: #292720;
  color: #c8bea2;
}

.status-pill.paid,
.status-pill.active,
.message-state.read {
  background: rgba(47, 143, 96, 0.2);
  color: #77d5a2;
}

.status-pill.card_declined,
.status-pill.churned,
.message-state.unread {
  background: rgba(166, 61, 53, 0.22);
  color: #ef9187;
}

.status-pill.cancelling,
.status-pill.trial_canceled,
.status-pill.free_trial,
.status-pill.pending {
  background: rgba(198, 173, 97, 0.15);
  color: #e0cb7b;
}

.empty-table-cell,
.empty-workspace,
.chart-empty {
  color: #817a69;
}

.opportunity-item {
  border-color: var(--app-line);
  background: #121212;
}

.opportunity-item[data-priority="urgent"] {
  box-shadow: inset 3px 0 0 #c35a51;
}

.priority-pill {
  background: rgba(49, 95, 142, 0.2);
  color: #86b4df;
}

.opportunity-copy h3,
.analytics-heading h3 {
  color: #f3f3f1;
}

.opportunity-copy p,
.analytics-heading p {
  color: #918a78;
}

.mini-action {
  border-color: rgba(198, 173, 97, 0.28);
  background: #11110f;
  color: #b9b095;
}

.mini-action:hover {
  border-color: rgba(224, 203, 123, 0.62);
  color: #f0dc91;
}

.campaign-row {
  border-color: var(--app-line);
}

.campaign-row span {
  color: #918a78;
}

.analytics-panel {
  background: #111110;
}

.chart {
  border-color: rgba(198, 173, 97, 0.12);
}

.chart-grid-line {
  stroke: #2b281f;
}

.chart-area {
  fill: rgba(198, 173, 97, 0.14);
}

.chart-line {
  stroke: var(--app-gold-light);
}

.chart-line-secondary {
  stroke: #7aa7cf;
}

.chart-bar {
  fill: #8f6f28;
}

.chart-point-primary {
  fill: #111110;
  stroke: var(--app-gold-light);
}

.chart-point-secondary {
  fill: #111110;
  stroke: #7aa7cf;
}

.chart-label {
  fill: #8f8877;
  font-family: "JetBrains Mono", monospace;
}

.chart-axis-label {
  fill: #716a5a;
  font-family: "JetBrains Mono", monospace;
}

.chart-summary,
.chart-summary-item,
.chart-data {
  border-color: rgba(198, 173, 97, 0.12);
}

.chart-summary-item strong {
  color: var(--app-gold-light);
  font-family: "JetBrains Mono", monospace;
}

.discovery-list > div {
  border-color: rgba(198, 173, 97, 0.14);
}

.discovery-list dt {
  color: #a9a087;
}

.campaign-dialog {
  border-color: rgba(224, 203, 123, 0.46);
  background: #0d0d0c;
  color: var(--app-ink);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.68);
}

.campaign-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.icon-button {
  color: var(--app-gold-light);
}

.icon-button:hover {
  background: #1b1913;
  color: #fff1bd;
}

.campaign-template-box,
.campaign-preview {
  border-color: var(--app-line);
  background: #121212;
}

.confirm-field {
  color: #aaa38f;
}

.access-blocked-panel {
  border-color: rgba(224, 203, 123, 0.46);
  background: #12110e;
}

* {
  scrollbar-color: #92762f #11110e;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #11110e;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid #11110e;
  border-radius: 999px;
  background: #92762f;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-theme {
  display: grid;
  gap: 7px;
}

.sidebar-theme > span {
  color: #786a3f;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--app-line-strong);
  border-radius: 7px;
  background: #0d0d0c;
}

.theme-switch button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8f8877;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.theme-switch button:hover {
  color: var(--app-gold-light);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--app-gold);
  color: #080807;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] {
  color-scheme: light;
  --app-bg: #f6f5f1;
  --app-surface: #ffffff;
  --app-surface-soft: #f5f2e9;
  --app-ink: #1a1915;
  --app-muted: #6c685e;
  --app-line: rgba(143, 111, 40, 0.2);
  --app-line-strong: rgba(143, 111, 40, 0.38);
  --app-sidebar: #fffdf8;
  --app-sidebar-muted: #625d50;
  --app-focus: #8f6f28;
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] .auth-page,
html[data-theme="light"] .member-main,
html[data-theme="light"] .member-content {
  background: var(--app-bg);
  color: var(--app-ink);
}

html[data-theme="light"] .member-brand,
html[data-theme="light"] .auth-title,
html[data-theme="light"] .view-title,
html[data-theme="light"] .section-title,
html[data-theme="light"] .campaign-dialog-header h2,
html[data-theme="light"] .access-blocked-panel h1,
html[data-theme="light"] .sidebar-account-name,
html[data-theme="light"] .opportunity-copy h3,
html[data-theme="light"] .analytics-heading h3 {
  color: #1a1915;
}

html[data-theme="light"] .auth-copy,
html[data-theme="light"] .auth-home-link,
html[data-theme="light"] .auth-footer,
html[data-theme="light"] .view-subtitle,
html[data-theme="light"] .section-meta {
  color: var(--app-muted);
}

html[data-theme="light"] .field-label,
html[data-theme="light"] .view-kicker,
html[data-theme="light"] .section-kicker,
html[data-theme="light"] .compact-field > span,
html[data-theme="light"] .text-button,
html[data-theme="light"] .password-toggle {
  color: #70551c;
}

html[data-theme="light"] .text-button:hover {
  color: #463612;
}

html[data-theme="light"] .auth-panel,
html[data-theme="light"] .settings-form,
html[data-theme="light"] .access-blocked-panel {
  border-color: var(--app-line-strong);
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(70, 55, 19, 0.1);
}

html[data-theme="light"] .field-input,
html[data-theme="light"] .compact-field input,
html[data-theme="light"] .compact-field select,
html[data-theme="light"] .community-picker select,
html[data-theme="light"] .inline-select select {
  border-color: var(--app-line-strong);
  background: #ffffff;
  color: #1a1915;
}

html[data-theme="light"] .field-input::placeholder,
html[data-theme="light"] .compact-field input::placeholder {
  color: #938d80;
}

html[data-theme="light"] .field-input:disabled {
  color: #777166;
  background: #f1efe8;
}

html[data-theme="light"] .secondary-button,
html[data-theme="light"] .danger-button {
  background: #ffffff;
  color: #403b30;
}

html[data-theme="light"] .secondary-button:hover {
  background: #f5f0df;
  color: #5f4918;
}

html[data-theme="light"] .form-status[data-tone="error"] {
  background: #fbe9e7;
  color: #8f3029;
}

html[data-theme="light"] .form-status[data-tone="success"] {
  background: #e5f5ec;
  color: #17613f;
}

html[data-theme="light"] .form-status[data-tone="info"] {
  background: #f7f0d9;
  color: #6e551b;
}

html[data-theme="light"] .member-sidebar {
  border-right-color: rgba(143, 111, 40, 0.28);
  background: #fffdf8;
  color: #1a1915;
  box-shadow: 10px 0 30px rgba(68, 52, 18, 0.07);
}

html[data-theme="light"] .member-nav-button {
  color: #625d50;
}

html[data-theme="light"] .member-nav-button:hover {
  background: #f5f0df;
  color: #5f4918;
}

html[data-theme="light"] .member-nav-button[aria-current="page"] {
  background: #eee7d3;
  color: #4b3912;
}

html[data-theme="light"] .sidebar-account {
  border-color: rgba(143, 111, 40, 0.2);
}

html[data-theme="light"] .sidebar-account-email {
  color: #7d7667;
}

html[data-theme="light"] .sidebar-logout {
  border-color: rgba(143, 111, 40, 0.34);
  color: #5f5848;
}

html[data-theme="light"] .sidebar-logout:hover {
  background: #f5f0df;
  color: #5f4918;
}

html[data-theme="light"] .member-topbar {
  border-bottom-color: rgba(143, 111, 40, 0.2);
  background: rgba(255, 253, 248, 0.96);
}

html[data-theme="light"] .mobile-menu-button {
  border-color: var(--app-line-strong);
  background: #ffffff;
  color: #6e551b;
}

html[data-theme="light"] .topbar-community-name {
  color: #817a6c;
}

html[data-theme="light"] .connection-status {
  border-color: rgba(143, 111, 40, 0.28);
  background: #ffffff;
  color: #716a5c;
}

html[data-theme="light"] .connection-status[data-connected="true"] {
  border-color: #acd8c1;
  background: #edf8f2;
  color: #17613f;
}

html[data-theme="light"] .sync-feedback[data-tone="warning"] {
  color: #70551c;
}

html[data-theme="light"] .metrics-grid,
html[data-theme="light"] .filter-panel,
html[data-theme="light"] .table-frame,
html[data-theme="light"] .opportunity-list,
html[data-theme="light"] .campaign-history,
html[data-theme="light"] .analytics-panel,
html[data-theme="light"] .metric,
html[data-theme="light"] .status-chip,
html[data-theme="light"] .opportunity-item,
html[data-theme="light"] .campaign-template-box,
html[data-theme="light"] .campaign-preview {
  border-color: var(--app-line);
  background: #ffffff;
}

html[data-theme="light"] .metric-foot,
html[data-theme="light"] .empty-table-cell,
html[data-theme="light"] .empty-workspace,
html[data-theme="light"] .chart-empty,
html[data-theme="light"] .opportunity-copy p,
html[data-theme="light"] .analytics-heading p,
html[data-theme="light"] .campaign-row span {
  color: #7c7669;
}

html[data-theme="light"] .status-chip {
  color: #625d50;
}

html[data-theme="light"] .status-chip:hover,
html[data-theme="light"] .status-chip[aria-pressed="true"] {
  border-color: rgba(143, 111, 40, 0.58);
  background: #f5f0df;
  color: #5f4918;
}

html[data-theme="light"] .filter-panel {
  background: #fffdf8;
}

html[data-theme="light"] .filter-footer,
html[data-theme="light"] .opportunity-toolbar {
  color: #756f62;
}

html[data-theme="light"] .member-table th,
html[data-theme="light"] .member-table td {
  border-color: rgba(143, 111, 40, 0.14);
  background: #ffffff;
  color: #292721;
}

html[data-theme="light"] .member-table th,
html[data-theme="light"] .member-table th:first-child,
html[data-theme="light"] .member-table th:nth-child(2) {
  border-bottom-color: rgba(143, 111, 40, 0.32);
  background: #f8f3e5;
  color: #6e551b;
}

html[data-theme="light"] .member-table tbody tr:nth-child(even) td {
  background: #f8f5ec;
}

html[data-theme="light"] .member-table tbody tr:hover td {
  background: #f1ead6;
}

html[data-theme="light"] .member-name-cell {
  color: #1a1915;
}

html[data-theme="light"] .sort-menu-heading {
  background: #f3ecd8;
  color: #6e551b;
}

html[data-theme="light"] .sort-menu-separator {
  background: #fffdf8;
  color: #b7a779;
}

html[data-theme="light"] .business-sync-status,
html[data-theme="light"] .business-plan,
html[data-theme="light"] .business-payout-table th,
html[data-theme="light"] .business-payout-table td {
  background: #ffffff;
}

html[data-theme="light"] .business-sync-status[data-tone="warning"] {
  border-color: rgba(143, 111, 40, 0.38);
  background: #fbf6e8;
  color: #6e551b;
}

html[data-theme="light"] .business-plan-header > span {
  border-color: #acd8c1;
  background: #edf8f2;
  color: #17613f;
}

html[data-theme="light"] .business-plan-prices strong,
html[data-theme="light"] .business-payout-amount,
html[data-theme="light"] .business-share-link {
  color: #6e551b;
}

html[data-theme="light"] .business-payout-table tbody tr:nth-child(even) td {
  background: #f8f5ec;
}

html[data-theme="light"] .status-pill,
html[data-theme="light"] .message-state,
html[data-theme="light"] .priority-pill {
  background: #ece9e0;
  color: #5f594d;
}

html[data-theme="light"] .status-pill.paid,
html[data-theme="light"] .status-pill.active,
html[data-theme="light"] .message-state.read {
  background: #dff2e8;
  color: #17613f;
}

html[data-theme="light"] .status-pill.card_declined,
html[data-theme="light"] .status-pill.churned,
html[data-theme="light"] .message-state.unread {
  background: #f8dfdc;
  color: #96352e;
}

html[data-theme="light"] .status-pill.cancelling,
html[data-theme="light"] .status-pill.trial_canceled,
html[data-theme="light"] .status-pill.free_trial,
html[data-theme="light"] .status-pill.pending {
  background: #f5ecd0;
  color: #6e551b;
}

html[data-theme="light"] .priority-pill {
  background: #e5eef7;
  color: #315f8e;
}

html[data-theme="light"] .mini-action {
  border-color: rgba(143, 111, 40, 0.28);
  background: #ffffff;
  color: #665f51;
}

html[data-theme="light"] .mini-action:hover {
  background: #f5f0df;
  color: #5f4918;
}

html[data-theme="light"] .chart {
  border-color: rgba(143, 111, 40, 0.14);
}

html[data-theme="light"] .chart-grid-line {
  stroke: #e6e0d1;
}

html[data-theme="light"] .chart-area {
  fill: rgba(198, 173, 97, 0.18);
}

html[data-theme="light"] .chart-label {
  fill: #756f62;
}

html[data-theme="light"] .chart-axis-label {
  fill: #8a8373;
}

html[data-theme="light"] .chart-point-primary {
  fill: #ffffff;
  stroke: #8f6f28;
}

html[data-theme="light"] .chart-point-secondary {
  fill: #ffffff;
  stroke: #527fa8;
}

html[data-theme="light"] .chart-summary,
html[data-theme="light"] .chart-summary-item,
html[data-theme="light"] .chart-data {
  border-color: rgba(143, 111, 40, 0.14);
}

html[data-theme="light"] .chart-summary-item strong {
  color: #5f4918;
}

html[data-theme="light"] .chart-tooltip {
  border-color: rgba(143, 111, 40, 0.46);
  background: rgba(255, 253, 248, 0.98);
  color: #1a1915;
  box-shadow: 0 10px 26px rgba(58, 44, 13, 0.2);
}

html[data-theme="light"] .chart-tooltip strong {
  border-color: rgba(143, 111, 40, 0.18);
  color: #6e551b;
}

html[data-theme="light"] .chart-tooltip dt {
  color: #756f62;
}

html[data-theme="light"] .chart-data > summary:hover {
  color: #5f4918;
}

html[data-theme="light"] .discovery-list > div,
html[data-theme="light"] .campaign-row {
  border-color: rgba(143, 111, 40, 0.16);
}

html[data-theme="light"] .discovery-list dt,
html[data-theme="light"] .confirm-field {
  color: #6f695c;
}

html[data-theme="light"] .campaign-dialog {
  border-color: rgba(143, 111, 40, 0.42);
  background: #fffdf8;
  color: #1a1915;
  box-shadow: 0 26px 80px rgba(44, 34, 10, 0.24);
}

html[data-theme="light"] .icon-button {
  color: #6e551b;
}

html[data-theme="light"] .icon-button:hover {
  background: #f5f0df;
  color: #4d3a10;
}

html[data-theme="light"] .theme-switch {
  background: #f1ede3;
}

html[data-theme="light"] .theme-switch button {
  color: #6d675b;
}

html[data-theme="light"] .theme-switch button:hover {
  color: #5f4918;
}

html[data-theme="light"] * {
  scrollbar-color: #b89a4a #f3efe5;
}

html[data-theme="light"] *::-webkit-scrollbar-track {
  background: #f3efe5;
}

html[data-theme="light"] *::-webkit-scrollbar-thumb {
  border-color: #f3efe5;
  background: #b89a4a;
}

@media (max-width: 1280px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

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

@media (max-width: 1000px) {
  .stale-data-notice {
    display: none;
  }

  .learn-feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .learn-copy {
    padding-top: 0;
  }

  .desktop-sync-button {
    display: none;
  }

  .member-layout {
    grid-template-columns: 1fr;
  }

  .member-sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(300px, calc(100vw - 48px));
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .member-layout[data-menu-open="true"] .member-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  body[data-mobile-menu-open="true"],
  body:has(.campaign-dialog[open]) {
    overflow: hidden;
  }

  .member-sidebar .member-brand {
    width: calc(100% - 34px);
    flex-shrink: 0;
    padding-right: 8px;
    font-size: 14px;
  }

  .member-sidebar .sidebar-close {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: 8px;
    display: grid;
    width: 44px;
    height: 44px;
  }

  .member-nav-button,
  .sidebar-logout {
    min-height: 44px;
    flex-shrink: 0;
  }

  .sidebar-account {
    flex-shrink: 0;
    margin-top: 24px;
  }

  .mobile-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(18, 20, 17, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .member-layout[data-menu-open="true"] .mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .member-topbar {
    justify-content: flex-start;
    gap: 12px;
    padding: 0 18px;
    min-height: 64px;
  }

  .connection-status {
    margin-left: auto;
  }

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

  .metric:nth-child(4n) {
    border-right: 1px solid var(--app-line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--app-line);
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

}

@media (max-width: 1000px) {
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .membership-panel {
    width: min(100%, 560px);
  }

  .member-content {
    padding: 18px max(12px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .member-topbar {
    padding-inline: 12px;
    gap: 10px;
  }

  .workspace-section,
  .business-section,
  .analytics-panel,
  .view-header > div {
    min-width: 0;
  }

  .workspace-section,
  [data-view-panel] {
    scroll-margin-top: 80px;
  }

  .view-title {
    font-size: 30px;
  }

  .section-heading,
  .analytics-heading,
  .business-plan,
  .business-sync-status,
  .business-payout-status {
    overflow-wrap: anywhere;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .compact-button,
  .mini-action,
  .section-toggle,
  .text-button,
  .icon-button,
  .theme-switch button {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
    flex-basis: 44px;
  }

  .field-input,
  .compact-field input,
  .compact-field select,
  .community-picker select,
  .inline-select select,
  .metric-period-filter select,
  .chart-inspector select {
    min-height: 44px;
    font-size: 16px;
  }

  input[type="month"] {
    display: block;
    max-width: 100%;
    min-width: 0;
  }

  .field,
  .field-input,
  .campaign-form {
    min-width: 0;
  }

  .view-header,
  .section-heading,
  .members-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .section-actions {
    justify-content: flex-start;
  }

  .metrics-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-period-filter {
    justify-content: space-between;
  }

  .metric-period-filter select {
    width: min(240px, 72vw);
  }

  .opportunity-controls {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .opportunity-controls .inline-select,
  .opportunity-controls .inline-select select {
    width: 100%;
  }

  .community-picker,
  .community-picker select,
  .dashboard-header .primary-button {
    width: 100%;
  }

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

  .member-filter-primary {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-grid > .compact-field {
    grid-column: 1 / -1;
  }

  .filter-grid > .money-field {
    grid-column: span 1;
  }

  .member-toolbar {
    position: sticky;
    z-index: 11;
    top: 64px;
    align-items: stretch;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }

  .member-selection-controls > button:first-child {
    flex: 1;
  }

  .member-selection-controls .text-button {
    padding: 6px 8px;
    font-size: 12px;
  }

  .member-selection-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .member-selection-actions .selection-count {
    width: auto;
    margin: 0;
    font-size: 12px;
  }

  .member-selection-actions .compact-button {
    min-width: 0;
    padding-inline: 10px;
    font-size: 12px;
  }

  .member-export-menu > summary {
    min-height: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .member-export-menu > summary .disclosure-icon {
    display: none;
  }

  .member-toolbar[data-has-selection="false"] .member-selection-actions,
  .member-toolbar[data-has-selection="false"] #clear-selection,
  .member-table-frame {
    display: none;
  }

  .mobile-member-list {
    display: block;
    border: 1px solid var(--app-line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    overflow: clip;
  }

  .mobile-member-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 2px;
    padding: 8px 8px 8px 2px;
    border-bottom: 1px solid var(--app-line);
    background: var(--app-surface);
  }

  .mobile-member-row:nth-child(even) {
    background: var(--app-surface-soft);
  }

  .mobile-member-row:last-child {
    border-bottom: 0;
  }

  .mobile-member-row[data-selected="true"] {
    background: color-mix(in srgb, var(--app-gold) 14%, var(--app-surface));
    box-shadow: inset 3px 0 var(--app-gold);
  }

  .member-checkbox-target,
  .opportunity-checkbox-target {
    display: grid;
    width: 44px;
    min-height: 44px;
    align-self: start;
    place-items: center;
    cursor: pointer;
  }

  .member-checkbox-target input,
  .opportunity-checkbox-target input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--app-gold);
  }

  .mobile-member-details,
  .mobile-member-identity {
    min-width: 0;
  }

  .mobile-member-details > summary {
    display: grid;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) 20px;
    align-items: start;
    gap: 8px 6px;
    padding: 10px 2px;
    list-style: none;
    cursor: pointer;
  }

  .mobile-member-identity strong {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .mobile-member-email {
    display: block;
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .mobile-member-overview {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: var(--app-muted);
    font-size: 12px;
  }

  .mobile-member-overview strong {
    color: var(--app-ink);
  }

  .mobile-member-overview > span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .mobile-member-fields {
    display: grid;
    min-width: 0;
    margin: 0 2px 8px;
    border-top: 1px solid var(--app-line);
  }

  .mobile-member-fields > div {
    display: grid;
    min-width: 0;
    min-height: 42px;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--app-line);
  }

  .mobile-member-fields dt,
  .mobile-member-fields dd {
    min-width: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .mobile-member-fields dt {
    color: var(--app-muted);
  }

  .mobile-member-fields dd {
    text-align: right;
  }

  .mobile-member-fields dd small {
    display: block;
    margin-top: 3px;
    color: var(--app-muted);
    font-size: 11px;
  }

  .mobile-member-empty {
    margin: 0;
    padding: 36px 18px;
    color: var(--app-muted);
    font-size: 14px;
    text-align: center;
  }

  .sort-field,
  .search-field {
    grid-column: 1 / -1;
  }

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

  .opportunity-list,
  .analytics-grid,
  .business-plan-list {
    grid-template-columns: 1fr;
  }

  .business-share-band {
    grid-template-columns: 1fr;
  }

  .business-share-band .secondary-button {
    justify-self: start;
  }

  .analytics-wide {
    grid-column: auto;
  }

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

  .chart-summary-item:nth-child(2) {
    border-right: 0;
  }

  .chart-summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--app-line);
  }

  .chart-legend small {
    display: none;
  }

  .chart-inspector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
  }

  .chart-inspector select {
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--app-line-strong);
    border-radius: 7px;
    background: var(--app-surface);
    color: var(--app-ink);
  }

  .chart-stage {
    height: auto;
    min-height: 0;
  }

  .chart-tooltip {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    box-shadow: none;
  }

  .chart-tooltip dl > div {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chart-tooltip dt {
    white-space: normal;
  }

  .chart-data > summary {
    min-height: 44px;
  }

  .opportunity-item {
    grid-template-columns: 44px minmax(0, 1fr);
    border-right: 0;
    padding: 12px 10px 12px 2px;
  }

  .opportunity-title-row {
    flex-wrap: wrap;
  }

  .opportunity-title-row strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .opportunity-copy p {
    font-size: 12px;
  }

  .opportunity-item:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--app-line);
  }

  .opportunity-item:last-child {
    border-bottom: 0;
  }

  .opportunity-actions {
    grid-column: 2;
  }

  .campaign-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    overflow-wrap: anywhere;
  }

  .campaign-row > :nth-child(3),
  .campaign-row > :nth-child(4) {
    display: block;
  }

  .campaign-row > :nth-child(4) {
    justify-self: end;
  }

  .template-actions,
  .campaign-fields {
    grid-template-columns: 1fr;
  }

  .campaign-dialog {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    overscroll-behavior: contain;
  }

  .campaign-form {
    gap: 14px;
    padding: 16px;
  }

  .campaign-dialog-header {
    position: sticky;
    z-index: 2;
    top: 0;
    padding-block: 10px;
    background: var(--app-surface);
  }

  .campaign-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--app-line);
    background: var(--app-surface);
  }

  .confirm-field {
    min-height: 44px;
    align-items: center;
    gap: 12px;
  }

  .confirm-field input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 600px) and (max-width: 1000px) {
  .member-toolbar {
    align-items: center;
    flex-direction: row;
  }

  .member-filter-primary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .filter-grid > .compact-field {
    grid-column: span 1;
  }

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

  .analytics-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .auth-header,
  .auth-main {
    width: min(100% - 28px, 460px);
  }

  .auth-header {
    min-height: 62px;
  }

  .auth-home-link {
    display: none;
  }

  .auth-header-actions {
    gap: 8px;
  }

  .theme-switch button {
    padding-inline: 8px;
  }

  .auth-main {
    align-items: start;
    padding: 30px 0 50px;
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .topbar-community-name {
    display: none;
  }

  .connection-status {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    padding: 13px;
  }

  .metric-value {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .metric-foot {
    display: none;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart svg {
    min-height: 200px;
    height: 200px;
  }

  .section-actions .compact-button {
    flex: 1 1 calc(50% - 8px);
  }

  .filter-footer {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .filter-actions {
    width: 100%;
  }

  .member-search-button {
    flex: 1;
  }

  .campaign-form {
    padding: 16px;
  }

  .access-blocked-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

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