/* Doc Jen App members' website. Colours match the Android app (ui/Ui.java). */
:root {
  --teal: #0B7A8C;
  --teal-dark: #075E6C;
  --teal-soft: #E3F2F3;
  --navy: #12344A;
  --gold: #FFD27A;
  --pink: #E07A93;
  --bg: #F3F7F8;
  --card: #FFFFFF;
  --text: #12344A;
  --muted: #5B7080;
  --line: #D6E2E6;
  --ai-bg: #FDF3DC;
  --ai-text: #854F0B;
  --ok-bg: #E4F4EA;
  --ok: #2E8B57;
  --warn: #B54A35;
  --red: #A32D2D;
  --red-soft: #FCEBEB;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }
a { color: var(--teal-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 16px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand span { color: #7FD3DF; font-weight: 600; margin-left: 2px; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.who-email { color: #CDEBEE; overflow-wrap: anywhere; }
.toplink { color: #BFE9EF; font: inherit; font-weight: 600; }
.as-link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* ---------------------------------------------------------------- hero (landing header) */
.hero {
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff; border-radius: 20px; padding: 20px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.hero .tagline { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.hero .tagline b { color: var(--gold); }
.hero .rule { width: 56px; height: 4px; border-radius: 2px; background: var(--gold); margin: 6px 0 12px; }
.hero .greeting { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.hero .sub { color: #CDEBEE; font-size: 14px; margin: 0; }
.founder { text-align: center; flex: 0 0 auto; width: 120px; }
.founder img {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--gold); display: block; margin: 0 auto 6px; background: #fff;
}
.founder .name { font-size: 12px; font-weight: 700; line-height: 1.3; }
.founder .role { font-size: 11px; color: #CDEBEE; }
@media (max-width: 480px) {
  .hero { padding: 16px; }
  .hero .tagline { font-size: 22px; }
  .founder { width: 92px; }
  .founder img { width: 76px; height: 76px; }
}

/* ---------------------------------------------------------------- cards and buttons */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 12px;
}
.card.soft { background: var(--teal-soft); border-color: #C5E3E6; }
.card.danger { background: var(--red-soft); border-color: #F1C9C9; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 20px 0 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 2px solid var(--teal);
  background: var(--teal); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.secondary { background: #fff; color: var(--teal-dark); }
.btn.secondary:hover { background: var(--teal-soft); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex: 1 1 160px; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--teal-dark); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-align: left; }
.link-btn.danger { color: var(--warn); }
.back { display: inline-block; margin: 4px 0 12px; font-weight: 600; }

/* Big menu rows (Find a doctor / pharmacy / emergency, family members) */
.menu { display: grid; gap: 10px; }
.menu-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font: inherit; width: 100%;
}
.menu-row:hover { border-color: var(--teal); }
.menu-row .ic { flex: 0 0 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--teal-soft); }
.menu-row .ic.red { background: var(--red-soft); }
.menu-row .words { flex: 1; min-width: 0; }
.menu-row .title { font-weight: 700; font-size: 17px; display: block; }
.menu-row .desc { color: var(--muted); font-size: 13px; display: block; }
.menu-row .chev { color: var(--teal); font-size: 26px; font-weight: 700; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid #B9CCD2; background: #fff; color: var(--text);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .menu-row:focus-visible { outline: 3px solid #7FD3DF; outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.form-error { color: var(--warn); font-weight: 600; margin-top: 10px; }
.filter { display: flex; gap: 10px; flex-wrap: wrap; }
.filter > * { flex: 1 1 200px; }

/* ---------------------------------------------------------------- directory entries */
.entry h3 { margin-bottom: 2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); margin-right: 6px; }
.badge.gray { background: #EEF2F4; color: var(--muted); }
.place { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.tel { font-weight: 700; white-space: nowrap; }

/* ---------------------------------------------------------------- answers */
.answer { border-radius: 12px; padding: 12px; margin-top: 10px; white-space: pre-wrap; }
.answer .label { font-weight: 700; font-size: 13px; display: block; margin-bottom: 4px; white-space: normal; }
.answer.verified { background: var(--ok-bg); }
.answer.verified .label { color: var(--ok); }
.answer.ai { background: var(--ai-bg); }
.answer.ai .label { color: var(--ai-text); }
.answer.waiting { background: var(--teal-soft); color: var(--muted); white-space: normal; }
.answer .note { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; white-space: normal; }
.ready { background: var(--ok-bg); border-radius: 12px; padding: 12px; margin-top: 10px; }
.ready h4 { margin: 0; color: var(--ok); font-size: 14px; }
.ready details { border-top: 1px solid #CBE6D4; padding: 8px 0 2px; margin-top: 8px; }
.ready summary { cursor: pointer; font-weight: 700; }
.ready .body { white-space: pre-wrap; margin: 6px 0; font-size: 14px; }
.qtext { white-space: pre-wrap; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- records */
.rec { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.rec:first-of-type { border-top: 0; }
.rec .what { font-weight: 700; }
.rec .meta { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tabs button { flex: 1 1 auto; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------------------------------------------------------------- family tree */
.tree { text-align: center; }
.band-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.band { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding-top: 6px; }
.unit { display: flex; align-items: flex-start; }
.vline { width: 2px; height: 18px; background: #9BB7C0; margin: 6px auto; }
.node { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 4px; width: 72px; display: flex; flex-direction: column; align-items: center; }
.node.big { width: 92px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.node.big .avatar { width: 52px; height: 52px; font-size: 17px; }
.node.me .avatar { width: 60px; height: 60px; background: var(--teal) !important; color: #fff !important; box-shadow: 0 0 0 3px var(--gold); }
.node .nm { font-weight: 700; font-size: 12px; margin-top: 4px; line-height: 1.2; overflow-wrap: anywhere; }
.node.big .nm { font-size: 13px; }
.node .sb { font-size: 11px; color: var(--muted); line-height: 1.2; }
.heart { color: var(--pink); font-weight: 700; padding-top: 14px; }
.b0 .avatar { background: #FAEEDA; color: #854F0B; }
.b1 .avatar { background: #FAECE7; color: #993C1D; }
.b2 .avatar { background: #E3F2F3; color: #075E6C; }
.b3 .avatar { background: #EEEDFE; color: #3C3489; }
.b4 .avatar { background: #EAF3DE; color: #27500A; }

/* ---------------------------------------------------------------- misc */
.loading { color: var(--muted); padding: 24px 0; text-align: center; }
.footer { max-width: 760px; margin: 8px auto 32px; padding: 0 16px; font-size: 14px; color: var(--muted); text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px;
  max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10;
}
dialog { border: 0; border-radius: 16px; padding: 20px; max-width: min(440px, calc(100% - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(18, 52, 74, .45); }
dialog .btn-row { justify-content: flex-end; }
