/* Guided layout (?ui=guided): see guided.js. Screen only; the PDF copy (.pdfmode) keeps the sheet. */
body.ui-guided { --g-accent: #E40046; --g-accent-soft: #fde8ef; --g-ok: #16a34a; --g-ok-soft: #e8f7ee; --g-next: #c9ced6;
  --g-fix: #d97706; --g-ink: #1D2128; --g-muted: #6b7280; --g-line: #cfd5dd; --g-bg: #F6F7F9; --g-err: #c8102e;
  background: var(--g-bg); color: var(--g-ink); font-family: "Inter", Arial, Helvetica, sans-serif; font-size: 15.5px; }
body.ui-guided.theme-brandblue { --g-accent: #4058A8; --g-accent-soft: #e9edf8; --g-bg: #F4F6FB; }
body.ui-guided .toolbar { background: #1D2128; }

/* ---------- page column */
.ui-guided .sheet:not(.pdfmode) { background: transparent; box-shadow: none; width: 100%; max-width: 780px; padding: 20px 16px 40px; margin: 0 auto; }
.ui-guided .sheet:not(.pdfmode) .letterhead { background: #fff; border-radius: 14px; padding: 22px 24px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.ui-guided .sheet:not(.pdfmode) .lh-title { font-family: "Inter Tight", "Inter", sans-serif; font-size: 20px; margin-top: 6px; }
.ui-guided .sheet:not(.pdfmode) .lh-addr { color: var(--g-muted); font-size: 13px; }
.ui-guided .sheet:not(.pdfmode) section.sec { background: #fff; border-radius: 14px; padding: 24px 26px 18px; margin: 0 0 16px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.ui-guided .sheet:not(.pdfmode) section.sec + section.sec:not(.ui-off) { margin-top: -10px; }
.ui-guided .sheet:not(.pdfmode) .sec-title, .ui-guided .sheet:not(.pdfmode) .banner {
  font-family: "Inter Tight", "Inter", sans-serif; font-size: 20px; text-align: left; color: var(--g-ink); border: 0; padding: 0; margin: 0 0 16px; letter-spacing: 0; }
.ui-guided .sheet:not(.pdfmode) .sec-title::before { display: none; }
.ui-guided .pagefoot { display: none; }
.ui-guided .actions { max-width: 780px; margin: 0 auto; padding: 0 16px 40px; }
.ui-guided .submit { background: var(--g-accent); border-radius: 10px; font-weight: 600; padding: 14px 28px; }

/* after step 1: a slim letterhead, no how-to card */
.ui-later .sheet:not(.pdfmode) .ui-intro, .ui-later .sheet:not(.pdfmode) .lh-addr { display: none; }
.ui-later .sheet:not(.pdfmode) .letterhead { display: flex; align-items: center; gap: 14px; padding: 12px 20px; text-align: left; }
.ui-later .sheet:not(.pdfmode) .letterhead .ui-logo { height: 34px; margin: 0; }
.ui-later .sheet:not(.pdfmode) .lh-title { margin: 0; font-size: 15px; color: var(--g-muted); }

/* ---------- instructions: the sheet's own notes, and the "how to" card */
.ui-guided .sheet:not(.pdfmode) p.note.i, .ui-guided .sheet:not(.pdfmode) p.note.bi {
  background: #eef4ff; border-radius: 10px; padding: 10px 14px 10px 38px; position: relative; font-style: normal; font-weight: 500; color: #1e3a8a; }
.ui-guided .sheet:not(.pdfmode) p.note.i::before, .ui-guided .sheet:not(.pdfmode) p.note.bi::before {
  content: "i"; position: absolute; left: 12px; top: 10px; width: 17px; height: 17px; border-radius: 50%; background: #3b5bdb; color: #fff;
  font: italic 700 12px/17px Georgia, serif; text-align: center; }
.ui-intro { text-align: left; background: #eef4ff; color: #1e3a8a; border-radius: 10px; padding: 12px 16px; margin-top: 16px; font-size: 14px; }
.ui-intro ul { margin: 6px 0 0; padding-left: 18px; } .ui-intro li { margin: 2px 0; }

/* ---------- no table look: just the words and the answer boxes */
.ui-guided .sheet:not(.pdfmode) table.t, .ui-guided .sheet:not(.pdfmode) table.t tbody,
.ui-guided .sheet:not(.pdfmode) table.t tr, .ui-guided .sheet:not(.pdfmode) table.t td, .ui-guided .sheet:not(.pdfmode) table.t th {
  display: block; width: 100%; border: 0 !important; background: none !important; padding: 0; height: auto; }
.ui-guided .sheet:not(.pdfmode) .tablewrap { overflow: visible; }
.ui-guided .sheet:not(.pdfmode) .tablewrap table.grid { min-width: 0; }
.ui-guided .sheet:not(.pdfmode) table.t { margin: 0 0 6px; }
/* label + answer pairs */
.ui-guided .sheet:not(.pdfmode) table.kv tr { margin: 0 0 16px; }
.ui-guided .sheet:not(.pdfmode) table.kv td.lab { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.ui-guided .sheet:not(.pdfmode) table.kv td.lab .sub { font-weight: 400; color: var(--g-muted); font-size: 13px; }
.ui-guided .sheet:not(.pdfmode) table.kv td.span { font-weight: 700; margin-top: 8px; }
/* yes / no questions */
.ui-guided .sheet:not(.pdfmode) table.yesno tr:first-child { display: none; }
.ui-guided .sheet:not(.pdfmode) table.yesno tr { padding: 12px 0; border-bottom: 1px solid #eef0f3 !important; }
.ui-guided .sheet:not(.pdfmode) table.yesno td.ans { margin-top: 8px; white-space: normal; }
/* repeating rows: each row a light block, every box with its column name */
.ui-guided .sheet:not(.pdfmode) table.grid tr:first-child { display: none; }
.ui-guided .sheet:not(.pdfmode) table.grid tr { background: #f7f8fa !important; border-radius: 12px; padding: 14px 16px 6px; margin: 0 0 12px; position: relative;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.ui-guided .sheet:not(.pdfmode) table.grid tr::before { content: attr(data-rowlabel); grid-column: 1 / -1; font-weight: 700; color: var(--g-accent); font-size: 13px; }
.ui-guided .sheet:not(.pdfmode) table.grid tr[data-rowlabel=""]::before { display: none; }
.ui-guided .sheet:not(.pdfmode) table.grid td { padding: 0 0 12px; }
.ui-cl { display: none; }
.ui-guided .sheet:not(.pdfmode) table.grid .ui-cl { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.ui-guided .sheet:not(.pdfmode) table.grid td.fixed { font-weight: 700; grid-column: 1 / -1; padding-bottom: 8px; }
.ui-guided .sheet:not(.pdfmode) table.grid .rm { position: absolute; right: 10px; top: 10px; }
.ui-guided .sheet:not(.pdfmode) .addrow { border: 1.5px dashed var(--g-accent); color: var(--g-accent); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; }
/* document lists */
.ui-guided .sheet:not(.pdfmode) table.docs tr { display: flex !important; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f1f4 !important; }
.ui-guided .sheet:not(.pdfmode) table.docs td.box { width: auto; flex: none; }

/* ---------- answer boxes */
.ui-guided .sheet:not(.pdfmode) .f, .ui-guided .sheet:not(.pdfmode) .line, .ui-guided .sheet:not(.pdfmode) table.grid .f {
  border: 1px solid var(--g-line); border-radius: 8px; background: #fff; min-height: 44px; padding: 10px 12px; font-size: 15px; width: 100%; height: auto; }
.ui-guided .sheet:not(.pdfmode) textarea.lined { background: #fff; line-height: 1.4; }
.ui-guided .sheet:not(.pdfmode) .line { width: 260px; max-width: 100%; }
.ui-guided .sheet:not(.pdfmode) input.line[data-fmt="date"], .ui-guided .sheet:not(.pdfmode) input.line[data-fmt="month"] { width: 170px; }
.ui-guided .sheet:not(.pdfmode) .f:focus, .ui-guided .sheet:not(.pdfmode) .line:focus {
  outline: none; border-color: var(--g-accent); box-shadow: 0 0 0 3px var(--g-accent-soft); }
.ui-guided .sheet:not(.pdfmode) .part { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 14px; font-weight: 600; }
.ui-guided .sheet:not(.pdfmode) .opts { gap: 8px 10px; }
.ui-guided .sheet:not(.pdfmode) .opt { border: 1px solid var(--g-line); border-radius: 999px; padding: 8px 14px; background: #fff; gap: 8px; }
.ui-guided .sheet:not(.pdfmode) .opt:has(input:checked) { border-color: var(--g-accent); background: var(--g-accent-soft); }
.ui-guided .sheet:not(.pdfmode) .opt input, .ui-guided .sheet:not(.pdfmode) .declare input, .ui-guided .sheet:not(.pdfmode) .docbox { accent-color: var(--g-accent); width: 18px; height: 18px; }
.ui-guided .sheet:not(.pdfmode) .radioline { margin: 0 0 16px; }
.ui-guided .sheet:not(.pdfmode) .radioline .rl-label { display: block; font-weight: 600; margin-bottom: 8px; }
.ui-guided .sheet:not(.pdfmode) .declare { background: #f7f8fa; border-radius: 10px; padding: 14px; font-weight: 500; }
.ui-guided .sheet:not(.pdfmode) .sigpad { border: 1.5px dashed var(--g-line); border-radius: 10px; background: #fff; width: 320px; max-width: 100%; height: 90px; }
.ui-guided .sheet:not(.pdfmode) .sigwrap { flex-direction: column; align-items: flex-start; font-weight: 600; }

/* ---------- required: red star (their asterisks) */
.ui-star { color: var(--g-err, #c8102e); font-weight: 700; margin-left: 2px; }
.sheet.pdfmode .ui-star { color: inherit; font-weight: inherit; margin: 0; }

/* ---------- autofilled from the walk-in form */
.ui-guided .sheet:not(.pdfmode) .ui-autofilled { background: #f3fbf6; border-color: #9fd9b4; }
.ui-auto { display: inline-block; font-size: 12px; font-weight: 600; color: #15803d; margin: 4px 0 0; }
.ui-guided .sheet:not(.pdfmode) .ui-auto { display: block; }

/* ---------- error messages */
.ui-guided .sheet:not(.pdfmode) .err, .ui-guided .sheet:not(.pdfmode) .ui-bad .f, .ui-guided .sheet:not(.pdfmode) .ui-bad .line { box-shadow: none; }
.ui-guided .sheet:not(.pdfmode) :is(input, textarea, select).err { border-color: var(--g-err) !important; background: #fff6f7 !important; }
.ui-guided .sheet:not(.pdfmode) .opts.err .opt, .ui-guided .sheet:not(.pdfmode) .ui-bad .opt { border-color: var(--g-err); }
.ui-guided .sheet:not(.pdfmode) .ui-bad .sigpad, .ui-guided .sheet:not(.pdfmode) .sigpad.err { border-color: var(--g-err); }
.ui-guided .sheet:not(.pdfmode) .declare.ui-bad { outline: 1.5px solid var(--g-err); background: #fff6f7; }
.ui-msg { color: var(--g-err); font-size: 13.5px; font-weight: 600; margin: 6px 0 12px; display: flex; gap: 6px; }
.ui-msg::before { content: "!"; flex: none; width: 17px; height: 17px; border-radius: 50%; background: var(--g-err); color: #fff; font-size: 12px; line-height: 17px; text-align: center; }
#ui-fix { background: #fff6f7; border: 1px solid #f3c1c9; color: #7f1d1d; border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 14px; }
#ui-fix ul { margin: 6px 0 0; padding-left: 18px; } #ui-fix a { color: var(--g-err); font-weight: 600; }
.ui-guided #errors { display: none !important; }

/* ---------- Back / Save & continue */
.ui-guided .ui-stepnav { max-width: 780px; margin: 0 auto 20px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui-savehint { flex: 1; text-align: center; font-size: 12.5px; color: var(--g-muted); }
.ui-guided .ui-btn { background: var(--g-accent); border-radius: 10px; font-weight: 600; padding: 13px 24px; }
.ui-guided .ui-btn.ghost { background: #fff; color: var(--g-ink); border: 1px solid var(--g-line); }

/* ======================================================================= the progress tracker
   green = completed · accent = current · grey = upcoming · amber = went back and emptied a required answer */
#ui-track { --c-done: var(--g-ok); --c-cur: var(--g-accent); --c-next: var(--g-next); --c-fix: var(--g-fix); font-size: 13px; }
#ui-track .t-head { display: flex; justify-content: space-between; gap: 10px; color: var(--g-muted); font-size: 12.5px; margin-bottom: 10px; }
#ui-track .t-head b { color: var(--g-ink); }
#ui-track .t-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--g-muted); }
#ui-track .lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
#ui-track .lg-done::before { background: var(--c-done); } #ui-track .lg-cur::before { background: var(--c-cur); } #ui-track .lg-next::before { background: var(--c-next); }
#ui-track a { text-decoration: none; color: inherit; }
#ui-track .t-dot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font-weight: 700; font-size: 12px; background: #fff; border: 2px solid var(--c-next); color: var(--g-muted); }
#ui-track .t-done .t-dot { background: var(--c-done); border-color: var(--c-done); color: #fff; }
#ui-track .t-cur .t-dot { background: var(--c-cur); border-color: var(--c-cur); color: #fff; box-shadow: 0 0 0 4px var(--g-accent-soft); }
#ui-track .t-fix .t-dot { background: var(--c-fix); border-color: var(--c-fix); color: #fff; }
#ui-track .t-txt { display: flex; flex-direction: column; min-width: 0; }
#ui-track .t-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui-track .t-sub { font-size: 11px; color: var(--g-muted); }
#ui-track .t-next .t-name { color: var(--g-muted); font-weight: 500; }
#ui-track .t-done .t-sub { color: var(--c-done); } #ui-track .t-cur .t-sub { color: var(--c-cur); font-weight: 600; } #ui-track .t-fix .t-sub { color: var(--c-fix); }

/* A. chips: sticky bar of section pills under the toolbar */
.track-chips #ui-track, .track-numbers #ui-track { position: sticky; top: 40px; z-index: 4; background: #fff; box-shadow: 0 1px 0 #e5e7eb, 0 4px 12px rgba(16,24,40,.04); padding: 12px max(16px, calc((100vw - 1100px) / 2)) 10px; }
.track-chips #ui-track .t-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.track-chips #ui-track .t-list a { flex: none; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1.5px solid #e5e7eb; background: #fff; }
.track-chips #ui-track .t-done { background: var(--g-ok-soft) !important; border-color: #b7e4c7 !important; }
.track-chips #ui-track .t-cur { border-color: var(--c-cur) !important; background: var(--g-accent-soft) !important; }
.track-chips #ui-track .t-next { background: #f9fafb !important; }

/* B. numbers: circles on a line, current name shown big */
.track-numbers #ui-track .t-list { display: flex; overflow-x: auto; padding: 4px 2px 6px; }
.track-numbers #ui-track .t-list a { flex: 1 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
.track-numbers #ui-track .t-list a::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--c-next); z-index: 0; }
.track-numbers #ui-track .t-list a:first-child::before { display: none; }
.track-numbers #ui-track .t-list a.t-done::before, .track-numbers #ui-track .t-list a.t-cur::before, .track-numbers #ui-track .t-list a.t-fix::before { background: var(--c-done); }
.track-numbers #ui-track .t-dot { position: relative; z-index: 1; }
.track-numbers #ui-track .t-txt { align-items: center; max-width: 86px; overflow: hidden; }
.track-numbers #ui-track .t-name { font-size: 11px; white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.track-numbers #ui-track .t-sub { display: none; }

/* C. side: a vertical list beside the form on wide screens, chips on phones */
@media (min-width: 1100px) {
  .track-side #ui-track { position: fixed; top: 60px; left: max(16px, calc((100vw - 780px) / 2 - 300px)); width: 270px; max-height: calc(100vh - 80px); overflow: auto;
    background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.06); padding: 16px; z-index: 3; }
  .track-side #ui-track .t-head { flex-direction: column; gap: 2px; }
  .track-side #ui-track .t-list { display: flex; flex-direction: column; }
  .track-side #ui-track .t-list a { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; position: relative; }
  .track-side #ui-track .t-list a:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 36px; bottom: -8px; width: 2px; background: var(--c-next); }
  .track-side #ui-track .t-list a.t-done:not(:last-child)::after { background: var(--c-done); }
  .track-side #ui-track .t-cur { background: var(--g-accent-soft); }
  .track-side #ui-track .t-name { white-space: normal; }
  .track-side .sheet:not(.pdfmode), .track-side .actions, .track-side .ui-stepnav { margin-left: max(310px, calc((100vw - 780px) / 2 + 20px)); margin-right: auto; }
}
@media (max-width: 1099px) {
  .track-side #ui-track { position: sticky; top: 40px; z-index: 4; background: #fff; padding: 12px 16px 10px; box-shadow: 0 1px 0 #e5e7eb; }
  .track-side #ui-track .t-list { display: flex; gap: 8px; overflow-x: auto; }
  .track-side #ui-track .t-list a { flex: none; display: flex; align-items: center; gap: 8px; max-width: 200px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1.5px solid #e5e7eb; }
}

/* D. bar: like their reference photo: section name, "Step n of N", one slim bar cut into the sections */
.track-bar #ui-track { position: sticky; top: 40px; z-index: 4; background: #fff; box-shadow: 0 1px 0 #e5e7eb; padding: 12px 16px 10px; }
.track-bar #ui-track > * { max-width: 748px; margin-left: auto; margin-right: auto; }
.track-bar #ui-track .b-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.track-bar #ui-track .b-title { font: 700 19px "Inter Tight", "Inter", sans-serif; color: var(--g-ink); }
.track-bar #ui-track .b-step { font-size: 12.5px; color: var(--g-muted); white-space: nowrap; }
.track-bar #ui-track .b-seg { display: flex; gap: 3px; margin-top: 8px; }
.track-bar #ui-track .b-seg a { flex: 1; height: 6px; border-radius: 3px; background: #e5e7eb; }
.track-bar #ui-track .b-seg a.t-done { background: var(--c-done); }
.track-bar #ui-track .b-seg a.t-cur { background: var(--c-cur); }
.track-bar #ui-track .b-seg a.t-fix { background: var(--c-fix); }
.track-bar #ui-track .t-legend { margin-top: 8px; }

/* section icon */
.ui-ic { display: inline-block; width: 22px; height: 22px; margin-right: 8px; vertical-align: -4px; color: var(--g-accent); }
.ui-ic svg { width: 100%; height: 100%; }

.ui-guided .sheet:not(.pdfmode) .sec-title::before { display: none !important; }

/* hints inside boxes */
.ui-guided .sheet:not(.pdfmode) ::placeholder { color: #9aa1ab; font-weight: 400; }

/* two short answers per line on wide screens */
@media (min-width: 720px) {
  .ui-guided .sheet:not(.pdfmode) table.kv tbody { display: flex !important; flex-wrap: wrap; gap: 0 18px; }
  .ui-guided .sheet:not(.pdfmode) table.kv tr { flex: 1 1 100%; }
  .ui-guided .sheet:not(.pdfmode) table.kv tr.ui-half { flex: 1 1 calc(50% - 9px); max-width: calc(50% - 9px); display: flex !important; flex-direction: column; justify-content: flex-start; }
}

/* ---------- phones */
@media (max-width: 640px) {
  .ui-guided .sheet:not(.pdfmode) section.sec { padding: 18px 16px 12px; border-radius: 12px; }
  .ui-guided .sheet:not(.pdfmode) .sec-title, .ui-guided .sheet:not(.pdfmode) .banner { font-size: 18px; }
  .ui-savehint { display: none; }
  .ui-guided .ui-stepnav .ui-btn { flex: 1; }
  #ui-track .t-legend { display: none; }
  .ui-guided .sheet:not(.pdfmode) table.grid tr { grid-template-columns: 1fr; }
}
@media print { #ui-track, .ui-stepnav, .ui-msg, #ui-fix, .ui-auto, .ui-intro { display: none !important; } .ui-off { display: revert !important; } }
