/* ═══════════════════════════════════════════════════════════════
   ROUTE PAGES — /support (public widget), /privacy, /delete.
   The widget skin styles chat.js's DOM contract exactly; chat.js
   itself is untouched (IDs: chat-setup, chat-interface, chat-email,
   chat-email-error, chat-messages, chat-loader, chat-input, send-btn,
   display-ticket · classes: chat-msg user|bot, msg-enter/msg-visible,
   loading-dots, chat-msg-system, chat-closed-badge, chat-restart-*,
   chat-input-row, chat-header-dot).
═══════════════════════════════════════════════════════════════ */

.page-head { max-width: 780px; margin: 0 auto; padding-top: 56px; }
.page-lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-secondary);
  margin-bottom: 40px;
}

/* ── Shared card recipe (app: radius 16, hairline, resting shadow) ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--rad-card);
  box-shadow: var(--shadow-card);
}

/* ═══════════════════════════════════════════════════════════════
   SUPPORT ROUTE
═══════════════════════════════════════════════════════════════ */
.support-mail-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  margin-bottom: 24px;
}
.support-mail-card .bento-icon { font-size: 22px; }
.support-mail-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 6px;
}
.support-mail-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}
.support-mail-card a {
  font-size: 15px;
  font-weight: 700;
  color: var(--cb-blue-600);
}

.chat-widget { overflow: hidden; }

.chat-setup-panel { padding: clamp(28px, 5vw, 44px); }
.chat-setup-panel h3 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink-display);
  margin-bottom: 10px;
}
.chat-setup-panel > p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 28px;
  max-width: 460px;
}
.chat-input-group { margin-bottom: 18px; }
.chat-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-primary);
  margin-bottom: 8px;
}
/* App input recipe: filled slate-100, no border at rest, 1.6px focus ring */
.chat-input-group input {
  width: 100%;
  height: 52px;
  background: var(--ink-100);
  border: 1.6px solid transparent;
  border-radius: var(--rad-btn);
  padding: 0 16px;
  font-size: 15px;
  color: var(--ink-primary);
  transition: border-color var(--dur-micro) var(--ease-cb), background var(--dur-micro) var(--ease-cb);
}
.chat-input-group input:focus {
  border-color: var(--cb-blue-600);
  background: var(--bg-surface);
}
.chat-input-group input[aria-invalid="true"] { border-color: var(--error); }
.chat-start-btn { width: 100%; }

/* chat.js shows this with style.display = 'flex' */
.chat-interface {
  display: none;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.3;
}
.chat-head-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-tertiary);
}
.chat-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--trade-buy-hard); /* chat.js restores to '' → this green */
  flex-shrink: 0;
}

.chat-messages-area {
  height: min(430px, 56vh);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-base);
}
.chat-msg {
  max-width: 80%;
  padding: 11px 15px;
  font-size: 14.5px;
  line-height: 1.55;
  word-wrap: break-word;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  border-radius: 16px 16px 16px 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--cb-blue-600);
  color: var(--white);
  border-radius: 16px 16px 4px 16px;
}
/* chat.js appends .msg-enter then adds .msg-visible on the next frame */
.msg-enter {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-standard) var(--ease-cb), transform var(--dur-standard) var(--ease-cb);
}
.msg-enter.msg-visible {
  opacity: 1;
  transform: none;
}

.loading-dots { display: inline-flex; gap: 4px; padding: 3px 2px; }
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-400);
  animation: dotBounce 1.2s var(--ease-in-out) infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-msg-system { align-self: center; }
.chat-closed-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-soft);
  color: var(--success-ink);
  border-radius: var(--rad-chip);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
}
.chat-restart-wrap { align-self: center; padding: 6px 0 2px; }
.chat-restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--rad-btn);
  border: 1px solid var(--border2);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 650;
  transition: border-color var(--dur-micro) var(--ease-cb), background var(--dur-micro) var(--ease-cb);
}
.chat-restart-btn:hover { border-color: var(--cb-blue-300); background: var(--cb-blue-50); }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.chat-input-row input {
  flex: 1;
  height: 46px;
  background: var(--ink-100);
  border: 1.6px solid transparent;
  border-radius: var(--rad-btn);
  padding: 0 15px;
  font-size: 14.5px;
  color: var(--ink-primary);
  transition: border-color var(--dur-micro) var(--ease-cb), background var(--dur-micro) var(--ease-cb);
}
.chat-input-row input:focus { border-color: var(--cb-blue-600); background: var(--bg-surface); }
.chat-input-row input:disabled { opacity: 0.55; }
.chat-send-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--rad-btn);
  background: var(--cb-blue-600);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur-micro) var(--ease-cb), transform var(--dur-micro) var(--ease-cb);
}
.chat-send-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-send-btn:hover { background: var(--cb-blue-700); }
.chat-send-btn:active { transform: scale(0.94); }
.chat-send-btn:disabled { background: var(--ink-300); }

.support-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-tertiary);
  margin-top: 24px;
}
.support-status-row .chip-dot { background: var(--trade-buy-hard); }

/* ═══════════════════════════════════════════════════════════════
   PRIVACY ROUTE
═══════════════════════════════════════════════════════════════ */
.privacy-card {
  padding: clamp(24px, 4vw, 36px);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}
/* blueprint band across the card head */
.privacy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-image:
    repeating-linear-gradient(0deg,  rgba(37, 99, 235, 0.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0 1px, transparent 1px 22px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
  pointer-events: none;
}
.privacy-h3 {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink-display);
  margin-bottom: 22px;
  position: relative;
}
.privacy-directive {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink-secondary);
  padding: 16px 0;
  position: relative;
}
.privacy-directive + .privacy-directive { border-top: 1px solid var(--border); }
.privacy-directive strong { color: var(--ink-primary); }
.privacy-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-blue-600);
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--rad-chip);
  padding: 4px 9px;
  flex-shrink: 0;
  margin-top: 1px;
}
.privacy-bullet {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink-secondary);
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
}
.privacy-bullet strong { color: var(--ink-primary); }
.privacy-bullet::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-blue-400);
}

/* Entrance system used by motion.js sequencers (ported from UIEngine) */
html.js .privacy-directive,
html.js .privacy-num,
html.js .privacy-bullet {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-cb), transform 0.5s var(--ease-cb);
}
html.js :is(.privacy-directive, .privacy-num, .privacy-bullet).anim-in {
  opacity: 1;
  transform: none;
}
html.js .privacy-num { transform: translateY(8px) scale(0.9); }
html.js .privacy-num.anim-in { transform: none; }

/* ═══════════════════════════════════════════════════════════════
   DELETE ROUTE
═══════════════════════════════════════════════════════════════ */
.delete-card-primary {
  padding: clamp(28px, 4.5vw, 40px);
  margin-bottom: 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #dceefe 100%);
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: var(--rad-card);
  box-shadow: var(--shadow-glow);
}
.delete-card-primary h3 {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink-display);
  margin-bottom: 10px;
}
.delete-card-primary p {
  font-size: 15.5px;
  line-height: 1.66;
  color: var(--ink-700);
}
.delete-card-primary strong { color: var(--cb-blue-700); }

.delete-card-secondary {
  padding: clamp(28px, 4.5vw, 40px);
  background: var(--ink-900);
  border: 1px solid var(--ink-800);
  border-radius: var(--rad-card);
  color: var(--white);
}
.delete-card-secondary h3 {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 10px;
}
.delete-card-secondary p {
  font-size: 15.5px;
  line-height: 1.66;
  color: var(--ink-400);
  margin-bottom: 26px;
}
.delete-subject-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--ink-display);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--rad-btn);
  padding: 14px 20px;
  margin-bottom: 24px;
  max-width: 100%;
  overflow: hidden;
}
.delete-subject-wrap .ds-label {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.45);
  margin-right: 8px;
  flex-shrink: 0;
}
.delete-subject-line {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  border-right: 2px solid var(--cb-blue-400);
  padding-right: 3px;
  animation: cursorBlink 1s step-end infinite;
}
html.js .delete-subject-line { max-width: 0; }
html.js .delete-subject-line.anim-in {
  max-width: 260px;
  transition: max-width 1.15s steps(26, end);
}
.delete-subject-line.typed { border-right-color: transparent; animation: none; }
@keyframes cursorBlink {
  0%, 100% { border-right-color: var(--cb-blue-400); }
  50%      { border-right-color: transparent; }
}
.delete-erase-btn {
  background: var(--trade-sell-hard);
  color: var(--white);
  border: none;
}
.delete-erase-btn:hover {
  background: #dc2626;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.30);
}

/* Card entrances driven by motion.js */
html.js .delete-card-primary,
html.js .delete-card-secondary,
html.js .delete-erase-btn {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease-cb), transform 0.55s var(--ease-cb);
}
html.js :is(.delete-card-primary, .delete-card-secondary, .delete-erase-btn).anim-in {
  opacity: 1;
  transform: none;
}
