/* ============================================================
   Home only (/home): the dashboard a person arranges and its Customize mode (TKT-0891), "Follow-ups due"
   (TKT-0888, TKT-0889), the numbers, the map and the key clients, and the buttons shrunk to a row. home.html loads it right after site.css, where the tokens and the shared parts (cards,
   tags, buttons) are; the buttons that reach a person, the pill choices and the "Log this call?" offer are in people.css.
   ============================================================ */

/* ==== THE DASHBOARD (home-dashboard.js): panels in holders, in the person's order ====
   Two columns on a wide screen, where a panel is full width or half; one column on a narrow one. */
.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.dash-item { grid-column: 1 / -1; min-width: 0; }
.dash-item[hidden] { display: none; }
.dash-item > .card { margin: 0; }
@media (min-width: 901px) { .dash-item[data-width="half"] { grid-column: span 1; } }
.dashboard .stats { margin-bottom: 0; }
/* The four numbers sit two by two in a half-width panel, and on a phone. */
@media (min-width: 901px) { .dash-item[data-width="half"] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dashboard .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); } }
#numbers-note:empty { display: none; }
#home-map-canvas { height: 360px; background: var(--map-bg); }
#home-map .map-tools h2 { margin: 0; }
#home-map-note { margin: 0; padding: var(--space-2) var(--space-4) var(--space-3); }
#home-map-note:empty { display: none; }
#key-clients .fu-row .fu-title { font-weight: 700; }

/* ==== CUSTOMIZE: arranging the panels ==== */
.customize-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--raise); }
.customize-bar[hidden], .hidden-panels[hidden], #customize[hidden] { display: none; }   /* a flex row or a button would show anyway */
.customize-words b { display: block; }
.customize-bar .sub, .hidden-panels .sub { color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); }
.customize-presets, .customize-actions, .panel-tool-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The strip above each panel while arranging: its name and what can be done to it. The panel under it is dimmed
   and cannot be pressed: it is being placed, not used. */
.panel-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3); border: 1px dashed var(--control-line); border-radius: var(--radius-control); background: var(--surface); }
body.customizing .dash-item > :not(.panel-tools) { opacity: .6; pointer-events: none; }
@media (max-width: 900px) { .wide-screen-only { display: none; } }   /* half and full width are the same thing in one column */
.hidden-panels { margin-top: var(--space-4); }
.hidden-panels h2 { margin: 0 0 var(--space-3); }
.hidden-panels ul { list-style: none; display: grid; gap: var(--space-3); margin: 0; padding: 0; }
.hidden-panels li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.hidden-panels li .sub { display: block; }
.hidden-panels .customize-actions { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }

.fu-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.fu-head h2 { margin: 0; }
.fu-count { min-height: 1.4em; margin: 2px 0 0; color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); }
/* Under the list, so nothing stands between the heading and the first Call button. */
.fu-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.fu-foot:has(> :not([hidden])) { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.fu-scope { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-left: auto; color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); }
.follow-ups [hidden] { display: none; }   /* a button or a flex row would show anyway */

/* One row: what it is about and how late, then each person to call with the buttons that reach them. */
.fu-list { list-style: none; margin: 0; padding: 0; }
.fu-list > li.hint { max-width: 62ch; margin: 0; }
.fu-row { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.fu-row:first-child { padding-top: 0; border-top: 0; }
.fu-row:last-child { padding-bottom: 0; }
.fu-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.fu-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); min-width: 0; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.fu-kind { font-size: calc(11px * var(--text-scale)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fu-top .tag { flex: none; }
.fu-top .tag:not(.red):not(.amber) { background: var(--raise); }
.fu-sub { max-width: 70ch; margin: 2px 0 0; color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); overflow-wrap: anywhere; }
.fu-people { list-style: none; display: grid; gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; }
.fu-person { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.fu-who { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.fu-who a, .fu-who b { font-weight: 600; }
.fu-who .sub { display: block; color: var(--muted); font-size: calc(var(--type-2) * var(--text-scale)); }
.fu-nobody { color: var(--muted); }
.fu-reach { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.fu-person .note-offer { flex-basis: 100%; }

/* Office staff: the six big buttons become a row of small ones. The list above is the page; the top menu
   already goes everywhere these do. */
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-2); }
/* a small tile: its drawing, its name, and under the name a badge when it has one ("Demo") */
.tiles.compact .tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; column-gap: var(--space-3); min-height: 0; padding: var(--space-3); }
.tiles.compact .tile .icon { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px; }
.tiles.compact .tile .icon svg { width: 20px; height: 20px; }
.tiles.compact .tile > span:not(.icon):not(.badge) { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.tiles.compact .tile:has(.badge) > span:not(.icon):not(.badge) { grid-row: 1; }
.tiles.compact .tile h2 { margin: 0; font-size: calc(var(--type-3) * var(--text-scale)); overflow-wrap: anywhere; }
.tiles.compact .tile .kicker, .tiles.compact .tile p { display: none; }
.tiles.compact .tile .badge { position: static; grid-column: 2; grid-row: 2; justify-self: start; margin-top: 2px; }
@media (max-width: 640px) { .tiles.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
