/* The setup guide (onboardingguide, 2026-11-17): js/app/setupguide/. Admin only for now.
   Colours come from the master palette only; text sizes from the t- classes and the --text-* tokens. */

/* ---------- the cover over the results and the panel on it ---------- */
.sg-backdrop {
    position: fixed;
    z-index: 950;
    background: rgba(var(--color-ui-overlay-rgb), 0.10);
    -webkit-backdrop-filter: blur(6px) saturate(0.6);
    backdrop-filter: blur(6px) saturate(0.6);
}
.sg-panel {
    position: fixed;
    z-index: 951;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 16px;
    pointer-events: none;      /* the frame is the whole results area; only the card takes clicks */
}
.sg-panel > * { pointer-events: auto; }
.sg-panel::before { content: none; }
.sg-panel .sg-top,
.sg-panel .sg-main,
.sg-panel .sg-foot {
    background: var(--ui-backgrounds-cardBg);
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.sg-panel .sg-top {
    border-radius: 16px 16px 0 0;
    padding: 16px 24px 4px;
    border: 1px solid var(--ui-borders-borderLight);
    border-bottom: 0;
}
.sg-panel .sg-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 24px 20px;
    border-left: 1px solid var(--ui-borders-borderLight);
    border-right: 1px solid var(--ui-borders-borderLight);
    color: var(--ui-text-primaryText);
}
.sg-panel .sg-top[hidden] + .sg-main { border-radius: 16px 16px 0 0; border-top: 1px solid var(--ui-borders-borderLight); }
.sg-panel .sg-foot {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 24px;
    border: 1px solid var(--ui-borders-borderLight);
    border-top: 1px solid var(--ui-borders-borderDefault);
    border-radius: 0 0 16px 16px;
    background: var(--ui-backgrounds-panelBg);
}
.sg-panel .sg-foot[hidden] ~ .sg-main,
.sg-panel .sg-main:last-child { border-radius: 0 0 16px 16px; }
.sg-panel .sg-top[hidden] ~ .sg-main { border-radius: 16px 16px 0 0; }
.sg-panel .sg-top[hidden] ~ .sg-foot[hidden] { display: none; }
.sg-panel:has(.sg-top[hidden]):has(.sg-foot[hidden]) .sg-main {
    border-radius: 16px;
    border: 1px solid var(--ui-borders-borderLight);
    flex: 0 1 auto;
}
.sg-panel { filter: drop-shadow(0 18px 40px rgba(var(--color-ui-overlay-rgb), 0.18)); }
.sg-panel.sg-leaving { opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 0.3s, transform 0.3s; }

/* ---------- progress ---------- */
.sg-top-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sg-step { color: var(--ui-text-secondaryText); }
.sg-step b { color: var(--ui-text-primaryText); margin-left: 4px; }
.sg-left { color: var(--color-teal-1); font-weight: 500; }
.sg-close {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--ui-text-mutedText);
    cursor: pointer;
    padding: 0;
}
.sg-close:hover { color: var(--ui-text-primaryText); }
.sg-stepper {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    list-style: none;
    margin: 10px 0 6px;
    padding: 0;
}
.sg-stepper li { min-width: 0; }
.sg-stepper li i { display: block; height: 6px; border-radius: 3px; background: var(--ui-borders-borderLight); }
.sg-stepper li.is-done i { background: var(--color-teal-1); }
.sg-stepper li.is-current i { background: var(--ui-text-linkText); }
.sg-stepper li span {
    display: block;
    margin-top: 4px;
    color: var(--ui-text-mutedText);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-stepper li.is-current span { color: var(--ui-text-primaryText); font-weight: 700; }
.sg-stepper li.is-done span { color: var(--color-teal-1); }
.sg-donenote {
    margin: 4px 0 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(var(--color-teal-1-rgb), 0.08);
    color: var(--ui-text-secondaryText);
}
.sg-ok { color: var(--color-semantic-success); font-weight: 700; }

/* ---------- a question ---------- */
.sg-qmeta { display: flex; align-items: center; gap: 8px; color: var(--ui-text-mutedText); font-weight: 500; }
.sg-qdots { display: flex; gap: 4px; }
.sg-qdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-borders-borderLight); display: block; }
.sg-qdots i.is-current { background: var(--ui-text-linkText); }
.sg-qdots i.is-past { background: var(--color-teal-1); }
.sg-title { font-size: 24px; line-height: 1.25; margin: 6px 0; letter-spacing: -0.3px; color: var(--ui-text-primaryText); }
.sg-intro .sg-title { font-size: 28px; }
.sg-help, .sg-lede { color: var(--ui-text-secondaryText); margin: 0 0 14px; max-width: 640px; }
.sg-lede { font-size: var(--text-medium, 15px); }
.sg-body p { margin: 0 0 10px; color: var(--ui-text-secondaryText); max-width: 640px; }
.sg-muted { color: var(--ui-text-mutedText); }
.sg-eyebrow { color: var(--color-teal-1); }
.sg-exlist { list-style: none; padding: 0; margin: 0 0 12px; max-width: 440px; }
.sg-exlist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--ui-borders-borderLight); font-size: var(--text-medium, 15px); }
.sg-exlist li b { margin-left: auto; }
.sg-chip { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sg-chip--example { color: var(--color-semantic-warning); background: rgba(var(--color-semantic-warning-rgb), 0.12); }

.sg-fields { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 4px 0 8px; }
.sg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; }
.sg-field label { font-weight: 500; color: var(--ui-text-secondaryText); }
.sg-field input,
.sg-field select,
.sg-accq-row input,
.sg-accq-row select {
    border: 1.5px solid var(--ui-borders-borderDefault);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 17px;
    width: 260px;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
}
.sg-field input.sg-short { width: 130px; }
.sg-field input:focus,
.sg-field select:focus,
.sg-accq-row input:focus,
.sg-accq-row select:focus {
    outline: none;
    border-color: var(--color-teal-1);
    box-shadow: 0 0 0 4px rgba(var(--color-teal-1-rgb), 0.15);
}
.sg-field-msg { color: var(--color-semantic-danger); }
.sg-lands { display: flex; align-items: center; gap: 10px; color: var(--color-teal-1); min-height: 18px; flex-wrap: wrap; }
.sg-lands b { font-weight: 700; }
.sg-showme { font-size: var(--text-small, 14px); }

.sg-accq { display: flex; flex-direction: column; gap: 8px; max-width: 660px; margin-bottom: 8px; }
.sg-accq-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--ui-borders-borderLight);
    border-radius: 10px;
}
.sg-accq-row input, .sg-accq-row select { width: 100%; font-size: 15px; padding: 8px 10px; }
.sg-accq-kind { display: flex; flex-direction: column; min-width: 0; }
.sg-accq-kind b { display: flex; align-items: center; gap: 7px; }
.sg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--ui-text-mutedText); }
.sg-dot--preTax { background: var(--color-blue-6); }
.sg-dot--roth { background: var(--color-teal-3); }
.sg-dot--taxable { background: var(--color-amber-2); }
.sg-dot--cash { background: var(--color-green-4); }

.sg-choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.sg-choice {
    border: 1.5px solid var(--ui-borders-borderDefault);
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 15.5px;
    font-weight: 500;
    min-width: 150px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}
.sg-choice:hover { border-color: var(--ui-text-linkText); }
.sg-choice.is-selected { border-color: var(--color-teal-1); background: rgba(var(--color-teal-1-rgb), 0.08); }
.sg-choice:disabled { opacity: 0.6; cursor: default; }
.sg-note {
    background: var(--ui-backgrounds-hoverBg);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--ui-text-secondaryText);
    margin: 6px 0 12px;
    max-width: 640px;
}
.sg-note--done { background: rgba(var(--color-teal-1-rgb), 0.08); color: var(--ui-text-primaryText); }
.sg-extlink { display: inline-block; margin: 0 0 12px; }

.sg-recap { list-style: none; padding: 0; margin: 4px 0 8px; max-width: 700px; }
.sg-recap li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--ui-borders-borderLight); }
.sg-recap-n {
    width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(var(--color-teal-1-rgb), 0.12);
    color: var(--color-teal-1);
    font-weight: 700;
    font-size: 12px;
}
.sg-recap-t { display: flex; flex-direction: column; }

/* ---------- buttons and links ---------- */
.sg-btn {
    border: 1.5px solid var(--ui-text-linkText);
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-linkText);
    border-radius: 10px;
    padding: 9px 18px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.sg-btn--primary { background: var(--ui-text-linkText); border-color: var(--ui-text-linkText); color: var(--ui-backgrounds-cardBg); margin-left: auto; }
.sg-btn--primary:hover { filter: brightness(0.92); }
.sg-btn--ghost { border-color: var(--ui-borders-borderDefault); color: var(--ui-text-secondaryText); }
.sg-btn--light { background: var(--ui-backgrounds-cardBg); color: var(--ui-text-primaryText); border-color: var(--ui-backgrounds-cardBg); padding: 5px 12px; font-size: 14px; }
.sg-btn:disabled { opacity: 0.45; cursor: default; }
.sg-foot .sg-saved + .sg-btn--primary { margin-left: 0; }
.sg-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ui-text-linkText);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.sg-link:hover { text-decoration: underline; }
.sg-watch { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-small, 14px); }
.sg-play { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; display: inline-block; }
.sg-saved { color: var(--ui-text-mutedText); margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- opening and welcome-back screens ---------- */
.sg-isteps { list-style: none; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 26px; max-width: 720px; }
.sg-isteps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ui-borders-borderLight); min-width: 0; }
.sg-isteps-n {
    width: 24px; height: 24px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--ui-backgrounds-hoverBg);
    color: var(--ui-text-linkText);
    font-weight: 700;
    font-size: 12px;
}
.sg-isteps li.is-done .sg-isteps-n { background: var(--color-teal-1); color: var(--ui-text-inverseText); }
.sg-isteps li.is-current .sg-isteps-n { background: var(--ui-text-linkText); color: var(--ui-backgrounds-cardBg); }
.sg-isteps-name { flex: 1; min-width: 0; }
.sg-isteps-min { color: var(--ui-text-mutedText); white-space: nowrap; }
.sg-total { color: var(--ui-text-secondaryText); margin: 8px 0 12px; }
.sg-total b { color: var(--ui-text-primaryText); }
.sg-handy { color: var(--ui-text-secondaryText); margin: 0 0 16px; max-width: 720px; }
.sg-handy summary { cursor: pointer; color: var(--ui-text-linkText); font-weight: 500; }
.sg-handy ul { margin: 6px 0 0; padding-left: 20px; }
.sg-bigchoices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; }
.sg-bigchoice {
    border: 1.5px solid var(--ui-borders-borderDefault);
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    cursor: pointer;
}
.sg-bigchoice b { font-size: 17px; }
.sg-bigchoice span { color: var(--ui-text-secondaryText); }
.sg-bigchoice:hover { border-color: var(--ui-text-linkText); }
.sg-bigchoice--primary { border-color: var(--ui-text-linkText); background: var(--ui-backgrounds-selectedBg); }
.sg-bigchoice--primary b { color: var(--ui-text-linkText); }
.sg-savenote { color: var(--ui-text-mutedText); margin: 12px 0 4px; display: flex; gap: 6px; align-items: center; }

/* ---------- the header's door ---------- */
.v2-header .sg-headlink {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(var(--color-teal-1-rgb), 0.9);
    background: transparent;
    color: var(--ui-main-headerText, var(--color-ui-header-text));
    border-radius: 999px;
    padding: 4px 12px 4px 5px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    margin-right: 8px;
}
.v2-header .sg-headlink:hover { background: rgba(var(--color-teal-1-rgb), 0.25); }
.v2-header .sg-headlink[aria-expanded="true"] { background: rgba(var(--color-teal-1-rgb), 0.35); }
.v2-header .sg-headlink .sg-ring-track { stroke: rgba(var(--ui-main-headerText-rgb, var(--color-ui-header-text-rgb)), 0.3); }
.sg-ring-track { fill: none; stroke: var(--ui-borders-borderLight); stroke-width: 3; }
.sg-ring-fill { fill: none; stroke: var(--color-teal-1); stroke-width: 3; stroke-linecap: round; }

/* ---------- the arrow and the rows it points at (left column) ---------- */
.sg-arrow-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 952; overflow: visible; }
.sg-arrow-path { fill: none; stroke: var(--color-teal-1); stroke-width: 2.6; stroke-linecap: round; }
.sg-arrow-head { fill: var(--color-teal-1); }
.sg-arrow-start { fill: var(--ui-backgrounds-cardBg); stroke: var(--color-teal-1); stroke-width: 2.4; }
.sg-arrow-packet { fill: var(--color-teal-1); }
.sg-aim {
    background: rgba(var(--color-teal-1-rgb), 0.08) !important;
    box-shadow: 0 0 0 2px var(--color-teal-1) !important;
    border-radius: 8px;
    transition: background 0.3s, box-shadow 0.3s;
}
.sg-flash { animation: sg-flash 0.5s ease-out; }
@keyframes sg-flash { 0% { background: rgba(var(--color-teal-1-rgb), 0.28); } 100% { background: rgba(var(--color-teal-1-rgb), 0.08); } }
.sg-landed { animation: sg-landed 1.5s ease-out; }
@keyframes sg-landed {
    0% { box-shadow: 0 0 0 0 rgba(var(--color-teal-1-rgb), 0.6); }
    60% { box-shadow: 0 0 0 10px rgba(var(--color-teal-1-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--color-teal-1-rgb), 0); }
}

/* ---------- the tour and the offer ---------- */
.sg-tour {
    position: fixed;
    z-index: 10040;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: var(--ui-text-primaryText);
    color: var(--ui-backgrounds-cardBg);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 12px 30px rgba(var(--color-ui-overlay-rgb), 0.25);
}
.sg-tour p { margin: 4px 0 10px; }
.sg-tour-n { color: var(--color-teal-5); }
.sg-tour-btns { display: flex; justify-content: space-between; align-items: center; }
.sg-tour-btns .sg-link { color: var(--ui-borders-borderLight); font-weight: 400; font-size: var(--text-small, 14px); }
.sg-tour-ring { box-shadow: 0 0 0 3px var(--color-teal-1), 0 0 0 9px rgba(var(--color-teal-1-rgb), 0.15) !important; border-radius: 10px; }
.sg-offer-back {
    position: fixed;
    inset: 0;
    z-index: 10045;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(var(--color-ui-overlay-rgb), 0.35);
}
.sg-offer {
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    border-radius: 16px;
    max-width: 460px;
    width: 100%;
    padding: 20px 22px;
    box-shadow: 0 20px 60px rgba(var(--color-ui-overlay-rgb), 0.25);
}
.sg-offer-title { font-size: 22px; margin: 4px 0 8px; }
.sg-offer p { margin: 0 0 6px; color: var(--ui-text-secondaryText); }
.sg-offer ul { list-style: disc; padding-left: 20px; margin: 6px 0 14px; color: var(--ui-text-secondaryText); }
.sg-offer ul li { margin: 4px 0; }
.sg-offer-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.sg-offer-btns .sg-btn--primary { margin-left: 0; }

/* ---------- the video ---------- */
.sg-video {
    border: 0;
    border-radius: 14px;
    padding: 0;
    width: min(760px, calc(100vw - 32px));
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
}
.sg-video::backdrop { background: rgba(var(--color-ui-overlay-rgb), 0.6); }
.sg-video-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.sg-video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--ui-text-primaryText); }
.sg-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- narrow screens: the panel is a sheet over the page ---------- */
@media (max-width: 800px) {
    .sg-panel { padding: 8px; }
    .sg-panel .sg-top, .sg-panel .sg-main, .sg-panel .sg-foot { padding-left: 14px; padding-right: 14px; }
    .sg-stepper li span { display: none; }
    .sg-isteps, .sg-bigchoices { grid-template-columns: 1fr; }
    .sg-accq-row { grid-template-columns: 1fr 1fr; }
    .sg-accq-kind { grid-column: 1 / -1; }
    .sg-field, .sg-field input, .sg-field select { width: 100%; }
    .sg-saved { order: -1; width: 100%; margin-left: 0; }
    .sg-title { font-size: 21px; }
    .sg-headlink span { display: none; }
}
