html, body { max-width: 100%; overflow-x: hidden; }
body.advisor-body-page { margin: 0; background: #f5efe6; color: #162338; line-height: 1.55; }
*, *::before, *::after { box-sizing: border-box; }
img, svg, table { max-width: 100%; }
button, input, select, textarea { font: inherit; }
.advisor-shell { min-height: 100vh; }
.advisor-hero { background: linear-gradient(180deg, #0d1830 0%, #13213f 100%); color: #fff; padding: 1.2rem 1rem 1.6rem; }
.advisor-hero__inner, .advisor-main { width: min(100%, 920px); margin: 0 auto; }
.advisor-hero__inner { display: grid; gap: .5rem; }
.advisor-hero__badge { display: inline-flex; align-items: center; width: fit-content; padding: .28rem .6rem; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(234,179,8,.22); color: #f7df93; font-size: .74rem; font-weight: 700; }
.advisor-hero h1 { margin: 0; font-size: clamp(1.25rem, 4vw, 1.75rem); line-height: 1.4; font-weight: 800; color: #fff8e1; }
.advisor-hero p { margin: 0; color: #c4d2ea; font-size: .88rem; }
.advisor-main { padding: 1rem 1rem 4rem; }
.advisor-flow { display: grid; gap: .9rem; }

.advisor-panel, .result-summary-bar, .result-hero-card, .alt-list-card, .details-toggle-card, .details-drawer, .saved-plans-panel, .auth-gate-panel, .disclaimer-panel, .empty-state {
  background: #fff; border: 1px solid #e9e1d3; border-radius: 18px; box-shadow: 0 10px 24px rgba(19,31,54,.05);
}
.advisor-panel, .result-summary-bar, .result-hero-card, .alt-list-card, .details-toggle-card, .details-drawer, .saved-plans-panel, .auth-gate-panel, .disclaimer-panel, .empty-state { padding: 1rem; }
.advisor-panel__header, .details-block h3, .saved-plans-panel__head h3 { margin: 0 0 .8rem; }
.advisor-panel__header h2, .details-block h3, .saved-plans-panel__head h3, .auth-gate-panel h3 { margin: 0 0 .2rem; font-size: 1rem; font-weight: 800; color: #14233b; }
.advisor-panel__header p, .auth-gate-panel p, .disclaimer-panel p, .helper-line { margin: 0; color: #68758b; font-size: .84rem; }

.result-summary-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; background: #fff9ea; border-color: #ebd8a0; }
.result-summary-bar__items { display: flex; flex-wrap: wrap; gap: .45rem .9rem; color: #7a6840; font-size: .82rem; }
.summary-edit-btn, .saved-refresh-btn { appearance: none; border: 1px solid #dbe3ee; background: #f2f5f9; color: #1e304c; border-radius: 12px; padding: .6rem .8rem; cursor: pointer; font-weight: 800; }

.progress-steps { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .45rem; margin-bottom: .85rem; }
.progress-step { padding: .58rem .65rem; border-radius: 12px; background: #f8f5ef; border: 1px solid #ece3d6; color: #72634a; font-size: .74rem; }
.progress-step strong { margin-inline-end: .25rem; color: #17253e; }
.progress-step.is-active { background: #fff7df; border-color: #dfbd66; color: #8a5d04; }
.progress-step.is-done { background: #eff9f2; border-color: #bdddca; color: #166534; }

.advisor-form { display: grid; gap: .85rem; }
.advisor-step { display: none; }
.advisor-step.is-active { display: block; }
.advisor-step__title { margin-bottom: .8rem; }
.advisor-step__title h3 { margin: 0 0 .15rem; font-size: .96rem; font-weight: 800; color: #15253d; }
.advisor-step__title p { margin: 0; color: #6c788f; font-size: .82rem; }
.form-control, .note-input { width: 100%; min-width: 0; padding: .88rem .95rem; border: 1px solid #d9cfbf; border-radius: 13px; background: #fcfbf8; color: #15253d; }
.form-control:focus, .note-input:focus { outline: none; border-color: #ca8a04; box-shadow: 0 0 0 3px rgba(202,138,4,.12); background: #fff; }
.currency-field { position: relative; }
.currency-field span { position: absolute; top: 50%; inset-inline-start: .85rem; transform: translateY(-50%); color: #6b778b; font-weight: 700; }
.currency-field .form-control { padding-inline-start: 2.8rem; }
.preset-row, .option-grid, .choice-grid, .result-metrics, .quick-actions, .compare-grid, .compare-metrics, .scenario-row, .saved-inline-list, .saved-plan-card__chips, .saved-plan-card__actions { display: grid; gap: .65rem; }
.preset-row { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: .7rem; }
.preset-btn, .option-card, .step-btn, .submit-btn, .action-btn, .saved-load-btn, .auth-cta, .inline-link-btn, .view-details-btn { appearance: none; border: 0; border-radius: 13px; text-decoration: none; transition: .18s ease; cursor: pointer; }
.preset-btn { padding: .7rem .8rem; background: #f5efe4; border: 1px solid #eadfcb; color: #69552f; font-weight: 700; }
.preset-btn.is-active, .preset-btn:hover { background: #fff4d1; border-color: #d9ae49; color: #8a5d04; }
.option-grid, .choice-grid { grid-template-columns: 1fr; }
.option-card { position: relative; display: block; padding: .88rem .95rem; background: #fff; border: 1px solid #e9e1d3; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card__label { display: block; margin-bottom: .2rem; color: #182842; font-weight: 800; font-size: .9rem; }
.option-card__help { display: block; color: #6b778b; font-size: .8rem; }
.option-card.is-selected { border-color: #d4a63c; background: #fff9e8; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-top: .9rem; }
.step-btn, .saved-load-btn, .inline-link-btn, .action-btn, .view-details-btn { padding: .78rem .95rem; background: #f2f5f9; color: #1e304c; border: 1px solid #dbe3ee; font-weight: 800; text-align: center; }
.submit-btn, .auth-cta, .action-btn.is-primary { padding: .82rem .95rem; background: linear-gradient(135deg, #f1c541, #ca8a04); color: #0f172a; font-weight: 800; text-align: center; }

.result-hero-card { border-color: #ebd8a0; background: linear-gradient(180deg, #fffdf7 0%, #fff 100%); }
.result-hero-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .7rem; }
.result-kicker { color: #8a6f38; font-size: .74rem; font-weight: 800; margin-bottom: .15rem; }
.result-hero-card h2 { margin: 0; font-size: 1.06rem; color: #15253d; }
.result-price { color: #111f35; font-size: 1.12rem; font-weight: 900; white-space: nowrap; }
.result-price span { font-size: .78rem; color: #6f7c92; }
.result-plan { padding: .75rem .8rem; background: #fff6dd; border: 1px solid #f0d38c; border-radius: 13px; color: #20314d; font-weight: 800; margin-bottom: .75rem; }
.result-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
.result-metric { min-width: 0; padding: .72rem .75rem; background: #f8fafc; border: 1px solid #e3e9f1; border-radius: 13px; }
.result-metric:nth-child(1) { background: #fff8e8; border-color: #ecd190; }
.result-metric:nth-child(2) { background: #edf9f0; border-color: #c3dfcc; }
.result-metric:nth-child(3) { background: #eef6ff; border-color: #cfe0f6; }
.result-metric:nth-child(4) { background: #f8f5ff; border-color: #ddd2fb; }
.result-metric span { display: block; margin-bottom: .15rem; color: #6b778b; font-size: .75rem; }
.result-metric strong { display: block; color: #12213a; font-size: .86rem; line-height: 1.45; }

.alt-list-card { background: #fff; }
.alt-row-list { display: grid; gap: .65rem; }
.alt-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .78rem .8rem; border: 1px solid #eee6da; border-radius: 14px; background: #fcfbf8; }
.alt-row__main { min-width: 0; display: grid; gap: .18rem; }
.alt-row__main strong { color: #15253d; font-size: .88rem; }
.alt-row__main span { color: #6b778b; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.alt-row__meta { text-align: left; white-space: nowrap; display: grid; gap: .1rem; }
.alt-row__meta em { font-style: normal; color: #132238; font-size: .84rem; font-weight: 800; }
.alt-row__meta small { color: #75839a; font-size: .75rem; }

.details-toggle-card { padding: .75rem; }
.view-details-btn { width: 100%; }
.details-drawer { display: grid; gap: .9rem; }
.details-block { display: grid; gap: .7rem; }
.compare-grid--compact { grid-template-columns: 1fr; }
.compare-strategy { border: 1px solid #e9e1d3; border-radius: 14px; padding: .82rem; background: #fff; }
.compare-strategy__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; margin-bottom: .6rem; }
.compare-strategy__head h3 { margin: 0; font-size: .88rem; font-weight: 800; color: #132238; }
.compare-strategy__head p { margin: .15rem 0 0; color: #6b778b; font-size: .78rem; }
.compare-chip { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .2rem .5rem; font-size: .72rem; font-weight: 800; border: 1px solid transparent; }
.compare-chip.is-good { background: #edf9f0; border-color: #c3dfcc; color: #166534; }
.compare-chip.is-mid { background: #fff7e3; border-color: #ecd18c; color: #9a6700; }
.compare-chip.is-bad { background: #fff2f3; border-color: #efc4ca; color: #b42318; }
.compare-metrics--compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
.compare-metric { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: .65rem .7rem; background: #fafbfc; border: 1px solid #e5ebf2; border-radius: 13px; }
.compare-metric span { color: #6b778b; font-size: .75rem; }
.compare-metric strong { color: #132238; font-size: .8rem; text-align: left; }
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.components-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.components-table th, .components-table td { padding: .75rem .6rem; border-bottom: 1px solid #eee6da; text-align: right; font-size: .8rem; white-space: nowrap; }
.components-table th { background: #fbf7ef; color: #785f2a; font-weight: 800; }
.scenario-row { grid-template-columns: 1fr; }
.scenario-mini { border: 1px solid #e3e9f1; border-radius: 13px; background: #f9fbfd; padding: .7rem; }
.scenario-mini.is-up { background: #effaf2; border-color: #c6dfce; }
.scenario-mini.is-down { background: #fff5f6; border-color: #efc7cd; }
.scenario-mini__label { color: #7b5d1b; font-size: .75rem; font-weight: 800; margin-bottom: .15rem; }
.scenario-mini__value { color: #15253d; font-size: .82rem; }
.save-inline { display: grid; gap: .7rem; }
.details-actions__buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
.advisor-action-status { display: grid; gap: .25rem; border-radius: 12px; padding: .75rem .85rem; font-size: .82rem; font-weight: 700; }
.advisor-action-status.is-success { background: #edf9f0; color: #166534; border: 1px solid #c3dfcc; }
.advisor-action-status.is-error { background: #fff2f3; color: #b42318; border: 1px solid #efc4ca; }
.advisor-action-status.is-info { background: #f2f5f9; color: #1e304c; border: 1px solid #dbe3ee; }
.advisor-action-status__link a { color: inherit; text-decoration: underline; }

.saved-plans-panel { background: #fff; }
.saved-plans-panel__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.saved-inline-list { grid-template-columns: 1fr; }
.saved-plan-card { display: grid; gap: .7rem; padding: .95rem; border-radius: 16px; background: #fff; border: 1px solid #e8e5f0; box-shadow: 0 6px 18px rgba(19,31,54,.04); }
.saved-plan-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.saved-plan-card__title-wrap { min-width: 0; display: grid; gap: .12rem; }
.saved-plan-card__title-wrap strong { color: #15253d; font-size: .9rem; font-weight: 800; }
.saved-plan-card__title-wrap small { color: #75839a; font-size: .73rem; }
.saved-plan-card__amount { white-space: nowrap; color: #132238; font-weight: 900; font-size: .92rem; display: inline-flex; align-items: center; gap: .3rem; }
.saved-plan-card__amount::before { content: '💰'; font-size: .9rem; }
.saved-plan-card__summary { color: #5f6f84; font-size: .8rem; line-height: 1.65; background: #fcfbf8; border: 1px solid #eee6da; padding: .65rem .75rem; border-radius: 12px; }
.saved-plan-card__chips { grid-template-columns: repeat(2, minmax(0,1fr)); }
.saved-chip { display: inline-flex; align-items: center; justify-content: center; padding: .58rem .65rem; background: #fff; border: 1px solid #e3e9f1; border-radius: 12px; color: #40516a; font-size: .76rem; font-weight: 700; }
.saved-chip:nth-child(1) { background: #fff8e8; border-color: #ecd190; }
.saved-chip:nth-child(2) { background: #edf9f0; border-color: #c3dfcc; }
.saved-plan-card__actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
.saved-mini-btn { appearance: none; border: 1px solid #dbe3ee; background: #fff; color: #1e304c; border-radius: 11px; padding: .62rem .7rem; cursor: pointer; font-size: .78rem; font-weight: 800; }
.saved-mini-btn.is-danger { color: #b42318; border-color: #efc4ca; background: #fff4f5; }

.auth-gate-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .75rem; }
.auth-gate-actions a { flex: 1 1 150px; }
.disclaimer-panel { background: #fff9ea; border-color: #ebd8a0; }
.disclaimer-panel strong { display: block; margin-bottom: .2rem; color: #7b5d1b; }
.empty-state { color: #855b08; }
#loginPromptModal[hidden] { display: none !important; }
#loginPromptModal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15,23,42,.42); backdrop-filter: blur(4px); }
.login-modal { width: min(100%, 340px); padding: .95rem; background: #fff; border-radius: 16px; border: 1px solid #e9e1d3; box-shadow: 0 14px 40px rgba(15,23,42,.14); }
.login-modal h3 { margin: 0 0 .25rem; color: #15253d; font-size: .96rem; font-weight: 800; }
.login-modal p { margin: 0; color: #68758b; font-size: .84rem; }
.login-modal__actions { display: grid; gap: .6rem; margin-top: .85rem; }
@media (min-width: 640px) { .progress-steps { grid-template-columns: repeat(3, minmax(0,1fr)); } .option-grid, .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .preset-row { grid-template-columns: repeat(3, minmax(0,1fr)); } .alt-row__main span { white-space: nowrap; } .scenario-row { grid-template-columns: repeat(3, minmax(0,1fr)); } .saved-inline-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .progress-steps { grid-template-columns: repeat(6, minmax(0,1fr)); } .details-actions__buttons { grid-template-columns: repeat(2, minmax(0,1fr)); } .saved-inline-list { grid-template-columns: 1fr 1fr; } }
