/* API-only additions; prototype styles are kept verbatim in their own file. */
body.modal-open {
  overflow: hidden;
}
.live-form,
.live-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.live-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.live-field input,
.live-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  font-size: 15px;
}
.live-field textarea {
  min-height: 78px;
  resize: vertical;
}
.live-account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.form-error,
.load-error {
  color: var(--red);
}
.form-error[hidden] {
  display: none;
}
.load-error p {
  color: var(--muted);
}
.dates {
  overflow-x: auto;
  flex-wrap: nowrap;
}
/* The modal body scrolls; its sections must keep their height instead of
   shrinking (a scrollable row like .dates would otherwise collapse to 0). */
.modal-body > * {
  flex-shrink: 0;
}
.dates .dbtn {
  flex: none;
}
.article {
  overflow-wrap: anywhere;
}
.article img {
  max-width: 100%;
  height: auto;
}
.live-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.live-guide-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  margin-bottom: 14px;
}
.live-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  font-size: 15px;
}
#modal .kv b {
  overflow-wrap: anywhere;
  max-width: 65%;
  text-align: right;
}
#modal .phase-head {
  padding: 12px 16px 4px;
}
@media (max-width: 560px) {
  .live-guide-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .live-toolbar .btn {
    flex: 1;
  }
}
/* Signup: a single current step, completed steps, and keyboard-visible focus. */
.ob-progress {
  width: 100%;
  max-width: 560px;
}
.ob-progress-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ob-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--ob-step-count), minmax(0, 1fr));
  margin: 0;
  padding: 0;
}
.ob-step {
  position: relative;
  min-width: 0;
}
.ob-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
}
.ob-step:first-child::before {
  left: 50%;
}
.ob-step:last-child::before {
  right: 50%;
}
.ob-step.complete::before {
  background: var(--good);
}
.ob-step button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 2px;
  min-height: 48px;
}
.ob-step button:disabled {
  cursor: default;
  opacity: 1;
}
.ob-step-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ob-step-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  max-width: 100%;
}
.ob-step.complete .ob-step-mark {
  background: var(--good);
  border-color: var(--good);
  color: #fff;
}
.ob-step.current .ob-step-mark {
  border-color: var(--red);
  background: var(--red);
  color: var(--red-ink);
  box-shadow: 0 0 0 4px var(--red-soft);
}
.ob-step.current .ob-step-label {
  color: var(--red);
  font-weight: 700;
}
.ob-step.complete .ob-step-label {
  color: var(--ink);
}
.ob-form .opt:focus,
.ob-form .chip:focus,
.ob-form .field:focus,
.live-field input:focus,
.live-field select:focus,
.live-field textarea:focus {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}
.ob-step button:focus-visible .ob-step-mark {
  outline: 2px solid var(--sky);
  outline-offset: 4px;
}
#onboarding-title:focus {
  outline: none;
}
@media (max-width: 1150px) {
  .ob-step-label {
    display: none;
  }
  .ob-step button {
    min-height: 34px;
  }
}
@media (max-width: 560px) {
  .ob-step-mark {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .ob-step::before {
    top: 11px;
  }
  .ob-step.current .ob-step-mark {
    box-shadow: 0 0 0 3px var(--red-soft);
  }
}
/* Keep the form's hit area and scroll container inside the dialog bounds. */
.modal {
  overflow: hidden;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s;
}
.modal-body {
  min-height: 0;
  overscroll-behavior: contain;
}
@supports (height: 100dvh) {
  .modal {
    max-height: min(86dvh, 820px);
  }
  @media (max-width: 900px) {
    .modal {
      max-height: 90dvh;
    }
  }
}
.guide-card-media .app-guide-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
}
.guide-card-media .link {
  margin-top: auto;
  padding-top: 8px;
}
.modal.guide-reader {
  width: min(820px, calc(100vw - 40px));
}
.guide-reader .modal-body {
  padding: 28px 32px;
  gap: 22px;
}
.guide-reader-article {
  width: 100%;
  max-width: 70ch;
  margin: 0 auto;
}
.guide-reader .mhead {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
@media (max-width: 900px) {
  .modal.guide-reader {
    width: 100%;
  }
  .guide-reader .modal-body {
    padding: 22px 20px;
  }
}

.destination-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.destination-fields label {
  font-size: 14px;
  font-weight: 600;
}
.destination-fields select {
  width: 100%;
  min-height: 48px;
}
.destination-later {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
.destination-later input {
  width: 18px;
  height: 18px;
  accent-color: var(--red, #ff5267);
}

.welcome-actions {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  align-self: flex-start;
}
.welcome-actions .welcome-action,
.welcome-actions .welcome-action:visited {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  font: 700 15px var(--body);
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}
.welcome-actions .welcome-action-secondary,
.welcome-actions .welcome-action-secondary:visited {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}
.welcome-actions .welcome-action-secondary:hover {
  border-color: var(--sky);
  background: var(--sky-soft);
}
.welcome-actions .welcome-action > svg:last-child {
  opacity: 0.65;
}
.welcome-actions .welcome-action:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

/* Native selects retain their keyboard/mobile behavior, with consistent app styling. */
.live-field select,
.destination-fields select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  min-height: 48px;
  padding: 12px 42px 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A98AD' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.live-field select option,
.destination-fields select option {
  background: var(--surface);
  color: var(--ink);
}
.live-field select:disabled {
  opacity: 0.55;
  cursor: wait;
}
.live-guide-controls.guide-filter-bar {
  grid-template-columns: minmax(180px, 1.2fr) 160px minmax(180px, 1fr);
  gap: 16px;
  align-items: end;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  margin: 0;
}
.guide-filter-bar .live-field {
  min-width: 0;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
.guide-filter-bar .search {
  min-height: 48px;
  padding: 0 14px;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.guide-filter-bar .search input {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 400;
  font-size: 14px;
}
.guide-filter-bar .search:focus-within {
  border-color: var(--sky);
  outline: 2px solid var(--sky-soft);
}
.guide-library-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.guide-library-heading h2 {
  font-size: 21px;
}
.gcards.app-guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.app-guide-grid .gcard {
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}
.app-guide-grid .app-guide-cover {
  width: calc(100% + 40px);
  max-width: none;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 0;
  margin: -20px -20px 4px;
}
.app-guide-grid .gcard b {
  font-size: 20px;
  line-height: 1.35;
  text-wrap: pretty;
}
.app-guide-grid .gcard > .small.muted {
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-guide-grid .gcard .link {
  margin-top: auto;
  padding-top: 8px;
}
@media (max-width: 1150px) {
  .gcards.app-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .live-guide-controls.guide-filter-bar {
    grid-template-columns: minmax(0, 1fr) 150px;
    padding: 16px;
  }
  .guide-filter-search {
    grid-column: 1/-1;
  }
}
@media (max-width: 540px) {
  .gcards.app-guide-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .live-guide-controls.guide-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }
  .welcome-actions .welcome-action {
    min-height: 54px;
    padding: 14px 16px;
  }
}

.app-guide-grid .gcard .link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  text-decoration: none;
}
/* Keep older cached welcome link markup usable while the matching JS is refreshed. */
.ob-form a.link.small[href="/app/login"],
.ob-form a.link.small[href="/app/guides"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: 700 15px var(--body);
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.ob-form .btn.btn-block[data-act="start"] {
  min-height: 56px;
}
@media (prefers-reduced-motion: reduce) {
  .app-guide-grid .gcard,
  .welcome-actions .welcome-action {
    transition: none;
    transform: none;
  }
}

.page.guide-library {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

/* Companion: keep the message box on screen. The base height did not count
   the conversation toolbar added above the chat (and the phone bottom bar). */
.chatwrap {
  height: min(680px, calc(100dvh - 345px));
  min-height: 380px;
}
@media (max-width: 900px) {
  .chatwrap {
    height: calc(100dvh - 385px);
    min-height: 340px;
  }
}

/* Me → account page */
.me-page {
  max-width: 1080px;
}
.me-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.me-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 14px;
}
.me-card-head p {
  margin-top: 3px;
}
.me-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
}
.me-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 22px;
  font-weight: 800;
}
.me-profile-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.me-profile-text p {
  overflow-wrap: anywhere;
}
.me-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.me-edit,
.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}
.me-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.me-main,
.me-side {
  display: grid;
  gap: 20px;
}
.me-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* last row's bottom border is clipped by the card edge */
  margin: 0 0 -1px;
  border-top: 1px solid var(--line);
}
.me-fact {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.me-fact:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.me-fact:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: 0;
}
.me-fact dt {
  font-size: 12.5px;
  color: var(--muted);
}
.me-fact dd {
  margin: 3px 0 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.me-fact dd.situation-missing {
  color: var(--red);
}
.me-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 40px);
  margin: 0 20px 14px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.me-callout span {
  flex: 1;
}
.me-progress {
  height: 6px;
  margin: 0 20px 14px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
}
.me-progress i {
  display: block;
  height: 100%;
  background: var(--good);
  border-radius: inherit;
}
.me-rows {
  border-top: 1px solid var(--line);
}
.me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 14.5px;
}
.me-row:first-child {
  border-top: 0;
}
button.me-row:hover {
  background: var(--surface-2);
}
.me-row > svg {
  flex: none;
  color: var(--muted);
}
.me-row-label {
  flex: 1;
  min-width: 0;
}
.me-row-label.strong {
  font-weight: 600;
}
.me-row-value {
  color: var(--muted);
  font-size: 13.5px;
  text-align: right;
}
.me-danger .me-row-label {
  color: var(--red);
  font-weight: 600;
}
.me-doc-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.me-doc-icon.done {
  background: var(--good-soft);
  color: var(--good);
}
.me-upload {
  cursor: pointer;
}
@media (max-width: 960px) {
  .me-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .me-profile {
    flex-wrap: wrap;
  }
  .me-avatar {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .me-edit {
    width: 100%;
  }
  .me-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .me-fact:nth-child(odd) {
    border-right: 0;
  }
}
#modal .destination-fields {
  display: grid;
  gap: 8px;
}
#modal .destination-fields .field {
  min-height: 48px;
  font-size: 15px;
  font-weight: 500;
}
.situation-household {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px 14px;
  margin: 0;
  display: grid;
  gap: 6px;
}
.situation-household legend {
  padding: 0 4px;
  font-weight: 600;
}
.me-card-head .num {
  white-space: nowrap;
}

/* Wallet: employer Life & Settlement credits + invite credits */
.wcard{border-radius:var(--r-lg,22px);padding:20px;color:#fff;background:linear-gradient(135deg,#D21F31,#8E1220);display:flex;flex-direction:column;gap:8px;position:relative;overflow:hidden}
.wcard::after{content:"";position:absolute;right:-36px;bottom:-36px;width:140px;height:140px;border-radius:50%;border:22px solid #00A1DE;opacity:.35;pointer-events:none}
.wcard .eyebrow{color:rgba(255,255,255,.85)}
.wcard .big{font-family:var(--display);font-size:40px;font-weight:800;line-height:1;position:relative;z-index:1}
.wcard .wsub{opacity:.9;position:relative;z-index:1}
.wcard .wb{display:flex;gap:8px;flex-wrap:wrap;position:relative;z-index:1;margin-top:4px}
.wcard .wb button{background:rgba(255,255,255,.18);color:#fff;border:0;border-radius:999px;padding:8px 14px;font-weight:700;font-size:13px;cursor:pointer}
.wcard .wb button:hover{background:rgba(255,255,255,.28)}
.wstats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;position:relative;z-index:1}
.wstats div{background:rgba(255,255,255,.14);border-radius:12px;padding:8px 10px}
.wstats b{display:block;font-family:var(--display);font-size:18px}
.wstats span{font-size:12px;opacity:.85}
.refcode{font-family:var(--display);font-weight:800;font-size:20px;letter-spacing:.06em;padding:6px 12px;border-radius:10px;border:1.5px dashed var(--line);background:var(--surface-2)}
.plogo{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--surface-2);flex:none}
.plogo.wal{background:var(--red);color:#fff}
.paypick{display:flex;flex-direction:column;gap:8px}
.prov-pick:disabled{opacity:.5;cursor:not-allowed}
.wallet-row{display:flex;gap:14px;align-items:center;text-align:left;width:100%}
.me-code-link{align-self:flex-start}
.me-ben{padding:18px 20px}

/* Passes, checkout and payments (webapp-commerce.js) */
.cm-hero{display:flex;flex-direction:column;gap:6px;background:#0E1A2C;color:#fff;border-radius:var(--r-lg);padding:20px 22px;margin-bottom:16px}
.cm-hero .eyebrow{color:#9EDDF6;font-size:11px;letter-spacing:.09em;font-weight:700}
.cm-hero b{font-family:"Bricolage Grotesque",sans-serif;font-size:24px;line-height:1.15;font-weight:800}
.cm-hero span:last-child{color:rgba(255,255,255,.74);font-size:14px;line-height:1.45}
.cm-tier{align-items:flex-start}
.cm-tier[disabled]{opacity:.55;cursor:default}
.cm-tier .pill{vertical-align:middle;margin-left:4px}
.cm-price{display:block;margin:10px 0 8px;color:var(--muted);font-size:13.5px}
.cm-price b{display:inline!important;font-family:"Bricolage Grotesque",sans-serif;font-size:28px!important;color:var(--ink);margin-right:6px}
.cm-feats{display:grid;gap:6px;border-top:1px solid var(--line);padding-top:10px}
.cm-feats span{display:flex;gap:8px;align-items:center;color:var(--ink)!important;font-size:13.5px}
.cm-feats svg{color:var(--good);flex:none}
.cm-feats .cm-x{color:var(--muted)!important;text-decoration:line-through}
.cm-feats .cm-x svg{color:var(--muted)}
.cm-settled{display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:14px 16px;margin:16px 0 10px}
.cm-settled .tic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;flex:none}
.cm-sum{margin-bottom:6px}.cm-sum .kv:first-child{border-top:0}
#cm-me .kv span{display:flex;gap:8px;align-items:center}
.modal .opts+.btn,.modal .btn-block+.btn-block{margin-top:10px}
.live-field[hidden] {
  display: none;
}
