body {
  font: 16px system-ui;
  margin: 0;
  background: #f4f5f7;
  color: #18232e;
}
header,
main {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: 26px;
  margin-right: auto;
}
button,
input,
select {
  font: inherit;
  padding: 12px;
  border: 1px solid #bac3cd;
  border-radius: 8px;
  background: white;
}
button {
  cursor: pointer;
}
button:focus {
  outline: 3px solid #73b1df;
}
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.card {
  text-align: left;
  padding: 10px;
}
.card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #e4e8eb;
}
.card small {
  display: block;
  margin-top: 6px;
}
dialog {
  max-width: 960px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 14px;
}
dialog::backdrop {
  background: #0009;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pair img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #e4e8eb;
}
#alternates {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
#alternates img {
  height: 70px;
}
#candidates {
  display: flex;
  overflow: auto;
  gap: 10px;
}
#candidates img {
  width: 90px;
  height: 100px;
  object-fit: contain;
}
#status {
  color: #455565;
  min-height: 24px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
#login {
  max-width: 400px;
  margin: 40px auto;
}
#login input {
  display: block;
  margin: 12px 0;
  width: 90%;
}
p {
  line-height: 1.5;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 24px;
}
.camera-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.camera-switch button {
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 650;
}
.camera-switch button[aria-pressed="true"] {
  background: #204fa8;
  color: #fff;
  border-color: #204fa8;
}
.seg-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.seg-switch button {
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 650;
}
.seg-switch button[aria-pressed="true"] {
  background: #204fa8;
  color: #fff;
  border-color: #204fa8;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
button.busy {
  pointer-events: none;
  cursor: progress;
  opacity: 0.85;
}
button.busy::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: spin 0.7s linear infinite;
}
button.busy::after {
  content: attr(data-elapsed);
  margin-left: 0.5em;
  font-variant-numeric: tabular-nums;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2147483647;
  max-width: min(92vw, 640px);
  padding: 12px 18px;
  border-radius: 10px;
  background: #1b2a3a;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: 0 6px 24px #0005;
  cursor: pointer;
}
.toast-error {
  background: #9b1c1c;
}
.actions[hidden] {
  display: none;
}
.regular-day h3 {
  margin: 16px 0 4px;
}
.regular-day h3::first-letter {
  text-transform: uppercase;
}
.regular-tile {
  display: inline-block;
  vertical-align: top;
  margin: 6px 6px 6px 0;
  padding: 8px;
  border: 2px solid #d6dce3;
  border-radius: 10px;
  background: #fff;
  max-width: 220px;
}
.regular-tile.flag {
  border-color: #c0392b;
}
.regular-tile img {
  height: 110px;
  margin: 0 4px 4px 0;
  border-radius: 6px;
  object-fit: contain;
  background: #e4e8eb;
  cursor: zoom-in;
}
.regular-tile small {
  display: block;
}
#regularDialog {
  width: min(960px, 96vw);
}
#regularTemplates {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d6dce3;
  border-radius: 10px;
}
.directory-head {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.directory-head > div {
  margin-right: auto;
}
.directory-head h2 {
  font-size: 30px;
  margin: 0;
}
.directory-head p {
  margin: 4px 0;
  color: #586675;
}
.person-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border-color: #e1e5ea;
}
.person-row img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  background: #e4e8eb;
}
.person-row span {
  display: grid;
  gap: 6px;
}
.person-row strong {
  font-size: 19px;
}
.person-row small,
.portrait-tile small {
  color: #586675;
}
.person-row:hover,
.portrait-tile:hover {
  border-color: #2768ad;
  background: #f5f9fd;
}
#portraitGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.portrait-tile {
  text-align: left;
  padding: 8px;
}
.portrait-tile img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #e4e8eb;
}
.portrait-tile small {
  display: block;
  margin-top: 8px;
}
#portraitDialog {
  max-width: 800px;
}
#portraitLarge {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 16px auto;
}
#personDialog {
  width: min(900px, 90vw);
}
.decision {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 10px 0;
  border-top: 1px solid #bac3cd;
  z-index: 2;
}
.decision button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  header,
  main {
    padding: 16px;
  }
  dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    box-sizing: border-box;
    border-radius: 0;
    padding: 16px;
  }
  .pair img {
    height: 190px;
  }
  .decision {
    flex-wrap: nowrap;
  }
  .decision button {
    flex: 1;
    padding: 10px 4px;
    font-size: 14px;
  }
}
body {
  background: #f5f6f5;
  color: #1f2926;
  font-family: Inter, system-ui, sans-serif;
}
header {
  border-bottom: 1px solid #e5e9e5;
  max-width: none;
  padding: 18px max(20px, calc((100vw - 1160px) / 2));
  background: #fff;
}
main {
  max-width: 1160px;
}
h1 {
  font-size: 22px;
  letter-spacing: -0.03em;
}
button,
input,
select {
  border-color: #d6ddd8;
  border-radius: 10px;
}
button:hover {
  background: #f4f8f5;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #79a88c;
  outline-offset: 2px;
}
.tabs {
  border-bottom: 1px solid #dce4dc;
  padding-bottom: 14px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: #375e47;
  font-weight: 650;
}
.directory-head {
  background: #fff;
  padding: 24px;
  border: 1px solid #e3e9e3;
  border-radius: 18px;
}
.directory-head input {
  min-width: 280px;
}
.person-row {
  border-radius: 14px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 3px 14px #25342a0b;
}
.person-row img {
  width: 76px;
  height: 76px;
}
.person-row strong {
  font-size: 20px;
}
.person-row small {
  font-size: 14px;
}
#personDialog {
  border: 1px solid #e2e8e2;
  box-shadow: 0 24px 70px #17251b33;
}
#portraitGrid {
  margin: 20px 0;
}
.portrait-tile {
  background: #fff;
  border-radius: 12px;
}
.portrait-tile img {
  border-radius: 8px;
}
@media (max-width: 600px) {
  header {
    padding: 16px;
  }
  .directory-head {
    padding: 16px;
  }
  .directory-head input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .person-row img {
    width: 60px;
    height: 60px;
  }
  .person-row strong {
    font-size: 17px;
  }
  #personDialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    border-radius: 0;
  }
  #portraitGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.help {
  background: #fff;
  border: 1px solid #d6ddd8;
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
}
.help li {
  margin: 12px 0;
  line-height: 1.5;
}
.help summary {
  cursor: pointer;
  font-weight: 700;
}
.live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.live-card {
  background: #fff;
  border: 1px solid #dfe7df;
  border-radius: 16px;
  padding: 14px;
}
.live-card h3 {
  margin: 0 0 12px;
}
.live-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #17221d;
  border-radius: 10px;
}
.live-card p {
  margin: 10px 0 0;
  color: #52655a;
}
@media (max-width: 700px) {
  .live-grid {
    grid-template-columns: 1fr;
  }
}
.suggestion-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.suggestion-choices label {
  display: grid;
  gap: 4px;
  border: 1px solid #d6ddd8;
  border-radius: 8px;
  padding: 6px;
}
.suggestion-choices img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}
.suggestion-choices input {
  justify-self: start;
}
.template-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #d9efe0;
  color: #185633;
  font-size: 13px;
  font-weight: 700;
}
.template-badge.inactive {
  background: #e9eeeb;
  color: #52655a;
}
.portrait-tile.is-template {
  border-color: #4c9765;
  background: #f5fbf6;
}
#portraitTemplateStatus {
  font-weight: 700;
}
#suggestionNotice {
  color: #185633;
  font-weight: 650;
}
.attendance-controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.attendance-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
}
.attendance-days button {
  min-width: 86px;
  display: grid;
  gap: 4px;
  text-align: center;
  color: #536276;
}
.attendance-days button strong {
  font-size: 16px;
  color: #172333;
}
.attendance-days button[aria-pressed="true"] {
  background: #204fa8;
  border-color: #204fa8;
  color: #fff;
}
.attendance-days button[aria-pressed="true"] strong {
  color: #fff;
}
.attendance-calendar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.attendance-calendar input {
  width: 150px;
}
.attendance-calendar.picker-supported input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border: 0;
}
#attendanceSelected {
  font-weight: 650;
  margin: 20px 0 4px;
}
#attendanceSelected:first-letter {
  text-transform: uppercase;
}
@media (max-width: 700px) {
  .attendance-days {
    width: 100%;
    flex-basis: 100%;
  }
  .attendance-days button {
    min-width: 74px;
    padding: 10px;
  }
  .attendance-calendar {
    width: 100%;
  }
}
.open-review-link {
  display: block;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #b8c6db;
  border-radius: 6px;
  text-align: center;
  color: #204fa8;
  font-size: 13px;
  text-decoration: none;
}
.open-review-link:hover {
  background: #f2f6ff;
}
.regular-tile .open-review-link {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
}
.regular-tile .open-review-link img {
  display: block;
}

body {
  background: #f7f8fa;
  color: #172333;
  font-family: system-ui, sans-serif;
}
header,
main {
  max-width: 1440px;
}
header {
  border-bottom: 1px solid #d6dce3;
}
button,
input,
select {
  border-color: #d6dce3;
  border-radius: 7px;
  color: #172333;
}
button:hover {
  border-color: #204fa8;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #6794e2;
  outline-offset: 2px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
}
.tabs button {
  white-space: nowrap;
}
.live-card,
.person-row {
  border-radius: 10px;
  border: 1px solid #d6dce3;
  box-shadow: none;
}
.live-card img {
  aspect-ratio: 16/9;
}
.person-row {
  width: 100%;
  text-align: left;
  background: #fff;
  margin-bottom: 8px;
}
.person-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.person-row small {
  color: #536276;
}
dialog {
  border: 1px solid #d6dce3;
  border-radius: 10px;
}
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}
@media (max-width: 700px) {
  header,
  main {
    padding: 14px;
  }
  .tabs button {
    padding: 10px;
    font-size: 14px;
  }
  .live-grid {
    grid-template-columns: 1fr;
  }
}

.tabs button[aria-current="page"] {
  background: #204fa8;
  color: white;
}
.directory-head {
  border-radius: 10px;
  padding: 16px;
}
.person-row {
  padding: 10px 14px;
}
.person-row img {
  width: 52px;
  height: 52px;
}
.person-row strong {
  font-size: 16px;
}
.person-row small {
  font-size: 13px;
}
.live-card {
  padding: 16px;
}
.live-card h3 {
  font-size: 18px;
}
.pair {
  align-items: start;
}
.pair img {
  border-radius: 8px;
}
.decision {
  box-shadow: 0 -6px 18px #1723330d;
}
.decision button:first-child {
  background: #204fa8;
  color: #fff;
}
.portrait-tile {
  border-radius: 8px;
}
.tabs button {
  min-height: 44px;
}
#reviewWorkspace .actions {
  background: white;
  border: 1px solid #d6dce3;
  border-radius: 10px;
  padding: 12px;
}
#personDialog h2 {
  font-size: 24px;
}
#personSummary {
  color: #536276;
}
@media (max-width: 600px) {
  .tabs {
    overflow-x: auto;
  }
  .tabs button {
    flex: 1;
    min-width: max-content;
  }
  .directory-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .directory-head > div,
  .directory-head input {
    grid-column: 1/-1;
    width: 100%;
  }
  #reviewWorkspace .actions > * {
    max-width: 100%;
  }
  .pair {
    gap: 8px;
  }
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.person-header h2 {
  margin: 12px 0 0;
}
.person-menu {
  position: relative;
}
.person-menu summary {
  cursor: pointer;
  padding: 12px;
  border: 1px solid #d6dce3;
  border-radius: 7px;
}
.person-menu button {
  margin-top: 8px;
  color: #a82323;
}
.person-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #d6dce3;
  margin: 20px 0;
  overflow: auto;
}
.person-tabs button {
  border: 0;
  border-radius: 0;
  white-space: nowrap;
}
.person-tabs [aria-current="page"] {
  border-bottom: 3px solid #204fa8;
  color: #204fa8;
  font-weight: 700;
}
#visitsPanel details {
  background: #fff;
  border: 1px solid #d6dce3;
  border-radius: 8px;
  margin: 8px 0;
  padding: 14px;
}
#visitsPanel summary {
  cursor: pointer;
  font-weight: 600;
}
#visitsPanel p {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#visitsPanel img {
  border-radius: 6px;
  cursor: pointer;
}
.pair h3 {
  font-size: 15px;
  color: #536276;
}
.pair img {
  height: min(38vh, 300px);
  object-fit: contain;
}
.decision {
  display: flex;
  flex-wrap: wrap;
}
.decision button {
  min-height: 44px;
}
#detail {
  padding: 24px;
}
#candidates button {
  position: relative;
}
#candidates button:focus,
#candidates button[aria-pressed="true"] {
  outline: 3px solid #204fa8;
  outline-offset: 2px;
}
@media (max-width: 600px) {
  #detail {
    padding: 14px;
  }
  .pair img {
    height: 23vh;
  }
  .person-header {
    gap: 8px;
  }
  .person-tabs button {
    padding: 10px 8px;
  }
  .decision button {
    font-size: 13px;
  }
}

@media (min-width: 900px) {
  #detail {
    width: min(1200px, 96vw);
    max-width: 1200px;
  }
  .review-dialog-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
  }
  .review-queue {
    border-right: 1px solid #d6dce3;
    padding-right: 16px;
    max-height: 82vh;
    overflow: auto;
  }
  .review-queue h3 {
    margin: 4px 0 12px;
  }
  .queue-entry {
    display: block;
    text-align: left;
    width: 100%;
    margin: 0 0 8px;
    font-size: 13px;
    padding: 10px;
  }
  .review-content {
    min-width: 0;
  }
}
@media (max-width: 899px) {
  .review-queue {
    display: none;
  }
}

header {
  background: #fff;
  border-color: #d6dce3;
}
main {
  max-width: 1440px;
}
.tabs {
  border-color: #d6dce3;
}
.tabs button {
  color: #536276;
  font-weight: 600;
}
.tabs button[aria-current="page"] {
  background: #204fa8;
  color: #fff;
}
.directory-head {
  background: #fff;
  border-color: #d6dce3;
}
.live-card {
  border-color: #d6dce3;
}
.live-card p {
  color: #536276;
}
.person-row {
  box-shadow: none;
}
.person-row:hover,
.portrait-tile:hover {
  background: #f3f7ff;
  border-color: #204fa8;
}
#grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.card {
  border-radius: 8px;
  background: white;
}
.card img {
  border-radius: 5px;
}
#personDialog {
  width: min(1100px, 94vw);
  max-width: 1100px;
}
.review-content h2 {
  margin: 12px 0;
}
.person-header h2 {
  font-size: 24px;
}
.person-tabs {
  margin: 16px 0;
}
.person-tabs button[aria-current="page"] {
  color: #204fa8;
}
.person-menu button {
  color: #a82323;
}
@media (max-width: 600px) {
  #personDialog {
    width: 100%;
    max-width: none;
  }
}

.camera-view {
  position: relative;
  aspect-ratio: 16/9;
  background: #172333;
  border-radius: 8px;
  overflow: hidden;
}
.camera-view span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d7e0e9;
  font-size: 14px;
}
.camera-view span[hidden],
.camera-view img[hidden] {
  display: none;
}
.camera-view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.live-card p[data-online="true"] {
  color: #18764b;
}
.live-card p[data-online="false"] {
  color: #8a5c13;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.feed-panel {
  min-width: 0;
}
.feed-panel h3 {
  margin: 0 0 4px;
}
.feed-panel > p {
  color: #536276;
  margin: 0 0 12px;
  font-size: 14px;
}
.feed-error {
  color: #9c4c24;
}
.feed-empty {
  color: #536276;
  padding: 16px;
  background: #fff;
  border: 1px solid #d6dce3;
  border-radius: 8px;
}
@media (max-width: 700px) {
  .feed-grid {
    grid-template-columns: 1fr;
  }
}

#candidates {
  display: flex;
  gap: 12px;
  overflow: auto;
  padding: 4px 2px 12px;
}
.candidate-card {
  flex: 0 0 150px;
  border: 1px solid #d6dce3;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}
.candidate-card:has(input:checked) {
  border-color: #204fa8;
  background: #f2f6ff;
}
.candidate-card input {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.candidate-card label {
  margin-left: 6px;
  font-size: 14px;
  cursor: pointer;
}
.candidate-preview {
  border: 0;
  width: 100%;
  padding: 8px 0 0;
  text-align: left;
  background: transparent;
}
.candidate-preview img {
  width: 100%;
  height: 115px;
  object-fit: contain;
}
.candidate-preview span {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.candidate-preview[aria-pressed="true"] {
  outline: 2px solid #204fa8;
}
.selection-help {
  font-size: 14px;
  color: #536276;
  line-height: 1.5;
}
#candidateCount {
  align-self: center;
  color: #536276;
}
#mergeCandidates:not(:disabled) {
  background: #204fa8;
  color: white;
}

:root {
  --ink: #1c2b3a;
  --muted: #586879;
  --line: #dce3eb;
  --accent: #245bd5;
  --wash: #f3f6fb;
}
* {
  box-sizing: border-box;
}
body {
  font:
    15px/1.45 system-ui,
    sans-serif;
  background: var(--wash);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
header {
  max-width: none;
  padding: 12px 28px;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
header h1 {
  font-size: 17px;
  letter-spacing: -0.025em;
  margin: 4px auto 4px 0;
}
main {
  max-width: 1500px;
  padding: 0 28px 32px;
}
button,
input,
select {
  font: inherit;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
button:hover {
  background: #eef3fc;
  border-color: #9cb4dc;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #5a84dc;
  outline-offset: 3px;
}
h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0;
}
h3 {
  font-size: 17px;
}
.tabs {
  position: relative;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin: 0 0 24px;
}
.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 16px 0;
  color: var(--muted);
  min-height: 52px;
}
.tabs button[aria-current="page"] {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.page-heading {
  margin-bottom: 16px;
}
.subnav,
.period-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.subnav {
  margin: 0 0 20px;
}
.subnav button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.subnav button[aria-pressed="true"] {
  color: #174ba9;
  background: #e4ecfc;
}
.camera-switch {
  gap: 4px;
  margin-bottom: 12px;
}
.camera-switch button {
  font-weight: 500;
  min-height: 40px;
  padding: 8px 12px;
  border-color: transparent;
  background: transparent;
}
.camera-switch button[aria-pressed="true"],
.period-presets button[aria-pressed="true"] {
  color: #174ba9;
  background: #e4ecfc;
  border-color: #c4d4f3;
}
#reviewWorkspace > .actions {
  display: flex;
  align-items: start;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
}
summary {
  cursor: pointer;
  min-height: 40px;
  padding: 9px 12px;
  font-weight: 500;
}
.advanced-filters,
.interval-picker {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.filter-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.filter-body label {
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.interval-picker label {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.interval-picker small {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
}
.diagnostics {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.diagnostics > button,
.diagnostics > a {
  margin: 12px;
  display: inline-block;
}
#status {
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
}
#grid {
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.card {
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 8px;
}
.card img {
  height: 160px;
  border-radius: 4px;
  object-fit: contain;
}
.card small {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.directory-head {
  border: 0;
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  border-radius: 0;
  gap: 12px;
}
.directory-head h2 {
  font-size: 26px;
}
.directory-head p {
  font-size: 14px;
}
.directory-head input {
  min-width: 240px;
}
#peopleList {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
#peopleList .person-row {
  display: grid;
  grid-template-columns:
    48px minmax(160px, 1.6fr) minmax(130px, 1fr) minmax(110px, 1fr)
    90px;
  gap: 16px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 12px 16px;
  box-shadow: none;
}
#peopleList .person-row:last-child {
  border-bottom: 0;
}
#peopleList .person-row img {
  width: 48px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
}
#peopleList .person-row span {
  display: grid;
  gap: 3px;
}
#peopleList .person-row small {
  font-size: 14px;
  color: var(--muted);
}
#peopleList .person-row strong {
  font-size: 16px;
}
.list-heading {
  padding: 8px 16px;
  display: grid;
  grid-template-columns:
    48px minmax(160px, 1.6fr) minmax(130px, 1fr) minmax(110px, 1fr)
    90px;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 100px #17233333;
}
dialog::backdrop {
  background: #10223880;
}
#detail {
  width: min(1220px, 96vw);
  max-width: 1220px;
  max-height: 94dvh;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.pair img {
  display: block;
  width: 100%;
  height: clamp(150px, 28vh, 270px);
  object-fit: contain;
  background: #edf1f6;
  border-radius: 6px;
  cursor: zoom-in;
}
.pair h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 8px;
}
.pair p {
  font-size: 14px;
  color: var(--muted);
}
.decision {
  position: sticky;
  bottom: -24px;
  z-index: 3;
  background: #fff;
  box-shadow: 0 -8px 20px #fff;
  padding: 12px 0;
  display: flex;
  gap: 8px;
}
.decision #same {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.review-queue {
  max-height: 80vh;
}
.live-card,
.feed-panel {
  border-radius: 8px;
  box-shadow: none;
}
.empty-state,
.feed-empty {
  padding: 24px;
  color: var(--muted);
  background: #fff;
}
input[type="checkbox"] {
  min-height: auto;
}
@media (max-width: 850px) {
  #peopleList .person-row,
  .list-heading {
    grid-template-columns: 44px minmax(100px, 1fr) 140px;
    gap: 10px;
  }
  #peopleList .person-row > :nth-child(n + 4),
  .list-heading > :nth-child(n + 4) {
    display: none;
  }
  .directory-head {
    flex-wrap: wrap;
  }
  .directory-head input {
    min-width: 0;
  }
}
@media (max-width: 600px) {
  header {
    padding: 12px 16px;
  }
  main {
    padding: 0 16px 24px;
  }
  .tabs {
    gap: 18px;
    margin-bottom: 20px;
  }
  .tabs button {
    flex: 0 0 auto;
    font-size: 14px;
    min-width: 0;
  }
  .directory-head {
    display: flex;
  }
  .directory-head > div {
    width: 100%;
  }
  .directory-head input {
    width: 100%;
  }
  #peopleList .person-row,
  .list-heading {
    grid-template-columns: 40px minmax(80px, 1fr) 110px;
    font-size: 14px;
    padding: 10px;
    gap: 8px;
  }
  .pair {
    gap: 10px;
  }
  .pair img {
    height: 23vh;
  }
  #detail {
    padding: 16px;
    width: 100%;
    max-height: 100dvh;
  }
  .decision {
    bottom: -16px;
    flex-wrap: wrap;
  }
  .decision button {
    min-height: 44px;
    font-size: 14px;
  }
  .decision #same {
    flex: 1 1 100%;
  }
  .review-dialog-grid {
    display: block;
  }
  .live-grid,
  .feed-grid {
    grid-template-columns: 1fr;
  }
  .subnav button {
    min-height: 44px;
  }
  #reviewWorkspace > .actions {
    flex-wrap: wrap;
  }
  h2 {
    font-size: 24px;
  }
  .camera-switch button {
    font-size: 14px;
  }
  .list-heading {
    font-size: 12px;
  }
}
/* Workflow components */
:root {
  --danger: #a62932;
  --focus: #245bd5;
  --surface: #fff;
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.filter-chip {
  font-size: 13px;
  min-height: 32px;
  background: #e4ecfc;
  color: #174ba9;
}
.tool-disclosure {
  border-top: 1px solid var(--line);
  margin: 16px 0;
  padding: 4px 0;
}
.tool-disclosure > summary {
  padding-left: 0;
  font-weight: 600;
}
.tool-disclosure[open] > summary {
  margin-bottom: 12px;
}
.tool-disclosure .actions {
  flex-wrap: wrap;
}
.tool-disclosure input[type="search"],
.tool-disclosure input[type="text"] {
  min-width: 0;
}
.inline-error {
  border: 1px solid #e9b9bf;
  background: #fff3f4;
  color: #86202a;
  padding: 12px;
  border-radius: 6px;
  margin: 12px 0;
}
.inline-error button {
  margin: 8px 0 0 12px;
}
.confirm-dialog {
  max-width: 520px;
  width: calc(100% - 32px);
}
.confirm-dialog h2 {
  font-size: 22px;
}
.confirm-dialog p {
  white-space: pre-line;
}
.confirm-dialog .actions {
  justify-content: flex-end;
}
.image-viewer {
  max-width: 96vw;
  max-height: 96dvh;
}
.image-viewer img {
  display: block;
  max-width: 100%;
  max-height: 80dvh;
  object-fit: contain;
}
.is-loading {
  opacity: 0.6;
  transition: opacity 0.15s;
  cursor: progress;
}
.operation-outcome {
  padding: 12px 16px;
  background: #e8f4ef;
  color: #16543c;
  border: 1px solid #b9d9ca;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.review-content:not(.bulk-mode) .candidate-card > input,
.review-content:not(.bulk-mode) .candidate-card > label,
.review-content:not(.bulk-mode) .bulk-actions {
  display: none;
}
#bulkToggle {
  font-size: 14px;
  margin-bottom: 12px;
}
.review-content.bulk-mode #bulkToggle {
  background: #e4ecfc;
  color: #174ba9;
}
#grid {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
#grid:empty {
  display: none;
}
#grid .card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
  text-align: left;
}
#grid .card:last-child {
  border-bottom: 0;
}
#grid .card:hover,
#grid .card.is-current {
  background: #eff4ff;
}
#grid .card img {
  width: 64px;
  height: 72px;
  object-fit: contain;
  background: #edf1f6;
}
#grid .card small {
  display: grid;
  grid-template-columns: minmax(100px, 1.4fr) 160px 140px 160px;
  align-items: center;
  gap: 16px;
  margin: 0;
}
#grid .review-state {
  font-size: 13px;
  color: #59697a;
  background: #f1f4f8;
  padding: 4px 8px;
  border-radius: 4px;
}
.queue-entry[aria-current="true"] {
  border-color: var(--accent);
  background: #e4ecfc;
  color: #174ba9;
}
img.portrait-image:not([src]),
img.missing-portrait {
  background: #edf1f6 url("person.svg") center/30px no-repeat !important;
  color: transparent;
}
#candidate:not([src]) {
  display: none;
}
.review-content {
  min-width: 0;
}
#detail .review-dialog-grid {
  align-items: start;
}
#detail .decision {
  position: sticky;
  bottom: -24px;
  order: 0;
}
#personDialog {
  width: min(1120px, 96vw);
  max-height: 94dvh;
}
#personSummary {
  font-size: 14px;
  color: var(--muted);
}
.person-tabs {
  position: sticky;
  top: -24px;
  background: #fff;
  z-index: 2;
}
.person-tabs button {
  border-radius: 0;
}
#personNaming {
  display: grid;
  grid-template-columns: 1fr 1fr 180px auto;
  gap: 12px;
}
#personNaming input {
  width: 100%;
  min-width: 0;
}
#portraitGrid .portrait-tile {
  position: relative;
  box-shadow: none;
}
#portraitGrid .template-badge {
  border-radius: 4px;
  font-size: 12px;
}
#portraitDialog .actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#regularDays {
  display: grid;
  gap: 12px;
}
.regular-day {
  border-top: 1px solid var(--line);
}
.regular-tile {
  max-width: 240px;
  border-width: 1px;
  border-radius: 6px;
}
.regular-tile.flag {
  border: 2px solid #bd731c;
  background: #fff9ee;
}
.regular-tile.flag small {
  color: #744007;
}
#regularCount {
  position: sticky;
  bottom: 0;
  padding: 12px;
  background: white;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.live-card > div[id$="Feed"] {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.camera-view {
  border-radius: 6px;
}
#peopleList .person-row img {
  background: #edf1f6 url("person.svg") center/24px no-repeat;
}
.person-row {
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 12px 16px;
}
#regularsList,
#attendanceList {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.selection-help,
small {
  color: var(--muted);
}
@media (max-width: 1050px) {
  #grid .card small {
    grid-template-columns: 1fr 140px;
    gap: 6px;
  }
  #personNaming {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  #grid .card {
    grid-template-columns: 52px 1fr;
    padding: 10px;
    gap: 12px;
  }
  #grid .card img {
    width: 52px;
    height: 68px;
  }
  #grid .card small {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  #grid .review-state {
    justify-self: start;
  }
  #detail .decision {
    bottom: -16px;
  }
  #peopleList .person-row {
    grid-template-columns: 40px 1fr;
  }
  .list-heading {
    display: none;
  }
  #peopleList .person-row > span:nth-child(3) {
    grid-column: 2;
  }
  #peopleList .person-row > span:nth-child(4) {
    display: block;
    grid-column: 2;
    font-size: 13px;
    color: var(--muted);
  }
  #peopleList .person-row img {
    grid-row: 1/4;
  }
  #personNaming {
    grid-template-columns: 1fr;
  }
  #regularDialog,
  #personDialog {
    padding: 16px;
    width: 100%;
    max-height: 100dvh;
  }
  .person-tabs {
    top: -16px;
  }
  #regularNew {
    display: grid;
    grid-template-columns: 1fr;
  }
  #regularNew > * {
    width: 100%;
  }
  .operation-outcome {
    align-items: start;
    flex-wrap: wrap;
  }
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.card{position:relative}
#grid .card.busy::before{position:absolute;top:10px;right:10px}
#grid .card.busy::after{position:absolute;bottom:6px;right:10px}
