:root {
    --app-bg: #0d1117;
    --surface: #171e27;
    --surface-raised: #202a36;
    --border: #344152;
    --text: #f4f7fb;
    --muted: #b3c0cd;
    --accent: #65a9ff;
    --accent-strong: #3c8dff;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

html, body { min-height: 100%; }
body { margin: 0; background: var(--app-bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a, .btn-link { color: #8dc0ff; }
a:hover, .btn-link:hover { color: #bddaff; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at top, #172338 0, var(--app-bg) 38rem); }
.page-container { width: 100%; max-width: 680px; margin: 0 auto; padding: 16px; }
.page-container h1 { margin: 8px 0 24px; font-size: clamp(1.6rem, 6vw, 2rem); }
.page-header { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.header-actions { display: flex; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.project-card { cursor: pointer; margin-bottom: 16px; transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.project-card:hover { background: var(--surface-raised); border-color: #567092; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.3); }
.project-card:active { transform: translateY(0); }
.project-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.text-muted, .form-hint { color: var(--muted) !important; }
.form-hint { margin: 8px 0 16px; font-size: .875rem; line-height: 1.45; }
.form-label { margin-bottom: 8px; font-weight: 600; }
.form-control, .form-select { min-height: 44px; background: var(--surface); border-color: var(--border); border-radius: var(--radius); color: var(--text); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
textarea.form-control { min-height: 120px; }
.form-control:focus, .form-select:focus { background: var(--surface-raised); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(101,169,255,.2); }
.btn { min-height: 44px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: var(--accent-strong); --bs-btn-border-color: var(--accent-strong); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong); }
.icon-button { width: 44px; min-width: 44px; height: 44px; padding: 0; }
.icon-button i { font-size: 1.1rem; }
.action-button { width: 100%; }
.back-button { justify-content: center; }
.model-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.task-progress { height: 8px; border-radius: 999px; background: #293647; overflow: hidden; }
.progress-bar { background: var(--accent-strong); transition: width .3s ease; }
.progress-summary { display: flex; justify-content: flex-end; margin-bottom: 8px; color: var(--muted); font-size: .875rem; }
.task-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.task-row input[type="checkbox"], .book-toggle input { width: 22px; height: 22px; accent-color: var(--accent-strong); transition: transform .15s ease; }
.task-row input[type="checkbox"]:active, .book-toggle input:active { transform: scale(.85); }
.task-title { flex: 1 1 150px; }
.task-complete { color: var(--muted); text-decoration: line-through; transition: color .2s ease; }
.add-task-row { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.floating-action-button { position: fixed; right: 24px; bottom: 24px; z-index: 10; width: 56px; min-width: 56px; height: 56px; padding: 0; border-radius: 50%; box-shadow: 0 12px 28px rgba(0, 0, 0, .48); }
.floating-action-button i { font-size: 1.25rem; }
.book-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 16px; color: var(--text); cursor: pointer; }
.book-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #4974a7; border-radius: 999px; color: #b9d8ff; font-size: .75rem; white-space: nowrap; }
.book-title-icon { color: #b9d8ff; font-size: .9em; }
.loading-stack { display: grid; gap: 16px; }
.skeleton-card, .skeleton-line { border-radius: var(--radius); background: linear-gradient(90deg, #1b2530 25%, #2b3948 50%, #1b2530 75%); background-size: 200% 100%; animation: shimmer 1.25s infinite; }
.skeleton-card { height: 132px; border: 1px solid var(--border); }
.skeleton-line { height: 20px; margin-bottom: 16px; }
.skeleton-title { width: 62%; height: 34px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (min-width: 576px) {
    .page-container { padding: 24px; }
    .page-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .add-task-row { flex-direction: row; }
    .add-task-row .form-control { flex: 1; }
    .add-task-row .btn { width: auto; min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
