* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
:root {
  --bg-top: #eef5ff;
  --bg-bottom: #e7f4ef;
  --text: #10233f;
  --muted: #4f6483;
  --card-bg: #ffffff;
  --surface: #f8fbff;
  --surface-2: #f3f8ff;
  --border: #d6e4f8;
  --border-strong: #bdd3ef;
  --table-border: #e3ebf8;
  --nav-bg: #ffffff;
  --input-bg: #ffffff;
  --link: #1a3762;
  --heading: #0f2b56;
  --shadow: 0 8px 24px rgba(16, 35, 63, 0.08);
  --primary-start: #0f67d8;
  --primary-end: #2e8cff;
  --secondary-start: #15803d;
  --secondary-end: #24b361;
  --danger-start: #cf3b3b;
  --danger-end: #ef5858;
  --accent-start: #7c3aed;
  --accent-end: #a855f7;
  --switch-track: #e5eefc;
  --switch-border: #c3d8f6;
}
[data-theme="dark"] {
  --bg-top: #0b1422;
  --bg-bottom: #122135;
  --text: #f3f7ff;
  --muted: #c7d5eb;
  --card-bg: #0f1b2d;
  --surface: #13243a;
  --surface-2: #172b46;
  --border: #28405f;
  --border-strong: #33517a;
  --table-border: #233650;
  --nav-bg: #0f1b2d;
  --input-bg: #0c1727;
  --link: #e1edff;
  --heading: #f3f7ff;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  --primary-start: #2d7df6;
  --primary-end: #4aa3ff;
  --secondary-start: #189c56;
  --secondary-end: #2fc975;
  --danger-start: #db4b4b;
  --danger-end: #f46c6c;
  --accent-start: #8b5cf6;
  --accent-end: #b780ff;
  --switch-track: #1a2d47;
  --switch-border: #35557d;
}
body {
  margin: 0;
  font-family: "Noto Sans", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
}
.page {
  width: min(1360px, 94vw);
  margin: 18px auto 28px;
}
.hidden { display: none !important; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.auth-shell { max-width: 920px; margin: 18px auto; }
.landing-shell { display: flex; flex-direction: column; gap: 14px; }
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 8px;
  z-index: 20;
}
.landing-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.landing-links a {
  text-decoration: none;
  color: var(--link);
  font-weight: 700;
}
.landing-links button { width: auto; }
.landing-hero h2 { margin: 0 0 10px; font-size: 2rem; color: var(--heading); }
.landing-hero p { margin: 0 0 14px; color: var(--muted); }
.landing-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.feature-grid, .price-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}
.price-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.feature-item, .price-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.feature-item h3, .price-item h3 { margin: 0 0 8px; }
.feature-item p, .price-item p { margin: 0; color: var(--muted); }
.pricing-hint { margin: 0 0 10px; }
.pricing-hint.error { color: #b42318; font-weight: 700; }
.plan-pick-btn { margin-top: 10px; width: 100%; }
.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 88px; height: 88px; object-fit: contain; }
.brand-logo.small { width: 52px; height: 52px; }
.brand-row h1 { margin: 0; font-size: 3rem; color: var(--heading); }
.welcome { margin: 18px 0 12px; font-size: 2rem; font-weight: 700; }
.lang-bar { display: flex; align-items: center; gap: 8px; }
.lang-bar label { font-weight: 700; }
.lang-select { width: auto; min-width: 140px; }
.tabs { display: flex; gap: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary-start); border-bottom-color: var(--primary-start); }
.auth-card { display: flex; flex-direction: column; gap: 10px; }
.auth-mobile-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-mobile-notice h3 { margin: 0; }
.password-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.password-field input {
  flex: 1 1 auto;
}
.password-toggle-btn {
  width: auto;
  min-width: 88px;
  white-space: nowrap;
}
.full { width: 100%; }
#signupPlanBanner {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
  margin-bottom: 2px;
}
.plan-shell { max-width: 980px; margin: 16px auto; }
.plan-switch-grid {
  margin: 8px 0 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}
.switch-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.switch-label {
  font-weight: 700;
  margin-bottom: 8px;
}
.toggle-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--switch-border);
  border-radius: 999px;
  background: var(--switch-track);
  padding: 4px;
  overflow: hidden;
  max-width: 240px;
}
.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, #1e74d6, #23a35c);
  box-shadow: 0 4px 12px rgba(16, 35, 63, 0.16);
  transition: transform 0.2s ease;
  pointer-events: none;
}
.toggle-switch[data-state="right"] .toggle-thumb {
  transform: translateX(100%);
}
.toggle-switch button {
  position: relative;
  z-index: 1;
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.1;
}
.toggle-switch button.active {
  color: #ffffff;
}
#billingCycleSwitch {
  max-width: 210px;
}
#planTypeSwitch {
  max-width: 230px;
}
.plan-grid {
  margin: 12px 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.plan-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-option h3 { margin: 0 0 6px; }
.plan-option p { margin: 0; color: var(--muted); }
.plan-option.active {
  border-color: #23a35c;
  box-shadow: 0 0 0 2px rgba(35, 163, 92, 0.2) inset;
}
.plan-option.segment-hidden {
  display: none;
}
.plan-option label {
  font-weight: 600;
  margin-top: 4px;
}
.plan-mini-features {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}
.plan-mini-features li {
  line-height: 1.3;
}
.plan-coupon-input {
  width: 100%;
}
.plan-continue-btn {
  margin-top: 2px;
  width: 100%;
}

.top {
  background: linear-gradient(135deg, #165ec6, #23a35c);
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-left { display: flex; align-items: center; gap: 12px; }
.top-logo { width: 56px; height: 56px; object-fit: contain; }
.top h1 { margin: 0; font-size: 2.3rem; }
.top-right { display: flex; align-items: center; gap: 10px; }
.app-mode-shell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-mode-shell > span {
  font-weight: 700;
}
.mode-toggle {
  max-width: 230px;
  min-width: 230px;
}
.badge { font-size: 1.12rem; font-weight: 600; }

.workspace-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.business-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.business-upgrade-card {
  border: 1px solid rgba(224, 83, 116, 0.28);
  background: linear-gradient(135deg, rgba(224, 83, 116, 0.12), rgba(193, 120, 25, 0.12));
}
.business-inline-grid,
.business-permissions-grid,
.business-modules {
  display: grid;
  gap: 10px;
}
.business-inline-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 12px;
}
.business-permissions-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 8px 0 12px;
}
.business-modules {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.module-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}
.module-card.enabled {
  border-color: rgba(35, 163, 92, 0.35);
  box-shadow: 0 0 0 1px rgba(35, 163, 92, 0.12) inset;
}
.module-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.module-card p {
  margin: 6px 0 0;
  color: var(--muted);
}
.module-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.module-state.enabled {
  background: rgba(35, 163, 92, 0.14);
  color: var(--secondary-start);
}
.module-state.locked {
  background: rgba(79, 100, 131, 0.14);
  color: var(--muted);
}
.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}
.checkbox-chip input {
  width: auto;
  min-width: 18px;
  margin: 0;
}
.business-employees-list .stack-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.business-employees-list .stack-item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.business-employees-list .stack-item-meta strong {
  font-size: 1rem;
}
.business-employees-list .stack-item-meta span {
  color: var(--muted);
}

.billing-lock-banner {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.billing-lock-banner.active {
  border: 1px solid rgba(35, 163, 92, 0.28);
  background: linear-gradient(135deg, rgba(22, 94, 198, 0.08), rgba(35, 163, 92, 0.08));
}
.billing-lock-banner.locked {
  border: 1px solid rgba(224, 83, 116, 0.28);
  background: linear-gradient(135deg, rgba(224, 83, 116, 0.12), rgba(193, 120, 25, 0.12));
}
.billing-lock-copy {
  flex: 1 1 auto;
}
.billing-lock-copy h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.billing-lock-copy p {
  margin: 0;
}
.billing-lock-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.kpi-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}
.kpi-card {
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  background: linear-gradient(135deg, #1f7ae0, #31a9ff);
}
.kpi-card.debt { background: linear-gradient(135deg, #cc3a58, #f06a8b); }
.kpi-card.income { background: linear-gradient(135deg, #15985e, #37c783); }
.kpi-card.expense { background: linear-gradient(135deg, #c17819, #ebb347); }
.kpi-card h3 { margin: 0; font-size: 0.95rem; opacity: 0.95; }
.kpi-card p { margin: 8px 0 0; font-size: 1.5rem; font-weight: 700; }

.app-status { margin-top: 14px; }
.muted { color: var(--muted); }

.charts { margin-top: 14px; }
.chart-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}
.chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}
.chart-card h3 { margin: 0 0 8px; }
.chart-card canvas { width: 100% !important; height: 220px !important; }
.chart-empty {
  margin: auto 0;
  padding: 22px 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}
.span-2 { grid-column: span 2; }

h2 { margin: 0 0 12px; font-size: 1.9rem; color: var(--heading); }
label { font-weight: 700; }
input, select, textarea {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 120px;
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
}
textarea {
  font: inherit;
  resize: vertical;
}
button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15, 43, 86, 0.12);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.03); }
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(46, 140, 255, 0.28);
  outline-offset: 2px;
}
button.secondary { background: linear-gradient(135deg, var(--secondary-start), var(--secondary-end)); }
button.danger { background: linear-gradient(135deg, var(--danger-start), var(--danger-end)); }
button.accent { background: linear-gradient(135deg, var(--accent-start), var(--accent-end)); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.row > * { flex: 1 1 180px; min-width: 0; }
.row.compact { margin-bottom: 0; }
.phone-row > #authCountryCode { flex: 0 0 150px; }
.phone-row > #authPhoneLocal { flex: 1 1 220px; }
.transfer-panel {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.transfer-panel h3 {
  margin: 0 0 6px;
  color: var(--heading);
}
.transfer-panel p {
  margin: 0 0 10px;
}

.tx-filter-panel {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.tx-filter-panel h3 {
  margin: 0 0 8px;
  color: var(--heading);
}

.tx-filter-totals {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.tx-filter-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.tx-filter-total span {
  color: var(--muted);
  font-weight: 700;
}

.tx-filter-total strong {
  font-size: 1.08rem;
}

.tx-filter-total.income strong {
  color: #2fbf71;
}

.tx-filter-total.expense strong {
  color: #ffb02f;
}

table { width: 100%; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid var(--table-border);
  text-align: left;
  padding: 8px 6px;
  font-size: 0.95rem;
}
th { color: var(--muted); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.plan-meta > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px;
}
.plan-meta > .plan-meta-wide {
  flex: 1 1 100%;
}
.plan-meta strong {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.plan-btn.active {
  outline: 2px solid #23a35c;
}
.profile-avatar-box {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-avatar {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
#embeddedCheckoutContainer {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 8px;
}
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.theme-switch.compact {
  margin-right: 4px;
}
.theme-toggle {
  position: relative;
  width: 64px;
  min-width: 64px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
  background: linear-gradient(135deg, var(--primary-start), var(--accent-end));
}
.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}
.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(28px);
}
.billing-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}
.billing-panel-head h3 {
  margin: 0 0 6px;
  color: var(--heading);
}
.billing-panel-head p {
  margin: 0;
}
.billing-panel-actions {
  margin-top: 10px;
}
#signupEmbeddedCheckoutContainer {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 8px;
}
.auth-inline-note {
  margin: 2px 0 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 30, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 80;
}
.modal-card {
  width: min(520px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal-body {
  padding: 18px;
}
.modal-body h3 {
  margin: 0 0 10px;
  color: var(--heading);
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.modal-actions button {
  width: auto;
  min-width: 180px;
}
.payment-shell {
  max-width: 920px;
}
.payment-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}
.payment-card h2 {
  margin: 0;
}
.payment-card p {
  margin: 0;
}
.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}
.payment-summary-item,
.payment-message-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}
.payment-summary-item strong,
.payment-message-card p {
  display: block;
  margin-top: 6px;
}
.payment-summary-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}
.payment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.payment-actions button {
  width: auto;
  min-width: 220px;
}
#paymentStatus[data-kind="success"] {
  color: #1f9d5a;
  font-weight: 700;
}
#paymentStatus[data-kind="warning"] {
  color: #c77f14;
  font-weight: 700;
}
#paymentStatus[data-kind="error"] {
  color: #d14343;
  font-weight: 700;
}
.admin-shell-page {
  max-width: 1400px;
}
.admin-auth-shell {
  max-width: 760px;
  margin: 22px auto 0;
}
.admin-auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.admin-toolbar {
  margin-bottom: 18px;
}
.admin-toolbar-note {
  margin: 4px 0 0;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-search {
  margin: 0 0 10px;
}
.error-text {
  color: #d14343;
  font-weight: 700;
}
.success-text {
  color: #1f9d5a;
  font-weight: 700;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.row.compact {
  gap: 10px;
}
.bank-sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.stack-list-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 18px;
  padding: 16px;
}
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.stack-item {
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
}
.stack-item-title {
  font-weight: 700;
}
.stack-item-meta {
  margin-top: 4px;
  color: var(--muted-color, #9fb0c7);
  font-size: 0.95rem;
}
.callout {
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.28);
  color: inherit;
}
.callout.hidden { display: none; }

.support-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 75;
  width: auto;
  min-width: 120px;
}

.support-widget {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 76;
  width: min(420px, calc(100vw - 20px));
  max-height: calc(100vh - 120px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.support-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.support-widget-head h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.support-head-btn {
  width: auto;
  min-width: 96px;
}

.support-note {
  margin: 0;
  font-size: 0.92rem;
}

.support-quick-questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-suggestion-btn {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
}

.support-messages {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.support-message {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.support-message.user {
  align-self: flex-end;
  color: #ffffff;
  border-top-right-radius: 4px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.support-message.assistant {
  align-self: flex-start;
  border-top-left-radius: 4px;
}

.support-message-topic {
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
}

.support-message-body {
  white-space: pre-wrap;
  line-height: 1.45;
}

.support-message-steps,
.support-message-escalation {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.support-message-escalation {
  color: var(--danger-start);
  font-weight: 700;
}

.support-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-compose textarea {
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.support-compose-actions {
  display: flex;
  gap: 10px;
}

.support-compose-actions > * {
  flex: 1 1 0;
}

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .feature-grid, .price-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .profile-avatar-box { flex: 1 1 100%; }
  .profile-avatar { width: 120px; height: 120px; }
  #embeddedCheckoutContainer { min-height: 460px; }
}
@media (max-width: 920px) {
  .page { width: 96vw; }
  .auth-top, .top { flex-direction: column; align-items: flex-start; }
  .landing-nav { flex-direction: column; align-items: flex-start; }
  .brand-row h1 { font-size: 2.1rem; }
  .welcome { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .plan-switch-grid { grid-template-columns: 1fr; }
  .business-hero { flex-direction: column; }
  .billing-lock-banner { flex-direction: column; align-items: stretch; }
  .billing-lock-actions { justify-content: stretch; }
  .billing-lock-actions button { width: 100%; }
  .payment-summary-grid { grid-template-columns: 1fr; }
  .admin-auth-shell { max-width: 100%; }
}
@media (max-width: 640px) {
  .page { width: 98vw; margin: 8px auto 16px; }
  .card { padding: 12px; border-radius: 12px; }
  .top h1 { font-size: 1.8rem; }
  .top-logo { width: 44px; height: 44px; }
  .top-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .app-mode-shell { width: 100%; flex-direction: column; align-items: stretch; }
  .mode-toggle { max-width: none; min-width: 0; }
  h2 { font-size: 1.6rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card p { font-size: 1.35rem; }
  .row > * { flex: 1 1 100%; min-width: 0; }
  .tx-filter-totals { grid-template-columns: 1fr; }
  .password-field {
    flex-direction: column;
  }
  .password-toggle-btn {
    width: 100%;
    min-width: 0;
  }
  button { width: 100%; }
  td button { width: auto; }
  .top-right button { width: auto; }
  .modal-actions button,
  .payment-actions button { width: 100%; min-width: 0; }
  .lang-select { width: 100%; min-width: 0; }
  .landing-links { width: 100%; gap: 8px; }
  .landing-links a { font-size: 1.15rem; }
  .landing-hero h2 { font-size: 1.4rem; }
  .landing-cta { flex-direction: column; }
  .landing-cta button { width: 100%; }
  .admin-auth-links { flex-direction: column; }
  .admin-auth-links a { width: 100%; }
  .feature-grid, .price-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .support-widget {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 74px;
    max-height: calc(100vh - 88px);
  }
  .support-launcher {
    right: 8px;
    left: 8px;
    width: auto;
  }
  .support-head-btn,
  .support-suggestion-btn {
    width: 100%;
  }
  .support-compose-actions {
    flex-direction: column;
  }
  table.mobile-stack thead { display: none; }
  table.mobile-stack,
  table.mobile-stack tbody,
  table.mobile-stack tr,
  table.mobile-stack td {
    display: block;
    width: 100%;
  }
  table.mobile-stack tr {
    border: 1px solid var(--table-border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--card-bg);
  }
  table.mobile-stack td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 0;
    padding: 6px 4px;
    white-space: normal;
    word-break: break-word;
  }
  table.mobile-stack td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 0 0 40%;
    max-width: 40%;
  }
  table.mobile-stack td.table-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  table.mobile-stack td.table-actions::before {
    flex: 0 0 auto;
    max-width: 100%;
  }
  table.mobile-stack td.table-actions button {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    font-size: 0.88rem;
    border-radius: 8px;
  }
  .chart-card canvas { height: 190px !important; }
  #embeddedCheckoutContainer { min-height: 420px; }
}

@media (max-width: 480px) {
  .page { width: 100vw; margin: 0; padding: 6px; }
  .card { padding: 10px; border-radius: 10px; }
  .top { padding: 10px; }
  .top-left { gap: 8px; }
  .top h1 { font-size: 1.5rem; }
  .badge { font-size: 0.95rem; }
  h2 { font-size: 1.35rem; margin-bottom: 8px; }
  .kpi-card { padding: 10px; }
  .kpi-card h3 { font-size: 0.85rem; }
  .kpi-card p { font-size: 1.1rem; }
  input, select, button { font-size: 0.95rem; }
  th, td { font-size: 0.88rem; padding: 7px 5px; }
  #accountsRows td,
  #txRows td { font-size: 0.84rem; }
  .chart-card canvas { height: 170px !important; }
}

@media (max-width: 380px) {
  .top h1 { font-size: 1.25rem; }
  .top-logo { width: 36px; height: 36px; }
  .badge { font-size: 0.86rem; }
}

