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

body {
  font-family: sans-serif;
  background: #f9f0f3;
  color: #333;
  min-height: 100vh;
  padding-bottom: 32px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  text-align: center;
  color: #e8537a;
  font-size: 1.4rem;
  padding: 20px 0 12px;
  letter-spacing: 0.05em;
}

h2 {
  font-size: 1rem;
  color: #c0436a;
  margin-bottom: 12px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(232,83,122,0.08);
}

/* 次回予定日カード */
.next-period-card {
  background: linear-gradient(135deg, #e8537a, #f08aaa);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(232,83,122,0.3);
}

.next-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.next-date {
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.next-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 6px;
}

/* フォーム */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #666;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

label.full {
  flex: 1 1 100%;
}

input[type="date"],
input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #f0c0d0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background: #fff8fa;
  outline: none;
  transition: border-color 0.2s;
}

input[type="date"]:focus,
input[type="text"]:focus {
  border-color: #e8537a;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 10px;
  background: #e8537a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

.btn-primary:hover { background: #c0436a; }

/* グラフ */
.graph-wrap {
  overflow-x: auto;
}

canvas {
  display: block;
  max-width: 100%;
}

/* 記録一覧 */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-item {
  background: #fff8fa;
  border: 1px solid #f0c0d0;
  border-radius: 10px;
  padding: 12px;
  position: relative;
}

.record-item .date-range {
  font-weight: bold;
  color: #e8537a;
  font-size: 0.95rem;
}

.record-item .duration {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.record-item .cycle-info {
  font-size: 0.8rem;
  color: #c0436a;
  margin-top: 2px;
}

.record-item .memo-text {
  font-size: 0.85rem;
  color: #555;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0d0da;
}

.btn-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.btn-delete:hover { color: #e8537a; }

.empty-msg {
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
  padding: 16px 0;
}

@media (max-width: 400px) {
  .next-date { font-size: 1.6rem; }
}
