/* THE CONTACTS ROOM (view-contacts: In Touch, the People list) — its stylesheet.
 *
 * Linked right after app.css (see the room-css markers in index.html). Holds the
 * rules that only this room's elements use: the tick-box and the bulk bar, the tag
 * bar, the "people in your mail" strip and dialog, the Add-a-contact form, the
 * just-saved ring, and the ⋯ More menu on the toolbar. Rules the organisations
 * room or the contact detail share (.contact-row, .cl-row, .cs-chip, .contact-tag,
 * .view-mode, .found-x, #contactList's grid) stay in app.css.
 *
 * Moved from app.css in the 15 Oct rebuild with the same selectors and
 * declarations in the same relative order. No !important was ever used on these
 * rules, so none was removed; the one rule that matched nothing, .contact-filters,
 * is gone.
 */

:root[data-mode="light"] .tag-chip.on{
  background:linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--blue) 82%, var(--neutral-2)));
  color:var(--on-accent); }

/* "The Hellands" is a heading OVER a group of cards, not a card. Without this
   it takes a cell of its own and the household it names begins in the cell
   beside it, so the label reads as a sibling of the people it introduces.
   Wrong at two columns as well; three only makes it easier to see. */
#contactList > .section-label{ grid-column:1 / -1; }

.cl-row .contact-pick{ margin:0; }

/* ==========================================================================
   A FORM ABOUT A PERSON — row 1744.
   ==========================================================================
   "Pretty generic. Need to move this up in quality quite a bit."

   The add-a-contact form was six .field boxes stacked down the full width of
   the page. At 1440 that is a box 1,780 pixels wide to hold a first name; on
   the screen he actually works on it is half as wide again. A form laid out
   that way is not laid out — it is what you get when nobody decided, and it
   reads as exactly that.

   Three rules, and each is arithmetic rather than taste:

     · A BOX IS AS WIDE AS WHAT GOES IN IT. Two columns of about 340px, which
       is twice the longest name anybody types and still wide enough for a
       long address across both. The form is capped at 760 so it does not
       grow with the window — nothing in it gets better at 1,200px.
     · RELATED THINGS SIT TOGETHER. First and last on one line because they
       are one answer; email and phone on one line because they are one
       question — how do I reach them; company and role for the same reason.
     · A LABEL IS NOT A PLACEHOLDER. A placeholder disappears at the exact
       moment it is needed, which is while the box is being filled in. These
       are real labels above the box, and the <label> wraps its input so
       pressing the word focuses the field.

   No hex below — every colour is a token, which is what keeps this working
   on all fourteen grounds rather than on the one it was drawn against. */
.people-form{ padding:var(--space-5) var(--space-6) var(--space-5); margin-bottom:var(--space-5); max-width:760px; }
.people-form .pf-lede{ margin:0 0 var(--space-4); }
/* auto-fit with a 240px floor: two columns on any real window, one on a
   phone, and no media query to keep in step with the card grid above. */
.pf-grid{ display:grid; gap:var(--space-4) var(--space-4);
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pf-field{ display:flex; flex-direction:column; gap:var(--space-2); min-width:0; }
/* Spanning both columns. Notes is a paragraph, and a paragraph in a
   half-width box is a paragraph you cannot read back. */
.pf-wide{ grid-column:1 / -1; }
.pf-label{ font-size:var(--type-body); font-weight:600; letter-spacing:.02em; color:var(--text-dim); }
/* .field carries its own bottom margin for the stacked layout it was written
   for; in a grid the gap does that job and the margin would leave every row
   of this form sitting crooked against its neighbour. */
.pf-field .field{ margin-bottom:0; width:100%; }
.pf-field textarea.field{ min-height:62px; resize:vertical; }
/* The sentence under the phone box. --text-dim and not --text-faint: it is
   the only thing on the form that explains what a field DOES, so it has to
   be readable rather than merely present. */
.pf-hint{ font-size:var(--type-body); color:var(--text-dim); }
.people-form .pf-actions{ margin:var(--space-5) 0 0; }
/* WHERE A FAILED SAVE LANDS. Colour is not the only thing saying it — there
   is a rule down the left edge too, because a message told in colour alone
   is a message somebody may not be shown. */
.pf-error{ margin:var(--space-4) 0 0; padding:var(--space-3) var(--space-3); border-radius:var(--radius-card);
  border-left:3px solid var(--cat-red-text);
  background:color-mix(in srgb, var(--cat-red) 12%, transparent);
  color:var(--text); font-size:var(--type-body); line-height:1.5; }

/* THE ROW THAT WAS JUST WRITTEN, lit for two and a half seconds.
   A save you cannot see is the other half of "create contact does not save":
   this list is sorted by closeness, and a new contact with no mail history
   lands in the middle of several hundred people. This is what makes the
   scroll arrive somewhere he can see it worked.

   A ring rather than a fill, because the cards already carry a category
   colour on their own panel and a second wash over it would read as a
   different category rather than as attention. */
.just-saved{ animation:justSaved 2.6s var(--ease-out) both; }
@keyframes justSaved{
  0%   { box-shadow:0 0 0 2px var(--accent), 0 0 26px color-mix(in srgb, var(--accent) 45%, transparent); }
  70%  { box-shadow:0 0 0 2px var(--accent), 0 0 26px color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow:0 0 0 0 transparent, 0 0 0 transparent; }
}
/* Somebody who has asked for less movement gets the ring without the fade:
   the point is to say WHICH ROW, and that does not need an animation. */
@media (prefers-reduced-motion: reduce){
  .just-saved{ animation:none; box-shadow:0 0 0 2px var(--accent); }
}

/* ==========================================================================
   THE ⋯ MORE MENU ON THE IN TOUCH TOOLBAR — row 1740.
   ==========================================================================
   Six of the seven buttons on this page's toolbar were things somebody does
   two or three times a year, and all seven were the same grey pill. They are
   under a chevron now — the same .from-selector / .from-menu / .more-item
   the compose window uses, so Lucid has one disclosure idiom and not two.

   What this block changes about .more-item is the SHAPE of a row, and the
   reason is the whole argument for rolling them up. The compose menu's items
   are one short phrase and a tick, so `space-between` and `nowrap` are right
   there. These six need the sentence that was previously only in a hover
   title: "Import a vCard" and "Fill from email" tell you nothing about which
   one you want, and a hover title does not exist on a tablet at all. So the
   label and its sentence stack, and the menu is wide enough for the sentence
   to be one line.

   Scoped by .people-more-menu, so the compose menu is untouched. */
/* There used to be `.people-more-menu{ min-width:380px; }` here. It never took
   effect: .from-menu{ min-width:230px } sits further down app.css at the same
   specificity and always won, so the menu has been 230px wide since it was
   written. The dead declaration is removed rather than "fixed" - the rebuild
   keeps every pixel. Matt: if the 380px menu was what you wanted, say so and it
   is one line (.people-more-menu.from-menu{ min-width:380px }). */
.people-more-menu .more-item{
  flex-direction:column; align-items:flex-start; gap:var(--space-1);
  white-space:normal; padding:var(--space-3) var(--space-4); }
.people-more-menu .more-item-note{
  font-size:var(--type-body); font-weight:400; color:var(--text-dim);
  /* Aligned under the label rather than under the icon, so the six sentences
     make a straight edge down the menu. 15px icon plus the 9px gap, both
     from the .more-item-label rule this menu inherits. */
  padding-left:var(--space-6); }

/* People Lucid found in the mail. One line above the contact list, never a
   block of suggestions inside it — the version that lived in the list was
   removed for exactly that reason. */
/* Picking several people at once. The box is always there rather than
   revealed on hover: a control you have to discover by waving the mouse at a
   row is a control nobody uses. */
/* In the corner of the card, inside .cc-head — which is already a
   space-between row — rather than as a child of .contact-row, which is a
   column and would have given it a full-width band of its own. */
.contact-pick{ flex:none; width:17px; height:17px; accent-color:var(--blue);
  cursor:pointer; margin:var(--space-hair) 0 0; }
.contact-bulk{ display:flex; align-items:center; gap:var(--space-3); flex-wrap:wrap;
  margin-bottom:var(--space-4); padding:var(--space-3) var(--space-4); border-radius:var(--radius-card);
  border:1px solid var(--glass-border-hi); background:var(--glass-bg); font-size:var(--type-body); }
.contact-bulk-n{ font-weight:600; }
.contact-tagbar{ display:flex; align-items:center; gap:var(--space-2); flex-wrap:wrap; margin-bottom:var(--space-3); }
.tag-chip{ font-size:var(--type-body); font-weight:600; padding:var(--space-1) var(--space-3); border-radius:var(--radius-pill);
  border:1px solid var(--glass-border-hi); cursor:pointer; color:var(--text-dim); }
.tag-chip:hover{ color:var(--text); }
.tag-chip.on{ color:var(--ink); background:linear-gradient(135deg,var(--blue),var(--blue-2)); border-color:transparent; }

.found-bar{ display:flex; align-items:center; gap:var(--space-4); margin-bottom:var(--space-4);
  padding:var(--space-3) var(--space-4); border-radius:var(--radius-card); border:1px solid var(--glass-border);
  background:var(--glass-bg); font-size:var(--type-body); }
.found-what{ flex:1; min-width:0; color:var(--text); }
.found-list{ max-height:min(56vh, 520px); overflow-y:auto; margin:0 calc(var(--space-1) * -1); padding:0 var(--space-1); }
.found-group{ font-size:var(--type-label); font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-dim); margin:var(--space-4) 0 var(--space-1); }
.found-group:first-child{ margin-top:var(--space-1); }
.found-row{ display:flex; align-items:center; gap:var(--space-3); padding:var(--space-2) 0;
  border-bottom:1px solid var(--glass-border); font-size:var(--type-body); }
.found-row:last-child{ border-bottom:none; }
.found-row input[type=checkbox]{ flex:none; width:16px; height:16px; accent-color:var(--blue); cursor:pointer; }
/* Two columns of names instead of one long scroll. A group heading must never
   be the last thing in a column with its list starting in the next one, and a
   row must never be sliced in half across the gutter — both are break rules,
   not layout rules, which is why columns are right here and grid is not. */
@media(min-width:700px){
  .found-list{ column-count:2; column-gap:var(--space-8); }
  .found-group{ break-after:avoid; }
  .found-row{ break-inside:avoid; }
}
.found-main{ flex:1; min-width:0; }
.found-name{ font-weight:600; }
.found-meta{ display:block; font-size:var(--type-label); color:var(--text-dim); margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
