/* ==========================================
   CSS VARIABLES (Deep Cyberpunk Neon Theme)
   ========================================== */
:root {
    --bg-color: #07080b;           
    --card-bg: #0f121a; 
    --card-border: #1d2333; 
    
    --text-primary: #ffffff;
    --text-secondary: #8b9bb4;
    --text-tertiary: #505d76;
    
    --neon-green: #2EF9B6;
    --neon-purple: #9D4EDD; 
    --neon-pink: #FF2DAA;
    --neon-red: #FF2E63;
    --neon-yellow: #F9ED69;
    --neon-cyan: #00E5FF;

    --accent-color: var(--neon-cyan);       
    --accent-glow: rgba(0, 229, 255, 0.7);
    
    --success-color: var(--neon-green);      
    --success-bg: rgba(46, 249, 182, 0.1);
    --success-border: rgba(46, 249, 182, 0.4);
    
    --danger-color: var(--neon-red);       
    --danger-bg: rgba(255, 46, 99, 0.1);
    --danger-border: rgba(255, 46, 99, 0.4);

    /* ドットフォント(DotGothic16)のみに統一 */
    --font-primary: 'DotGothic16', sans-serif;
    --font-display: 'DotGothic16', sans-serif;
    --border-radius: 8px;          
    --border-radius-sm: 4px;
    --transition-speed: 0.2s;
    
    --text-neon-glow: 0 0 2px #fff, 0 0 8px rgba(0, 229, 255, 0.8), 0 0 15px rgba(0, 229, 255, 0.5); 
    --text-neon-magenta: 0 0 2px #fff, 0 0 8px var(--neon-pink), 0 0 15px rgba(255, 45, 170, 0.5);
}

/* ==========================================
   BASE STYLES & PC FIXED LAYOUT
   ========================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--bg-color); 
    color: var(--text-primary); 
    font-family: var(--font-primary); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased; 
    position: fixed;
    inset: 0;
    width: 100%; height: 100%;
    overflow: hidden; 
}

input, select, textarea, button {
    font-family: var(--font-primary) !important;
    letter-spacing: 0.05em;
}

h1, h2, h3, .stat-value {
    color: #ffffff;
    text-shadow: var(--text-neon-glow);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 900;
    -webkit-text-stroke: 0.5px currentColor;
}

.wish-title, .workout-name, .task-name-text, .weight-table td, .day-dot {
    color: #ffffff;
    text-shadow: var(--text-neon-glow);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 900;
}

.app-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    padding: 92px 20px 20px; 
    gap: 16px; 
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.app-header { 
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    display: flex; justify-content: space-between; align-items: center; 
    padding: 0 24px; z-index: 1000;
    background-color: rgba(7, 8, 11, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 45, 170, 0.6); 
    box-shadow: 0 4px 15px rgba(255, 45, 170, 0.3); 
}
.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-icon { 
    font-size: 30px; 
    background: linear-gradient(180deg, #00E5FF, #B200FF);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(178, 0, 255, 0.6));
}
.logo-text h1 { 
    font-family: var(--font-display); font-size: 20px; letter-spacing: 1.5px; 
    line-height: 1.1; 
}
.wallet-card { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.wallet-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); text-shadow: none; }
.wallet-amount { 
    font-family: var(--font-display); 
    font-size: 22px; 
    color: #ffffff; /* ロゴに合わせて白ベースに */
    letter-spacing: 0.5px; 
    /* ロゴの発光感と統一 */
    text-shadow: 0 0 5px #ffffff, 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
}

/* SVG ICONS */
.nav-icon { width: 24px; height: 24px; fill: var(--text-secondary); transition: 0.2s; }
.cyber-icon { width: 18px; height: 18px; fill: currentColor; transition: 0.2s; }
.btn-icon-edit, .btn-icon-edit svg { color: var(--success-color); fill: var(--success-color); }
.btn-icon-edit:hover { filter: drop-shadow(0 0 8px var(--success-color)); }
.btn-icon-delete, .btn-icon-delete svg { color: var(--danger-color); fill: var(--danger-color); transition: 0.2s; }
.btn-icon-delete:hover { filter: drop-shadow(0 0 8px var(--danger-color)); }

/* NAVIGATION */
.app-nav { 
    display: flex; background: rgba(15, 18, 26, 0.6);
    border: 1px solid var(--card-border); border-radius: var(--border-radius); 
    padding: 6px; gap: 6px; overflow-x: auto; 
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05), 0 4px 15px rgba(0,0,0,0.8);
    margin-bottom: 8px; flex-shrink: 0;
}
.nav-btn { 
    flex: 1; background: none; border: none; padding: 12px 16px; 
    font-family: var(--font-primary); font-size: 14px; font-weight: 600; 
    color: var(--text-secondary); cursor: pointer; border-radius: var(--border-radius-sm); 
    transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; 
}
.nav-btn span { display: inline; font-size: 13px; font-family: var(--font-primary); text-shadow: none; color: var(--text-secondary); }
.nav-btn:hover { background-color: rgba(255, 45, 170, 0.1); }
.nav-btn.active { 
    background-color: rgba(255, 45, 170, 0.15); color: #fff; 
    border: 1px solid rgba(255, 45, 170, 0.4); 
    box-shadow: inset 0 0 10px rgba(255, 45, 170, 0.5), 0 0 10px rgba(255, 45, 170, 0.5); 
}
.nav-btn.active span { color: #fff; text-shadow: var(--text-neon-magenta); }
.nav-btn.active .nav-icon { fill: #fff; filter: drop-shadow(0 0 8px var(--neon-pink)); }

/* ==========================================
   SCROLLABLE INTERNAL LAYOUTS
   ========================================== */
.main-layout { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.tab-content { flex: 1; display: none; flex-direction: column; overflow: hidden; }
.tab-content.active { display: flex; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; flex: 1; overflow: hidden; }
.weight-view-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; flex: 1; overflow: hidden; }

/* FIX: スクロールできるように overflow-y: auto に変更 */
.settings-grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; flex: 1; overflow-y: auto; overflow-x: hidden; }

.weight-sidebar { display: flex; flex-direction: column; gap: 24px; height: 100%; overflow: hidden; }

.card { 
    background: rgba(15, 18, 26, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 229, 255, 0.4); 
    border-radius: var(--border-radius); 
    padding: 20px; display: flex; flex-direction: column; gap: 16px; 
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1), 0 0 15px rgba(0, 229, 255, 0.15); 
    flex: 1; overflow: hidden; 
}
.weight-input-card { flex: none; }

.task-list, .menu-list, .wishlist-container, .weight-history-table-wrapper, .settings-grid { 
    flex: 1; overflow-y: auto; padding-right: 8px; 
}
.task-list { max-height: none; } 

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 229, 255, 0.05); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.4); border-radius: 3px; box-shadow: 0 0 5px var(--neon-cyan); }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* ==========================================
   COMPONENTS
   ========================================== */
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; }
.card-header h2 { font-size: 15px; letter-spacing: 1px; position: relative; padding-left: 12px; }
.card-header h2::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; background-color: var(--neon-pink); border-radius: 2px; box-shadow: 0 0 10px var(--neon-pink); }
.date-badge { font-size: 11px; font-weight: 800; color: #fff; text-shadow: var(--text-neon-glow); background-color: rgba(0, 229, 255, 0.1); padding: 4px 12px; border-radius: 20px; border: 1px solid var(--neon-cyan); box-shadow: inset 0 0 8px rgba(0,229,255,0.3); }
.no-data-msg { color: var(--text-secondary); font-size: 13px; text-align: center; padding: 30px 10px; border: 1px dashed var(--text-tertiary); border-radius: var(--border-radius-sm); width: 100%; text-shadow: none; }

.chart-toggle-group { display: flex; gap: 8px; margin-top: 8px; }
.chart-toggle { padding: 4px 14px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: var(--font-primary); background-color: transparent; color: var(--text-secondary); border: 1px solid var(--text-tertiary); cursor: pointer; transition: 0.2s; }
.chart-toggle:hover { color: var(--text-primary); border-color: var(--text-secondary); text-shadow: var(--text-neon-glow); }
.chart-toggle.active { background-color: rgba(0, 229, 255, 0.15); color: #fff; text-shadow: 0 0 8px var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }

/* --- CALENDAR CELL REDESIGN --- */
.calendar-card { display: flex; flex-direction: column; }
.calendar-wrapper { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding-bottom: 6px; border-bottom: 1px solid var(--card-border); flex-shrink: 0; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); gap: 6px; flex: 1; min-height: 0; }

.calendar-day { 
    width: 100%; height: 100%; min-height: 35px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding-top: 6px; 
    background-color: rgba(0, 229, 255, 0.03); 
    border: 2px solid rgba(0, 229, 255, 0.05); 
    border-radius: 6px; font-size: 13px; font-weight: 600; 
    cursor: pointer; position: relative; transition: 0.2s; 
    text-shadow: none; color: var(--text-secondary); 
}
.calendar-day.is-past { opacity: 0.6; }
.calendar-day.is-future { color: #fff; text-shadow: 0 0 5px rgba(0, 229, 255, 0.6), 0 0 8px rgba(0, 229, 255, 0.3); }

.day-dots-container { position: absolute; bottom: 4px; display: flex; gap: 4px; justify-content: center; width: 100%; }
.task-dot { width: 5px; height: 5px; border-radius: 50%; }
.dot-normal { background-color: var(--neon-yellow); box-shadow: 0 0 4px rgba(249, 237, 105, 0.8); }
.dot-bonus { background-color: #ffffff; box-shadow: 0 0 4px rgba(255, 255, 255, 0.8); }

.calendar-day.bg-completed { background-color: rgba(46, 249, 182, 0.15) !important; border-color: var(--neon-green) !important; color: #fff; text-shadow: 0 0 5px var(--neon-green); }
.calendar-day.bg-partial { background-color: rgba(255, 45, 170, 0.15) !important; border-color: var(--neon-pink) !important; color: #fff; text-shadow: 0 0 5px var(--neon-pink); }
.calendar-day.bg-penalty { background-color: rgba(255, 46, 99, 0.15) !important; border-color: var(--neon-red) !important; color: #fff; }
.calendar-day.other-month { color: var(--text-tertiary); opacity: 0.3; }

.calendar-day.state-today { 
    border-color: rgba(0, 229, 255, 0.5) !important; 
    box-shadow: inset 0 0 4px rgba(0, 229, 255, 0.2), 0 0 3px rgba(0, 229, 255, 0.3) !important; 
    color: #fff !important; 
    text-shadow: 0 0 3px var(--neon-cyan); 
    font-weight: 800; 
}
.calendar-day.state-selected { 
    border-color: rgba(255, 255, 255, 0.6) !important; 
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.4), inset 0 0 3px rgba(255,255,255,0.1) !important; 
    color: #fff; 
    text-shadow: 0 0 4px #fff; 
    z-index: 2; 
}

.calendar-legend { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-box { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.btn { font-family: var(--font-primary); font-size: 12px; font-weight: 700; padding: 8px 16px; border-radius: var(--border-radius-sm); border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s ease; letter-spacing: 0.5px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(90deg, #7C4DFF, #00E5FF); color: #ffffff; text-shadow: 0 0 5px rgba(255,255,255,0.8); box-shadow: 0 0 12px rgba(0, 229, 255, 0.4); border: 1px solid var(--neon-cyan); }
.btn-primary:hover { box-shadow: 0 0 20px rgba(0, 229, 255, 0.8); }
.btn-secondary { background-color: rgba(0, 229, 255, 0.05); color: var(--neon-cyan); border: 1px solid rgba(0, 229, 255, 0.3); text-shadow: 0 0 5px rgba(0, 229, 255, 0.5); }
.btn-secondary:hover { background-color: rgba(0, 229, 255, 0.15); box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); color: #fff; text-shadow: var(--text-neon-glow); }
.btn-danger { background-color: transparent; color: var(--danger-color); border: 1px solid rgba(255, 46, 99, 0.4); text-shadow: 0 0 5px rgba(255, 46, 99, 0.5); }
.btn-danger:hover { background-color: rgba(255, 46, 99, 0.1); box-shadow: 0 0 10px rgba(255, 46, 99, 0.4); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-xs { padding: 4px 8px; font-size: 10px; }

.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); background-color: rgba(0, 229, 255, 0.05); border-radius: var(--border-radius-sm); padding: 12px; border: 1px solid rgba(0, 229, 255, 0.2); text-align: center; flex-shrink: 0; }
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-item:not(:last-child) { border-right: 1px solid rgba(0, 229, 255, 0.2); }
.stat-label { font-size: 10px; color: var(--text-secondary); letter-spacing: 0.5px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { background-color: rgba(0, 0, 0, 0.3); border: 1px solid rgba(0, 229, 255, 0.15); border-radius: var(--border-radius-sm); padding: 12px 16px; display: flex; align-items: center; transition: 0.2s; }
.task-item.completed { border-color: var(--neon-green); background-color: rgba(46, 249, 182, 0.05); box-shadow: inset 0 0 10px rgba(46, 249, 182, 0.1); }
.task-item.penalty { border-color: rgba(255, 46, 99, 0.3); background-color: transparent; opacity: 0.5; }
.checkbox-container { display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; user-select: none; }
.checkbox-container input { display: none; }
.checkmark { flex-shrink: 0; width: 18px; height: 18px; border: 1.5px solid var(--card-border); border-radius: 4px; display: inline-block; position: relative; transition: 0.2s; box-shadow: 0 0 5px rgba(0, 229, 255, 0.2); }
.checkbox-container:hover input ~ .checkmark { border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0, 229, 255, 0.6); }
.checkbox-container input:checked ~ .checkmark { background-color: rgba(46, 249, 182, 0.2); border-color: var(--neon-green); box-shadow: 0 0 12px rgba(46, 249, 182, 0.6); }
.checkbox-container input:checked ~ .checkmark::after { content: ''; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); filter: drop-shadow(0 0 3px #fff); }

.task-details { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.task-name-group { display: flex; flex-direction: column; gap: 2px; }
.task-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-name-text { display: flex; align-items: center; }

.checkbox-container input:checked ~ .task-details .task-name-group .task-name-row .task-name-text { 
    text-decoration: line-through; 
    color: var(--text-secondary); 
    text-shadow: none; 
}

.task-desc { font-size: 11px; color: var(--text-secondary); font-weight: normal; line-height: 1.3; text-shadow: none; }
.task-meta { font-size: 11px; color: var(--text-tertiary); }
.penalty-badge { background-color: rgba(255, 46, 99, 0.1); color: var(--danger-color); border: 1px solid rgba(255, 46, 99, 0.4); padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-left: auto; letter-spacing: 0.5px; text-shadow: 0 0 5px rgba(255, 46, 99, 0.6); }

.badge-bonus {
    background: transparent; color: #fff; border: 1px solid var(--neon-pink); padding: 2px 6px; font-size: 10px !important; font-weight: 800; border-radius: 4px; text-shadow: var(--text-neon-magenta); box-shadow: inset 0 0 8px rgba(255, 45, 170, 0.5), 0 0 8px rgba(255, 45, 170, 0.5); animation: neon-flash 2s infinite alternate;
}
@keyframes neon-flash { 0% { box-shadow: inset 0 0 5px rgba(255, 45, 170, 0.3), 0 0 5px rgba(255, 45, 170, 0.3); border-color: rgba(255,45,170,0.5); } 100% { box-shadow: inset 0 0 15px var(--neon-pink), 0 0 20px var(--neon-pink); border-color: #fff; } }

.wish-item { background-color: rgba(0, 0, 0, 0.3); border: 1px solid rgba(0, 229, 255, 0.15); border-radius: var(--border-radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: 0.3s; }
.wish-item.achieved-glow { border-color: var(--neon-green); box-shadow: inset 0 0 15px rgba(46, 249, 182, 0.1), 0 0 15px rgba(46, 249, 182, 0.2); }
.wish-item-top { display: flex; justify-content: space-between; align-items: center; }
.wish-price { font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--neon-cyan); text-shadow: var(--text-neon-glow); transition: 0.3s; }
.wish-item.achieved-glow .wish-price { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }
.wish-progress-bar-bg { height: 6px; background-color: rgba(0, 229, 255, 0.05); border-radius: 3px; overflow: hidden; border: 1px solid rgba(0, 229, 255, 0.1); }
.wish-progress-bar { height: 100%; background-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); width: 0%; transition: width 0.5s ease-out, background-color 0.3s; }
.wish-progress-bar.achieved { background-color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); }
.wish-item-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.wish-percent { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.5px; transition: 0.3s;}
.wish-item.achieved-glow .wish-percent { color: var(--neon-green); font-weight: bold; text-shadow: 0 0 5px var(--neon-green); }
.wish-actions-btn-group { display: flex; gap: 10px; align-items: center; }
.wish-btn-delete { background: none; border: none; padding: 4px; cursor: pointer; color: var(--danger-color); transition: 0.2s; }
.wish-btn-delete:hover { filter: drop-shadow(0 0 8px var(--danger-color)); }

/* WEIGHT VIEW */
.weight-history-table-wrapper { position: relative; }
.weight-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.weight-table th, .weight-table td { text-align: center; }
.weight-table th { position: sticky; top: 0; background-color: var(--card-bg); z-index: 10; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.5px; padding: 6px 4px; font-size: 11px; border-bottom: 1px solid var(--card-border); text-shadow: none; }
.weight-table th:nth-child(1) { width: 45%; }
.weight-table th:nth-child(2) { width: 35%; }
.weight-table th:nth-child(3) { width: 20%; }
.weight-table td { padding: 6px 4px; border-bottom: 1px solid rgba(0, 229, 255, 0.05); white-space: nowrap; font-size: 12px; }

.btn-delete-weight, .btn-delete-weight svg { border: none !important; background: transparent !important; box-shadow: none !important; cursor: pointer; padding: 4px; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; color: var(--danger-color); fill: var(--danger-color); }
.btn-delete-weight:hover { filter: drop-shadow(0 0 5px var(--danger-color)); }
.weight-form-inline { display: flex; gap: 16px; align-items: stretch; width: 100%; }
.weight-form-inline input { background-color: rgba(0,0,0,0.5); border: 1px solid var(--card-border); border-radius: 4px; color: var(--text-primary); padding: 10px 12px; font-family: var(--font-primary); font-size: 13px; width: 100%; transition: 0.2s; }
.weight-form-inline input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }

.workout-item { background-color: rgba(0, 0, 0, 0.3); border: 1px solid rgba(0, 229, 255, 0.15); border-radius: var(--border-radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.workout-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.workout-item-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.workout-item .badge-bonus { flex-shrink: 0; margin-left: auto; align-self: flex-start; }
.workout-actions { display: flex; gap: 12px; align-items: center; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; }
.workout-item-details { font-size: 11px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; letter-spacing: 0.3px; }
.workout-item-days { display: flex; gap: 6px; }
.day-dot { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; background-color: rgba(0, 229, 255, 0.05); border: 1px solid rgba(0, 229, 255, 0.2); color: var(--text-secondary); text-shadow: none; }
.day-dot.active { background-color: rgba(124, 77, 255, 0.2); color: #fff; border-color: var(--neon-purple); box-shadow: 0 0 10px rgba(124, 77, 255, 0.5); text-shadow: 0 0 5px var(--neon-purple); }

.settings-group { display: flex; flex-direction: column; gap: 6px; }
.settings-group label { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.5px; }
.settings-group input, .settings-group select { background-color: rgba(0,0,0,0.5); border: 1px solid var(--card-border); border-radius: 4px; color: var(--text-primary); padding: 10px 12px; font-family: var(--font-primary); font-size: 13px; transition: 0.2s; }
.settings-group input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) hue-rotate(180deg) saturate(300%) brightness(150%); cursor: pointer; }
.settings-group input:focus, .settings-group select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
.readonly-value { font-size: 13px; padding: 10px 12px; background-color: transparent; border: 1px dashed var(--card-border); border-radius: 4px; color: #fff; text-shadow: var(--text-neon-glow); }
.bonus-settings-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }

.debug-card { display: none; }
.debug-card.is-visible { display: flex !important; }
.debug-controls { display: flex; flex-direction: column; gap: 4px; }
.debug-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.debug-buttons { display: flex; gap: 4px; }
.debug-status { font-family: monospace; font-size: 11px; color: #fff; text-shadow: var(--text-neon-glow); background-color: rgba(0, 229, 255, 0.1); padding: 8px 12px; border-radius: 4px; border: 1px solid rgba(0, 229, 255, 0.3); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(7, 8, 11, 0.9); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 2000; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--card-bg); border: 1px solid var(--neon-cyan); width: 100%; max-width: 460px; border-radius: var(--border-radius); padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 0 40px rgba(0, 229, 255, 0.2), inset 0 0 20px rgba(0, 229, 255, 0.1); transform: translateY(20px) scale(0.98); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-overlay.open .modal-content { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-header h3 { font-family: var(--font-display); font-size: 17px; color: #ffffff; text-shadow: var(--text-neon-glow); }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 24px; cursor: pointer; transition: 0.2s; line-height: 1; }
.modal-close:hover { color: var(--danger-color); text-shadow: 0 0 10px rgba(255, 46, 99, 0.8); }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-row.mets-row { grid-template-columns: 2fr 1fr; }       
.form-group label { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.5px; }
.form-group input, .form-group select { background-color: rgba(0,0,0,0.5); border: 1px solid var(--card-border); border-radius: 4px; color: var(--text-primary); padding: 10px 12px; font-family: var(--font-primary); font-size: 13px; width: 100%; transition: 0.2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
.day-checkbox-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { cursor: pointer; }
.day-chip input { display: none; }
.day-chip span { display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 4px; background-color: rgba(0, 229, 255, 0.05); border: 1px solid rgba(0, 229, 255, 0.2); font-size: 11px; font-weight: 600; color: var(--text-secondary); transition: 0.2s; }
.day-chip:hover span { border-color: var(--neon-green); box-shadow: 0 0 5px rgba(46, 249, 182, 0.3); color: #fff; text-shadow: 0 0 5px var(--neon-green); }
.day-chip input:checked ~ span { background-color: rgba(124, 77, 255, 0.2); color: #fff; border-color: var(--neon-purple); box-shadow: 0 0 10px rgba(124, 77, 255, 0.5); text-shadow: 0 0 5px var(--neon-purple); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }

/* ==========================================
   LANDSCAPE WARNING OVERLAY
   ========================================== */
#landscape-warning {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color); z-index: 99999;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #fff;
}
.warning-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(15, 18, 26, 0.9); padding: 40px; border: 2px solid var(--neon-pink);
    border-radius: var(--border-radius); box-shadow: 0 0 20px rgba(255, 45, 170, 0.4);
}
#landscape-warning h2 { color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink); margin: 16px 0 12px; letter-spacing: 2px; }
#landscape-warning p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.rotate-icon { width: 64px; height: 64px; fill: var(--neon-cyan); animation: rotate-phone 2s infinite ease-in-out; filter: drop-shadow(0 0 10px var(--neon-cyan)); }
@keyframes rotate-phone { 0% { transform: rotate(-90deg); } 50% { transform: rotate(0deg); } 100% { transform: rotate(-90deg); } }

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media screen and (max-width: 900px) and (orientation: landscape) {
    #landscape-warning { display: flex; }
    .app-container { display: none; }
}

@media (max-width: 600px) {
    body { 
        position: fixed;
        inset: 0;
        width: 100%; height: 100%;
        overflow: hidden; 
    } 
    
    .app-container { 
        position: absolute;
        inset: 0;
        width: 100%; height: 100%;
        padding-top: 90px;  
        padding-bottom: calc(75px + env(safe-area-inset-bottom)); 
        padding-left: 10px; 
        padding-right: 10px; 
        gap: 10px;
    }

    .app-nav {
        position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
        display: flex; flex-direction: row; justify-content: space-around; align-items: center;
        z-index: 1000; margin-bottom: 0; padding: 0; padding-bottom: env(safe-area-inset-bottom);
        background-color: rgba(7, 8, 11, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border: none; border-top: 1px solid rgba(255, 45, 170, 0.6); border-radius: 0;
        box-shadow: 0 -4px 15px rgba(255, 45, 170, 0.3);
    }
        
    .nav-btn {
        flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        padding: 8px 0; width: 20%; background: transparent; border: none !important;
        box-shadow: none !important; border-radius: 0;
    }
    .nav-btn.active { transform: translateY(-2px); background: transparent; }
    .nav-btn span { display: none; } 

    .card { padding: 12px; gap: 10px; }
    
    .dashboard-grid, .weight-view-layout { 
        display: flex; 
        flex-direction: column; 
        height: 100%; 
        gap: 8px; 
    }

    .calendar-card { 
        flex: 0 0 auto; 
        padding: 10px; 
        gap: 6px;
    }
    .calendar-wrapper { padding: 0; gap: 2px; flex: none; height: auto; }
    .calendar-days { gap: 2px; grid-template-rows: auto; }
    
    .calendar-day { 
        font-size: 11px; 
        border-radius: 4px; 
        width: 100%; 
        height: auto; 
        min-height: 28px; 
        justify-content: flex-start; 
        padding-top: 2px; 
        padding-bottom: 8px;
    }
    .day-dots-container { bottom: 2px; gap: 2px; }
    .task-dot { width: 4px; height: 4px; }

    .calendar-legend {
        gap: 6px; 
        font-size: 9px; 
        padding: 0;
        margin-top: 2px;
        justify-content: center;
    }
    .legend-item { gap: 3px; }

    .today-tasks-card { 
        flex: 1 1 0; 
        min-height: 0; 
        display: flex;
        flex-direction: column;
        padding: 10px;
        gap: 8px;
    }
    
    .summary-stats { padding: 6px; flex-shrink: 0; }
    .stat-value { font-size: 14px; }
    .card-header { gap: 8px; flex-shrink: 0; }
    .card-header h2 { font-size: 12px; }

    .task-list {
        flex: 1; 
        overflow-y: auto; 
        margin-right: -4px; 
        padding-right: 4px;
        max-height: none;
    }

    .weight-chart-card { flex: 0.8; min-height: 160px; } 
    .weight-sidebar { flex: 1.2; gap: 12px; }
    .weight-input-card { flex-shrink: 0; }
    .weight-history-card { flex: 1; display: flex; flex-direction: column; }
    .weight-history-table-wrapper { flex: 1; min-height: 120px; overflow-y: auto; font-size: 14px; }
    .weight-table th, .weight-table td { padding: 12px 4px; }
    
    /* FIX: デバッグツールを含めてスクロールできるよう調整 */
    #view-settings .settings-grid-layout { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overflow-x: hidden; height: 100%; padding-bottom: 0px;}
    .settings-card { flex: none; padding: 16px 12px; }
    .settings-grid { display: flex; flex-direction: column; gap: 12px; overflow-x: hidden; }
    .debug-card { flex: none; padding: 10px; gap: 0px; overflow-x: hidden; }
    .settings-group { gap: 6px; }
    .settings-group input, .readonly-value, .settings-group select { padding: 10px 12px; font-size: 13px; width: 100%; box-sizing: border-box; }
    .settings-group label { font-size: 11px; }
    
    .bonus-settings-container { 
        display: grid; grid-template-columns: 1fr 1fr; gap: 12px; 
        margin-top: 8px; width: 100%; box-sizing: border-box; 
    }
    .bonus-settings-container .settings-group:last-child { grid-column: 1 / -1; }

    .debug-buttons { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
    .debug-status { padding: 8px 10px; font-size: 11px; }
    .debug-desc { font-size: 10px; margin-bottom: 0; line-height: 1.4;}
    .settings-group p { margin-bottom: 8px !important; font-size: 10px !important; line-height: 1.4 !important;}
}

/* ロゴの色味変更 (マゼンタ系) */
.logo-text h1 {
    color: #ffffff; /* 文字中心を白に */
    text-shadow: 0 0 5px #ffffff, 0 0 10px #ffffff, 0 0 20px var(--neon-pink), 0 0 30px var(--neon-pink);
    -webkit-text-stroke: transparent; /* ストロークがある場合は調整 */
}

/* カレンダーの日付枠の発光強化 */
.calendar-day.state-today {
    box-shadow: inset 0 0 6px rgba(0, 229, 255, 0.4), 0 0 8px rgba(0, 229, 255, 0.6) !important;
}
.calendar-day.state-selected {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6), inset 0 0 5px rgba(255,255,255,0.3) !important;
}
.calendar-day.bg-completed {
    box-shadow: inset 0 0 6px rgba(46, 249, 182, 0.3), 0 0 8px rgba(46, 249, 182, 0.5) !important;
}

/* 履歴一覧の項目幅均等化 & ゴミ箱アイコン拡大 */
.weight-table th:nth-child(1) { width: 35%; }
.weight-table th:nth-child(2) { width: 35%; }
.weight-table th:nth-child(3) { width: 30%; }
.btn-delete-weight svg { width: 22px; height: 22px; }

/* 専用画面 (カスタムUI) 用のスタイル */
.cyber-btn-select {
    background-color: rgba(0,0,0,0.5);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px 12px;
    font-family: var(--font-primary);
    font-size: 13px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cyber-btn-select:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}
.cyber-btn-select::after {
    content: '▼';
    font-size: 10px;
    color: var(--neon-cyan);
}
.custom-option-list {
    display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; padding-right: 4px;
}
.custom-option-btn {
    background: rgba(0, 229, 255, 0.05); border: 1px solid rgba(0, 229, 255, 0.2); color: #fff;
    padding: 12px; border-radius: 4px; cursor: pointer; text-align: left; font-family: var(--font-primary); transition: 0.2s;
}
.custom-option-btn:hover {
    background: rgba(0, 229, 255, 0.2); border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.cyber-date-input {
    background-color: rgba(0,0,0,0.5); border: 1px solid var(--card-border); border-radius: 4px;
    color: #fff; padding: 10px; font-family: var(--font-primary); font-size: 14px; text-align: center;
}
.cyber-date-input:focus {
    outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}
/* --- デバッグパネルを元の配置に戻す --- */
.debug-card {
    display: none; /* 初期状態は非表示 */
}

.debug-card.is-visible {
    display: flex !important; /* グリッドレイアウトの一部として表示 */
    flex-direction: column;
    position: static;
    background: rgba(15, 18, 26, 0.85);
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1), 0 0 15px rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: var(--border-radius);
    padding: 20px;

    /* 画面に収めるための設定 */
    flex: 1;
    max-height: 100%;      /* 親要素の高さに制限 */
    overflow-y: auto;      /* 内容が溢れた場合のみ内部でスクロール */
}