/* Dorado Country Estates — calm, readable, forest-green theme with light and dark modes. */
:root {
  --brand: #1f3d34;
  --brand-strong: #163028;
  --brand-accent: #d4a85a;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --border: #dde3df;
  --border-strong: #c5cec9;
  --text: #17211d;
  --text-2: #4a5852;
  --muted: #6b7873;
  --link: #1f5b48;
  --mark: #fbe7b5;
  --focus: #2f7d63;
  --primary-bg: #1f3d34;
  --primary-fg: #ffffff;
  --primary-hover: #2a5245;
  --secondary-bg: #e3ece7;
  --secondary-fg: #1f3d34;
  --danger: #b3261e;
  --ok-bg: #e5f2ea;
  --ok-fg: #1d5a3c;
  --err-bg: #fbe9e7;
  --err-fg: #8f1f17;
  --shadow: 0 1px 2px rgba(20, 35, 30, 0.05), 0 4px 16px rgba(20, 35, 30, 0.05);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #2d5a4c; --brand-strong: #224539; --brand-accent: #e0b86c;
    --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --border: #27332e; --border-strong: #35443e;
    --text: #e5ece8; --text-2: #b8c4bf; --muted: #8e9c96; --link: #8fd0b4; --mark: #5a4a1f; --focus: #8fd0b4;
    --primary-bg: #8fd0b4; --primary-fg: #0d1f18; --primary-hover: #a9dec7;
    --secondary-bg: #213029; --secondary-fg: #cfe6db; --danger: #ff8a80;
    --ok-bg: #173226; --ok-fg: #a8e0c4; --err-bg: #3a1a17; --err-fg: #ffb4ab;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #2d5a4c; --brand-strong: #224539; --brand-accent: #e0b86c;
  --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --border: #27332e; --border-strong: #35443e;
  --text: #e5ece8; --text-2: #b8c4bf; --muted: #8e9c96; --link: #8fd0b4; --mark: #5a4a1f; --focus: #8fd0b4;
  --primary-bg: #8fd0b4; --primary-fg: #0d1f18; --primary-hover: #a9dec7;
  --secondary-bg: #213029; --secondary-fg: #cfe6db; --danger: #ff8a80;
  --ok-bg: #173226; --ok-fg: #a8e0c4; --err-bg: #3a1a17; --err-fg: #ffb4ab;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
mark { background: var(--mark); color: inherit; padding: 0 0.1em; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.page { flex: 1; padding-top: 32px; padding-bottom: 64px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { flex: none; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 400; white-space: nowrap; }
.brand-name strong { font-weight: 700; }
.brand-legal { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav > a { padding: 8px 14px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.main-nav > a:hover { background: var(--surface-2); color: var(--text); }
.main-nav > a.active { background: var(--secondary-bg); color: var(--secondary-fg); }
.nav-account-mobile { display: none; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.main-nav + .header-actions { margin-left: 8px; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
}
.nav-toggle { display: none; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 0.95rem;
}
.account-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
}
.account-who { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; font-size: 0.9rem; overflow-wrap: anywhere; }
.account-who span { color: var(--muted); }
.account-who .badge { align-self: flex-start; margin-top: 6px; color: var(--secondary-fg); }

/* ---------- buttons, forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; line-height: 1.2; transition: background-color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-bg); color: var(--secondary-fg); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 0.92rem; }
.field em { font-weight: 400; font-style: normal; }
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="date"], input[type="file"], input:not([type]), select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: 0.875rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.check-inline { align-self: end; padding-bottom: 12px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; font-size: 0.92rem; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 0.95rem; overflow-wrap: anywhere; }
.notice-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.notice-error { background: var(--err-bg); color: var(--err-fg); border-color: transparent; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--secondary-bg); color: var(--secondary-fg); vertical-align: middle; }

/* ---------- common blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.75rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--link); }
.lede { font-size: 1.1rem; color: var(--text-2); max-width: 46rem; }
.page-head { margin-bottom: 20px; }
.page-head .search-box { margin-top: 16px; }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; font-size: 0.92rem; }
.empty { padding: 22px; color: var(--muted); }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); text-decoration: none; font-size: 0.9rem; font-weight: 500; background: var(--surface); }
.pill:hover { border-color: var(--brand); color: var(--text); }
.pill.active { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }

/* search */
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px 6px 6px 14px; max-width: 680px; }
.search-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.search-box input { border: 0; padding: 8px 4px; min-height: 40px; background: transparent; box-shadow: none !important; }
.search-icon { color: var(--muted); display: inline-flex; }
.search-big { padding: 8px 8px 8px 18px; border-radius: 14px; box-shadow: var(--shadow); }
.search-big input { font-size: 1.05rem; }

/* ---------- home ---------- */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); margin-bottom: 12px; }
.ask-box {
  display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 26px 0 14px;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 16px;
  padding: 8px 8px 8px 18px; box-shadow: var(--shadow);
}
.ask-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 20%, transparent), var(--shadow); }
.ask-box-icon { color: var(--brand-accent); display: inline-flex; }
.ask-box input { border: 0; background: transparent; font-size: 1.1rem; min-height: 48px; padding: 8px 4px; box-shadow: none !important; }
.ask-box .btn { min-height: 48px; padding: 10px 24px; }
.hero-suggestions .chip { text-decoration: none; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.cat-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.cat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--secondary-bg); color: var(--secondary-fg); }
.cat-title { font-weight: 650; font-size: 1.05rem; margin-top: 4px; }
.cat-blurb { color: var(--text-2); font-size: 0.92rem; flex: 1; }
.cat-count { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-weight: 600; font-size: 0.9rem; }
.announcements { display: grid; gap: 14px; }
.announcement { padding: 20px 22px; }
.announcement header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.announcement h3 { margin: 0; font-size: 1.1rem; }
.announcement.pinned { border-left: 4px solid var(--brand-accent); }

/* doc lists */
.doc-list { list-style: none; margin: 0; padding: 4px 0; }
.doc-row + .doc-row { border-top: 1px solid var(--border); }
.doc-row a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px; text-decoration: none; color: var(--text); }
.doc-row a:hover { background: var(--surface-2); }
.doc-row-icon { color: var(--brand-accent); margin-top: 2px; flex: none; }
.doc-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.doc-row-title { font-weight: 600; }
.doc-row a:hover .doc-row-title { color: var(--link); text-decoration: underline; }
.doc-row-summary { color: var(--text-2); font-size: 0.92rem; }
.doc-row-meta { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }

.results { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.result { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.result-title { font-weight: 650; font-size: 1.05rem; }
.result-snippet { margin: 8px 0 0; color: var(--text-2); font-family: var(--serif); font-size: 1.02rem; }

/* ---------- document view ---------- */
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-aside { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; padding-bottom: 20px; }
.toc summary { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); cursor: pointer; padding: 6px 0; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform 0.15s; }
.toc[open] summary::after { transform: translateY(0) rotate(-135deg); }
.toc ol { list-style: none; margin: 6px 0 0; padding: 0; border-left: 2px solid var(--border); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: 0.9rem; line-height: 1.4; }
.toc li.toc-l3 a { padding-left: 28px; font-size: 0.85rem; }
.toc li a:hover { color: var(--text); }
.toc li a.current { border-left-color: var(--brand-accent); color: var(--text); font-weight: 600; }
.doc-main { max-width: 760px; }
.toc-mobile { display: none; }
.doc-header { padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.doc-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-find { display: flex; align-items: center; gap: 8px; margin-top: 16px; max-width: 420px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 10px; background: var(--surface); }
.doc-find input { border: 0; background: transparent; min-height: 40px; padding: 6px 2px; box-shadow: none !important; }
.doc-find mark.current { outline: 2px solid var(--brand-accent); }

/* Readable long-form text */
.prose { font-family: var(--serif); font-size: 1.125rem; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--sans); position: relative; scroll-margin-top: 90px; }
.prose h1 { font-family: var(--serif); font-size: 1.8rem; margin: 1.4em 0 0.6em; }
.prose h2 { font-size: 1.3rem; margin: 2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 0.4em; }
.prose h4 { font-size: 1rem; margin: 1.4em 0 0.3em; }
.prose > :first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: 0.3em 0; }
.prose blockquote { border-left: 4px solid var(--brand-accent); padding: 0.2em 0 0.2em 1em; color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose .anchor { position: absolute; left: -1.1em; width: 1em; color: var(--muted); opacity: 0; text-decoration: none; font-weight: 400; }
.prose h1:hover .anchor, .prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose-sm { font-size: 1rem; line-height: 1.65; }
.prose-sm h1, .prose-sm h2, .prose-sm h3 { font-size: 1.02rem; margin: 1em 0 0.4em; border: 0; padding: 0; }
.prose-sm > :last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; min-height: 260px; }
.chat-empty { margin: auto 0; }
.chat-scope { color: var(--text-2); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 0.9rem; text-align: left; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--brand); background: var(--surface-2); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-form textarea { min-height: 48px; max-height: 200px; resize: none; }
.chat-form .btn { min-height: 48px; }
.chat-foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 16px 14px; background: var(--surface); flex-wrap: wrap; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.msg-who { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.msg-user { align-self: flex-end; align-items: flex-end; max-width: 85%; }
.msg-user .msg-body { background: var(--primary-bg); color: var(--primary-fg); padding: 10px 14px; border-radius: 14px 14px 4px 14px; font-family: var(--sans); white-space: pre-wrap; }
.msg-user .msg-body p { margin: 0; }
.msg-assistant .msg-body { font-family: var(--serif); font-size: 1.05rem; line-height: 1.7; }
.msg-assistant .msg-body.streaming { white-space: pre-wrap; }
.msg-assistant .msg-body.streaming::after { content: "▍"; color: var(--brand-accent); animation: blink 1s steps(2) infinite; }
.msg-error { color: var(--err-fg); background: var(--err-bg); padding: 10px 14px; border-radius: 10px; font-size: 0.95rem; }
.thinking { display: inline-flex; gap: 5px; padding: 6px 0; }
.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: pulse 1.2s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
@keyframes blink { to { visibility: hidden; } }

.ask-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.doc-picker { padding: 18px; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.picker-head h2 { font-size: 1rem; margin: 0; }
.doc-picker fieldset { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.doc-picker legend { display: flex; justify-content: space-between; width: 100%; padding: 0 0 6px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.doc-picker legend .link-button { text-transform: none; letter-spacing: 0; }
.doc-picker .check { font-size: 0.92rem; line-height: 1.4; }
.ask-chat { overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 520px; }

/* drawer for chat on document pages */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 12, 0.45); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface);
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2); animation: slidein 0.18s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0.6; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.drawer-head .eyebrow { margin-bottom: 4px; }
.drawer .chat { flex: 1; }
body.drawer-open { overflow: hidden; }

/* ---------- auth ---------- */
body.auth .page { display: grid; place-items: start center; padding-top: 8vh; }
.auth-card { width: 100%; max-width: 460px; padding: 32px; }
.auth-card h1 { font-size: 1.8rem; }

/* ---------- admin ---------- */
.admin-nav { margin-bottom: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat-l { color: var(--text-2); font-size: 0.9rem; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th { text-align: left; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table th:first-child { border-top-left-radius: var(--radius); }
.data-table th:last-child { border-top-right-radius: var(--radius); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.inactive td { opacity: 0.6; }
.data-table .detail { max-width: 520px; overflow-wrap: anywhere; }
.data-table .ip { display: block; }
.event { display: inline-block; font-size: 0.82rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.event-login { background: var(--ok-bg); color: var(--ok-fg); }
.event-chat { background: color-mix(in srgb, var(--brand-accent) 22%, transparent); }
.event-admin { background: var(--secondary-bg); color: var(--secondary-fg); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-search { display: flex; gap: 8px; max-width: 420px; flex: 1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.split h2 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.filters { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 14px; margin-bottom: 16px; align-items: end; }
.filters-actions { grid-column: 1 / -1; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.danger-zone { margin-top: 18px; }
.announcement-admin { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.transcript { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.transcript .msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; max-width: 100%; align-self: stretch; align-items: stretch; }
.transcript .msg-user .msg-body { background: none; color: var(--text); padding: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; max-width: 1320px; }
.footer-inner > div:last-child { max-width: 380px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-aside { display: none; }
  .doc-main { max-width: none; }
  .toc-mobile { display: block; }
  .toc { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 14px; margin: 0 0 22px; background: var(--surface); }
  .ask-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-picker { position: static; max-height: 300px; }
  .ask-chat { height: 70vh; min-height: 460px; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 16px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav > a { padding: 12px 14px; border-radius: 10px; font-size: 1rem; }
  .nav-account-mobile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px 0; margin-top: 6px; border-top: 1px solid var(--border); font-size: 0.9rem; overflow-wrap: anywhere; }
  .nav-toggle { display: inline-grid; }
  .account-menu { display: none; }
  .header-actions { margin-left: auto !important; }
  .split, .grid-2 { grid-template-columns: 1fr; }
  .check-inline { padding-bottom: 0; }
}
@media (max-width: 560px) {
  .wrap, .wrap-wide { padding: 0 16px; }
  .page { padding-top: 22px; }
  .header-inner { gap: 10px; height: 62px; }
  .main-nav { top: 62px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 1rem; }
  .brand-legal { display: none; }
  .search-box { padding-left: 10px; }
  .search-box .btn { padding: 8px 12px; }
  .search-big input { font-size: 1rem; }
  .ask-box { padding-left: 12px; }
  .ask-box input { font-size: 1rem; }
  .ask-box .btn { padding: 10px 16px; }
  .doc-row a { padding: 14px 16px; flex-wrap: wrap; }
  .doc-row-meta { width: 100%; padding-left: 34px; }
  .doc-actions .btn { flex: 1 1 auto; }
  .prose { font-size: 1.06rem; line-height: 1.7; }
  .prose .anchor { display: none; }
  .filters { grid-template-columns: 1fr; }
  .chat-log { padding: 16px; }
  .chat-form { padding: 12px; }
  .msg-user { max-width: 92%; }
  .auth-card { padding: 24px 20px; }
  .data-table { font-size: 0.875rem; }
  .data-table td, .data-table th { padding: 10px; }
}

/* ---------- print: just the document ---------- */
@media print {
  :root { --text: #000; --bg: #fff; --surface: #fff; }
  .site-header, .site-footer, .doc-aside, .doc-actions, .doc-find, .drawer, .skip-link { display: none !important; }
  .doc-layout { display: block; }
  .prose { font-size: 11.5pt; }
  .prose .anchor { display: none; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- owner contact forms ---------- */
.account-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.contact-form { gap: 22px; }
.form-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.form-group legend { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 0 0 4px; }
.form-group p { margin: -4px 0 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 14px; }
.req { color: var(--danger); font-style: normal; }
.field-error { color: var(--err-fg); font-style: normal; font-size: 0.85rem; font-weight: 500; }
.has-error input { border-color: var(--danger); }
.is-missing input { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 8%, var(--surface)); }
.notice-warn { background: color-mix(in srgb, var(--brand-accent) 18%, var(--surface)); border-color: transparent; }
.prop-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.prop-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.prop-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.prop-addr { font-weight: 500; }
.prop-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; }
.missing-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--brand-accent) 25%, transparent); }
.ok-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--ok-bg); color: var(--ok-fg); }
.owners-table td { font-size: 0.88rem; }
.prop-row-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) auto; gap: 8px; align-items: center; }
.prop-row-form input, .prop-row-form select { min-height: 36px; padding: 6px 10px; font-size: 0.88rem; }
.nav-mobile-only { display: none; }
@media (max-width: 1000px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .nav-mobile-only { display: block; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .prop-row-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .phone-row { grid-template-columns: minmax(0, 1fr) 120px; }
}
