.all_body { 
    font-family: "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f7;
    margin: 0; padding: 20px; color: #333;
    display: flex; justify-content: center;
    -webkit-user-select: none; user-select: none;
}

.container {
    width: 100%; max-width: 650px;
    background: #fff; padding: 20px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

h1 { font-size: 1.3rem; text-align: center; margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 10px; }

/* --- テンプレート管理エリア --- */
.template-section {
    background: #f8f9fa; padding: 15px; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 20px;
}
.template-label { font-size: 0.85rem; font-weight: bold; color: #555; margin-bottom: 5px; display: block;}
.template-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } /* flex-wrap追加 */
.template-select { 
    flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #ccc; font-size: 0.95rem; background: #fff; min-width: 150px;
}
.btn-save-tpl { background: #27ae60; font-size: 0.8rem; }
.btn-share { background: #9b59b6; font-size: 0.8rem; } /* 新規追加 */

/* --- 入力エリア --- */
.input-section { margin-bottom: 25px; padding: 15px; border: 1px solid #eee; border-radius: 8px; }

.input-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.input-row input[type="text"] {
    flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; user-select: text;
}
.btn {
    padding: 0 12px; height: 40px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; color: white; display: flex; align-items: center; justify-content: center;
}
.btn-add { background: #3498db; }
.btn-cat { background: #2980b9; font-size: 0.8rem; }

/* カテゴリ選択ラジオ */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; padding: 5px 0; margin-bottom: 15px;}
.radio-label {
    display: flex; align-items: center; cursor: pointer; font-size: 0.85rem; 
    padding: 5px 12px; border-radius: 20px; transition: 0.2s;
    border: 1px solid #ddd;
    background-color: #fff;
}
.radio-label:hover { opacity: 0.8; }
.radio-label input { margin-right: 5px; cursor: pointer; }
.radio-label.selected { 
    border: 2px solid #555; font-weight: bold; transform: scale(1.05);
}

/* カラーパレット */
.color-picker { display: flex; gap: 8px; margin-right: 8px; }
.color-option {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s;
}
.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: #333; transform: scale(1.2); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* --- リスト表示エリア --- */
.category-block { margin-bottom: 20px; background: #fff; border-radius: 6px; overflow: hidden; }
.category-block.cat-dragging { opacity: 0.4; border: 2px dashed #ccc; }
.category-block.cat-drag-over { border-top: 4px solid #2980b9; }

.category-header {
    padding: 8px 12px; font-weight: bold; font-size: 1rem; color: #333;
    display: flex; justify-content: space-between; align-items: center;
    transition: background-color 0.5s ease, color 0.5s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.checklist-group { list-style: none; padding: 0; margin: 0; }

.checklist-item {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #f0f0f0; background: #fff; transition: background 0.2s;
}
.checklist-item.dragging { opacity: 0.4; background: #eee; }
.checklist-item.drag-over { border-top: 2px solid #3498db; background: #e1f5fe; }

.item-main { display: flex; align-items: center; flex: 1; padding: 12px 5px; cursor: pointer; }
.item-main input[type="checkbox"] { margin-right: 12px; transform: scale(1.3); cursor: pointer; }
.checked .item-text { color: #bbb; text-decoration: line-through; }

/* アイコン */
.icon-lines {
    display: block; width: 14px; height: 2px; background-color: #777; position: relative; border-radius: 2px;
}
.icon-lines::before, .icon-lines::after { content: ''; position: absolute; width: 100%; height: 100%; background-color: inherit; border-radius: inherit; }
.icon-lines::before { top: -4px; }
.icon-lines::after { bottom: -4px; }

.drag-handle { display: none; cursor: grab; padding: 15px 10px; }
.is-editing .drag-handle { display: flex; align-items: center; }
.cat-drag-handle { display: none; cursor: grab; margin-right: 10px; padding: 5px; opacity: 0.6; }
.is-editing .cat-drag-handle { display: inline-block; }
.header-left { display: flex; align-items: center; }

/* 編集コントロール */
.edit-controls { display: none; gap: 5px; padding-right: 5px; align-items: center; }
.is-editing .edit-controls { display: flex; }
.cat-del-btn { background: rgba(255,255,255,0.7); color: #e74c3c; border: 1px solid #e74c3c; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; cursor: pointer; display: none; }
.is-editing .cat-del-btn { display: block; }
.ctrl-btn { border: none; border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 0.8rem; color: white; }
.del-btn { background: #e74c3c; }

/* フッター */
.progress-section { margin-top: 30px; text-align: center; }
.progress-container { width: 100%; height: 18px; background: #eee; border-radius: 9px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; width: 0%; background: #3498db; transition: width 0.4s ease, background-color 0.4s ease; }
.footer-btns { display: flex; justify-content: space-between; margin-top: 15px; gap: 5px; flex-wrap: wrap; }
.secondary-btn { padding: 8px 10px; background: #fff; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; font-size: 0.8rem; flex: 1; min-width: 100px; }
.edit-mode-active { background: #333; color: #fff; border-color: #333; }
.danger-btn { color: #e74c3c; border-color: #e74c3c; }

/* 100%完了時のスタイル */
.all-completed { transform: scale(1.02); box-shadow: 0 15px 40px rgba(0,0,0,0.1); }
.all-completed .progress-bar { background-color: #7f8c8d; }
.all-completed .category-header { 
    background-color: #ecf0f1 !important; 
    color: #95a5a6 !important;
    border-bottom: 1px solid #eee;
}
.all-completed .cat-drag-handle { opacity: 0.2; }