/*
  "Create a Schedule" (class.schedule_funnel.php) — the walkthrough that opens inside the main
  content column, plus the pink button in the staff rail that opens it. On a phone the same
  walkthrough sits in an add_window() drawer (.schedule_funnel_drawer, at the bottom of this file).

  NOTE: no rem units in here. lib/bootstrap_old sets html { font-size: 10px }, so a rem is 10px
  on this site and anything sized in rem comes out about a third too small. px throughout.

  Everything below the button is scoped under .schedule_funnel_container, so none of it can reach
  the rest of the page. The tokens are the ones from claude/mockups/demo_request_funnel.html —
  teal brand, magenta accent — light only, because the app has no dark mode.
*/

/* ---- the button in the rail (dark ground, so it carries the pink on its own) ---- */

.ssb_create_schedule
{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #d6469f 0%, #bb3487 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px -8px rgba(214,70,159,0.9);
  transition: filter 0.12s, transform 0.12s;
}

.ssb_create_schedule:hover { filter: brightness(1.08); }
.ssb_create_schedule:active { transform: translateY(1px); }
.ssb_create_schedule i { font-size: 15px; }

/* ---- the funnel ---- */

.schedule_funnel_container
{
  --sf_surface: #ffffff;
  --sf_sunk: #f5f8f8;
  --sf_ink: #16211f;
  --sf_muted: #61727a;
  --sf_faint: #8a9a9f;
  --sf_line: #dbe4e6;
  --sf_line_strong: #c3d1d4;
  --sf_brand: #18a4ac;
  --sf_brand_deep: #0e7278;
  --sf_brand_wash: #eaf7f8;
  --sf_brand_edge: #b6e2e5;
  --sf_magenta: #bb3487;
  --sf_radius: 5px;

  /* the duotone illustration set: one flat wash, one soft wash, a line, a magenta accent */
  --sf_duo_fill: #cfeced;
  --sf_duo_fill_soft: #e4f4f5;
  --sf_duo_line: #0e7278;

  max-width: 1120px;
  margin: 0 auto;
  color: var(--sf_ink);
  font-size: 15px;
  line-height: 1.45;
}

.schedule_funnel_container *,
.schedule_funnel_container *:before,
.schedule_funnel_container *:after { box-sizing: border-box; }

.schedule_funnel_container h1,
.schedule_funnel_container h2 { margin: 0; }
.schedule_funnel_container p { margin: 0; }

/* ---- head ---- */

.sf_head
{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0 18px;
}

.sf_eyebrow
{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sf_brand_deep);
}

.sf_title
{
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px !important;
  line-height: 1.2;
}

.sf_close
{
  margin-left: auto;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--sf_line_strong);
  background: var(--sf_surface);
  color: var(--sf_muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.sf_close:hover { border-color: var(--sf_magenta); color: var(--sf_magenta); }

/* ---- the two columns ---- */

.sf_grid
{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 26px;
  align-items: start;
}

@media (max-width: 991px)
{
  .sf_grid { grid-template-columns: minmax(0, 1fr); }
}

.sf_card
{
  background: var(--sf_surface);
  border: 1px solid var(--sf_line);
  border-radius: var(--sf_radius);
  box-shadow: 0 1px 2px rgba(22,33,31,0.06), 0 8px 24px -14px rgba(22,33,31,0.22);
}

/* ---- progress ---- */

.sf_prog { display: flex; border-bottom: 1px solid var(--sf_line); }

.sf_prog_step
{
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-right: 1px solid var(--sf_line);
  background: var(--sf_sunk);
  color: var(--sf_faint);
  font-size: 13.5px;
}
.sf_prog_step:last-child { border-right: 0; }

.sf_prog_num
{
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid var(--sf_line_strong);
  background: var(--sf_surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.sf_prog_label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sf_prog_done { background: var(--sf_surface); color: var(--sf_muted); }
.sf_prog_done .sf_prog_num { border-color: var(--sf_brand); background: var(--sf_brand_wash); color: var(--sf_brand_deep); }

.sf_prog_now
{
  background: var(--sf_surface);
  color: var(--sf_ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--sf_brand);
}
.sf_prog_now .sf_prog_num { border-color: var(--sf_brand); background: var(--sf_brand); color: #fff; }

/* ---- panels ---- */

.sf_panel { padding: 26px 26px 24px; }
.sf_panel_head { margin-bottom: 20px; }
.sf_panel_head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sf_panel_head p { margin-top: 6px !important; color: var(--sf_muted); font-size: 14px; }

/* ---- the big choice cards ---- */

.sf_choice_grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* the opening fork is two answers, so they take the width between them */
.sf_choice_grid_two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 767px)
{
  .sf_choice_grid { grid-template-columns: minmax(0, 1fr); }
}

.sf_choice { position: relative; display: block; cursor: pointer; margin: 0; font-weight: 400; }
.sf_choice input { position: absolute; opacity: 0; pointer-events: none; }

.sf_choice_inner
{
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 17px 16px;
  border: 1px solid var(--sf_line_strong);
  border-radius: var(--sf_radius);
  background: var(--sf_sunk);
  transition: border-color 0.12s, background 0.12s;
}
.sf_choice:hover .sf_choice_inner { border-color: var(--sf_brand_edge); background: var(--sf_surface); }

.sf_choice input:checked ~ .sf_choice_inner
{
  border-color: var(--sf_brand);
  background: var(--sf_brand_wash);
  box-shadow: inset 0 -2px 0 var(--sf_brand);
}

.sf_duo_fill { fill: var(--sf_duo_fill); }
.sf_duo_fill_soft { fill: var(--sf_duo_fill_soft); }
.sf_duo_line { fill: none; stroke: var(--sf_duo_line); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sf_duo_accent { fill: none; stroke: var(--sf_magenta); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sf_duo_accent_fill { fill: var(--sf_magenta); }

.sf_choice_ill { width: 54px; height: 54px; }
.sf_choice_title { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; }
.sf_choice_desc { font-size: 13px; color: var(--sf_muted); line-height: 1.4; }

/* once a track is picked the two big cards step back and make room for its sub-options */
.sf_fork_picked .sf_choice_inner { flex-direction: row; align-items: center; gap: 13px; padding: 13px 15px; }
.sf_fork_picked .sf_choice_ill { width: 34px; height: 34px; flex: none; }
.sf_fork_picked .sf_choice_desc { display: none; }
.sf_fork_picked .sf_choice:not(.sf_picked) .sf_choice_inner { opacity: 0.62; }
.sf_fork_picked .sf_choice:not(.sf_picked):hover .sf_choice_inner { opacity: 1; }

/* ---- the sub-options that open under the fork ---- */

.sf_sub_panel
{
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--sf_line_strong);
}

.sf_sub_head { margin-bottom: 13px; }
.sf_sub_head b { font-size: 15px; font-weight: 700; }
.sf_sub_head p { margin-top: 3px !important; font-size: 13.5px; color: var(--sf_muted); }

/* ---- the smaller tiles ---- */

.sf_tile_grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 767px)
{
  .sf_tile_grid { grid-template-columns: minmax(0, 1fr); }
}

.sf_tile { position: relative; display: block; cursor: pointer; margin: 0; font-weight: 400; }
.sf_tile input { position: absolute; opacity: 0; pointer-events: none; }

.sf_tile_inner
{
  height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--sf_line_strong);
  border-radius: var(--sf_radius);
  background: var(--sf_sunk);
}
.sf_tile:hover .sf_tile_inner { border-color: var(--sf_brand_edge); background: var(--sf_surface); }

.sf_tile input:checked ~ .sf_tile_inner
{
  border-color: var(--sf_brand);
  background: var(--sf_brand_wash);
  box-shadow: inset 0 -2px 0 var(--sf_brand);
}

.sf_tile_ill { flex: none; width: 27px; height: 27px; margin-top: 1px; }
.sf_tile b { display: block; font-size: 14px; font-weight: 700; }
.sf_tile em { display: block; font-style: normal; font-size: 12.5px; color: var(--sf_muted); margin-top: 2px; line-height: 1.4; }

/* ---- fields ---- */

.sf_f_grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 14px; }
.sf_f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sf_f6 { grid-column: span 6; }
.sf_f12 { grid-column: span 12; }

@media (max-width: 767px)
{
  .sf_f6 { grid-column: span 12; }
}

.sf_f > label,
.sf_label
{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sf_muted);
  letter-spacing: 0.01em;
  margin: 0;
}

.sf_req { color: var(--sf_magenta); font-weight: 700; margin-left: 2px; }
.sf_hint { font-size: 12px; color: var(--sf_faint); font-weight: 400; }

.schedule_funnel_container input[type = 'text'],
.schedule_funnel_container textarea,
.schedule_funnel_container select
{
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--sf_line_strong);
  border-radius: var(--sf_radius);
  background: var(--sf_sunk);
  font-size: 14.5px;
  color: var(--sf_ink);
}

.schedule_funnel_container textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

.schedule_funnel_container input[type = 'text']:focus,
.schedule_funnel_container textarea:focus,
.schedule_funnel_container select:focus
{
  background: var(--sf_surface);
  border-color: var(--sf_brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--sf_brand_wash);
}

/* ---- segmented radios ---- */

.sf_seg
{
  display: flex;
  width: 100%;
  border: 1px solid var(--sf_line_strong);
  border-radius: var(--sf_radius);
  overflow: hidden;
}

.sf_seg label
{
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 400;
  background: var(--sf_sunk);
  border-left: 1px solid var(--sf_line_strong);
  position: relative;
}
.sf_seg label:first-of-type { border-left: 0; }
.sf_seg input { position: absolute; opacity: 0; pointer-events: none; }

.sf_seg input:checked + span { color: var(--sf_brand_deep); font-weight: 700; }

/* the checked cell fills. :has() covers a current browser; schedule_funnel.js also puts
   .sf_seg_on on the label, so the fill still lands where :has() is not understood */
.sf_seg label:has(input:checked),
.sf_seg label.sf_seg_on { background: var(--sf_brand_wash); box-shadow: inset 0 -2px 0 var(--sf_brand); }

/* ---- chips ---- */

.sf_chip_row { display: flex; flex-wrap: wrap; gap: 8px; }
.sf_chip { position: relative; cursor: pointer; margin: 0; font-weight: 400; }
.sf_chip input { position: absolute; opacity: 0; pointer-events: none; }

.sf_chip span
{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--sf_line_strong);
  border-radius: 100px;
  background: var(--sf_sunk);
  font-size: 13.5px;
  white-space: nowrap;
}
.sf_chip:hover span { border-color: var(--sf_brand_edge); }

.sf_chip input:checked + span
{
  background: var(--sf_brand_wash);
  border-color: var(--sf_brand);
  color: var(--sf_brand_deep);
  font-weight: 600;
}

/* ---- the aside note ---- */

.sf_note
{
  grid-column: span 12;
  display: flex;
  gap: 9px;
  padding: 11px 14px;
  background: var(--sf_brand_wash);
  border: 1px solid var(--sf_brand_edge);
  border-radius: var(--sf_radius);
  font-size: 13.5px;
  color: var(--sf_brand_deep);
}

/* ---- footer ---- */

.sf_foot
{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  border-top: 1px solid var(--sf_line);
  background: var(--sf_sunk);
  border-radius: 0 0 var(--sf_radius) var(--sf_radius);
}

.sf_foot_note { font-size: 12.5px; color: var(--sf_faint); }
.sf_foot_spacer { margin-left: auto; }

.sf_btn
{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--sf_radius);
  border: 1px solid var(--sf_line_strong);
  background: var(--sf_surface);
  color: var(--sf_ink);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.sf_btn:hover, .sf_btn:focus { border-color: var(--sf_brand); color: var(--sf_brand_deep); text-decoration: none; }

.sf_btn_primary
{
  border-color: var(--sf_magenta);
  background: var(--sf_magenta);
  color: #fff;
  font-weight: 600;
}
.sf_btn_primary:hover, .sf_btn_primary:focus { background: #a52c78; border-color: #a52c78; color: #fff; }

.sf_btn_ghost { border-color: transparent; background: transparent; color: var(--sf_muted); }
.sf_btn_lg { min-height: 42px; padding: 9px 20px; font-size: 15px; }

.sf_btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.sf_btn_primary[disabled]:hover { background: var(--sf_magenta); border-color: var(--sf_magenta); }

/* ---- the rail ---- */

.sf_rail { display: flex; flex-direction: column; gap: 14px; }

.sf_rail_card
{
  background: var(--sf_surface);
  border: 1px solid var(--sf_line);
  border-radius: var(--sf_radius);
  padding: 17px;
}

.sf_rail_title
{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sf_faint);
  margin-bottom: 12px;
}

.sf_next_list { display: flex; flex-direction: column; gap: 13px; }
.sf_next_item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 11px; }

.sf_next_num
{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sf_brand_wash);
  border: 1px solid var(--sf_brand_edge);
  color: var(--sf_brand_deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.sf_next_item b { display: block; font-size: 14px; font-weight: 700; }
.sf_next_item p { font-size: 13px; color: var(--sf_muted); margin-top: 2px !important; }

.sf_host { display: flex; gap: 12px; align-items: flex-start; }

.sf_host_avatar
{
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sf_brand_wash);
  border: 1px solid var(--sf_brand_edge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--sf_brand_deep);
}

.sf_host b { font-size: 14.5px; }
.sf_host_role { font-size: 12.5px; color: var(--sf_faint); }
.sf_host_note { margin-top: 10px !important; font-size: 13px; color: var(--sf_muted); }

.sf_proof
{
  background: var(--sf_sunk);
  border: 1px solid var(--sf_line);
  border-left: 2px solid var(--sf_magenta);
  border-radius: var(--sf_radius);
  padding: 14px 15px;
}
.sf_proof p { font-size: 13.5px; line-height: 1.5; }
.sf_proof_who { margin-top: 9px; font-size: 12px; color: var(--sf_faint); }

/* ---- the end ---- */

.sf_done { padding: 40px 30px; text-align: center; }
.sf_done_icon { font-size: 54px; color: var(--sf_brand); line-height: 1; }
.sf_done h2 { font-size: 23px; letter-spacing: -0.015em; margin-top: 14px !important; }
.sf_done > p { margin-top: 10px !important; color: var(--sf_muted); max-width: 460px; margin-left: auto; margin-right: auto; }

.sf_recap
{
  margin: 24px auto 0;
  max-width: 460px;
  text-align: left;
  border: 1px solid var(--sf_line);
  border-radius: var(--sf_radius);
  overflow: hidden;
}

.sf_recap_row
{
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sf_line);
  font-size: 13.5px;
}
.sf_recap_row:last-child { border-bottom: 0; }
.sf_recap_row span { color: var(--sf_faint); font-size: 12.5px; }
.sf_recap_row b { font-weight: 600; }

.sf_done_buttons { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- the phone drawer (schedule_funnel::display() in 'drawer' mode) ----
   the same card and rail, inside the mchat frame of an add_window() drawer. the container is
   the .mchat_container itself, so the walk buttons are its .mchat_input footer */

.schedule_funnel_drawer { max-width: none; margin: 0; }

.schedule_funnel_drawer .sf_drawer_title { font-size: 21px; margin: 2px 4px 14px !important; }

.schedule_funnel_drawer .sf_grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }

.schedule_funnel_drawer .schedule_funnel_footer
{
  flex: none;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--sf_line);
  border-radius: 0;
}

.schedule_funnel_drawer .sf_foot_note { display: none; }
.schedule_funnel_drawer .schedule_funnel_footer .sf_btn { min-height: 44px; }
.schedule_funnel_drawer .schedule_funnel_footer .schedule_funnel_next { flex: 1; font-size: 15px; }

/* the end panel's pair (Done / Start over) share the width */
.schedule_funnel_drawer .schedule_funnel_footer .sf_btn_lg { flex: 1; padding: 9px 10px; }

/* ---- a phone width, either shell ---- */

@media (max-width: 767px)
{
  .sf_panel { padding: 18px 14px; }
  .sf_done { padding: 28px 16px; }

  /* the progress bar is numbers only, bar the step they are on, which keeps its label */
  .sf_prog_step { padding: 10px 9px; gap: 6px; flex: 0 0 auto; }
  .sf_prog_now { flex: 1; min-width: 0; }
  .sf_prog_step:not(.sf_prog_now) .sf_prog_label { display: none; }
}
