/* ==========================================================
   Lula Helpline - caller page look (the start screen and the
   conversation screen). Loaded only by pages/index.html, after
   lula.css, so the staff, responder and admin pages never see it.

   Appearance only. Every element, id, word and behaviour on the
   page is unchanged; this file decides how they look.

   Navy structure, Lula pink for actions and highlights, white
   ground. No aqua and no green on this page.
   ========================================================== */

/* The colours. Also given to the responder's preview of a grounding
   exercise, so she sees it exactly as the caller will. */
body.caller-page, .grounding-preview-frame {
  --c-navy: #0e2a47;
  --c-navy-light: #1d3e5e;
  --c-pink: #e8557a;
  --c-pink-hover: #d44368;
  /* Pink for words on a light background. The fill pink is too light to
     read as text at body size, so text uses this deeper shade of it. */
  --c-pink-ink: #c2305c;
  --c-pink-light: #fce8ed;
  --c-pink-soft: #f9d8e0;
  --c-white: #ffffff;
  --c-off-white: #faf8f9;
  --c-text: #1e1e1e;
  --c-grey-text: #4a4a4a;
  --c-grey-light: #6b6b6b;
  --c-border: #e8e3e6;
  --c-amber: #f0b429;
  --c-offline: #b9b2b7;
  --c-ring: rgba(232, 85, 122, .18);
  --c-shadow: 0 12px 30px rgba(14, 42, 71, .08);
}

body.caller-page {
  margin: 0;
  padding: 1.25rem 1rem 5.5rem;
  background: var(--c-white);
  color: var(--c-text);
  /* rem, so the Text size setting scales the whole page */
  font-size: 1rem;
  line-height: 1.55;
}

/* Higher contrast setting: darker colours and firm borders. */
html.high-contrast body.caller-page, html.high-contrast .grounding-preview-frame {
  --c-navy: #001f3f;
  --c-navy-light: #003366;
  --c-pink: #c41e4a;
  --c-pink-hover: #a3173c;
  --c-pink-ink: #a3173c;
  --c-pink-light: #ffe0e8;
  --c-pink-soft: #ffc4d4;
  --c-off-white: #ffffff;
  --c-text: #000000;
  --c-grey-text: #1a1a1a;
  --c-grey-light: #2a2a2a;
  --c-border: #000000;
  --c-shadow: none;
}

.caller-page :focus-visible { outline: 3px solid var(--c-pink); outline-offset: 2px; }
.caller-page a { color: var(--c-navy); text-underline-offset: 2px; }
.caller-page a:hover { color: var(--c-pink-ink); }
.caller-page .skip-link { background: var(--c-navy); color: var(--c-white); border-radius: 8px; font-weight: 600; }

/* ---------------- the card ---------------- */

.caller-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 28px;
  box-shadow: var(--c-shadow);
  overflow: hidden;
}
html.high-contrast .caller-card { border-width: 3px; }

/* ---------------- navy header ---------------- */

.caller-page .caller-header {
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  padding: 1.15rem 1.6rem 1.05rem;
  background: var(--c-navy);
  border-bottom: 4px solid var(--c-pink);
}
.caller-page .caller-header .brand { gap: .75rem; color: var(--c-white); border-radius: 12px; }
.caller-page .caller-header .brand img {
  height: 2.6rem; width: 2.6rem;
  border-radius: 50%; background: var(--c-white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.caller-page .caller-header .brand-text { line-height: 1.2; }
.caller-page .caller-header .brand-name {
  color: var(--c-white); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em;
}
.caller-page .caller-header .brand-sub {
  color: var(--c-white); opacity: .9; font-size: .875rem;
  text-transform: none; letter-spacing: .01em; font-weight: 400;
}

/* Leave this page: Lula pink, white edge, always easy to find */
.caller-page .exit-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--c-pink); color: var(--c-white);
  border: 1.5px solid var(--c-white); border-radius: 999px;
  padding: .45rem .95rem; font-size: .875rem; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap; transition: background .15s, transform .1s;
}
.caller-page .exit-btn:hover { background: var(--c-pink-hover); }
.caller-page .exit-btn:active { transform: scale(.97); }
.caller-page .exit-btn:focus-visible { outline: 3px solid var(--c-white); outline-offset: 3px; }
.caller-page .btn-icon { width: 1rem; height: 1rem; fill: currentColor; flex: none; pointer-events: none; }

/* ---------------- page body ---------------- */

.caller-page .caller-shell { max-width: none; margin: 0; padding: 1.8rem 1.8rem 1.4rem; }
.caller-page .hint { color: var(--c-grey-text); }

/* ---------------- start screen ---------------- */

.caller-page .caller-hero { padding: 0; margin-bottom: 1.25rem; }
.caller-page .caller-hero h1 {
  font-size: 1.4rem; font-weight: 600; color: var(--c-navy);
  letter-spacing: -0.01em; margin: 0 0 .6rem;
}
.caller-page .caller-hero p.lead { font-size: 1rem; color: var(--c-grey-text); line-height: 1.55; margin: 0; }

/* Emergency notice: pink edge on soft pink */
.caller-page .emergency-band {
  background: var(--c-pink-light);
  border: 0; border-left: 5px solid var(--c-pink);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.2rem; margin: 0 0 1.5rem;
  font-size: .95rem; color: var(--c-navy); line-height: 1.55;
}
.caller-page .emergency-band strong { color: var(--c-pink-ink); }
html.high-contrast .caller-page .emergency-band { border: 2px solid #000; border-left-width: 5px; }

/* Closed: a pink "Closed" tag, then the heading and the hours */
.caller-page .closed-band { background: none; border: 0; border-radius: 0; padding: 0; margin: 0 0 1rem; }
.caller-page .closed-band::before {
  content: "\25CF\00a0 Closed";
  content: "\25CF\00a0 Closed" / "";
  display: inline-block; margin-bottom: .9rem;
  background: var(--c-pink); color: var(--c-white);
  font-size: .875rem; font-weight: 600; letter-spacing: .02em;
  padding: .25rem 1rem; border-radius: 999px;
}
.caller-page .closed-band strong {
  display: block; font-size: 1.2rem; font-weight: 600; color: var(--c-navy); margin-bottom: .25rem;
}
.caller-page .closed-band p { margin: .35rem 0 0; font-size: .95rem; color: var(--c-grey-text); line-height: 1.55; }

/* Whether a responder is free */
.caller-page .availability {
  display: flex; align-items: center; gap: .55rem;
  font-size: .95rem; color: var(--c-grey-light); margin: 0 0 1.4rem;
}
.caller-page .status-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--c-border); }
.caller-page .status-AVAILABLE { background: var(--c-pink); }
.caller-page .status-BUSY { background: var(--c-amber); }
.caller-page .status-OFFLINE { background: var(--c-offline); }
@media (prefers-reduced-motion: no-preference) {
  .caller-page .status-AVAILABLE { animation: caller-pulse 2s infinite; }
}
@keyframes caller-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* The panel that holds location, consent and the start button is no longer
   a box of its own: each part inside it is. */
.caller-page #startScreen > .panel {
  background: none; border: 0; box-shadow: none; padding: 0; margin: 0;
}

/* Where are you? */
.caller-page .location-section {
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: 18px;
  padding: 1.4rem 1.4rem 1.2rem; margin: 0 0 1.5rem;
}
.caller-page .location-section h2 {
  font-size: 1rem; font-weight: 600; color: var(--c-navy); margin: 0 0 .5rem;
}
.caller-page .optional-note { font-weight: 400; font-size: .875rem; color: var(--c-grey-light); margin-left: .2rem; }
.caller-page .location-section > .hint { font-size: .95rem; color: var(--c-grey-text); line-height: 1.5; margin: 0 0 1.1rem; }

.caller-page .choice-grid { gap: 1rem; margin: 0; }
.caller-page .choice {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: 14px;
  padding: .85rem 2.6rem .85rem 1rem;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.caller-page .choice::after {
  content: ""; position: absolute; top: 50%; right: 1rem;
  width: 1.05rem; height: 1.05rem; margin-top: -.525rem;
  border-radius: 50%; border: 2px solid var(--c-border); background: var(--c-white);
  box-sizing: border-box; transition: border-color .15s, background .15s, box-shadow .15s;
}
.caller-page .choice:hover { border-color: var(--c-pink-soft); background: #fffafb; }
.caller-page .choice[aria-pressed="true"] {
  border-color: var(--c-pink); background: var(--c-pink-light);
  box-shadow: inset 0 0 0 1px var(--c-pink);
}
.caller-page .choice[aria-pressed="true"]::after {
  border-color: var(--c-pink); background: var(--c-pink);
  box-shadow: inset 0 0 0 3px var(--c-white);
}
.caller-page .choice .choice-title { font-size: 1rem; font-weight: 600; color: var(--c-navy); }
.caller-page .choice .choice-note { font-size: .875rem; color: var(--c-grey-light); }

.caller-page .location-section .field { margin: 1.1rem 0 0; }
.caller-page .location-section .field label { font-size: .875rem; font-weight: 600; color: var(--c-navy); margin-bottom: .4rem; }
.caller-page select {
  border: 1px solid var(--c-border); border-radius: 10px;
  padding: .65rem .85rem; font-size: .95rem; color: var(--c-text); background-color: var(--c-white);
  transition: border-color .15s, box-shadow .15s;
}
.caller-page select:focus { border-color: var(--c-pink); box-shadow: 0 0 0 3px var(--c-ring); }

/* Before we begin: white with a navy frame */
.caller-page .consent-box {
  background: var(--c-white);
  border: 2px solid var(--c-navy); border-radius: 20px;
  padding: 1.4rem 1.6rem; margin: 0 0 1.4rem;
}
.caller-page .consent-box h3 { font-size: 1.05rem; font-weight: 600; color: var(--c-navy); margin: 0 0 .8rem; }
.caller-page .consent-text {
  max-height: 340px; font-size: .9rem; line-height: 1.6; color: var(--c-grey-text);
  margin-bottom: 1rem; padding-right: .25rem;
  scrollbar-width: thin; scrollbar-color: var(--c-border) transparent;
}
.caller-page .consent-text p { margin: 0 0 .8rem; }

/* "I Agree": the tick box sits inside a navy pill that fills in when ticked */
.caller-page .consent-box .check { position: relative; display: inline-flex; gap: 0; }
.caller-page .consent-box .check input {
  position: absolute; left: 1rem; top: 50%; margin: 0;
  width: 1.1rem; height: 1.1rem; transform: translateY(-50%);
  accent-color: var(--c-pink); cursor: pointer;
}
.caller-page .consent-box .check label {
  display: inline-block; cursor: pointer;
  padding: .7rem 1.4rem .7rem 2.65rem;
  border: 2px solid var(--c-navy); border-radius: 999px;
  background: var(--c-white); color: var(--c-navy);
  font-size: .95rem; font-weight: 600; line-height: 1.3;
  transition: background .15s, color .15s;
}
.caller-page .consent-box .check label:hover { background: var(--c-pink-light); }
.caller-page .consent-box .check input:checked + label { background: var(--c-navy); color: var(--c-white); }
.caller-page .consent-box .check input:focus-visible { outline: none; }
.caller-page .consent-box .check input:focus-visible + label { outline: 3px solid var(--c-pink); outline-offset: 3px; }

/* ---------------- buttons ---------------- */

.caller-page .btn { border-radius: 999px; font-weight: 600; }
.caller-page .btn-primary {
  background: var(--c-pink); color: var(--c-white); border: 1px solid var(--c-pink);
  transition: background .15s, transform .1s;
}
.caller-page .btn-primary:hover:not(:disabled) { background: var(--c-pink-hover); border-color: var(--c-pink-hover); }
.caller-page .btn-primary:active:not(:disabled) { transform: scale(.98); }
.caller-page .btn-quiet {
  background: var(--c-white); color: var(--c-navy); border: 1.5px solid var(--c-border);
  transition: background .15s, border-color .15s;
}
.caller-page .btn-quiet:hover { background: var(--c-pink-light); border-color: var(--c-pink); }
html.high-contrast .caller-page .btn-quiet { border-color: #000; color: #000; }

/* Start a conversation */
.caller-page #startBtn { padding: .85rem 1.4rem; font-size: 1rem; }
/* While it cannot be pressed (closed, or not agreed yet) it reads as a soft
   pink notice rather than a faded button. */
.caller-page #startBtn:disabled {
  opacity: 1; cursor: not-allowed;
  background: var(--c-pink-light); color: var(--c-navy);
  border: 1px solid var(--c-pink-soft); font-weight: 500;
}
.caller-page #startScreen:has(#closedBand:not([hidden])) #startBtn:disabled::before {
  content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--c-pink);
}
html.high-contrast .caller-page #startBtn:disabled { border: 2px solid #000; }

.caller-page #startHint {
  margin: .9rem 0 0; text-align: center;
  font-size: .875rem; color: var(--c-grey-light); line-height: 1.5;
}
.caller-page #startHint a { color: var(--c-pink-ink); font-weight: 500; }
.caller-page #startHint a:hover { color: var(--c-navy); }

/* ---------------- conversation screen ---------------- */

.caller-page #chatScreen .panel-head { margin: 0 0 .35rem; gap: .8rem; }
.caller-page #chatHeading { font-size: 1.4rem; font-weight: 600; color: var(--c-navy); letter-spacing: -0.01em; margin: 0; }
.caller-page #chatSubheading { font-size: .95rem; color: var(--c-grey-text); margin: 0 0 1.2rem; }

/* Status pill: Waiting / Connected / Ended */
.caller-page #chatStatus {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .875rem; font-weight: 600; line-height: 1.3;
  padding: .32rem .85rem; border-radius: 999px;
  background: var(--c-off-white); color: var(--c-grey-text); border: 1px solid var(--c-border);
}
.caller-page #chatStatus::before {
  content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c-offline);
}
.caller-page #chatStatus.badge-waiting { background: var(--c-pink-light); color: var(--c-navy); border-color: var(--c-pink-soft); }
.caller-page #chatStatus.badge-waiting::before { background: var(--c-pink); }
.caller-page #chatStatus.badge-active { background: var(--c-navy); color: var(--c-white); border-color: var(--c-navy); }
.caller-page #chatStatus.badge-active::before { background: var(--c-pink); }
@media (prefers-reduced-motion: no-preference) {
  .caller-page #chatStatus.badge-waiting::before,
  .caller-page #chatStatus.badge-active::before { animation: caller-pulse 2s infinite; }
}

/* Place in the queue */
.caller-page .queue-standing {
  background: var(--c-pink-light); border: 1px solid var(--c-pink-soft);
  border-radius: 16px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; text-align: center;
}
.caller-page .queue-place { font-size: 1.1rem; font-weight: 700; color: var(--c-navy); margin-bottom: .2rem; }
.caller-page .queue-explain { font-size: .95rem; color: var(--c-grey-text); line-height: 1.5; }
html.high-contrast .caller-page .queue-standing { border: 2px solid #000; }

/* Book an appointment instead of waiting - shown only while she is in the queue */
.caller-page .booking-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem;
  background: var(--c-white); border: 1px solid var(--c-border); border-left: 4px solid var(--c-navy);
  border-radius: 16px; padding: 1rem 1.2rem; margin: 0 0 1.2rem;
}
.caller-page .booking-notice[hidden] { display: none; }
.caller-page .booking-notice-text {
  flex: 1 1 260px; margin: 0; font-size: .95rem; line-height: 1.55; color: var(--c-navy);
}
.caller-page .booking-notice .booking-notice-btn {
  flex: none; padding: .6rem 1.3rem; text-decoration: none; white-space: nowrap;
}
.caller-page .booking-notice .booking-notice-btn:hover { color: var(--c-white); }
@media (max-width: 520px) {
  .caller-page .booking-notice .booking-notice-btn { width: 100%; }
}
html.high-contrast .caller-page .booking-notice { border: 2px solid #000; border-left-width: 4px; }

/* This conversation has ended */
.caller-page .ended-band {
  background: var(--c-white);
  border: 2px solid var(--c-navy); border-radius: 20px;
  padding: 1.5rem 1.6rem 1.3rem; margin: 0 0 1.2rem; text-align: center;
}
.caller-page .ended-band > strong { font-size: 1.2rem; font-weight: 600; color: var(--c-navy); margin-bottom: .4rem; }
.caller-page .ended-band > p { font-size: .95rem; color: var(--c-grey-text); line-height: 1.55; margin: 0 0 1.1rem; }
.caller-page .ended-band > .hint { font-size: .875rem; color: var(--c-grey-light); margin: .8rem 0 0; }
.caller-page #endCallBtn { padding: .8rem 1.4rem; font-size: 1rem; margin-top: .4rem; }

.caller-page .rating-card {
  border: 1.5px solid var(--c-pink-soft); border-radius: 18px;
  padding: 1.1rem .5rem 1rem; margin: 0 0 1rem; background: var(--c-white);
}
.caller-page .rating-question { color: var(--c-navy); font-size: 1rem; margin-bottom: .6rem; }
.caller-page .rating-option label { color: var(--c-navy); font-size: .875rem; border-radius: 12px; }
.caller-page .rating-star polygon { stroke: var(--c-pink); }
.caller-page .rating-option.is-on .rating-star polygon { fill: var(--c-pink); }
.caller-page .rating-option label:hover .rating-star polygon { stroke: var(--c-pink-hover); }
.caller-page .rating-option input:focus-visible + label { outline: 3px solid var(--c-pink); outline-offset: 2px; }
.caller-page .rating-actions { margin-top: .9rem; }
.caller-page #ratingSend { padding: .6rem 1.3rem; }
.caller-page .rating-later { color: var(--c-navy); font-size: .95rem; text-underline-offset: 2px; }
.caller-page .rating-later:hover { color: var(--c-pink-ink); }
.caller-page .ended-band .rating-thanks {
  display: inline-block; margin: 0 0 1rem; padding: .55rem 1.1rem;
  background: var(--c-pink-light); border: 1px solid var(--c-pink-soft); border-radius: 999px;
  color: var(--c-navy); font-weight: 600; font-size: .95rem;
}
.caller-page .ended-band .rating-thanks[hidden] { display: none; }

.caller-page .survey-box {
  background: var(--c-pink-light); border: 1px solid var(--c-pink-soft);
  border-radius: 18px; padding: 1.1rem 1.2rem; margin: 0 0 1rem;
}
.caller-page .survey-box p { color: var(--c-navy); font-size: .95rem; line-height: 1.55; margin: 0 0 .9rem; }
.caller-page .survey-box .btn-accent {
  background: var(--c-navy); color: var(--c-white); border: 1px solid var(--c-navy);
  padding: .6rem 1.3rem; text-decoration: none; transition: background .15s;
}
.caller-page .survey-box .btn-accent:hover { background: var(--c-navy-light); color: var(--c-white); }
html.high-contrast .caller-page .survey-box,
html.high-contrast .caller-page .rating-card { border: 2px solid #000; }

/* The conversation itself */
.caller-page .caller-thread {
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: 20px;
  padding: 1.1rem 1rem .6rem;
  scrollbar-width: thin; scrollbar-color: var(--c-border) transparent;
}
.caller-page .caller-thread::-webkit-scrollbar { width: 8px; }
.caller-page .caller-thread::-webkit-scrollbar-track { background: transparent; }
.caller-page .caller-thread::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 10px; }
.caller-page .caller-thread::-webkit-scrollbar-thumb:hover { background: var(--c-pink-soft); }
html.high-contrast .caller-page .caller-thread { border-width: 2px; }

/* Each bubble is as wide as its words, up to 85% of the conversation. */
.caller-page .bubble { width: fit-content; max-width: 85%; margin-bottom: .85rem; }
.caller-page .bubble .bubble-body {
  padding: .7rem 1rem; border-radius: 18px;
  font-size: .95rem; line-height: 1.5;
}
.caller-page .bubble .bubble-meta { font-size: .875rem; color: var(--c-grey-light); margin-top: .25rem; padding: 0 .3rem; }

/* From the responder: soft white bubble, Lula badge beside it */
.caller-page .bubble-caller {
  display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); column-gap: .55rem;
}
.caller-page .bubble-caller::before {
  content: ""; grid-column: 1; grid-row: 1; align-self: end;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--c-white) url("/assets/lula-mark.svg") center / 100% 100% no-repeat;
  box-shadow: 0 0 0 2px var(--c-pink);
}
.caller-page .bubble-caller .bubble-body,
.caller-page .bubble-caller .bubble-meta { grid-column: 2; }
.caller-page .bubble-caller .bubble-body {
  background: var(--c-off-white); color: var(--c-navy);
  border: 1px solid var(--c-border); border-bottom-left-radius: 6px;
}
html.high-contrast .caller-page .bubble-caller .bubble-body { border: 2px solid #000; }

/* From her: navy bubble on the right */
.caller-page .bubble-mine .bubble-body {
  background: var(--c-navy); color: var(--c-white);
  border: 1px solid var(--c-navy); border-bottom-right-radius: 6px;
}

/* Notes from the helpline itself */
.caller-page .bubble-system { width: auto; max-width: 100%; text-align: center; }
.caller-page .bubble-system .bubble-body {
  display: inline-block; max-width: 100%;
  background: var(--c-pink-light); color: var(--c-navy);
  border: 1px solid var(--c-pink-soft); border-radius: 14px;
  padding: .5rem 1rem; font-size: .875rem;
}

/* Writing a message */
.caller-page .caller-composer { margin-top: .9rem; }
.caller-page .typing-indicator { color: var(--c-pink-ink); font-size: .9rem; font-style: italic; margin: 0 0 .5rem .4rem; }

.caller-page .composer-box {
  display: flex; align-items: flex-end; gap: .6rem;
  background: var(--c-white);
  border: 1.5px solid var(--c-border); border-radius: 22px;
  padding: .45rem .45rem .45rem 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.caller-page .composer-box:focus-within { border-color: var(--c-pink); box-shadow: 0 0 0 3px var(--c-ring); }
html.high-contrast .caller-page .composer-box { border: 2px solid #000; }
.caller-page .composer-box textarea {
  flex: 1 1 auto; min-width: 0;
  border: 0; border-radius: 0; background: transparent;
  padding: .45rem 0; min-height: 3.3rem;
  font-size: 1rem; line-height: 1.45; color: var(--c-navy);
}
.caller-page .composer-box textarea:focus,
.caller-page .composer-box textarea:focus-visible { outline: none; }
.caller-page .composer-box textarea::placeholder { color: var(--c-grey-light); }
.caller-page .composer-box textarea:disabled { background: transparent; color: var(--c-grey-light); }

.caller-page #sendBtn {
  flex: none; align-self: flex-end;
  min-height: 2.6rem; padding: 0 1.05rem 0 1.15rem; gap: .45rem; font-size: .95rem;
}
.caller-page #sendBtn .btn-icon { width: 1.05rem; height: 1.05rem; }
.caller-page #sendBtn:disabled { opacity: 1; background: #d9c9cf; border-color: #d9c9cf; }
.caller-page #sendBtn:focus-visible { outline: 3px solid var(--c-navy); outline-offset: 2px; }

.caller-page .caller-actions { align-items: center; gap: .6rem; margin-top: .75rem; }
.caller-page .caller-actions .spacer { flex: 1 1 auto; }
.caller-page #endBtn { padding: .55rem 1.1rem; font-size: .95rem; }
.caller-page .connection-state { margin: 0; font-size: .875rem; color: var(--c-grey-light); }

.caller-page .sound-setting {
  margin-top: .9rem; padding: .8rem 1rem;
  background: var(--c-off-white); border: 1px solid var(--c-border); border-radius: 16px;
}
.caller-page .sound-setting .check { gap: .65rem; font-size: .95rem; color: var(--c-navy); font-weight: 500; }
.caller-page .sound-setting .hint { margin: .45rem 0 0; font-size: .875rem; color: var(--c-grey-light); line-height: 1.5; }

/* On/off switches: the sound setting and the accessibility options. Still
   ordinary tick boxes underneath; only their look changes. */
.caller-page #callerSound,
.caller-page .a11y-options .check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 2.75rem; height: 1.6rem; margin: 0;
  border: 1px solid var(--c-border); border-radius: 999px;
  background-color: #c9c3c8;
  background-image: radial-gradient(circle, #ffffff .52rem, rgba(255, 255, 255, 0) calc(.52rem + 1px));
  background-size: 1.55rem 1.55rem; background-repeat: no-repeat;
  background-position: left center;
  cursor: pointer; transition: background-color .15s, background-position .15s;
}
.caller-page #callerSound:checked,
.caller-page .a11y-options .check input[type="checkbox"]:checked {
  background-color: var(--c-pink); border-color: var(--c-pink); background-position: right center;
}
.caller-page #callerSound:focus-visible,
.caller-page .a11y-options .check input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--c-navy); outline-offset: 2px;
}
html.high-contrast .caller-page #callerSound,
html.high-contrast .caller-page .a11y-options .check input[type="checkbox"] { border: 2px solid #000; }

/* ---------------- footer, inside the card ---------------- */

.caller-page .site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1.2rem;
  margin: 0; padding: .95rem 1.8rem;
  background: var(--c-off-white); border-top: 1px solid var(--c-border);
  font-size: .875rem; color: var(--c-grey-light);
}
.caller-page .site-footer .footer-links { gap: 1.2rem; margin: 0; }
.caller-page .site-footer .footer-note { order: -1; }
.caller-page .site-footer a { color: var(--c-navy); font-weight: 500; }
.caller-page .site-footer a:hover { color: var(--c-pink-ink); }

/* ---------------- accessibility button and options ---------------- */

.caller-page .a11y-toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--c-navy); color: var(--c-white);
  border: 3px solid var(--c-white); border-radius: 999px;
  padding: .55rem 1.1rem .55rem .8rem;
  font-size: .875rem; font-weight: 700;
  box-shadow: 0 4px 16px rgba(14, 42, 71, .35);
  transition: background .15s, transform .15s;
}
.caller-page .a11y-toggle::before {
  content: ""; width: 1.35rem; height: 1.35rem; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.caller-page .a11y-toggle:hover { background: var(--c-navy-light); transform: scale(1.03); }
.caller-page .a11y-toggle:focus-visible { outline: 3px solid var(--c-pink); outline-offset: 3px; }

.caller-page .a11y-options {
  bottom: 3.6rem; width: 300px; max-width: calc(100vw - 28px);
  max-height: calc(100vh - 6rem); overflow-y: auto;
  background: var(--c-white);
  border: 2px solid var(--c-navy); border-radius: 22px;
  padding: 1.2rem 1.2rem 1rem;
  box-shadow: 0 15px 40px rgba(14, 42, 71, .25);
}
.caller-page .a11y-label {
  display: block; font-size: .875rem; font-weight: 700; color: var(--c-navy);
  margin: .9rem 0 .45rem;
}
.caller-page p.a11y-label { padding-top: .85rem; border-top: 1px solid var(--c-border); }
.caller-page p.a11y-label:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.caller-page .a11y-options .a11y-row { gap: .4rem; }
.caller-page .a11y-btn {
  font-size: .875rem; font-weight: 600; padding: .35rem .85rem;
  border: 1.5px solid var(--c-navy); border-radius: 999px;
  background: var(--c-white); color: var(--c-navy);
  transition: background .15s;
}
.caller-page .a11y-btn:hover { background: var(--c-pink-light); }
.caller-page .a11y-btn[aria-pressed="true"] { background: var(--c-pink); border-color: var(--c-pink); color: var(--c-white); }
.caller-page .a11y-options .check {
  justify-content: space-between; flex-direction: row-reverse; gap: .8rem;
  font-size: .95rem; color: var(--c-navy); font-weight: 500;
}
.caller-page .a11y-options select { font-size: .9rem; padding: .5rem .7rem; }
.caller-page .a11y-test-voice {
  display: block; width: 100%; margin-top: .8rem; padding: .55rem;
  border-radius: 12px; font-weight: 600;
}
.caller-page .a11y-note { font-size: .875rem; color: var(--c-grey-light); line-height: 1.45; }
.caller-page .a11y-options > .a11y-note:last-child {
  margin-top: .9rem; padding: .55rem .75rem;
  background: var(--c-pink-light); border-radius: 10px; color: var(--c-navy);
}

/* ---------------- phones ---------------- */

@media (max-width: 520px) {
  body.caller-page { padding: .75rem .6rem 5rem; }
  .caller-card { border-radius: 22px; }
  .caller-page .caller-header { padding: .9rem 1rem .85rem; gap: .6rem; }
  .caller-page .caller-header .brand { gap: .55rem; }
  .caller-page .caller-header .brand img { height: 2.2rem; width: 2.2rem; }
  .caller-page .caller-header .brand-name { font-size: 1.2rem; }
  .caller-page .caller-header .brand-sub { font-size: .875rem; }
  .caller-page .exit-btn { padding: .4rem .75rem; }
  .caller-page .caller-shell { padding: 1.2rem 1.1rem 1rem; }
  .caller-page .caller-hero h1, .caller-page #chatHeading { font-size: 1.25rem; }
  .caller-page .location-section { padding: 1.1rem 1rem 1rem; }
  .caller-page .choice-grid { gap: .6rem; }
  .caller-page .choice { padding: .75rem 2.2rem .75rem .8rem; }
  .caller-page .choice::after { right: .75rem; }
  .caller-page .consent-box { padding: 1.2rem 1.1rem; }
  .caller-page .ended-band { padding: 1.2rem 1rem 1.1rem; }
  .caller-page .caller-thread { padding: .9rem .7rem .5rem; }
  .caller-page .bubble { max-width: 94%; }
  .caller-page .composer-box { padding-left: .85rem; }
  .caller-page .site-footer { flex-direction: column; align-items: flex-start; padding: .9rem 1.1rem; }
  /* Accessibility options on a phone: a compact panel that scrolls inside
     itself, so it never covers the whole page. Sizes in px and vh so a
     phone's own larger-text setting cannot blow it up to full screen. */
  .caller-page .a11y { left: 10px; bottom: 10px; }
  .caller-page .a11y-toggle { padding: .4rem .85rem .4rem .6rem; border-width: 2px; gap: .35rem; }
  .caller-page .a11y-toggle::before { width: 1.1rem; height: 1.1rem; }
  .caller-page .a11y-options {
    bottom: calc(100% + 8px); width: min(290px, calc(100vw - 20px));
    max-height: 50vh; overflow-y: auto; overscroll-behavior: contain;
    padding: .7rem .8rem .65rem; border-radius: 16px; border-width: 1.5px;
  }
  .caller-page .a11y-label { margin: .5rem 0 .3rem; }
  .caller-page p.a11y-label { padding-top: .5rem; }
  .caller-page .a11y-options .a11y-row { gap: .3rem; }
  .caller-page .a11y-btn { padding: .2rem .65rem; }
  .caller-page .a11y-options .check { font-size: .875rem; gap: .6rem; }
  .caller-page .a11y-options .check input[type="checkbox"] {
    width: 2.3rem; height: 1.3rem; background-size: 1.25rem 1.25rem;
    background-image: radial-gradient(circle, #ffffff .42rem, rgba(255, 255, 255, 0) calc(.42rem + 1px));
  }
  .caller-page .a11y-options select { font-size: .875rem; padding: .3rem .55rem; }
  .caller-page .a11y-test-voice { margin-top: .5rem; padding: .35rem; }
  .caller-page .a11y-note { line-height: 1.35; margin-top: .3rem; }
  .caller-page .a11y-options > .a11y-note:last-child { margin-top: .5rem; padding: .35rem .55rem; }
}

/* ==========================================================
   Life Plan and Safety Plan (plan-caller.js)
   An offer appears as a card in the chat. A shared plan opens in a panel
   over the chat, so she never loses her place. Text is never smaller than
   14px. Status is always written in words, never shown by colour alone.
   ========================================================== */
.caller-page {
  --plan-blue: #1f5b8f; --plan-blue-light: #e0edf8; --plan-blue-line: #a8c9e6;
  --plan-green: #2e7d4f; --plan-green-light: #e3f4ea; --plan-green-line: #a9d6bc;
  --plan-amber-ink: #7a5800; --plan-amber-light: #fff4d6; --plan-amber-line: #e8cf8c;
}

/* ----- status pills ----- */
.caller-page .plan-pill {
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
  font-size: .875rem; font-weight: 700; padding: .15rem .65rem; border-radius: 12px;
  background: var(--plan-blue-light); color: var(--plan-blue); border: 1px solid var(--plan-blue-line);
}
.caller-page .plan-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.caller-page .plan-pill-approved { background: var(--plan-green-light); color: var(--plan-green); border-color: var(--plan-green-line); }
.caller-page .plan-pill-changes, .caller-page .plan-pill-discuss, .caller-page .plan-pill-rejected { background: #f3f1f2; color: var(--c-grey-text); border-color: var(--c-border); }

/* ----- the offer, in the chat ----- */
.caller-page .plan-invite {
  width: 100%; max-width: 100%; margin: .4rem 0 1rem;
  display: flex; flex-direction: column; gap: .6rem;
  border: 1.5px solid var(--c-pink); border-radius: 16px; padding: .95rem 1.05rem;
  background: linear-gradient(180deg, #fff8fa 0%, var(--c-pink-light) 100%);
  box-shadow: 0 3px 10px rgba(232, 85, 122, .12);
}
.caller-page .plan-invite-life {
  border-color: var(--plan-blue);
  background: linear-gradient(180deg, #f6fafc 0%, #e3eef6 100%);
}
.caller-page .plan-invite-eyebrow {
  display: flex; align-items: center; gap: .4rem; margin: 0;
  font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c-pink-ink);
}
.caller-page .plan-invite-life .plan-invite-eyebrow { color: var(--plan-blue); }
.caller-page .plan-invite-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.caller-page .plan-invite-text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--c-navy); }
.caller-page .plan-invite-title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--c-navy); }
.caller-page .plan-invite-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.caller-page .plan-invite-actions[hidden] { display: none; }
.caller-page .plan-invite-yes, .caller-page .plan-invite-no {
  font: inherit; font-size: .9375rem; font-weight: 700; border-radius: 20px; padding: .5rem 1.05rem; cursor: pointer;
}
.caller-page .plan-invite-yes { background: var(--c-pink); color: #fff; border: 1.5px solid var(--c-pink); }
.caller-page .plan-invite-yes:hover { background: var(--c-pink-hover); border-color: var(--c-pink-hover); }
.caller-page .plan-invite-life .plan-invite-yes { background: var(--plan-blue); border-color: var(--plan-blue); }
.caller-page .plan-invite-life .plan-invite-yes:hover { background: #174a76; border-color: #174a76; }
.caller-page .plan-invite-no { background: #fff; color: var(--c-grey-text); border: 1.5px solid var(--c-border); font-weight: 600; }
.caller-page .plan-invite-no:hover { border-color: var(--c-pink); color: var(--c-navy); }
.caller-page .plan-invite-yes:disabled, .caller-page .plan-invite-no:disabled { opacity: .6; cursor: progress; }
.caller-page .plan-invite-outcome { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--c-navy); }
.caller-page .plan-invite-note {
  margin: 0; padding-top: .5rem; border-top: 1px dashed rgba(232, 85, 122, .3);
  font-size: .875rem; line-height: 1.45; color: var(--c-grey-text);
}

/* ----- a shared plan, in the chat ----- */
.caller-page .plan-shared-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  margin: .4rem 0 1rem; padding: .8rem 1rem; border-radius: 14px;
  background: var(--plan-blue-light); border: 1px solid var(--plan-blue-line); color: var(--c-navy);
}
.caller-page .plan-shared-card strong { color: var(--plan-blue); font-size: .9375rem; }
.caller-page .plan-shared-text { font-size: .9375rem; line-height: 1.5; }
.caller-page .plan-open-btn {
  margin-top: .25rem; font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer;
  background: #fff; color: var(--plan-blue); border: 1.5px solid var(--plan-blue); border-radius: 18px; padding: .4rem .95rem;
}
.caller-page .plan-open-btn:hover { background: var(--plan-blue); color: #fff; }

/* ----- the row of shared plans, above the message box ----- */
.caller-page .caller-plans {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem;
  margin: .25rem 0 .75rem; padding: .6rem .8rem;
  background: var(--c-off-white); border: 1px solid var(--c-border); border-radius: 16px;
}
.caller-page .caller-plans[hidden] { display: none; }
.caller-page .caller-plans-label { font-size: .875rem; font-weight: 700; color: var(--c-navy); }
.caller-page .caller-plans-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.caller-page .caller-plan-btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font: inherit; font-size: .9375rem; font-weight: 600; color: var(--c-navy);
  background: #fff; border: 1.5px solid var(--c-navy); border-radius: 20px; padding: .35rem .5rem .35rem .9rem;
}
.caller-page .caller-plan-btn:hover { background: var(--c-pink-light); }

/* ----- the review panel ----- */
body.plan-open { overflow: hidden; }
.caller-page .plan-overlay {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: stretch; justify-content: center; padding: 1rem;
  background: rgba(14, 42, 71, .4);
}
.caller-page .plan-overlay[hidden] { display: none; }
.caller-page .plan-panel {
  width: 100%; max-width: 680px; max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 22px; border: 1px solid var(--c-border);
  box-shadow: 0 25px 50px rgba(14, 42, 71, .3);
}
.caller-page .plan-panel-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; flex: none;
  background: var(--c-navy); color: #fff; padding: .9rem 1.1rem; border-bottom: 3px solid var(--c-pink);
}
.caller-page .plan-panel-heading { flex: 1 1 auto; min-width: 0; }
.caller-page .plan-panel-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; color: #fff; }
.caller-page .plan-panel-head h2:focus { outline: none; }
.caller-page .plan-panel-head h2:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 4px; }
.caller-page .plan-panel-sub { margin: .1rem 0 0; font-size: .875rem; color: rgba(255, 255, 255, .9); }
.caller-page .plan-panel-head .plan-pill { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.caller-page .plan-leave { flex: none; }
.caller-page .plan-close {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  background: none; color: #fff; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 20px;
  font: inherit; font-size: .9375rem; font-weight: 700; line-height: 1.2; padding: .3rem .85rem;
}
.caller-page .plan-close .close-x { font-size: 1.3rem; line-height: 1; font-weight: 400; }
.caller-page .plan-close:hover { background: rgba(255, 255, 255, .15); }
.caller-page .plan-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Says plainly what each way out does, in a plan or an exercise. */
.caller-page .panel-exit-hint {
  flex: none; margin: 0; padding: .45rem 1.1rem; font-size: .875rem; line-height: 1.4;
  color: var(--c-navy); background: var(--c-pink-light); border-bottom: 1px solid var(--c-pink-soft);
}

.caller-page .plan-panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1.1rem; }
.caller-page .plan-ready-box {
  margin-bottom: .8rem; padding: .7rem .9rem; border-radius: 12px;
  background: var(--plan-blue-light); border: 1px solid var(--plan-blue-line);
  font-size: .9375rem; line-height: 1.5; color: var(--c-navy);
}
.caller-page .plan-ready-box strong { display: block; color: var(--plan-blue); margin-bottom: .15rem; }
.caller-page .plan-ready-box[hidden] { display: none; }
.caller-page .plan-approved-note {
  margin: 0 0 .8rem; padding: .6rem .85rem; border-radius: 12px; font-size: .9375rem;
  background: var(--plan-green-light); border: 1px solid var(--plan-green-line); color: #1f5a39;
}
.caller-page .plan-sections { display: flex; flex-direction: column; gap: .45rem; }
.caller-page .plan-section {
  background: var(--c-off-white); border: 1px solid var(--c-border); border-radius: 10px; padding: .6rem .8rem;
}
.caller-page .plan-section h3 {
  margin: 0 0 .15rem; font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c-pink-ink);
}
.caller-page .plan-area-heading {
  margin: .7rem 0 .1rem; padding-bottom: .2rem; border-bottom: 2px solid var(--c-pink); font-size: 1rem; font-weight: 700; color: var(--c-navy);
}
.caller-page .plan-area-heading:first-child { margin-top: 0; }
.caller-page .plan-section p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--c-navy); white-space: pre-wrap; overflow-wrap: anywhere; }
.caller-page .plan-dv-note {
  margin-top: .8rem; padding: .75rem .9rem; border-left: 4px solid var(--c-pink); border-radius: 0 10px 10px 0;
  background: var(--c-pink-light); color: var(--c-navy); font-size: .9375rem; line-height: 1.5;
}
.caller-page .plan-dv-note strong { display: block; color: var(--c-pink-ink); margin-bottom: .2rem; }
.caller-page .plan-storage-warning, .caller-page .plan-warn {
  margin-top: .7rem; padding: .7rem .9rem; border-left: 4px solid #b8860b; border-radius: 0 10px 10px 0;
  background: var(--plan-amber-light); color: #5a4200; font-size: .9375rem; line-height: 1.5;
}
.caller-page .plan-dv-note[hidden], .caller-page .plan-storage-warning[hidden], .caller-page .plan-warn[hidden],
.caller-page .plan-changes[hidden], .caller-page .plan-copy-fallback[hidden] { display: none; }
.caller-page .plan-warn-text { margin: 0 0 .6rem; }
.caller-page .plan-changes, .caller-page .plan-copy-fallback {
  margin-top: .8rem; padding: .8rem .9rem; border: 1.5px solid var(--c-border); border-radius: 14px; background: #fff;
}
.caller-page .plan-changes label, .caller-page .plan-copy-fallback label { display: block; font-weight: 700; color: var(--c-navy); }
.caller-page .plan-changes .hint, .caller-page .plan-copy-fallback .hint { margin: .2rem 0 .5rem; font-size: .875rem; }
.caller-page .plan-changes textarea, .caller-page .plan-copy-fallback textarea {
  width: 100%; border: 1.5px solid var(--c-border); border-radius: 12px; padding: .6rem .75rem;
  font: inherit; font-size: 1rem; color: var(--c-navy); resize: vertical;
}
.caller-page .plan-changes textarea:focus, .caller-page .plan-copy-fallback textarea:focus {
  border-color: var(--c-pink); box-shadow: 0 0 0 3px var(--c-ring); outline: none;
}
.caller-page .plan-inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

.caller-page .plan-panel-foot { flex: none; padding: .8rem 1.1rem 1rem; border-top: 1px solid var(--c-border); background: #fff; }
.caller-page .plan-message { margin: 0 0 .5rem; font-size: .9375rem; font-weight: 600; color: var(--c-navy); }
.caller-page .plan-message:empty { display: none; }
.caller-page .plan-actions, .caller-page .plan-export { display: flex; flex-wrap: wrap; gap: .5rem; }
.caller-page .plan-actions[hidden] { display: none; }
.caller-page .plan-export { margin-top: .5rem; }
.caller-page .plan-approve, .caller-page .plan-request, .caller-page .plan-discuss, .caller-page .plan-export-btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font: inherit; font-size: .9375rem; font-weight: 700; border-radius: 20px; padding: .45rem 1rem;
}
.caller-page .plan-approve { background: var(--plan-green); color: #fff; border: 1.5px solid var(--plan-green); }
.caller-page .plan-approve:hover:not(:disabled) { background: #256641; }
.caller-page .plan-approve:disabled { background: var(--plan-green-light); color: var(--plan-green); cursor: default; }
.caller-page .plan-request { background: #fff; color: var(--plan-amber-ink); border: 1.5px solid #b8860b; }
.caller-page .plan-request:hover { background: var(--plan-amber-light); }
.caller-page .plan-discuss { background: #fff; color: var(--c-navy); border: 1.5px solid var(--c-navy); }
.caller-page .plan-discuss:hover { background: var(--c-pink-light); }
.caller-page .plan-export-btn { background: #fff; color: var(--c-navy); border: 1.5px solid var(--c-border); font-weight: 600; }
.caller-page .plan-export-btn:hover { border-color: var(--c-pink); background: var(--c-pink-light); }
.caller-page .plan-export-btn[hidden] { display: none; }
.caller-page .plan-actions button:disabled:not(.plan-approve), .caller-page .plan-export-btn:disabled { opacity: .6; cursor: progress; }
.caller-page .plan-foot-note { margin: .5rem 0 0; font-size: .875rem; color: var(--c-grey-light); }
.caller-page .plan-panel .exit-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

html.high-contrast .caller-page .plan-invite, html.high-contrast .caller-page .plan-section,
html.high-contrast .caller-page .plan-panel, html.high-contrast .caller-page .caller-plans { border: 2px solid #000; }

@media (max-width: 640px) {
  .caller-page .plan-overlay { padding: 0; }
  .caller-page .plan-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .caller-page .plan-panel-head { padding: .75rem .9rem; }
  .caller-page .plan-panel-body { padding: .9rem; }
  .caller-page .plan-panel-foot { padding: .7rem .9rem .9rem; }
  .caller-page .plan-invite { padding: .85rem .9rem; }
  .caller-page .panel-exit-hint { padding: .4rem .9rem; }
}

/* ----- printing a plan: only the plan, nothing of the chat ----- */
.plan-print { display: none; }
@media print {
  body.printing-plan > *:not(#planPrint) { display: none !important; }
  body.printing-plan { background: #fff !important; }
  body.printing-plan #planPrint {
    display: block !important; color: #000; font-size: 12pt; line-height: 1.5;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  }
  #planPrint h1 { font-size: 20pt; margin: 0 0 4pt; color: #0e2a47; }
  #planPrint .plan-print-meta { margin: 0 0 14pt; font-size: 10.5pt; color: #444; }
  #planPrint .plan-print-area { font-size: 14pt; margin: 14pt 0 6pt; color: #0e2a47; text-transform: none; letter-spacing: 0; border-bottom: 1.5pt solid #e8557a; }
  #planPrint .plan-print-section { margin: 0 0 10pt; break-inside: avoid; page-break-inside: avoid; }
  #planPrint h2 {
    font-size: 12pt; margin: 0 0 2pt; color: #0e2a47; text-transform: uppercase; letter-spacing: .04em;
    break-after: avoid; page-break-after: avoid;
  }
  #planPrint p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; orphans: 3; widows: 3; }
  #planPrint .plan-print-note { margin-top: 14pt; padding: 8pt 10pt; border-left: 3pt solid #c2305c; break-inside: avoid; }
  #planPrint .plan-print-warning { margin-top: 10pt; padding: 8pt 10pt; border: 1pt solid #999; font-size: 10.5pt; break-inside: avoid; }
}

/* ==========================================================
   Grounding Tool (grounding-caller.js)
   An offer appears as a card in the chat. An exercise opens in a panel over
   the chat; on a phone it fills the screen, with Close and Leave this page
   always at the top and the buttons always at the bottom. Calm green for the
   grounding exercises, warm terracotta for One true thing about myself, and
   a soft neutral for Just sit with me. Every state is also written in words,
   never shown by colour alone. Text is never smaller than 14px.
   ========================================================== */
.caller-page {
  --g-calm: #4f6e60;          /* buttons and words: 5.6:1 with white */
  --g-calm-mid: #6b8e7f;      /* borders: 3.6:1 against white */
  --g-calm-light: #eef4f0;
  --g-calm-soft: #d6e4dc;
  --g-warm: #9c5a3c;          /* buttons and words: 5.3:1 with white */
  --g-warm-mid: #b07055;
  --g-warm-light: #f7ede7;
  --g-warm-soft: #e8d4c7;
  --g-sit: #6f6253;
  --g-sit-mid: #8a7d6d;
  --g-sit-light: #f6f3ee;
  --g-sit-soft: #e4ddd2;
}
html.high-contrast .caller-page {
  --g-calm: #2d4a3d; --g-calm-mid: #2d4a3d; --g-warm: #6f3a22; --g-warm-mid: #6f3a22;
  --g-sit: #3f352a; --g-sit-mid: #3f352a;
}

/* ----- the offer, in the chat ----- */
.caller-page .grounding-offer {
  --tone: var(--g-calm); --tone-mid: var(--g-calm-mid); --tone-light: var(--g-calm-light); --tone-soft: var(--g-calm-soft);
  width: 100%; margin: .4rem 0 1rem; display: flex; flex-direction: column; gap: .55rem;
  border: 1.5px solid var(--tone-mid); border-radius: 16px; padding: .95rem 1.05rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--tone-light) 100%);
  box-shadow: 0 3px 10px rgba(14, 42, 71, .08);
}
.caller-page .grounding-offer.theme-warm {
  --tone: var(--g-warm); --tone-mid: var(--g-warm-mid); --tone-light: var(--g-warm-light); --tone-soft: var(--g-warm-soft);
}
.caller-page .grounding-offer.theme-sit {
  --tone: var(--g-sit); --tone-mid: var(--g-sit-mid); --tone-light: var(--g-sit-light); --tone-soft: var(--g-sit-soft);
}
.caller-page .grounding-offer[hidden] { display: none; }
.caller-page .grounding-offer:focus { outline: none; }
.caller-page .grounding-offer:focus-visible { outline: 3px solid var(--tone); outline-offset: 3px; }
.caller-page .grounding-offer-eyebrow {
  display: flex; align-items: center; gap: .4rem; margin: 0;
  font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tone);
}
.caller-page .grounding-offer-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.caller-page .grounding-offer-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--c-navy); }
.caller-page .grounding-offer-text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--c-navy); }
.caller-page .grounding-offer-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.caller-page .grounding-offer-actions[hidden], .caller-page .grounding-offer-outcome[hidden],
.caller-page .grounding-reopen[hidden] { display: none; }
.caller-page .grounding-yes, .caller-page .grounding-no, .caller-page .grounding-reopen {
  font: inherit; font-size: .9375rem; font-weight: 700; border-radius: 20px; padding: .5rem 1.05rem; cursor: pointer;
}
.caller-page .grounding-yes { background: var(--tone); color: #fff; border: 1.5px solid var(--tone); }
.caller-page .grounding-yes:hover { filter: brightness(.92); }
.caller-page .grounding-no { background: #fff; color: var(--c-grey-text); border: 1.5px solid var(--c-border); font-weight: 600; }
.caller-page .grounding-no:hover { border-color: var(--tone-mid); color: var(--c-navy); }
.caller-page .grounding-yes:disabled, .caller-page .grounding-no:disabled { opacity: .6; cursor: progress; }
.caller-page .grounding-reopen { align-self: flex-start; background: #fff; color: var(--tone); border: 1.5px solid var(--tone-mid); }
.caller-page .grounding-reopen:hover { background: var(--tone-light); }
.caller-page .grounding-offer-outcome { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--c-navy); }
.caller-page .grounding-offer-note {
  margin: 0; padding-top: .5rem; border-top: 1px dashed var(--tone-soft);
  font-size: .875rem; line-height: 1.45; color: var(--c-grey-text);
}
.caller-page .grounding-declined .bubble-body {
  font-size: .875rem; background: var(--c-off-white); color: var(--c-grey-text); border-color: var(--c-border);
}

/* ----- the exercise panel ----- */
body.grounding-open { overflow: hidden; }
.caller-page .grounding-overlay {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: stretch; justify-content: center; padding: 1rem;
  background: rgba(14, 42, 71, .4);
}
.caller-page .grounding-overlay[hidden] { display: none; }
.caller-page .grounding-panel {
  --tone: var(--g-calm); --tone-mid: var(--g-calm-mid); --tone-light: var(--g-calm-light); --tone-soft: var(--g-calm-soft);
  width: 100%; max-width: 620px; max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 22px; border: 1.5px solid var(--tone-mid);
  box-shadow: 0 25px 50px rgba(14, 42, 71, .3);
}
.caller-page .grounding-panel.theme-warm {
  --tone: var(--g-warm); --tone-mid: var(--g-warm-mid); --tone-light: var(--g-warm-light); --tone-soft: var(--g-warm-soft);
}
.caller-page .grounding-panel.theme-sit {
  --tone: var(--g-sit); --tone-mid: var(--g-sit-mid); --tone-light: var(--g-sit-light); --tone-soft: var(--g-sit-soft);
}
.caller-page .grounding-head {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .6rem;
  padding: .75rem 1rem; background: var(--tone); color: #fff;
}
.caller-page .grounding-eyebrow {
  flex: 1 1 12rem; min-width: 0; margin: 0; font-size: .9375rem; font-weight: 700; line-height: 1.35; color: #fff;
}
.caller-page .grounding-leave { flex: none; }
.caller-page .grounding-panel .exit-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.caller-page .grounding-close {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  background: none; color: #fff; border: 1.5px solid rgba(255, 255, 255, .75); border-radius: 20px;
  font: inherit; font-size: .9375rem; font-weight: 700; line-height: 1.2; padding: .3rem .85rem;
}
.caller-page .grounding-close .close-x { font-size: 1.3rem; line-height: 1; font-weight: 400; }
.caller-page .grounding-close:hover { background: rgba(255, 255, 255, .15); }
.caller-page .grounding-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.caller-page .grounding-panel .panel-exit-hint { background: var(--tone-light); border-bottom-color: var(--tone-soft); }

.caller-page .grounding-progress { flex: none; padding: .7rem 1rem 0; }
.caller-page .grounding-progress[hidden] { display: none; }
.caller-page .grounding-dots { display: flex; justify-content: center; align-items: center; gap: .45rem; }
.caller-page .grounding-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--tone-mid); }
.caller-page .grounding-dot.is-done { background: var(--tone-mid); }
.caller-page .grounding-dot.is-current { width: 12px; height: 12px; background: var(--tone); border-color: var(--tone); }

.caller-page .grounding-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1.2rem 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--tone-light) 100%);
}
.caller-page .grounding-body h2 { margin: 0 0 .6rem; font-size: 1.25rem; font-weight: 700; color: var(--c-navy); line-height: 1.3; }
.caller-page .grounding-body h2:focus { outline: none; }
.caller-page .grounding-body h2:focus-visible { outline: 3px solid var(--tone); outline-offset: 3px; border-radius: 4px; }
.caller-page .grounding-text, .caller-page .grounding-finish-text {
  margin: 0 0 .7rem; font-size: 1.0625rem; line-height: 1.65; color: var(--c-text); max-width: 36rem;
}
.caller-page .grounding-finish-text { color: var(--c-navy); }
.caller-page .grounding-note {
  margin: .2rem 0 .8rem; padding: .65rem .85rem; border-radius: 0 10px 10px 0;
  font-size: .9375rem; line-height: 1.5;
}
.caller-page .grounding-note-warning { background: #fff4d6; border-left: 4px solid #b8860b; color: #4d3800; font-weight: 600; }
.caller-page .grounding-note-gentle { background: #fff; border-left: 4px solid var(--tone-mid); color: var(--c-navy); }

.caller-page .grounding-fields { display: flex; flex-direction: column; gap: .5rem; margin-top: .2rem; }
.caller-page .grounding-helper { margin: 0 0 .1rem; font-size: .875rem; color: var(--c-grey-text); }
.caller-page .grounding-field { display: flex; flex-direction: column; gap: .3rem; }
.caller-page .grounding-field.is-numbered { flex-direction: row; align-items: center; gap: .55rem; }
.caller-page .grounding-num {
  flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tone-soft); color: var(--tone); font-size: .875rem; font-weight: 700;
}
.caller-page .grounding-label { font-size: .9375rem; font-weight: 700; color: var(--c-navy); }
.caller-page .grounding-input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: 1.5px solid var(--tone-mid); border-radius: 12px; padding: .6rem .8rem; background: #fff;
  font: inherit; font-size: 1rem; color: var(--c-navy); resize: vertical;
}
.caller-page .grounding-input::placeholder { color: #767676; }
.caller-page .grounding-input:focus { outline: none; border-color: var(--tone); box-shadow: 0 0 0 3px var(--tone-soft); }
.caller-page .grounding-input:focus-visible { outline: 3px solid var(--tone); outline-offset: 1px; }
.caller-page .grounding-keep { margin: .4rem 0 0; font-size: 1rem; font-style: italic; color: var(--tone); }
.caller-page .grounding-keep[hidden] { display: none; }

.caller-page .grounding-sit-icon {
  width: 64px; height: 64px; margin: .4rem auto 1rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--g-sit-soft);
}
.caller-page .grounding-sit-icon svg { width: 30px; height: 30px; fill: var(--g-sit); }
.caller-page .theme-sit .grounding-body { text-align: center; padding-top: 1.4rem; }
.caller-page .theme-sit .grounding-body h2 { margin-bottom: .8rem; }
.caller-page .theme-sit .grounding-text { margin-left: auto; margin-right: auto; }

.caller-page .grounding-foot { flex: none; padding: .7rem 1rem .9rem; border-top: 1px solid var(--tone-soft); background: #fff; }
.caller-page .grounding-newmsg {
  margin: 0 0 .5rem; padding: .45rem .7rem; border-radius: 10px;
  background: var(--c-pink-light); color: var(--c-navy); font-size: .9375rem;
}
.caller-page .grounding-newmsg[hidden] { display: none; }
.caller-page .grounding-reassure { margin: 0 0 .6rem; font-size: .875rem; line-height: 1.45; color: var(--c-grey-text); }
.caller-page .grounding-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.caller-page .grounding-btn {
  font: inherit; font-size: .9375rem; font-weight: 700; border-radius: 20px; padding: .55rem 1.1rem; cursor: pointer;
}
.caller-page .grounding-btn-main { margin-left: auto; background: var(--tone); color: #fff; border: 1.5px solid var(--tone); }
.caller-page .grounding-btn-main:hover { filter: brightness(.92); }
.caller-page .grounding-btn-second { background: #fff; color: var(--tone); border: 1.5px solid var(--tone-mid); }
.caller-page .grounding-btn-second:hover { background: var(--tone-light); }
.caller-page .grounding-btn-quiet { background: #fff; color: var(--c-grey-text); border: 1.5px solid var(--c-border); font-weight: 600; }
.caller-page .grounding-btn-quiet:hover { border-color: var(--tone-mid); color: var(--c-navy); }
.caller-page .grounding-btn:focus-visible { outline: 3px solid var(--tone); outline-offset: 2px; }

/* ---- Interactive parts: the one-box slot of the two sensory-light exercises,
   the breathing circle and the Feet on the floor scene (grounding-render.js). ---- */
.caller-page .grounding-slot {
  display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem .3rem .6rem;
  background: #fff; border: 1.5px solid var(--tone-mid); border-radius: 12px;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.caller-page .grounding-slot .grounding-num { background: #fff; color: var(--tone); border: 1.5px solid var(--tone-mid); transition: background-color .12s, color .12s; }
.caller-page .grounding-slot .grounding-input { border: 0; border-radius: 8px; padding: .35rem .2rem; background: transparent; }
.caller-page .grounding-slot .grounding-input:focus, .caller-page .grounding-slot .grounding-input:focus-visible { outline: none; box-shadow: none; }
.caller-page .grounding-slot:focus-within { outline: 3px solid var(--tone); outline-offset: 2px; }
.caller-page .grounding-slot.is-filled { background: var(--tone-soft); border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.caller-page .grounding-slot.is-filled .grounding-num { background: var(--tone); border-color: var(--tone); color: #fff; }
.caller-page .grounding-slot.is-multiline { align-items: flex-start; }
.caller-page .grounding-slot.is-multiline .grounding-num { margin-top: .35rem; }

.caller-page .grounding-breathe, .caller-page .grounding-ground, .caller-page .grounding-hold {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; overflow: hidden;
  margin-top: .4rem; padding: .9rem .75rem 1rem; text-align: center;
  background: linear-gradient(180deg, #f7faf8 0%, var(--tone-light) 100%);
  border: 1.5px solid var(--tone-soft); border-radius: 18px;
}
.caller-page .grounding-circle-wrap { position: relative; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.caller-page .grounding-circle-ring { position: absolute; inset: 4px; border-radius: 50%; border: 2px dashed var(--tone-soft); }
.caller-page .grounding-circle {
  position: relative; z-index: 1; width: 120px; height: 120px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #6f9383 0%, #557666 45%, #4f6e60 100%);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  box-shadow: 0 0 0 0 rgba(79, 110, 96, .18), 0 8px 24px rgba(79, 110, 96, .25);
  transition-property: width, height, box-shadow; transition-duration: .8s; transition-timing-function: cubic-bezier(.4, 0, .2, 1);
}
.caller-page .grounding-circle.is-in { width: 196px; height: 196px; box-shadow: 0 0 0 14px rgba(79, 110, 96, .1), 0 12px 32px rgba(79, 110, 96, .3); }
.caller-page .grounding-circle-count { min-height: 2rem; font-size: 1.75rem; font-weight: 700; line-height: 1.15; }
.caller-page .grounding-circle-phase { font-size: .875rem; font-weight: 700; letter-spacing: .04em; }
.caller-page .grounding-breathe-status { margin: 0; min-height: 1.5rem; font-size: 1rem; font-weight: 700; color: var(--tone); }
.caller-page .grounding-breathe-sub { margin: 0; min-height: 1.3rem; font-size: .875rem; color: var(--c-grey-text); }
.caller-page .grounding-breath-dots { display: flex; gap: .55rem; justify-content: center; }
.caller-page .grounding-breath-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 1.5px solid var(--tone-mid); transition: background-color .3s; }
.caller-page .grounding-breath-dot.is-current { box-shadow: 0 0 0 2px var(--tone-soft); }
.caller-page .grounding-breath-dot.is-done { background: var(--tone); border-color: var(--tone); }
.caller-page .grounding-breathe-btn, .caller-page .grounding-press {
  min-height: 44px; border-radius: 22px; border: 1.5px solid var(--tone); background: var(--tone); color: #fff;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.caller-page .grounding-breathe-btn { padding: .55rem 1.8rem; }
.caller-page .grounding-breathe-btn:hover { box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .12); }
.caller-page .grounding-breathe-btn:focus-visible, .caller-page .grounding-press:focus-visible { outline: 3px solid var(--tone); outline-offset: 3px; }

.caller-page .grounding-floor { position: relative; width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; padding-top: .3rem; }
.caller-page .grounding-feet { position: relative; z-index: 1; display: flex; gap: 14px; align-items: flex-end; justify-content: center; transition: transform .3s cubic-bezier(.4, 0, .2, 1); }
.caller-page .grounding-footprint {
  position: relative; width: 48px; height: 84px; border-radius: 24px 24px 14px 14px;
  background: linear-gradient(180deg, #f4d9c8 0%, #e8c4b0 100%); border: 2px solid var(--tone);
  box-shadow: 0 2px 6px rgba(79, 110, 96, .15);
}
.caller-page .grounding-footprint::after { content: ""; position: absolute; bottom: -3px; left: 8px; right: 8px; height: 5px; border-radius: 3px; background: var(--tone); opacity: .5; }
.caller-page .grounding-ground-line {
  position: relative; width: 100%; height: 10px; margin-top: 6px; border-radius: 5px;
  background: linear-gradient(90deg, transparent 0%, var(--tone-soft) 15%, var(--tone-mid) 50%, var(--tone-soft) 85%, transparent 100%);
  transition: transform .25s ease, box-shadow .3s ease;
}
.caller-page .grounding-ripple {
  position: absolute; left: 50%; bottom: -7px; width: 80px; height: 24px; margin-left: -40px; border-radius: 50%;
  background: var(--tone-mid); opacity: 0; pointer-events: none; animation: grounding-ripple .9s ease-out forwards;
}
@keyframes grounding-ripple { from { transform: scale(0); opacity: .55; } to { transform: scale(3.5); opacity: 0; } }
.caller-page .grounding-ground-hint { position: relative; z-index: 1; margin: 0; max-width: 340px; min-height: 3rem; font-size: .9375rem; color: var(--c-grey-text); }
.caller-page .grounding-press {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 2rem;
  box-shadow: 0 4px 12px rgba(79, 110, 96, .3); transition: transform .12s, box-shadow .2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.caller-page .grounding-press svg { width: 16px; height: 16px; fill: currentColor; transition: transform .2s; }
.caller-page .grounding-ground-held { margin: 0; min-height: 1.3rem; font-size: .875rem; color: var(--c-grey-text); }
.caller-page .grounding-ground.is-pressing .grounding-feet { transform: translateY(8px); }
.caller-page .grounding-ground.is-pressing .grounding-ground-line { transform: scaleY(2); box-shadow: 0 0 20px rgba(107, 142, 127, .65); }
.caller-page .grounding-ground.is-pressing .grounding-ground-hint { color: var(--tone); font-weight: 700; }
.caller-page .grounding-ground.is-pressing .grounding-press {
  transform: scale(.96);
  box-shadow: 0 2px 6px rgba(79, 110, 96, .5), 0 0 0 4px rgba(107, 142, 127, .2), inset 0 2px 5px rgba(0, 0, 0, .3);
}
.caller-page .grounding-ground.is-pressing .grounding-press svg { transform: translateY(2px); }

/* Something to hold: the picker, then the thing she holds. */
.caller-page .grounding-hold-pick { display: flex; flex-direction: column; gap: .6rem; margin-top: .3rem; }
.caller-page .grounding-pick-lead { margin: 0; font-size: .9375rem; color: var(--c-grey-text); }
.caller-page .grounding-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.caller-page .grounding-object {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .85rem .7rem;
  background: #fff; border: 2px solid var(--tone-soft); border-radius: 14px; cursor: pointer;
  font: inherit; text-align: center; transition: border-color .2s, background-color .2s, transform .15s;
}
.caller-page .grounding-object:hover { border-color: var(--tone-mid); transform: translateY(-1px); }
.caller-page .grounding-object:focus-visible { outline: 3px solid var(--tone); outline-offset: 2px; }
.caller-page .grounding-object.is-selected { border-color: var(--tone); background: var(--tone-light); box-shadow: 0 0 0 3px var(--tone-soft); }
.caller-page .grounding-object.is-custom { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: .6rem; padding: .75rem; }
.caller-page .grounding-object-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.caller-page .grounding-object-icon svg { width: 100%; height: 100%; }
.caller-page .grounding-object.is-custom .grounding-object-icon { width: 32px; height: 32px; }
.caller-page .grounding-object.is-custom svg { fill: var(--tone); }
.caller-page .grounding-object.is-selected .grounding-object-icon { transform: scale(1.08); }
.caller-page .grounding-object-label { font-size: .875rem; font-weight: 600; line-height: 1.3; color: var(--c-navy); }
.caller-page .grounding-object-name {
  display: flex; flex-direction: column; gap: .3rem; padding: .85rem .9rem;
  background: #fff; border: 1.5px solid var(--tone-mid); border-radius: 14px;
}
.caller-page .grounding-object-name[hidden] { display: none; }

.caller-page .grounding-hold-display { position: relative; width: 140px; height: 140px; margin: .6rem 0 .2rem; display: flex; align-items: center; justify-content: center; }
.caller-page .grounding-hold-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tone-soft); transition: border-color .3s ease; }
.caller-page .grounding-hold-glow {
  position: absolute; inset: -20px; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.8);
  background: radial-gradient(circle, rgba(184, 122, 92, .35) 0%, rgba(184, 122, 92, .15) 40%, transparent 70%);
  transition: opacity .4s ease, transform .4s ease;
}
.caller-page .grounding-hold-pulse {
  position: absolute; top: 50%; left: 50%; width: 100px; height: 100px; margin: -50px 0 0 -50px;
  border-radius: 50%; border: 2px solid var(--g-warm-mid); opacity: 0; pointer-events: none;
}
.caller-page .grounding-hold-object { position: relative; z-index: 1; width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; transition: transform .25s ease; }
.caller-page .grounding-hold-object svg { width: 100%; height: 100%; }
.caller-page .grounding-hold-words {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: .5rem;
  background: var(--tone-light); border: 2px dashed var(--tone-mid); border-radius: 20px; color: var(--tone);
  font-size: .875rem; font-weight: 700; line-height: 1.3; text-align: center; overflow: hidden;
  overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
  transition: background-color .3s, border-color .3s;
}
.caller-page .grounding-hold.is-holding .grounding-hold-ring { border-color: var(--tone-mid); }
.caller-page .grounding-hold.is-holding .grounding-hold-glow { opacity: 1; transform: scale(1.1); }
.caller-page .grounding-hold.is-holding .grounding-hold-pulse { animation: grounding-hold-pulse 2.4s ease-out infinite; }
@keyframes grounding-hold-pulse { from { transform: scale(1); opacity: .5; } to { transform: scale(1.8); opacity: 0; } }
.caller-page .grounding-hold.is-holding .grounding-hold-object { transform: scale(1.06); }
.caller-page .grounding-hold.is-holding .grounding-hold-words { background: var(--g-warm-light); border-color: var(--g-warm-mid); color: var(--g-warm); }
.caller-page .grounding-hold.is-holding .grounding-ground-hint { color: var(--tone); font-weight: 700; }
.caller-page .grounding-hold.is-holding .grounding-press {
  transform: scale(.96);
  box-shadow: 0 2px 6px rgba(79, 110, 96, .5), 0 0 0 4px rgba(107, 142, 127, .2), inset 0 2px 5px rgba(0, 0, 0, .3);
}
.caller-page .grounding-hold.is-holding .grounding-press svg { transform: translateY(2px); }

@media (max-width: 360px) {
  .caller-page .grounding-circle-wrap { width: 200px; height: 200px; }
  .caller-page .grounding-circle.is-in { width: 180px; height: 180px; }
}
/* Less motion: the circle changes size at once, the feet and ground still
   respond, and there is no ripple. */
@media (prefers-reduced-motion: reduce) {
  .caller-page .grounding-circle, .caller-page .grounding-feet, .caller-page .grounding-ground-line,
  .caller-page .grounding-press, .caller-page .grounding-press svg, .caller-page .grounding-breath-dot,
  .caller-page .grounding-slot, .caller-page .grounding-slot .grounding-num { transition: none; }
  .caller-page .grounding-ripple { display: none; }
  .caller-page .grounding-object, .caller-page .grounding-object-icon, .caller-page .grounding-hold-ring,
  .caller-page .grounding-hold-glow, .caller-page .grounding-hold-object, .caller-page .grounding-hold-words { transition: none; }
  .caller-page .grounding-object:hover { transform: none; }
  .caller-page .grounding-hold.is-holding .grounding-hold-pulse { animation: none; }
}

html.high-contrast .caller-page .grounding-offer, html.high-contrast .caller-page .grounding-panel,
html.high-contrast .caller-page .grounding-input { border: 2px solid #000; }

@media (prefers-reduced-motion: no-preference) {
  .caller-page .grounding-panel { animation: grounding-in .2s ease-out; }
  @keyframes grounding-in { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 640px) {
  .caller-page .grounding-overlay { padding: 0; }
  .caller-page .grounding-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .caller-page .grounding-head { padding: .65rem .9rem; }
  .caller-page .grounding-eyebrow { flex-basis: 100%; }
  .caller-page .grounding-leave { margin-right: auto; }
  .caller-page .grounding-body { padding: .9rem; }
  .caller-page .grounding-foot { padding: .6rem .9rem .8rem; }
  .caller-page .grounding-btn { padding: .5rem .95rem; }
  .caller-page .grounding-offer { padding: .85rem .9rem; }
}
.caller-page .grounding-offer-from { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--c-navy); }
.caller-page .grounding-offer-from[hidden] { display: none; }
.caller-page .grounding-offer-from strong { color: var(--tone); }
/* While a version adjusted for her loads, so she never sees the wording change under her. */
.caller-page .grounding-offer.is-loading .grounding-offer-text,
.caller-page .grounding-offer.is-loading .grounding-offer-from { visibility: hidden; }
