/* Account menu, footer theme switch, Settings, lead profile, timeline and email compose.
   Colors come from the page's own variables (site.css or app/app.css), so Day and Night both work. No orange fills. */
.am { position: relative; display: inline-flex; }
.am-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 260px; padding: 3px 10px 3px 3px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
.am-btn:hover { border-color: var(--ghost-line, var(--muted)); }
.am-btn:focus-visible, .am-item:focus-visible, .am-theme button:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
.am-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  letter-spacing: .02em; background: var(--chip, var(--line)); color: var(--ink); }
.am-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.am-caret { font-size: 11px; color: var(--muted); }
@media (max-width: 720px) { .am-email, .am-caret { display: none; } .am-btn { padding: 3px; min-height: 40px; } }
.am-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 288px; padding: 8px; border-radius: 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 2px; font-family: inherit; text-align: left; }
.am-pop[hidden] { display: none; }
.am-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; min-width: 0; }
.am-head strong { font-size: 15px; }
.am-head span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-head .am-role { align-self: flex-start; margin-top: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); }
.am-item { display: flex; flex-direction: column; gap: 1px; min-height: 44px; justify-content: center; padding: 6px 10px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font: 600 15px/1.25 inherit; font-family: inherit; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.am-item small { font-weight: 400; font-size: 12px; color: var(--muted); }
.am-item:hover, .am-item[aria-current="page"] { background: var(--chip, var(--line)); }
.am-signout { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.am-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.am-k { font-size: 13px; color: var(--muted); font-weight: 600; }
.am-theme, .theme-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.am-theme button, .theme-seg button { min-height: 32px; padding: 0 10px; border-radius: 999px; border: 0; background: none; color: var(--muted);
  font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; }
.am-theme button[aria-pressed="true"], .theme-seg button[aria-pressed="true"] { background: var(--chip, var(--line)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
/* Phones: the menu opens as a sheet from the bottom, thumb-reachable. */
@media (max-width: 560px) {
  .am-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 80vh; overflow: auto; }
  .am-item { min-height: 48px; }
}
/* Mobile menu: "Your CRM" link where Log in was (signed in). */
.links a.menu-account { font-weight: 700; }

/* Footer theme switch on the public website: small and quiet. */
.foot-theme { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; font-size: 14px; color: var(--muted); }

/* ---- Settings ---- */
.st-wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 72px; }
.st-wrap h1 { font-size: clamp(34px, 5vw, 48px); margin: 6px 0 4px; }
.st-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; scrollbar-width: none; }
.st-nav::-webkit-scrollbar { display: none; }
.st-nav a { flex: none; min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.st-card { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 18px 16px; margin: 16px 0; scroll-margin-top: 64px; }
.st-card h2 { font-family: var(--fd, inherit); font-size: 28px; margin: 0 0 4px; }
.st-card > p.lead { color: var(--muted); margin: 0 0 14px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
@media (max-width: 560px) { .st-grid { grid-template-columns: 1fr; } }
.st-grid .full { grid-column: 1 / -1; }
.st-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.st-field input, .st-field select, .st-field textarea, .cmp input, .cmp select, .cmp textarea, .lp-inline input, .lp-inline select, .lp-inline textarea {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--field, var(--card)); color: var(--ink);
  padding: 9px 12px; font: 500 16px/1.35 inherit; font-family: inherit; width: 100%; }
.st-field textarea, .cmp textarea { min-height: 120px; resize: vertical; }
.st-field small, .st-hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.st-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; font-weight: 600; }
.st-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.st-check span small { display: block; font-weight: 400; color: var(--muted); }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.st-btn, .lp-btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: 700 15px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.st-btn.solid, .lp-btn.solid { background: var(--ink); color: var(--bg); }
.st-btn[disabled], .lp-btn[disabled] { opacity: .55; cursor: default; }
.st-btn.danger { border-color: var(--danger, #b42318); color: var(--danger, #b42318); }
.st-msg { min-height: 1.4em; font-size: 14px; color: var(--muted); }
.st-msg.error { color: var(--danger, #b42318); }
.st-theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-theme-pick button { min-height: 92px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 12px; font: 700 15px/1.2 inherit; font-family: inherit; text-align: left; }
.st-theme-pick button small { font-weight: 400; color: var(--muted); font-size: 12px; }
.st-theme-pick button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.st-theme-pick .sw { width: 100%; height: 26px; border-radius: 8px; border: 1px solid var(--line); }
.sw-day { background: linear-gradient(90deg, #FAF8F5 60%, #FF7A1A 60%); }
.sw-night { background: linear-gradient(90deg, #111215 60%, #FF7A1A 60%); }
.sw-auto { background: linear-gradient(90deg, #FAF8F5 50%, #111215 50%); }
.st-steps { margin: 8px 0 0; padding-left: 1.2em; }
.st-steps li { margin: 6px 0; }
.st-codes { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.st-codes th, .st-codes td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-codes code, .st-card code { font: 700 15px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip, var(--line)); padding: 1px 6px; border-radius: 6px; }
.st-note { border-left: 3px solid var(--line); padding: 6px 12px; color: var(--muted); margin: 10px 0; font-size: 14px; }

/* ---- Lead profile ---- */
.lp { max-width: 1120px; margin: 0 auto; padding: 16px 16px 80px; }
.lp-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; }
.lp-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; margin: 4px 0 12px; }
.lp-head h1 { font-size: clamp(32px, 5vw, 52px); margin: 0; flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.lp-sub { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.lp-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.lp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .lp-cols { grid-template-columns: 1fr; } }
.lp-card { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 16px; margin-bottom: 16px; min-width: 0; }
.lp-card h2 { font-family: var(--fb, inherit); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.lp-dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 15px; }
.lp-dl dt { color: var(--muted); font-weight: 600; }
.lp-dl dd { margin: 0; overflow-wrap: anywhere; }
.lp-dl a { color: var(--link, var(--ink)); }
.lp-pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 4px 0; }
.lp-pipe button { min-height: 44px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted);
  font: 700 13px/1.15 inherit; font-family: inherit; cursor: pointer; }
.lp-pipe button.done { color: var(--ink); background: var(--chip, var(--line)); }
.lp-pipe button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); background: var(--chip, var(--line)); }
.lp-pipe button.lost[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--danger, #b42318); color: var(--danger, #b42318); }
@media (max-width: 420px) { .lp-pipe button { font-size: 12px; } }
.lp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.lp-tag { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.lp-tag button { min-width: 28px; min-height: 28px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; border-radius: 50%; }
.lp-inline { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.lp-inline input { flex: 1; }
.lp-map { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; margin-top: 10px; background: var(--chip, var(--line)); }
.lp-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.lp-est { font-size: 26px; font-family: var(--fd, inherit); margin: 2px 0 6px; }
.lp-ai pre, .lp-pre { white-space: pre-wrap; font: inherit; margin: 6px 0; }
/* Log a call or text */
.log-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.log-row button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
.log-row button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); background: var(--chip, var(--line)); }
/* Email compose */
.cmp { display: flex; flex-direction: column; gap: 10px; }
.cmp-tpl { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-tpl button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; }
.cmp-to { font-size: 14px; color: var(--muted); margin: 0; }
.cmp-to strong { color: var(--ink); }
/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 16px 44px; min-width: 0; }
.tl .tl-ic { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.tl .tl-t { font-weight: 700; font-size: 15px; }
.tl .tl-m { color: var(--muted); font-size: 13px; }
.tl .tl-b { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; background: var(--chip, var(--line)); padding: 8px 10px; border-radius: 10px; }
.tl details summary { cursor: pointer; font-size: 13px; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.tl-empty { color: var(--muted); }
.lp-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; max-width: min(520px, calc(100% - 32px));
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.lp-toast.error { background: var(--danger, #b42318); color: #fff; }
.lp-toast:empty { display: none; }

/* Due today (top of the CRM), follow-up suggestion, duplicates */
.due { background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px var(--line); padding: 14px 16px; margin: 0 0 16px; }
.due h2 { font-size: 20px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-family: inherit; }
.due-n { font-size: 13px; font-weight: 700; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--chip, var(--line)); color: var(--ink); }
.due-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.due-list li { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; }
.due-list li:first-child { border-top: 0; }
.due-open { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; color: var(--ink); text-decoration: none; min-height: 44px; align-content: center; }
.due-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-open small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.due-when, .due-late { font-size: 13px; font-weight: 700; color: var(--muted); }
.due-late { color: var(--danger, #b42318); }
html[data-theme="night"] .due-late { color: #ff8a80; }
.due-call { min-width: 44px; padding: 0; justify-content: center; }
.lp-suggest { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--chip, var(--line)); }
.lp-suggest[hidden] { display: none; }
.lp-suggest p { margin: 0 0 8px; font-size: 14px; }
.lp-suggest .log-row button.pick { box-shadow: inset 0 0 0 2px var(--ink); font-weight: 700; }
.lp-dups { border: 1px dashed var(--muted); }
.lp-dups ul { list-style: none; margin: 8px 0 0; padding: 0; }
.lp-dups li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.lp-dups li small { display: block; color: var(--muted); }
.imp-map { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0; }
@media (max-width: 560px) { .imp-map { grid-template-columns: 1fr; } }
.imp-prev { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; display: block; overflow-x: auto; }
.imp-prev th, .imp-prev td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.imp-prev tr.dup td { color: var(--muted); text-decoration: line-through; }
.hours-grid { display: grid; grid-template-columns: 64px auto 1fr 1fr; gap: 8px 10px; align-items: center; }
.hours-grid input[type="time"] { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--field, var(--bg)); color: var(--ink); padding: 0 8px; font: inherit; }
@media (max-width: 420px) { .hours-grid { grid-template-columns: 48px auto 1fr 1fr; gap: 6px; } .hours-grid input[type="time"] { padding: 0 4px; font-size: 14px; } }
.hours-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--chip, var(--line)); font-size: 14px; }
.pad-x { padding: 0 1rem; } .pad-x .due { margin-top: .75rem; }
.st-btn[hidden], .lp-btn[hidden] { display: none !important; }
/* timeline emails: tap to expand the exact subject + body */
.tl .tl-mail > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; }
.tl .tl-mail > summary::-webkit-details-marker { display: none; }
.tl .tl-mail .tl-more { font-size: 13px; text-decoration: underline; color: var(--muted); }
.tl .tl-mail[open] .tl-more { display: none; }
.tl .tl-head { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: 13px; }
.tl .tl-head dt { color: var(--muted); }
.tl .tl-head dd { margin: 0; overflow-wrap: anywhere; }
.tl .tl-mailbody { max-height: none; }
.tl li.tl-email.in .tl-ic { outline: 2px solid var(--line); }
.st-sub { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); } .st-sub h3 { margin: 0 0 10px; font-size: 16px; } .st-sub[hidden] { display: none; }
