/* Shared onboarding + wizard import/messaging animations */
.ob-privacy-note {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.ob-privacy-note strong { color: var(--color-text); }

.import-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.import-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.import-row.is-importing { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12); }
.import-row.is-done { border-color: var(--color-success); }
.import-row.is-error { border-color: var(--color-danger); }
.import-row-top { display: flex; gap: var(--space-2); align-items: center; }
.import-row-top input { flex: 1; min-width: 0; }
.import-row-status {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-text-secondary);
  min-height: 1.5rem;
}
.import-row-preview {
  margin-top: var(--space-2); font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text);
}
.import-row-remove {
  flex-shrink: 0; border: none; background: transparent; color: var(--color-text-tertiary);
  cursor: pointer; padding: var(--space-1); border-radius: var(--radius-sm);
}
.import-row-remove:hover { color: var(--color-danger); background: var(--color-danger-light); }

.ob-status-icon {
  width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.ob-spinner {
  width: 18px; height: 18px; border: 2px solid var(--color-border);
  border-top-color: var(--color-accent); border-radius: 50%;
  animation: ob-spin 0.7s linear infinite;
}
@keyframes ob-spin { to { transform: rotate(360deg); } }

.ob-check svg {
  width: 20px; height: 20px; stroke: var(--color-success); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round; fill: none;
}
.ob-check .check-circle {
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: ob-draw-circle 0.45s ease forwards;
}
.ob-check .check-mark {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: ob-draw-check 0.35s 0.3s ease forwards;
}
@keyframes ob-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes ob-draw-check { to { stroke-dashoffset: 0; } }

.import-progress-steps { margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.import-progress-steps li {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-text-tertiary);
  padding: 2px 0; transition: color 0.2s;
}
.import-progress-steps li.active { color: var(--color-accent); font-weight: 500; }
.import-progress-steps li.done { color: var(--color-success); }
.import-progress-steps li .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}

.ob-help-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-sm); color: var(--color-accent); cursor: pointer;
  background: none; border: none; padding: 0; font-family: inherit; text-decoration: underline;
}
.ob-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: var(--space-4);
}
.ob-modal-overlay[hidden] { display: none; }
.ob-modal {
  background: var(--color-surface); border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; padding: var(--space-6);
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.ob-modal h3 { margin: 0 0 var(--space-4); font-family: var(--font-display); }
.ob-modal-steps { margin: 0; padding: 0; list-style: none; counter-reset: obstep; }
.ob-modal-steps li {
  counter-increment: obstep; position: relative; padding-left: 2rem;
  margin-bottom: var(--space-4); font-size: var(--text-sm); line-height: 1.5;
}
.ob-modal-steps li::before {
  content: counter(obstep); position: absolute; left: 0; top: 0;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--color-accent); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.ob-modal-visual {
  background: var(--color-surface-secondary); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-4); font-size: var(--text-sm);
}
.ob-modal-visual .mock-menu { font-family: monospace; line-height: 1.8; color: var(--color-text-secondary); }
.ob-modal-visual .mock-highlight { background: rgba(249,115,22,0.15); padding: 0 4px; border-radius: 3px; color: var(--color-text); }

.ob-prop-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.ob-prop-tab {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: var(--text-sm); cursor: pointer;
}
.ob-prop-tab.active { border-color: var(--color-accent); background: rgba(249,115,22,0.08); font-weight: 500; }

.ical-input-wrap { margin-top: var(--space-2); }
.ical-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-secondary);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: text;
}
.ical-input:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: var(--color-surface);
}
.ical-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}
.ical-input::placeholder { color: var(--color-text-tertiary); font-size: var(--text-sm); }

.ob-upload-zone {
  border: 2px dashed var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-5); text-align: center; cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s;
}
.ob-upload-zone:hover, .ob-upload-zone.is-drag { border-color: var(--color-accent); background: rgba(249,115,22,0.04); }
.ob-upload-zone.is-uploaded {
  border-color: var(--color-success); border-style: solid;
  background: rgba(34, 197, 94, 0.06);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
  animation: ob-upload-pulse 0.55s ease;
}
@keyframes ob-upload-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.ob-upload-zone p { margin: 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.ob-file-list { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.ob-file-chip {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.06);
  font-size: var(--text-sm);
  opacity: 0; transform: translateY(8px);
  animation: ob-file-chip-in 0.45s ease forwards;
}
@keyframes ob-file-chip-in {
  to { opacity: 1; transform: translateY(0); }
}
.ob-file-chip-name { font-weight: 600; color: var(--color-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-file-chip-meta { font-size: var(--text-xs); color: var(--color-success); font-weight: 500; white-space: nowrap; }

.msg-template-row {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-3);
}
.msg-template-row.is-on { border-color: rgba(249,115,22,0.35); background: rgba(249,115,22,0.03); }
.msg-template-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-2); }
.msg-template-head label { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; cursor: pointer; }
.msg-template-when { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 2px; }
.msg-template-row textarea {
  width: 100%; min-height: 88px; padding: var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-family: inherit; font-size: var(--text-sm); resize: vertical; box-sizing: border-box;
}
.msg-drafting-banner {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3); background: var(--color-surface-secondary);
  border-radius: var(--radius-md); font-size: var(--text-sm); margin-bottom: var(--space-4);
}

.msg-template-row.is-loading .msg-body {
  color: var(--color-text-tertiary);
  background: var(--color-surface-secondary);
}
.msg-template-row .msg-row-status {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 6px;
}
.msg-template-row.is-done-row .msg-row-status { color: var(--color-success); }

.msg-body, textarea.wtr-body.msg-body {
  overflow: hidden; resize: none; min-height: 72px; line-height: 1.45;
}

.ob-finish-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(250, 249, 247, 0.92);
  display: flex; align-items: center; justify-content: center; padding: var(--space-6);
}
.ob-finish-overlay[hidden] { display: none; }
.ob-finish-card {
  max-width: 420px; width: 100%; text-align: center;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-8); box-shadow: var(--shadow-lg);
}
.ob-finish-card h3 { margin: 0 0 var(--space-2); font-family: var(--font-display); }
.ob-finish-card p { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0 0 var(--space-5); }
.ob-finish-steps { list-style: none; padding: 0; margin: 0; text-align: left; }
.ob-finish-steps li {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--color-text-tertiary);
}
.ob-finish-steps li.active { color: var(--color-accent); font-weight: 500; }
.ob-finish-steps li.done { color: var(--color-success); }
.ob-finish-dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.ob-finish-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.ob-finish-success {
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.ob-finish-success[hidden] { display: none; }
.ob-check-lg svg { width: 48px; height: 48px; }
.ob-finish-success p { margin: var(--space-2) 0 0; font-weight: 600; color: var(--color-success); }

/* Welcome tour */
/* Overlay container is intentionally NOT positioned so it does NOT create a
   stacking context. Its position:fixed children then compete directly in the
   root stacking context — that's what lets a menu/drawer be lifted ABOVE the
   dim (z 10060) while the tooltip stays on top of everything (z 10070). */
.welcome-tour-overlay {
  position: static; pointer-events: none;
}
.welcome-tour-shield {
  position: fixed; z-index: 10050;
  background: rgba(0, 0, 0, 0.30);
  pointer-events: auto;
}
.welcome-tour-shield.is-hidden { display: none; }
.welcome-tour-spot {
  position: fixed; border-radius: 12px; z-index: 10061;
  pointer-events: none;
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.5), 0 8px 30px rgba(0, 0, 0, 0.25);
  background: transparent;
}
.welcome-tour-spot.is-hidden { opacity: 0; box-shadow: none; outline: none; }
.welcome-tour-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.30); z-index: 10050;
  pointer-events: auto;
}
.welcome-tour-backdrop.is-hidden { display: none; }
/* Inline chatbot preview frame */
.welcome-tour-chat {
  position: fixed; z-index: 10060; pointer-events: auto;
  top: 50%; left: 50%; transform: translate(-50%, -56%);
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 220px));
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  border: 1px solid var(--color-border); overflow: hidden;
}
.welcome-tour-chat.is-hidden { display: none; }
.welcome-tour-chat-frame { width: 100%; height: 100%; border: 0; display: block; }
.welcome-tour-chat-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: var(--space-6); text-align: center; color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.welcome-tour-tip {
  position: fixed; z-index: 10070; max-width: 360px; width: calc(100vw - 32px);
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--color-border);
  pointer-events: auto;
}
.welcome-tour-tip.is-centered {
  top: 50% !important; left: 50% !important;
  transform: translate(-50%, -50%);
  max-width: 420px;
}
.welcome-tour-num {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-accent); margin-bottom: var(--space-2);
}
.welcome-tour-tip h4 { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-family: var(--font-display); }
.welcome-tour-tip p { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.55; }
.welcome-tour-action {
  margin: 0 0 var(--space-4); padding: var(--space-3);
  background: rgba(249, 115, 22, 0.08); border-radius: var(--radius-md);
  border: 1px solid rgba(249, 115, 22, 0.2);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
  line-height: 1.45;
}
.welcome-tour-action[hidden] { display: none; }
.welcome-tour-action.is-done {
  background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.25); color: var(--color-success);
}
.welcome-tour-copy {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 8px 8px 8px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}
.welcome-tour-copy[hidden] { display: none; }
.welcome-tour-copy-text { flex: 1; font-weight: 600; color: #9a3412; font-size: 0.95em; }
.welcome-tour-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  border: 1px solid #fdba74; border-radius: 8px;
  background: #fff; color: #c2410c;
  font-size: 0.8em; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap;
}
.welcome-tour-copy-btn:hover { background: #fff7ed; }
.welcome-tour-copy-btn.is-copied { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }

.welcome-tour-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); }
.welcome-tour-tip-controls {
  position: absolute; top: 6px; right: 6px;
  display: flex; align-items: center; gap: 2px;
}
.welcome-tour-minimize,
.welcome-tour-close {
  border: none; background: none;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--color-text-tertiary);
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.welcome-tour-minimize:hover,
.welcome-tour-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--color-text); }
.welcome-tour-minimize { font-size: 22px; font-weight: 600; }
.welcome-tour-close { font-size: 22px; }
.welcome-tour-mini {
  position: fixed; z-index: 10070;
  bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  animation: welcome-tour-mini-in 0.2s ease;
}
.welcome-tour-mini[hidden] { display: none; }
.welcome-tour-mini-label {
  font-size: 12px; font-weight: 700; color: var(--color-accent);
  white-space: nowrap;
}
.welcome-tour-mini-expand {
  border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--color-accent, #f97316); color: #fff;
  font-size: 12px; font-weight: 600; font-family: inherit;
  white-space: nowrap;
}
.welcome-tour-mini-expand:hover { filter: brightness(1.05); }
.welcome-tour-mini-close {
  border: none; background: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  color: var(--color-text-tertiary); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.welcome-tour-mini-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--color-text); }
@keyframes welcome-tour-mini-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-tour-pulse {
  animation: welcome-tour-pulse 1.2s ease-in-out infinite;
}
@keyframes welcome-tour-pulse {
  0%, 100% { outline-color: rgba(255, 255, 255, 0.85); }
  50% { outline-color: rgba(249, 115, 22, 0.95); }
}

/* Dev-only floating button to replay dashboard tour (Ctrl+Alt+O) */
.dev-setup-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 9990;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  font-family: var(--font-body, Inter, sans-serif);
  color: var(--color-text-inverse, #fff);
  background: var(--color-accent, #f97316);
  border: none; border-radius: var(--radius-md, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer; opacity: 0.94;
  transition: opacity 0.15s, transform 0.15s;
}
.dev-setup-fab:hover { opacity: 1; transform: translateY(-1px); }
.dev-setup-fab[hidden] { display: none; }

/* ── Post-onboarding welcome choice ─────────────────────────────────── */
.welcome-choice-overlay {
  position: fixed; inset: 0; z-index: 10080;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.welcome-choice-card {
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--color-border);
}
.welcome-choice-header { text-align: center; margin-bottom: var(--space-5); }
.welcome-choice-header h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.welcome-choice-header p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.welcome-choice-video {
  display: block; width: 100%;
  border: none; padding: 0; margin: 0 0 var(--space-5);
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: default;
  position: relative;
  aspect-ratio: 16 / 9;
}
.welcome-choice-video-frame {
  width: 100%; height: 100%;
  border: 0; display: block;
}
.welcome-choice-video-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 220px;
  padding: var(--space-6); text-align: center;
  color: rgba(255, 255, 255, 0.85);
}
.welcome-choice-video-placeholder p { margin: var(--space-2) 0 0; font-size: var(--text-sm); }
.welcome-choice-video-hint { color: rgba(255, 255, 255, 0.55) !important; font-size: 12px !important; }
.welcome-choice-video-hint code { font-size: 11px; background: rgba(255,255,255,0.1); padding: 1px 4px; border-radius: 3px; }
.welcome-choice-video-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff; font-size: 13px; font-weight: 600;
  text-align: left; pointer-events: none;
}
.welcome-choice-video-duration { font-weight: 400; opacity: 0.85; }
.welcome-choice-video.is-placeholder-pulse { animation: welcome-choice-pulse 0.5s ease; }
@keyframes welcome-choice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
  50% { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.35); }
}
.welcome-choice-actions {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
}
.welcome-choice-tour { width: 100%; max-width: 360px; }
.welcome-choice-skip {
  border: none; background: none; cursor: pointer;
  font-size: var(--text-sm); color: var(--color-text-tertiary);
  font-family: inherit; padding: var(--space-2);
  text-decoration: underline; text-underline-offset: 2px;
}
.welcome-choice-skip:hover { color: var(--color-text-secondary); }

/* ── Manager preview bar (chatbot page, owner only) ─────────────────── */
/* Sits as the first flex child of .chat-fullpage so it pins to the top
   without overlapping the chat layout below it. */
.manager-preview-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: 8px 14px;
  background: var(--color-accent, #f97316);
  color: #fff;
  font-family: var(--font-body, Inter, sans-serif);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  z-index: 5;
}
.manager-preview-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--color-accent, #f97316);
  background: #fff;
  border: none; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s;
}
.manager-preview-back:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); }
.manager-preview-back svg { flex-shrink: 0; }
.manager-preview-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; line-height: 1.3;
  opacity: 0.96; text-align: right;
}
.manager-preview-label svg { flex-shrink: 0; opacity: 0.9; }
@media (max-width: 540px) {
  .manager-preview-label { display: none; }
  .manager-preview-bar { justify-content: flex-start; }
}
