/* Stream Money lead capture — tokens from standards.md
   Neon blue and typefaces are PROVISIONAL until confirmed against the live brand guidelines. */
:root {
  --sm-mint: #53FFA6;
  --sm-grey: #D8D9D8;
  --sm-black: #000000;
  --sm-white: #FFFFFF;
  --sm-neon-blue: #1F51FF;      /* provisional */
  --ink-2: #333433;             /* secondary text on white/grey, AA */
  --line: #858685;              /* input borders, 3:1 on white */
  --surface-2: #ECEDEC;
  --danger: #B3261E;
  --font-display: 'Inter Tight', 'Inter', -apple-system, system-ui, sans-serif;  /* provisional */
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;                    /* provisional */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-h: 78px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sm-grey); }
body {
  font-family: var(--font-body); color: var(--sm-black);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--sm-neon-blue); font-weight: 600; }
:focus-visible { outline: 3px solid var(--sm-neon-blue); outline-offset: 2px; }
.screen--dark :focus-visible { outline-color: var(--sm-mint); }
[hidden] { display: none !important; }

.app { height: 100%; max-width: 560px; margin: 0 auto; position: relative; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--sm-grey); }
.screen--dark { background: var(--sm-black); color: var(--sm-white); }
.scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 12px) 20px calc(var(--bar-h) + var(--safe-bottom) + 24px);
  display: flex; flex-direction: column; gap: 18px;
}
#screen-capture .scroll { padding-bottom: 24px; }
#screen-capture form { display: flex; flex-direction: column; gap: 18px; padding-bottom: calc(var(--bar-h) + var(--safe-bottom) + 8px); }

/* Type */
.h1 { margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.h2 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; font-size: 15px; font-weight: 700; }
.muted { margin: 0; color: var(--ink-2); font-size: 15px; }
.small { font-size: 13px; line-height: 1.45; }

/* Header */
.brandbar { display: flex; justify-content: space-between; align-items: center; min-height: 56px; background: var(--sm-black); border-radius: 28px; padding: 6px 6px 6px 18px; }
.brandbar__logo { height: 24px; width: auto; display: block; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.intro { display: flex; flex-direction: column; gap: 6px; }
.intro__event { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-2); min-height: 1em; }
.intro__sub { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 22px; background: var(--sm-white); font-size: 14px; font-weight: 600; }
.pill__icon { width: 10px; height: 10px; border-radius: 50%; background: var(--sm-mint); border: 1.5px solid var(--sm-black); }
.pill[data-state="queued"] .pill__icon { background: var(--sm-white); border-style: dashed; }
.pill[data-state="offline"] .pill__icon { background: var(--sm-grey); }
.pill[data-state="error"] .pill__icon { background: var(--danger); border-color: var(--danger); }

.iconbtn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 22px; background: var(--sm-white); display: inline-flex; align-items: center; justify-content: center; }

/* Cards & fields */
.card, fieldset.card { margin: 0; border: 0; background: var(--sm-white); border-radius: 20px; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
fieldset.block { margin: 0; padding: 0; border: 0; min-width: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.opt { font-weight: 400; color: var(--ink-2); }
.hint { margin: 0; font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=password], select, textarea {
  width: 100%; min-width: 0; height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px;
  font-size: 17px; /* ≥16px stops iOS zoom on focus */ background: var(--sm-white); -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, #000 50%), linear-gradient(135deg, #000 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: none; }
input::placeholder, textarea::placeholder { color: #6B6C6B; }
input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; min-height: 44px; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--sm-black); }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--sm-white); border: 2px solid var(--danger); color: var(--danger); font-size: 14px; font-weight: 600; }

/* Chips & selectable buttons */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--sm-white); font-size: 15px; font-weight: 600; }
.chip svg { width: 16px; height: 16px; stroke-width: 2.6; display: none; }
.chip[aria-pressed="true"] { background: var(--sm-neon-blue); border-color: var(--sm-neon-blue); color: var(--sm-white); }
.chip[aria-pressed="true"] svg { display: block; }

.types { display: flex; flex-direction: column; gap: 8px; }
.type { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--sm-white); border-radius: 16px; background: var(--sm-white); text-align: left; }
.type__name { display: block; font-size: 16px; font-weight: 700; }
.type__meta { display: block; font-size: 14px; color: var(--ink-2); }
.type__tick { width: 28px; height: 28px; border-radius: 14px; background: var(--sm-neon-blue); color: var(--sm-white); display: none; align-items: center; justify-content: center; }
.type__tick svg { width: 16px; height: 16px; stroke-width: 2.6; }
.type[aria-pressed="true"] { border-color: var(--sm-neon-blue); }
.type[aria-pressed="true"] .type__tick { display: inline-flex; }

.days { display: flex; gap: 6px; overflow-x: auto; margin: 0 -4px; padding: 2px 4px 4px; scroll-snap-type: x proximity; }
.day { flex: none; width: 64px; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--sm-white); scroll-snap-align: start; }
.day__dow { font-size: 12px; font-weight: 600; }
.day__num { font-size: 20px; font-weight: 700; }
.day__mon { font-size: 11px; font-weight: 500; }
.day[aria-pressed="true"] { background: var(--sm-neon-blue); border-color: var(--sm-neon-blue); color: var(--sm-white); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sm-white); font-size: 16px; font-weight: 600; }
.slot[aria-pressed="true"] { background: var(--sm-neon-blue); border-color: var(--sm-neon-blue); color: var(--sm-white); }

.leadcard { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 20px; background: var(--sm-black); color: var(--sm-white); }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--sm-mint); color: var(--sm-black); display: flex; align-items: center; justify-content: center; }
.leadcard__text { min-width: 0; }
.leadcard__name { margin: 0; font-size: 16px; font-weight: 700; }
.leadcard__meta { margin: 2px 0 0; font-size: 14px; color: var(--sm-grey); overflow-wrap: anywhere; }

/* Buttons & bottom bar */
.bottombar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 10px; padding: 12px 20px calc(var(--safe-bottom) + 12px);
  background: var(--sm-white); border-top: 1px solid #C4C5C4;
}
.bottombar--stack { flex-direction: column; }
.bottombar__summary { margin: 0; text-align: center; font-size: 14px; font-weight: 600; }
.btn { height: 54px; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 27px; border: 1.5px solid transparent; font-size: 16px; font-weight: 600; text-decoration: none; }
.btn--wide { flex: 1.7; }
.btn--primary { background: var(--sm-black); color: var(--sm-white); }
.btn--primary:disabled { background: #6B6C6B; cursor: not-allowed; }
.btn--ghost { background: var(--sm-white); border-color: var(--sm-black); color: var(--sm-black); }
.btn--light { background: var(--sm-white); color: var(--sm-black); }
.btn--link { background: transparent; color: var(--sm-white); text-decoration: underline; text-underline-offset: 3px; height: 48px; }
.btn--dark { color: var(--sm-black); }
.btn--small { height: 44px; flex: none; font-size: 14px; padding: 0 14px; border-radius: 22px; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* Confirmation */
.scroll--dark { padding-bottom: calc(var(--safe-bottom) + 20px); }
.done__brand { min-height: 44px; display: flex; align-items: center; }
.done__brand img { height: 24px; width: auto; }
.done__body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.done__tick { width: 72px; height: 72px; border-radius: 36px; background: var(--sm-mint); color: var(--sm-black); display: flex; align-items: center; justify-content: center; }
.done__tick svg { width: 36px; height: 36px; stroke-width: 2.4; }
.done__sub { margin: 0; font-size: 16px; line-height: 1.45; color: var(--sm-grey); }
.summary { margin: 10px 0 0; padding: 6px 16px; border-radius: 20px; background: var(--sm-white); color: var(--sm-black); }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--sm-grey); }
.summary div:last-child { border-bottom: 0; }
.summary dt { font-size: 14px; color: var(--ink-2); }
.summary dd { margin: 0; font-size: 15px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.done__actions { display: flex; flex-direction: column; gap: 6px; }

/* Leads */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 20px; background: var(--sm-black); color: var(--sm-white); }
.banner svg { width: 24px; height: 24px; stroke-width: 2; }
.banner__title { margin: 0; font-size: 15px; font-weight: 700; }
.banner__text { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--sm-grey); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--sm-white); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat__n { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat__l { font-size: 13px; color: var(--ink-2); }
.leadlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lead { background: var(--sm-white); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.lead__top { display: flex; justify-content: space-between; gap: 12px; }
.lead__name { margin: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.lead__co { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.lead__time { font-size: 13px; color: var(--ink-2); flex: none; }
.lead__tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.tag svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tag--synced { background: var(--sm-mint); }
.tag--queued { background: var(--surface-2); border: 1px dashed var(--sm-black); }
.tag--error { background: var(--sm-white); border: 1.5px solid var(--danger); color: var(--danger); }
.tag--meeting { background: var(--sm-white); border: 1.5px solid var(--sm-neon-blue); color: var(--sm-neon-blue); }
.lead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { background: var(--sm-white); border-radius: 16px; padding: 20px 16px; font-size: 15px; line-height: 1.45; }

/* Settings sheet */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; background: var(--sm-white); }
.sheet::backdrop { background: rgba(0, 0, 0, .5); }
.sheet form { display: flex; flex-direction: column; gap: 16px; padding: 24px 20px calc(var(--safe-bottom) + 16px); }
.sheet .btn { flex: none; }

/* Toast */
.toast { position: absolute; left: 20px; right: 20px; bottom: calc(var(--bar-h) + var(--safe-bottom) + 12px); z-index: 20; padding: 14px 16px; border-radius: 14px; background: var(--sm-black); color: var(--sm-white); font-size: 15px; line-height: 1.4; }

@media (prefers-reduced-motion: no-preference) {
  .screen:not([hidden]) { animation: enter .18s ease-out; }
  @keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Layout guards: stop wide children (the day strip) stretching the page, and keep stacked buttons full height */
.scroll { overflow-x: hidden; }
.scroll > *, .card > *, fieldset > * { min-width: 0; }
.bottombar--stack .btn, .done__actions .btn { flex: none; }
.types .type { width: 100%; }
.legend + * { clear: both; }

/* v2: phone with dialling code, volume options, notes counter, legal footer */
.phone { display: flex; gap: 8px; }
.phone__dial { width: 120px; flex: none; padding: 0 30px 0 10px; }
.phone input { flex: 1; }
.volumes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.volume { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sm-white); font-size: 15px; font-weight: 600; }
.volume[aria-checked="true"] { background: var(--sm-neon-blue); border-color: var(--sm-neon-blue); color: var(--sm-white); }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.counter { font-size: 12px; color: var(--ink-2); }
.counter[data-near="true"] { color: var(--danger); font-weight: 600; }
.legal { margin-top: 6px; padding-top: 14px; border-top: 1px solid #B9BAB9; color: var(--ink-2); font-size: 11px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
.legal p { margin: 0; }
.legal__h { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.legal--dark { color: var(--sm-grey); border-top-color: #333433; }
.done__body { flex: none; min-height: 60vh; }

/* v3: iPhone 16/17 range (393–440pt) and Galaxy S25/S26 Ultra (≈412 × 915 CSS px), Android Chrome and Samsung Internet */
:root {
  --font-display: 'Inter Tight', 'Inter', -apple-system, 'Roboto', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, 'Roboto', 'Segoe UI', system-ui, sans-serif;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
html, body { height: 100%; }
@supports (height: 100dvh) { .app { height: 100dvh; } }
.scroll { padding-left: calc(20px + var(--safe-left)); padding-right: calc(20px + var(--safe-right)); }
.bottombar { padding-left: calc(20px + var(--safe-left)); padding-right: calc(20px + var(--safe-right)); }
/* Android draws content under the status bar in standalone mode with viewport-fit=cover; keep a minimum top gap where no inset is reported. */
.scroll { padding-top: max(calc(var(--safe-top) + 12px), 28px); }
/* Let controls grow with the phone's text-size setting instead of clipping. */
.btn, .chip, .volume, .slot, .pill { height: auto; min-height: 44px; }
.btn { min-height: 54px; padding-top: 8px; padding-bottom: 8px; text-align: center; line-height: 1.25; }
.btn--small { min-height: 44px; }
.slot, .volume { min-height: 48px; }
input[type=text], input[type=email], input[type=tel], input[type=password], select { height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; }
.day { height: auto; min-height: 76px; padding: 6px 0; }
/* Wider phones (iPhone Plus/Pro Max, Galaxy Ultra) get a fourth time column and roomier chips. */
@media (min-width: 410px) {
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .h1 { font-size: 36px; }
}
/* When the on-screen keyboard shrinks the viewport (Android), let the action bar sit at the end of the form instead of covering fields. */
@media (max-height: 560px) {
  .bottombar { position: static; }
  #screen-capture form { padding-bottom: 0; }
  .scroll { padding-bottom: 24px; }
  .toast { bottom: 12px; }
}
/* Landscape or tablets: keep a single readable column. */
@media (orientation: landscape) and (min-width: 700px) {
  .app { max-width: 600px; }
}
