/* Ridgefront Medical ID — clean white, deep medical red, slate ink.
   Big type and high contrast: the public card is read in a hurry,
   often by a stranger, often in bad light. */
:root {
  --red: #B3261E;
  --red-dark: #8C1D18;
  --ink: #23272B;
  --muted: #5A6167;
  --paper: #FFFFFF;
  --wash: #F6F4F1;
  --line: #DDD6CF;
  --ok: #1E6B34;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--wash); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px; line-height: 1.45;
}
.bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper); border-bottom: 3px solid var(--red);
  padding: 12px 16px;
}
.brand { font-weight: 700; font-size: 20px; }
.brand .cross {
  display: inline-block; background: var(--red); color: #fff;
  width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 6px; margin-right: 6px; font-size: 20px;
}
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; margin: 12px 0 8px; }
h2 { font-size: 20px; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 16px; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin: 0 0 16px;
}
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
label.pub-toggle {
  background: var(--wash); border: 1px dashed var(--line);
  border-radius: 8px; padding: 8px 10px; margin: 0 0 8px;
}
input, textarea, select {
  width: 100%; padding: 10px; font-size: 18px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
button {
  padding: 12px 16px; font-size: 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); cursor: pointer;
}
button.primary { background: var(--red); border-color: var(--red-dark); color: #fff; font-weight: 700; }
button.ghost { border: none; background: none; color: var(--red); font-weight: 600; }
button.danger { color: var(--red); border-color: var(--red); margin-top: 10px; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row > div { flex: 1; }
.msg { min-height: 24px; color: var(--red-dark); margin: 8px 0; }
.msg.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 15px; }
.hidden { display: none !important; }

/* My cards list */
.profile-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin: 0 0 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.profile-card .who { font-weight: 700; font-size: 20px; }
.profile-card .code { color: var(--muted); letter-spacing: 2px; }

/* Editor */
.code-row { display: flex; gap: 16px; flex-wrap: wrap; }
.tag-code { font-size: 34px; font-weight: 800; letter-spacing: 4px; }
.qr-box { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.entry-row { display: flex; gap: 8px; margin: 0 0 8px; }
.entry-row input { flex: 1; }
.entry-row button { flex: 0 0 auto; }
.contact-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0 0 10px; }
.contact-box .row { margin-top: 4px; }

/* Public emergency card */
.emergency-banner {
  background: var(--red); color: #fff; font-weight: 800;
  text-align: center; font-size: 22px; letter-spacing: 2px;
  padding: 12px; border-radius: 12px 12px 0 0;
}
.public-card {
  background: var(--paper); border: 2px solid var(--red);
  border-top: none; border-radius: 0 0 12px 12px; padding: 18px;
  margin: 0 0 16px;
}
.public-card .pname { font-size: 32px; font-weight: 800; margin: 0 0 2px; }
.public-card .pcode { color: var(--muted); letter-spacing: 3px; margin: 0 0 12px; }
.public-card h3 {
  font-size: 19px; margin: 18px 0 6px; color: var(--red-dark);
  border-bottom: 2px solid var(--line); padding-bottom: 4px;
}
.public-card ul { margin: 0; padding-left: 20px; }
.public-card li { margin: 0 0 6px; }
.public-card .kv { margin: 0 0 4px; }
.public-card .kv b { display: inline-block; min-width: 110px; }
.allergy-alert {
  background: #FDECEA; border: 1px solid var(--red); border-radius: 8px;
  padding: 10px 12px;
}

@media print {
  .no-print, .bar, button { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  section.hidden { display: none !important; }
}
