/* Phone first. Big tap targets (at least 48px), one column, high contrast. */
:root {
  --ink: #17202a; --muted: #5b6672; --line: #dde3e8; --bg: #f5f7f9; --card: #fff;
  --brand: #0f3d5e; --call: #1b7f3b; --text: #1f5fbf; --email: #6b3fa0; --done: #3d4a56;
  --warn: #a5460b; --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); padding-bottom: 76px; }
body.public { padding-bottom: 0; }
a { color: var(--text); }
h1 { font-size: 1.6rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.page { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }
.page.narrow { max-width: 480px; padding-top: 16px; }
.sub { color: var(--muted); font-size: .9rem; display: block; }
.warn { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); padding: 1rem 0; }
.count { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 .55em; font-size: .85rem; vertical-align: middle; }
.lead-text { font-size: 1.15rem; }
.fine { font-size: .8rem; color: var(--muted); }

/* Top and bottom bars */
.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--brand); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 5; }
.topbar .brand { color: #fff; text-decoration: none; font-weight: 700; }
.topbar .who { font-size: .9rem; opacity: .9; margin: 0; }
.linkish { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; padding: 8px 0 8px 6px; cursor: pointer; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar a { flex: 1; text-align: center; padding: 16px 4px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.tabbar a.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }

/* Flash messages */
.flash p { margin: 12px 16px 0; padding: 12px 14px; border-radius: 10px; background: #e8f4ec; }
.flash .flash-error, .flash .flash-warning { background: #fdecea; }

/* Cards and buttons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card-head { display: block; color: inherit; text-decoration: none; margin-bottom: 12px; }
.card-head strong { font-size: 1.15rem; display: block; }
.card .why { display: block; color: var(--warn); font-weight: 600; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.actions.big .btn { min-height: 60px; font-size: 1.1rem; }
.actions.stacked { grid-template-columns: 1fr; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 14px; border: 0; border-radius: 12px;
       font: inherit; font-weight: 700; color: #fff; background: var(--brand); text-decoration: none; cursor: pointer; }
.btn.call { background: var(--call); } .btn.text { background: var(--text); } .btn.email { background: var(--email); }
.btn.done { background: var(--done); } .btn.handoff { background: var(--warn); width: 100%; margin-top: 10px; }
.btn.small { min-height: 44px; font-size: .95rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:active { transform: scale(.98); }

/* Lists, panels, forms */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; margin: 14px 0; }
.list, .plain { list-style: none; margin: 0; padding: 0; }
.list li a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e8edf2; color: var(--ink); }
.stage-new { background: #fff1d6; } .stage-nurture { background: #e3f0ff; } .stage-client { background: #e2f6e7; }
.stage-under_contract { background: #ffe3d3; } .stage-past_client { background: #efe6fa; }
.tag { display: inline-block; font-size: .8rem; background: #eef1f4; border-radius: 6px; padding: 2px 8px; margin: 0 4px 4px 0; }
.lead-head h1 { margin-bottom: .2rem; }
.contact-lines { margin: .6rem 0; }
blockquote { margin: .4rem 0; padding: .4rem .8rem; border-left: 3px solid var(--line); color: var(--muted); }
input, select, textarea { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #c4ccd4; border-radius: 10px; background: #fff; }
textarea { min-height: 80px; }
.stack { display: grid; gap: 10px; margin: 10px 0; }
.stack label { display: grid; gap: 4px; font-weight: 600; }
.stack label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.stack label.check input { width: 24px; min-height: 24px; height: 24px; }
.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.row select { flex: 1; min-width: 160px; }
.search { display: grid; gap: 8px; margin-bottom: 14px; }
details summary { cursor: pointer; color: var(--text); padding: 10px 0; font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.errorlist { color: var(--warn); margin: 0; padding-left: 1rem; }
.hero { width: 100%; border-radius: var(--radius); }

/* Activity feed */
.feed { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed p { margin: 2px 0; }
.feed .dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa5b1; margin-top: 7px; }
.kind-listing_saved .dot, .kind-showing_request .dot, .kind-info_request .dot { background: var(--warn); }
.kind-email_in .dot, .kind-text_in .dot { background: var(--call); }
.kind-email_out .dot, .kind-text_out .dot, .kind-call .dot { background: var(--text); }
.kind-note .dot { background: var(--email); }

/* Open house QR sheet */
.qr-sheet { text-align: center; padding: 24px 0; }
.qr { display: inline-block; padding: 16px; background: #fff; border-radius: var(--radius); margin: 12px 0; }
@media print { .topbar, .tabbar, .no-print, .flash { display: none !important; } body { background: #fff; } .qr-sheet h1 { font-size: 2.4rem; } }

@media (min-width: 720px) { .search { grid-template-columns: 2fr 1fr; } }

/* Office sign-in-as banner and office tables */
.visitbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between;
            background: #fdecea; border-bottom: 2px solid var(--warn); padding: 10px 16px; font-size: .95rem; position: sticky; top: 52px; z-index: 4; }
.tablewrap { overflow-x: auto; }
.table td.btns { white-space: nowrap; }
.table td.btns .btn { margin: 2px 4px 2px 0; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Person page: transaction path and feed filter */
.deal .next { margin: .4rem 0; }
.path { list-style: none; margin: 8px 0 0; padding: 0; }
.path li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 6px 0; }
.path .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #9aa5b1; margin-top: 6px; }
.path .ms-done .dot { background: var(--call); border-color: var(--call); }
.path .ms-next .dot { background: var(--warn); border-color: var(--warn); }
.path .ms-upcoming b { font-weight: 500; color: var(--muted); }
.pills { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.pills a { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 600; }
.pills a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.inboxnote { display: block; text-decoration: none; color: inherit; border-color: var(--warn); }

/* Texting allowance meter on Today */
.meter .bar { height: 8px; background: var(--line); border-radius: 999px; margin: 8px 0 6px; overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: var(--call); }
.meter.near .bar span { background: #c98a0b; }
.meter.over .bar span { background: var(--warn); }
.meter.over strong { color: var(--warn); }

/* My website: the look picker */
.looks{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:8px}
.look-pick{display:grid;gap:4px;padding:10px;border:1px solid var(--line);border-radius:12px;cursor:pointer}
.look-pick:has(input:checked){border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.look-pick input{position:absolute;opacity:0}
.pal-sw{display:flex;height:44px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}.pal-sw i{flex:1}.pal-sw i:first-child{flex:2}
.look-ph{display:block;aspect-ratio:16/10;border-radius:8px;background:center/cover no-repeat var(--line)}
.row2{display:grid;grid-template-columns:90px 1fr;gap:8px}
