/* ===========================================================
   Marketing AI · marketer view
   Single-column, generous, plain-English. Reuses tokens
   from styles.css (--bg, --c-clm/paid/ecomm/analysis, etc).
   =========================================================== */

.m-page {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 'Geist', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.m {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 28px 64px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; }

/* ===========================================================
   Top bar
   =========================================================== */

.m-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.m-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.m-brand__mark { display: inline-flex; width: 26px; height: 26px; color: var(--text); }
.m-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.m-brand__line1 {
  font-family: 'Inter Tight', 'Geist', system-ui, sans-serif;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.005em;
  line-height: 0.95;
}
.m-brand__line2 {
  font-family: 'Inter Tight', 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--mute);
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.m-top__link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mute);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.m-top__link:hover { color: var(--text); border-color: var(--line-3); background: var(--bg4); }

/* ===========================================================
   Intro
   =========================================================== */

.m-main { flex: 1; }

.m-intro { padding: 64px 0 36px; }
.m-intro__h {
  font-family: 'Fraunces', 'Geist', serif;
  font-weight: 300;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 18ch;
}
.m-intro__h em {
  font-style: italic;
  font-weight: 400;
  color: var(--c-clm);
}
.m-intro__dek {
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--mute);
  max-width: 60ch;
  margin: 0;
}

/* ===========================================================
   Agent picker
   =========================================================== */

.m-picker { padding: 36px 0 24px; }
.m-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.m-pick {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 18px 14px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 92px;
}
.m-pick:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--line-3);
}
.m-pick.is-active {
  background: var(--accent-soft, var(--bg4));
  border-color: var(--accent, var(--line-3));
  box-shadow: var(--shadow);
}

.m-pick--clm      { --accent: var(--c-clm);      --accent-soft: var(--c-clm-soft); }
.m-pick--paid     { --accent: var(--c-paid);     --accent-soft: var(--c-paid-soft); }
.m-pick--ecomm    { --accent: var(--c-ecomm);    --accent-soft: var(--c-ecomm-soft); }
.m-pick--analysis { --accent: var(--c-analysis); --accent-soft: var(--c-analysis-soft); }

.m-pick__label {
  font-family: 'Inter Tight', 'Geist', system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}
.m-pick.is-active .m-pick__label { color: var(--accent); }

.m-pick__pill {
  font-family: 'Inter Tight', 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-transform: lowercase;
}
.m-pick__pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ghost); display: inline-block; }
.m-pick__pill.is-live { color: var(--c-ok); }
.m-pick__pill.is-live .dot { background: var(--c-ok); box-shadow: 0 0 0 2px rgba(47,106,74,0.18); }

/* ===========================================================
   Ask
   =========================================================== */

.m-ask { padding: 0 0 40px; }
.m-ask__shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.m-ask__shell:focus-within {
  border-color: var(--accent, var(--text));
  box-shadow: 0 0 0 4px var(--accent-soft, rgba(0,0,0,0.04)), var(--shadow-sm);
}

.m-ask__input {
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  padding: 22px 18px 22px 24px;
  color: var(--text);
  width: 100%;
  min-height: 112px;
  max-height: 360px;
  font-family: inherit;
  overflow-y: auto;
}
.m-ask__input::placeholder { color: var(--ghost); }
.m-ask__input:disabled { color: var(--mute); cursor: default; }

.m-ask__btn {
  align-self: end;
  margin: 10px 10px;
  background: var(--text);
  color: #fdfaf2;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background .14s ease, transform .14s ease;
}
.m-ask__btn:hover { background: #000; transform: translateY(-1px); }
.m-ask__btn:disabled { background: var(--line-3); color: var(--bg2); cursor: not-allowed; transform: none; opacity: 0.85; }
.m-ask__btn--running { background: var(--accent, var(--text)); }
.m-ask__btn-arrow { display: inline-block; }

.m-ask__examples {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.m-chip {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .14s ease, background .14s ease, color .14s ease, transform .14s ease;
  line-height: 1.3;
}
.m-chip--clm      { --chip-accent: var(--c-clm);      --chip-soft: var(--c-clm-soft); }
.m-chip--paid     { --chip-accent: var(--c-paid);     --chip-soft: var(--c-paid-soft); }
.m-chip--ecomm    { --chip-accent: var(--c-ecomm);    --chip-soft: var(--c-ecomm-soft); }
.m-chip--analysis { --chip-accent: var(--c-analysis); --chip-soft: var(--c-analysis-soft); }
.m-chip:hover {
  border-color: var(--chip-accent, var(--line-3));
  color: var(--chip-accent, var(--text));
  background: var(--chip-soft, var(--bg4));
  transform: translateY(-1px);
}

/* ===========================================================
   Result
   =========================================================== */

.m-result { padding: 12px 0 0; }

.m-result__asked {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 22px;
  background: var(--bg4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--line-3));
  border-radius: 10px;
  margin-bottom: 22px;
}
.m-result__asked-label {
  font-family: 'Inter Tight', 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  flex-shrink: 0;
  padding-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.m-result__asked-sep { color: var(--ghost); }
.m-result__asked-agent {
  font-weight: 700;
  color: var(--accent, var(--text));
  letter-spacing: 0.04em;
}
.m-result__asked-agent--clm      { color: var(--c-clm); }
.m-result__asked-agent--paid     { color: var(--c-paid); }
.m-result__asked-agent--ecomm    { color: var(--c-ecomm); }
.m-result__asked-agent--analysis { color: var(--c-analysis); }
.m-result__asked-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
}

/* Steps */
.m-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.m-step:last-child { border-bottom: 0; }
.m-step__icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--bg2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s ease, background .15s ease;
}
.m-step__icon::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-3);
  transition: background .15s ease, transform .15s ease;
}

.m-step.is-running .m-step__icon {
  border-color: var(--accent, var(--c-clm));
  border-top-color: transparent;
  animation: m-spin 0.85s linear infinite;
}
.m-step.is-running .m-step__icon::after { display: none; }

.m-step.is-done .m-step__icon {
  border-color: var(--c-ok);
  background: var(--c-ok);
}
.m-step.is-done .m-step__icon::after {
  background: transparent;
  width: 11px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0;
  transform: rotate(-45deg) translate(1px, -2px);
}

.m-step.is-error .m-step__icon {
  border-color: var(--c-err);
  background: var(--c-err);
}
.m-step.is-error .m-step__icon::after {
  background: transparent;
  width: 8px; height: 8px;
  border-radius: 0;
  position: relative;
}
.m-step.is-error .m-step__icon::before {
  content: '!';
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

@keyframes m-spin {
  to { transform: rotate(360deg); }
}

.m-step__body { min-width: 0; }
.m-step__title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.m-step__detail {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.4;
  margin-top: 1px;
}

/* Response */
.m-response {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
}
.m-response p { margin: 0 0 14px; }
.m-response p:last-child { margin-bottom: 0; }
.m-response h1, .m-response h2, .m-response h3, .m-response h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin: 22px 0 10px;
}
.m-response h1 { font-size: 24px; }
.m-response h2 { font-size: 20px; }
.m-response h3 { font-size: 17px; }
.m-response h4 { font-size: 15px; color: var(--mute); }
.m-response ul, .m-response ol { padding-left: 22px; margin: 0 0 14px; }
.m-response li { margin: 4px 0; }
.m-response strong { font-weight: 600; color: var(--text); }
.m-response code {
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
}
.m-response table {
  border-collapse: collapse;
  margin: 12px 0 18px;
  width: 100%;
  font-size: 14px;
}
.m-response th, .m-response td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.m-response th {
  font-weight: 600;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-2);
}
.m-response hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.m-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--accent, var(--text));
  vertical-align: -3px;
  margin-left: 2px;
  animation: m-blink 1s steps(2, end) infinite;
}
@keyframes m-blink { to { opacity: 0; } }

/* Error */
.m-error {
  background: rgba(181, 74, 68, 0.06);
  border: 1px solid rgba(181, 74, 68, 0.3);
  color: var(--c-err);
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  margin-bottom: 20px;
}

/* After block */
.m-result__after {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
}
.m-ask-another {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.m-ask-another:hover {
  background: var(--bg4);
  border-color: var(--line-3);
  color: var(--accent, var(--text));
}

/* ===========================================================
   Footer
   =========================================================== */

.m-foot {
  margin-top: auto;
  padding: 22px 0 0;
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ===========================================================
   Notice (preview agent free-text fallback)
   =========================================================== */

.m-notice {
  background: var(--bg4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c-warn);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 18px;
}
.m-notice strong { color: var(--c-warn); font-weight: 600; }

/* ===========================================================
   Responsive
   =========================================================== */

@media (max-width: 720px) {
  .m { padding: 18px 18px 48px; }
  .m-intro { padding: 40px 0 28px; }
  .m-picker__grid { grid-template-columns: repeat(2, 1fr); }

  /* Ask: button drops below textarea as a full-width primary action.
     The desktop "send pill in the corner" pattern is fiddly with a thumb;
     a wide bottom button is unmistakable. Also cap textarea height so it
     stops dominating the viewport once the on-screen keyboard is up. */
  .m-ask__shell { grid-template-columns: 1fr; }
  .m-ask__input {
    font-size: 16px;
    padding: 14px 16px 12px;
    min-height: 88px;
    max-height: 200px;
  }
  .m-ask__btn {
    align-self: stretch;
    margin: 0 10px 10px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    justify-content: center;
    min-height: 48px;
    border-radius: 12px;
  }

  .m-result__asked { flex-direction: column; gap: 6px; align-items: stretch; padding: 14px 16px; }
  .m-response { padding: 20px 18px; font-size: 15px; }
}

@media (max-width: 440px) {
  .m-picker__grid { grid-template-columns: 1fr; }
}
