:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #ccfbf1;
  --buyer-bg: #eff6ff;
  --buyer-border: #bfdbfe;
  --buyer-text: #1e3a8a;
  --profit-bg: #ecfdf5;
  --profit-border: #a7f3d0;
  --profit-text: #065f46;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --cta-bg: #0f172a;
  --cta-accent: #14b8a6;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0f766e 0%, #0f172a 100%);
  color: #ffffff;
  padding: 24px 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-ph,
.badge-free {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-ph {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.badge-free {
  background: #ccfbf1;
  color: #0f766e;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #e2e8f0;
  max-width: 680px;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 28px;
}

@media (min-width: 860px) {
  .main-grid {
    grid-template-columns: 1.02fr 0.98fr;
    align-items: start;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.section-subheading {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* Form Elements */
.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.96rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.field-row {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

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

@media (min-width: 480px) {
  .three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Buttons */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

button,
.btn-cta {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  transition: background-color 0.15s ease, transform 0.08s ease;
}

button:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  font-size: 0.9rem;
  flex: 1;
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 0.88rem;
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

/* Results Column */
.results-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.status-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-good {
  background: var(--profit-bg);
  color: var(--profit-text);
  border: 1px solid var(--profit-border);
}

.status-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.status-loss {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.kpi-box {
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.kpi-buyer {
  background: var(--buyer-bg);
  border: 1px solid var(--buyer-border);
  color: var(--buyer-text);
}

.kpi-profit {
  background: var(--profit-bg);
  border: 1px solid var(--profit-border);
  color: var(--profit-text);
}

.kpi-profit.is-loss {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 4px 0 2px;
}

.kpi-sub {
  font-size: 0.78rem;
  opacity: 0.9;
}

/* Breakdown Table */
.breakdown-box {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.breakdown-box h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.breakdown-list {
  margin: 0;
}

.b-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 5px 0;
  border-bottom: 1px dashed #cbd5e1;
}

.b-row dt {
  color: var(--text);
}

.b-row dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.b-total,
.b-net {
  border-bottom: 1px solid #94a3b8;
  font-weight: 700;
  padding: 8px 0;
}

.b-net {
  border-bottom: none;
  font-size: 1rem;
  color: var(--primary);
}

.text-danger {
  color: var(--danger-text);
}

.text-muted {
  color: var(--text-muted);
}

.fee-summary-line {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
}

/* Copy Box */
.copy-box {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.copy-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.copy-header label {
  font-size: 0.86rem;
  font-weight: 700;
}

#buyer-message-preview {
  background: #f8fafc;
  font-size: 0.86rem;
  line-height: 1.45;
  resize: vertical;
}

.copy-toast {
  margin: 8px 0 0;
  padding: 8px 12px;
  background: var(--profit-bg);
  border: 1px solid var(--profit-border);
  color: var(--profit-text);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

/* History List */
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
}

.history-item-main {
  display: flex;
  flex-direction: column;
}

.history-item-title {
  font-weight: 700;
  color: var(--text);
}

.history-item-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.empty-history {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 6px 0;
}

/* Bottom Lead Magnet CTA Banner */
.aether-cta-banner {
  background: var(--cta-bg);
  color: #ffffff;
  border-top: 3px solid var(--cta-accent);
  padding: 22px 0;
  margin-top: 12px;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cta-tag {
  display: inline-block;
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.cta-text {
  margin: 0 0 4px;
  font-size: 0.98rem;
  line-height: 1.45;
}

.cta-subtext {
  margin: 0;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.btn-cta {
  display: inline-block;
  text-decoration: none;
  background: var(--cta-accent);
  color: #042f2e;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 12px 20px;
  border-radius: 10px;
  white-space: nowrap;
  text-align: center;
}

.btn-cta:hover {
  background: #2dd4bf;
}

/* Footer */
.app-footer {
  padding: 16px 0 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* Mode Switcher Tabs & Live AI Receptionist Demo Styles */
.badge-demo {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.22);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.45);
}

.title-sub {
  font-size: 1.15rem;
  font-weight: 600;
  color: #5eead4;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mode-tab {
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.mode-tab:hover {
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
}

.mode-tab.is-active {
  background: #ffffff;
  color: #0f766e;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.demo-bridge-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.demo-bridge-box strong {
  display: block;
  font-size: 0.88rem;
  color: #0f766e;
}

.demo-bridge-box p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #115e59;
}

.demo-section {
  padding-top: 20px;
  padding-bottom: 28px;
}

.demo-intro-card {
  margin-bottom: 18px;
}

.demo-intro-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

@media (min-width: 780px) {
  .demo-intro-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.demo-intro-card h2 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
}

.demo-intro-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 680px;
}

.demo-price-badge {
  background: #0f172a;
  color: #ffffff;
  border: 2px solid #14b8a6;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  min-width: 240px;
}

.price-pill-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5eead4;
  font-weight: 700;
}

.price-pill-val {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 2px 0;
}

.price-pill-note {
  font-size: 0.76rem;
  color: #cbd5e1;
}

.scenario-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 760px) {
  .scenario-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

.scenario-btn {
  padding: 12px 14px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}

.scenario-btn:hover {
  background: #e2e8f0;
}

.scenario-btn.is-active {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 860px) {
  .demo-grid {
    grid-template-columns: 0.92fr 1.08fr;
    align-items: start;
  }
}

.badge-verified {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.demo-kb-desc {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.kb-facts-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.kb-facts-box h4,
.vs-chatgpt-box h4 {
  margin: 0 0 8px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.kb-facts-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vs-chatgpt-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.vs-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.vs-bad {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  color: #991b1b;
}

.vs-good {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  color: #065f46;
}

.vs-bad p,
.vs-good p {
  margin: 4px 0 0;
}

.chat-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.chat-window-header strong {
  display: block;
  font-size: 0.96rem;
}

.chat-status-badge {
  font-size: 0.76rem;
  color: #0f766e;
  font-weight: 600;
}

.prompt-chips-box {
  margin-bottom: 12px;
}

.chips-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.prompt-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #5eead4;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.prompt-chip:hover {
  background: #ccfbf1;
}

.demo-chat-log {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  min-height: 290px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.chat-msg-customer {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.chat-msg-bot {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-bottom-left-radius: 3px;
}

.chat-msg-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.tag-faq {
  background: #065f46;
  color: #6ee7b7;
}

.tag-handoff {
  background: #1e3a8a;
  color: #93c5fd;
}

.tag-guard {
  background: #7f1d1d;
  color: #fca5a5;
}

.demo-chat-input-row {
  display: flex;
  gap: 8px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-cta-secondary {
  background: #1e293b;
  color: #5eead4;
  border: 1px solid #2dd4bf;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 10px;
}

.btn-cta-secondary:hover {
  background: #334155;
}
