/* LDM-05 additions only: interactive overview statistics, photo filters,
   and compact private guest thumbnails. Existing design files stay intact. */

/* The original shell's 1fr column uses its table's minimum width at compact
   laptop sizes. Keep the new guest identity cell contained inside the card. */
#app { grid-template-columns: 248px minmax(0, 1fr); }
#app.rail { grid-template-columns: 56px minmax(0, 1fr); }
header#top,
main,
#panel-guests,
#panel-guests > .card { min-width: 0; }
#panel-guests > .card { overflow-x: auto; }

button.stat {
  width: 100%;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

button.stat .lbl,
button.stat .val { display: block; }

button.stat:focus-visible {
  outline: 3px solid rgba(138, 35, 51, .28);
  outline-offset: 3px;
}

button.stat:disabled {
  color: inherit;
  cursor: default;
  opacity: 1;
}

button.stat:disabled:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-2);
  transform: none;
}

.photo-filter {
  display: inline-flex;
  min-width: 0;
  margin: 0;
  padding: 3px;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.photo-filter legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-filter label {
  position: relative;
  min-width: 0;
  min-height: 36px;
  margin: 0;
}

.photo-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-filter span {
  display: inline-flex;
  min-height: 36px;
  padding: 0 11px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: color .15s, background .15s, box-shadow .15s;
}

.photo-filter input:checked + span {
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.photo-filter input:focus-visible + span {
  outline: 3px solid rgba(138, 35, 51, .24);
  outline-offset: 1px;
}

.guest-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.guest-identity > b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.guest-thumb-shell {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-faint);
  background: var(--surface-2);
}

.guest-thumb,
.guest-thumb-placeholder {
  width: 100%;
  height: 100%;
}

.guest-thumb {
  display: block;
  object-fit: cover;
}

.guest-thumb[hidden],
.guest-thumb-placeholder[hidden] { display: none; }

.guest-thumb-placeholder {
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

html[data-ui="apple"] button.stat:focus-visible {
  outline-color: rgba(10, 132, 255, .42);
}

html[data-ui="apple"] button.stat:disabled:hover {
  border-color: var(--apple-line-soft);
  box-shadow: var(--apple-shadow-sm);
  transform: none;
}

html[data-ui="apple"] .photo-filter {
  border-color: var(--apple-line-soft);
  border-radius: 11px;
  background: #e9e9eb;
}

html[data-ui="apple"] .photo-filter span {
  border-radius: 8px;
  color: var(--apple-secondary);
}

html[data-ui="apple"] .photo-filter input:checked + span {
  color: var(--apple-label);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .13);
}

html[data-ui="apple"] .photo-filter input:focus-visible + span {
  outline-color: rgba(10, 132, 255, .42);
}

html[data-ui="apple"] .guest-thumb-shell {
  border-color: var(--apple-line-soft);
  color: var(--apple-tertiary);
  background: #f2f2f7;
}

@media (max-width: 520px) {
  .photo-filter {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-filter label,
  .photo-filter span { width: 100%; }

  .photo-filter span { min-height: 40px; padding-inline: 7px; font-size: 10.5px; }
  .guest-thumb-shell { width: 36px; height: 36px; flex-basis: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-filter span { transition: none; }
}
