/*
 * MyMappi People & Pets — build 763
 *
 * A warm, private companion library and a compact memory-editor picker.
 * All product hooks are isolated behind `people-pets` or `memory-companion`
 * classes so the feature can land without changing existing account cards,
 * dialogs or editor fields.
 */

.people-pets-entry,
.people-pets-dialog,
.people-pets-shell,
.memory-companion-picker {
  --people-pets-deep: #073f4d;
  --people-pets-teal: #08766e;
  --people-pets-mint: #62cfb2;
  --people-pets-coral: #ec7b70;
  --people-pets-gold: #d9a75e;
  --people-pets-ink: #143f49;
  --people-pets-muted: #667f82;
  --people-pets-line: rgba(8, 91, 92, 0.11);
  --people-pets-pearl: #fffdf8;
  box-sizing: border-box;
  font-family: var(
    --mymappi-brand-font,
    ui-rounded,
    "SF Pro Rounded",
    "Avenir Next Rounded",
    system-ui,
    sans-serif
  );
}

/* Account entry --------------------------------------------------------- */

.people-pets-entry {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 78px;
  padding: 12px 13px;
  gap: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(218, 250, 240, 0.14);
  border-radius: 18px;
  color: rgba(244, 255, 251, 0.94);
  background:
    radial-gradient(circle at 2% 4%, rgba(236, 123, 112, 0.2), transparent 37%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(89, 211, 175, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font: inherit;
  text-align: start;
  transition:
    border-color 180ms ease,
    background 220ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(0.2, 0.78, 0.22, 1);
}

.people-pets-entry-mark {
  position: relative;
  display: grid;
  inline-size: 52px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 36%;
  color: #fffdf8;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.36), transparent 34%),
    linear-gradient(145deg, #dd7e73, #c98773 46%, #3f9f91);
  box-shadow:
    0 9px 20px rgba(2, 28, 36, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.people-pets-entry-mark svg,
.people-pets-entry-mark img {
  inline-size: 25px;
  block-size: 25px;
  object-fit: cover;
}

.people-pets-entry-copy {
  display: grid;
  min-inline-size: 0;
  gap: 3px;
}

.people-pets-entry-copy strong,
.people-pets-entry-title {
  overflow: hidden;
  color: #f8fffc;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-pets-entry-copy small,
.people-pets-entry-note {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(220, 246, 239, 0.63);
  font-size: 0.68rem;
  font-weight: 630;
  line-height: 1.34;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.people-pets-entry-chevron {
  display: grid;
  inline-size: 34px;
  block-size: 34px;
  place-items: center;
  border: 1px solid rgba(233, 255, 248, 0.1);
  border-radius: 50%;
  color: rgba(232, 253, 247, 0.68);
  background: rgba(255, 255, 255, 0.045);
}

.people-pets-entry-chevron svg {
  inline-size: 16px;
  block-size: 16px;
}

/* Private library dialog ------------------------------------------------ */

.people-pets-dialog {
  inline-size: min(760px, calc(100vw - 32px));
  max-inline-size: 760px;
  max-block-size: min(850px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(219, 243, 236, 0.88);
  border-radius: 31px;
  color: var(--people-pets-ink);
  background:
    radial-gradient(circle at 92% 2%, rgba(236, 123, 112, 0.12), transparent 30%),
    radial-gradient(circle at 5% 98%, rgba(98, 207, 178, 0.12), transparent 32%),
    linear-gradient(148deg, #fffdf8 0%, #f5faf6 58%, #edf7f3 100%);
  box-shadow:
    0 34px 96px rgba(2, 28, 38, 0.32),
    0 8px 22px rgba(6, 81, 80, 0.1),
    inset 0 1px 0 #ffffff;
}

.people-pets-dialog[open] {
  animation: people-pets-dialog-arrive 320ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.people-pets-dialog::backdrop {
  background:
    radial-gradient(circle at 72% 12%, rgba(236, 123, 112, 0.09), transparent 32%),
    rgba(2, 25, 34, 0.64);
  backdrop-filter: blur(14px) saturate(0.96);
  -webkit-backdrop-filter: blur(14px) saturate(0.96);
}

.people-pets-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  inline-size: 100%;
  max-block-size: min(850px, calc(100dvh - 32px));
  overflow: hidden;
}

.people-pets-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  padding: 24px 25px 17px;
  gap: 16px;
  align-items: start;
  border-block-end: 1px solid rgba(8, 91, 92, 0.075);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(16px) saturate(1.04);
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
}

.people-pets-header-copy {
  display: grid;
  min-inline-size: 0;
  gap: 5px;
}

.people-pets-kicker {
  color: var(--people-pets-teal);
  font-size: 0.63rem;
  font-weight: 860;
  letter-spacing: 0.11em;
  line-height: 1.15;
  text-transform: uppercase;
}

.people-pets-header h2 {
  margin: 0;
  color: #103c47;
  font-size: clamp(1.52rem, 4vw, 2.05rem);
  font-weight: 870;
  letter-spacing: -0.038em;
  line-height: 1.04;
  text-wrap: balance;
}

.people-pets-header p {
  max-inline-size: 56ch;
  margin: 0;
  color: var(--people-pets-muted);
  font-size: 0.76rem;
  font-weight: 590;
  line-height: 1.45;
}

.people-pets-close {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  inline-size: 44px;
  block-size: 44px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(8, 80, 87, 0.13);
  border-radius: 15px;
  color: #315f64;
  background: rgba(255, 255, 251, 0.86);
  box-shadow: 0 7px 18px rgba(4, 64, 68, 0.06);
  cursor: pointer;
}

.people-pets-close svg {
  inline-size: 18px;
  block-size: 18px;
}

.people-pets-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-block-size: 0;
  padding: 20px 25px 25px;
  gap: 15px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(8, 118, 110, 0.24) transparent;
  -webkit-overflow-scrolling: touch;
}

.people-pets-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-inline-size: 0;
  gap: 15px;
  align-content: start;
}

.people-pets-group {
  display: grid;
  min-inline-size: 0;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--people-pets-line);
  border-radius: 22px;
  background: rgba(255, 255, 252, 0.7);
  box-shadow:
    0 10px 26px rgba(5, 70, 72, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.people-pets-group > header {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 2px;
}

.people-pets-group > header strong {
  color: #174852;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.people-pets-group > header small {
  display: inline-flex;
  min-block-size: 26px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6d8586;
  background: rgba(7, 111, 105, 0.065);
  font-size: 0.61rem;
  font-weight: 760;
}

.people-pets-card {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 68px;
  padding: 9px 10px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(8, 91, 92, 0.09);
  border-radius: 17px;
  color: var(--people-pets-ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 7px 17px rgba(4, 63, 67, 0.045);
  font: inherit;
  text-align: start;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

button.people-pets-card {
  cursor: pointer;
}

.people-pets-card[aria-pressed="true"],
.people-pets-card.is-selected {
  border-color: rgba(8, 128, 116, 0.3);
  background:
    radial-gradient(circle at 0% 0%, rgba(98, 207, 178, 0.15), transparent 42%),
    rgba(248, 255, 252, 0.96);
  box-shadow:
    0 10px 24px rgba(5, 84, 82, 0.08),
    inset 0 0 0 1px rgba(98, 207, 178, 0.08);
}

.people-pets-avatar {
  position: relative;
  display: grid;
  inline-size: 48px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(8, 91, 92, 0.1);
  border-radius: 36%;
  color: #9c594f;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.74), transparent 36%),
    linear-gradient(145deg, #ffe2d8, #efd0b3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1;
}

.people-pets-card[data-kind="pet"] .people-pets-avatar,
.people-pets-avatar.is-pet {
  border-radius: 50%;
  color: #855d2d;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), transparent 36%),
    linear-gradient(145deg, #ffe9bd, #e5d7a9);
}

.people-pets-avatar img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.people-pets-avatar svg {
  inline-size: 21px;
  block-size: 21px;
}

.people-pets-card-copy {
  display: grid;
  min-inline-size: 0;
  gap: 2px;
}

.people-pets-card-copy strong {
  overflow: hidden;
  color: #174751;
  font-size: 0.76rem;
  font-weight: 830;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-pets-card-copy small {
  overflow: hidden;
  color: #73898a;
  font-size: 0.62rem;
  font-weight: 640;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-pets-card-action {
  display: grid;
  inline-size: 44px;
  block-size: 44px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(8, 91, 92, 0.09);
  border-radius: 50%;
  color: #4d7074;
  background: rgba(248, 252, 249, 0.78);
  cursor: pointer;
}

.people-pets-card-action svg {
  inline-size: 17px;
  block-size: 17px;
}

.people-pets-empty {
  display: grid;
  grid-column: 1 / -1;
  min-block-size: 170px;
  padding: 24px 18px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed rgba(8, 111, 105, 0.2);
  border-radius: 20px;
  color: #5f7c7f;
  background:
    radial-gradient(circle at 50% 42%, rgba(98, 207, 178, 0.1), transparent 42%),
    rgba(250, 253, 249, 0.62);
  text-align: center;
}

.people-pets-group-empty {
  display: grid;
  min-block-size: 68px;
  margin: 0;
  padding: 13px;
  place-items: center;
  border: 1px dashed rgba(8, 111, 105, 0.14);
  border-radius: 15px;
  color: #789092;
  background: rgba(249, 253, 250, 0.56);
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.38;
  text-align: center;
}

.people-pets-empty-mark {
  display: grid;
  inline-size: 48px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 36%;
  color: #148074;
  background: rgba(98, 207, 178, 0.12);
}

.people-pets-empty strong {
  color: #275861;
  font-size: 0.82rem;
  font-weight: 840;
}

.people-pets-empty p {
  max-inline-size: 32ch;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 610;
  line-height: 1.42;
}

.people-pets-empty button {
  min-block-size: 44px;
  margin-block-start: 4px;
  padding: 9px 15px;
  border: 1px solid rgba(8, 118, 109, 0.16);
  border-radius: 999px;
  color: #087168;
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 820;
  cursor: pointer;
}

.people-pets-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-inline-size: 0;
  padding: 16px;
  gap: 13px;
  border: 1px solid rgba(8, 112, 104, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% 0%, rgba(236, 123, 112, 0.1), transparent 30%),
    rgba(255, 255, 252, 0.88);
  box-shadow: 0 12px 30px rgba(4, 70, 72, 0.06);
}

.people-pets-form > header,
.people-pets-form-heading,
.people-pets-form .people-pets-form-wide {
  grid-column: 1 / -1;
}

.people-pets-form > header,
.people-pets-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.people-pets-form > header strong,
.people-pets-form-heading strong {
  color: #174852;
  font-size: 0.82rem;
  font-weight: 850;
}

.people-pets-form label {
  display: grid;
  min-inline-size: 0;
  gap: 6px;
  color: #3f666a;
  font-size: 0.64rem;
  font-weight: 780;
}

.people-pets-form :is(input, select, textarea) {
  appearance: none;
  -webkit-appearance: none;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(8, 91, 92, 0.13);
  border-radius: 14px;
  color: #173f48;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(3, 48, 54, 0.025);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 640;
}

.people-pets-form textarea {
  min-block-size: 88px;
  resize: vertical;
  line-height: 1.42;
}

.people-pets-form :is(input, textarea)::placeholder {
  color: #93a5a6;
}

.people-pets-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px 25px max(16px, env(safe-area-inset-bottom));
  gap: 9px;
  align-items: center;
  border-block-start: 1px solid rgba(8, 91, 92, 0.075);
  background: rgba(250, 253, 249, 0.9);
  backdrop-filter: blur(16px) saturate(1.04);
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
}

.people-pets-actions > p {
  grid-column: 1;
  min-inline-size: 0;
  margin: 0;
  overflow: hidden;
  color: #698184;
  font-size: 0.67rem;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.people-pets-actions > p:empty {
  min-block-size: 0;
}

.people-pets-actions > p[data-state="error"] {
  color: #a34f4a;
}

.people-pets-actions .people-pets-danger {
  grid-column: 2;
}

.people-pets-actions .people-pets-primary,
.people-pets-actions [data-people-pets-save] {
  grid-column: 3;
}

.people-pets-actions button,
.people-pets-actions a {
  display: inline-flex;
  min-block-size: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  gap: 7px;
  border: 1px solid rgba(8, 91, 92, 0.13);
  border-radius: 15px;
  color: #42676b;
  background: rgba(255, 255, 252, 0.86);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 820;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.people-pets-actions .people-pets-primary,
.people-pets-actions [data-people-pets-save] {
  min-inline-size: 132px;
  border-color: rgba(98, 207, 178, 0.28);
  color: #f8fffc;
  background: linear-gradient(120deg, #073f4d, #08766e 58%, #1a987c);
  box-shadow: 0 11px 24px rgba(5, 91, 87, 0.17);
}

.people-pets-actions .people-pets-danger {
  color: #9b4f4c;
  border-color: rgba(190, 84, 79, 0.14);
  background: rgba(255, 248, 246, 0.86);
}

/* Memory editor picker -------------------------------------------------- */

.memory-companion-picker {
  display: grid;
  min-inline-size: 0;
  padding: 14px;
  gap: 11px;
  border: 1px solid rgba(8, 105, 101, 0.11);
  border-radius: 20px;
  color: var(--people-pets-ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(236, 123, 112, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 252, 0.88), rgba(239, 249, 245, 0.84));
  box-shadow:
    0 10px 26px rgba(5, 70, 72, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.memory-companion-picker-head {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-companion-picker-copy {
  display: grid;
  min-inline-size: 0;
  gap: 2px;
}

.memory-companion-picker-head strong {
  color: #174852;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.memory-companion-picker-head small {
  color: #718789;
  font-size: 0.61rem;
  font-weight: 640;
  line-height: 1.32;
}

.memory-companion-groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-inline-size: 0;
  gap: 7px;
}

.memory-companion-group {
  display: grid;
  min-inline-size: 0;
  align-content: start;
  gap: 7px;
}

.memory-companion-group > strong,
.memory-companion-group-label {
  color: #5d797c;
  font-size: 0.6rem;
  font-weight: 830;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-transform: uppercase;
}

.memory-companion-chips {
  display: flex;
  min-inline-size: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.memory-companion-chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  grid-template-columns: 28px minmax(0, auto);
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: 6px 11px 6px 7px;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(8, 91, 92, 0.1);
  border-radius: 999px;
  color: #42686c;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 14px rgba(4, 62, 65, 0.035);
  cursor: pointer;
  font: inherit;
  font-size: 0.67rem;
  font-weight: 750;
  line-height: 1;
  text-align: start;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.memory-companion-chip-avatar {
  display: grid;
  inline-size: 28px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #98554d;
  background: linear-gradient(145deg, #ffe0d7, #efd1b9);
  font-size: 0.68rem;
  font-weight: 850;
}

.memory-companion-chip-avatar img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.memory-companion-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-companion-chip[aria-pressed="true"],
.memory-companion-chip.is-selected {
  color: #075f5b;
  border-color: rgba(8, 132, 120, 0.3);
  background:
    radial-gradient(circle at 0% 0%, rgba(98, 207, 178, 0.18), transparent 42%),
    rgba(244, 255, 250, 0.96);
  box-shadow:
    0 7px 17px rgba(5, 89, 84, 0.08),
    inset 0 0 0 1px rgba(98, 207, 178, 0.08);
}

.memory-companion-chip[aria-pressed="true"] .memory-companion-chip-avatar,
.memory-companion-chip.is-selected .memory-companion-chip-avatar {
  box-shadow: 0 0 0 2px rgba(8, 127, 116, 0.2);
}

.memory-companion-manage {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  flex: 0 0 auto;
  min-block-size: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  gap: 6px;
  border: 1px solid rgba(8, 104, 100, 0.1);
  border-radius: 999px;
  color: #08726a;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 820;
  line-height: 1;
  cursor: pointer;
}

.memory-companion-manage svg {
  inline-size: 15px;
  block-size: 15px;
}

/* Group intent is a five-choice tab row, separate from selected name chips. */
.memory-companion-groups > button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  min-inline-size: 0;
  min-block-size: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 9px;
  border: 1px solid rgba(8, 91, 92, 0.1);
  border-radius: 14px;
  color: #5a777a;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 0.63rem;
  font-weight: 790;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.memory-companion-groups > button.active,
.memory-companion-groups > button[aria-pressed="true"] {
  border-color: rgba(8, 132, 120, 0.28);
  color: #075f5b;
  background:
    radial-gradient(circle at 0% 0%, rgba(98, 207, 178, 0.2), transparent 46%),
    rgba(241, 255, 249, 0.96);
  box-shadow:
    0 7px 17px rgba(5, 89, 84, 0.07),
    inset 0 0 0 1px rgba(98, 207, 178, 0.08);
}

.memory-companion-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(8, 111, 105, 0.16);
  border-radius: 14px;
  color: #708789;
  background: rgba(255, 255, 255, 0.52);
  font-size: 0.66rem;
  font-weight: 630;
  line-height: 1.4;
  text-align: center;
}

/*
 * Editor cascade lock. Older editor layers protect a four-button category
 * row with high-specificity `!important` declarations. This extra class and
 * ID scope makes the five companion groups and flexible name chips own their
 * intended layout without changing the legacy picker elsewhere.
 */
html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker {
  display: grid !important;
  width: min(100%, 500px) !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 14px !important;
  gap: 11px !important;
  justify-items: stretch !important;
  border: 1px solid rgba(8, 105, 101, 0.11) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(236, 123, 112, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 252, 0.88), rgba(239, 249, 245, 0.84)) !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker > .memory-companion-groups {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 7px !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-groups > button {
  display: inline-flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 8px 7px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(8, 91, 92, 0.1) !important;
  border-radius: 14px !important;
  color: #5a777a !important;
  background: rgba(255, 255, 255, 0.7) !important;
  box-shadow: none !important;
  font-size: 0.63rem !important;
  font-weight: 790 !important;
  line-height: 1.05 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-groups > button:is(.active, [aria-pressed="true"]) {
  border-color: var(--mymappi-color-midnight) !important;
  color: var(--mymappi-color-midnight) !important;
  background: var(--mymappi-color-mint) !important;
  box-shadow:
    0 7px 17px rgba(5, 89, 84, 0.07),
    inset 0 0 0 1px rgba(98, 207, 178, 0.08) !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-manage {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 8px 10px !important;
  justify-content: center !important;
  border: 1px solid rgba(8, 104, 100, 0.1) !important;
  border-radius: 999px !important;
  color: var(--mymappi-color-midnight) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: none !important;
  font-size: 0.64rem !important;
  font-weight: 820 !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-chips {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 7px !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-chips > .memory-companion-chip {
  display: inline-grid !important;
  grid-template-columns: 28px minmax(0, auto) !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 6px 11px 6px 7px !important;
  gap: 7px !important;
  align-items: center !important;
  justify-content: start !important;
  border: 1px solid rgba(8, 91, 92, 0.1) !important;
  border-radius: 999px !important;
  color: #42686c !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 5px 14px rgba(4, 62, 65, 0.035) !important;
  font-size: 0.67rem !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-chips > .memory-companion-chip[aria-pressed="true"] {
  color: var(--mymappi-color-midnight) !important;
  border-color: var(--mymappi-color-midnight) !important;
  background: var(--mymappi-color-mint) !important;
  box-shadow:
    0 7px 17px rgba(5, 89, 84, 0.08),
    inset 0 0 0 1px rgba(98, 207, 178, 0.08) !important;
}

/* The account entry needs to keep its richer three-column composition. */
html body main.app-shell .account-menu .account-menu-item.people-pets-entry {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) 34px !important;
  min-height: 78px !important;
  padding: 12px 13px !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: stretch !important;
  border: 1px solid rgba(218, 250, 240, 0.14) !important;
  border-radius: 18px !important;
  color: rgba(244, 255, 251, 0.94) !important;
  background:
    radial-gradient(circle at 2% 4%, rgba(236, 123, 112, 0.2), transparent 37%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(89, 211, 175, 0.055)) !important;
}

html body main.app-shell .account-menu .account-menu-item.people-pets-entry .people-pets-entry-mark svg {
  width: 25px !important;
  height: 25px !important;
}

/* Interaction and accessibility ---------------------------------------- */

.people-pets-entry:focus-visible,
.people-pets-close:focus-visible,
.people-pets-card:focus-visible,
.people-pets-card-action:focus-visible,
.people-pets-empty button:focus-visible,
.people-pets-form :is(input, select, textarea):focus-visible,
.people-pets-actions :is(button, a):focus-visible,
.memory-companion-groups > button:focus-visible,
.memory-companion-chip:focus-visible,
.memory-companion-manage:focus-visible {
  outline: 3px solid rgba(10, 139, 126, 0.32);
  outline-offset: 3px;
}

.people-pets-form :is(input, select, textarea):focus-visible {
  border-color: rgba(8, 132, 120, 0.42);
  box-shadow: 0 0 0 4px rgba(98, 207, 178, 0.1);
}

.people-pets-entry[aria-disabled="true"],
.people-pets-card:disabled,
.people-pets-actions button:disabled,
.memory-companion-chip:disabled,
.memory-companion-manage:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.people-pets-entry[hidden],
.people-pets-dialog[hidden],
.people-pets-dialog [hidden],
.people-pets-shell [hidden],
.people-pets-groups[hidden],
.people-pets-group[hidden],
.people-pets-card[hidden],
.people-pets-empty[hidden],
.people-pets-form[hidden],
.people-pets-actions[hidden],
.memory-companion-picker[hidden],
.memory-companion-picker [hidden],
.memory-companion-groups[hidden],
.memory-companion-group[hidden],
.memory-companion-chip[hidden] {
  display: none !important;
}

@keyframes people-pets-dialog-arrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  .people-pets-entry:hover {
    border-color: rgba(215, 250, 239, 0.24);
    background:
      radial-gradient(circle at 2% 4%, rgba(236, 123, 112, 0.25), transparent 38%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(89, 211, 175, 0.075));
    box-shadow:
      0 10px 24px rgba(2, 26, 34, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
  }

  .people-pets-close:hover,
  .people-pets-card-action:hover,
  .people-pets-empty button:hover,
  .people-pets-actions button:hover,
  .memory-companion-manage:hover {
    border-color: rgba(8, 132, 120, 0.28);
    color: #075f5b;
    transform: translateY(-1px);
  }

  .people-pets-card:hover {
    border-color: rgba(8, 120, 112, 0.2);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 23px rgba(4, 69, 70, 0.075);
    transform: translateY(-1px);
  }

  .memory-companion-chip:hover {
    border-color: rgba(8, 132, 120, 0.22);
    color: #075f5b;
    transform: translateY(-1px);
  }

  .memory-companion-groups > button:hover {
    border-color: rgba(8, 132, 120, 0.22);
    color: #075f5b;
    transform: translateY(-1px);
  }

  html body main.app-shell .account-menu .account-menu-item.people-pets-entry:hover,
  html body main.app-shell .account-menu .account-menu-item.people-pets-entry:focus-visible {
    border-color: rgba(215, 250, 239, 0.24) !important;
    color: #ffffff !important;
    background:
      radial-gradient(circle at 2% 4%, rgba(236, 123, 112, 0.25), transparent 38%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(89, 211, 175, 0.075)) !important;
  }
}

/* Phones: one calm column and bottom actions that stay easy to reach. */
@media (max-width: 600px) {
  .people-pets-dialog {
    inline-size: calc(100vw - 14px);
    max-block-size: calc(100dvh - 14px);
    border-radius: 25px;
  }

  .people-pets-shell {
    max-block-size: calc(100dvh - 14px);
  }

  .people-pets-header {
    padding: 18px 16px 14px;
    gap: 12px;
  }

  .people-pets-header h2 {
    font-size: clamp(1.38rem, 7vw, 1.72rem);
  }

  .people-pets-groups {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 18px;
    gap: 12px;
  }

  .people-pets-library {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .people-pets-group {
    padding: 12px;
    border-radius: 19px;
  }

  .people-pets-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
    border-radius: 19px;
  }

  .people-pets-form > header,
  .people-pets-form-heading,
  .people-pets-form .people-pets-form-wide {
    grid-column: 1;
  }

  .people-pets-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 11px 14px max(13px, env(safe-area-inset-bottom));
  }

  .people-pets-actions > p {
    grid-column: 1 / -1;
    grid-row: 1;
    white-space: normal;
  }

  .people-pets-actions .people-pets-danger {
    grid-column: 1;
    grid-row: 2;
  }

  .people-pets-actions .people-pets-primary,
  .people-pets-actions [data-people-pets-save] {
    grid-column: 2;
    grid-row: 2;
    inline-size: 100%;
    min-inline-size: 0;
  }

  .people-pets-actions .people-pets-danger[hidden] + .people-pets-primary,
  .people-pets-actions .people-pets-danger[hidden] + [data-people-pets-save] {
    grid-column: 1 / -1;
  }

  .people-pets-actions button,
  .people-pets-actions a {
    inline-size: 100%;
    padding-inline: 10px;
  }

  .memory-companion-picker {
    padding: 12px;
    border-radius: 18px;
  }

  .memory-companion-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker > .memory-companion-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .memory-companion-chip {
    max-inline-size: min(100%, 190px);
  }
}

@media (max-width: 380px) {
  .people-pets-card {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding-inline: 8px;
    gap: 8px;
  }

  .people-pets-avatar {
    inline-size: 44px;
  }

  .memory-companion-picker-head {
    align-items: flex-start;
  }
}

/* iPad gets a slightly wider library while retaining the two-group rhythm. */
@media (min-width: 601px) and (max-width: 1180px) {
  .people-pets-dialog {
    inline-size: min(760px, calc(100vw - 40px));
    max-block-size: calc(100dvh - 40px);
  }

  .people-pets-shell {
    max-block-size: calc(100dvh - 40px);
  }
}

/* The keyboard changes the visual viewport, not necessarily 100dvh in WKWebView.
   Keep one scrolling body between the fixed heading and reachable Save action. */
#peoplePetsDialog.people-pets-dialog {
  --people-pets-top-space: max(12px, env(safe-area-inset-top));
  --people-pets-bottom-space: max(12px, env(safe-area-inset-bottom));
  --people-pets-available-height: calc(var(--people-pets-viewport-height, 100dvh) - var(--people-pets-top-space) - var(--people-pets-bottom-space));
  inline-size: min(760px, calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))));
  position: fixed;
  inset-block-start: calc(var(--people-pets-viewport-top, 0px) + var(--people-pets-top-space));
  inset-block-end: auto;
  margin-block: 0;
  max-block-size: min(850px, var(--people-pets-available-height));
}

#peoplePetsDialog .people-pets-shell {
  max-block-size: min(850px, var(--people-pets-available-height));
}

#peoplePetsDialog .people-pets-library[hidden],
#peoplePetsDialog .people-pets-form[hidden] {
  display: none;
}

#peoplePetsDialog.is-editing {
  animation: none;
}

#peoplePetsDialog .people-pets-form :is(input, select, textarea) {
  font-size: max(16px, 0.875rem);
  scroll-margin-block: 12px;
}

#peoplePetsDialog.is-compact .people-pets-header {
  padding: 8px 14px;
  align-items: center;
}

#peoplePetsDialog.is-compact .people-pets-header h2 {
  font-size: 1.125rem;
}

#peoplePetsDialog.is-compact .people-pets-header :is(p, .people-pets-kicker) {
  display: none;
}

#peoplePetsDialog.is-compact .people-pets-groups {
  padding: 8px 14px;
}

#peoplePetsDialog.is-compact .people-pets-form {
  padding: 10px;
  gap: 10px;
}

#peoplePetsDialog.is-compact .people-pets-actions {
  padding: 8px 14px;
  gap: 6px;
}

#peoplePetsDialog.is-compact .people-pets-actions > p:not([data-state="error"]) {
  display: none;
}

@media (prefers-contrast: more) {
  .people-pets-entry,
  .people-pets-dialog,
  .people-pets-group,
  .people-pets-card,
  .people-pets-empty,
  .people-pets-form,
  .people-pets-form :is(input, select, textarea),
  .people-pets-actions :is(button, a),
  .memory-companion-picker,
  .memory-companion-groups > button,
  .memory-companion-chip,
  .memory-companion-manage {
    border-width: 2px;
  }

  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-groups > button,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-chips > .memory-companion-chip,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-manage {
    border-width: 2px !important;
  }

  .people-pets-header p,
  .people-pets-card-copy small,
  .people-pets-empty p,
  .memory-companion-picker-head small {
    color: #355e63;
  }
}

@media (forced-colors: active) {
  .people-pets-entry,
  .people-pets-dialog,
  .people-pets-entry-mark,
  .people-pets-close,
  .people-pets-group,
  .people-pets-card,
  .people-pets-avatar,
  .people-pets-empty,
  .people-pets-form,
  .people-pets-form :is(input, select, textarea),
  .people-pets-actions :is(button, a),
  .memory-companion-picker,
  .memory-companion-groups > button,
  .memory-companion-chip,
  .memory-companion-manage {
    border: 1px solid CanvasText;
    forced-color-adjust: auto;
  }

  html body main.app-shell .account-menu .account-menu-item.people-pets-entry,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-groups > button,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-chips > .memory-companion-chip,
  html body main.app-shell #memoryForm#memoryForm .memory-people-chips.memory-companion-picker .memory-companion-manage {
    border: 1px solid CanvasText !important;
    color: ButtonText !important;
    background: ButtonFace !important;
    box-shadow: none !important;
    forced-color-adjust: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .people-pets-entry,
  .people-pets-dialog,
  .people-pets-close,
  .people-pets-card,
  .people-pets-card-action,
  .people-pets-empty button,
  .people-pets-actions button,
  .memory-companion-groups > button,
  .memory-companion-chip,
  .memory-companion-manage {
    animation: none;
    scroll-behavior: auto;
    transition: none;
  }
}
