﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   TradesMind MVP â€” Style
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

:root {
  --bg: #0b1929;
  --bg-deep: #060f1a;
  --bg-page: #0e1a22;
  --teal: #02C39A;
  --teal-dark: #1D9E75;
  --teal-light: #5DCAA5;
  --text: #c8daea;
  --text-dim: #4a6070;
  --text-muted: #2a3e50;
  --border: #1a2e40;
  --red: #e24b4a;
  --orange: #EF9F27;
  --purple: #AFA9EC;
  --card: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-page);
  font-family: 'DM Sans', -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--app-height, 100dvh);
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

/* Mobile: no padding, full screen */
@media (max-width: 499px) {
  body {
    padding: 0;
    align-items: flex-start;
  }
}

/* Phone Frame */
.phone-frame {
  width: 100%;
  max-width: 428px;
  height: var(--app-height, 100dvh);
  max-height: 926px;
  background: var(--bg);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Mobile: use full dynamic height, no max-height cap */
@media (max-width: 499px) {
  .phone-frame {
    max-height: none;
    height: var(--app-height, 100dvh);
  }
}

/* Desktop: show as phone */
@media (min-width: 500px) {
  .phone-frame {
    border-radius: 44px;
    border: 5px solid var(--border);
    height: 90vh;
    box-shadow: 0 28px 70px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.03);
  }
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 20px 0;
  flex-shrink: 0;
  z-index: 10;
  min-height: 0;
}
.status-bar:not(:has(.rec-indicator:not(.hidden))) { padding: 0; }
.sb-right { display: flex; align-items: center; gap: 8px; }
.rec-indicator { display: flex; align-items: center; gap: 5px; padding: 6px 12px; background: rgba(220,53,69,0.12); border-radius: 20px; }
.rec-indicator.hidden { display: none; }
.rec-indicator-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1s ease-in-out infinite; }
.rec-indicator span { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--red); font-weight: 700; }

/* Screen Container */
.screen-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Bottom Nav */
.bottom-nav.keyboard-open { display: none; }
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 20px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-item.active { color: var(--teal); background: rgba(2,195,154,.1); }
.nav-item span { font-size: 12px; font-weight: 600; letter-spacing: 0.2px; }

/* â•â•â• HOME â•â•â• */
.home-top {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-top svg {
  width: 340px;
  height: auto;
  max-width: 90vw;
}

@media (max-width: 428px) {
  .home-top svg {
    width: 360px;
  }
}

@media (max-width: 375px) {
  .home-top svg {
    width: 340px;
  }
}
.record-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 40px;
}
.tap-lbl {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
  font-weight: 500;
}
.record-btn-outer {
  position: relative;
  width: 140px; height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ring {
  position: absolute;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.r3 { width: 140px; height: 140px; border: 1px solid rgba(2,195,154,.07); }
.r2 { width: 112px; height: 112px; border: 1px solid rgba(2,195,154,.13); }
.r1 { width: 88px; height: 88px; border: 1.5px solid rgba(2,195,154,.22); }
.record-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 8px 28px rgba(2,195,154,.38);
  transition: transform 0.15s ease;
}
.record-btn-outer:active .record-btn { transform: scale(0.92); }
.record-btn-outer:hover .r1 { transform: scale(1.08); }
.record-btn-outer:hover .r2 { transform: scale(1.04); }

.home-sub {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
  margin-top: 24px;
  padding: 0 20px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
.home-sub span { color: var(--teal-light); font-weight: 500; }

.recent-section {
  padding: 20px 20px 12px;
  border-top: 1px solid rgba(255,255,255,.04);
  flex-shrink: 0;
  margin-top: auto;
}
.recent-title {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background 0.2s ease;
}

.recent-row:hover {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 7px 8px;
}
.recent-row:last-child { border: none; }
.recent-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.recent-text { flex: 1; font-size: 14px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-time { font-size: 12px; color: var(--text-muted); font-family: 'Space Mono', monospace; }

/* â•â•â• RECORDING â•â•â• */
.rec-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
}
.rec-chip {
  background: rgba(226,75,74,.12);
  border: 1px solid rgba(226,75,74,.28);
  border-radius: 24px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}
.rec-dot-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}
.rec-chip-txt {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 1.5px;
}
.rec-btn-wrap {
  position: relative;
  width: 130px; height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.pulse-ring { position: absolute; border-radius: 50%; }
.rpa { width: 130px; height: 130px; border: 1px solid rgba(2,195,154,.08); animation: pulseRing 2s ease-in-out infinite; }
.rpb { width: 104px; height: 104px; border: 1.5px solid rgba(2,195,154,.16); animation: pulseRing 2s ease-in-out infinite 0.3s; }
.rpc { width: 82px; height: 82px; border: 2px solid rgba(2,195,154,.28); animation: pulseRing 2s ease-in-out infinite 0.6s; }
.rec-inner-btn {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 10px 32px rgba(2,195,154,.42);
}

.waveform {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 32px;
  margin-bottom: 18px;
}
.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--teal);
  opacity: 0.9;
  transition: height 0.15s ease;
}

.transcript-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 16px;
  width: 100%;
  margin-bottom: 18px;
}
.transcript-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.transcript-text {
  font-size: 12px;
  color: #8899aa;
  line-height: 1.7;
}
.transcript-text em { color: var(--text); font-style: normal; font-weight: 500; }

.stop-row { display: flex; gap: 8px; width: 100%; }
.stop-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--red), #c0392b);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.stop-btn:active { transform: scale(0.97); }
.pause-btn {
  width: 48px;
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.07);
  cursor: pointer;
}

/* â•â•â• ANALYSING â•â•â• */
.proc-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 20px;
}
.proc-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.proc-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.audio-snippet {
  background: rgba(2,195,154,.04);
  border-left: 2px solid rgba(2,195,154,.3);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.audio-quote { font-size: 12px; color: var(--text-dim); line-height: 1.65; font-style: italic; }

.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.3s ease;
}
.s-done { background: var(--teal); }
.s-active { background: transparent; border: 2px solid var(--teal); }
.s-wait { background: transparent; border: 2px solid var(--border); }
.step-content { flex: 1; }
.step-title { font-size: 13px; font-weight: 600; color: var(--text-muted); transition: color 0.3s; }
.step.done .step-title { color: var(--teal); }
.step.active .step-title { color: #fff; }
.step-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.spinner {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.1s ease-in-out infinite;
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 24px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* â•â•â• EMAIL â•â•â• */
.email-header {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.back-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--teal-light); font-weight: 600;
}
.email-title {
  flex: 1; text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 700; color: #fff;
}
.edit-btn {
  font-size: 12px; color: var(--teal-light); font-weight: 600;
  background: none; border: none; cursor: pointer;
}

.ai-pill {
  margin: 10px 18px 8px;
  background: rgba(127,119,221,.1);
  border: 1px solid rgba(127,119,221,.2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); flex-shrink: 0; }
.ai-pill-text { font-size: 12px; color: var(--purple); line-height: 1.5; }
.ai-pill-text strong { color: var(--text); display: block; margin-bottom: 2px; }

.email-meta { margin: 0 18px 8px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.meta-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 8px 12px;
}
.meta-label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  letter-spacing: .5px; min-width: 36px; text-transform: uppercase;
}
.meta-value { flex: 1; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-value.teal { color: var(--teal); }
.meta-input {
  flex: 1; font-size: 12px; color: var(--text);
  background: none; border: none; outline: none;
  font-family: inherit; padding: 0;
}
.meta-input.teal { color: var(--teal); }
.meta-input::placeholder { color: var(--text-muted); }
.meta-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(2,195,154,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--teal);
  flex-shrink: 0;
}

.email-divider { height: 1px; background: var(--border); margin: 4px 18px; flex-shrink: 0; }

.tone-row {
  display: flex; gap: 6px; margin: 0 18px 8px; flex-shrink: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tone-row::-webkit-scrollbar { display: none; }
.tone-pill {
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 24px;
  white-space: nowrap; flex-shrink: 0;
  cursor: pointer; border: none; transition: all 0.2s;
}
.tone-pill.active { background: var(--teal); color: #0D1F2D; }
.tone-pill:not(.active) { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--border); }

.email-body {
  flex: 1; overflow-y: auto;
  margin: 0 18px 10px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  outline: none;
  min-height: 180px;
  -webkit-user-modify: read-write-plaintext-only;
  cursor: text;
  transition: border-color 0.2s;
}
.email-body:focus {
  border-color: rgba(2,195,154,.4);
}
.email-body::after {
  content: 'Tap to edit';
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
  letter-spacing: 0.5px;
}
.email-body:focus::after {
  content: 'Editing';
  color: var(--teal);
}
.email-greeting { color: #fff; font-weight: 600; display: block; margin-bottom: 6px; }
.email-intro { color: var(--text-dim); display: block; margin-bottom: 10px; }
.email-section-title {
  color: var(--teal); font-size: 12px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.email-bullet { display: flex; gap: 8px; margin-bottom: 4px; }
.bullet-dot { color: var(--teal); flex-shrink: 0; font-size: 12px; }
.highlight { background: rgba(2,195,154,.12); color: var(--teal); border-radius: 4px; padding: 0 4px; }
.email-signoff { color: var(--text-dim); display: block; margin-top: 10px; }
.email-name { color: var(--text); font-weight: 600; display: block; margin-top: 3px; }

.email-actions { padding: 0 18px 6px; flex-shrink: 0; display: flex; gap: 8px; align-items: flex-start; }
.ea-left { display: flex; flex-direction: column; gap: 6px; flex: 2; }
.ea-right { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.btn-refine-full { width: 100%; box-sizing: border-box; }
/* legacy - kept for compat */
.ea-top { display: flex; gap: 8px; margin-bottom: 6px; }
.ea-bottom { display: flex; gap: 8px; }
.btn-send {
  flex: 1;
  width: 100%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-send:active { transform: scale(0.97); }
.btn-send span { font-size: 15px; font-weight: 700; color: #0D1F2D; }
.btn-secondary {
  flex: 1;
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,.07);
  cursor: pointer;
}
.btn-small {
  flex: 1;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.05);
  cursor: pointer;
}
.btn-small.accent { color: var(--teal-light); border-color: rgba(2,195,154,.18); }

/* â•â•â• SENT â•â•â• */
.sent-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 24px 20px;
}
.sent-tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 26px rgba(2,195,154,.38);
  animation: popIn 0.4s ease;
}
.sent-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.sent-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }

.sent-card {
  width: 100%;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sent-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(2,195,154,.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sent-card-title { font-size: 12px; color: #fff; font-weight: 500; }
.sent-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.notices-box {
  width: 100%;
  background: rgba(2,195,154,.04);
  border: 1px solid rgba(2,195,154,.14);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.notices-header {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(2,195,154,.1);
}
.notices-header span { font-size: 12px; color: var(--teal-light); font-weight: 600; }
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.notice:last-child { border: none; }
.notice-badge {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 5px;
  flex-shrink: 0; margin-top: 2px;
}
.nb-invoice { background: rgba(2,195,154,.15); color: var(--teal); }
.nb-call { background: rgba(239,159,39,.15); color: var(--orange); }
.nb-diary { background: rgba(26,82,118,.2); color: #85C1E9; }
.notice-text { font-size: 12px; color: #8899aa; line-height: 1.5; flex: 1; }
.notice-tap { font-size: 12px; color: var(--teal-light); font-weight: 600; flex-shrink: 0; align-self: center; cursor: pointer; }

.coming-soon { font-size: 12px; color: var(--border); text-align: center; margin-bottom: 12px; font-style: italic; }
.home-btn {
  width: 100%;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--teal-light);
  font-weight: 500;
  border: 1px solid rgba(2,195,154,.18);
  cursor: pointer;
  transition: transform 0.15s;
}
.home-btn:active { transform: scale(0.97); }

/* â•â•â• HISTORY â•â•â• */
.hist-header { padding: 18px 20px 12px; flex-shrink: 0; }
.hist-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 10px;
}
.hist-filters { display: flex; gap: 6px; overflow-x: auto; }
.hist-filters::-webkit-scrollbar { display: none; }
.filter-pill {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 24px;
  white-space: nowrap; flex-shrink: 0;
  cursor: pointer; border: none; letter-spacing: .3px;
  transition: all 0.2s;
}
.filter-pill.active { background: var(--teal); color: #0D1F2D; }
.filter-pill:not(.active) { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--border); }

.hist-list { flex: 1; overflow-y: auto; padding: 6px 20px 0; }
.hist-item {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}
.hist-item:active { transform: scale(0.98); background: rgba(93,202,165,.06); }
.hist-item-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.hist-item-title { font-size: 15px; font-weight: 600; color: #fff; flex: 1; padding-right: 10px; line-height: 1.4; }
.hist-item-time { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.hist-item-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist-badge {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; letter-spacing: .3px;
}
.hb-sent { background: rgba(2,195,154,.12); color: var(--teal); }
.hb-type { background: rgba(255,255,255,.07); color: var(--text-dim); }
.hb-dur { background: rgba(255,255,255,.05); color: var(--text-muted); }
.hist-item-preview { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 6px; }

/* â•â•â• PROFILE â•â•â• */
.profile-header { padding: 20px 20px 12px; flex-shrink: 0; }
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(2,195,154,.2), rgba(29,158,117,.08));
  border: 2px solid rgba(2,195,154,.3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: var(--teal);
}
.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 3px;
}
.profile-trade { font-size: 12px; color: var(--teal-light); font-weight: 500; }

.profile-stats { display: flex; gap: 8px; }
.stat-box {
  flex: 1;
  background: var(--card);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--card-border);
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700; color: var(--teal);
  display: block;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.profile-form { flex: 1; overflow-y: auto; padding: 0 14px 20px; }

/* Profile Accordions */
.pf-accordion { margin-bottom: 8px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; overflow: hidden; }
.pf-acc-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; background: rgba(255,255,255,.04); border: none; cursor: pointer;
  transition: background 0.15s;
}
.pf-acc-header:active { background: rgba(255,255,255,.08); }
.pf-acc-title {
  font-size: 15px; font-weight: 700; color: #fff; text-align: center; flex: 1;
  letter-spacing: -0.2px;
}
.pf-acc-chevron { flex-shrink: 0; transition: transform 0.2s; color: #5DCAA5; }
.pf-acc-chevron.open { transform: rotate(180deg); }
.pf-acc-body { padding: 4px 18px 16px; }
.pf-acc-body.hidden { display: none; }

.form-section-title {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--text-muted); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 10px;
}
.form-group { margin-bottom: 10px; }
.form-label { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; display: block; font-weight: 500; }
.form-input, .form-select {
  width: 100%; padding: 10px 12px; font-size: 15px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 10px; color: #fff; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus { border-color: rgba(2,195,154,.4); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { -webkit-appearance: none; appearance: none; cursor: pointer; }
.form-select option { background: var(--bg); color: #fff; }
.form-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.form-hint {
  font-size: 12px; color: var(--text-dim); line-height: 1.6;
  background: rgba(2,195,154,.04); border-left: 2px solid rgba(2,195,154,.3);
  border-radius: 0 8px 8px 0; padding: 8px 12px; margin-bottom: 10px;
}
.btn-save-profile {
  width: 100%; margin-top: 14px; padding: 14px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 14px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #0D1F2D;
  transition: transform 0.15s;
}
.btn-save-profile:active { transform: scale(0.97); }
.form-saved {
  text-align: center; font-size: 12px; color: var(--teal);
  margin-top: 8px; font-weight: 600;
}
.hidden { display: none; }

.profile-list { flex: 1; overflow-y: auto; padding: 0 20px; }
.profile-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.profile-row:last-child { border: none; }
.profile-row-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-row-icon.purple { background: rgba(175,169,236,.08); }
.profile-row-content { flex: 1; }
.profile-row-title { font-size: 13px; font-weight: 500; color: #fff; margin-bottom: 2px; }
.profile-row-title.purple { color: var(--purple); }
.profile-row-sub { font-size: 12px; color: var(--text-muted); }
.profile-row-arrow { font-size: 16px; color: var(--text-muted); }
.profile-row-chip {
  background: rgba(2,195,154,.12); border: 1px solid rgba(2,195,154,.2);
  border-radius: 8px; padding: 4px 10px;
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700; color: var(--teal);
}
.profile-row-soon { font-size: 12px; color: var(--text-muted); }


/* === REFERRALS === */
.referral-card { background: rgba(255,255,255,.04); border: 1px solid rgba(93,202,165,.15); border-radius: 16px; padding: 16px; margin-top: 8px; }
.referral-code-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.referral-code-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.referral-code-display { font-family: 'Space Mono', monospace; font-size: 20px; font-weight: 700; color: #5DCAA5; letter-spacing: .08em; }
.btn-copy-ref { background: rgba(93,202,165,.1); border: 1px solid rgba(93,202,165,.2); border-radius: 8px; padding: 8px; cursor: pointer; display: flex; align-items: center; }
.btn-share-ref { width: 100%; padding: 12px; background: #25D366; border: none; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.referral-tiers-info { background: rgba(255,255,255,.03); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.tier-info-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tier-badge { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: .04em; }
.tier-badge.t1 { background: rgba(93,202,165,.2); color: #5DCAA5; }
.tier-badge.t2 { background: rgba(167,139,250,.2); color: #a78bfa; }
.tier-badge.t3 { background: rgba(251,191,36,.15); color: #fbbf24; }
.tier-desc { font-size: 12px; color: var(--text-dim); flex: 1; }
.tier-pct { font-size: 13px; font-weight: 700; color: #fff; }
.referral-summary { display: flex; gap: 0; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.ref-sum-item { flex: 1; text-align: center; padding: 10px 8px; border-right: 1px solid rgba(255,255,255,.06); }
.ref-sum-item:last-child { border-right: none; }
.ref-sum-num { display: block; font-size: 20px; font-weight: 700; color: #fff; }
.ref-sum-num.green { color: #5DCAA5; }
.ref-sum-label { font-size: 12px; color: var(--text-muted); }
.referrals-accordion { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #5DCAA5; }
.referrals-list { margin-top: 8px; }
.referrals-list.hidden { display: none; }
.referral-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.referral-item:last-child { border-bottom: none; }
.ref-item-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(93,202,165,.15); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #5DCAA5; flex-shrink: 0; }
.ref-item-info { flex: 1; }
.ref-item-email { font-size: 12px; color: var(--text-dim); }
.ref-item-date { font-size: 12px; color: var(--text-muted); }
.ref-item-right { text-align: right; }
.ref-item-commission { font-size: 13px; font-weight: 700; color: #5DCAA5; }
.ref-item-status { font-size: 12px; padding: 2px 6px; border-radius: 10px; }
.ref-item-status.paying { background: rgba(93,202,165,.15); color: #5DCAA5; }
.ref-item-status.pending { background: rgba(255,255,255,.06); color: var(--text-muted); }
.referrals-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 12px 0; }
/* â•â•â• MODALS â•â•â• */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-help {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.smtp-fields.hidden {
  display: none;
}

.trust-message {
  background: rgba(2,195,154,.06);
  border: 1px solid rgba(2,195,154,.12);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.trust-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.trust-message h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 12px;
}

.trust-message p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 8px;
}

.trust-message p:last-child {
  margin-bottom: 0;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #0D1F2D;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-bottom: 12px;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255,255,255,.06);
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.modal-footer a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.modal-footer a:hover {
  text-decoration: underline;
}

/* â•â•â• ANIMATIONS â•â•â• */
@keyframes blink { 0%,100%{ opacity:1 } 50%{ opacity:.2 } }
@keyframes pulse { 0%,100%{ opacity:1 } 50%{ opacity:.25 } }
@keyframes pulseRing { 0%,100%{ transform:scale(1); opacity:1 } 50%{ transform:scale(1.06); opacity:.5 } }
@keyframes popIn { 0%{ transform:scale(0.5); opacity:0 } 100%{ transform:scale(1); opacity:1 } }


/* Referral pitch block */
.ref-pitch { background: linear-gradient(135deg, rgba(93,202,165,.12), rgba(93,202,165,.04)); border: 1px solid rgba(93,202,165,.2); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.ref-pitch-title { font-size: 15px; font-weight: 700; color: #5DCAA5; margin-bottom: 8px; }
.ref-pitch-body { font-size: 13px; color: #8ab0c8; line-height: 1.6; }
.ref-pitch-body strong { color: #fff; font-weight: 600; }



/* === SIGNATURE SETUP MODAL === */
.sig-modal-content {
  padding: 0;
  border-radius: 20px 20px 0 0;
  background: #0b1929;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.sig-header { text-align: center; padding: 22px 20px 0; }
.sig-logo { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 700; color: #fff; }
.sig-tagline { font-family: 'Space Mono', monospace; font-size: 12px; color: #5DCAA5; letter-spacing: 3px; margin-top: 2px; }
.sig-title { text-align: center; font-size: 20px; font-weight: 700; color: #fff; margin: 14px 20px 4px; line-height: 1.3; }
.sig-subtitle { text-align: center; font-size: 13px; color: #5DCAA5; margin: 0 20px 18px; }
#email-setup-form { padding: 0 20px 24px; }
.sig-field-group { margin-bottom: 12px; }
.sig-label { font-family: 'Space Mono', monospace; font-size: 12px; color: #4a6070; letter-spacing: 1.5px; display: block; margin-bottom: 5px; }
.sig-input {
  width: 100%; padding: 13px 14px; font-size: 15px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; color: #fff; font-family: inherit; outline: none; box-sizing: border-box;
  transition: border-color 0.2s;
}
.sig-input:focus { border-color: rgba(2,195,154,.5); }
.sig-input::placeholder { color: #2a3e50; }
.sig-field-hint { font-size: 12px; color: #2a4a5a; margin-top: 4px; line-height: 1.5; }
.sig-preview-box {
  background: rgba(255,255,255,.03); border-left: 3px solid #5DCAA5;
  border-radius: 0 10px 10px 0; padding: 14px 16px; margin: 16px 0 12px;
}
.sig-preview-label { font-family: 'Space Mono', monospace; font-size: 12px; color: #4a6070; letter-spacing: 1.5px; margin-bottom: 10px; }
.sig-preview-name { font-size: 15px; font-weight: 700; color: #fff; }
.sig-preview-biz { font-size: 13px; color: #8ab0c8; margin-top: 2px; }
.sig-preview-mobile { font-size: 13px; color: #8ab0c8; margin-top: 2px; }
.sig-send-note { font-size: 12px; color: #2a4a5a; text-align: center; margin-bottom: 16px; line-height: 1.5; }
.btn-sig-send {
  width: 100%; padding: 15px; background: #02C39A; border: none; border-radius: 14px;
  color: #0b1929; font-size: 16px; font-weight: 700; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px;
  font-family: inherit;
}
.sig-save-note { font-size: 12px; color: #1a2e40; text-align: center; margin-top: 6px; }

/* Progressive reveal */
.sig-field-hidden {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}
.sig-field-reveal {
  display: block;
  animation: sigReveal 0.25s ease forwards;
}
@keyframes sigReveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
