/* Balmve Partners: sign-in, sign-up, magic-link and not-found pages. Loaded after warm.css (tokens) and after each page's own CSS.
 * One calm split screen: deep teal brand panel on the left (what you get, in plain facts), paper form on the right.
 * No masthead tricks, no italic serif, no gradients, no quotes we did not collect. */
:root { --font-display: var(--font); }
body { background: var(--surface); color: var(--ink); font-family: var(--font); }

/* ---------- Split shell: form on the left, the product on the right ---------- */
.shell { display: grid; grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr); min-height: 100vh; min-height: 100dvh; }
/* The right cell stretches the full height of a long form; the inset panel inside stays pinned to the viewport.
   Nothing on .hero may clip (overflow hidden/auto): that makes it the sticky scroller and the pin stops working.
   The panel itself clips, which is what lets the app screen run off its right and bottom edges. */
.hero { position: static; display: block; min-height: 100vh; min-height: 100dvh; isolation: auto; overflow: visible; padding: 16px 16px 16px 0;
  background: var(--surface); color: var(--ink); }
.hero::before, .hero::after { display: none; }
.hero-inner { --pad: clamp(28px, 3.5vw, 56px); --bleed: 72px; --panel-end: #edf5f4;
  position: sticky; top: 16px; display: flex; flex-direction: column; height: calc(100vh - 32px); height: calc(100dvh - 32px);
  padding: clamp(32px, 6vh, 64px) var(--pad) 0; border-radius: 20px; overflow: hidden; container: panel / inline-size;
  background: linear-gradient(180deg, #d4e7e5 0%, var(--panel-end) 100%); }
/* The app screen fades out at the bottom of the panel instead of stopping on a hard line. */
.hero-inner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(237, 245, 244, 0), var(--panel-end) 85%); }
.hero-body { max-width: 520px; }
h1.hero-title { font: 600 clamp(28px, 2.7vw, 38px)/1.1 var(--font); font-style: normal; letter-spacing: -0.03em; color: var(--ink); max-width: 17ch;
  margin: 0 0 14px; text-wrap: balance; font-variation-settings: normal; }
h1.hero-title .roman, h1.hero-title em { font-style: normal; font-weight: 600; }
.hero-accent { color: #0b6a61; }
.hero-lead { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; margin: 0; text-wrap: pretty; }
.hero-lead strong { color: var(--ink); font-weight: 600; }
.edition, .pullquote, .mast-meta { display: none; }

/* ---------- The app screen (hero-chat.js): a copy of /me/messages as it looks today ---------- */
.hero-shot { position: relative; flex: none; margin: clamp(28px, 5vh, 48px) 0 0; width: calc(100% + var(--pad) + var(--bleed)); }
.hc { display: grid; grid-template-columns: 150px minmax(0, 1fr); height: max(720px, calc(100vh - 240px)); height: max(720px, calc(100dvh - 240px)); border-radius: 14px; overflow: hidden; color: var(--ink); background: var(--surface-3);
  box-shadow: 0 0 0 1px rgba(23, 23, 40, 0.08), 0 24px 56px -28px rgba(23, 23, 40, 0.34); }
.hc-side { background: var(--sidebar); color: var(--sidebar-ink); padding: 16px 10px; }
.hc-brand { display: grid; gap: 2px; padding: 2px 8px 14px; margin-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.hc-brand b { font: 650 14px var(--font); letter-spacing: -0.01em; color: #ffffff; }
.hc-brand span { font: 500 12px var(--font); color: var(--sidebar-ink-2); }
.hc-nav { display: grid; gap: 1px; }
.hc-nav span { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--r-sm); font: 500 12.5px var(--font); }
.hc-nav svg { width: 15px; height: 15px; opacity: 0.8; flex: none; }
.hc-nav .on { background: rgba(255, 255, 255, 0.13); color: #ffffff; font-weight: 600; }
.hc-nav .on svg { opacity: 1; color: #6fdccf; }
.hc-main { display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 0; }
.hc-top { padding: 0 2px 14px; }
.hc-top b { display: block; font: 600 18px/1.2 var(--font); letter-spacing: -0.02em; }
.hc-top p { margin: 4px 0 0; font: 400 12px/1.45 var(--font); color: var(--ink-2); max-width: 44ch; }
.hc-card { flex: 1; min-height: 0; display: grid; grid-template-columns: 228px minmax(0, 1fr); background: var(--surface); border-radius: 12px 12px 0 0; }

/* Inbox: All / Unread, search, then the room list */
.hc-inbox { border-right: 1px solid var(--border); padding: 10px 8px; min-width: 0; }
.hc-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 10px; }
.hc-inbox-head b { font: 700 14px var(--font); }
.hc-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; }
.hc-seg span { padding: 2px 8px; border-radius: 6px; font: 600 12px/1.4 var(--font); color: var(--ink-3); }
.hc-seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(23, 23, 40, 0.08); }
.hc-search { display: flex; align-items: center; gap: 7px; margin: 0 2px 12px; padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px;
  font: 400 12px var(--font); color: var(--ink-3); }
.hc-search svg { width: 13px; height: 13px; flex: none; }
.hc-label { font: 500 12px var(--font); color: var(--ink-3); padding: 0 6px 6px; }
.hc-row + .hc-label { margin-top: 12px; }
.hc-past { display: flex; align-items: center; gap: 5px; color: var(--ink-2); }
.hc-past svg { width: 12px; height: 12px; flex: none; }
.hc-past span { margin-left: auto; color: var(--ink-3); }
.hc-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; align-items: center; width: 100%; padding: 7px 6px; border: 0;
  border-radius: var(--r-sm); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color 140ms; }
.hc-row + .hc-row { margin-top: 1px; }
.hc-row:hover { background: var(--surface-2); }
.hc-row.on { background: var(--accent-weak); }
/* Room tiles in the app's tones (warm.css .ch-avatar.a-*) */
.hc-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1px rgba(14, 72, 84, 0.07); }
.hc-av svg { width: 18px; height: 18px; }
.hc-team { background: var(--sidebar); color: #e3efef; box-shadow: none; }
.hc-community { background: #dcebea; color: #0e4854; }
.hc-training { background: #f4e9d0; color: #7a5512; }
.hc-brief { background: #f7e6dd; color: #a2482f; }
.hc-row.on .hc-av { box-shadow: 0 0 0 2px var(--surface); }
.hc-rbody { min-width: 0; }
.hc-rtop { display: flex; align-items: baseline; gap: 4px; }
.hc-rtop b { flex: 1; min-width: 0; font: 600 13px/1.2 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-row.on .hc-rtop b { font-weight: 700; }
.hc-rtop time { font: 500 12px var(--font); color: var(--ink-3); flex: none; }
.hc-pin { display: inline-flex; align-self: center; color: var(--ink-3); opacity: 0.7; }
.hc-pin svg { width: 10px; height: 10px; }
.hc-row.on .hc-pin { color: var(--accent); opacity: 1; }
.hc-snip { display: block; font: 400 12px/1.35 var(--font); color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-cap { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 3px; }
.hc-cap .hc-snip { flex: 1; min-width: 0; margin: 0; }
.hc-chip { flex: none; display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font: 600 12px/1.35 var(--font); background: var(--good-weak); color: var(--good); white-space: nowrap; }

/* The open room. The part past the panel edge is cut off, so the room keeps its text inside the visible part. */
.hc-thread { --cut: calc(var(--bleed) - 18px); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hc-thread[hidden] { display: none; }
.hc-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.hc-head .hc-av { width: 30px; height: 30px; }
.hc-head .hc-av svg { width: 16px; height: 16px; }
.hc-id { display: grid; min-width: 0; line-height: 1.3; }
.hc-id b { display: flex; align-items: center; gap: 8px; min-width: 0; font: 700 13.5px var(--font); white-space: nowrap; }
.hc-sep { color: var(--border-strong); }
.hc-link { color: var(--accent); font-weight: 600; }
.hc-id small { display: flex; align-items: center; gap: 6px; font: 400 12px var(--font); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px rgba(18, 133, 90, 0.18); flex: none; }
.hc-pins { display: flex; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.hc-pins span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-weak); color: var(--accent-ink);
  border: 1px solid var(--accent-line); font: 600 12px/1.4 var(--font); }
.hc-pins svg { width: 10px; height: 10px; }
.hc-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 12px calc(var(--cut) + 14px) 12px 14px; background: var(--surface-2); }
/* Dates ride in a small pill in the middle, as in the app */
.hc-day { display: flex; justify-content: center; }
.hc-day span { padding: 3px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(19, 41, 44, 0.05), 0 6px 14px -8px rgba(19, 41, 44, 0.18); font: 600 12px/1.4 var(--font); color: var(--ink-2); white-space: nowrap; }
.hc-group { display: flex; gap: 8px; max-width: 90%; }
.hc-group.them { align-self: flex-start; }
.hc-group.me { align-self: flex-end; }
.hc-mav { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; align-self: flex-end; font: 700 12px var(--font); }
.hc-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.hc-group.me .hc-stack { align-items: flex-end; }
.hc-who { display: flex; align-items: baseline; gap: 6px; padding: 0 3px 1px; white-space: nowrap; }
.hc-who b { font: 650 12.5px var(--font); color: var(--ink); }
.hc-who time { font: 500 12px var(--font); color: var(--ink-3); }
.hc-tag { display: inline-flex; align-items: center; gap: 3px; align-self: center; padding: 0 7px 0 4px; border-radius: 999px; background: var(--accent-weak); color: var(--accent-ink); font: 600 12px/1.5 var(--font); }
.hc-tag svg { width: 12px; height: 12px; flex: none; }
.hc-bub { margin: 0; padding: 7px 11px; border-radius: 12px; font: 400 13px/1.45 var(--font); text-wrap: pretty; }
.hc-bub b { font-weight: 650; }
.hc-group.them .hc-bub { background: var(--surface-3); }
.hc-group.them .hc-bub.first { border-top-left-radius: 5px; }
.hc-group.me .hc-bub { background: var(--accent); color: #ffffff; }
.hc-group.me .hc-bub.first { border-top-right-radius: 5px; }
.hc-time { font: 500 12px var(--font); color: var(--ink-3); padding: 0 3px; }
.hc-compose { padding: 8px calc(var(--cut) + 12px) 10px 12px; border-top: 1px solid var(--border); }
.hc-shell { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 10px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 12px; font: 400 13px var(--font); color: var(--ink-3); }
.hc-shell svg { width: 15px; height: 15px; flex: none; }
.hc-shell span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-send { flex: none; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--accent); color: #ffffff; font: 650 12px var(--font); opacity: 0.5; }
.hc-ro { text-align: center; font: 400 12px/1.4 var(--font); color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
/* Narrower panels drop the app sidebar first, then turn the inbox into a rail of room tiles. */
@container panel (max-width: 540px) {
  .hc { grid-template-columns: minmax(0, 1fr); }
  .hc-side { display: none; }
}
@container panel (max-width: 400px) {
  .hc-card { grid-template-columns: 50px minmax(0, 1fr); }
  .hc-inbox { padding: 10px 5px; }
  .hc-inbox-head, .hc-search, .hc-label, .hc-rbody { display: none; }
  .hc-row { grid-template-columns: 32px; justify-content: center; padding: 5px 0; }
  .hc-row + .hc-row { margin-top: 4px; }
}
.hero :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Form side ---------- */
.form-panel { background: var(--surface); padding: clamp(28px, 5vh, 48px) clamp(24px, 5vw, 80px) 56px; display: flex; flex-direction: column; min-width: 0; }
.form-panel > .mast { display: flex; align-items: baseline; gap: 6px; margin: 0 0 clamp(28px, 6vh, 56px); padding: 0; border: 0; font: 650 16px var(--font); letter-spacing: -0.01em; }
.form-panel > .mast .wordmark { color: var(--sidebar); font: inherit; letter-spacing: inherit; text-transform: none; }
.form-panel > .mast .division { color: var(--ink-3); font: 500 16px var(--font); letter-spacing: 0; text-transform: none; padding: 0; border: 0; }
/* The logo and the back link line up with the form's left edge. */
.form-panel > .mast, .form-panel > .back-link { align-self: center; width: min(100%, 440px); }
/* A short form (sign in) sits in the middle of the column; a long one (apply) starts at the top. */
.form-wrap { width: 100%; max-width: 440px; margin: auto; }
.back-link { align-self: flex-start; font: 600 14px var(--font); color: var(--ink-2); margin-bottom: 28px; }
.back-link:hover { color: var(--accent-ink); }
h2.form-title { font: 600 28px/1.15 var(--font); font-style: normal; letter-spacing: -0.025em; color: var(--ink); margin: 0 0 8px; font-variation-settings: normal; }
h2.form-title .roman, h2.form-title em { font-style: normal; font-weight: 600; }
.form-sub { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0 0 28px; max-width: 46ch; text-wrap: pretty; }
.section-title { font-family: var(--font); font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--accent-ink); }
.chip[aria-pressed="true"] { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid rgba(14, 72, 84, 0.16); outline-offset: 0; }
.success-check { background: var(--good-weak); color: var(--good); }
.field-error { color: var(--danger); }

/* ---------- Phone and tablet: the product panel goes, the form takes the screen ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .hero { display: none; }
  .form-panel { padding: 24px 20px 56px; }
  .form-panel > .mast { margin-bottom: 32px; }
  .form-wrap { margin: 0 auto; }
  h2.form-title { font-size: 24px; }
}

/* ---------- Single-card notices: magic link, expired link, not found ---------- */
body.notice-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--surface-3); }
.notice { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 32px 28px; text-align: left; box-shadow: none; }
.notice-brand { display: flex; flex-direction: column; gap: 3px; margin-bottom: 28px; }
.notice-brand b { font: 650 16px var(--font); letter-spacing: -0.01em; color: var(--sidebar); }
.notice-brand span { font: 500 13px var(--font); color: var(--ink-3); }
.notice h1 { font: 600 24px/1.2 var(--font); font-style: normal; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px; }
.notice p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; text-wrap: pretty; }
.notice-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.notice-actions form { flex: 1 1 100%; }
.notice .btn, .notice button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 15px var(--font); text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease; }
.notice .btn-primary, .notice button { background: var(--accent); color: #ffffff; width: auto; }
.notice form button { width: 100%; }
.notice .btn-primary:hover, .notice button:hover { background: var(--accent-hover); }
.notice .btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.notice .btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.notice .btn:focus-visible, .notice button:focus-visible { outline: 2px solid #0e8f81; outline-offset: 2px; }
.notice .notice-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink-3); }
.notice-foot a { color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) { * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
.status-pill .pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: none; box-shadow: none; }
