* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
  margin: 0;
  padding: 24px;
}
.container {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
h1 { font-size: 1.4rem; margin-bottom: 20px; }
h2 { font-size: 1.1rem; margin-top: 32px; }

.controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.8rem; color: #555; }
select, input[type="number"], input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #d0d3d9;
  border-radius: 6px;
  font-size: 0.95rem;
}
button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover { background: #1d4ed8; }
#newSourceBtn { background: #eef1f6; color: #1f2430; }
#newSourceBtn:hover { background: #dde2ea; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #eee; }
th { font-size: 0.8rem; color: #666; }
td input[type="number"] { width: 120px; }

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hidden { display: none; }

#daysDetails {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
#daysDetails summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #2563eb;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
#daysDetails summary::-webkit-details-marker { display: none; }
#daysDetails summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
#daysDetails[open] summary::before { transform: rotate(90deg); }
#daysDetails summary:hover { color: #1d4ed8; }

#statusMsg { font-size: 0.9rem; min-height: 1.2em; color: #16a34a; }
#statusMsg.error { color: #dc2626; }

.export-preview pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.8rem;
  max-height: 320px;
}

dialog {
  border: none;
  border-radius: 10px;
  padding: 20px;
  min-width: 280px;
}
dialog form { display: flex; flex-direction: column; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
