:root {
  --page-scale: 0.67;
  --sidebar: #252524;
  --green: #14a44d;
  --green-dark: #0f7f3b;
  --text: #111111;
  --muted: #666666;
  --line: #e6e6e6;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  zoom: var(--page-scale);
}

@supports not (zoom: 1) {
  body {
    transform: scale(var(--page-scale));
    transform-origin: top left;
    width: calc(100% / var(--page-scale));
    min-height: calc(100vh / var(--page-scale));
  }
}

a {
  color: inherit;
}

.public-page {
  min-height: calc(100vh - 172px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  background: var(--bg);
}

.public-top-bar {
  min-height: clamp(86px, 14vh, 128px);
  background: #070707;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-shell {
  min-height: 100vh;
}

.home-frame-bar,
.home-footer {
  min-height: 50px;
  background: var(--sidebar);
}

.home-page {
  min-height: calc(100vh - 100px);
  align-items: center;
}

.public-wrap {
  width: min(920px, 100%);
}

.home-wrap {
  padding: 42px 0;
}

.public-logo {
  display: block;
  width: min(260px, 70vw);
  height: auto;
  margin-bottom: 36px;
}

.public-title {
  max-width: 680px;
  margin: 0 0 8px;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 800;
}

.public-channel {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 20px;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.home-title {
  max-width: 760px;
  margin-bottom: 26px;
  font-size: clamp(32px, 4.5vw, 58px);
  line-height: 1.05;
}

.public-text {
  max-width: 540px;
  margin: 0 0 30px;
  font-size: 20px;
  line-height: 1.45;
  color: var(--muted);
}

.home-lead-list {
  max-width: 760px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 21px;
  line-height: 1.55;
  color: var(--text);
}

.home-lead-list li + li {
  margin-top: 8px;
}

.home-invite {
  max-width: 660px;
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

.public-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
}

.home-footer a {
  color: #ffffff;
  font-weight: 800;
}

.type-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.type-option {
  min-height: 58px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.type-option span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.type-option.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.type-option.active span {
  color: rgba(255, 255, 255, 0.86);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--text);
  background: var(--text);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #ffffff;
  color: var(--text);
}

.button.green {
  border-color: var(--green);
  background: var(--green);
}

.button.green:hover {
  background: var(--green-dark);
}

.top-note {
  margin-top: 26px;
  font-size: 14px;
  color: var(--muted);
}

.legal-mini,
.public-legal-footer {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.legal-mini a,
.public-legal-footer a {
  color: var(--muted);
  text-decoration: underline;
}

.public-legal-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 26px;
  padding: 12px 14px;
  background: #070707;
  color: #ffffff;
  text-align: center;
}

.public-legal-footer a {
  color: #ffffff;
  font-weight: 800;
}

.legal-page {
  min-height: calc(100vh - 100px);
  padding: 46px 24px;
}

.legal-wrap {
  width: min(900px, 100%);
  margin: 0 auto;
}

.legal-logo {
  display: block;
  width: 220px;
  max-width: 70vw;
  height: auto;
  margin: 14px 0 28px;
}

.legal-back {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.legal-wrap h1 {
  max-width: 760px;
  margin: 0 0 22px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.08;
}

.legal-text {
  max-width: 860px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #202020;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.legal-section .legal-text {
  padding-top: 0;
  border-top: 0;
}

.policies-index {
  max-width: 760px;
}

.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.policy-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.policy-links a:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.public-form {
  width: min(640px, 100%);
}

.public-form textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.public-form input,
.public-form select,
.public-form textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.public-form input,
.public-form select {
  height: 46px;
  padding: 0 12px;
}

.public-form input:focus,
.public-form select:focus,
.public-form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row.three {
  grid-template-columns: repeat(3, 1fr);
}

.form-row.four {
  grid-template-columns: repeat(4, 1fr);
}

.voice-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.voice-preview audio {
  width: 100%;
  min-width: 0;
}

.result-box {
  display: none;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.result-box.active {
  display: block;
}

.qr-image {
  width: 260px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.copy-code {
  width: 100%;
  min-height: 90px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cfcfcf;
  background: #fafafa;
  font-family: Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.audio-panel {
  display: none;
  margin: 0 0 18px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audio-panel.active {
  display: block;
}

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

.audio-panel p {
  margin: 0 0 14px;
  color: var(--muted);
}

.audio-preview {
  display: none;
  width: 100%;
  margin: 4px 0 10px;
}

.audio-preview.active {
  display: block;
}

.small-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.login-page {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
}

.login-box img {
  display: block;
  width: 210px;
  margin-bottom: 34px;
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.18;
}

.login-box p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.45;
}

.login-help {
  font-size: 14px;
}

.login-help a {
  color: var(--green-dark);
  font-weight: 800;
}

.login-return {
  margin: 18px 0 0;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 46px;
  border: 1px solid #cfcfcf;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.field textarea,
.plain-table textarea,
.plain-table select,
.plain-table input {
  width: 100%;
  border: 1px solid #cfcfcf;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.field textarea,
.plain-table textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.error {
  margin: 0 0 16px;
  padding: 12px;
  border-left: 4px solid #b42318;
  background: #fff4f2;
  color: #7a1b13;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  overflow-y: auto;
  background: var(--sidebar);
  color: #ffffff;
  padding: 22px 20px;
}

.sidebar-logo {
  display: block;
  width: 156px;
  height: auto;
  margin-bottom: 18px;
}

.sidebar-user {
  padding: 0 0 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-user span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  line-height: 1.2;
}

.sidebar-user strong {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar-user a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-user a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-section {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-section-balance {
  padding: 14px 0 12px;
}

.sidebar-section-compact {
  padding: 7px 0;
}

.sidebar-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  text-transform: uppercase;
}

.sidebar-value {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.sidebar-section-balance .sidebar-label {
  margin-bottom: 5px;
  font-size: 11px;
}

.sidebar-section-balance .sidebar-value {
  font-size: 28px;
  line-height: 1;
}

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

.sidebar-nav a {
  display: block;
  padding: 9px 10px;
  color: #ffffff;
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
}

.sidebar-nav a.active {
  background: var(--green);
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active:hover {
  background: var(--green);
}

.app-main {
  width: calc(100% - 270px);
  margin-left: 270px;
  padding: 38px min(6vw, 64px);
}

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

.page-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.simple-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.metric {
  min-height: 140px;
  padding: 28px;
  background: #ffffff;
}

.admin-metrics .metric strong {
  font-size: 34px;
}

.admin-filter {
  max-width: 860px;
}

.admin-users-table textarea,
.support-table textarea {
  min-width: 180px;
}

.admin-transactions-table small,
.support-table small {
  color: var(--muted);
  font-size: 11px;
}

.admin-copy-line {
  margin-top: 10px;
  max-width: none;
  font-size: 14px;
}

.admin-copy-line a {
  color: var(--text);
  font-weight: 800;
}

.admin-test-table th {
  width: 160px;
  text-align: left;
  color: var(--muted);
}

.admin-test-table textarea {
  width: 100%;
  min-height: 88px;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.inline-admin-form {
  margin: 10px 0 14px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.admin-mp-test-table {
  min-width: 1460px;
}

.mp-card-test-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.payment-cell textarea {
  width: 320px;
  min-height: 74px;
  margin-top: 6px;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.payment-cell details {
  max-width: 340px;
}

.mp-test-qr {
  display: block;
  width: 118px;
  height: 118px;
  margin-top: 8px;
  border: 1px solid var(--line);
}

.button.small {
  padding: 8px 12px;
  min-height: 0;
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.approved {
  border-color: var(--green);
  color: var(--green);
}

.status-pill.pending {
  color: var(--muted);
}

.metric span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 38px;
}

.section {
  margin-top: 0;
  padding-top: 0;
}

.section-separator {
  max-width: 980px;
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.section p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.plain-table th,
.plain-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.plain-table th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.messages-table tbody tr:nth-child(odd) td {
  background: #ffffff !important;
}

.messages-table tbody tr:nth-child(even) td {
  background: #cfcfcf !important;
}

.messages-table td {
  font-size: 13px;
  border-bottom: 2px solid #c8c8c8;
}

.messages-table tbody tr:hover td {
  background: #e9f8ee !important;
}

.public-url-callout {
  display: block;
  margin-top: 8px;
  color: #111111;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.messages-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.messages-toolbar h2 {
  margin-bottom: 0;
}

.auto-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.widget-section .code-line {
  max-width: 920px;
}

.widget-section + .section-separator {
  margin-top: 28px;
}

.table-audio {
  width: min(260px, 100%);
}

.audio-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.audio-badge.pending {
  border-color: var(--green);
  color: var(--green-dark);
}

.table-action {
  min-height: 28px;
  margin: 0 5px 5px 0;
  padding: 0 9px;
  border: 1px solid var(--text);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.icon-action {
  min-width: 52px;
}

.table-action.green {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.code-line {
  display: block;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fafafa;
  font-family: Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
}

.inline-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.security-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 16px;
  padding: 0 10px;
  border: 1px solid #cfcfcf;
  color: var(--muted);
  font-weight: 800;
}

.security-status.active {
  border-color: var(--green);
  color: var(--green-dark);
}

.totp-setup {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  margin: 16px 0;
}

.totp-qr {
  width: 180px;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #ffffff;
}

.totp-qr svg {
  width: 168px;
  height: 168px;
}

.pix-verification-tools {
  display: none;
}

.danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
}

.danger-zone h2 {
  color: #7a1b13;
}

@media (max-width: 760px) {
  .app-layout {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  .app-main {
    width: 100%;
    margin-left: 0;
    padding: 28px 20px;
  }

  .page-head {
    display: block;
  }

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

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

  .form-row.three {
    grid-template-columns: 1fr;
  }

  .form-row.four {
    grid-template-columns: 1fr;
  }

  .type-options {
    grid-template-columns: 1fr;
  }

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

  .metric {
    min-height: 110px;
  }
}
