/* Add-on: crm (js/plus/crm.js). The guest form's required-field messages, the returning guest's Welcome back, the verify-in-person step, the sales desk block in
   the presenter drawer and the read-only previous-visit summary. Same material as the form: the welcome form is light paper with dark ink (css/ux/welcome.css);
   the presenter drawer and the sheet use the glass tokens. No new blur, no animation beyond what the drawer already does. */

/* ---------- required fields ---------- */
#drawer .crm-err { display: block; margin-top: .35rem; font: 500 max(.82rem, 13px)/1.35 var(--sans); letter-spacing: 0; text-transform: none; color: #b42318; }
#drawer:not(.ux-setup) .crm-err { color: #ffb4a8; }
#drawer .crm-err[hidden] { display: none; }
#drawer .nm input[aria-invalid="true"] { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
#drawer .crm-consent { margin: -.2rem 0 0; font: 400 max(.8rem, 12.5px)/1.45 var(--sans); color: rgba(22, 22, 27, .66); }
/* (QA Q3) the form's rows keep their full height: a two-line guest sentence was squeezed to one line (the second hidden under Welcome back) once the form outgrew the panel */
#drawer.ux-setup .ux-scroll > * { flex-shrink: 0; }

/* ---------- what the form says about the number ---------- */
#drawer .crm-id:empty { display: none; }
#drawer .crm-id { display: grid; gap: .6rem; }
#drawer .crm-ok { display: flex; align-items: center; gap: .5rem; margin: 0; font: 500 max(.88rem, 13.5px)/1.35 var(--sans); color: var(--lg-fg2, inherit); }
#drawer .crm-ok svg, #drawer .crm-back-ic svg { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#drawer .crm-ok svg { color: var(--ok); }
#drawer .crm-verify { display: grid; gap: .75rem; padding: .9rem 1rem; border-radius: 14px; background: var(--lg-field); box-shadow: inset 0 0 0 1px var(--lg-line); }
#drawer.ux-setup .crm-verify { background: rgba(22, 22, 27, .045); box-shadow: inset 0 0 0 1px rgba(22, 22, 27, .12); }
#drawer .crm-verify b { display: block; font: 600 max(.98rem, 15px)/1.3 var(--sans); }
#drawer .crm-verify small { display: block; margin-top: .2rem; font: 400 max(.85rem, 13px)/1.45 var(--sans); opacity: .78; }
#drawer .crm-verify > .pill { justify-self: start; }
#drawer .crm-verify .pill svg, #drawer .crm-acts .pill svg, #drawer .crm-desk .pill svg { width: 1rem; height: 1rem; margin-right: .4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#drawer .crm-signin { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; }
#drawer .crm-signin .crm-err { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { #drawer .crm-signin { grid-template-columns: 1fr; } }

/* ---------- Welcome back (the welcome form, a verified returning guest) ---------- */
#drawer .crm-back { display: grid; gap: .55rem; padding: 1rem 1.1rem 1.05rem; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px rgba(22, 22, 27, .1); color: #16161b; }
#drawer .crm-back-t { display: flex; align-items: center; gap: .6rem; }
#drawer .crm-back-ic { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(143, 196, 160, .22); color: #2f7a4d; }
#drawer .crm-back h3 { margin: 0; font: 500 max(1.35rem, 20px)/1.15 var(--sans); letter-spacing: -.015em; }
#drawer .crm-back p { margin: 0; font: 400 max(.95rem, 14.5px)/1.45 var(--sans); color: rgba(22, 22, 27, .78); }
#drawer .crm-back small { font: 500 max(.8rem, 12.5px)/1.4 var(--sans); color: rgba(22, 22, 27, .66); }
#drawer .crm-acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
#drawer .crm-acts .pill { display: inline-flex; align-items: center; }
#drawer .crm-acts .pill[disabled] { opacity: .55; cursor: default; }
/* the saved answers fold away under Review / update details (the guest's sentence above still says them) */
#drawer.ux-setup .ux-scroll.crm-folded > .chips,
#drawer.ux-setup .ux-scroll.crm-folded > .crm-fold { display: none; }   /* .crm-fold: each question's label (js/plus/crm.js), no :has() (style recalc on the tablet) */

/* ---------- the sales desk block (presenter drawer · Visit) ---------- */
#drawer .crm-desk { display: grid; gap: .6rem; margin: 0 0 1.2rem; padding: 0 0 1.1rem; border-bottom: 1px solid var(--lg-line); }
#drawer .crm-desk .k { margin: 0; }
#drawer .crm-desk > .pill { justify-self: start; display: inline-flex; align-items: center; text-decoration: none; }
#drawer .crm-line { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin: 0; font: 400 max(.9rem, 14px)/1.4 var(--sans); color: var(--lg-fg2); }
#drawer .crm-line > i { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--sold); }
#drawer .crm-line.on > i { background: var(--ok); }
#drawer .crm-line b { color: var(--lg-fg); font-weight: 600; }

/* ---------- the previous visit's summary (read only) ---------- */
#sheet.crm-sum { z-index: 85; }   /* it opens from the guest form, so above the open drawer (#drawer.on: 80 in css/ux/welcome.css) */
#sheet.crm-sum .sh-panel { margin-inline: auto; }   /* (QA Q11) centred, as the other sheets look on the TV */
#drawer.on.ux-setup ~ #toast { z-index: 90; }   /* a toast raised while the welcome form is open (Welcome back …) shows above it, not half under it */
/* (QA Q9) once the sales desk's CRM knows a hold, the card says it once ("Held for you · until …"): the old button and sync line step aside */
#lv-summary .sm-home .sm-holdbox.crm-done { display: none; }
/* a hold still waiting for the sales desk shows no "Held for …" seal or green plan; they come back (stamped) when it is approved, without a repaint */
#lv-summary .sm-home.crm-wait .sm-seal, #lv-summary .sm-home.crm-wait .sm-green { display: none; }
#sheet.crm-sum .sh-panel { padding: 2rem 2.2rem 2.2rem; max-width: min(980px, calc(100vw - 2rem)); }
#sheet.crm-sum .crm-sum-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.3rem; padding-right: 3.6rem; }
#sheet.crm-sum .k { margin: 0; color: var(--lg-fg3); }
#sheet.crm-sum h2 { margin: .25rem 0 .2rem; font: 400 max(1.7rem, 24px)/1.12 var(--sans); letter-spacing: -.02em; }
#sheet.crm-sum .sub { margin: 0; color: var(--lg-fg2); }
#sheet.crm-sum .crm-sum-nav { display: flex; gap: .5rem; }
#sheet.crm-sum .crm-sum-nav .cx-btn[disabled] { opacity: .4; }
#sheet.crm-sum .crm-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem 2rem; }
#sheet.crm-sum section { min-width: 0; }
#sheet.crm-sum section > .k { margin-bottom: .55rem; }
#sheet.crm-sum dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
#sheet.crm-sum dt { color: var(--lg-fg3); font: 500 max(.85rem, 13px)/1.4 var(--sans); }
#sheet.crm-sum dd { margin: 0; font: 500 max(.95rem, 14.5px)/1.4 var(--sans); }
#sheet.crm-sum .crm-homes { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
#sheet.crm-sum .crm-homes li { display: grid; gap: .1rem; padding: 0 0 .55rem; border-bottom: 1px solid var(--lg-line); }
#sheet.crm-sum .crm-homes li:last-child { border-bottom: 0; padding-bottom: 0; }
#sheet.crm-sum .crm-homes b { font: 600 max(.98rem, 15px)/1.3 var(--sans); }
#sheet.crm-sum .crm-homes span { color: var(--lg-fg2); font: 400 max(.88rem, 13.5px)/1.4 var(--sans); }
#sheet.crm-sum .crm-homes em { font: 500 max(.8rem, 12.5px)/1.3 var(--sans); font-style: normal; color: var(--lg-fg3); }
#sheet.crm-sum .crm-hs { justify-self: start; padding: .15rem .55rem; border-radius: 999px; background: var(--lg-field); }
#sheet.crm-sum .crm-hs-approved { background: rgba(143, 196, 160, .25); }
#sheet.crm-sum .crm-hs-pending { background: rgba(223, 176, 106, .25); }
@media (max-width: 640px) { #sheet.crm-sum .sh-panel { padding: 1.4rem 1.1rem 1.6rem; } #sheet.crm-sum .crm-sum-head { padding-right: 3rem; } }
