*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #2563EB;
  --accent-dark: #1D4ED8;
  --green: #16A34A;
  --red: #DC2626;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;
  --bg: #F9FAFB;
  --white: #FFFFFF;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

/* ── Header ── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.logo span { color: var(--accent); }

.lookup-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.lookup-counter.empty    { color: var(--red);   border-color: #FCA5A5; background: #FEF2F2; }
.lookup-counter.unlocked { color: var(--green); border-color: #86EFAC; background: #F0FDF4; }

/* ── Search ── */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 12px 12px 12px 38px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}

#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--muted); }

/* ── Main ── */
main { padding: 12px 16px 100px; max-width: 480px; margin: 0 auto; }

/* ── Results list ── */
#results { display: flex; flex-direction: column; gap: 8px; }

.result-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.result-item:active { transform: scale(0.99); }
.result-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.result-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.result-name { font-weight: 600; font-size: 16px; }

.result-category {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.result-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-phone { font-size: 13px; color: var(--accent); font-weight: 500; }
.result-preview { font-size: 13px; color: var(--muted); }
.result-preview strong { color: var(--text); }

/* ── Accordion detail ── */
.result-item.expanded { border-color: var(--accent); }

.card-detail {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 4px;
}

/* ── Directory ── */
.category-section { margin-bottom: 8px; }

.category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 12px 4px 6px;
}

/* ── No results ── */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.no-results p { margin-bottom: 12px; font-size: 15px; }

/* ── Detail view ── */
#result-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

#result-detail.hidden { display: none; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
  font-weight: 500;
  flex-shrink: 0;
}

.detail-title h2 { font-size: 18px; font-weight: 700; }
.detail-category { font-size: 12px; color: var(--muted); }

/* ── Steps ── */
.steps { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content { display: flex; flex-direction: column; gap: 2px; }

.step-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 2px;
}

.step-type.press { background: #DBEAFE; color: #1D4ED8; }
.step-type.say { background: #D1FAE5; color: #065F46; }

.step-value { font-size: 17px; font-weight: 700; color: var(--text); }
.step-note { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── Tip ── */
.tip {
  margin: 0 16px 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400E;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.tip-icon { flex-shrink: 0; }

/* ── Copy button ── */
.copy-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:active { background: var(--accent-dark); }
.copy-btn.copied { background: var(--green); }

/* ── Detail footer ── */
.detail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.votes { font-size: 13px; color: var(--muted); }

/* ── Links ── */
.submit-link { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }
.submit-link:hover { text-decoration: underline; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px 20px;
  color: var(--muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  padding: 0;
}

.modal-overlay.hidden { display: none; }

.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 40px;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-sheet h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.modal-sheet .subtitle { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

/* Paywall */
.paywall-price {
  text-align: center;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.price-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.paywall-features {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paywall-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.paywall-features .check {
  width: 22px;
  height: 22px;
  background: #D1FAE5;
  color: #065F46;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.unlock-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.unlock-btn:active { background: var(--accent-dark); }

.modal-dismiss {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* Submit form */
.submit-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  outline: none;
  width: 100%;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: none; height: 80px; }

.submit-form-btn {
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#toast.hidden { display: none; }

/* ── Submit FAB ── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
}
