/* Carbon design tokens (docs/Platform_Build_Brief_261011.md section 2).
   One file for every surface: the side panel snapshot, the Gmail sidebar
   (compiled into its shadow root) and the staff web app. Colour values are
   the mockups' .light and .dark sets (docs/mockups/Home.html).
   Rules:
   - Coral is the one primary action per screen, the selected tab and the
     accent. Never for errors, never as text on cream.
   - Overdue and errors use --red (now burnt orange, 2026-11-05), not coral; true red is the buyer marker only.
   - DM Sans for all UI; Fraunces only for property addresses and page
     greetings. Self-hosted, no Google Fonts requests.
   - 13px body, 8px grid, compact density. Line SVG icons, not emoji.
   Light/dark: follows the system unless data-theme="light" / "dark" is set
   on <html>. The mockups' own variable names (--surface2, --muted, --chipbg,
   --nav…) are kept as aliases so their markup works unchanged. */

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Representation (Nicole, 2026-10-16: one blue, red and purple everywhere). */
  --rep-seller: #1F5FAD; --rep-buyer: #B42318; --rep-dual: #6B3FA0;
  color-scheme: light;

  /* Brand */
  --teal: #0E374A;
  --coral: #F47D5F;
  --purple: #656DB3;
  --cream: #FBF6EF;
  --mauve: #C27DB5;

  /* Roles: the mockups' .light set */
  --bg: #FBF6EF;
  --surface: #FFFFFF;
  --surface-sunk: #F5EFE6;
  --line: #E6DED2;
  --text: #0E374A;
  --text-muted: #4A5A62;
  --heading: #0E374A;
  --header-bg: #0E374A;          /* --nav */
  --header-text: #FBF6EF;        /* --navtx */
  --header-muted: #B9CBD3;       /* --navmuted */
  --header-field: rgba(251, 246, 239, 0.12); /* --navactive */
  --accent: #F47D5F;
  --on-accent: #0E374A;
  --link: #4F579E;               /* purple, darkened for contrast on cream */
  --focus: #4F579E;
  /* Alerts, late and missing in burnt orange, not red (Nicole, 2026-11-05:
     red / blue / purple only for the buyer / seller / dual markers). */
  --red: #A94A0C;
  --red-bg: #FCEBDD;
  --amber: #7A4F00;
  --amber-bg: #FDF1D6;
  --green: #17603C;
  --green-bg: #E3F2EA;
  --info: #3B4280;               /* --chiptx */
  --info-bg: #E7E9F6;            /* --chipbg */
  --shadow: 0 1px 2px rgba(14, 55, 74, 0.08);

  /* Status chips (colour follows the status emoji) */
  --chip-green-bg: var(--green-bg);  --chip-green-fg: var(--green);
  --chip-yellow-bg: var(--amber-bg); --chip-yellow-fg: var(--amber);
  --chip-red-bg: var(--red-bg);      --chip-red-fg: var(--red);
  --chip-purple-bg: var(--info-bg);  --chip-purple-fg: var(--info);
  --chip-mauve-bg: #F4E5F1;          --chip-mauve-fg: #7E3F74;
  --chip-neutral-bg: var(--surface-sunk); --chip-neutral-fg: var(--text-muted);
  --chip-done-bg: var(--green-bg);   --chip-done-fg: var(--green);
  --chip-muted-bg: #EDEBE8;          --chip-muted-fg: #6B7178;
  --chip-blue-bg: #E1ECFA;           --chip-blue-fg: #1F5FAD;

  /* Type */
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-address: 'Fraunces', Georgia, serif;
  --fs-body: 13px;
  --fs-small: 12px;
  --fs-label: 11px;
  --fs-title: 15px;
  --fs-address: 20px;
  --lh: 1.45;

  /* Space: 8px grid (4px for hairline gaps only) */
  --s-half: 4px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* The mockups' names, as aliases */
  --surface2: var(--surface-sunk);
  --muted: var(--text-muted);
  --onaccent: var(--on-accent);
  --chipbg: var(--info-bg);
  --chiptx: var(--info);
  --nav: var(--header-bg);
  --navtx: var(--header-text);
  --navmuted: var(--header-muted);
  --navactive: var(--header-field);
  --redbg: var(--red-bg);
  --amberbg: var(--amber-bg);
  --greenbg: var(--green-bg);
}

/* The mockups' .dark set. Written twice: once for the system setting, once
   for an explicit data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B2532;
    --surface: #11303F;
    --surface-sunk: #163949;
    --line: #21485A;
    --text: #EEF2F3;
    --text-muted: #A9B8BE;
    --heading: #EEF2F3;
    --header-bg: #071C26;
    --header-text: #EEF2F3;
    --header-muted: #8FA6B0;
    --header-field: rgba(238, 242, 243, 0.10);
    --link: #B7BCEB;
    --focus: #B7BCEB;
    --red: #FFB27A;
    --red-bg: #46260F;
    --amber: #F5C66B;
    --amber-bg: #3D2E0E;
    --green: #8FD9AE;
    --green-bg: #173D2A;
    --info: #D6DAF7;
    --info-bg: #2A3366;
    --chip-mauve-bg: #3A2337;  --chip-mauve-fg: #E7B9DE;
    --chip-muted-bg: #1C3542;  --chip-muted-fg: #8FA2AB;
    --chip-blue-bg: #1A3354;   --chip-blue-fg: #A9CBF5;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B2532;
  --surface: #11303F;
  --surface-sunk: #163949;
  --line: #21485A;
  --text: #EEF2F3;
  --text-muted: #A9B8BE;
  --heading: #EEF2F3;
  --header-bg: #071C26;
  --header-text: #EEF2F3;
  --header-muted: #8FA6B0;
  --header-field: rgba(238, 242, 243, 0.10);
  --link: #B7BCEB;
  --focus: #B7BCEB;
  --red: #FFB27A;
  --red-bg: #46260F;
  --amber: #F5C66B;
  --amber-bg: #3D2E0E;
  --green: #8FD9AE;
  --green-bg: #173D2A;
  --info: #D6DAF7;
  --info-bg: #2A3366;
  --chip-mauve-bg: #3A2337;  --chip-mauve-fg: #E7B9DE;
  --chip-muted-bg: #1C3542;  --chip-muted-fg: #8FA2AB;
  --chip-blue-bg: #1A3354;   --chip-blue-fg: #A9CBF5;
  --shadow: none;
}
/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: var(--fs-body)/var(--lh) var(--font-ui); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- Components ---- */
.label { font-size: var(--fs-label); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: var(--s-half); padding: 2px var(--s1); border-radius: var(--radius-pill); font-size: var(--fs-small); font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--chip-neutral-bg); color: var(--chip-neutral-fg); }
.chip.green   { background: var(--chip-green-bg);   color: var(--chip-green-fg); }
.chip.yellow  { background: var(--chip-yellow-bg);  color: var(--chip-yellow-fg); }
.chip.red     { background: var(--chip-red-bg);     color: var(--chip-red-fg); }
.chip.purple  { background: var(--chip-purple-bg);  color: var(--chip-purple-fg); }
.chip.mauve   { background: var(--chip-mauve-bg);   color: var(--chip-mauve-fg); }
.chip.done    { background: var(--chip-done-bg);    color: var(--chip-done-fg); }
.chip.muted   { background: var(--chip-muted-bg);   color: var(--chip-muted-fg); }
.chip.blue    { background: var(--chip-blue-bg);    color: var(--chip-blue-fg); }
.chip.solid   { background: var(--teal); color: #FFFFFF; }

/* Option colours as the team knows them (2026-10-15), from
   extension/src/core/select-colors.js: the same pill in both themes. */
.chip.at-blueBright, .at-blueBright, .status-select option.at-blueBright { background: #2D7FF9; color: #FFFFFF; }
.chip.at-cyanBright, .at-cyanBright, .status-select option.at-cyanBright { background: #18BFFF; color: #102A3A; }
.chip.at-greenBright, .at-greenBright, .status-select option.at-greenBright { background: #20C933; color: #FFFFFF; }
.chip.at-yellowBright, .at-yellowBright, .status-select option.at-yellowBright { background: #FCB400; color: #3B2600; }
.chip.at-redBright, .at-redBright, .status-select option.at-redBright { background: #F82B60; color: #FFFFFF; }
.chip.at-purpleBright, .at-purpleBright, .status-select option.at-purpleBright { background: #8B46FF; color: #FFFFFF; }
.chip.at-orangeDark1, .at-orangeDark1, .status-select option.at-orangeDark1 { background: #D74D26; color: #FFFFFF; }
.chip.at-redDark1, .at-redDark1, .status-select option.at-redDark1 { background: #BA1E45; color: #FFFFFF; }
.chip.at-grayDark1, .at-grayDark1, .status-select option.at-grayDark1 { background: #444444; color: #FFFFFF; }
.chip.at-greenLight1, .at-greenLight1, .status-select option.at-greenLight1 { background: #93E088; color: #0F3B0A; }
.chip.at-redLight1, .at-redLight1, .status-select option.at-redLight1 { background: #FF9EB7; color: #5C0A20; }
.chip.at-redLight2, .at-redLight2, .status-select option.at-redLight2 { background: #FFDCE5; color: #7A0F2C; }
.chip.at-yellowLight2, .at-yellowLight2, .status-select option.at-yellowLight2 { background: #FFEAB6; color: #5C3D00; }
.chip.at-orangeLight2, .at-orangeLight2, .status-select option.at-orangeLight2 { background: #FEE2D5; color: #6B2A0E; }
.chip.at-purpleLight2, .at-purpleLight2, .status-select option.at-purpleLight2 { background: #EDE2FE; color: #3B1E6E; }
.chip.at-grayLight2, .at-grayLight2, .status-select option.at-grayLight2 { background: #EEEEEE; color: #333333; }
:root[data-theme="dark"] .chip.solid:not([class*="at-"]) { background: var(--cream); color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.solid:not([class*="at-"]) { background: var(--cream); color: var(--teal); } }

.badge-email { display: inline-flex; align-items: center; gap: var(--s-half); padding: 1px var(--s1); border-radius: var(--radius); font-size: var(--fs-small); font-weight: 600; background: var(--red-bg); color: var(--red); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: 32px; padding: var(--s-half) var(--s2); border-radius: var(--radius); border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; text-transform: capitalize; }
/* Every button in Title Case (Nicole, 2026-12-04: "everything needs that format"); a file name or address on a button keeps its own case. */
[role="tab"] { text-transform: capitalize; }
.btn .keep-case, .btn.keep-case, [role="tab"] .keep-case, [role="tab"].keep-case { text-transform: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.secondary { background: var(--surface); color: var(--link); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--link); }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.notice { border-radius: var(--radius); padding: var(--s1) var(--s2); }
.notice.error { background: var(--red-bg); color: var(--red); }
.notice .code { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-small); opacity: .8; }

/* Line icons sit on the text baseline and take the text colour. */
.icon { flex: none; vertical-align: -2px; }
.with-icon { display: inline-flex; align-items: center; gap: var(--s-half); }

/* Titles in Title Case everywhere (Nicole, 2026-10-12: "every word
   capitalized"): headings and form field names. Hints and values are left
   as written. */
h1, h2, h3, h4, .form-row > span:first-child { text-transform: capitalize; }
.save-mark { text-transform: none; }
/* Section and group headers too (milestones, inspections, people ...):
   Title Case, not all capitals (Nicole, 2026-10-12). */
.label, .tl-title, .insp-head, .group-head, .sub-label, .rep-label, .rep-agent-label, .person-head, .party-head, .drafting-head, .drafting-docs-head, [role=tab] { text-transform: capitalize; }
.label { letter-spacing: .02em; }

/* A contact's name opens their profile (2026-10-12). */
a.person-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line, currentColor); text-underline-offset: 2px; }
a.person-link:hover { color: var(--accent, inherit); text-decoration-color: currentColor; }

/* Contact roles in her colors (2026-10-12): Our Agent orange, Co-op purple,
   Title yellow, Lender green, Buyer red, Seller blue. */
.role-ourAgent { --role: #F28C28; } .role-coopAgent { --role: #8E5CC7; } .role-settlementAgent { --role: #E3B505; }
.role-lender { --role: #3A9D5D; } .role-buyer { --role: var(--rep-buyer); } .role-seller { --role: var(--rep-seller); }
.person[class*="role-"], .contact-row[class*="role-"] { border-left: 4px solid var(--role); padding-left: 10px; }
.person[class*="role-"] .label, .contact-row[class*="role-"] .contact-role { color: var(--role); font-weight: 600; }
.vacation-banner { border-left: 4px solid #F28C28; }
.vendor-lists { display: grid; gap: 4px; margin: 6px 0; }

/* Small coloured squares (the Upcoming groups, the status key): red past
   due, orange today, purple next business day, green done, white later. */
.sq { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: #FFFFFF; border: 1px solid #C9CDD2; box-sizing: border-box; vertical-align: middle; }
.sq.past { background: #E5383B; border-color: #E5383B; }
.sq.today { background: #F7A325; border-color: #F7A325; }
.sq.next { background: #A06BFF; border-color: #A06BFF; }
.sq.done { background: #2FBF56; border-color: #2FBF56; }
.sq-more { font-size: 11px; color: var(--text-muted); margin-left: 2px; }
.chip.rep-buyer { background: var(--rep-buyer); color: #FFFFFF; }
.chip.rep-seller { background: var(--rep-seller); color: #FFFFFF; }
.chip.rep-dual { background: var(--rep-dual); color: #FFFFFF; }
/* Listing Coordination is the seller side: the same blue. */
.chip.at-sellerBlue, .at-sellerBlue, .status-select option.at-sellerBlue { background: var(--rep-seller); color: #FFFFFF; }
/* A file row's photo, small (lists). */
.row-photo { width: 44px; height: 32px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-sunk); }
.addr-cell { display: flex; gap: 10px; align-items: center; min-width: 0; }
.addr-cell .addr-text { display: grid; gap: 4px; min-width: 0; }

/* The status picker you can type into (2026-10-15). */
.search-select { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.search-select .ss-button { all: unset; box-sizing: border-box; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; color: inherit; padding-right: 2px; }
.search-select .ss-button:disabled { cursor: default; opacity: 0.7; }
.search-select:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
/* A picker standing in for a form field (our agent, city): looks like one. */
.search-select.ss-field { display: flex; width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 28px 8px 10px; background: var(--surface); color: var(--text); }
.search-select.ss-field .ss-button { flex: 1; }
.search-select.ss-field::after { content: ''; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .6; pointer-events: none; }
.search-select.ss-field .ss-box { top: calc(100% + 4px); left: 0; }
.search-select.status-after { border: 1px solid var(--line); border-radius: 6px; padding: 5px 24px 5px 8px; background: var(--surface); color: var(--text); }
.ss-box { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 260px; max-width: min(360px, calc(90 * var(--vw, 1vw))); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); padding: 6px; display: grid; gap: 6px; font-weight: 400; white-space: normal; }
.ss-input { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface-sunk); color: var(--text); }
.ss-list { max-height: 300px; overflow: auto; display: grid; gap: 2px; }
.ss-group { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 6px 6px 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.ss-option { padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ss-option.active { outline: 2px solid var(--accent); outline-offset: -2px; }
.ss-option.current { font-weight: 700; }
.ss-none { padding: 6px 8px; }

/* One file in any search's results (view/file-result.js, 2026-10-16). */
.file-result { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 2px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.file-result:hover, .file-result.active, .file-result:focus-visible { background: var(--surface-sunk, rgba(127, 127, 127, .12)); }
.file-result-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Placeholders read as hints, never as an answer (Nicole, 2026-10-27: "i cant
   differentiate between a text written in or ... a placeholder"): lighter and
   in italics everywhere; what's typed stays full-color upright text. */
::placeholder { color: var(--text-muted); opacity: .55; font-style: italic; }
[contenteditable][data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--text-muted); opacity: .55; font-style: italic; pointer-events: none; }

/* Every fold shows it folds (Nicole, 2026-10-27: "make that arrow bigger ...
   hard to tell it is collapsible"): one clear chevron before its heading,
   pointing right when closed and down when open. Not on the dropdown menus. */
details:not(.actions-menu):not(.multi-drop):not(.chip-select) > summary { list-style: none; }
details:not(.actions-menu):not(.multi-drop):not(.chip-select) > summary::-webkit-details-marker { display: none; }
details:not(.actions-menu):not(.multi-drop):not(.chip-select) > summary::before {
  content: ''; display: inline-block; flex: none; width: 9px; height: 9px; margin: 0 10px 2px 2px; vertical-align: middle;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; opacity: .8;
  transform: rotate(-45deg); transition: transform .15s;
}
details:not(.actions-menu):not(.multi-drop):not(.chip-select)[open] > summary::before { transform: rotate(45deg); margin-bottom: 5px; }
@media (prefers-reduced-motion: reduce) { details > summary::before { transition: none; } }
/* A vendor's details from the right (2026-10-27). */
.vendor-link { padding: 0; font: inherit; }
.vendor-sheet-wrap { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.25); display: flex; justify-content: flex-end; }
.vendor-sheet { width: min(360px, 92vw); height: 100%; overflow-y: auto; box-sizing: border-box; padding: 16px; background: var(--surface, #fff); color: var(--text); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.18); display: grid; align-content: start; gap: 12px; }
.vendor-sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.vendor-sheet-head .link { font-size: 22px; line-height: 1; }
.vendor-row .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.vendor-notes { white-space: pre-wrap; font-size: var(--fs-small); }
.vendor-sheet-body { display: grid; gap: 14px; }
.vendor-row { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vendor-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vendor-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.vendor-row input[type=text], .vendor-row input[type=email], .vendor-row textarea { width: 100%; box-sizing: border-box; }
