/* ============================================================
   The parts the pages about people share (Home's follow-ups, a person's page, a company's page), each of
   which loads this after site.css, where the tokens and the dialog's base look are:
     the sheet that logs a note (note-sheet.js; TKT-0824, TKT-0889), the rows of pill choices in it, its
     one-tap lines, and the "Log this call?" offer;
     the buttons on a row that reach a person: Call, Text, Email.
   ============================================================ */

/* "Log this call?": shown once Call, Text or Email has been pressed, under the buttons that were pressed. */
.note-offer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--raise); font-weight: 600; }
.note-offer[hidden] { display: none; }
.note-offer span { flex: 1; min-width: 8ch; }

/* ==== THE SHEET THAT LOGS A NOTE ====
   A dialog on a wide screen; on a phone it sits at the bottom edge, in reach of a thumb, and slides up. */
dialog.note-sheet { --sheet-pad: 20px; --sheet-pad-bottom: 20px; width: min(520px, calc(100vw - 32px)); padding: var(--sheet-pad) var(--sheet-pad) var(--sheet-pad-bottom); transition: transform var(--dur-enter) var(--ease), opacity var(--dur-enter) var(--ease); }
@starting-style { dialog.note-sheet[open] { transform: translateY(16px); opacity: 0; } }
dialog.note-sheet .field-label, dialog.note-sheet label[for="note-text"], dialog.note-sheet label[for="note-who"] { display: block; margin: var(--space-4) 0 var(--space-2); font-size: calc(var(--type-2) * var(--text-scale)); font-weight: 600; }
dialog.note-sheet textarea { min-height: 88px; }
dialog.note-sheet .step-says { min-height: 1.4em; }
dialog.note-sheet #note-day { max-width: 220px; margin-top: var(--space-2); }
dialog.note-sheet label.check { display: flex; margin: var(--space-3) 0 0; min-height: var(--control-h-small); cursor: pointer; }
dialog.note-sheet .msg:empty { display: none; }
/* Save and Cancel stay at the bottom edge of the sheet while the rest scrolls under them: on a small phone the
   sheet is taller than the screen, and Save must not need a scroll to find. The row reaches the sheet's edges. */
dialog.note-sheet .actions { position: sticky; bottom: calc(var(--sheet-pad-bottom) * -1); display: grid; grid-template-columns: 2fr 1fr;
  margin: var(--space-3) calc(var(--sheet-pad) * -1) calc(var(--sheet-pad-bottom) * -1); padding: var(--space-3) var(--sheet-pad) var(--sheet-pad-bottom);
  background: var(--surface); border-top: 1px solid var(--line); }

/* A row of choices, one picked: radio buttons drawn as pills. The real radio button lies over its pill, unseen,
   so the whole pill is what a finger or a keyboard uses. */
.choice-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice-chips label { position: relative; margin: 0; }
.choice-chips input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-chips span { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border: 1px solid var(--control-line); border-radius: var(--radius-pill);
  font-size: calc(var(--type-3) * var(--text-scale)); font-weight: 600; user-select: none; transition: transform var(--dur-press) var(--ease); }
.choice-chips input:active + span { transform: scale(.97); }
@media (hover: hover) { .choice-chips input:hover + span { background: var(--raise); } }
.choice-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--ink-invert); }
.choice-chips input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .choice-chips span { min-height: 44px; } }

/* One tap writes the line into the note. Dashed, so they read as suggestions and not as the choices above. */
.quick-lines { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.quick-lines:empty { display: none; }
.quick-lines button { border-style: dashed; font-weight: 500; }

@media (max-width: 640px) {
  /* --keyboard: how much of the screen the phone's keyboard covers (person-notes.js sets it), so Save is never under it. */
  dialog.note-sheet { --sheet-pad: var(--space-4); --sheet-pad-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); width: 100vw; max-width: 100vw;
    max-height: calc(100dvh - 24px - var(--keyboard, 0px)); margin: auto 0 var(--keyboard, 0px); border-width: 1px 0 0; border-radius: 20px 20px 0 0; }
  @starting-style { dialog.note-sheet[open] { transform: translateY(100%); opacity: 1; } }
}

/* The buttons that reach a person. Call is the strong one: it is what these rows are for.
   (Home's follow-up rows, a company's people.) */
.reach-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--control-line); border-radius: var(--radius-pill); color: var(--ink); text-decoration: none; font-weight: 600; user-select: none;
  transition: transform var(--dur-press) var(--ease); }
.reach-btn .reach-icon { display: grid; place-items: center; }
.reach-btn svg { width: 18px; height: 18px; }
.reach-btn.call { padding: 0 16px 0 12px; background: var(--ink); border-color: var(--ink); color: var(--ink-invert); }
.reach-btn:active { transform: scale(.97); }
.reach-btn.off { border-style: dashed; color: var(--muted); cursor: not-allowed; }
@media (hover: hover) { .reach-btn:not(.call):not(.off):hover { background: var(--raise); } }
@media (pointer: coarse) { .reach-btn { min-height: 44px; } }

/* "Who was it with?": the people the phone's Log button offers (log-anywhere.js), one big row each. */
.log-people { list-style: none; display: grid; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; }
.log-people button { display: block; width: 100%; min-height: 56px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-control); text-align: left; white-space: normal; }
.log-people button b { display: block; }
.log-people button .sub { display: block; margin: 0; color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); font-weight: 400; }
dialog.log-who .actions { grid-template-columns: 1fr auto; }

