:root {
  color-scheme: light;
  --bg: #FAF4EC;
  --card: #FFFFFF;
  --border: #EDE2D4;
  --ink: #3D3229;
  --text-2: #6B5F51;
  --muted: #8C7F70;
  --error: #C0392B;
  --accent: #2F9C95;
  --accent-hover: #257A75;
  --accent-tint: #DFF3F1;
  --accent-line: #B9E0DC;
  --shadow-card: 0 2px 10px rgba(60,40,20,0.06);
  --focus-ring: 0 0 0 3px rgba(47,156,149,0.18);
  --radius-card: 20px;
  --radius-pill: 999px;
  --radius-icon: 14px;
  --font: "Nunito", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  padding: 40px 20px;
}

header,
main {
  max-width: 680px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  flex-shrink: 0;
}

.app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.app-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.section-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
}

.map-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.add-section,
.chart-section,
.list-section {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}

.add-section .field-label {
  margin-top: 14px;
}

.add-section .field-label:first-of-type {
  margin-top: 0;
}

.map-input,
textarea,
select {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.map-input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.error-msg {
  color: var(--error);
  font-size: 13px;
  margin: 8px 0 0;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
  text-align: center;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.secondary-btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 14px 18px;
  cursor: pointer;
  width: 100%;
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.secondary-btn {
  background: var(--card);
  color: var(--accent-hover);
  border: 1.5px solid var(--accent-line);
}

.secondary-btn:hover {
  background: var(--accent-tint);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.pet-tabs-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.pet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pet-tab {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}

.pet-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.add-pet-btn {
  width: auto;
}

#add-pet-section {
  margin-bottom: 24px;
}

.chart-section svg {
  width: 100%;
  height: auto;
  display: block;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entry-main {
  min-width: 0;
}

.entry-date {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-weight {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-hover);
}

.entry-note {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.entry-delete {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry-delete:hover {
  color: var(--error);
  background: rgba(192, 57, 43, 0.08);
}

.entry-delete:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 30px 16px;
}

.empty-illustration {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0;
}

@media (min-width: 480px) {
  .btn-row {
    flex-direction: row;
  }

  .primary-btn,
  .secondary-btn {
    width: auto;
  }

  .add-section .btn-row .primary-btn {
    flex: 1;
  }
}

.how-to-use-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 16px;
  border: 1.5px solid var(--accent-line);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: var(--card);
  color: var(--accent-hover);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  z-index: 900;
}

.how-to-use-btn:hover {
  background: var(--accent-tint);
}

.how-to-use-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 50, 41, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-modal {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 30px 24px 22px;
  box-shadow: 0 24px 60px rgba(60, 40, 20, 0.3);
  text-align: center;
}

.onboarding-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.onboarding-title {
  margin: 6px 0 10px;
  font-size: 18px;
  font-weight: 800;
}

.onboarding-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.onboarding-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.onboarding-dot.active {
  background: var(--accent);
}

.onboarding-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.onboarding-nav-btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #fff;
}

.onboarding-nav-btn:hover {
  background: var(--accent-hover);
}

.onboarding-nav-btn.secondary {
  background: var(--card);
  color: var(--accent-hover);
  border: 1.5px solid var(--accent-line);
}

.onboarding-nav-btn.secondary:hover {
  background: var(--accent-tint);
}

.onboarding-nav-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
