:root {
  --navy: #141428;
  --navy2: #1d1d38;
  --green: #1a5c2e;
  --green-bright: #2e8b47;
  --gold: #e8b64c;
  --gold-dark: #c9962e;
  --red: #d63a3a;
  --red-dark: #8f1f1f;
  --text: #f2f0e8;
  --muted: #a8a4b8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 92px;
}
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--navy2);
  border-bottom: 1px solid rgba(232,182,76,.15);
  position: sticky; top: 0; z-index: 10;
}
.topbar-logo { width: 44px; height: 44px; border-radius: 10px; }
.greeting { font-size: 20px; font-weight: 700; }
.dateline { font-size: 13px; color: var(--muted); }
main { padding: 16px; max-width: 560px; margin: 0 auto; }
.screen { display: none; }
.screen.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.checkin-btn {
  width: 100%; border: none; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 24px; padding: 34px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--navy);
  box-shadow: 0 6px 24px rgba(232,182,76,.35);
}
.checkin-icon { font-size: 44px; }
.checkin-label { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.checkin-sub { font-size: 15px; opacity: .8; }

.action-row { display: flex; gap: 12px; margin-top: 14px; }
.action-btn {
  flex: 1; border: none; cursor: pointer; border-radius: 16px; padding: 18px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff;
}
.action-btn.safe { background: linear-gradient(135deg, var(--green-bright), var(--green)); }
.action-btn.panic { background: linear-gradient(135deg, var(--red), var(--red-dark)); user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; position: relative; overflow: hidden; }
.action-btn.panic::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(255,255,255,.28);
  transform: scaleX(var(--hold, 0)); transform-origin: left center;
}
.action-icon { font-size: 30px; }
.action-label { font-size: 17px; font-weight: 800; }
.action-sub { font-size: 13px; opacity: .85; }

.circle-preview { margin-top: 20px; }
.circle-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.circle-head h2 { font-size: 18px; color: var(--gold); }
.link-btn { background: none; border: none; color: var(--gold); font-size: 15px; cursor: pointer; }
.avatars { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; }
.avatar .face {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--navy2); border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.avatar .nm { font-size: 12px; color: var(--muted); }
.avatars .empty { color: var(--muted); font-size: 14px; }

.privacy-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.replay-wrap { text-align: center; margin-top: 8px; }

.confirm-banner {
  background: var(--green-bright); color: #fff; font-weight: 800; font-size: 18px;
  border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 14px;
}
.photo-card { border-radius: 18px; overflow: hidden; background: var(--navy2); margin-bottom: 14px; }
.photo-card img { width: 100%; display: block; max-height: 52vh; object-fit: cover; }
.photo-stamp {
  background: var(--gold); color: var(--navy); font-weight: 700; font-size: 14px;
  padding: 10px 14px; text-align: center;
}

.panic-banner {
  background: var(--red); color: #fff; font-weight: 800; font-size: 20px;
  border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(214,58,58,.6);
}
.panic-card { background: var(--navy2); border-radius: 18px; padding: 16px; margin-bottom: 14px; border: 1px solid rgba(214,58,58,.4); }
.panic-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.panic-title { font-weight: 800; font-size: 18px; }
.panic-live { color: var(--red); font-size: 13px; font-weight: 700; }
.panic-map {
  background: #0d0d1a; border-radius: 12px; min-height: 150px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; margin-bottom: 10px; text-align: center; padding: 12px;
}
.panic-map a { color: var(--gold); }
.panic-info { font-size: 14px; color: var(--muted); text-align: center; }

.gold-btn {
  width: 100%; border: none; cursor: pointer; border-radius: 14px; padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy); font-size: 17px; font-weight: 800; margin-bottom: 10px;
}
.gold-btn.small, .ghost-btn.small, .dark-btn.small { width: auto; padding: 10px 18px; font-size: 14px; margin-bottom: 0; }
.ghost-btn {
  width: 100%; cursor: pointer; border-radius: 14px; padding: 16px;
  background: transparent; border: 2px solid var(--red); color: #fff;
  font-size: 16px; font-weight: 800;
}
.dark-btn {
  border: none; cursor: pointer; border-radius: 10px; padding: 10px 18px;
  background: var(--navy); color: var(--gold); font-weight: 800;
}

.contacts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.contacts-head h2 { font-size: 20px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.contact-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--navy2); border-radius: 14px; padding: 12px;
}
.contact-card .face {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.contact-card .who { flex: 1; }
.contact-card .who .n { font-weight: 700; font-size: 16px; }
.contact-card .who .p { color: var(--muted); font-size: 13px; }
.badge {
  background: var(--green-bright); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 6px 12px;
}
.del-btn { background: none; border: none; color: var(--red); font-size: 20px; cursor: pointer; }
.add-form { background: var(--navy2); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.add-form input {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid rgba(232,182,76,.3);
  background: var(--navy); color: var(--text); font-size: 15px; margin-bottom: 10px;
}
.form-row { display: flex; gap: 10px; }
.premium-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy); border-radius: 14px; padding: 14px;
}
.premium-banner strong { font-size: 15px; }
.premium-banner span { font-size: 13px; }

.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-card { display: flex; gap: 12px; background: var(--navy2); border-radius: 14px; padding: 10px; align-items: center; }
.history-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.history-card .meta .d { font-weight: 700; font-size: 14px; }
.history-card .meta .t { color: var(--muted); font-size: 12px; }
.empty-msg { color: var(--muted); text-align: center; padding: 30px 10px; }

.premium-logo { width: 110px; border-radius: 22px; display: block; margin: 10px auto 16px; }
#screen-premium h2 { text-align: center; margin-bottom: 14px; }
.premium-list { list-style: none; margin-bottom: 18px; }
.premium-list li { padding: 8px 0; font-size: 16px; border-bottom: 1px solid rgba(232,182,76,.12); }
.price { text-align: center; font-size: 44px; font-weight: 800; color: var(--gold); margin-bottom: 14px; }
.price span { font-size: 18px; color: var(--muted); font-weight: 400; }
.fineprint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--navy2);
  border-top: 1px solid rgba(232,182,76,.15);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.bottomnav.hidden { display: none; }

/* welcome */
.welcome-wrap { text-align: center; padding: 26px 6px; }
.welcome-logo { width: 130px; border-radius: 26px; margin-bottom: 16px; }
.welcome-title { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.welcome-slogan { color: var(--gold); font-size: 17px; font-style: italic; margin-bottom: 18px; }
.welcome-input {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid rgba(232,182,76,.3);
  background: var(--navy2); color: var(--text); font-size: 15px; margin-bottom: 14px; text-align: center;
}
.welcome-steps { text-align: left; margin: 20px 0; display: flex; flex-direction: column; gap: 14px; }
.wstep { display: flex; gap: 12px; align-items: flex-start; background: var(--navy2); border-radius: 14px; padding: 12px; }
.wstep span { font-size: 28px; }
.wstep strong { font-size: 15px; }
.wstep p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px;
}
.nav-btn span { font-size: 22px; }
.nav-btn.active { color: var(--gold); }
