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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8fafc;
  color: #1f2937;
  line-height: 1.6;
}

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

h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  color: #111827;
}

.section {
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
  padding: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #374151;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .date-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
}

input[type="date"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.days-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-button {
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-button:hover {
  background: #f3f4f6;
}

.day-button.selected {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.dynamic-list {
  margin-bottom: 16px;
}

.dynamic-item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.dynamic-item label {
  margin: 0;
  white-space: nowrap;
}

.dynamic-item input {
  flex: 1;
  margin: 0;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #dc2626;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger:hover {
  background: #b91c1c;
}

.calculate-section {
  text-align: center;
  margin: 32px 0;
}

.calculate-btn {
  padding: 12px 32px;
  font-size: 16px;
}

.result {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 24px;
  margin-top: 24px;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}

.help-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

.progress-container {
  width: 100%;
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
  display: none;
}

.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  width: 0%;
  transition: width linear;
  border-radius: 8px;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
  font-weight: 500;
}