/* Toadally Clean CRM. Dark navy theme by owner preference (D-006 layout, wireframes v0.4 colors).
   Brand palette is PRELIMINARY until the logo source file supplies exact values. */
:root {
  /* Light-blue main area with white sidebar, by owner preference (2026-10-13). */
  /* Blues sampled from the v1 logo: splash #80E0F0 (lightened for the page), water #0A9BEF, outline navy #001030. */
  --bg: #C2EAF7; --surface: #FFFFFF; --fg: #1D2733; --muted: #5B6B7B; --line: #A9DCEF; --wire: #E6F6FC; --wire-2: #C2EAF7;
  --head: #0B5FA5; --green: #5F9622; --green-ink: #FFFFFF; --green-soft: #E6F2D4; --blue: #0A8FE0; --blue-soft: #E1F3FC;
  --red: #B3261E; --red-soft: #FBE7E6; --amber: #9A6700; --amber-soft: #FFF1CC;
  /* sidebar and top bar */
  --side-bg: #FFFFFF; --side-fg: #1D2733; --side-muted: #5B6B7B; --side-line: #A9DCEF; --side-input: #F2F6FA; --side-link: #0B5FA5; --bar-bg: #0A9BEF; --bar-fg: #FFFFFF; --bar-muted: #D8EFFC;
  --ui: system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--ui); font-size: 14px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--head); line-height: 1.2; }
h2 { font-size: 1rem; font-weight: 800; }
h3 { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
p { margin: 0; }
.small { font-size: .78rem; }
.muted { color: var(--muted); }
.error { color: var(--red); background: var(--red-soft); padding: 8px 10px; border-radius: 6px; font-size: .85rem; }

/* top bar with Classic-style tabs */
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 16px; min-height: 38px; background: var(--bar-bg); border-bottom: 1px solid #0882CC; flex-wrap: wrap; }
.brand { font-weight: 800; color: var(--head); font-size: 1.05rem; }
.barmark { display: flex; align-items: center; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 900; font-size: 1.05rem; letter-spacing: .08em; line-height: 1; color: var(--bar-fg); white-space: nowrap; }
.barmark:hover { text-decoration: none; opacity: .9; }
.bm-lily { color: #FFFFFF; } .bm-pad { color: #DDF5A6; }
.bm-crm { margin-left: 7px; font-size: .55rem; font-weight: 800; letter-spacing: .18em; color: var(--head); background: #FFFFFF; padding: 3px 5px 3px 7px; border-radius: 4px; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; flex-wrap: wrap; justify-content: center; padding: 5px 0; }
.tabs a, .tabs .soon { padding: 6px 11px; font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--bar-muted); border-radius: 999px; }
.tabs a { color: var(--bar-fg); }
.tabs a:hover { text-decoration: none; background: rgba(255,255,255,.18); }
.tabs a.on, .tabs a.on:hover { background: #FFFFFF; color: var(--head); box-shadow: 0 1px 4px rgba(4,60,110,.35); }
.tabs .soon { opacity: .55; cursor: default; }
.who { display: flex; align-items: center; gap: 8px; color: var(--bar-muted); font-size: .85rem; margin-left: auto; }
.linkbtn { background: none; border: 0; color: var(--bar-fg); cursor: pointer; font: inherit; padding: 0; font-weight: 600; }

/* Classic layout: narrow sidebar + main column */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.content { min-width: 0; display: flex; flex-direction: column; }
.sidebar { background: var(--side-bg); color: var(--side-fg); border-right: 1px solid var(--side-line); padding: 10px 12px 14px; display: grid; gap: 16px; align-content: start; }
.sidebar h3 { color: var(--side-muted); }
.sidebar .muted { color: var(--side-muted); }
.sidebar a { color: var(--side-link); }
.sidebar .inp { background: var(--side-input); border-color: var(--side-line); color: var(--side-fg); color-scheme: light; }
.main { padding: 14px 16px; display: grid; gap: 14px; align-content: start; min-width: 0; flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; box-shadow: 0 1px 2px rgba(11,95,165,.08); }
.panel .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel .empty { padding: 14px 12px; color: var(--muted); font-size: .85rem; }

.tiles { display: grid; grid-template-columns: 1.3fr repeat(5, 1fr); gap: 10px; padding: 12px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.tile .l { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: 1.2rem; font-weight: 800; color: var(--head); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--wire-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--green); }
.col-lg .bar { display: inline-block; width: 130px; margin: 0; vertical-align: middle; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.on { background: var(--head); color: #FFFFFF; border-color: var(--head); font-weight: 700; }

.inp { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); padding: 7px 9px; font: inherit; }
.inp:disabled { opacity: .6; }
.btn { display: inline-block; font-weight: 700; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--head); cursor: pointer; font: inherit; }
.btn.pri { background: var(--green); border-color: var(--green); color: var(--green-ink); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: grid; gap: 10px; }
.login-card label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #FFFFFF; color: var(--fg); padding: 9px 10px; font: inherit; }
.login-brand { font-weight: 800; font-size: 1.4rem; color: var(--head); }
.login-sub { color: var(--muted); margin-bottom: 8px; }
.wordmark { display: flex; align-items: center; justify-content: center; gap: 0; margin: 2px 0 14px; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 900; font-size: 1.7rem; letter-spacing: .08em; line-height: 1; }
.wm-toad { color: var(--green); text-shadow: 0 1px 0 rgba(0,0,0,.08); }
.wm-force { background: linear-gradient(180deg, var(--blue) 0%, var(--head) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-crm { margin-left: 10px; font-size: .62rem; font-weight: 800; letter-spacing: .18em; color: #fff; background: var(--head); padding: 4px 7px 4px 9px; border-radius: 5px; align-self: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--head); background: var(--wire); }
.pw-eye svg[hidden] { display: none; }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--side-line); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
}

/* logo */
.brand-logo { width: 100%; height: auto; display: block; }
.login-logo { background: #fff; }
.login-logo { width: 100%; max-width: 300px; background: #fff; border-radius: 8px; padding: 8px 12px; justify-self: center; margin-bottom: 4px; }

/* list rows (Classic list view) */
.gh { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .subject { flex: 1; min-width: 0; font-weight: 600; }
.row .related { width: 290px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .owner { width: 56px; color: var(--muted); }
.row form { display: contents; }
.row form.inline-adjust { display: contents; }
.stripe { border-left: 3px solid transparent; }
.stripe.red { border-left-color: var(--red); }
.stripe.amber { border-left-color: var(--amber); }
.cb { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 3px; background: transparent; cursor: pointer; padding: 0; flex: 0 0 auto; }
.cb:hover { border-color: var(--green); background: var(--green-soft); }
.cb.done { border-color: var(--green); color: var(--green); font-size: .7rem; line-height: 14px; text-align: center; cursor: default; }
.cb.ghost { border-style: dashed; opacity: .5; cursor: default; }
.cb.cancelled { border-color: var(--muted); color: var(--muted); font-size: .8rem; line-height: 13px; text-align: center; cursor: default; }
.pill { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--wire); color: var(--muted); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--head); }
.pill.kind-job { background: var(--green); color: #fff; }
.pill.kind-inspection { background: var(--amber); color: #fff; }
.pill.kind-other { background: var(--head); color: #fff; }
.pill.kind-task { background: var(--muted); color: #fff; }
.ev .pill { font-size: .6rem; padding: 1px 6px; vertical-align: 1px; }
.timespan { width: 150px; white-space: nowrap; }
.cals { display: flex; flex-wrap: wrap; gap: 4px; width: 250px; flex: 0 0 auto; justify-content: flex-start; }
@media (max-width: 860px) { .cals { width: auto; } }
.datepill.wide { min-width: 172px; }
.datepill { min-width: 108px; width: auto; padding: 2px 10px; text-align: center; font-variant-numeric: tabular-nums; margin-right: 6px; flex: 0 0 auto; }
.pb { padding: 4px 0 10px; }
.panel.narrow { max-width: 620px; }
.btn.sm { padding: 4px 9px; font-size: .72rem; }
.filters { display: inline-flex; }
.filters .inp { width: auto; padding: 3px 8px; font-size: .78rem; }
.chips .chip { text-decoration: none; }
.chips .chip:hover { border-color: var(--head); color: var(--head); }

/* forms */
.form { display: grid; gap: 10px; padding: 12px; max-width: 560px; }
.field { display: grid; gap: 4px; }
.field label { font-size: .76rem; font-weight: 700; color: var(--muted); }
.actions { display: flex; gap: 8px; padding-top: 4px; }
.two.pb { padding: 0; }
.two > .form { max-width: none; }
.two > div { padding: 12px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .85rem; }
.ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; flex: 0 0 auto; }
.rec-type .ico { width: 15px; height: 15px; color: var(--head); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .8rem; }
.recent li { display: flex; align-items: center; gap: 7px; }
.recent .ico { color: var(--side-muted); }
.flash { display: grid; gap: 6px; }
.flash-item { padding: 8px 12px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: .85rem; }
.flash-item.info { background: var(--blue-soft); color: var(--blue); }

/* customers and properties */
.row.head { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.row.head .subject { font-weight: 700; }
.col-md { width: 140px; min-width: 0; } .col-lg { width: 240px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .span2 { grid-column: span 2; }
.field.check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.field.check input[type=checkbox] { order: 0; margin: 0; }
.field.check label { order: 1; margin: 0; }
.field.check .small, .field.check .error { order: 2; flex-basis: 100%; }
.dupe { margin: 10px 12px 0; padding: 8px 10px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-size: .85rem; }
.dupe a { color: var(--head); font-weight: 700; }
.lookup { position: relative; }
.lookup-menu { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(11,95,165,.16); max-height: 300px; overflow: auto; }
.lookup-menu[hidden] { display: none; }
.lookup-opt { display: grid; gap: 1px; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--wire); }
.lookup-opt b { font-weight: 600; color: var(--head); font-size: .86rem; }
.lookup-opt span { font-size: .76rem; color: var(--muted); }
.lookup-opt:hover, .lookup-opt.on { background: var(--wire); }
.lookup-empty { padding: 6px 10px; color: var(--muted); font-size: .8rem; }
.gsearch { position: relative; }
.merge-pick { display: flex; align-items: center; gap: 6px; cursor: pointer; text-transform: none; }
.merge-pick:has(input:checked) { font-weight: 700; color: var(--head); }
.search-results .row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.5fr) 120px 110px; gap: 14px; align-items: center; }
.search-results .row > span { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.search-results .row > span:nth-child(n+4) { text-align: center; }
.search-results .row a { font-weight: 600; }
.search-results .appt-detail { display: block; }
.search-results .photo-cell { display: flex; align-items: center; gap: 10px; }
.search-results .photo-cell img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; display: block; flex: 0 0 auto; }
.search-results .photo-cell > span { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
@media (max-width: 700px) { .search-results .photo-cell { flex-direction: column; align-items: flex-start; gap: 4px; } .search-results .photo-cell > span { width: 100%; } }
.sidebar .gsearch-opt:has(.gsearch-thumb) { grid-template-columns: 44px 1fr; }
.gsearch-thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 3px; display: block; }
@media (max-width: 700px) { .search-results .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 100px; } .search-results .row > span:nth-child(3), .search-results .row > span:nth-child(4) { display: none; } }
.gsearch-menu { max-height: 70vh; }
.gsearch-head { padding: 7px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sidebar .gsearch-opt { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; padding: 6px 10px; border-bottom: 1px solid var(--wire); color: var(--head); text-decoration: none; }
.gsearch-opt .ico { margin-top: 2px; }
.gsearch-text { display: grid; gap: 1px; min-width: 0; }
.gsearch-text b { font-weight: 600; font-size: .84rem; color: var(--head); overflow-wrap: anywhere; }
.gsearch-text span { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.sidebar .gsearch-all { display: block; font-size: .8rem; font-weight: 700; border-bottom: 0; }
.gsearch-opt:hover, .gsearch-opt.on { background: var(--wire); }
.form-dock { position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--line); margin: 0 -12px -12px; padding: 8px 12px 12px; display: grid; gap: 8px; }
.form-dock .dupe { margin: 0; max-height: 42vh; overflow: auto; }
.dupe-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.dupe-list li { display: grid; grid-template-columns: max-content 1fr; gap: 1px 8px; align-items: baseline; }
.dupe-list .pill { grid-row: span 3; align-self: start; margin-top: 1px; }
.dupe-facts { color: var(--fg); font-size: .8rem; }
.dupe-why { font-size: .8rem; font-style: italic; }
.dupe-prop { margin-top: 6px; }
.dupe .pill { background: #fff; }
.dupe .pill.amber { background: var(--amber); color: #fff; }
@media (max-width: 700px) { .form-dock { position: static; } }
.dupe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(154,103,0,.25); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .82rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .85rem; }
.prop-grid { display: grid; grid-template-columns: 300px 1fr; gap: 0; }
.prop-side { padding: 12px; border-right: 1px solid var(--line); background: var(--wire); }
.prop-main { padding: 0 12px 12px; min-width: 0; }
.person { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.person:last-child { border-bottom: 0; }
.lock { display: inline-block; font-size: .68rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 1px 6px; margin-top: 3px; }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -12px 8px; padding: 0 12px; overflow-x: auto; }
.subtabs a, .subtabs .soon { padding: 9px 10px; font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.subtabs a.on { color: var(--head); border-bottom-color: var(--green); }
.subtabs .soon { opacity: .5; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.tl li:last-child { border-bottom: 0; }
.tl .d { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.tl li.internal { opacity: .8; }
.note { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.note:last-child { border-bottom: 0; }
@media (max-width: 860px) { .prop-grid { grid-template-columns: 1fr; } .prop-side { border-right: 0; border-bottom: 1px solid var(--line); } .grid2 { grid-template-columns: 1fr; } .grid2 .span2 { grid-column: span 1; } .col-lg, .col-md { display: none; } }

.form-section { padding: 10px 12px 2px; font-size: .74rem; }
.form-hint { padding: 0 12px 6px; }
.field.checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.field.checks li label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--fg); font-size: .85rem; }

/* Classic record detail layout */
.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 14px; padding: 12px 12px 10px; flex-wrap: wrap; }
.rec-head > .rec-badge + div { flex: 1; min-width: 0; }
.rec-badge { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; width: 76px; }
.rec-badge .tile { width: 50px; height: 50px; border-radius: 12px; background: var(--kc); display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.rec-badge .tile .ico { width: 28px; height: 28px; color: #fff; stroke-width: 2; }
.rec-badge .kind { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--kc); text-align: center; line-height: 1.1; }
.panel:has(> .rec-head .rec-badge) { border-top: 4px solid; border-top-color: var(--line); }
.panel:has(> .rec-head .rec-badge[data-kind="customer"]) { border-top-color: #0A8FE0; }
.panel:has(> .rec-head .rec-badge[data-kind="property"]) { border-top-color: #5F9622; }
.panel:has(> .rec-head .rec-badge[data-kind="quote"]) { border-top-color: #D9822B; }
.panel:has(> .rec-head .rec-badge[data-kind="job"]) { border-top-color: #0B5FA5; }
.panel:has(> .rec-head .rec-badge[data-kind="invoice"]) { border-top-color: #0F8C7E; }
.panel:has(> .rec-head .rec-badge[data-kind="change_order"]) { border-top-color: #C0492B; }
.panel:has(> .rec-head .rec-badge[data-kind="appointment"]), .panel:has(> .rec-head .rec-badge[data-kind="calendar"]) { border-top-color: #7B4FC9; }
.panel:has(> .rec-head .rec-badge[data-kind="task"]) { border-top-color: #5B6B7B; }
.panel:has(> .rec-head .rec-badge[data-kind="outbox"]), .panel:has(> .rec-head .rec-badge[data-kind="communication"]) { border-top-color: #0F8C7E; }
.panel:has(> .rec-head .rec-badge[data-kind="pricing"]) { border-top-color: #8A5A2B; }
@media (max-width: 600px) { .rec-badge { width: 60px; } .rec-badge .tile { width: 40px; height: 40px; } .rec-badge .tile .ico { width: 22px; height: 22px; } }
.rec-type { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rec-head h2 { font-size: 1.25rem; }
.rel-links { padding: 4px 12px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.rel-links a { margin-right: 10px; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 7px 12px; background: var(--wire); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--head); font-size: .8rem; font-weight: 800; letter-spacing: .02em; text-transform: none; }
.sec .count { color: var(--muted); font-weight: 600; margin-left: 6px; margin-right: auto; }
.sec { justify-content: flex-start; }
.sec::after { content: ""; margin-left: auto; } /* buttons sit centered between the title and the right edge */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; padding: 8px 12px 12px; }
.detail .f { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px dotted var(--line); font-size: .84rem; }
.detail .f dt { color: var(--fg); font-weight: 700; text-align: right; }
.detail .f dt::after { content: ":"; }
.detail .f dd { margin: 0; min-width: 0; }
.detail .f.wide { grid-column: span 2; }
.rl { padding: 0 0 6px; }
.rl .row { padding-left: 12px; padding-right: 12px; }
.rl .muted-row { color: var(--muted); }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } .detail .f.wide { grid-column: span 1; } .detail .f dt { text-align: left; } }
.detail .col { display: grid; align-content: start; min-width: 0; }

/* Title Case for labels: form labels, detail labels, section headers */
.field label, .detail .f dt, .sec { text-transform: capitalize; }

.xb { width: 20px; height: 20px; border: 1.5px solid var(--muted); border-radius: 4px; background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; line-height: 1; font-size: 15px; font-weight: 700; flex: 0 0 auto; }
.xb:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.mapicon { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 2px 9px 2px 5px; border-radius: 999px; background: var(--blue-soft); border: 1px solid #BFE3F8; color: var(--head); font-size: .74rem; font-weight: 700; line-height: 1.4; text-decoration: none; vertical-align: 2px; white-space: nowrap; }
.mapicon:hover { background: #D2ECFB; text-decoration: none; }
.mapicon .ico { width: 16px; height: 16px; fill: #E0412F; stroke: none; vertical-align: 0; }
h2 .mapicon { font-size: .8rem; vertical-align: 4px; }
.row span.subject a { font-weight: 600; }

.col-sm { width: 92px; min-width: 0; }
/* fixed-width columns and their headers are centered; the description column stays left */
.row .col-sm, .row .col-md, .row .col-lg, .row.head .col-sm, .row.head .col-md, .row.head .col-lg { text-align: center; }
.col-sm.num, .col-md.num { font-variant-numeric: tabular-nums; }
.row .col-sm.verify, .row .col-lg.verify, .row .col-lg.outcome, .row .col-lg.wrap, .row .cals { text-align: left; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tot { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .88rem; }
.tot .big { font-weight: 800; font-size: 1.1rem; color: var(--head); }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr; } .col-sm { display: none; } }

/* user menu in the top bar */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; color: var(--bar-fg); font-weight: 600; user-select: none; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 24px; min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(11,95,165,.18); padding: 6px 0; z-index: 5; display: grid; }
.usermenu .menu a, .usermenu .menu .linkbtn { display: block; width: 100%; text-align: left; padding: 7px 12px; color: var(--fg); font-weight: 500; text-decoration: none; }
.usermenu .menu a:hover, .usermenu .menu .linkbtn:hover { background: var(--wire); }

/* quote builder and proposal */
.grid3 .span3 { grid-column: span 3; }
.qline form { display: contents; }
.row.total { border-top: 2px solid var(--line); margin-top: 4px; }
.proposal-wrap { max-width: 720px; }
.proposal-head { display: flex; gap: 16px; align-items: center; padding: 14px 12px 8px; flex-wrap: wrap; }
.proposal-logo { width: 190px; height: auto; }
.notice { margin: 8px 12px; padding: 8px 10px; border-radius: 6px; font-size: .85rem; }
.notice.amber { background: var(--amber-soft); color: var(--amber); }
.notice.green { background: var(--green-soft); color: var(--green); }
.proposal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 12px 14px; }
.btn.disabled { opacity: .55; cursor: not-allowed; text-align: center; }
@media (max-width: 860px) { .grid3 .span3 { grid-column: span 1; } .qb .col-sm { display: inline; width: auto; } }

/* Proposal (customer view and PDF layout) */
.proposal { padding-bottom: 8px; }
.pp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 22px 24px 10px; flex-wrap: wrap; }
.pp-meta { text-align: right; }
.pp-title { font-size: 1.5rem; font-weight: 800; color: var(--head); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.pp-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .86rem; }
.pp-kv dt { color: var(--muted); font-weight: 700; text-transform: capitalize; }
.pp-kv dt::after { content: ":"; }
.pp-kv dd { margin: 0; }
.pp-meta .pp-kv { grid-template-columns: auto auto; justify-content: end; }
.pp-meta .pp-kv dt { text-align: right; }
.pp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 10px 24px 6px; }
.pp-parties .pp-kv { grid-template-columns: 112px 1fr; }
.pp-addr { font-size: .9rem; line-height: 1.45; }
.pp-label { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pp-lines { width: calc(100% - 48px); margin: 28px 24px 0; border-collapse: collapse; font-size: .9rem; }
.pp-lines th { text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.pp-lines td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pp-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-totals { display: flex; justify-content: flex-end; padding: 22px 24px 6px; }
.pp-totals dl { display: grid; grid-template-columns: auto auto; gap: 8px 28px; margin: 0; font-size: .92rem; min-width: 340px; }
.pp-totals dt { text-align: right; color: var(--fg); }
.pp-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pp-totals .good { color: var(--green); }
.pp-totals .grand { font-weight: 800; font-size: 1.15rem; color: var(--head); padding-top: 10px; border-top: 2px solid var(--line); }
.pp-notes { padding: 8px 24px; font-size: .86rem; }
.pp-foot { padding: 14px 24px 6px; font-size: .78rem; color: var(--muted); }
.proposal .notice { margin: 12px 24px 4px; }
.proposal .proposal-actions { padding: 10px 24px 16px; }
@media (max-width: 700px) { .pp-parties { grid-template-columns: 1fr; } .pp-meta { text-align: left; } .pp-meta .pp-kv { justify-content: start; } .pp-meta .pp-kv dt { text-align: left; } .pp-totals dl { min-width: 0; width: 100%; } }
.pp-kv dt.nocolon::after { content: ""; }

.public-main { max-width: 760px; margin: 0 auto; padding: 16px; }
.mailbody { white-space: pre-wrap; font: inherit; padding: 12px; margin: 0; }

.sigpad { width: 100%; max-width: 600px; height: 180px; background: #fff; border: 1px dashed var(--muted); border-radius: 6px; touch-action: none; display: block; }
.terms { padding: 6px 12px; font-size: .86rem; max-height: 320px; overflow-y: auto; }
.terms .terms-h { margin: 14px 0 4px; font-size: .92rem; color: var(--head); }
.terms p { margin: 0 0 6px; } .terms ul { margin: 0 0 8px; padding-left: 22px; } .terms li { margin-bottom: 2px; }
.terms-todo { background: var(--amber-soft); color: var(--amber); font-weight: 600; padding: 0 2px; border-radius: 3px; }
.terms-banner { font-weight: 700; color: var(--red); }

/* calendar */
.calwrap { overflow-x: auto; padding: 8px 12px; }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: .78rem; min-width: 860px; }
.cal th { text-align: center; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 4px; }
.cal th.res { text-align: left; width: 150px; }
.cal td { vertical-align: top; background: var(--wire); border-radius: 6px; min-height: 64px; height: 64px; padding: 4px; }
.cal td.res { background: transparent; padding: 6px 4px; }
.cal th.today, .cal td.today { outline: 2px solid var(--blue); outline-offset: -2px; }
.ev { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; border-radius: 4px; padding: 3px 6px; margin-bottom: 3px; font-size: .74rem; }
.ev.appt { background: var(--blue-soft); color: var(--blue); border-left: 3px solid var(--blue); }
.ev.appt a { color: var(--blue); font-weight: 600; }
.ev.appt.done { opacity: .7; }
.ev.appt.done a::after { content: " ✓"; }
.ev.block { background: var(--wire-2); color: var(--muted); }
.ev.via { background: transparent; color: var(--muted); }
.ev form { display: contents; }
.ev .xb { width: 16px; height: 16px; font-size: 12px; }
.addslot { display: block; height: 100%; min-height: 40px; }
.mini { width: 100%; border-collapse: collapse; font-size: .68rem; text-align: center; }
.mini th { color: var(--side-muted); font-weight: 600; padding: 2px 0; }
.mini td { padding: 1px 0; }
.mini td a { display: block; border-radius: 3px; padding: 2px 0; color: var(--side-fg); text-decoration: none; }
.mini td.out a { color: #B8C3D1; }
.mini td.busy a { font-weight: 700; color: var(--side-link); text-decoration: underline; }
.mini td.today a { background: var(--side-link); color: #fff; font-weight: 700; }
.mini-title { font-size: .76rem; font-weight: 700; text-align: center; margin-bottom: 2px; }

.cal.month td { height: 96px; min-height: 96px; width: 14.28%; }
.cal.month td.out { background: transparent; border: 1px dashed var(--line); }
.cal.month .daynum { font-size: .74rem; font-weight: 700; margin-bottom: 3px; }
.cal.month .daynum a { color: var(--muted); text-decoration: none; }
.cal.month td.today .daynum a { color: var(--blue); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }

/* work order production */
.production { padding: 0; }
.prod-grid { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
.prod-grid h4 { margin: 10px 0 6px; font-size: .82rem; font-weight: 700; color: var(--head); }
.inp.sm { padding: 4px 6px; font-size: .8rem; }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.verify { display: flex; align-items: center; gap: 6px; margin-left: 28px; }
.verify input.num { width: 90px; }
.outcome { display: grid; gap: 4px; }
.outcome input[hidden] { display: none; }
.strike { text-decoration: line-through; }
.visitcol { margin-left: 28px; }
.panel > .sec:first-child { border-top: 0; border-radius: 8px 8px 0 0; }
.visit-panel { border-left: 4px solid var(--blue); }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); z-index: 2; }
.btn.linkish { margin-left: 10px; padding: 1px 8px; font-size: .74rem; }
.mats[hidden], .mat-row[hidden] { display: none; }
.mats { background: #F4FAFD; padding: 6px 12px 8px 80px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.mat-row { display: grid; grid-template-columns: 260px 90px 40px max-content; gap: 8px; align-items: center; font-size: .84rem; justify-content: start; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .88rem; }
.checklist label { display: flex; gap: 8px; align-items: flex-start; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.inline { display: inline; }
.sec .chips form { display: inline; }
@media (max-width: 860px) { .prod-grid { grid-template-columns: 1fr; } .checklist { grid-template-columns: 1fr; } .mat-row { grid-template-columns: 1fr 1fr; } .sec { flex-wrap: wrap; } }

/* invoices */
.row.stripe.red { border-left: 3px solid var(--red); }
.pill.red { background: var(--red-soft); color: var(--red); }

/* photos */
.sub { margin: 10px 12px 4px; font-size: .8rem; font-weight: 800; color: var(--head); }
.photo-upload { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; padding: 6px 12px 10px; align-items: center; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 4px 12px 12px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; position: relative; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo figcaption { padding: 6px 8px 8px; font-size: .78rem; display: grid; gap: 4px; }
.photo-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.photo figcaption .xb { position: absolute; top: 6px; right: 6px; }
.photos .empty { grid-column: 1 / -1; }
.compares { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 8px 12px; }
.compare { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.compare img { display: block; width: 100%; }
.compare figcaption { padding: 6px 8px; font-size: .82rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.compare-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; padding: 4px 12px 12px; }
.pp-packet { padding: 14px 24px 4px; }
.pp-compare { margin: 6px 0 10px; }
.pp-compare img { width: 100%; border: 1px solid var(--line); border-radius: 6px; }
.pp-compare figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 860px) { .photo-upload, .compare-form { grid-template-columns: 1fr; } }
.co-form { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.co-form .inp { width: 260px; }
.col-lg.wrap { white-space: normal; overflow: visible; line-height: 1.9; }
.col-xs { width: 34px; min-width: 0; text-align: center; }
.row.excluded .subject, .row.excluded .num { text-decoration: line-through; text-decoration-color: var(--muted); }
.row.excluded .pill, .row.excluded .btn, .row.excluded .xb { text-decoration: none; }
.actions-cell { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

/* quote photos */
.photo.internal img { opacity: .55; }
.photo figcaption .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.photos.pick .photo img { aspect-ratio: 4 / 3; }
.pp-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pp-photos figure { margin: 0; }
.pp-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; display: block; }
.pp-photos figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 600px) { .pp-photos { grid-template-columns: 1fr; } }

.county-note { margin-top: 6px; padding: 6px 8px; background: var(--wire); border-radius: 6px; font-size: .84rem; }

.field.side-note { align-self: end; padding-bottom: 8px; }

.preview-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #D9822B; border-radius: 8px; }

.quote-step .form { max-width: none; }
.public .field label, .public .pick { text-transform: none; }  /* customer questions read as sentences */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.service-picks, .radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 500; color: var(--fg); cursor: pointer; text-transform: none; }
.pick:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.q-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 10px; }
.q-group legend { font-weight: 700; color: var(--head); padding: 0 6px; }
.cta-box { margin: 0 0 14px; padding: 14px 16px; background: #fff; border: 2px solid var(--green); border-radius: 10px; text-align: center; }
.cta-title { font-size: 1.15rem; font-weight: 800; color: var(--head); margin-bottom: 10px; }
.cta-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.btn.big { padding: 12px 22px; font-size: 1rem; font-weight: 700; }

.docframe { width: 100%; height: 85vh; min-height: 600px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; }
.mailframe { width: 100%; max-width: 680px; height: 900px; border: 1px solid var(--line); border-radius: 8px; background: #EAF7FC; display: block; }

ul.prep { margin: 4px 0 0; padding: 0; list-style: none; }
ul.prep li { padding-left: 22px; position: relative; margin: 2px 0; }
ul.prep li::before { content: "\2713"; position: absolute; left: 2px; color: var(--green); font-weight: 800; }

/* quote builder: Add An Area (D-027) */
.area-services { display: grid; gap: 6px; padding: 4px 0 8px; }
.area-svc { display: grid; grid-template-columns: minmax(220px, 1fr) 130px 110px; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--wire); }
.area-svc[hidden], .field[hidden], .area-services[hidden] { display: none; }
.area-pick { font-weight: 700; text-transform: none; display: flex; gap: 8px; align-items: center; }
details.single-service > summary { cursor: pointer; list-style: revert; }
.row.book-group { background: var(--wire); font-weight: 800; color: var(--head); text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.area-form .inp.num { text-align: left; }
#area-qty { max-width: 160px; }
.details-form .field { align-content: start; }
.details-form .inp.num, .details-form input[type=number] { text-align: left; }
