/* Bottom-right Get Email Stock dock (FAB + drop-up order panel) */
.stock-buy-dock {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: min(24.5rem, calc(100vw - 2rem));
  pointer-events: none;
}
.stock-buy-dock > * { pointer-events: auto; }

.stock-buy-fab {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 1.05rem 0.72rem 0.72rem;
  border: 0;
  border-radius: 1.15rem;
  cursor: pointer;
  color: #f8fafc;
  font-family: 'Sora', 'Outfit', sans-serif;
  text-align: left;
  background:
    linear-gradient(145deg, #0f766e 0%, var(--auth-accent, #2563eb) 48%, var(--auth-accent-deep, #1d4ed8) 100%);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stock-buy-fab-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(45, 212, 191, 0.35), transparent 42%, rgba(255, 255, 255, 0.12));
  opacity: 0.55;
  z-index: -1;
  filter: blur(10px);
  pointer-events: none;
}
.stock-buy-fab-icon {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.stock-buy-fab-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.stock-buy-fab-copy strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.stock-buy-fab-copy small {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.84;
  letter-spacing: 0.01em;
}
.stock-buy-fab-chevron {
  margin-left: 0.15rem;
  font-size: 0.72rem;
  opacity: 0.85;
  transition: transform 0.22s ease;
}
.stock-buy-fab:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}
.stock-buy-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.stock-buy-dock.is-open .stock-buy-fab-chevron {
  transform: rotate(180deg);
}

.stock-buy-panel {
  width: min(24.5rem, calc(100vw - 2rem));
  max-height: min(72vh, 36rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.05rem 1.05rem 0.95rem;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.96));
  color: var(--auth-ink, #1e293b);
  box-shadow:
    0 28px 60px rgba(2, 6, 23, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  transform-origin: bottom right;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.stock-buy-dock.is-open .stock-buy-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.stock-buy-panel[hidden] { display: none !important; }
.stock-buy-dock.is-open .stock-buy-panel[hidden] { display: block !important; }

.stock-buy-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.stock-buy-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}
.stock-buy-panel-head h2 {
  margin: 0;
  font-family: 'Sora', 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.stock-buy-sub {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--auth-muted, #64748b);
}
.stock-buy-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #334155;
  background: rgba(15, 23, 42, 0.06);
  display: inline-grid;
  place-items: center;
}
.stock-buy-close:hover { background: rgba(15, 23, 42, 0.1); }
.stock-panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.28rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.06);
}
.stock-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 0.7rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font-family: 'Sora', 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.stock-tab.is-active {
  color: #0f172a;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.stock-tab-live {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  animation: dealPulse 1.8s ease-out infinite;
}
@keyframes dealPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.stock-pane[hidden] { display: none !important; }
.stock-order-closed {
  padding: 0.9rem 0.95rem;
  border-radius: 0.9rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #92400e;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}
.stock-buy-rate {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(15, 118, 110, 0.1);
}

.live-deal-shell { display: flex; flex-direction: column; gap: 0.6rem; }
.live-deal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.16);
}
.live-deal-banner-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.live-deal-banner-left strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.live-deal-avatar {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 0.8rem;
  color: #fff;
  background: linear-gradient(145deg, #1d4ed8, #0ea5e9);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}
.live-deal-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #047857;
}
.live-deal-avail {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.8rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.45;
  color: #334155;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.18);
}
.live-deal-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}
.live-deal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
/* Reset login neumorphic input styles inside stock panel — fixes invisible text */
body .stock-buy-panel input.live-deal-field,
body .stock-buy-panel input.live-deal-input,
body .stock-buy-panel .live-deal-field {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 0.7rem 0.85rem !important;
  font: 600 0.88rem "Sora", "Outfit", sans-serif !important;
  line-height: 1.35 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #1d4ed8 !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) !important;
  outline: none;
}
body .stock-buy-panel input.live-deal-field::placeholder,
body .stock-buy-panel input.live-deal-input::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1;
}
body .stock-buy-panel input.live-deal-field:focus,
body .stock-buy-panel input.live-deal-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}
.live-deal-log {
  min-height: 11.5rem;
  max-height: 15.5rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.7rem;
  border-radius: 1rem;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(37, 99, 235, 0.08), transparent 55%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.live-deal-msg { display: flex; max-width: 92%; }
.live-deal-msg p {
  margin: 0;
  padding: 0.58rem 0.75rem;
  border-radius: 0.9rem;
  font-size: 0.8rem;
  line-height: 1.45;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}
.live-deal-msg--bot,
.live-deal-msg--admin { align-self: flex-start; }
.live-deal-msg--bot p,
.live-deal-msg--admin p {
  background: #eef2ff;
  color: #0f172a;
  border-bottom-left-radius: 0.28rem;
}
.live-deal-msg--admin p {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.live-deal-msg--user {
  align-self: flex-end;
  margin-left: auto;
}
.live-deal-msg--user p {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-bottom-right-radius: 0.28rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}
.live-deal-compose {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.live-deal-input { flex: 1 1 auto; min-width: 0; }
.live-deal-send {
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  min-width: 2.85rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0.9rem;
  cursor: pointer;
  color: #fff;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.live-deal-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.4);
}
.live-deal-hint {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
@media (max-width: 560px) {
  .live-deal-meta { grid-template-columns: 1fr; }
}
.stock-buy-form { margin-top: 0.15rem; }
.stock-buy-submit {
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 800;
}
.stock-buy-foot {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--auth-muted, #64748b);
}
.stock-buy-foot a {
  color: var(--auth-accent-deep, #1d4ed8);
  font-weight: 700;
  text-decoration: none;
}
.stock-buy-foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .stock-buy-dock {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    align-items: stretch;
    padding: 0 max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }
  .stock-buy-fab {
    width: 100%;
    justify-content: flex-start;
    border-radius: 1rem;
  }
  .stock-buy-fab-copy { flex: 1; }
  .stock-buy-panel {
    width: 100%;
    max-height: min(78vh, 40rem);
    border-radius: 1.15rem 1.15rem 1rem 1rem;
    transform-origin: bottom center;
  }
  .stock-buy-fab-copy small { display: none; }
}

