/* FamilyReply web pages. Mobile first, light, same palette as the app. */
:root {
  --ink: #2a1b3d;
  --muted: #63596b;
  --primary: #6b38d4;
  --surface: #fdfbfd;
  --lavender: #f0ebf8;
  --lavender-deep: #e9def4;
  --border: #e8e2ee;
  --danger: #9f1239;
  --danger-soft: #fff1f2;
  --ok: #047857;
  --map-edge: #5ba4e6;
  --map-fill: #f5f0ea;
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.brand img { border-radius: 8px; }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 48px;
  display: grid;
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgb(42 27 61 / 6%);
}

.card.center { text-align: center; padding: 32px 20px; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 8px;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }

.question { font-size: 30px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

/* The other person is in a live call right now. */
.eyebrow.live {
  color: var(--ok);
  font-size: 18px;
}
.eyebrow.live::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .eyebrow.live::before { animation: none; }
}

.muted { color: var(--muted); margin: 0; }

label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 8px; }

textarea,
input[type="text"] {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
}

textarea:focus-visible,
input[type="text"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.row { display: grid; gap: 10px; margin: 14px 0 0; }

/* Chunky buttons with a ledge under them, like the ones in the app. */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--lavender);
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--lavender-deep);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--lavender-deep); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn.primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 4px 0 #5a4a70;
  font-size: 18px;
  min-height: 54px;
}

.btn.ghost { background: #fff; }

.btn.danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  box-shadow: 0 4px 0 #f6d9de;
}

.btn.map {
  display: inline-flex;
  width: auto;
  background: var(--map-fill);
  border-color: var(--map-edge);
  margin: 10px 0 4px;
}

.btn.map::before { content: "\1F4CD"; }

.status { min-height: 1.5em; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.status.ok { color: var(--ok); font-weight: 700; }
.status.warn { color: var(--danger); }

.preview {
  width: 100%;
  max-height: 320px;
  margin-top: 12px;
  border-radius: 12px;
  background: #000;
  object-fit: cover;
}

.replies { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.replies li { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.replies time { display: block; font-size: 13px; color: var(--muted); }
.replies p { margin: 6px 0 0; }

[hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
  :root { --surface: #17101f; --ink: #f3eefa; --muted: #b9aecb; --lavender: #2a1f3a; --lavender-deep: #3b2d52; --border: #3a2d4d; --map-fill: #2d2a33; }
  .card, textarea, input[type="text"], .btn.ghost { background: #211830; }
  .btn.primary { color: #17101f; background: #f3eefa; border-color: #f3eefa; box-shadow: 0 4px 0 #9d8fb6; }
  .btn.danger { background: #3a1621; color: #ffd9e0; border-color: #ff6b88; box-shadow: 0 4px 0 #52202e; }
}

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

.small { font-size: 13px; margin-top: 16px; }
.card.center img { border-radius: 16px; margin-bottom: 12px; }
.card.center p { margin: 14px 0; }
.card.center .btn { margin-top: 12px; }

/* Language button: the current language in a pill, the three languages in a small menu. */
.lang {
  position: relative;
  margin-left: auto;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
}

.lang summary {
  list-style: none;
  cursor: pointer;
  min-width: 52px;
  padding: 8px 14px;
  text-align: center;
  color: var(--primary);
  background: var(--lavender);
  border: 1px solid var(--border);
  border-radius: 999px;
  user-select: none;
}

.lang summary::-webkit-details-marker { display: none; }

.lang summary:focus-visible,
.lang a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(42, 27, 61, 0.12);
}

.lang a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
}

.lang a:hover { background: var(--lavender); }
.lang a[aria-current="true"] { color: var(--primary); background: var(--lavender); }

@media (prefers-color-scheme: dark) {
  .lang summary { color: var(--ink); }
  .lang ul { background: #211830; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
  .lang a[aria-current="true"] { color: var(--ink); }
}

/* "Write where I am instead": a quiet text button, and the field it reveals. */
.linkbtn {
  display: block;
  margin: 8px 0 0;
  padding: 8px 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.linkbtn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

#placeBox { margin: 4px 0 12px; }
#placeBox input { width: 100%; }

.replies .place { margin: 6px 0; font-weight: 600; }

@media (prefers-color-scheme: dark) {
  .linkbtn { color: var(--ink); }
}

/* An approximate location is shown with a warning, never as if it were exact. */
#approxBox { margin: 8px 0 12px; }
#approxBox .btn { margin: 12px 0 0; }
.credit { margin-top: 10px; }
.credit a { color: inherit; }

.replies .approx {
  margin: 6px 0;
  padding: 8px 10px;
  font-size: 14px;
  color: #7a4b00;
  background: #fff4df;
  border: 1px solid #f0cf8f;
  border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  .replies .approx { color: #ffdca0; background: #3a2a0f; border-color: #6b4f1c; }
}

/* Privacy policy and terms: long text, read calmly. */
.legal h2 { font-size: 20px; margin: 22px 0 6px; }
.legal p { line-height: 1.55; }
.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 8px 16px 28px;
  font-size: 14px;
}
.legal-links a { color: var(--muted); }

/* ---------- urgent request (the kidnapping scam): the person's page and the sender's signs ---------- */
:root {
  --warning: #f59e0b;
  --warning-soft: #fff4d9;
  --warning-text: #92400e;
  --ok-soft: #ecfdf5;
}

/* A card with a status rail on the left, like the cards of the app. */
.card.rail { position: relative; padding-left: 24px; overflow: hidden; }
.card.rail::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--rail, var(--primary)); }
.card.rail.danger { --rail: var(--danger); }
.card.rail.warning { --rail: var(--warning); }
.card.rail.ok { --rail: var(--ok); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--primary); background: var(--lavender); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.warning { color: var(--warning-text); background: var(--warning-soft); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.soft { color: var(--muted); background: var(--lavender); }

.card-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.card-head h2 { margin: 0; font-size: 20px; }
.card-head .pill { margin-left: auto; }

.btn.big { min-height: 64px; font-size: 20px; border-radius: 14px; }
.btn.small { min-height: 36px; width: auto; padding: 6px 14px; font-size: 14px; margin: 0; border-radius: 10px; box-shadow: 0 3px 0 var(--lavender-deep); }
.btn.sel { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 #5a4a70; }

.ok-card { border-color: var(--ok); }
#urgentCard .muted { margin-bottom: 18px; }
#urgentCard .status { min-height: 0; margin: 0; }

.note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; font-size: 13px; line-height: 1.35;
  color: var(--warning-text); background: var(--warning-soft); border: 1px solid rgb(245 158 11 / 45%); border-radius: 10px; }
.note .ic { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.note.danger { color: var(--danger); background: var(--danger-soft); border-color: rgb(225 29 72 / 35%); }

.ic { width: 16px; height: 16px; flex: none; }

/* sender: the count of signs */
.signals { display: grid; gap: 16px; }
.sg-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sg-name { font-size: 20px; font-weight: 700; }
.sg-top .verify { margin-left: auto; position: relative; }
.btn .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--danger); border-radius: 99px; }
.sg-score { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.score { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.score strong { font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1; }
.score span { font-size: 13px; font-weight: 700; color: var(--muted); }
/* One bar per signal: Signals.Total (9). An inline style would be refused by the CSP. */
.meter { flex: 1; display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.meter i { height: 8px; border-radius: 99px; background: var(--lavender-deep); }
.meter i.on { background: var(--rail, var(--danger)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--muted); background: var(--lavender); }
.chip .ic { width: 13px; height: 13px; }
.chip.on { color: var(--danger); background: var(--danger-soft); }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.ask { color: var(--warning-text); background: var(--warning-soft); }

.sg-rows { display: grid; gap: 12px; }
.sg-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.sg-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--primary); background: var(--lavender); }
.sg-row.on .sg-ic, .sg-q.on .sg-ic { color: var(--danger); background: var(--danger-soft); }
.sg-row.ok .sg-ic, .sg-q.ok .sg-ic { color: var(--ok); background: var(--ok-soft); }
.sg-row.ask .sg-ic { color: var(--warning-text); background: var(--warning-soft); }
.sg-row.na { opacity: 0.55; }
.sg-title { font-size: 14px; font-weight: 700; }
.sg-row.on .sg-title { color: var(--danger); }
.sg-line { margin: 0; font-size: 13px; color: var(--muted); }
.sg-kind { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sg-kind .ic { width: 12px; height: 12px; }
.sg-map-cap { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.sg-map-cap .ic { color: var(--primary); }
.sg-none { margin: 0; padding: 10px 0; text-align: center; font-weight: 600; color: var(--muted); }

/* sender: the questionnaire, as a sheet over the page */
.sg-sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgb(42 27 61 / 50%); }
.sg-sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 16px 18px 22px; background: var(--surface);
  border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px rgb(42 27 61 / 22%); }
.sg-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.sg-head h2 { margin: 0; }
.sg-x { margin-left: auto; display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); background: var(--lavender);
  border: 0; border-radius: 50%; cursor: pointer; }
.sg-q { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.sg-q.na { opacity: 0.5; }
.sg-txt { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sg-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.sg-btns { display: flex; gap: 6px; }
.sg-sheet .btn.primary { margin-top: 12px; }

@media (prefers-color-scheme: dark) {
  :root { --warning-soft: #3a2b0e; --warning-text: #ffd89a; --ok-soft: #12302a; --danger-soft: #3a1621; }
  .chip.on, .pill.danger, .note.danger { color: #ffd9e0; }
  .btn.small { background: #211830; }
  .btn.sel { color: #17101f; background: #f3eefa; border-color: #f3eefa; }
}

