/* Area: people — styles for src/next/areas/people.js views. Tokens only (see next.css :root). */
.pp-form { display: flex; flex-direction: column; gap: 18px; }
.pp-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pp-set legend { padding: 0; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.pp-error { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--alert-soft); color: var(--alert); font-weight: 700; }
/* ⚠️ An EMPTY one must not paint itself. Coordinators renders `<span class="pp-error" data-err>`
   unconditionally so a failed invite has somewhere to land, and with nothing in it that rule drew a
   blush blob beside Send and Share (Tovah, 2026-10-19). It is a live region, so it has to stay in
   the DOM for a screen reader to announce into: hide it when empty, never remove it. */
.pp-error:empty { display: none; }
.pp-error svg { width: 18px; height: 18px; }
.pp-save { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--pill); background: var(--sunk); color: var(--ink-2); font-size: 14px; font-weight: 700; }
.pp-save svg { width: 16px; height: 16px; }
.pp-save.ok { background: var(--good-soft); color: var(--good); }
.pp-save.bad { background: var(--alert-soft); color: var(--alert); }
/* segmented radio (type, bought/sold) */
.pp-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--sunk); align-self: flex-start; }
.pp-seg label { position: relative; }
.pp-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pp-seg span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: var(--pill); font-weight: 700; font-size: 15px; color: var(--ink-2); }
.pp-seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.pp-seg input:focus-visible + span { outline: 3px solid var(--olive); outline-offset: 2px; }
/* checkbox chips (tags, areas, features) */
.pp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-pill { position: relative; }
.pp-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pp-pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; color: var(--ink); }
.pp-pill input:checked + span { background: var(--olive); border-color: var(--olive); color: var(--on-dark); }
.pp-pill input:focus-visible + span { outline: 3px solid var(--olive); outline-offset: 2px; }
.pp-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pp-toggle { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; min-height: 48px; cursor: pointer; }
.pp-toggle input { width: 22px; height: 22px; accent-color: var(--olive); }
/* list rows with a select box beside the link */
.pp-row { display: flex; align-items: center; gap: 4px; padding-left: 10px; box-shadow: var(--shadow); }
.pp-row .row { flex: 1; min-width: 0; }
.pp-row.on { outline: 2px solid var(--olive); }
.pp-check { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; flex: none; }
.pp-check input { width: 22px; height: 22px; accent-color: var(--olive); }
.pp-bulk { position: sticky; top: 150px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--r-md); background: var(--ink); color: var(--on-dark); box-shadow: var(--shadow-lift); }
.pp-bulk .spacer { flex: 1; }
.pp-bulk .btn-ghost { color: var(--on-dark); }
.pp-bulk .btn-ghost:hover { background: transparent; text-decoration: underline; }
.phone .pp-bulk { top: 70px; }
.phone .pp-seg { border-radius: var(--r-md); }

/* ---- person page layout (2026-09-25) ---- */
.p-hero { display: flex; align-items: center; gap: 24px; background: var(--card); border-radius: var(--r-xl); padding: 28px 30px; box-shadow: var(--shadow); flex-wrap: wrap; }
.p-hero-main { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.p-name { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 3.6vw, 48px); letter-spacing: -0.025em; line-height: 1; margin: 0; }
.p-contact { margin: 0; color: var(--ink-2); font-size: 16px; }
.p-contact a { color: var(--ink); text-decoration: none; font-weight: 600; }
.p-contact a:hover { text-decoration: underline; }
.p-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 16px 0; }
.p-tile { border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; background: var(--c, var(--card)); text-decoration: none; color: var(--ink); min-width: 0; }
.p-tile b { font-size: 17px; line-height: 1.25; }
.p-tile .eyebrow { color: var(--ink-2); }
.p-big { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.k-butter { --c: var(--butter); } .k-sky { --c: var(--sky); } .k-sage { --c: var(--sage); } .k-blush { --c: var(--blush); } .k-lilac { --c: var(--lilac); }
.p-deal { grid-column: span 2; flex-direction: row; padding: 0; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.p-deal .photo { width: 44%; min-height: 150px; flex: none; }
.p-deal .p-tile-in { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);   /* two even columns: notes | timeline + homes, documents, details (2026-09-29) */ gap: 24px; align-items: start; }
.p-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.p-note textarea { flex: 1; min-height: 50px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card-2); padding: 12px 14px; resize: vertical; font-size: 16px; transition: min-height .15s ease; }
.p-note textarea:focus { outline: 0; border-color: var(--olive); min-height: 110px; background: var(--card); }
.p-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.p-dl dt { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.p-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.p-about { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card-2); }
@media (max-width: 1100px) { .p-cols { grid-template-columns: 1fr; } }
.phone .p-hero { padding: 20px; gap: 16px; }
.phone .p-deal { grid-column: auto; flex-direction: column; }
.phone .p-deal .photo { width: 100%; min-height: 140px; }
.phone .p-cols { grid-template-columns: 1fr; }
.p-big { font-weight: 800; letter-spacing: -0.03em; }

/* ---- People list (2026-09-25 redesign) ---- */
.pp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.pp-tools { display: flex; align-items: center; gap: 8px; }
.pp-tools .search { width: 260px; height: 44px; }
.pp-group { margin-bottom: 36px; }
.pp-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; margin-left: 8px; border-radius: 13px; background: var(--olive-soft); color: var(--olive-deep); font-size: 14px; letter-spacing: 0; vertical-align: 2px; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.pp-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s ease, transform .15s ease; }
.pp-card:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.pp-card.on { border-color: var(--olive); box-shadow: 0 0 0 3px var(--olive-tint); }
.pp-card .pp-check { position: absolute; top: 16px; right: 16px; z-index: 1; }
.pp-card .pp-check input { width: 22px; height: 22px; accent-color: var(--olive); }
.pp-card.selecting .pp-thumb { display: none; }
.pp-link { display: flex; flex-direction: column; gap: 16px; padding: 22px; text-decoration: none; color: var(--ink); height: 100%; }
.pp-top { display: flex; align-items: center; gap: 14px; }
.pp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-who b { font-size: 18px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
.pp-who span { font-size: 15px; color: var(--ink-2); }
.pp-thumb { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; flex: none; }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp-place { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pp-place svg { width: 16px; height: 16px; }
.pp-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.pp-next { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; }
.pp-next b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-next span { color: var(--olive); font-weight: 700; font-size: 14px; }
.pp-when { flex: none; font-size: 14px; color: var(--ink-2); }
.pp-bulk { display: flex; align-items: center; gap: 12px; background: var(--olive-tint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 16px; margin: -12px 0 24px; }
.pp-bulk .spacer { flex: 1; }
.phone .pp-grid { grid-template-columns: 1fr; }
.phone .pp-tools .search { width: 100%; }
.phone .pp-tools { width: 100%; }

/* ---------- stages as tiles (2026-09-25) ---------- */
.pp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.pp-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 22px 20px; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-xl); min-width: 0; font: inherit; }
.pp-tile:hover { border-color: var(--ink-3); }
.pp-tile.on { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.pp-tile-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.pp-tile-k { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pp-tile-n { font-size: 56px; font-weight: 800; letter-spacing: -0.05em; line-height: .9; }
.pp-chev { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.pp-tile.on .pp-chev { border-color: var(--dark-line); }
.pp-chev svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s ease; }
.pp-tile.on .pp-chev svg { transform: rotate(-90deg); }
.pp-avs { display: flex; }
.pp-avs .av { margin-left: -8px; box-shadow: 0 0 0 3px var(--card); }
.pp-tile.on .pp-avs .av { box-shadow: 0 0 0 3px var(--dark); }
.pp-avs .av:first-child { margin-left: 0; }
.pp-avs .more { background: var(--sunk); color: var(--ink); font-size: 14px; }
.pp-names { font-size: 15px; font-weight: 600; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pp-tile.on .pp-names { color: var(--on-dark-2); }
.pp-tile-next { display: flex; flex-direction: column; gap: 3px; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; min-width: 0; }
.pp-tile.on .pp-tile-next { border-top-color: var(--dark-line); }
.pp-tile-next .k { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pp-tile-next b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.pp-tile-next span:last-child:not(.k) { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pp-tile.on .pp-tile-next .k, .pp-tile.on .pp-tile-next span:last-child:not(.k) { color: var(--on-dark-2); }
.pp-open { margin-bottom: 28px; }
@media (max-width: 1180px) { .pp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.phone .pp-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
.phone .pp-tile { padding: 16px; border-radius: var(--r-lg); }
.phone .pp-tile-n { font-size: 40px; }
.phone .pp-names { display: none; }
.pp-avs { gap: 6px; max-width: 100%; min-width: 0; overflow: hidden; }
.pp-avs .av, .pp-avs .av:first-child { margin-left: 0; box-shadow: none; flex: none; }
.pp-tile.on .pp-avs .av { box-shadow: none; }
/* ⚠️ views/ui.js faceRow() counts the circles that fit; the overflow above is the backstop, so a
   future extra face clips INSIDE the card instead of hanging off the side of the page. */
.hs-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.hs-row .mini { flex: 1; min-width: 0; }
.hs-row .btn.small, .hs-row .tag { flex: none; }
.av-home { padding: 0; overflow: hidden; background: var(--sunk); }
.av-home img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* past clients: Buyers | Sellers, then a section per year */
.pp-sides { margin-bottom: 22px; }
.pp-year + .pp-year { margin-top: 30px; }

/* a stage's people open under its own row (see views/people.js list()) */
.pp-tiles { grid-auto-flow: row dense; }
.pp-tiles > .pp-open { grid-column: 1 / -1; margin: 4px 0 8px; }
/* a past client's commission: the amount leads, the label is quiet */
.pp-next.pp-comm span { color: var(--ink-2); font-weight: 600; order: -1; }
.pp-next.pp-comm b { font-size: 20px; letter-spacing: -0.02em; }

/* Log a call: the outcome chips are radios (2026-09-28) */
.chips .chip:has(input:checked) { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chips .chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.p-tile .p-tile-btn { margin-top: 10px; align-self: flex-start; }
/* the stage picker beside the type tag (2026-09-29): a pill with an arrow at the end */
.stage-pick { position: relative; display: inline-flex; align-items: center; }
.stage-pick select { appearance: none; -webkit-appearance: none; min-height: 34px; padding: 4px 38px 4px 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--card); color: var(--ink); cursor: pointer; }
.stage-pick select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.stage-pick svg { position: absolute; right: 12px; width: 16px; height: 16px; pointer-events: none; color: var(--accent); }

/* Tovah, 2026-09-29 ("clean up all them buttons"): the profile's choices sit in an even grid, same width, same height,
   one tidy block per group instead of ragged rows of different-length pills */
.pp-pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pp-pill span { width: 100%; justify-content: center; text-align: center; min-height: 42px; padding: 6px 12px; font-size: 14px; line-height: 1.2; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pp-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--card); }
.pp-pill input:focus-visible + span { outline-color: var(--accent); }
form .pp-group { gap: 8px; margin: 0 0 18px; }   /* the profile form only: .pp-group is also the People list's section */
form .pp-group > .muted.small { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
@media (max-width: 600px) { .pp-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 600px) {
  .people-notes .check { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 10px 12px; }
  .people-notes .check > .t { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
  .people-notes .check > .actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .people-notes .p-note { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .people-notes .p-note textarea, .people-notes .p-note-edit { box-sizing: border-box; width: 100%; min-width: 0; }
  .people-notes .p-note textarea { min-height: 80px; }
  .people-notes .p-note > .btn { align-self: flex-end; min-height: 44px; }
}
.phone .p-cols { grid-template-columns: minmax(0, 1fr); }
.phone .p-cols > * { min-width: 0; }

/* The People controls on a phone were four stacked rows of pills before a single person appeared
   (Tovah, 2026-10-04: "the stuff inside yellow box look sall cramped on mobile"). The lead filters
   become one row that scrolls, like the kind chips above them, and the rows sit closer together. */
@media (max-width: 600px) {
  .lt-bar { gap: 10px; }
  .lt-bar .chips.pp-sides { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  .lt-bar .chips.pp-sides::-webkit-scrollbar { display: none; }
  .lt-bar .chip { flex: none; }
  .pp-top + .chips, .pp-search { margin-top: 10px; }
}

/* ---------- the timeline's "View more" (2026-10-28) ----------
   Morgan: "have the timeline show the last 5 and then view more". A <details>, so there is no
   handler to go missing and nothing to restore after a repaint. */
.tl-more { margin-top: 2px; }
.tl-more > summary {
  cursor: pointer; list-style: none; padding: 10px 0 2px;
  font-size: 15px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.tl-more > summary::-webkit-details-marker { display: none; }
.tl-more > summary::after { content: "⌄"; font-size: 15px; line-height: 1; }
.tl-more[open] > summary::after { content: "⌃"; }
.tl-more > summary:hover { color: var(--ink); }
