/* 
 * タスク管理アプリ - ソフトUI版（元のテーマカラー）
 * 特徴: 赤系テーマカラー (#8B1538)、丸みのあるカード、柔らかい背景、点線タイムライン
 */

/* カラーパレット */
:root {
    --primary-red: #8B1538;
    --primary-red-light: #A91D42;
    --primary-red-dark: #6B0F2A;
    --gray-50: #f5f5f5;
    --gray-100: #f9f9f9;
    --gray-200: #e8e8e8;
    --gray-300: #ddd;
    --gray-400: #999;
    --gray-500: #666;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #333;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(139, 21, 56, 0.4);
    
    /* タイムライン用追加カラー */
    --priority-high: #991B1B;
    --priority-medium: #4B5563;
    --priority-low: #9CA3AF;
    
    /* アイコン用カラー */
    --icon-home: #ffb3ba;
    --icon-car: #ffd699;
    --icon-health: #ffb3ba;
    --icon-book: #e8e8e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
}

/* ハンバーガーメニューボタン（デフォルトで非表示） */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 0.5rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

/* Erudaの右下アイコンを非表示 */
.eruda-entry-btn {
    display: none !important;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* サイドバー */
.sidebar {
    width: 250px;
    background-color: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.nav-btn.active {
    background-color: var(--primary-red);
    color: var(--white);
}

.nav-btn .icon {
    font-size: 1.25rem;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-title {
    display: none;
}

/* ダッシュボード */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}

.today-summary {
    margin-bottom: 1.5rem;
}

.summary-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 0.5rem;
    background-color: var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-red-light));
    border-radius: 1rem;
    transition: width 0.3s ease;
    width: 0%;
}

.priority-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.priority-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.high {
    background-color: var(--priority-high);
    color: var(--white);
}

.priority-badge.medium {
    background-color: var(--gray-500);
    color: var(--white);
}

.priority-badge.low {
    background-color: var(--gray-300);
    color: var(--gray-700);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.task-item {
    padding: 1rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    border-left: 3px solid var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
}

.task-item:hover {
    background-color: var(--gray-200);
    transform: translateX(2px);
}

.task-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-item.priority-high {
    border-left-color: var(--priority-high);
}

.task-item.priority-medium {
    border-left-color: var(--priority-medium);
}

.task-item.priority-low {
    border-left-color: var(--priority-low);
}

.task-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-red);
}

.task-item-title {
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
}

.task-unschedule-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 0.25rem;
}

.task-unschedule-btn:hover {
    color: var(--primary-red);
    background-color: var(--gray-100);
}

.task-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* カレンダー */
.calendar-container {
    display: flex;
    gap: 2rem;
    height: calc(100vh - 150px);
}

.week-calendar {
    flex: 1;
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-nav-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background-color: var(--white);
    color: var(--gray-700);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background-color: var(--gray-100);
}

.week-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    height: calc(100% - 60px);
}

.calendar-day {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: var(--gray-100);
    min-height: 150px;
}

.calendar-day.today {
    background-color: #FFF5F7;
    border-color: var(--primary-red-light);
}

.calendar-day-header {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.calendar-day-date {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.calendar-day.today .calendar-day-date {
    color: var(--primary-red);
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-task {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: var(--white);
    border-radius: 0.375rem;
    border-left: 3px solid var(--primary-red);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.calendar-task:hover {
    box-shadow: var(--shadow);
}

.calendar-task-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow: hidden;
}

.calendar-task-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
}

.calendar-task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--gray-800);
}

.calendar-task-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.calendar-task-remove:hover {
    color: var(--primary-red);
}

.calendar-task.priority-high {
    border-left-color: var(--priority-high);
}

.calendar-task.priority-medium {
    border-left-color: var(--priority-medium);
}

.calendar-task.priority-low {
    border-left-color: var(--priority-low);
}

.calendar-day.drag-over {
    background-color: var(--gray-200);
    border-color: var(--primary-red);
}

/* タスクサイドバー */
.task-sidebar {
    width: 350px;
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.task-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.task-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.unscheduled-tasks,
.scheduled-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 50px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.unscheduled-tasks.drag-over,
.scheduled-tasks.drag-over {
    background-color: var(--gray-200);
}

.unscheduled-task {
    padding: 1rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    border-left: 3px solid var(--gray-300);
    cursor: move;
    transition: all 0.2s;
}

.unscheduled-task:hover {
    background-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.unscheduled-task.priority-high {
    border-left-color: var(--priority-high);
}

.unscheduled-task.priority-medium {
    border-left-color: var(--priority-medium);
}

.unscheduled-task.priority-low {
    border-left-color: var(--priority-low);
}

/* ボード（ToDo管理） */
.board-header {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.board-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.bucket {
    min-width: 350px;
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: opacity 0.2s;
}

.bucket[draggable="false"] {
    cursor: default;
}

.bucket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}

.bucket-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.bucket-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bucket-collapse-btn {
    display: none;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .bucket-collapse-btn {
        display: block;
    }
    
    .bucket-header-left {
        cursor: pointer;
    }
    
    .bucket.collapsed .bucket-tasks {
        display: none !important;
    }
    
    .bucket.collapsed {
        padding-bottom: 0.75rem;
    }
    
    .bucket.collapsed .bucket-header {
        margin-bottom: 0;
        border-bottom: none;
        padding-bottom: 0;
    }
}

.completed-bucket-title {
    color: var(--primary-red);
}

.bucket.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.bucket-count {
    background-color: var(--gray-200);
    color: var(--gray-700);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.bucket-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bucket-add-task-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    line-height: 1;
}

.bucket-add-task-btn:hover {
    color: var(--primary-red);
    background-color: var(--gray-100);
}

.bucket-delete {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bucket-delete:hover {
    color: var(--primary-red);
}

.bucket-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100px;
}

.board-task {
    padding: 1rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    border-left: 3px solid var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
}

.board-task:hover {
    background-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.board-task.priority-high {
    border-left-color: var(--priority-high);
}

.board-task.priority-medium {
    border-left-color: var(--priority-medium);
}

.board-task.priority-low {
    border-left-color: var(--priority-low);
}

.board-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.board-task-title {
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
}

.board-task.completed .board-task-title {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-complete-btn {
    background: none;
    border: 1px solid var(--gray-300);
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.125rem 0.375rem;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 0.25rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.task-complete-btn:hover {
    color: var(--primary-red);
    border-color: var(--primary-red);
    background-color: rgba(139, 21, 56, 0.05);
}

.board-task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.board-task-deadline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.board-task-schedule {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-red);
    font-weight: 600;
}

/* ボタン */
.btn-primary {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-red-light));
    color: var(--white);
    border: none;
    border-radius: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-red-dark), var(--primary-red));
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-danger {
    padding: 0.5rem 1rem;
    background-color: #991B1B;
    color: var(--white);
    border: none;
    border-radius: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-danger:hover {
    background-color: #7F1D1D;
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* カスタムモーダル */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.custom-modal.active {
    display: flex;
}

.custom-modal-content {
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.custom-modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--gray-800);
}

.custom-modal-content p {
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

.custom-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.custom-modal-actions .btn {
    flex: 1;
}
    border-radius: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--gray-100);
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 1.25rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.modal-footer .modal-footer-right {
    margin-left: auto;
    display: flex;
    gap: 1rem;
}

/* アクションボタン（編集・削除選択用） */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 1.25rem;
    background-color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.action-btn:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.action-btn-primary {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.action-btn-primary:hover {
    background-color: var(--primary-red);
    color: var(--white);
}

.action-btn-danger {
    border-color: #991B1B;
    color: #991B1B;
}

.action-btn-danger:hover {
    background-color: #991B1B;
    color: var(--white);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
}

/* フォームヒントテキスト */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* 繰り返し設定UI */
.recurring-settings {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    margin-top: 1rem;
}

.weekday-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.weekday-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.weekday-checkbox input[type="checkbox"] {
    display: none;
}

.weekday-checkbox span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    background-color: var(--white);
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
}

.weekday-checkbox input[type="checkbox"]:checked + span {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
}

.weekday-checkbox:hover span {
    border-color: var(--primary-red);
    transform: scale(1.05);
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item,
.board-task,
.calendar-task,
.unscheduled-task {
    animation: fadeIn 0.3s ease;
}

/* ===================================
   レスポンシブデザイン（スマホ対応）
   =================================== */

/* FABボタン（デフォルトで非表示） */
.fab-button {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: var(--primary-red);
    color: white;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: transform 0.2s;
}

.fab-button:hover {
    transform: scale(1.1);
}

.fab-button:active {
    transform: scale(0.95);
}

/* モバイル用カレンダービュー（デフォルトで非表示） */
.mobile-calendar-view {
    display: none;
}

/* タブレット以下 (768px以下) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .fab-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #add-task-from-timeline-btn {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .app-title {
        font-size: 1.5rem;
        padding: 1rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    .nav-menu {
        padding: 0 1rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .nav-btn .icon {
        font-size: 1.25rem;
    }
    
    .main-content {
        padding: 4.5rem 0 0.5rem;
        width: 100%;
        height: 100vh;
    }
    
    .view {
        height: calc(100vh - 5rem);
        overflow-y: auto;
    }
    
    .view-title {
        padding: 0 0.75rem;
        margin-bottom: 1rem;
        font-size: 1.25rem;
    }
    
    #board-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 0.75rem;
    }
    
    .bucket {
        width: 100%;
        min-width: auto;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .today-summary {
        margin-bottom: 1rem;
    }
    
    .summary-text {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .task-list {
        gap: 0.5rem;
    }
    
    .task-item {
        padding: 0.75rem;
    }
    
    .priority-section {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .priority-item {
        padding: 0.6rem 0.5rem;
        gap: 0.35rem;
        font-size: 0.8rem;
    }
    
    .calendar-container {
        display: none;
    }
    
    .mobile-calendar-view {
        display: block;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        padding: 0;
    }
    
    .mobile-date-selector {
        display: flex;
        gap: 0.4rem;
        overflow-x: auto;
        padding: 0.75rem 0.5rem;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-date-selector::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-date-item {
        flex: 0 0 auto;
        width: 3.2rem;
        padding: 0.65rem 0.4rem;
        text-align: center;
        border-radius: 0.875rem;
        background: var(--white);
        border: 2px solid var(--gray-200);
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .mobile-date-item.today {
        border-color: var(--primary-red);
    }
    
    .mobile-date-item.selected {
        background: var(--primary-red);
        color: white;
        border-color: var(--primary-red);
    }
    
    .mobile-date-day {
        font-size: 0.7rem;
        color: var(--gray-500);
        margin-bottom: 0.25rem;
    }
    
    .mobile-date-item.selected .mobile-date-day {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .mobile-date-number {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    .mobile-date-count {
        font-size: 0.65rem;
        color: var(--gray-500);
        margin-top: 0.25rem;
    }
    
    .mobile-date-item.selected .mobile-date-count {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .mobile-selected-date-tasks {
        margin-bottom: 1.5rem;
    }
    
    .mobile-date-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--gray-800);
        margin-bottom: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .mobile-tasks-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 0.75rem;
    }
    
    .mobile-task-card {
        background: white;
        border-radius: 0.5rem;
        padding: 0.875rem;
        box-shadow: var(--shadow);
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .mobile-task-checkbox {
        width: 1.25rem;
        height: 1.25rem;
        cursor: pointer;
    }
    
    .mobile-task-content {
        flex: 1;
    }
    
    .mobile-task-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--gray-800);
        margin-bottom: 0.25rem;
    }
    
    .mobile-task-meta {
        display: flex;
        gap: 0.75rem;
        font-size: 0.8rem;
        color: var(--gray-600);
    }
    
    .mobile-task-priority {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .priority-high .mobile-task-priority::before {
        content: '🔴';
    }
    
    .priority-medium .mobile-task-priority::before {
        content: '⚫';
    }
    
    .priority-low .mobile-task-priority::before {
        content: '⚪';
    }
    
    .mobile-unscheduled-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 2px solid var(--gray-200);
    }
    
    .mobile-section-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--gray-700);
        margin-bottom: 0.75rem;
        padding: 0 0.75rem;
    }
    
    #add-task-btn-pc {
        display: none;
    }
    
    .unscheduled-panel {
        max-height: none;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
    }
    
    /* タスク追加モーダル：モバイルで快適な入力体験 */
    #task-modal .modal-content {
        max-height: 95dvh;
        max-height: 95vh;
        height: auto;
        margin: 0.5rem;
        border-radius: 1rem;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    #task-modal .modal-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
    #task-modal .modal-header h3 {
        font-size: 1.05rem;
    }
    #task-modal .modal-body {
        padding: 0.75rem 1rem 0.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
        max-height: 75dvh;
        max-height: 75vh;
        min-height: 0;
    }
    #task-modal .form-group {
        margin-bottom: 0.6rem;
    }
    #task-modal .recurring-settings,
    #task-modal .timeline-fields .form-group:last-child {
        margin-bottom: 0;
    }
    #task-modal .form-group label {
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }
    #task-modal .form-input {
        padding: 0.5rem 0.7rem;
        font-size: 16px; /* 16px以上でiOS自動ズームを防止 */
    }
    #task-modal #task-description {
        min-height: 2.5rem;
        resize: none;
    }
    #task-modal .form-row {
        gap: 0.5rem;
    }
    #task-modal .timeline-fields {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        margin-bottom: 0;
        padding-bottom: 0;
        border-top-width: 1px;
    }
    #task-modal .duration-quick-btns {
        margin-bottom: 0.35rem;
    }
    #task-modal .duration-quick-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    #task-modal .duration-dropdown {
        padding: 0.35rem 0.4rem;
        min-width: 2.8rem;
        font-size: 16px; /* iOS自動ズーム防止 */
    }
    #task-modal .duration-custom-row {
        gap: 0.35rem;
    }
    #task-modal .duration-custom-label,
    #task-modal .duration-unit {
        font-size: 0.85rem;
    }
    #task-modal .recurring-settings {
        padding-top: 0.5rem;
        margin-top: 0.5rem;
        margin-bottom: 0;
        padding-bottom: 0;
        border-top-width: 1px;
    }
    #task-modal .modal-footer {
        padding: 0.6rem 1rem;
        flex-shrink: 0;
        margin-top: 0;
    }
    #task-modal .modal-footer .btn-primary,
    #task-modal .modal-footer .btn-secondary {
        padding: 0.55rem 1rem;
        font-size: 0.9rem;
    }
    #task-modal .weekday-selector {
        gap: 0.4rem;
    }
    #task-modal .weekday-checkbox span {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .view-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .view-header h2 {
        font-size: 1.5rem;
    }
    
    #date-detail-tasks {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #date-detail-tasks .calendar-task {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        border-radius: 0.5rem;
        background: var(--gray-100);
    }
}

/* スマホ (480px以下) */
@media (max-width: 480px) {
    .menu-toggle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .fab-button {
        width: 3rem;
        height: 3rem;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.75rem;
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .main-content {
        padding: 4rem 0 0.5rem;
    }
    
    .view {
        height: calc(100vh - 4.5rem);
    }
    
    .view-title {
        padding: 0 0.5rem;
        font-size: 1.1rem;
    }
    
    .view-header h2 {
        font-size: 1.25rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .mobile-date-item {
        width: 2.85rem;
        padding: 0.45rem 0.3rem;
    }
    
    .mobile-date-selector {
        padding: 0.5rem 0.4rem;
        margin-bottom: 0.75rem;
        gap: 0.35rem;
    }
    
    .mobile-date-day {
        font-size: 0.65rem;
    }
    
    .mobile-date-number {
        font-size: 1.1rem;
    }
    
    .mobile-date-count {
        font-size: 0.6rem;
    }
    
    .mobile-date-title {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .mobile-task-card {
        padding: 0.75rem;
    }
    
    .mobile-tasks-list {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .mobile-section-title {
        padding: 0 0.5rem;
    }
    
    .mobile-task-title {
        font-size: 0.9rem;
    }
    
    .dashboard-grid {
        padding: 0 0.5rem;
        gap: 0.6rem;
    }
    
    .card {
        padding: 0.875rem;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }
    
    .task-item {
        padding: 0.65rem;
    }
    
    .priority-item {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
    
    #board-container {
        padding: 0 0.5rem;
    }
    
    .mobile-calendar-view {
        padding: 0;
    }
    
    .mobile-unscheduled-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .mobile-selected-date-tasks {
        margin-bottom: 1rem;
    }
    
    .mobile-task-meta {
        font-size: 0.75rem;
    }
    
    .board-task-title,
    .task-name {
        font-size: 0.85rem;
    }
}

/* ==========================================
   タイムライン機能用スタイル（オレンジ・ソフトUI版）
   ========================================== */

/* 日付ヘッダー */
.date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
}

.date-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.date-label {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--gray-800);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.date-label .year-month-day {
    color: var(--primary-red);
}

.date-nav-btn {
    padding: 0.625rem 1.25rem;
    border: 2px solid var(--gray-200);
    background-color: var(--white);
    color: var(--gray-700);
    border-radius: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-weight: 500;
}

.date-nav-btn:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

.today-btn {
    padding: 0.625rem 1.25rem;
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 1.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(139, 21, 56, 0.2);
}

.today-btn:hover {
    background-color: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
}

/* タイムラインコンテナ */
.timeline-container {
    display: flex;
    gap: 1.5rem;
    min-height: 400px;
    position: relative;
    padding: 1.25rem;
    background: var(--white);
    border-radius: 1.25rem;
    margin-top: 0.625rem;
}

/* タイムラインメインエリア（左側） */
.timeline-main-area {
    flex: 1;
    display: flex;
    background-color: var(--white);
    overflow-y: visible;
    overflow-x: hidden;
    position: relative;
    min-height: 400px;
}

/* インボックスエリア（右側） */
.timeline-inbox-area {
    width: 350px;
    flex-shrink: 0;
}

.timeline-labels {
    width: 50px;
    flex-shrink: 0;
    padding-left: 0.625rem;
}

.time-label {
    height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-400);
    border-bottom: none;
    position: relative;
    left: 0;
    width: 50px;
    text-align: left;
}

.timeline-grid {
    flex: 1;
    position: relative;
    padding-left: 6.063rem;
}

/* タスクベースレイアウト（予定がある部分は拡大、ない時間は省略） */
.timeline-grid.timeline-task-based {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: auto;
    padding: 0;
}

.timeline-grid.timeline-task-based::before {
    display: none;
}

/* タスクブロック */
.timeline-task-block {
    display: flex;
    align-items: stretch;
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    cursor: default;
    position: relative;
    flex-shrink: 0;
}

/* 左側：アイコンと縦の点線エリア */
.timeline-left {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 6px;
}

/* 縦の点線（アイコンの背面を通って下まで伸びる） */
.timeline-left::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    border-left: 2px dashed #d1d1d6;
    z-index: 1;
}

/* アイコン円 */
.icon-circle {
    width: 44px;
    height: 44px;
    background-color: var(--gray-100);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    z-index: 2;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--gray-200);
}

/* 優先度によるアイコン枠色 */
.timeline-task-block.priority-high .icon-circle {
    border-color: var(--priority-high);
    background-color: rgba(153, 27, 27, 0.05);
}
.timeline-task-block.priority-medium .icon-circle {
    border-color: var(--priority-medium);
}
.timeline-task-block.priority-low .icon-circle {
    border-color: var(--priority-low);
}

/* 右側：時刻とタイトル */
.timeline-right {
    flex: 1;
    min-width: 0;
    padding: 8px 0 24px 12px;
    cursor: pointer;
}

.task-time {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 4px;
    line-height: 1.3;
}

.task-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1c1c1e;
    line-height: 1.4;
}

/* チェックボックス */
.timeline-task-block .schedule-checkbox {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    cursor: pointer;
    accent-color: var(--primary-red);
    margin-top: 10px;
    margin-right: 4px;
}

/* 完了済み */
.timeline-task-block.completed .icon-circle {
    opacity: 0.4;
}
.timeline-task-block.completed .task-time,
.timeline-task-block.completed .task-title {
    color: var(--gray-400) !important;
}
.timeline-task-block.completed .task-title {
    text-decoration: line-through;
}

/* 空き時間ブロック */
.timeline-gap-block {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    min-height: 32px;
    padding: 0;
    margin: 0;
}

.timeline-gap-block .timeline-left {
    padding-top: 0;
}

.gap-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 12px;
    transition: background 0.2s;
}

.timeline-gap-block:hover .gap-content {
    color: var(--primary-red);
}

/* タイムライン軸（点線） */
.timeline-grid::before {
    content: '';
    position: absolute;
    left: 9.063rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--gray-300) 50%, transparent 50%);
    background-size: 2px 8px;
    z-index: 1;
}

.timeline-slot {
    height: 80px;
    border-bottom: none;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.timeline-slot:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* スケジュールアイテム - ソフトUI */
.schedule-item {
    position: absolute;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.938rem 1rem;
    background: var(--gray-100);
    border-radius: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 75px;
    z-index: 10;
    user-select: none;
}

.schedule-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    z-index: 50;
}

.schedule-item:active {
    transform: translateY(0);
}

.schedule-item.completed {
    opacity: 0.5;
}

.schedule-item.completed .schedule-item-title,
.schedule-item.completed .schedule-item-time {
    text-decoration: line-through;
}

.schedule-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.schedule-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
    line-height: 1.4;
}

.schedule-item-time {
    font-size: 0.813rem;
    color: var(--gray-400);
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* スケジュールチェックボックス */
.schedule-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-red);
}

.schedule-item-info {
    font-size: 0.813rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.schedule-item-info .highlight {
    color: var(--primary-red);
    font-weight: 600;
}

/* チェックボックス */
.task-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--primary-red);
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    cursor: pointer;
}

.task-checkbox.completed {
    background: var(--primary-red);
    position: relative;
}

.task-checkbox.completed::after {
    content: '✓';
    color: var(--white);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 小さいスケジュール */
.schedule-item.small {
    padding: 0.813rem;
    min-height: 65px;
}

.schedule-item.small .schedule-item-title {
    font-size: 0.925rem;
}

.schedule-item.small .schedule-item-time {
    font-size: 0.75rem;
}

.schedule-item.tiny {
    padding: 0.75rem;
    min-height: 60px;
}

.schedule-item.tiny .schedule-item-title {
    font-size: 0.875rem;
}

.schedule-item.tiny .schedule-item-time {
    font-size: 0.7rem;
}

/* インボックスセクション */
.timeline-inbox-section {
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inbox-count {
    background-color: var(--primary-red);
    color: var(--white);
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
}

.inbox-item {
    padding: 0.5rem 0.75rem;
    background-color: var(--gray-100);
    border-radius: 0.625rem;
    border-left: 3px solid var(--gray-400);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.inbox-item:hover {
    background-color: var(--gray-200);
    box-shadow: var(--shadow);
    transform: translateX(8px);
}

.inbox-item-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.inbox-item-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* 優先度カラー */
.inbox-item.priority-high {
    border-left-color: #991B1B;
}

.inbox-item.priority-medium {
    border-left-color: #4B5563;
}

.inbox-item.priority-low {
    border-left-color: #9CA3AF;
}

/* 現在時刻インジケーター */
.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-red);
    z-index: 100;
    pointer-events: none;
    display: none;
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    left: 8.75rem;
    top: -4px;
    width: 10px;
    height: 10px;
    background-color: var(--primary-red);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(139, 21, 56, 0.5);
}

/* タイムラインフィールド（モーダル内） */
.timeline-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-200);
}

/* 所要時間：クイックボタン + 〇時間〇分ドロップダウン */
.duration-quick-btns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.duration-quick-btn {
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-quick-btn:hover {
    border-color: var(--primary-red);
    background: rgba(139, 21, 56, 0.08);
    color: var(--primary-red);
}

.duration-custom-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.duration-custom-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-right: 0.25rem;
}

.duration-dropdown {
    width: auto;
    min-width: 3.5rem;
    padding: 0.5rem 0.5rem;
}

.duration-unit {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* クイック追加モーダル */
.modal-small {
    max-width: 400px;
}

/* 追加方法選択・予定のみモーダル */
.action-btn-schedule {
    border-color: var(--primary-red-light);
    color: var(--primary-red-light);
}

.action-btn-schedule:hover {
    background-color: var(--primary-red-light);
    color: var(--white);
}

.action-btn-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.action-btn:hover .action-btn-desc {
    color: rgba(255, 255, 255, 0.8);
}

.duration-all-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.duration-all-row .duration-quick-btn {
    flex-shrink: 0;
}

.duration-all-row .duration-dropdown {
    width: auto;
    min-width: 3rem;
}

.quick-add-info {
    padding: 0.75rem;
    background-color: rgba(139, 21, 56, 0.1);
    border-radius: 1.25rem;
    text-align: center;
    color: var(--primary-red);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    font-weight: 600;
}

/* タスク追加ボタン */
.add-task-button {
    background: rgba(139, 21, 56, 0.1);
    border: none;
    border-radius: 1.25rem;
    padding: 0.625rem 1rem;
    color: var(--primary-red);
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 4.688rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-task-button:hover {
    background: rgba(139, 21, 56, 0.15);
    transform: translateY(-2px);
}

/* タイムライン用レスポンシブ */
@media (max-width: 768px) {
    .date-header {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .date-label {
        font-size: 1.125rem;
    }
    
    .timeline-container {
        flex-direction: column;
        min-height: 400px;
        padding: 1rem;
    }
    
    .timeline-main-area {
        width: 100%;
        min-height: 400px;
        max-height: none;
    }
    
    .timeline-inbox-area {
        width: 100%;
        margin-top: 1rem;
    }
    
    .timeline-labels {
        width: 45px;
    }
    
    .time-label {
        font-size: 0.75rem;
        padding-top: 0.25rem;
        height: 70px;
    }
    
    .timeline-slot {
        height: 70px;
    }
    
    .schedule-item {
        padding: 0.813rem;
        min-height: 65px;
    }
    
    /* タスクベースレイアウトのモバイル用 */
    .timeline-grid.timeline-task-based {
        gap: 0;
    }
    
    .icon-circle {
        width: 38px;
        height: 38px;
        font-size: 1.125rem;
    }
    
    .task-time {
        font-size: 0.75rem;
    }
    
    .task-title {
        font-size: 0.9375rem;
    }
    
    .timeline-left {
        width: 48px;
    }
    
    .timeline-right {
        padding-bottom: 20px;
    }
    
    .timeline-gap-block {
        min-height: 24px;
    }
}

@media (max-width: 480px) {
    .date-nav-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .today-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .timeline-slot {
        height: 65px;
    }
    
    .time-label {
        height: 65px;
    }
    
    .schedule-item {
        padding: 0.75rem;
        min-height: 60px;
    }
    
    .schedule-item-title {
        font-size: 0.875rem;
    }
    
    .schedule-item-time {
        font-size: 0.75rem;
    }
}

/* ========== リスト画面（iPhoneリマインダー風） ========== */
.lists-container {
    display: flex;
    gap: 1.5rem;
    min-height: 500px;
    background: var(--white);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.lists-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--gray-200);
    padding-right: 1rem;
}

.lists-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.lists-sidebar-header .lists-sidebar-title {
    margin-bottom: 0;
}

.lists-sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lists-sidebar .btn-small {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.lists-sidebar-list {
    list-style: none;
}

.lists-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.lists-sidebar-item:hover {
    background: var(--gray-100);
}

.lists-sidebar-item.active {
    background: var(--primary-red);
    color: white;
}

.lists-sidebar-item.active .lists-sidebar-name {
    color: white;
    font-weight: 600;
}

.lists-sidebar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lists-sidebar-name {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.lists-sidebar-edit {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.2s;
}

.lists-sidebar-edit:hover {
    background: var(--gray-200);
    color: var(--gray-700);
    opacity: 1;
}

.lists-sidebar-item.active .lists-sidebar-edit {
    color: rgba(255, 255, 255, 0.9);
}

.lists-sidebar-item.active .lists-sidebar-edit:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lists-main {
    flex: 1;
    min-width: 0;
}

.lists-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--gray-400);
    font-size: 1rem;
}

.lists-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.lists-header .view-title {
    display: block;
    font-size: 1.5rem;
    margin: 0;
}

.list-items-container {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.list-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    transition: background 0.2s;
}

.list-item-row:hover {
    background: var(--gray-100);
}

.list-item-row.completed .list-item-title {
    text-decoration: line-through;
    color: var(--gray-500);
}

.list-item-row.list-item-fadeout {
    animation: list-item-fadeout 2s ease-out forwards;
    pointer-events: none;
}

@keyframes list-item-fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.list-item-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.list-item-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.list-item-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.list-item-checkbox input:checked + .list-item-checkmark {
    background: var(--item-color, var(--primary-red));
    border-color: var(--item-color, var(--primary-red));
    color: white;
}

.list-item-checkbox input:checked + .list-item-checkmark::after {
    content: '✓';
    font-size: 0.75rem;
    font-weight: bold;
}

.list-item-title {
    flex: 1;
    font-size: 1rem;
    color: var(--gray-800);
}

.list-item-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.list-item-delete:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.list-item-add-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.list-item-add-row .form-input {
    flex: 1;
}

.lists-mobile-toggle {
    display: none;
}

/* ========== 設定画面 ========== */
.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-card {
    max-width: 500px;
}

.settings-desc,
.settings-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.settings-nav-order {
    list-style: none;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-order-btns {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.settings-order-btn {
    width: 28px;
    height: 24px;
    border: none;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 0.25rem;
    padding: 0;
    line-height: 1;
}

.settings-order-btn:hover:not(:disabled) {
    background: var(--primary-red);
    color: white;
}

.settings-order-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.settings-toggle input {
    position: absolute;
    opacity: 0;
}

.settings-toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.settings-toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.settings-toggle input:checked + .settings-toggle-slider {
    background: var(--primary-red);
}

.settings-toggle input:checked + .settings-toggle-slider::after {
    transform: translateX(20px);
}

.settings-nav-label {
    flex: 1;
    font-size: 1rem;
    color: var(--gray-800);
}

.settings-theme-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.settings-notification-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.settings-notification-status {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.theme-color-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-color-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.theme-color-btn.active {
    border-color: var(--theme-primary, var(--primary-red));
    background: var(--gray-50);
    box-shadow: 0 0 0 1px var(--theme-primary, var(--primary-red));
}

.theme-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--theme-primary, var(--primary-red));
}

.theme-color-label {
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* ========== リスト画面・モバイル最適化 ========== */
@media (max-width: 768px) {
    .lists-container {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
        gap: 0;
        position: relative;
    }
    
    /* サイドバー：モバイルではドロワー（トグルで表示） */
    .lists-sidebar {
        display: none;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        background: var(--white);
        border-radius: 0.75rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        max-height: 70vh;
        overflow-y: auto;
        padding: 1rem;
        border: none;
    }
    
    .lists-container.sidebar-open .lists-sidebar {
        display: block;
    }
    
    .lists-sidebar-header {
        margin-bottom: 0.75rem;
    }
    
    .lists-sidebar .btn-small {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    .lists-sidebar-item {
        padding: 0.75rem 1rem;
        min-height: 48px;
    }
    
    /* リスト切り替えボタン（モバイルのみ表示） */
    .lists-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.875rem 1rem;
        margin-bottom: 1rem;
        border: 2px solid var(--gray-200);
        border-radius: 0.75rem;
        background: var(--white);
        font-size: 1rem;
        color: var(--gray-800);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .lists-mobile-toggle:active {
        background: var(--gray-50);
    }
    
    .lists-mobile-toggle-icon {
        color: var(--gray-500);
        font-size: 0.75rem;
    }
    
    .lists-main {
        flex: 1;
        min-height: 300px;
    }
    
    .lists-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .lists-header .view-title {
        font-size: 1.25rem;
        flex: 1;
        min-width: 0;
        word-break: break-word;
        white-space: normal;
    }
    
    .lists-header .btn-add-item {
        min-height: 44px;
        min-width: 80px;
        padding: 0.625rem 1rem;
        flex-shrink: 0;
    }
    
    .list-item-row {
        padding: 0.4rem 0.6rem;
        min-height: 40px;
        gap: 0.5rem;
    }
    
    .list-item-checkmark {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .list-item-title {
        font-size: 0.9rem;
    }
    
    .list-item-delete {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 1rem;
    }
    
    .list-items-container {
        gap: 0.15rem;
    }
    
    .list-item-add-row {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-bottom: env(safe-area-inset-bottom, 1rem);
    }
    
    .list-item-add-row .form-input {
        min-height: 48px;
        font-size: 16px;
        padding: 0.75rem 1rem;
    }
    
    .list-item-add-row .btn-primary {
        min-height: 48px;
        width: 100%;
    }
    
    .lists-empty {
        min-height: 200px;
        padding: 2rem 1rem;
    }
}
