/* ==========================================================================
   marketing-scope.css — the redesigned "Scope your project" chat/quote
   experience (Guru-Site redesign, teal era). One experience whose UI states
   map to the six "Cloud testing" Figma comps (Peace, review 300304d6, A2):
   chat opened → message sent → generating → response + draft-quote panel →
   submit. Depends on marketing-tokens.css + marketing-components.css.
   ========================================================================== */

.mks-shell { position: relative; padding: 40px 24px 88px; }
.mks-title {
  margin: 24px auto 0;
  text-align: center;
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 550;
  letter-spacing: -1.2px;
  line-height: 1.2;
  color: var(--mk-heading);
}
.mks-sub {
  margin: 14px auto 0;
  max-width: 520px;
  text-align: center;
  font-size: var(--mk-para-s-size);
  line-height: var(--mk-para-s-lh);
  color: var(--mk-secondary);
}

/* --- Two-panel card ------------------------------------------------------- */
.mks-card {
  display: grid;
  grid-template-columns: minmax(0, 13fr) minmax(0, 7fr);
  max-width: 1280px;
  margin: 40px auto 0;
  border: 1.5px solid #2e3538;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f2ec;
  box-shadow: 8px 10px 0 -2px rgba(114, 166, 171, 0.5);
}

.mks-pane { display: flex; flex-direction: column; min-height: 560px; }
.mks-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #dedbd1;
}
.mks-pane-header strong {
  font-size: var(--mk-para-size);
  font-weight: 550;
  color: var(--mk-heading);
}
.mks-session-pill {
  margin-left: 10px;
  padding: 3px 10px;
  border: 1px solid var(--mk-border);
  border-radius: 999px;
  background: var(--mk-surface);
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--mk-secondary);
  white-space: nowrap;
}

/* --- Chat pane -------------------------------------------------------------- */
.mks-transcript {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.mks-empty {
  margin: auto;
  max-width: 480px;
  text-align: center;
}
.mks-empty .mk-face { margin-bottom: 20px; }
.mks-empty-title {
  margin: 0;
  font-size: var(--mk-para-size);
  font-weight: 600;
  letter-spacing: -0.16px;
  color: var(--mk-heading);
}
.mks-empty-example {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mk-secondary);
}

.mks-msg { display: flex; gap: 10px; max-width: 85%; }
.mks-msg-human { align-self: flex-end; justify-content: flex-end; }
.mks-msg-agent { align-self: flex-start; }
.mks-msg .mk-face { align-self: flex-end; }
.mks-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: var(--mk-para-s-size);
  line-height: var(--mk-para-s-lh);
  color: var(--mk-body);
  overflow-wrap: anywhere;
}
.mks-msg-human .mks-bubble {
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  border-bottom-right-radius: 4px;
  color: var(--mk-heading);
}
.mks-msg-agent .mks-bubble {
  background: #ecebe2;
  border-bottom-left-radius: 4px;
}
.mks-bubble p { margin: 0 0 8px; }
.mks-bubble p:last-child { margin-bottom: 0; }
.mks-bubble ul, .mks-bubble ol { margin: 0 0 8px; padding-left: 20px; }

.mks-thinking span {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--mk-secondary);
  animation: mks-bounce 1.2s infinite;
}
.mks-thinking span:nth-child(2) { animation-delay: 0.15s; }
.mks-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mks-bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .mks-thinking span { animation: none; }
}

.mks-system {
  align-self: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}
.mks-system-info { background: #ecebe2; color: var(--mk-body); }
.mks-system-ok { background: #eef8ef; color: #1e7a38; }
.mks-system-warn { background: #fdf3e0; color: #8a5a00; }
.mks-system-error { background: #fbe9e7; color: #a3312a; }

/* --- Input row ---------------------------------------------------------------- */
.mks-input-wrap { padding: 16px 24px 20px; }
.mks-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  background: var(--mk-surface);
  border: 1px solid var(--mk-primary);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(114, 166, 171, 0.17);
}
.mks-input-row:focus-within { border-color: var(--mk-primary-hover); }
.mks-input-row input {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--mk-font);
  font-size: 14px;
  letter-spacing: -0.14px;
  color: var(--mk-contrast);
}
.mks-input-row input::placeholder { color: rgba(0, 0, 0, 0.5); }
.mks-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--mk-secondary);
  cursor: pointer;
}
.mks-icon-btn:hover:not(:disabled) { background: var(--mk-primary-tint); }
.mks-icon-btn:disabled { opacity: 0.4; cursor: default; }
.mks-icon-btn img, .mks-icon-btn svg { width: 16px; height: 16px; display: block; }
.mks-input-divider { width: 1px; height: 18px; background: var(--mk-border); }
.mks-upchip {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--mk-secondary);
}

/* --- Draft pane ------------------------------------------------------------------ */
.mks-draft-pane {
  background: #eae9df;
  border-left: 1.5px solid #2e3538;
}
.mks-draft-actions { display: flex; align-items: center; gap: 4px; }
.mks-draft-actions .mks-total-pill { margin-left: 6px; }
.mks-icon-btn.mks-copied { color: #1e7a38; background: #eef8ef; }
.mks-total-pill {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  font-size: var(--mk-caption-size);
  color: var(--mk-heading);
  white-space: nowrap;
}
.mks-draft-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.mks-draft-empty { margin: auto; max-width: 260px; text-align: center; }
.mks-draft-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--mk-surface);
  box-shadow: 0 2px 10px rgba(46, 53, 56, 0.08);
  color: var(--mk-primary-pressed);
}
.mks-draft-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mk-secondary);
}
.mks-section-label {
  margin: 16px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--mk-secondary);
}
.mks-section-label:first-child { margin-top: 0; }
.mks-section-body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mk-body); }
.mks-phase {
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  border-radius: 10px;
}
.mks-phase-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--mk-para-s-size);
  font-weight: 600;
  color: var(--mk-heading);
}
.mks-phase-sub { font-weight: 400; font-size: var(--mk-caption-size); color: var(--mk-secondary); white-space: nowrap; }
.mks-task-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--mk-body);
}
.mks-task-h { color: var(--mk-secondary); white-space: nowrap; }
.mks-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--mk-body); }

.mks-draft-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #d8d6ca;
}
.mks-footnote { margin: 0; font-size: var(--mk-caption-size); line-height: 1.5; color: var(--mk-secondary); }

/* --- Submit-for-review -------------------------------------------------------------- */
.mks-submit { margin-bottom: 16px; }
.mks-submit-head strong { display: block; font-size: var(--mk-para-s-size); color: var(--mk-heading); }
.mks-submit-sub { display: block; margin-top: 4px; font-size: var(--mk-caption-size); line-height: 1.5; color: var(--mk-secondary); }
.mks-field { margin-top: 10px; }
.mks-field label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--mk-caption-size);
  font-weight: 600;
  color: var(--mk-heading);
}
.mks-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--mk-border);
  border-radius: 8px;
  background: var(--mk-surface);
  font-family: var(--mk-font);
  font-size: 13px;
  color: var(--mk-contrast);
}
.mks-field input:hover { border-color: #c9ccc4; }
.mks-field input:focus { outline: none; border-color: var(--mk-primary); box-shadow: 0 0 0 3px rgba(114, 166, 171, 0.2); }
.mks-field input:disabled { background: #f2f0e9; color: var(--mk-disabled); }
.mks-field-row { display: flex; gap: 10px; }
.mks-field-row .mks-field { flex: 1; }
.mks-submit-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fbe9e7;
  font-size: 13px;
  color: #a3312a;
}
.mks-submit .mk-btn { width: 100%; margin-top: 12px; }
.mks-submit-success { text-align: center; padding: 8px 0; }
.mks-submit-success h3 { margin: 8px 0 4px; font-size: var(--mk-para-size); color: var(--mk-heading); }
.mks-submit-success p { margin: 0; font-size: 13px; color: var(--mk-body); }
.mks-success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #eef8ef;
  border: 1.5px solid #35c759;
  color: #35c759;
  font-size: 18px;
  font-weight: 700;
}

/* --- Turnstile gate -------------------------------------------------------------------- */
.mks-gate {
  max-width: 480px;
  margin: 48px auto 0;
  padding: 32px;
  text-align: center;
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  border-radius: 16px;
}
.mks-gate h2 { margin: 0 0 8px; font-size: 20px; font-weight: 550; color: var(--mk-heading); }
.mks-gate p { margin: 0 0 16px; font-size: 13px; color: var(--mk-secondary); }
.mks-gate .cf-turnstile { display: inline-block; }

/* --- Responsive ---------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .mks-card { grid-template-columns: 1fr; }
  .mks-pane { min-height: 0; }
  .mks-transcript { min-height: 320px; max-height: 55vh; }
  .mks-draft-pane { border-left: none; border-top: 1.5px solid #2e3538; }
  .mks-draft-body { max-height: 45vh; }
}
