/* people.css — the People Management view (#view-people), restyled to match the
   Service Platform's look: system font, white rounded groups on a light page,
   large readable text, pill buttons and soft colour chips.

   ONLY styling lives here — the page's HTML and texts are unchanged, so the
   translations (/i18n/console/*.json) keep working. Everything is scoped to
   #view-people (plus the toast, which this view uses for its messages), so the
   launcher keeps its own look. Loaded after styles.css and overrides it.

   §1 tokens + page   §2 heading   §3 cards   §4 the add form   §5 the list
   §6 restricted box  §7 toast     §8 phones                                  */

/* ── §1 tokens + page ─────────────────────────────────────────────────────── */
#view-people {
  --p-text: #1c1c1e;
  --p-muted: #6e6e73;
  --p-faint: #8e8e93;
  --p-surface: #ffffff;
  --p-fill: rgba(118, 118, 128, .12);
  --p-fill-strong: rgba(118, 118, 128, .2);
  --p-line: rgba(60, 60, 67, .16);
  --p-accent: #007aff;
  --p-radius: 16px;
  max-width: 920px; margin: 0 auto;
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--p-text);
  -webkit-text-size-adjust: 100%;
}
#view-people *, #view-people *::before { letter-spacing: normal; }

/* ── §2 heading ───────────────────────────────────────────────────────────── */
#view-people .section-head { align-items: flex-end; gap: .4rem 1.2rem; flex-wrap: wrap; margin: 6px 2px 20px; }
#view-people .section-head h1 {
  font: 700 32px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -.02em; text-transform: none; color: var(--p-text);
}
#view-people .section-head .count { font-family: inherit; font-weight: 400; font-size: 15px; line-height: 1.3; color: var(--p-muted); }

/* ── §3 cards ─────────────────────────────────────────────────────────────── */
#view-people .panel-block {
  background: var(--p-surface); border: 0; border-radius: var(--p-radius);
  padding: 22px 22px 24px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}
#view-people .panel-block h3 {
  font-family: inherit; font-weight: 600; font-size: 20px; line-height: 1.2; text-transform: none; color: var(--p-text); margin: 0 0 18px;
}
#view-people .panel-block h3::before { content: none; }

/* ── §4 the add form ──────────────────────────────────────────────────────── */
#view-people .add-form { gap: 16px; margin-bottom: 20px; }
/* field captions — also the "App access" caption, which carries inline styles in the page */
#view-people .field label,
#view-people .panel-block > label {
  display: block; margin: 0 0 7px 2px !important;
  font: 500 14px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif !important;
  letter-spacing: normal !important; text-transform: none !important; color: var(--p-muted) !important;
}
#view-people .field input,
#view-people .role-select {
  width: 100%; height: 48px; padding: 0 14px;
  border: 0; border-radius: 12px; background: var(--p-fill); color: var(--p-text);
  font-family: inherit; font-weight: 400; font-size: 17px; line-height: 1;
  transition: box-shadow .15s ease, background .15s ease;
}
#view-people .field input::placeholder { color: var(--p-faint); }
#view-people .field input:focus,
#view-people .role-select:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .3); }
/* the role dropdown: plain, with one chevron */
#view-people .role-select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6.5 8 3.5l3 3M5 9.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}

/* app choices: pills; a chosen one turns blue with a tick */
#view-people .app-toggles { gap: 10px; margin-bottom: 22px; }
#view-people .toggle-chip {
  gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  background: var(--p-fill); color: var(--p-text);
  font-family: inherit; font-weight: 500; font-size: 15px; line-height: 1.2;
  transition: background .15s ease, color .15s ease, transform .08s ease;
}
#view-people .toggle-chip:hover { background: var(--p-fill-strong); }
#view-people .toggle-chip:active { transform: scale(.97); }
#view-people .toggle-chip .dot {
  width: 20px; height: 20px; border: 1.5px solid var(--p-faint); background: transparent;
  display: grid; place-items: center; transition: background .15s ease, border-color .15s ease;
}
#view-people .toggle-chip.checked { background: rgba(0, 122, 255, .13); color: #0058c0; }
#view-people .toggle-chip.checked .dot {
  border-color: var(--p-accent);
  background: var(--p-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

#view-people .add-btn {
  min-width: 160px; height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--p-accent); color: #fff;
  font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1; text-transform: none;
  transition: filter .12s ease, transform .08s ease;
}
#view-people .add-btn:hover { filter: brightness(1.08); }
#view-people .add-btn:active { transform: scale(.97); }
#view-people .add-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35); }
#view-people .form-msg { margin-top: 12px; min-height: 20px; font-family: inherit; font-weight: 500; font-size: 15px; line-height: 1.35; }
#view-people .form-msg.ok { color: #1d7a36; }
#view-people .form-msg.err { color: #c4221a; }

/* ── §5 the list ──────────────────────────────────────────────────────────── */
#view-people .people-table th {
  padding: 0 12px 10px 0; border-bottom: 1px solid var(--p-line);
  font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1.3; text-transform: none; color: var(--p-muted);
}
#view-people .people-table td {
  padding: 15px 12px 15px 0; border-bottom: 1px solid var(--p-line); font-size: 17px;
}
#view-people .people-table tr:last-child td { border-bottom: 0; }
#view-people .email-cell { font-weight: 500; color: var(--p-text); overflow-wrap: anywhere; }
/* a person with a name: the name, and the e-mail smaller underneath */
#view-people .person-name { display: block; font-weight: 600; }
#view-people .person-email { display: block; margin-top: 1px; font-size: 14px; font-weight: 400; color: var(--p-muted); }
#view-people .add-form { grid-template-columns: 1fr 1fr; }

/* role: a soft colour chip */
#view-people .role-pill {
  padding: 5px 12px; border: 0; border-radius: 999px; white-space: nowrap;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; text-transform: none;
  background: var(--p-fill); color: #3a3a3c;
}
#view-people .role-pill[data-role="admin"]           { background: rgba(0, 122, 255, .13);  color: #0058c0; }
#view-people .role-pill[data-role="management"]      { background: rgba(255, 159, 10, .2);  color: #8a5300; }
#view-people .role-pill[data-role="service_manager"] { background: rgba(175, 82, 222, .15); color: #7a2fa8; }
#view-people .role-pill[data-role="serviceman"]      { background: rgba(52, 199, 89, .18);  color: #1d7a36; }

#view-people .apps-cell { gap: 6px; max-width: 320px; }
#view-people .app-tag {
  padding: 4px 10px; border: 0 !important; border-radius: 8px; background: var(--p-fill);
  font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1.2; color: #3a3a3c;
}
#view-people .app-tag[style*="--blue"] { background: rgba(0, 122, 255, .13); color: #0058c0 !important; }

/* remove: a round button that turns red */
#view-people .icon-btn {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--p-fill); color: var(--p-muted);
  transition: background .15s ease, color .15s ease, transform .08s ease;
}
#view-people .icon-btn:hover { background: rgba(255, 59, 48, .14); color: #c4221a; }
#view-people .icon-btn:active { transform: scale(.94); }
#view-people .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35); }
#view-people .icon-btn svg { width: 17px; height: 17px; }
#view-people .empty-row td { padding: 30px 0; font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1.4; color: var(--p-faint); }

/* ── §6 restricted box ────────────────────────────────────────────────────── */
#view-people .denied-box { padding: 72px 20px; }
#view-people .denied-box svg { width: 52px; height: 52px; color: var(--p-faint); margin-bottom: 16px; }
#view-people .denied-box h2 { font-family: inherit; font-weight: 700; font-size: 24px; line-height: 1.2; text-transform: none; color: var(--p-text); }
#view-people .denied-box p { max-width: 420px; font-size: 17px; line-height: 1.45; color: var(--p-muted); }

/* ── §7 toast (the short confirmation at the bottom) ──────────────────────── */
.toast {
  left: 50%; right: auto; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 10px); max-width: calc(100vw - 32px);
  padding: 13px 20px; border: 0; border-radius: 999px;
  background: rgba(28, 28, 30, .92); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font: 500 16px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.show { transform: translate(-50%, 0); }

/* ── §8 phones: each person becomes a small card instead of a table row ───── */
@media (max-width: 700px) {
  #view-people .section-head h1 { font-size: 28px; }
  #view-people .panel-block { padding: 18px 16px 20px; border-radius: 14px; }
  #view-people .add-btn { width: 100%; }
  #view-people .table-wrap { overflow: visible; }
  #view-people .people-table thead { display: none; }
  #view-people .people-table, #view-people .people-table tbody { display: block; }
  #view-people .people-table tr {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center;
    padding: 14px 0; border-bottom: 1px solid var(--p-line);
  }
  #view-people .people-table tr:last-child { border-bottom: 0; padding-bottom: 0; }
  #view-people .people-table tr:first-child { padding-top: 0; }
  #view-people .people-table td { display: block; padding: 0; border: 0; }
  #view-people .people-table td.email-cell { grid-column: 1; grid-row: 1; }
  #view-people .people-table td.row-actions { grid-column: 2; grid-row: 1; }
  #view-people .people-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  #view-people .people-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  #view-people .apps-cell { max-width: none; }
  #view-people .empty-row { display: block !important; }
  #view-people .empty-row td { grid-column: 1 / -1; }
}

/* ── People on one e-mail (app.js §6b): an Apple-style sheet ─────────────── */
.pf-open-page { overflow: hidden; }
.pf-back { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.pf-back.show { opacity: 1; pointer-events: auto; }
.pf-sheet { position: relative; width: 100%; max-width: 460px; max-height: min(88vh, 780px); overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 24px 18px 22px; border-radius: 22px; background: #f2f2f7; color: #1c1c1e;
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 30px 80px rgba(0,0,0,.28); transform: translateY(16px) scale(.98); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.pf-back.show .pf-sheet { transform: none; }
.pf-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(118,118,128,.16); color: #6e6e73; cursor: pointer; }
.pf-x svg { width: 14px; height: 14px; }
.pf-title { margin: 2px 44px 2px 4px; font: 700 24px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif; letter-spacing: -.01em; }
.pf-email { margin: 0 4px 18px; color: #6e6e73; font-size: 15px; overflow-wrap: anywhere; }
.pf-list { list-style: none; margin: 0 0 12px; padding: 0; border-radius: 12px; background: #fff; overflow: hidden; }
.pf-empty { padding: 14px 16px; color: #6e6e73; font-size: 15px; }
.pf-item { padding: 12px 16px; }
.pf-item + .pf-item { box-shadow: inset 16px 0 #fff, inset 0 .5px rgba(60,60,67,.14); }
.pf-item.is-off .pf-name, .pf-item.is-off .pf-avatar { opacity: .45; }
.pf-top { display: flex; align-items: center; gap: 12px; }
.pf-avatar { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #a9b2c3, #8a94a6); color: #fff; font-weight: 600; font-size: 14px; }
.pf-main { min-width: 0; flex: 1; }
.pf-name { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.pf-state { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; margin-top: 1px; color: #6e6e73; font-size: 14px; }
.pf-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.pf-dot.green { background: #34c759; } .pf-dot.amber { background: #ff9f0a; } .pf-dot.red { background: #ff3b30; } .pf-dot.grey { background: #aeaeb2; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 50px; }
.pf-actions:empty { display: none; }
.pf-btn { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(118,118,128,.12); color: #007aff;
  font: 500 15px -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pf-btn:active { opacity: .7; }
.pf-btn.red { color: #ff3b30; }
.pf-btn.primary { background: #007aff; color: #fff; font-weight: 600; }
.pf-btn.armed { background: #ff3b30; color: #fff; }
.pf-btn:disabled { opacity: .45; cursor: default; }
.pf-addbox li { padding: 12px 16px; }
.pf-addlink { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: #007aff;
  font: 17px -apple-system, BlinkMacSystemFont, sans-serif; text-align: left; cursor: pointer; }
.pf-plus { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,122,255,.12); font-size: 24px; line-height: 1; }
.pf-form { flex: 1; }
.pf-form input { display: block; width: 100%; margin: 0 0 8px; padding: 11px 12px; border: 0; border-radius: 10px; background: rgba(118,118,128,.1);
  font: 17px -apple-system, BlinkMacSystemFont, sans-serif; color: #1c1c1e; outline: none; }
.pf-form input:focus { box-shadow: 0 0 0 3px rgba(0,122,255,.25); }
.pf-row { display: flex; justify-content: flex-end; gap: 8px; }
.pf-hint { margin: 4px 16px 0; color: #6e6e73; font-size: 13px; line-height: 1.4; }
.pf-msg { margin: 10px 16px 0; font-size: 14px; }
.pf-msg.err { color: #c4271c; } .pf-msg.ok { color: #1e7b34; }
@media (max-width: 560px) {
  .pf-back { align-items: flex-end; padding: 0; }
  .pf-sheet { max-width: none; max-height: 92vh; border-radius: 22px 22px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); transform: translateY(40px); }
}
@media (prefers-reduced-motion: reduce) { .pf-back, .pf-sheet { transition: none; } }

/* ── "Who are you?" + PIN inside the sign-in card (index.html #pinStep, app.js §3b) ── */
.pin-step { text-align: center; animation: pinIn .25s ease both; }
@keyframes pinIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.pin-title { margin: 0 0 4px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.pin-sub { margin: 0 0 16px; color: var(--ink-dim); font-size: 13.5px; overflow-wrap: anywhere; }
.pin-people { list-style: none; margin: 0; padding: 0; border-radius: 12px; background: #F2F4F8; overflow: hidden; text-align: left; }
.pin-people li + li button { border-top: .5px solid var(--line); }
.pin-people button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 14px; border: 0; background: transparent;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pin-people button:active { background: rgba(18,35,64,.05); }
.pin-people button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pin-people b { display: block; font-weight: 600; font-size: 15px; }
.pin-people small { display: block; font-size: 12.5px; color: var(--ink-dim); }
.pin-people small.warn { color: #C4271C; }
.pin-people .chev { margin-left: auto; width: 8px; height: 13px; flex: 0 0 auto; stroke: #B8C1CF; stroke-width: 2; fill: none; }
.pin-avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: #E1E7F0; color: var(--blue-deep); font-weight: 600; font-size: 14px; }
.pin-who { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 16px 0 6px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--ink); transition: background .12s; }
.pin-dots i.on { background: var(--ink); }
.pin-dots.wrong { animation: pinShake .4s; }
.pin-dots.wrong i { border-color: #FF3B30; }
@keyframes pinShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-msg { min-height: 36px; margin: 2px 0 8px; font-size: 13px; color: var(--ink-dim); }
.pin-msg.bad { color: #C4271C; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 66px); justify-content: center; gap: 12px 20px; }
.pin-keys button { width: 66px; height: 66px; border: 0; border-radius: 50%; background: #EEF1F6; color: var(--ink); font: 500 25px/1 -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; transition: background .1s, transform .1s; }
.pin-keys button:active { background: #DCE2EC; transform: scale(.96); }
.pin-keys button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pin-keys button:disabled { opacity: .35; pointer-events: none; }
.pin-keys .pin-del { background: transparent; color: var(--blue); font-size: 20px; }
.pin-hint { margin: 14px 4px 0; font-size: 12.5px; color: var(--ink-dim); }
.pin-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.pin-links button { border: 0; background: none; padding: 6px 2px; color: var(--blue); font: 500 14px -apple-system, BlinkMacSystemFont, Inter, sans-serif; cursor: pointer; }
.gate-card.is-pin .gate-sub, .gate-card.is-pin #loginBtn { display: none; }
@media (max-height: 680px) { .pin-keys { grid-template-columns: repeat(3, 58px); gap: 9px 18px; } .pin-keys button { width: 58px; height: 58px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .pin-step, .pin-dots.wrong { animation: none; } }

/* ── "Who are you?" like Netflix's "Who's watching?" (app.js showPeopleList) ──
   While the people are showing, the card widens and each person is a big tile:
   a large rounded picture with the initial, the name under it. Same colours as
   the rest of the sign-in. The PIN pad afterwards is unchanged. */
.gate-card { transition: max-width .3s ease; }
.gate-card.is-people { max-width: 920px; padding: 40px 32px 32px; }
.gate-card.is-people .gate-mark { margin-bottom: 10px; }
.gate-card.is-people .pin-title { font-size: 30px; margin-bottom: 6px; }
.gate-card.is-people .pin-sub { margin-bottom: 30px; }
.gate-card.is-people .pin-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 32px; background: none; border-radius: 0; overflow: visible; }
.gate-card.is-people .pin-people li + li button { border-top: 0; }
.gate-card.is-people .pin-people button { flex-direction: column; justify-content: flex-start; gap: 12px; width: 150px; min-height: 0; padding: 0;
  text-align: center; border-radius: 16px; background: none; }
.gate-card.is-people .pin-people button:active { background: none; }
.gate-card.is-people .pin-people .pin-avatar { flex: 0 0 auto; width: 136px; height: 136px; border-radius: 22px; font-size: 52px; font-weight: 600;
  box-shadow: 0 0 0 3px transparent; transition: transform .18s ease, box-shadow .18s ease; }
.gate-card.is-people .pin-people button:hover .pin-avatar,
.gate-card.is-people .pin-people button:focus-visible .pin-avatar { transform: scale(1.05); box-shadow: 0 0 0 3px var(--blue); }
.gate-card.is-people .pin-people button:focus-visible { outline: none; }
.gate-card.is-people .pin-people b { font-size: 16px; font-weight: 600; color: var(--ink-dim); transition: color .18s; overflow-wrap: anywhere; }
.gate-card.is-people .pin-people button:hover b { color: var(--ink); }
.gate-card.is-people .pin-people small { margin-top: 2px; }
.gate-card.is-people .pin-people .chev { display: none; }
.gate-card.is-people .pin-people span:not(.pin-avatar) { display: block; width: 100%; }
@media (max-width: 640px) {
  .gate-card.is-people { padding: 30px 18px 22px; }
  .gate-card.is-people .pin-title { font-size: 24px; }
  .gate-card.is-people .pin-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .gate-card.is-people .pin-people button { width: 100%; }
  .gate-card.is-people .pin-people .pin-avatar { width: 108px; height: 108px; font-size: 42px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .gate-card, .gate-card.is-people .pin-people .pin-avatar { transition: none; } }
/* many people on a small screen: the sign-in scrolls instead of cutting the card off (still centred when it fits) */
.gate { overflow-y: auto; align-items: flex-start; }
.gate > .gate-card { margin: auto; }

/* Under the PIN step: "Not you? Sign out" looks like the People section's "Add person"
   button (filled blue pill); "Back" is a plain blue text link beside it */
.pin-links { align-items: center; gap: 14px; margin-top: 22px; }
.pin-links button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
.pin-links #pinSignOut { min-width: 160px; height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  background: #007aff; color: #fff; font: 600 17px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
  transition: filter .12s ease, transform .08s ease; }
.pin-links #pinSignOut:hover { filter: brightness(1.08); }
.pin-links #pinSignOut:active { transform: scale(.97); }
.pin-links #pinSignOut:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35); }
.pin-links #pinBack { height: 48px; padding: 0 8px; border: 0; background: none; color: #007aff;
  font: 500 17px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; }
.pin-links #pinBack:active { opacity: .6; }
.pin-links #pinBack:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35); border-radius: 10px; }
.pin-links button.hidden { display: none; }
@media (max-width: 480px) { .pin-links #pinSignOut { width: 100%; } }

/* ── Two ways in: a code by e-mail (on top) or Google (app.js §3b, index.html #signInStart) ── */
.gate-card.is-pin #signInStart, .gate-card.is-code #signInStart { display: none; }
.mail-form { display: grid; gap: 10px; }
.mail-form input, #codeInput { width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: rgba(118,118,128,.12);
  font: 17px -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; color: var(--ink); outline: none; transition: box-shadow .15s, background .15s; }
.mail-form input:focus, #codeInput:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0,122,255,.3); }
.mail-btn { width: 100%; height: 48px; border: 0; border-radius: 999px; background: #007aff; color: #fff;
  font: 600 17px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; cursor: pointer; transition: filter .12s, transform .08s; }
.mail-btn:hover { filter: brightness(1.08); }
.mail-btn:active { transform: scale(.98); }
.mail-btn:disabled { opacity: .5; cursor: default; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-faint); font-size: 13px; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-step { text-align: center; }
#codeInput { margin: 6px 0 12px; text-align: center; font-size: 28px; font-weight: 600; letter-spacing: .25em; height: 60px; }
.code-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
.code-links button { border: 0; background: none; padding: 6px 2px; color: #007aff; font: 500 15px -apple-system, BlinkMacSystemFont, Inter, sans-serif; cursor: pointer; }
.code-links button:disabled { opacity: .45; }
.pf-method { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: -10px 4px 16px; color: #6e6e73; font-size: 15px; }
.pf-method b { color: #1c1c1e; font-weight: 500; }
.pf-method .pf-btn { height: 30px; padding: 0 12px; font-size: 14px; }
.code-timer { margin: 14px 0 0; font-size: 15px; font-weight: 500; color: var(--ink-faint); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.code-timer #codeTimerTime { font-size: 17px; font-weight: 600; color: var(--ink-dim); }
.code-timer.is-over { color: #c4271c; }

/* a wrong code: shake + red field, a red flash over the card, a red message */
#codeInput { transition: box-shadow .2s, background .2s, color .2s; }
#codeInput.is-wrong { background: rgba(255,59,48,.08); color: #c4271c; box-shadow: 0 0 0 2px rgba(255,59,48,.55); animation: codeShake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes codeShake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); }
}
.gate-card.flash-red { animation: cardFlash .9s ease-out; }
@keyframes cardFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,48,0), 0 8px 28px rgba(18,35,64,.08); border-color: var(--line); }
  15%  { box-shadow: 0 0 0 6px rgba(255,59,48,.28), 0 0 60px rgba(255,59,48,.35); border-color: #ff3b30; background: #fff6f5; }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0), 0 8px 28px rgba(18,35,64,.08); border-color: var(--line); background: var(--panel); }
}
.gate-error.is-alert { color: #c4271c; font-weight: 600; animation: alertIn .35s ease-out; }
@keyframes alertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #codeInput.is-wrong, .gate-card.flash-red, .gate-error.is-alert { animation: none; } }

/* the message under the code (code window only, for now): the card's own font, bigger and clearer */
.gate-card.is-code .gate-error { margin-top: 16px; font: 500 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; letter-spacing: 0; color: var(--ink-dim); }
.gate-card.is-code .gate-error.is-alert { font-weight: 600; color: #c4271c; }
.gate-card.is-code .gate-error span + span { font-weight: 700; font-variant-numeric: tabular-nums; }

/* this address signs in the other way: the wrong-code alarm on the e-mail field / the Google button */
#mailInput.is-wrong { background: rgba(255,59,48,.08); color: #c4271c; box-shadow: 0 0 0 2px rgba(255,59,48,.55); animation: codeShake .5s cubic-bezier(.36,.07,.19,.97); }
#loginBtn.is-wrong { border-color: #ff3b30; box-shadow: 0 0 0 2px rgba(255,59,48,.45); animation: codeShake .5s cubic-bezier(.36,.07,.19,.97); }
.gate-error.is-wayin { margin-top: 16px; font: 600 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; letter-spacing: 0; color: #c4271c; }
@media (prefers-reduced-motion: reduce) { #mailInput.is-wrong, #loginBtn.is-wrong { animation: none; } }

/* a wrong PIN: the wrong-code alarm (card flash from .flash-red), stronger shake, red dots, bold red message */
.pin-dots.wrong { animation: codeShake .5s cubic-bezier(.36,.07,.19,.97); }
.pin-dots.wrong i { border-color: #ff3b30; box-shadow: 0 0 0 3px rgba(255,59,48,.18); }
.pin-msg.bad { font: 600 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif; color: #c4271c; animation: alertIn .35s ease-out; }
.pin-msg.bad span + span { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .pin-dots.wrong, .pin-msg.bad { animation: none; } }

/* ── the e-mail field of "Add person": type a new one, or pick one on the list (app.js) ── */
#view-people .em-field { position: relative; }
.em-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; max-height: 320px; overflow: auto; padding: 6px;
  border-radius: 14px; background: #fff; box-shadow: 0 12px 36px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.08);
  font: 16px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
.em-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none;
  text-align: left; color: #1c1c1e; cursor: pointer; font: inherit; }
.em-item:hover, .em-item.is-active { background: rgba(0,122,255,.1); }
.em-text { min-width: 0; }
.em-text b { font-weight: 500; overflow-wrap: anywhere; }
.em-text small { display: block; color: #6e6e73; font-size: 13px; }
.em-text small:empty { display: none; }
.em-plus { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,122,255,.12); color: #007aff; font-weight: 600; }
.em-note { margin: 8px 2px 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,122,255,.08); color: #1c1c1e; font-size: 14px; line-height: 1.4; }
.em-note b { font-weight: 600; }
#view-people .role-select:disabled { opacity: .55; cursor: default; }
#view-people .app-toggles.is-locked { opacity: .55; pointer-events: none; }
.em-btn-mail { font-weight: 600; }
