/* BUI Estate Advisor website. BUI Brandline: orange #D9861C, grey #535657, Calibri. */
:root {
  color-scheme: light;
  --bui-orange: #D9861C;
  --bui-orange-dark: #A9640F;
  --bui-grey: #535657;
  --bui-grey-dark: #3F4244;
  --bg: #F6F5F3;
  --panel: #FFFFFF;
  --fg: #1F2223;
  --muted: #5F6466;
  --line: #E2DFDA;
  --ok: #2E7D32;
  --warn: #A35F00;
  --bad: #C62828;
  --tint: #FBF0E2;
  --tint-strong: #F4D5AC;
  --grey-tint: #ECEBE9;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .10);
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
a { color: var(--bui-orange-dark); }
a:hover { color: var(--bui-orange); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--bui-orange); outline-offset: 2px; }
#app:focus, #app:focus-visible { outline: none; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header */
.site-head { background: var(--panel); border-bottom: 3px solid var(--bui-orange); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--fg); flex: none; overflow: hidden; width: 155px; }
.brand-bui { width: 200px; height: auto; display: block; flex-shrink: 0; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: none; }
.nav:empty { display: none; }
.nav-signin { background: none; border: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--fg); padding: 6px 8px; }
.nav-signin:hover { color: var(--bui-orange); }
.avatar-wrap { position: relative; }
.avatar-btn { background: none; border: none; cursor: pointer; padding: 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.avatar-btn:focus-visible { outline: 2px solid var(--bui-orange); outline-offset: 2px; }
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; background: #0078d4; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; user-select: none; letter-spacing: .02em; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-drop { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,.12); z-index: 200; overflow: hidden; }
.avatar-wrap:focus-within .avatar-drop { display: block; }
.avatar-drop-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.avatar-drop-info { display: grid; gap: 2px; min-width: 0; overflow: hidden; }
.avatar-drop-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-drop-info span { font-size: 12px; color: var(--muted); }
.avatar-drop-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: none; background: none; cursor: pointer; font: inherit; font-size: 14px; color: var(--fg); }
.avatar-drop-item:hover { background: var(--bg); }
@media (max-width: 768px) {
  .brand-bui { width: 160px; }
  .nav { flex-basis: 100%; margin-left: 0; justify-content: center; }
}
.nav a, .nav .link { color: var(--fg); text-decoration: none; font-weight: 600; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav .link:hover { background: var(--grey-tint); }
.who { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.who b { color: var(--fg); display: block; font-size: 14px; }
.nav .who + .btn { margin-left: 2px; }
.mode-banner { background: var(--bui-grey); color: #fff; font-size: 13px; }
.mode-banner .wrap { padding-block: 6px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mode-banner b { color: var(--tint-strong); }

/* Buttons */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 10px 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--bui-orange); color: var(--fg); }
.btn.primary { background: var(--bui-orange); border-color: var(--bui-orange); color: #fff; }
.btn.primary:hover { background: var(--bui-orange-dark); border-color: var(--bui-orange-dark); color: #fff; }
.btn.dark { background: var(--bui-grey); border-color: var(--bui-grey); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

main { padding-block: 28px 48px; }
.stack { display: grid; gap: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 16px; }
.note { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--bui-orange-dark); font-weight: 700; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

/* Landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-block: 24px 8px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; line-height: 1.15; }
.hero h1 .h1-main { font-family: 'Poppins', sans-serif; font-weight: 800; letter-spacing: -0.02em; display: block; }
.hero h1 .h1-sub { font-family: 'Poppins', sans-serif; font-weight: 700; font-style: italic; display: block; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 44ch; }
.hero .strap { font-weight: 700; color: var(--bui-grey); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-wordmark { font-size: clamp(36px, 4.8vw, 56px); font-weight: 700; letter-spacing: -0.01em; line-height: 1; margin: 0; }
.wm-estate { color: var(--fg); }
.wm-advisor { color: var(--bui-orange); }
.hero-visual { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; margin-top: 72px; }
.hero-m365 { width: clamp(240px, 110%, 420px); height: auto; display: block; mix-blend-mode: multiply; margin-left: -14px; }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } }
.feature { border-top: 3px solid var(--bui-orange); }
.feature b { font-size: 17px; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; }
.step::before { counter-increment: s; content: counter(s); width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--bui-orange); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.checklist { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.illustration { position: relative; margin-left: 32px; align-self: stretch; }
.illustration .tag { position: absolute; top: 10px; right: 12px; z-index: 1; font-size: 12px; background: #fff; color: var(--muted); border-radius: 999px; padding: 2px 10px; border: 1px solid var(--line); }

/* Value card and KPIs (same language as the example report) */
.value { background: var(--bui-grey); color: #fff; border-radius: var(--radius); padding: 24px; display: grid; gap: 8px; align-content: center; position: relative; overflow: hidden; }
.value::after { content: ""; position: absolute; right: -48px; top: -48px; width: 150px; height: 150px; border-radius: 50%; border: 20px solid rgba(217, 134, 28, .45); z-index: 0; }
.value > * { position: relative; z-index: 1; }
.value .label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #f3c58a; font-weight: 700; }
.value .big { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 700; line-height: 1; }
.value .big small { font-size: .38em; font-weight: 600; color: #e9e9e9; margin-left: 6px; }
.value .year { font-size: 17px; }
.value .year b { color: #f3c58a; }
.value .foot { font-size: 13px; color: #dcdcdc; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; align-content: start; }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .n { font-size: 2rem; font-weight: 700; line-height: 1.05; }
.kpi .n.date { font-size: 1.4rem; }
.kpi .n .of { font-size: .5em; color: var(--muted); font-weight: 600; }
.kpi .f { font-size: 13px; color: var(--muted); line-height: 1.4; }
.meter { height: 6px; border-radius: 3px; background: var(--grey-tint); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--bui-orange); width: 0; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.report-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 860px) { .report-hero { grid-template-columns: 1fr; } }

/* Report header and tabs */
.report-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.report-head h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { appearance: none; border: 0; background: none; color: var(--muted); padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; font-weight: 700; margin-bottom: -1px; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--bui-orange); }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--tint); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; line-height: 1.45; border: 1px solid var(--tint-strong); }
.banner.grey { background: var(--grey-tint); border-color: var(--line); }
.banner.warn { background: #FFF4E5; border-color: #F0C27A; }
.banner .i { font-weight: 700; color: var(--bui-orange-dark); }
.cta { background: var(--bui-grey); color: #fff; border-radius: var(--radius); padding: 22px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta p { max-width: 70ch; }
.cta b { color: #f3c58a; }

/* Bars */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-a { background: var(--bui-orange); }
.sw-i { background: var(--tint-strong); }
.sw-f { background: var(--grey-tint); border: 1px dashed #c9c4bc; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 4px; }
.bar-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 13px; }
.bar-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top span { color: var(--muted); }
.track { position: relative; height: 14px; border-radius: 7px; background: var(--grey-tint); overflow: hidden; }
.track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.track > i.a { background: var(--bui-orange); }
.track > i.s { background: var(--tint-strong); }
.reason { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.reason .b { height: 22px; border-radius: 4px; background: var(--bui-orange); min-width: 2px; }
.reason .v { font-weight: 700; white-space: nowrap; }
.reason .v small { color: var(--muted); font-weight: 400; margin-left: 4px; }
@media (max-width: 520px) { .reason { grid-template-columns: 1fr auto; } .reason .b { grid-column: 1 / -1; grid-row: 2; } }
.stackbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stackbar > i { display: block; min-width: 3px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 12px; }

/* Tables */
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table-wrap.free { max-height: none; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 700; padding: 9px 10px; border-bottom: 2px solid var(--bui-orange); white-space: nowrap; z-index: 1; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th.num, td.num { text-align: right; }
th .th-btn { all: unset; cursor: pointer; }
th .th-btn:focus-visible { outline: 2px solid var(--bui-orange); outline-offset: 2px; }
#app:focus, #app:focus-visible { outline: none; }
th[aria-sort="ascending"] .th-btn::after { content: " \25B2"; font-size: .8em; color: var(--bui-orange); }
th[aria-sort="descending"] .th-btn::after { content: " \25BC"; font-size: .8em; color: var(--bui-orange); }
tbody tr:hover td { background: var(--tint); }
td.strong { font-weight: 700; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--grey-tint); color: var(--fg); }
.pill.ok { background: #E3F1E4; color: var(--ok); }
.pill.warn { background: #FCEBD3; color: var(--warn); }
.pill.bad { background: #F9E0E0; color: var(--bad); }
.pill.brand { background: var(--tint-strong); color: var(--fg); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters label, .field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
input[type="search"], input[type="text"], select, input[type="file"], textarea { color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; max-width: 100%; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--fg) !important; font-weight: 600 !important; }

/* Recommendations */
.recs { display: grid; gap: 14px; }
.rec { display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 14rem); gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.rec-id { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--bui-orange); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rec-body { display: grid; gap: 8px; min-width: 0; }
.rec-title { font-size: 18px; font-weight: 700; }
.rec-detail { max-width: 76ch; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-side { display: grid; gap: 4px; justify-items: end; text-align: right; align-content: start; }
.rec-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.rec-val.muted { font-size: 15px; color: var(--muted); }
.rules { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; font-weight: 600; }
.rule-chip:hover { border-color: var(--bui-orange); }
details.rule { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--bg); }
details.rule summary { cursor: pointer; font-weight: 700; }
ul.checks { margin: 0; padding-left: 1.2em; font-size: 14px; }
@media (max-width: 760px) { .rec { grid-template-columns: 2.8rem minmax(0, 1fr); } .rec-side { grid-column: 2; justify-items: start; text-align: left; } }

/* AI */
.ai-card { border-left: 4px solid var(--bui-grey); }
.ai-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.ai-label b { color: var(--bui-grey); }
.major { background: #FFF4E5; border: 1px solid #F0C27A; border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.feedback { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* Scan progress */
.progress-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.progress-list li { display: flex; gap: 12px; align-items: center; }
.progress-list .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.progress-list li.done .dot { background: var(--bui-orange); border-color: var(--bui-orange); color: #fff; }
.progress-list li.now .dot { border-color: var(--bui-orange); color: var(--bui-orange-dark); }
.progress-list li.now { font-weight: 700; }
.bigbar { height: 10px; border-radius: 5px; background: var(--grey-tint); overflow: hidden; }
.bigbar > i { display: block; height: 100%; background: var(--bui-orange); width: 0; transition: width .6s ease; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(31, 34, 35, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 560px; width: 100%; padding: 22px; display: grid; gap: 14px; max-height: calc(100vh - 32px); overflow: auto; }
.modal.wide { max-width: 860px; }
.quote { border-left: 3px solid var(--line); padding: 4px 10px; font-size: 14px; line-height: 1.45; }
.quote.found { border-left-color: var(--ok); }
.quote.missing { border-left-color: var(--bad); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
textarea { font: inherit; }
.persona { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); cursor: pointer; }
.persona:hover { border-color: var(--bui-orange); }
.persona b { font-size: 16px; }
.persona span { font-size: 13px; color: var(--muted); grid-column: 1; }

.consent-text { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-height: 320px; overflow: auto; font-size: 14px; display: grid; gap: 8px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--bui-grey); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 30; max-width: calc(100% - 32px); }
.error { color: var(--bad); font-weight: 700; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

.site-foot { border-top: 1px solid var(--line); background: var(--panel); }
.site-foot .wrap { padding-block: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: 13px; color: var(--muted); }

@media print {
  .site-head .nav, .tabs, .filters, .mode-banner, .btn, .site-foot { display: none !important; }
  .site-head .nav { display: none !important; }
  body { background: #fff; }
  .value { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .meter > i, .bigbar > i { transition: none; } }
.narrow { max-width: 720px; margin-inline: auto; }
