* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f4f5f7;
  margin: 0;
  color: #222;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #2f6f4f;
  color: white;
}

header h1 {
  margin: 0;
  font-size: 1.3rem;
}

header button {
  background: white;
  color: #2f6f4f;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

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

.test-email-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.test-email-form input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.test-email-form button {
  background: #2f6f4f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friend-card {
  background: white;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.friend-card img.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
}

.friend-card .info {
  flex: 1;
}

.friend-card .name {
  font-weight: 600;
}

.friend-card .last-contact {
  font-size: 0.85rem;
  color: #666;
}

.friend-card .last-contact.stale {
  color: #c0392b;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 30px 14px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

#friend-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #444;
}

#friend-form input,
#friend-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.photo-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  background: #2f6f4f;
  color: white;
}

.form-actions button.danger {
  background: #c0392b;
}

#contacts-section {
  margin-top: 22px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.contact-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.contact-form input {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  flex: 1;
  min-width: 100px;
}

.contact-form button {
  background: #2f6f4f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.contact-list .meta {
  color: #666;
}

.contact-list button {
  border: none;
  background: none;
  color: #c0392b;
  cursor: pointer;
}

.hidden {
  display: none !important;
}
