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

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

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

.center-page { text-align: center; }

.header { margin-bottom: 24px; }
.header h1 { font-size: 1.8rem; margin-bottom: 4px; }
.subtitle { color: #718096; font-size: 0.95rem; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 { font-size: 1.15rem; margin-bottom: 12px; }

label { display: block; font-weight: 600; margin-bottom: 4px; margin-top: 12px; }
label:first-child { margin-top: 0; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

textarea { resize: vertical; }

.row { display: flex; gap: 16px; }
.row > div { flex: 1; }

.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }

.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background: #cbd5e0; }

.btn-small { padding: 6px 14px; font-size: 0.85rem; margin-top: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; }
.table th { font-weight: 600; color: #718096; font-size: 0.85rem; text-transform: uppercase; }

.share-box { margin-top: 12px; background: #edf2f7; border-radius: 8px; padding: 12px; }
.share-box label { display: block; font-size: 0.85rem; color: #718096; margin-bottom: 6px; }
.share-input {
  width: calc(100% - 80px);
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.threshold-bar { margin-bottom: 16px; }
.threshold-bar label { display: inline-block; margin-right: 12px; font-size: 0.9rem; }
.threshold-bar input[type="range"] { width: 200px; vertical-align: middle; }
#threshold-val { font-weight: 700; color: #3b82f6; }

.hint { color: #718096; font-size: 0.85rem; margin-bottom: 12px; }

.summary-card dl { text-align: left; }
.summary-card dt { font-weight: 600; margin-top: 8px; }
.summary-card dd { margin-left: 0; color: #4a5568; }

/* Heatmap */
.heatmap { overflow-x: auto; }
.heatmap-grid { display: grid; gap: 2px; min-width: max-content; }
.heatmap-cell {
  width: 36px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
}
.heatmap-cell.empty { background: #e2e8f0; color: #a0aec0; }
.heatmap-header { font-size: 0.75rem; color: #718096; text-align: center; padding: 4px 0; }
.heatmap-day-label { font-size: 0.8rem; font-weight: 600; padding-right: 8px; white-space: nowrap; display: flex; align-items: center; }

/* Time Grid */
.time-grid { overflow-x: auto; user-select: none; }
.grid-row { display: flex; align-items: stretch; min-height: 32px; margin-bottom: 2px; }
.grid-label { width: 100px; min-width: 100px; font-size: 0.8rem; color: #718096; display: flex; align-items: center; padding-right: 8px; justify-content: flex-end; }
.grid-canvas {
  flex: 1;
  position: relative;
  height: 28px;
  background: #f7fafc;
  border-radius: 4px;
  cursor: crosshair;
  overflow: hidden;
}
.grid-slot {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s;
}
.grid-slot:hover { opacity: 1; }

.day-header-row { display: flex; margin-bottom: 4px; }
.day-header { font-size: 0.8rem; font-weight: 600; text-align: center; padding: 4px 0; color: #4a5568; }
.day-separator { width: 2px; background: #cbd5e0; margin: 0 1px; }

.hour-labels { display: flex; margin-bottom: 2px; }
.hour-label { font-size: 0.7rem; color: #a0aec0; text-align: center; min-width: 60px; }