* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  margin: 0;
  padding: 16px;
  color: #333;
  line-height: 1.5;
}
.container {
  max-width: 900px;
  margin: 0 auto;
}
h1 { text-align: center; margin-bottom: 6px; font-size: 22px; }
.subtitle { text-align: center; color: #666; margin-bottom: 20px; font-size: 14px; }
.nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.nav a {
  padding: 8px 16px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: #2563eb;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.nav a.active {
  background: #2563eb;
  color: #fff;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card h2 {
  margin-top: 0;
  font-size: 16px;
  margin-bottom: 14px;
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #475569;
}
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
}
textarea { min-height: 80px; resize: vertical; }
button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
button:hover { background: #1d4ed8; }
button.secondary {
  background: #e2e8f0;
  color: #334155;
}
button.danger {
  background: #ef4444;
}
button.small {
  padding: 4px 10px;
  font-size: 13px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.summary-item {
  text-align: center;
  padding: 14px 8px;
  background: #f8fafc;
  border-radius: 10px;
}
.summary-value {
  font-size: 24px;
  font-weight: bold;
  color: #2563eb;
}
.summary-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.month-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.month-selector select {
  width: auto;
  margin: 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-header {
  text-align: center;
  font-weight: bold;
  color: #64748b;
  font-size: 13px;
  padding: 6px 0;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
}
.calendar-day.empty { background: transparent; }
.calendar-day.has-record { background: #dbeafe; color: #1e40af; font-weight: bold; }
.calendar-day .dot { width: 5px; height: 5px; background: #2563eb; border-radius: 50%; margin-top: 3px; }
.chart-list { display: flex; flex-direction: column; gap: 10px; }
.chart-row { display: flex; align-items: center; gap: 10px; }
.chart-label { width: 90px; font-size: 13px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-wrap { flex: 1; background: #f1f5f9; border-radius: 5px; height: 22px; overflow: hidden; }
.chart-bar { height: 100%; background: #60a5fa; border-radius: 5px; display: flex; align-items: center; padding-left: 6px; color: #fff; font-size: 11px; min-width: fit-content; }
.chart-value { width: 44px; font-size: 12px; color: #64748b; }
.trend-list { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 16px; }
.trend-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trend-bar { width: 100%; background: #34d399; border-radius: 5px 5px 0 0; min-height: 3px; }
.trend-label { font-size: 11px; color: #64748b; text-align: center; }
.trend-value { font-size: 11px; font-weight: bold; color: #059669; }
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
}
.record-item .date { font-weight: bold; margin-bottom: 4px; }
.record-item .tags { color: #475569; font-size: 13px; }
.record-item .actions { margin-top: 8px; display: flex; gap: 8px; }
.password-gate {
  max-width: 360px;
  margin: 80px auto;
  text-align: center;
}
.password-gate input {
  margin-bottom: 12px;
}
.error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
}
.success {
  color: #16a34a;
  font-size: 13px;
  margin-top: 6px;
}
.hidden { display: none; }
.edit-section {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.tag-option {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}
.tag-option.selected {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-label { width: 70px; }
  body { padding: 12px; }
}
