/* ThunderHelp — elderly-friendly: big fonts, high contrast, big buttons, mobile-first */
:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #555;
  --primary: #0b6bcb;
  --primary-dark: #095aa9;
  --green: #1e7e34;
  --red: #c0392b;
  --amber: #b7791f;
  --line: #dfe5ee;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 19px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.55; padding-bottom: 92px;
}
#topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); color: #fff; padding: 14px 18px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.bell {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; font-size: 1.7rem;
  background: rgba(255,255,255,.18); border: 2px solid #fff; border-radius: 50%;
  cursor: pointer;
}
.bell-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 26px; height: 26px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: .85rem; font-weight: 800;
  border-radius: 999px; border: 2px solid #fff;
}
.brand { font-size: 1.35rem; font-weight: 800; }
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.18); border: 2px solid #fff;
  border-radius: 999px; padding: 4px;
}
.lang-opt {
  font-size: 1.05rem; font-weight: 800; padding: 8px 18px; min-height: 46px;
  border: none; border-radius: 999px; background: transparent; color: #fff;
  cursor: pointer;
}
.lang-opt.active { background: #fff; color: var(--primary); }
#view { max-width: 640px; margin: 0 auto; padding: 18px 16px 30px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.3rem; margin: 0 0 10px; }
h3 { font-size: 1.12rem; margin: 14px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.big { font-size: 1.15rem; }

label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 1.05rem; }
input, select, textarea {
  width: 100%; font-size: 1.12rem; padding: 14px 12px;
  border: 2px solid #b9c4d6; border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 3px solid #9cc7f5; border-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; }
.hint { font-size: .95rem; color: var(--muted); margin-top: 6px; }
.warn {
  background: #fff7e6; border: 2px solid #e6b800; border-radius: 10px;
  padding: 12px 14px; margin: 12px 0; font-weight: 600;
}
.error { background: #fdecea; border: 2px solid var(--red); color: var(--red); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 700; }
.okmsg { background: #e9f7ef; border: 2px solid var(--green); color: var(--green); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 700; }

.btn {
  display: block; width: 100%; font-size: 1.2rem; font-weight: 800;
  padding: 16px; margin: 12px 0; border: none; border-radius: var(--radius);
  background: var(--primary); color: #fff; cursor: pointer; text-align: center;
  text-decoration: none; min-height: 58px;
}
.btn:active { background: var(--primary-dark); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-gray { background: #6c757d; }
.btn-outline { background: #fff; color: var(--primary); border: 3px solid var(--primary); }
.btn-small { width: auto; display: inline-block; font-size: 1.02rem; padding: 10px 20px; min-height: 48px; margin: 6px 6px 6px 0; }
.btn-911 {
  background: var(--red); font-size: 1.5rem; padding: 20px;
  border: 4px solid #7d1f14;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; min-width: 140px; }

.req { cursor: pointer; }
.req:active { background: #eef4fb; }
.req-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.req-meta { color: var(--muted); font-size: 1rem; }
.badge {
  display: inline-block; font-size: .95rem; font-weight: 800; padding: 4px 12px;
  border-radius: 999px; margin: 4px 6px 4px 0; color: #fff;
}
.badge-open { background: var(--primary); }
.badge-accepted { background: var(--amber); }
.badge-completed { background: var(--green); }
.badge-cancelled { background: #6c757d; }
.badge-paid { background: #7b2fbe; }
.badge-free { background: #2e7d32; }
.badge-lang { background: #0f766e; }
.badge-match { background: #15803d; }
.filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.filterbar label { margin: 0; white-space: nowrap; }
.filterbar select { width: auto; flex: 1; }
.radio-row { display: flex; gap: 12px; margin: 8px 0; }
.radio-row .radio {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 16px; font-size: 1.15rem; cursor: pointer; flex: 1;
}
.radio-row .radio input { width: 24px; height: 24px; }
.cat { background: #e8f0fe; color: #0b3d91; }

.fee { font-size: 1.25rem; font-weight: 800; color: #7b2fbe; }

#bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: #fff; border-top: 2px solid var(--line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
#bottomnav button {
  flex: 1; border: none; background: none; font-size: .92rem; font-weight: 700;
  color: var(--muted); padding: 10px 2px; cursor: pointer; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
#bottomnav button .ico { font-size: 1.5rem; }
#bottomnav button.active { color: var(--primary); }

/* center check-in button — big and thumb-friendly */
.nav-checkin {
  flex: 1.35; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: var(--primary); color: #fff !important;
  border-radius: 18px; margin: -26px 4px 4px; padding: 10px 2px 8px;
  box-shadow: 0 -3px 10px rgba(11,107,203,.35);
  min-height: 78px; font-weight: 800;
}
.nav-checkin .ck-ico { font-size: 2rem; line-height: 1.1; }
.nav-checkin .ck-label { font-size: 1.02rem; }
.nav-checkin.done { background: var(--green); box-shadow: 0 -3px 10px rgba(30,126,52,.35); }
/* center SOS button — red, always visible */
.nav-checkin.sos {
  background: linear-gradient(135deg, #c62828, #f44336);
  box-shadow: 0 -3px 10px rgba(198,40,40,.45);
  text-decoration: none;
}

.notif.unread { border-left: 6px solid var(--red); }
.notif-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.notif-body { white-space: pre-line; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.stars { display: flex; gap: 8px; font-size: 2.4rem; margin: 8px 0; }
.stars span { cursor: pointer; color: #ccc; }
.stars span.on { color: #f5a623; }

.privacy-box {
  max-height: 300px; overflow-y: auto; border: 2px solid var(--line);
  border-radius: 10px; padding: 14px; background: #fbfcfe; font-size: 1rem;
  margin: 10px 0;
}
.checkline { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; font-size: 1.05rem; }
.checkline input { width: 30px; height: 30px; flex: none; margin-top: 2px; }

.mic-wrap { display: flex; gap: 8px; align-items: stretch; }
.mic-wrap textarea { flex: 1; }
.mic-btn {
  flex: none; width: 64px; font-size: 1.8rem; border: 2px solid var(--primary);
  background: #e8f0fe; border-radius: 10px; cursor: pointer;
}
.mic-btn.rec { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button {
  flex: 1; font-size: 1.1rem; font-weight: 800; padding: 14px;
  border: 2px solid var(--primary); background: #fff; color: var(--primary);
  border-radius: 10px; cursor: pointer;
}
.tabs button.active { background: var(--primary); color: #fff; }

table.admin { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.admin th, table.admin td { border: 1px solid var(--line); padding: 10px 8px; text-align: left; }
table.admin th { background: #eef2f7; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.center { text-align: center; }
.mt { margin-top: 16px; }
.tel-link { font-size: 1.3rem; font-weight: 800; color: var(--primary); }

/* v2 senior-first */
.senior-hi { font-size: 1.6rem; margin: 10px 0 16px; }
.senior-actions { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.senior-btn {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 22px 18px; border: none; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #e8820c, #f5a623); color: #fff;
  box-shadow: 0 4px 14px rgba(232,130,12,.35); text-align: left;
  text-decoration: none;
}
.senior-btn.done { background: linear-gradient(135deg, #1e7e34, #34a853); box-shadow: 0 4px 14px rgba(30,126,52,.35); }
.senior-btn .sb-ico { font-size: 3rem; flex: none; }
.senior-btn .sb-label { font-size: 1.7rem; font-weight: 800; display: block; }
.senior-btn .sb-hint { font-size: 1.05rem; opacity: .92; display: block; margin-top: 4px; }
.btn-huge { font-size: 1.5rem; padding: 22px; line-height: 1.6; }
.btn-huge .bignum { font-size: 2rem; letter-spacing: 2px; }
.mic-btn.mic-big { width: 88px; font-size: 2.6rem; }
.badge-proxy { background: #0d6efd; }
.buddy-entry { cursor: pointer; border: 2px dashed var(--primary); }

/* minimal: talk button */
.senior-btn.talk { background: linear-gradient(135deg, #0d6efd, #20c997); box-shadow: 0 4px 14px rgba(13,110,253,.35); }
.senior-btn.call { background: linear-gradient(135deg, #6f42c1, #b16cea); box-shadow: 0 4px 14px rgba(111,66,193,.35); }
.talk-mic { font-size: 4.5rem; animation: pulse 1.2s infinite; margin: 8px 0; }
.talk-mic.done { animation: none; }
.talk-row { display: flex; gap: 10px; margin-top: 12px; }
.talk-row .btn { flex: 1; }
#talk_text { min-height: 110px; font-size: 1.25rem; }
.senior-btn.buddy { background: linear-gradient(135deg, #e8820c, #f5b301); box-shadow: 0 4px 14px rgba(232,130,12,.35); }
