/* MVS Psychology Group — shared styles */
:root {
  --bg: #f4f7f8;
  --bg-2: #e8eff1;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --ink: #0b1f29;
  --ink-2: #33495a;
  --muted: #5f7482;
  --line: #dce5ea;
  --primary: #0d6a72;
  --primary-strong: #08525a;
  --primary-soft: #e0f0f0;
  --on-primary: #ffffff;
  --accent: #e8875a;
  --accent-soft: #fcebe1;
  --lilac: #e8e6fa;
  --lilac-ink: #3d3a78;
  --ok: #1f8a5b;
  --alert-bg: #fdf0e8;
  --alert-line: #e8a27c;
  --code-bg: #0c1a20;
  --code-ink: #d4e3e6;
  --code-muted: #7f98a1;
  --shadow: 0 1px 2px rgba(11, 31, 41, .06), 0 18px 48px -22px rgba(11, 31, 41, .28);
  --radius: 18px;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a161b; --bg-2: #0f1f26; --surface: #11232a; --surface-2: #152a32;
    --ink: #e5eef1; --ink-2: #bccbd2; --muted: #8ea3ad; --line: #22363f;
    --primary: #4cbfbb; --primary-strong: #7ad5d1; --primary-soft: #133238; --on-primary: #04211f;
    --accent: #f3a077; --accent-soft: #37241a; --lilac: #1c1e3a; --lilac-ink: #c6c3f7;
    --alert-bg: #33231a; --alert-line: #a8694a; --code-bg: #071014;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 22px 50px -24px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a161b; --bg-2: #0f1f26; --surface: #11232a; --surface-2: #152a32;
  --ink: #e5eef1; --ink-2: #bccbd2; --muted: #8ea3ad; --line: #22363f;
  --primary: #4cbfbb; --primary-strong: #7ad5d1; --primary-soft: #133238; --on-primary: #04211f;
  --accent: #f3a077; --accent-soft: #37241a; --lilac: #1c1e3a; --lilac-ink: #c6c3f7;
  --alert-bg: #33231a; --alert-line: #a8694a; --code-bg: #071014;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 22px 50px -24px rgba(0,0,0,.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--primary); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { margin: 0; text-wrap: balance; color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; line-height: 1.04; }
h1 { font-size: clamp(42px, 6.4vw, 78px); }
h2 { font-size: clamp(34px, 4.4vw, 54px); }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
h1 em, h2 em { font-style: italic; color: var(--primary); }
p { margin: 0; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 58ch; }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); border-radius: 2px; }
.section { padding-block: clamp(64px, 9vw, 110px); }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; max-width: 760px; }
.tint { background: var(--bg-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15.5px; border-radius: 999px; padding: 13px 22px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-family: var(--display); font-size: 19px; letter-spacing: .02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.brand-text span { white-space: nowrap; font-size: 11.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-phone { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; color: var(--ink); cursor: pointer; }
@media (max-width: 1020px) { .nav-links, .nav-phone { display: none; } .nav-cta { margin-left: auto; } }
@media (max-width: 1020px) { .menu-btn { display: grid; place-items: center; margin-left: 0; } }
.mobile-menu { border-top: 1px solid var(--line); background: var(--surface); }
.mobile-menu ul { list-style: none; margin: 0; padding: 10px 20px 18px; display: grid; gap: 2px; }
.mobile-menu a { display: block; padding: 11px 4px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }

/* ============ Mia chat ============ */
.mia { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; height: 640px; max-height: calc(100svh - 110px); min-height: 480px; font-size: 15px; }
.mia-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px 16px; }
.mia-avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, var(--primary), var(--primary-strong)); color: var(--on-primary); display: grid; place-items: center; font-family: var(--display); font-size: 21px; }
.mia-avatar::after { content: ""; position: absolute; right: -1px; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #34c77b; border: 2px solid var(--surface); }
.mia-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mia-who b { font-size: 15.5px; }
.mia-who span { font-size: 12.5px; color: var(--muted); }
.mia-mode { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--lilac-ink); background: var(--lilac); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.mia-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.mia-icon:hover { color: var(--primary); border-color: var(--primary); }
.mia-close { display: none; }
.mia-progress { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0; padding: 0 16px 12px; border-bottom: 1px solid var(--line); counter-reset: p; }
.mia-progress li { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mia-progress li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.mia-progress li.done::before { background: var(--primary); }
.mia-progress li.now::before { background: linear-gradient(90deg, var(--primary) 50%, var(--line) 50%); }
.mia-progress li.now, .mia-progress li.done { color: var(--ink-2); }
.mia-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; background: var(--surface-2); overscroll-behavior: contain; }
.mia-row { display: flex; flex-direction: column; gap: 7px; max-width: 90%; animation: rise .25s ease both; }
@keyframes rise { from { opacity: .0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mia-row.bot { align-self: flex-start; }
.mia-row.user { align-self: flex-end; align-items: flex-end; }
.mia-bubble { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.bot .mia-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.user .mia-bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.mia-bubble.alert { background: var(--alert-bg); border-color: var(--alert-line); }
.mia-bubble.success { border-color: var(--primary); display: flex; gap: 8px; align-items: flex-start; }
.mia-ok { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; margin-top: 1px; }
.mia-typing { display: inline-flex; gap: 4px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; border-bottom-left-radius: 6px; }
.mia-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite; }
.mia-typing i:nth-child(2) { animation-delay: .18s; } .mia-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.mia-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.mia-chip { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--primary); background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent); border-radius: 999px; padding: 6px 12px; cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.mia-chip:hover { background: var(--primary-soft); border-color: var(--primary); }
.mia-choices.used .mia-chip, .mia-choices.used + * .mia-chip { opacity: .4; pointer-events: none; }
.mia-row:not(:last-child) .mia-slots .mia-chip { opacity: .4; pointer-events: none; }
.mia-time { font-variant-numeric: tabular-nums; min-width: 78px; text-align: center; }
.mia-slots { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.mia-slotday { display: flex; flex-direction: column; gap: 6px; }
.mia-slotday > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mia-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px; }
.mia-pic { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.mia-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mia-card-body b { font-size: 15px; }
.mia-card-body small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.mia-card-body .bio { color: var(--ink-2); margin-top: 3px; }
.mia-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.mia-tags span { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); }
.mia-summary { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.mia-summary dt { color: var(--muted); }
.mia-summary dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.mia-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.mia-input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.mia-input:focus { outline: none; border-color: var(--primary); }
.mia-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; }
.mia-send:hover { background: var(--primary-strong); }
.mia-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mia-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; align-items: center; padding: 0 14px 11px; background: var(--surface); font-size: 11.5px; color: var(--muted); }
.mia-human { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* floating mode */
.mia.is-floating { position: fixed; z-index: 80; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: 410px; height: min(680px, calc(100svh - 40px)); max-height: none; animation: pop .22s ease both; }
.mia.is-floating .mia-close { display: grid; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .mia.is-floating { inset: 0; width: auto; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.fab { position: fixed; z-index: 70; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; font-size: 15px; box-shadow: 0 14px 34px -12px rgba(0,0,0,.45); cursor: pointer; animation: pop .25s ease both; }
.fab .mia-avatar { width: 38px; height: 38px; font-size: 19px; }
.fab .mia-avatar::after { border-color: var(--ink); }

/* footer */
.footer { background: #0b1f29; color: #b9c9d0; padding-block: 56px 36px; font-size: 14.5px; border-top: 1px solid var(--line); }
.footer a { color: inherit; }
.footer .brand-text b, .footer h3 { color: #f1f6f7; }
.footer .brand-text span { color: #88a0ab; }
.footer .brand-mark { background: #4cbfbb; color: #04211f; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.crisis { margin-top: 40px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.crisis b { color: #f1f6f7; }
.foot-bottom { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: #7d95a0; }

@media (max-width: 440px) { .brand-text span { display: none; } .nav-in { gap: 12px; } }
