:root {
  color-scheme: light;
  --ink: #1f1f1f;
  --muted: #444746;
  --line: #dde3ea;
  --line-strong: #7c8794;
  --paper: #ffffff;
  --bg: #f8fafd;
  --surface: #f0f4f9;
  --brand: #0b57d0;
  --brand-hover: #0842a0;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fe;
  --accent: #c2410c;
  --error: #b42318;
  --error-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff5db;
  --ok: #137333;
  --radius: 12px;
  --gutter: clamp(20px, 4vw, 48px);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 94px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.3; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 11; padding: 8px 12px; background: var(--paper); }
.skip-link:not(:focus) { clip-path: inset(50%); }

/* Language: zh mode shows Chinese + the official English term; en mode shows only English. */
.lang-en .zh { display: none !important; }
/* French: translated .zh text is shown; untranslated .zh falls back to the English .term / en-only twin. */
.lang-fr .zh.fr-miss { display: none !important; }
.lang-fr .term { display: none !important; }
.lang-fr .zh.fr-miss ~ .term { display: revert !important; }
.lang-fr .zh:not(.fr-miss) ~ .en-only { display: none !important; }
.lang-zh .en-only, .lang-en .fr-only, .lang-zh .fr-only { display: none !important; }
/* In French, an English span that has a French twin right after it is hidden; untranslated English stays visible. */
.lang-fr .en-only:has(+ .fr-only) { display: none !important; }

.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- header / footer ---------- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.brand-text { font-weight: 700; font-size: 20px; letter-spacing: -.03em; }
.brand-text small { color: var(--brand); font-size: inherit; }
.topnav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 32px); }
.topnav a:not(.btn) { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.topnav a:not(.btn):hover { color: var(--brand); text-decoration: underline; }
.footer { margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--surface); }

/* ---------- buttons ---------- */
.btn, .btn-secondary, .btn-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; padding: 8px 18px; }
.btn { background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); }
.btn:hover:not(:disabled):not(.btn-secondary) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--surface); }
.btn-small { min-height: 40px; padding: 4px 14px; font-size: 14px; }
.btn-large { min-height: 50px; padding: 10px 20px; font-size: 16px; }
.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.btn-chip { min-height: 34px; padding: 4px 12px; font-size: 14px; font-weight: 500; background: var(--brand-soft); color: var(--ink); border: 1px solid var(--line); }

/* ---------- landing ---------- */
.hero { padding: 80px 0 64px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 4.5vw, 64px); align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; margin: 0 0 16px; }
.eyebrow::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.hero h1 { font-size: clamp(36px, 4.2vw, 60px); line-height: 1.12; letter-spacing: -.04em; margin: 0 0 18px; }
.hero h1 span { display: block; color: var(--brand); }
.lead { font-size: 18px; color: var(--muted); max-width: 66ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; list-style: none; color: var(--muted); font-size: 13px; margin: 24px 0 0; }
.hero-trust li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 6px; }
.lease-preview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview-head, .preview-caption { background: var(--surface); padding: 18px 24px; }
.preview-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.preview-head h2 { font-size: 17px; margin: 0 0 4px; }
.preview-head p, .preview-caption { margin: 0; color: var(--muted); font-size: 13px; }
.preview-badge { color: var(--brand-hover); background: var(--brand-soft); padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.preview-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 18px 24px; }
.preview-list li { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.preview-list li div span { display: block; font-size: 13px; color: var(--muted); }
.preview-number { flex: none; display: grid; place-items: center; width: 38px; height: 38px; background: var(--brand-soft); border-radius: 6px; color: var(--brand-hover); font-weight: 700; }
.preview-caption { border-top: 1px solid var(--line); padding-block: 12px; }
.feature-band { background: var(--surface); border-block: 1px solid var(--line); padding: 56px 0; }
.feature-band h2 { margin: 0; text-align: center; font-size: clamp(26px, 3vw, 36px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.card h3 { font-size: 18px; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); }
.facts, .faq { margin-top: 40px; }
.facts ol { padding-left: 20px; }
.facts li { margin-bottom: 10px; }
.verified { font-size: 13px; color: var(--muted); }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.cta { text-align: center; margin-top: 40px; }
.cta-panel { padding: 28px 16px; background: var(--brand-soft); border: 1px solid #c9dcfa; border-radius: var(--radius); }
.prose { max-width: 760px; padding-top: 32px; }
.prose small { color: var(--muted); font-weight: 400; }

/* ---------- wizard ---------- */
.wizard-heading, .wizard { max-width: 1200px; }
.wizard-heading { padding-top: 40px; }
.wizard-heading .eyebrow { margin-bottom: 8px; }
.wizard-heading h1 { font-size: clamp(26px, 4vw, 38px); margin: 0; }
.wizard { margin: 24px auto 0; padding-inline: var(--gutter); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.wizard-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); width: max-content; }
.lang-toggle button { border: none; background: transparent; padding: 6px 14px; font: inherit; cursor: pointer; color: var(--muted); }
.lang-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; }
.steps button { width: 100%; text-align: left; background: none; border: none; font: inherit; color: var(--muted); padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.steps button::before { content: counter(step) ". "; }
.steps li.current button { background: var(--brand-soft); color: var(--brand-hover); font-weight: 700; }
.steps li.has-errors button { color: var(--error); }
.draft-box { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.draft-box p { margin: 0 0 6px; }

.wizard-main { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); transition: width .3s; }
.progress-text { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.step h2 { font-size: 21px; margin: 28px 0 8px; }
.step h2:first-child { margin-top: 12px; }
.step h3 { font-size: 16px; margin: 22px 0 6px; }
.term { color: var(--muted); font-weight: 400; font-size: .82em; }
.lang-zh .term { margin-left: 8px; }
.lang-zh h2 .term, .lang-zh h3 .term { display: block; margin-left: 0; }
.lang-en .term, .lang-fr .term { color: inherit; font-size: inherit; font-weight: inherit; }
.intro { color: var(--muted); margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid .wide-2 { grid-column: span 2; }
.grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; border: none; padding: 0; min-width: 0; }
.field.wide { width: 100%; }
.lbl { font-weight: 600; font-size: 15px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 11px; width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field.check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field.check input { margin-top: 5px; width: 18px; height: 18px; }
.hint { font-size: 13px; color: var(--muted); display: block; }
p.hint { margin: 4px 0 8px; }
.err { font-size: 13px; color: var(--error); font-weight: 600; }
.err:empty { display: none; }
.err.warn { color: var(--warn); font-weight: 500; }

fieldset.choice legend { padding: 0; margin-bottom: 4px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; background: var(--paper); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt input { accent-color: var(--brand); margin: 0; }
.opt .term { margin-left: 4px; }

.list .items { display: flex; flex-direction: column; gap: 8px; }
.list-item { border: 1px dashed var(--line); border-radius: 8px; padding: 4px 12px; position: relative; }
.list-item.row-2 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 12px; align-items: end; }
.list-item .remove { font-size: 13px; margin: 0 0 18px; }
.list-item:not(.row-2) .remove { position: absolute; top: 10px; right: 12px; }
.list-item [data-err-item] { grid-column: 1 / -1; margin-bottom: 6px; }
.list [data-add] { margin-top: 10px; }
.total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 16px; }
.total strong { font-size: 20px; margin-left: auto; }
details.sub { margin: 10px 0; }
details.sub summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

.note { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin: 20px 0; font-size: 14px; }
.note p { margin: 0; }
.note.warn { background: var(--warn-soft); }

.clauses { display: flex; flex-direction: column; gap: 10px; }
.clause { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.clause:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.clause input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.clause-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.clause-title { font-weight: 700; }
.clause-text { font-size: 14px; }
.clause-zh { font-size: 14px; color: var(--muted); }
.clause-why { font-size: 13px; color: var(--muted); }
.basis { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-weight: 600; color: var(--ink); }
.badge { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 6px; }

.issues { background: var(--error-soft); border-radius: 8px; padding: 10px 14px; margin: 14px 0; color: var(--error); font-size: 14px; }
.issues p { margin: 2px 0; }
#final-issues { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
#final-issues h3 { font-size: 15px; margin: 6px 0; }
#final-issues h3.error { color: var(--error); }
#final-issues h3.warn { color: var(--warn); }
#final-issues ul { margin: 0 0 8px; padding-left: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
#pdf-preview { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; background: #fff; }
.next-steps, .email-box { border-top: 1px solid var(--line); margin-top: 20px; }
.email-status { font-weight: 600; }
.email-status.ok { color: var(--ok); }
.email-status.error { color: var(--error); }
.step-nav { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.step-nav #btn-next { margin-left: auto; }

@media (max-width: 960px) {
  .hero { padding: 48px 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .lease-preview { width: 100%; max-width: 760px; }
}

@media (max-width: 820px) {
  .wizard { grid-template-columns: 1fr; margin-top: 12px; }
  .wizard-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .steps { display: none; }
  .draft-box { border-top: none; padding-top: 0; flex: 1 1 200px; min-width: 0; }
  .wizard-main { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .grid .wide-2 { grid-column: auto; }
  .list-item.row-2 { grid-template-columns: 1fr; }
  .list-item.row-2 .remove { margin: 0 0 8px; justify-self: start; }
}

@media (max-width: 640px) {
  .topbar-inner { min-height: 64px; }
  .brand { gap: 7px; }
  .brand-text { font-size: 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .topnav .section-link { display: none; }
  .topnav .btn-small { padding-inline: 8px; font-size: 13px; }
  .hero h1 { font-size: clamp(30px, 8.5vw, 44px); }
  .lang-zh .hero h1 { font-size: clamp(26px, 7.4vw, 44px); text-wrap: balance; }
  .lead { font-size: 16px; }
  .preview-head, .preview-list, .preview-caption { padding-inline: 14px; }
  .feature-band { padding: 40px 0; }
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .wizard-heading { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}

/* ---------- Canadian Living & Real Estate Suite ---------- */
.suite-bar { margin-top: 64px; background: var(--paper); border-top: 1px solid var(--line); }
.suite-bar + .footer { margin-top: 0; }
.suite-details { padding: 14px 0; }
.suite-title { font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; margin-bottom: 10px; }
.suite-title::-webkit-details-marker { display: none; }
.suite-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.suite-links a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); text-decoration: none; background: var(--paper); }
.suite-links a:hover { border-color: var(--brand); color: var(--brand); }
.suite-links a.is-current { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.suite-about { color: var(--muted); }
.more-tools .suite-title { margin: 14px 0 6px; color: var(--ink); cursor: default; pointer-events: auto; }
.more-tools-list { margin: 0; padding: 0 0 14px; list-style: none; font-size: 14px; color: var(--muted); }
.more-tools-list li { padding: 3px 0; }
.more-tools-list a { color: var(--ink); overflow-wrap: anywhere; }
.more-tools-list a:hover { color: var(--brand); }
.brand-line { margin-bottom: 0; }

/* Guides, FAQ and pricing pages */
.article { max-width: 780px; padding-top: 28px; }
.article h1 { font-size: clamp(26px, 4vw, 36px); margin: 8px 0 8px; }
.article h2 { font-size: 21px; margin: 32px 0 10px; }
.article h3 { font-size: 17px; margin: 22px 0 6px; }
.breadcrumb { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.article-meta { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.answer-box { border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 0 0 24px; }
.answer-box p { margin: 6px 0 0; }
.article-body { font-size: 16px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article-body th { background: var(--surface); }
.article-body blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.article-body code { background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.article-cta, .article-journey { margin: 28px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.article-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-color: var(--brand); background: var(--brand-soft); }
.article-cta p { margin: 0; flex: 1 1 300px; }
.article-journey ul { margin: 8px 0 0; padding-left: 20px; }
.article-sources ul, .article-related ul { padding-left: 20px; }
.disclaimer { margin-top: 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.guide-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.guide-list li { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.guide-list a { font-weight: 600; font-size: 17px; }
.guide-list span { color: var(--muted); font-size: 14px; }
.guide-list small { color: var(--muted); font-size: 12px; }

.guide-link { margin: -2px 0 10px; font-size: 14px; }

/* ChkLease scan call-to-action (home pages) */
.scan-cta { margin-top: 32px; }
.scan-cta-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--brand-soft); }
.scan-cta-text { margin: 0; flex: 1 1 320px; font-size: 16px; color: var(--ink); }

/* Landlord journey progress (lease result page) */
.journey { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.journey-title { font-size: 15px; margin: 0 0 14px; }
.journey-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: none; }
.journey-track li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.journey-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 1px solid var(--line-strong); background: var(--paper); }
.journey-track .is-done .journey-num { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.journey-track .is-current .journey-num { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.journey-track .is-current { color: var(--ink); font-weight: 600; }
.journey-next { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--paper); color: var(--muted); font-size: 14px; text-decoration: none; }
.journey-next strong { color: var(--ink); font-size: 16px; }
.journey-next:hover strong { color: var(--brand); }
.journey-kicker { color: var(--brand); font-size: 13px; font-weight: 600; }
.journey-prev { margin: 12px 0 0; font-size: 14px; }

@media (max-width: 640px) {
  .suite-bar { margin-top: 40px; }
  .suite-title { cursor: pointer; list-style: revert; margin-bottom: 0; }
  .suite-details[open] .suite-title { margin-bottom: 10px; }
  .journey-track { grid-template-columns: repeat(7, 28px); justify-content: space-between; }
  .journey-track .journey-label { display: none; } /* numbers only on phones; the heading names the current step */
}
@media (min-width: 641px) {
  /* Always expanded on wider screens: the heading is a label, not a toggle. */
  .suite-title { pointer-events: none; }
}
