/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: #2c2c2c;
  background: #faf7f2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #2c2c2c;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { top: 0; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e6dfd3;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #2c2c2c;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo svg { flex-shrink: 0; }
.site-nav ul {
  display: flex;
  list-style: none;
  gap: 1.25rem;
}
.site-nav a {
  text-decoration: none;
  color: #5a4e3c;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a:focus { color: #2c2c2c; text-decoration: underline; }

/* Dashboard */
.dashboard { padding: 2rem 0; }
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dashboard-header h1 { font-size: 1.75rem; flex: 1; }
.subtitle { color: #5a4e3c; font-size: 1rem; flex: 1 0 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #e07b5a; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #c96a4b; }
.btn-secondary { background: #f0ede5; color: #2c2c2c; border: 1px solid #d9d0bf; }
.btn-secondary:hover, .btn-secondary:focus { background: #e6dfd3; }
.btn-danger { background: #fff; color: #b33a3a; border: 1px solid #e0c0c0; }
.btn-danger:hover, .btn-danger:focus { background: #fdf0f0; }

/* Pet tabs */
.pet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e6dfd3;
  padding-bottom: 0.75rem;
}
.pet-tab {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 2px solid transparent;
  background: #f0ede5;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}
.pet-tab[aria-selected="true"] {
  background: #fff;
  border-color: #e07b5a;
  color: #2c2c2c;
}
.pet-tab:hover, .pet-tab:focus { background: #e6dfd3; }

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e6dfd3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.card h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }

/* Quick log */
.quick-log-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.log-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #d9d0bf;
  background: #faf7f2;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}
.log-btn:hover, .log-btn:focus { background: #f0ede5; border-color: #b8a890; }
.log-icon { font-size: 1.1rem; }
.log-note-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d9d0bf;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: #fdfcf9;
}

/* Weekly heatmap */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 0.75rem;
}
.day-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #f0ede5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.day-cell:hover, .day-cell:focus { border-color: #b8a890; }
.day-cell[data-count="0"] { background: #f0ede5; }
.day-cell[data-count="1"], .day-cell[data-count="2"] { background: #fce4c8; }
.day-cell[data-count="3"], .day-cell[data-count="4"] { background: #f5b87a; }
.day-cell[data-count="5"], .day-cell[data-count="6"], .day-cell[data-count="7"], .day-cell[data-count="8"], .day-cell[data-count="9"], .day-cell[data-count="10"] { background: #e07b5a; color: #fff; }

.legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #5a4e3c;
}
.legend-item { display: flex; align-items: center; gap: 0.25rem; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.swatch-empty { background: #f0ede5; }
.swatch-light { background: #fce4c8; }
.swatch-medium { background: #f5b87a; }
.swatch-full { background: #e07b5a; }

/* Actions row */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay[aria-hidden="true"] { display: none; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.modal h2 { margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-group input, .form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d9d0bf;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* Supporting content */
.supporting-content {
  background: #fff;
  border-top: 1px solid #e6dfd3;
  padding: 2.5rem 0;
}
.support-article h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.support-article h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.support-article p, .support-article li { color: #3d3529; margin-bottom: 0.75rem; }
.support-article ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.related-links {
  margin-top: 2rem;
  padding: 1rem;
  background: #faf7f2;
  border-radius: 8px;
  border: 1px solid #e6dfd3;
}
.related-links h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.related-links a { color: #e07b5a; font-weight: 600; }

/* Footer */
.site-footer {
  margin-top: auto;
  background: #f0ede5;
  border-top: 1px solid #e6dfd3;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #5a4e3c;
}
.site-footer nav { display: flex; justify-content: center; gap: 1.25rem; margin: 0.5rem 0; }
.site-footer a { color: #5a4e3c; text-decoration: underline; }
.site-footer a:hover { color: #2c2c2c; }
.version { font-size: 0.8rem; color: #8c7b64; }

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Print styles */
@media print {
  .site-header, .site-footer, .actions-row, .quick-log-card, .modal-overlay, .related-links { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
