/* The three screens: Overview, Works, People */

.section { display: flex; flex-direction: column; gap: var(--gap-items); }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-items); }
.section__title { font-size: var(--fs-20); font-weight: var(--weight-heavy); line-height: var(--lh-tight); }
.hint { font-size: var(--fs-14); color: var(--text-muted); }
.meta { font-size: var(--fs-14); color: var(--text-muted); overflow-wrap: anywhere; }
.meta--alert { color: var(--alert-fg); font-weight: var(--weight-medium); }
.meta--soon { color: var(--soon-fg); font-weight: var(--weight-medium); }
.group { display: flex; flex-direction: column; gap: var(--gap-group); }

/* ---- Overview: needs attention ---- */
.attn-list { display: flex; flex-direction: column; }
.attn-list > li { padding: var(--space-12) 0; box-shadow: inset 0 calc(var(--hairline) * -1) 0 var(--line); }
.attn-list > li:first-child { padding-top: 0; }
.attn-list > li:last-child { padding-bottom: 0; box-shadow: none; }
.attn-row {
  display: flex; flex-direction: column; gap: var(--gap-group); width: 100%; min-height: var(--target-min);
  padding: 0; border: 0; background: none; text-align: left;
}
.attn-row__title { font-weight: var(--weight-heavy); line-height: var(--lh-tight); overflow-wrap: anywhere; }

/* ---- Overview: counts ---- */
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-items); }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--gap-group);
  min-height: var(--target-min); padding: var(--tile-pad); border: 0; border-radius: var(--radius-16);
  background: var(--surface-card); box-shadow: var(--shadow-card); text-align: left;
  transition: transform var(--ms-fast) var(--ease-out);
}
.tile:active { transform: scale(var(--press-scale)); }
.tile__num { font-size: var(--fs-24); font-weight: var(--weight-heavy); line-height: var(--lh-tight); }
.tile__label { font-size: var(--fs-12); color: var(--text-muted); overflow-wrap: anywhere; }
.tile--alert .tile__num { color: var(--alert-fg); }
.tile--done .tile__num { color: var(--done-fg); }

/* ---- Overview: seven stages as a step line ---- */
.stages-scroll { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.stages-scroll::-webkit-scrollbar { display: none; }
.stages-scroll.can-right { -webkit-mask-image: linear-gradient(to right, black 0, black 85%, transparent); mask-image: linear-gradient(to right, black 0, black 85%, transparent); }
.stages-scroll.can-left { -webkit-mask-image: linear-gradient(to left, black 0, black 85%, transparent); mask-image: linear-gradient(to left, black 0, black 85%, transparent); }
.stages-scroll.can-left.can-right { -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); }
.stages { display: flex; }
.stage {
  position: relative; flex: 1 0 var(--step-w); display: flex; flex-direction: column; align-items: center;
  gap: var(--gap-items); padding: 0 var(--space-4); border: 0; background: none; text-align: center;
}
.stage + .stage::before {
  content: ""; position: absolute; top: calc(var(--target-min) / 2 - var(--connector-h) / 2);
  left: -50%; width: 100%; height: var(--connector-h); background: var(--line-strong);
}
.stage__count {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: var(--target-min); height: var(--target-min); border-radius: var(--radius-full);
  background: var(--surface-card); box-shadow: inset 0 0 0 var(--focus-w) var(--line-strong);
  font-size: var(--fs-16); font-weight: var(--weight-heavy);
}
.stage--done .stage__count { color: var(--done-fg); box-shadow: inset 0 0 0 var(--focus-w) var(--done-fg); }
.stage__label { font-size: var(--fs-12); color: var(--text-muted); overflow-wrap: anywhere; }

/* ---- Overview: manifesto points ---- */
.pillars { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-items); }
.pillar {
  display: flex; flex-direction: column; gap: var(--gap-items); width: 100%;
  padding: var(--card-pad); border: 0; border-radius: var(--radius-16);
  background: var(--surface-card); box-shadow: var(--shadow-card); text-align: left;
}
.pillar__name { font-weight: var(--weight-heavy); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.bar { height: var(--bar-h); border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.bar__fill { height: 100%; border-radius: var(--radius-full); background: var(--done-fg); }

/* ---- Overview: wards (4 per row on phone, 7 on computer, no orphan) ---- */
.wards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-items); }
.ward--whole { grid-column: 1 / -1; }
.ward { gap: var(--gap-group); justify-content: flex-start; }
.ward__name { font-size: var(--fs-20); font-weight: var(--weight-heavy); line-height: var(--lh-tight); }
.ward--whole .ward__name { font-size: var(--fs-16); }

/* ---- Works: search + filter chips on one even row ---- */
.works-toolbar { display: flex; flex-direction: column; gap: var(--gap-items); }
.chips {
  display: flex; gap: var(--gap-items); padding-block: var(--space-4);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }
.chips.can-right { -webkit-mask-image: linear-gradient(to right, black 0, black 90%, transparent); mask-image: linear-gradient(to right, black 0, black 90%, transparent); }
.chips.can-left { -webkit-mask-image: linear-gradient(to left, black 0, black 90%, transparent); mask-image: linear-gradient(to left, black 0, black 90%, transparent); }
.chips.can-left.can-right { -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.chips--phone { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.chip__badge {
  display: inline-grid; place-items: center; min-width: var(--space-16); padding: 0 var(--space-4);
  border-radius: var(--radius-full); background: var(--key-ink); color: var(--on-key-ink); font-size: var(--fs-12);
}
.meta-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--gap-group) var(--gap-items); }
.meta-row .meta--end { margin-inline-start: auto; text-align: right; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-items); min-height: var(--btn-h); }
.work-list { display: flex; flex-direction: column; gap: var(--gap-items); }
.work-card {
  display: flex; flex-direction: column; gap: var(--gap-items); width: 100%;
  padding: var(--card-pad); border: 0; border-radius: var(--radius-16);
  background: var(--surface-card); box-shadow: var(--shadow-card); text-align: left;
}
.work-card__title { font-size: var(--fs-16); font-weight: var(--weight-heavy); line-height: var(--lh-tight); overflow-wrap: anywhere; }

/* ---- Works on a computer: a real table with a sticky header row ---- */
.table-card { background: var(--surface-card); border-radius: var(--radius-16); box-shadow: var(--shadow-card); }
.works-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.works-table th {
  position: sticky; top: var(--tab-h); z-index: 2; background: var(--surface-card);
  padding: var(--space-12) var(--space-16); text-align: left;
  font-size: var(--fs-12); font-weight: var(--weight-heavy); color: var(--text-muted);
  box-shadow: inset 0 calc(var(--hairline) * -1) 0 var(--line);
}
.works-table th:first-child { border-top-left-radius: var(--radius-16); }
.works-table th:last-child { border-top-right-radius: var(--radius-16); }
.works-table td {
  padding: var(--space-12) var(--space-16); vertical-align: baseline; font-size: var(--fs-14);
  overflow-wrap: anywhere; box-shadow: inset 0 calc(var(--hairline) * -1) 0 var(--line);
}
.works-table tbody tr { cursor: pointer; }
.works-table tbody tr:last-child td { box-shadow: none; }
.works-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-16); }
.works-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-16); }
@media (hover: hover) { .works-table tbody tr:hover td { background: var(--surface-sunken); } }
.c-work { width: 31%; } .c-stage { width: 18%; } .c-ward { width: 10%; }
.c-person { width: 14%; } .c-due { width: 12%; } .c-update { width: 15%; }
.works-table td:last-child { white-space: nowrap; }

/* ---- People ---- */
.people-list { display: flex; flex-direction: column; gap: var(--gap-items); }
.person {
  display: grid; align-items: center; gap: var(--gap-items);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "id more" "contact contact" "works works";
}
.person__id { grid-area: id; display: flex; flex-direction: column; gap: var(--gap-group); min-width: 0; }
.person__name { font-size: var(--fs-16); font-weight: var(--weight-heavy); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.person__role { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-group) var(--gap-items); }
.person__contact { grid-area: contact; display: flex; align-items: center; justify-content: space-between; gap: var(--gap-items); }
.person__contact-text { display: flex; flex-wrap: wrap; gap: var(--gap-group) var(--gap-items); min-width: 0; font-size: var(--fs-16); overflow-wrap: anywhere; }
.person__works { grid-area: works; display: flex; justify-content: flex-start; }
.person__more { grid-area: more; }
.phone-text { font-size: var(--fs-16); user-select: all; -webkit-user-select: all; }

@media (min-width: 1024px) {
  .counts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wards { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ward--whole { grid-column: span 2; }
  .works-toolbar { flex-direction: row; align-items: center; }
  .works-toolbar .search { flex: 0 0 var(--search-w); }
  .works-toolbar .chips { flex: 1 1 auto; min-width: 0; }
  .person {
    gap: var(--space-16);
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 2fr) auto;
    grid-template-areas: "id contact works more";
  }
}
