*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(var(--nav-h) + var(--footer-h) + var(--safe-bottom) + 16px);
}
#app-root { max-width: 640px; margin: 0 auto; }
#app-main { padding: 12px 14px 20px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: var(--primary); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 24px; width: 100%; }
.btn-block { width: 100%; margin-bottom: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; background: var(--secondary); color: var(--primary); }
.muted { color: var(--text-muted); font-size: .9rem; }
.page-title, .section-title { font-size: 1.15rem; margin: 0 0 12px; }
.section { margin: 16px 0; }
.form-stack label { display: block; margin-bottom: 10px; font-size: .9rem; }
.form-stack input, .form-stack textarea, .form-stack select {
  width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font: inherit;
  background: var(--surface); color: var(--text);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.header-brand { font-weight: 600; font-size: .95rem; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.bottom-nav {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--footer-h) + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--border); z-index: 30;
}
.bottom-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; text-decoration: none; color: var(--text-muted); font-size: .68rem;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--border);
  padding: 8px 12px calc(8px + var(--safe-bottom));
}
.contact-footer__btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.contact-footer__cta, .contact-footer__btn {
  padding: 8px 14px; border-radius: 999px; font-size: .85rem;
  text-decoration: none; border: none; cursor: pointer;
}
.contact-footer__cta { background: var(--primary); color: #fff; }
.contact-footer__btn { background: #f1f5f9; color: var(--text); }
.contact-footer__brand { text-align: center; font-size: .7rem; color: var(--text-muted); margin: 6px 0 0; }
.toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9999; }
.toast { padding: 10px 18px; border-radius: 8px; margin-bottom: 8px; color: #fff; font-size: .9rem; }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #334155; }
.modal-root { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-root.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal-box { position: relative; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; z-index: 1; }
.tab { border: none; background: var(--secondary); padding: 8px 14px; border-radius: 999px; font-size: .85rem; cursor: pointer; margin-right: 4px; }
.tab.on { background: var(--primary); color: #fff; }
.period-tabs { margin-bottom: 12px; }
.empty-hint { text-align: center; padding: 24px; color: var(--text-muted); }
.share-url { word-break: break-all; font-size: .75rem; }
