* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; background: #f5f5f5; color: #333; }
header { background: #b71c1c; color: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
header h1 { font-size: 1.3rem; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav button { background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
nav button:hover { background: rgba(255,255,255,0.3); }
nav button.active { background: #fff; color: #b71c1c; font-weight: bold; }
#screen { max-width: 960px; margin: 24px auto; padding: 0 16px; }

.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card h2 { font-size: 1.1rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #b71c1c; }

.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: #b71c1c; color: #fff; }
.btn-primary:hover { background: #9a1515; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #ccc; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: bold; font-size: 0.85rem; margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; font-family: inherit; }
.form-group textarea { min-height: 60px; resize: vertical; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
table th { background: #fafafa; font-weight: bold; }
table tr:hover td { background: #f8f8f8; }
table .actions { white-space: nowrap; text-align: right; }

.empty-state { text-align: center; padding: 40px 20px; color: #999; }
.empty-state p { margin-top: 8px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* Phase form */
.phase-block { margin-bottom: 24px; }
.phase-header { background: #f5f5f5; padding: 8px 12px; border-left: 4px solid #b71c1c; font-weight: bold; font-size: 0.95rem; margin-bottom: 8px; }
.phase-guide { font-size: 0.8rem; color: #666; margin: 0 4px 8px; }
.preset-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.preset-chip { font-size: 0.75rem; padding: 3px 10px; border: 1px solid #ccc; border-radius: 12px; background: #fff; cursor: pointer; }
.preset-chip:hover { background: #fbe9e7; border-color: #b71c1c; }
.action-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; padding: 6px 8px; background: #fafafa; border-radius: 4px; }
.action-row .action-text { flex: 1; }
.action-row .action-assignee { width: 120px; }
.add-action-area { display: flex; gap: 8px; margin-top: 8px; }
.add-action-area input { flex: 1; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }
.add-action-area select { width: 120px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }

/* Items */
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; padding: 6px 8px; }
.item-row .item-check { width: 24px; }
.item-row .item-name { flex: 1; }

/* Top screen */
.top-actions { display: flex; gap: 12px; margin-top: 16px; }
.top-actions .btn { flex: 1; text-align: center; padding: 20px; font-size: 1rem; }

/* Preview / Print */
.preview-phase { margin-bottom: 16px; }
.preview-phase h3 { background: #f5f5f5; padding: 6px 10px; border-left: 3px solid #b71c1c; font-size: 0.9rem; }
.preview-phase ul { list-style: none; padding: 4px 0; }
.preview-phase li { padding: 4px 10px; font-size: 0.85rem; border-bottom: 1px dotted #eee; display: flex; gap: 8px; }
.preview-phase li .assignee-tag { display: inline-block; background: #e3f2fd; color: #1565c0; padding: 0 6px; border-radius: 3px; font-size: 0.75rem; }

@media print {
  header, nav { display: none !important; }
  #screen { max-width: 100%; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .no-print { display: none !important; }
}